From 4e8dc934ead9b8b36935eb5ddb2cc7ffd604597d Mon Sep 17 00:00:00 2001 From: aarkue Date: Tue, 11 Jun 2024 13:15:46 +0200 Subject: [PATCH] Update GH Pages --- .../{index-cdacba05.js => index-231a9a61.js} | 59 +++++++++++-------- example/dist/assets/index-6160bb1b.css | 1 + example/dist/assets/index-eeae6c16.css | 1 - example/dist/index.html | 4 +- 4 files changed, 38 insertions(+), 27 deletions(-) rename example/dist/assets/{index-cdacba05.js => index-231a9a61.js} (96%) create mode 100644 example/dist/assets/index-6160bb1b.css delete mode 100644 example/dist/assets/index-eeae6c16.css diff --git a/example/dist/assets/index-cdacba05.js b/example/dist/assets/index-231a9a61.js similarity index 96% rename from example/dist/assets/index-cdacba05.js rename to example/dist/assets/index-231a9a61.js index c604fc5..7951e40 100644 --- a/example/dist/assets/index-cdacba05.js +++ b/example/dist/assets/index-231a9a61.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ml=Symbol.for("react.element"),Q6=Symbol.for("react.portal"),Z6=Symbol.for("react.fragment"),e7=Symbol.for("react.strict_mode"),t7=Symbol.for("react.profiler"),r7=Symbol.for("react.provider"),n7=Symbol.for("react.context"),i7=Symbol.for("react.forward_ref"),s7=Symbol.for("react.suspense"),o7=Symbol.for("react.memo"),l7=Symbol.for("react.lazy"),ap=Symbol.iterator;function a7(r){return r===null||typeof r!="object"?null:(r=ap&&r[ap]||r["@@iterator"],typeof r=="function"?r:null)}var O4={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z4=Object.assign,I4={};function Ws(r,e,t){this.props=r,this.context=e,this.refs=I4,this.updater=t||O4}Ws.prototype.isReactComponent={};Ws.prototype.setState=function(r,e){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,e,"setState")};Ws.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function D4(){}D4.prototype=Ws.prototype;function hd(r,e,t){this.props=r,this.context=e,this.refs=I4,this.updater=t||O4}var pd=hd.prototype=new D4;pd.constructor=hd;z4(pd,Ws.prototype);pd.isPureReactComponent=!0;var up=Array.isArray,R4=Object.prototype.hasOwnProperty,md={current:null},P4={key:!0,ref:!0,__self:!0,__source:!0};function B4(r,e,t){var n,i={},s=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)R4.call(e,n)&&!P4.hasOwnProperty(n)&&(i[n]=e[n]);var l=arguments.length-2;if(l===1)i.children=t;else if(1>>1,ue=V[ce];if(0>>1;cei(Or,X))zri(pr,Or)?(V[ce]=pr,V[zr]=X,ce=zr):(V[ce]=Or,V[hr]=X,ce=hr);else if(zri(pr,X))V[ce]=pr,V[zr]=X,ce=zr;else break e}}return Q}function i(V,Q){var X=V.sortIndex-Q.sortIndex;return X!==0?X:V.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();r.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,f=null,d=3,p=!1,g=!1,v=!1,T=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(V){for(var Q=t(u);Q!==null;){if(Q.callback===null)n(u);else if(Q.startTime<=V)n(u),Q.sortIndex=Q.expirationTime,e(a,Q);else break;Q=t(u)}}function E(V){if(v=!1,S(V),!g)if(t(a)!==null)g=!0,Jt(A);else{var Q=t(u);Q!==null&&Nr(E,Q.startTime-V)}}function A(V,Q){g=!1,v&&(v=!1,x(O),O=-1),p=!0;var X=d;try{for(S(Q),f=t(a);f!==null&&(!(f.expirationTime>Q)||V&&!de());){var ce=f.callback;if(typeof ce=="function"){f.callback=null,d=f.priorityLevel;var ue=ce(f.expirationTime<=Q);Q=r.unstable_now(),typeof ue=="function"?f.callback=ue:f===t(a)&&n(a),S(Q)}else n(a);f=t(a)}if(f!==null)var Ar=!0;else{var hr=t(u);hr!==null&&Nr(E,hr.startTime-Q),Ar=!1}return Ar}finally{f=null,d=X,p=!1}}var z=!1,I=null,O=-1,W=5,K=-1;function de(){return!(r.unstable_now()-KV||125ce?(V.sortIndex=X,e(u,V),t(a)===null&&V===t(u)&&(v?(x(O),O=-1):v=!0,Nr(E,X-ce))):(V.sortIndex=ue,e(a,V),g||p||(g=!0,Jt(A))),V},r.unstable_shouldYield=de,r.unstable_wrapCallback=function(V){var Q=d;return function(){var X=d;d=Q;try{return V.apply(this,arguments)}finally{d=X}}}})(V4);$4.exports=V4;var x7=$4.exports;/** + */(function(r){function e(V,Q){var X=V.length;V.push(Q);e:for(;0>>1,ue=V[ce];if(0>>1;cei(zr,X))Iri(pr,zr)?(V[ce]=pr,V[Ir]=X,ce=Ir):(V[ce]=zr,V[hr]=X,ce=hr);else if(Iri(pr,X))V[ce]=pr,V[Ir]=X,ce=Ir;else break e}}return Q}function i(V,Q){var X=V.sortIndex-Q.sortIndex;return X!==0?X:V.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();r.unstable_now=function(){return o.now()-l}}var a=[],u=[],c=1,f=null,d=3,p=!1,g=!1,v=!1,T=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(V){for(var Q=t(u);Q!==null;){if(Q.callback===null)n(u);else if(Q.startTime<=V)n(u),Q.sortIndex=Q.expirationTime,e(a,Q);else break;Q=t(u)}}function E(V){if(v=!1,S(V),!g)if(t(a)!==null)g=!0,Jt(A);else{var Q=t(u);Q!==null&&Ar(E,Q.startTime-V)}}function A(V,Q){g=!1,v&&(v=!1,x(O),O=-1),p=!0;var X=d;try{for(S(Q),f=t(a);f!==null&&(!(f.expirationTime>Q)||V&&!de());){var ce=f.callback;if(typeof ce=="function"){f.callback=null,d=f.priorityLevel;var ue=ce(f.expirationTime<=Q);Q=r.unstable_now(),typeof ue=="function"?f.callback=ue:f===t(a)&&n(a),S(Q)}else n(a);f=t(a)}if(f!==null)var Or=!0;else{var hr=t(u);hr!==null&&Ar(E,hr.startTime-Q),Or=!1}return Or}finally{f=null,d=X,p=!1}}var z=!1,I=null,O=-1,W=5,K=-1;function de(){return!(r.unstable_now()-KV||125ce?(V.sortIndex=X,e(u,V),t(a)===null&&V===t(u)&&(v?(x(O),O=-1):v=!0,Ar(E,X-ce))):(V.sortIndex=ue,e(a,V),g||p||(g=!0,Jt(A))),V},r.unstable_shouldYield=de,r.unstable_wrapCallback=function(V){var Q=d;return function(){var X=d;d=Q;try{return V.apply(this,arguments)}finally{d=X}}}})(V4);$4.exports=V4;var x7=$4.exports;/** * @license React * react-dom.production.min.js * @@ -30,25 +30,25 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var H4=Ze,_t=x7;function P(r){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+r,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=Object.prototype.hasOwnProperty,k7=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fp={},dp={};function w7(r){return Rc.call(dp,r)?!0:Rc.call(fp,r)?!1:k7.test(r)?dp[r]=!0:(fp[r]=!0,!1)}function S7(r,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function b7(r,e,t,n){if(e===null||typeof e>"u"||S7(r,e,t,n))return!0;if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function vt(r,e,t,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=r,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){rt[r]=new vt(r,0,!1,r,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var e=r[0];rt[e]=new vt(e,1,!1,r[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(r){rt[r]=new vt(r,2,!1,r.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){rt[r]=new vt(r,2,!1,r,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){rt[r]=new vt(r,3,!1,r.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(r){rt[r]=new vt(r,3,!0,r,null,!1,!1)});["capture","download"].forEach(function(r){rt[r]=new vt(r,4,!1,r,null,!1,!1)});["cols","rows","size","span"].forEach(function(r){rt[r]=new vt(r,6,!1,r,null,!1,!1)});["rowSpan","start"].forEach(function(r){rt[r]=new vt(r,5,!1,r.toLowerCase(),null,!1,!1)});var yd=/[\-:]([a-z])/g;function vd(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var e=r.replace(yd,vd);rt[e]=new vt(e,1,!1,r,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var e=r.replace(yd,vd);rt[e]=new vt(e,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(r){var e=r.replace(yd,vd);rt[e]=new vt(e,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(r){rt[r]=new vt(r,1,!1,r.toLowerCase(),null,!1,!1)});rt.xlinkHref=new vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(r){rt[r]=new vt(r,1,!1,r.toLowerCase(),null,!0,!0)});function xd(r,e,t,n){var i=rt.hasOwnProperty(e)?rt[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rc=Object.prototype.hasOwnProperty,k7=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fp={},dp={};function w7(r){return Rc.call(dp,r)?!0:Rc.call(fp,r)?!1:k7.test(r)?dp[r]=!0:(fp[r]=!0,!1)}function S7(r,e,t,n){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:t!==null?!t.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function b7(r,e,t,n){if(e===null||typeof e>"u"||S7(r,e,t,n))return!0;if(n)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function vt(r,e,t,n,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=t,this.propertyName=r,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var rt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){rt[r]=new vt(r,0,!1,r,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var e=r[0];rt[e]=new vt(e,1,!1,r[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(r){rt[r]=new vt(r,2,!1,r.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){rt[r]=new vt(r,2,!1,r,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){rt[r]=new vt(r,3,!1,r.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(r){rt[r]=new vt(r,3,!0,r,null,!1,!1)});["capture","download"].forEach(function(r){rt[r]=new vt(r,4,!1,r,null,!1,!1)});["cols","rows","size","span"].forEach(function(r){rt[r]=new vt(r,6,!1,r,null,!1,!1)});["rowSpan","start"].forEach(function(r){rt[r]=new vt(r,5,!1,r.toLowerCase(),null,!1,!1)});var yd=/[\-:]([a-z])/g;function vd(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var e=r.replace(yd,vd);rt[e]=new vt(e,1,!1,r,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var e=r.replace(yd,vd);rt[e]=new vt(e,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(r){var e=r.replace(yd,vd);rt[e]=new vt(e,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(r){rt[r]=new vt(r,1,!1,r.toLowerCase(),null,!1,!1)});rt.xlinkHref=new vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(r){rt[r]=new vt(r,1,!1,r.toLowerCase(),null,!0,!0)});function xd(r,e,t,n){var i=rt.hasOwnProperty(e)?rt[e]:null;(i!==null?i.type!==0:n||!(2l||i[o]!==s[l]){var a=` -`+i[o].replace(" at new "," at ");return r.displayName&&a.includes("")&&(a=a.replace("",r.displayName)),a}while(1<=o&&0<=l);break}}}finally{hu=!1,Error.prepareStackTrace=t}return(r=r?r.displayName||r.name:"")?ao(r):""}function M7(r){switch(r.tag){case 5:return ao(r.type);case 16:return ao("Lazy");case 13:return ao("Suspense");case 19:return ao("SuspenseList");case 0:case 2:case 15:return r=pu(r.type,!1),r;case 11:return r=pu(r.type.render,!1),r;case 1:return r=pu(r.type,!0),r;default:return""}}function Fc(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case ns:return"Fragment";case rs:return"Portal";case Pc:return"Profiler";case kd:return"StrictMode";case Bc:return"Suspense";case Lc:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case U4:return(r.displayName||"Context")+".Consumer";case _4:return(r._context.displayName||"Context")+".Provider";case wd:var e=r.render;return r=r.displayName,r||(r=e.displayName||e.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Sd:return e=r.displayName||null,e!==null?e:Fc(r.type)||"Memo";case Tn:e=r._payload,r=r._init;try{return Fc(r(e))}catch{}}return null}function T7(r){var e=r.type;switch(r.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=e.render,r=r.displayName||r.name||"",e.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fc(e);case 8:return e===kd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Jn(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function j4(r){var e=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function C7(r){var e=j4(r)?"checked":"value",t=Object.getOwnPropertyDescriptor(r.constructor.prototype,e),n=""+r[e];if(!r.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(r,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(r,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){r._valueTracker=null,delete r[e]}}}}function Rl(r){r._valueTracker||(r._valueTracker=C7(r))}function Y4(r){if(!r)return!1;var e=r._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return r&&(n=j4(r)?r.checked?"true":"false":r.value),r=n,r!==t?(e.setValue(r),!0):!1}function Da(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function $c(r,e){var t=e.checked;return Oe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??r._wrapperState.initialChecked})}function pp(r,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Jn(e.value!=null?e.value:t),r._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function J4(r,e){e=e.checked,e!=null&&xd(r,"checked",e,!1)}function Vc(r,e){J4(r,e);var t=Jn(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&r.value===""||r.value!=t)&&(r.value=""+t):r.value!==""+t&&(r.value=""+t);else if(n==="submit"||n==="reset"){r.removeAttribute("value");return}e.hasOwnProperty("value")?Hc(r,e.type,t):e.hasOwnProperty("defaultValue")&&Hc(r,e.type,Jn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(r.defaultChecked=!!e.defaultChecked)}function mp(r,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+r._wrapperState.initialValue,t||e===r.value||(r.value=e),r.defaultValue=e}t=r.name,t!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,t!==""&&(r.name=t)}function Hc(r,e,t){(e!=="number"||Da(r.ownerDocument)!==r)&&(t==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+t&&(r.defaultValue=""+t))}var uo=Array.isArray;function ys(r,e,t,n){if(r=r.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Pl.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;e.firstChild;)r.appendChild(e.firstChild)}});function _o(r,e){if(e){var t=r.firstChild;if(t&&t===r.lastChild&&t.nodeType===3){t.nodeValue=e;return}}r.textContent=e}var To={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},E7=["Webkit","ms","Moz","O"];Object.keys(To).forEach(function(r){E7.forEach(function(e){e=e+r.charAt(0).toUpperCase()+r.substring(1),To[e]=To[r]})});function Q4(r,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||To.hasOwnProperty(r)&&To[r]?(""+e).trim():e+"px"}function Z4(r,e){r=r.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,i=Q4(t,e[t],n);t==="float"&&(t="cssFloat"),n?r.setProperty(t,i):r[t]=i}}var N7=Oe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Uc(r,e){if(e){if(N7[r]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(P(137,r));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(P(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(P(61))}if(e.style!=null&&typeof e.style!="object")throw Error(P(62))}}function Wc(r,e){if(r.indexOf("-")===-1)return typeof e.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jc=null;function bd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Yc=null,vs=null,xs=null;function vp(r){if(r=vl(r)){if(typeof Yc!="function")throw Error(P(280));var e=r.stateNode;e&&(e=z0(e),Yc(r.stateNode,r.type,e))}}function e2(r){vs?xs?xs.push(r):xs=[r]:vs=r}function t2(){if(vs){var r=vs,e=xs;if(xs=vs=null,vp(r),e)for(r=0;r>>=0,r===0?32:31-($7(r)/V7|0)|0}var Bl=64,Ll=4194304;function co(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function La(r,e){var t=r.pendingLanes;if(t===0)return 0;var n=0,i=r.suspendedLanes,s=r.pingedLanes,o=t&268435455;if(o!==0){var l=o&~i;l!==0?n=co(l):(s&=o,s!==0&&(n=co(s)))}else o=t&~i,o!==0?n=co(o):s!==0&&(n=co(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=t&16),e=r.entangledLanes,e!==0)for(r=r.entanglements,e&=n;0t;t++)e.push(r);return e}function gl(r,e,t){r.pendingLanes|=e,e!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,e=31-br(e),r[e]=t}function U7(r,e){var t=r.pendingLanes&~e;r.pendingLanes=e,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=e,r.mutableReadLanes&=e,r.entangledLanes&=e,e=r.entanglements;var n=r.eventTimes;for(r=r.expirationTimes;0=Eo),Ep=String.fromCharCode(32),Np=!1;function w2(r,e){switch(r){case"keyup":return vy.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S2(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var is=!1;function ky(r,e){switch(r){case"compositionend":return S2(e);case"keypress":return e.which!==32?null:(Np=!0,Ep);case"textInput":return r=e.data,r===Ep&&Np?null:r;default:return null}}function wy(r,e){if(is)return r==="compositionend"||!zd&&w2(r,e)?(r=x2(),pa=Nd=zn=null,is=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-r};r=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Ip(t)}}function C2(r,e){return r&&e?r===e?!0:r&&r.nodeType===3?!1:e&&e.nodeType===3?C2(r,e.parentNode):"contains"in r?r.contains(e):r.compareDocumentPosition?!!(r.compareDocumentPosition(e)&16):!1:!1}function E2(){for(var r=window,e=Da();e instanceof r.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)r=e.contentWindow;else break;e=Da(r.document)}return e}function Id(r){var e=r&&r.nodeName&&r.nodeName.toLowerCase();return e&&(e==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||e==="textarea"||r.contentEditable==="true")}function Oy(r){var e=E2(),t=r.focusedElem,n=r.selectionRange;if(e!==t&&t&&t.ownerDocument&&C2(t.ownerDocument.documentElement,t)){if(n!==null&&Id(t)){if(e=n.start,r=n.end,r===void 0&&(r=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(r,t.value.length);else if(r=(e=t.ownerDocument||document)&&e.defaultView||window,r.getSelection){r=r.getSelection();var i=t.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!r.extend&&s>n&&(i=n,n=s,s=i),i=Dp(t,s);var o=Dp(t,n);i&&o&&(r.rangeCount!==1||r.anchorNode!==i.node||r.anchorOffset!==i.offset||r.focusNode!==o.node||r.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),r.removeAllRanges(),s>n?(r.addRange(e),r.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),r.addRange(e)))}}for(e=[],r=t;r=r.parentNode;)r.nodeType===1&&e.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,ss=null,Zc=null,Ao=null,ef=!1;function Rp(r,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;ef||ss==null||ss!==Da(n)||(n=ss,"selectionStart"in n&&Id(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ao&&Ko(Ao,n)||(Ao=n,n=Va(Zc,"onSelect"),0us||(r.current=lf[us],lf[us]=null,us--)}function ye(r,e){us++,lf[us]=r.current,r.current=e}var Kn={},at=ti(Kn),Tt=ti(!1),Ri=Kn;function Os(r,e){var t=r.type.contextTypes;if(!t)return Kn;var n=r.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return n&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=e,r.__reactInternalMemoizedMaskedChildContext=i),i}function Ct(r){return r=r.childContextTypes,r!=null}function qa(){we(Tt),we(at)}function Hp(r,e,t){if(at.current!==Kn)throw Error(P(168));ye(at,e),ye(Tt,t)}function B2(r,e,t){var n=r.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(P(108,T7(r)||"Unknown",i));return Oe({},t,n)}function _a(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Kn,Ri=at.current,ye(at,r),ye(Tt,Tt.current),!0}function qp(r,e,t){var n=r.stateNode;if(!n)throw Error(P(169));t?(r=B2(r,e,Ri),n.__reactInternalMemoizedMergedChildContext=r,we(Tt),we(at),ye(at,r)):we(Tt),ye(Tt,t)}var en=null,I0=!1,Nu=!1;function L2(r){en===null?en=[r]:en.push(r)}function qy(r){I0=!0,L2(r)}function ri(){if(!Nu&&en!==null){Nu=!0;var r=0,e=he;try{var t=en;for(he=1;r>=o,i-=o,rn=1<<32-br(e)+i|t<O?(W=I,I=null):W=I.sibling;var K=d(x,I,S[O],E);if(K===null){I===null&&(I=W);break}r&&I&&K.alternate===null&&e(x,I),w=s(K,w,O),z===null?A=K:z.sibling=K,z=K,I=W}if(O===S.length)return t(x,I),Me&&fi(x,O),A;if(I===null){for(;OO?(W=I,I=null):W=I.sibling;var de=d(x,I,K.value,E);if(de===null){I===null&&(I=W);break}r&&I&&de.alternate===null&&e(x,I),w=s(de,w,O),z===null?A=de:z.sibling=de,z=de,I=W}if(K.done)return t(x,I),Me&&fi(x,O),A;if(I===null){for(;!K.done;O++,K=S.next())K=f(x,K.value,E),K!==null&&(w=s(K,w,O),z===null?A=K:z.sibling=K,z=K);return Me&&fi(x,O),A}for(I=n(x,I);!K.done;O++,K=S.next())K=p(I,x,O,K.value,E),K!==null&&(r&&K.alternate!==null&&I.delete(K.key===null?O:K.key),w=s(K,w,O),z===null?A=K:z.sibling=K,z=K);return r&&I.forEach(function(xe){return e(x,xe)}),Me&&fi(x,O),A}function T(x,w,S,E){if(typeof S=="object"&&S!==null&&S.type===ns&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Dl:e:{for(var A=S.key,z=w;z!==null;){if(z.key===A){if(A=S.type,A===ns){if(z.tag===7){t(x,z.sibling),w=i(z,S.props.children),w.return=x,x=w;break e}}else if(z.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Tn&&Kp(A)===z.type){t(x,z.sibling),w=i(z,S.props),w.ref=no(x,z,S),w.return=x,x=w;break e}t(x,z);break}else e(x,z);z=z.sibling}S.type===ns?(w=Ei(S.props.children,x.mode,E,S.key),w.return=x,x=w):(E=Sa(S.type,S.key,S.props,null,x.mode,E),E.ref=no(x,w,S),E.return=x,x=E)}return o(x);case rs:e:{for(z=S.key;w!==null;){if(w.key===z)if(w.tag===4&&w.stateNode.containerInfo===S.containerInfo&&w.stateNode.implementation===S.implementation){t(x,w.sibling),w=i(w,S.children||[]),w.return=x,x=w;break e}else{t(x,w);break}else e(x,w);w=w.sibling}w=Bu(S,x.mode,E),w.return=x,x=w}return o(x);case Tn:return z=S._init,T(x,w,z(S._payload),E)}if(uo(S))return g(x,w,S,E);if(Qs(S))return v(x,w,S,E);Ul(x,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,w!==null&&w.tag===6?(t(x,w.sibling),w=i(w,S),w.return=x,x=w):(t(x,w),w=Pu(S,x.mode,E),w.return=x,x=w),o(x)):t(x,w)}return T}var Is=W2(!0),j2=W2(!1),xl={},Hr=ti(xl),Zo=ti(xl),el=ti(xl);function vi(r){if(r===xl)throw Error(P(174));return r}function Hd(r,e){switch(ye(el,e),ye(Zo,r),ye(Hr,xl),r=e.nodeType,r){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:_c(null,"");break;default:r=r===8?e.parentNode:e,e=r.namespaceURI||null,r=r.tagName,e=_c(e,r)}we(Hr),ye(Hr,e)}function Ds(){we(Hr),we(Zo),we(el)}function Y2(r){vi(el.current);var e=vi(Hr.current),t=_c(e,r.type);e!==t&&(ye(Zo,r),ye(Hr,t))}function qd(r){Zo.current===r&&(we(Hr),we(Zo))}var Ee=ti(0);function Ka(r){for(var e=r;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break;for(;e.sibling===null;){if(e.return===null||e.return===r)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Au=[];function _d(){for(var r=0;rt?t:4,r(!0);var n=Ou.transition;Ou.transition={};try{r(!1),e()}finally{he=t,Ou.transition=n}}function ug(){return ur().memoizedState}function jy(r,e,t){var n=Hn(r);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},cg(r))fg(e,t);else if(t=H2(r,e,t,n),t!==null){var i=ht();Mr(t,r,n,i),dg(t,e,n)}}function Yy(r,e,t){var n=Hn(r),i={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(cg(r))fg(e,i);else{var s=r.alternate;if(r.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,t);if(i.hasEagerState=!0,i.eagerState=l,Tr(l,o)){var a=e.interleaved;a===null?(i.next=i,$d(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}t=H2(r,e,i,n),t!==null&&(i=ht(),Mr(t,r,n,i),dg(t,e,n))}}function cg(r){var e=r.alternate;return r===Ae||e!==null&&e===Ae}function fg(r,e){Oo=Ga=!0;var t=r.pending;t===null?e.next=e:(e.next=t.next,t.next=e),r.pending=e}function dg(r,e,t){if(t&4194240){var n=e.lanes;n&=r.pendingLanes,t|=n,e.lanes=t,Td(r,t)}}var Xa={readContext:ar,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useInsertionEffect:nt,useLayoutEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useMutableSource:nt,useSyncExternalStore:nt,useId:nt,unstable_isNewReconciler:!1},Jy={readContext:ar,useCallback:function(r,e){return Dr().memoizedState=[r,e===void 0?null:e],r},useContext:ar,useEffect:Xp,useImperativeHandle:function(r,e,t){return t=t!=null?t.concat([r]):null,va(4194308,4,ig.bind(null,e,r),t)},useLayoutEffect:function(r,e){return va(4194308,4,r,e)},useInsertionEffect:function(r,e){return va(4,2,r,e)},useMemo:function(r,e){var t=Dr();return e=e===void 0?null:e,r=r(),t.memoizedState=[r,e],r},useReducer:function(r,e,t){var n=Dr();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:e},n.queue=r,r=r.dispatch=jy.bind(null,Ae,r),[n.memoizedState,r]},useRef:function(r){var e=Dr();return r={current:r},e.memoizedState=r},useState:Gp,useDebugValue:Jd,useDeferredValue:function(r){return Dr().memoizedState=r},useTransition:function(){var r=Gp(!1),e=r[0];return r=Wy.bind(null,r[1]),Dr().memoizedState=r,[e,r]},useMutableSource:function(){},useSyncExternalStore:function(r,e,t){var n=Ae,i=Dr();if(Me){if(t===void 0)throw Error(P(407));t=t()}else{if(t=e(),Ye===null)throw Error(P(349));Bi&30||G2(n,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,Xp(Q2.bind(null,n,s,r),[r]),n.flags|=2048,nl(9,X2.bind(null,n,s,t,e),void 0,null),t},useId:function(){var r=Dr(),e=Ye.identifierPrefix;if(Me){var t=nn,n=rn;t=(n&~(1<<32-br(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=tl++,0")&&(a=a.replace("",r.displayName)),a}while(1<=o&&0<=l);break}}}finally{hu=!1,Error.prepareStackTrace=t}return(r=r?r.displayName||r.name:"")?ao(r):""}function M7(r){switch(r.tag){case 5:return ao(r.type);case 16:return ao("Lazy");case 13:return ao("Suspense");case 19:return ao("SuspenseList");case 0:case 2:case 15:return r=pu(r.type,!1),r;case 11:return r=pu(r.type.render,!1),r;case 1:return r=pu(r.type,!0),r;default:return""}}function Fc(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case ns:return"Fragment";case rs:return"Portal";case Pc:return"Profiler";case kd:return"StrictMode";case Bc:return"Suspense";case Lc:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case U4:return(r.displayName||"Context")+".Consumer";case _4:return(r._context.displayName||"Context")+".Provider";case wd:var e=r.render;return r=r.displayName,r||(r=e.displayName||e.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case Sd:return e=r.displayName||null,e!==null?e:Fc(r.type)||"Memo";case Tn:e=r._payload,r=r._init;try{return Fc(r(e))}catch{}}return null}function T7(r){var e=r.type;switch(r.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=e.render,r=r.displayName||r.name||"",e.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fc(e);case 8:return e===kd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Jn(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function j4(r){var e=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function C7(r){var e=j4(r)?"checked":"value",t=Object.getOwnPropertyDescriptor(r.constructor.prototype,e),n=""+r[e];if(!r.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var i=t.get,s=t.set;return Object.defineProperty(r,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(r,e,{enumerable:t.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){r._valueTracker=null,delete r[e]}}}}function Rl(r){r._valueTracker||(r._valueTracker=C7(r))}function Y4(r){if(!r)return!1;var e=r._valueTracker;if(!e)return!0;var t=e.getValue(),n="";return r&&(n=j4(r)?r.checked?"true":"false":r.value),r=n,r!==t?(e.setValue(r),!0):!1}function Da(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function $c(r,e){var t=e.checked;return Oe({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??r._wrapperState.initialChecked})}function pp(r,e){var t=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;t=Jn(e.value!=null?e.value:t),r._wrapperState={initialChecked:n,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function J4(r,e){e=e.checked,e!=null&&xd(r,"checked",e,!1)}function Vc(r,e){J4(r,e);var t=Jn(e.value),n=e.type;if(t!=null)n==="number"?(t===0&&r.value===""||r.value!=t)&&(r.value=""+t):r.value!==""+t&&(r.value=""+t);else if(n==="submit"||n==="reset"){r.removeAttribute("value");return}e.hasOwnProperty("value")?Hc(r,e.type,t):e.hasOwnProperty("defaultValue")&&Hc(r,e.type,Jn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(r.defaultChecked=!!e.defaultChecked)}function mp(r,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+r._wrapperState.initialValue,t||e===r.value||(r.value=e),r.defaultValue=e}t=r.name,t!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,t!==""&&(r.name=t)}function Hc(r,e,t){(e!=="number"||Da(r.ownerDocument)!==r)&&(t==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+t&&(r.defaultValue=""+t))}var uo=Array.isArray;function ys(r,e,t,n){if(r=r.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Pl.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;e.firstChild;)r.appendChild(e.firstChild)}});function _o(r,e){if(e){var t=r.firstChild;if(t&&t===r.lastChild&&t.nodeType===3){t.nodeValue=e;return}}r.textContent=e}var To={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},E7=["Webkit","ms","Moz","O"];Object.keys(To).forEach(function(r){E7.forEach(function(e){e=e+r.charAt(0).toUpperCase()+r.substring(1),To[e]=To[r]})});function Q4(r,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||To.hasOwnProperty(r)&&To[r]?(""+e).trim():e+"px"}function Z4(r,e){r=r.style;for(var t in e)if(e.hasOwnProperty(t)){var n=t.indexOf("--")===0,i=Q4(t,e[t],n);t==="float"&&(t="cssFloat"),n?r.setProperty(t,i):r[t]=i}}var N7=Oe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Uc(r,e){if(e){if(N7[r]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(P(137,r));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(P(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(P(61))}if(e.style!=null&&typeof e.style!="object")throw Error(P(62))}}function Wc(r,e){if(r.indexOf("-")===-1)return typeof e.is=="string";switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jc=null;function bd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Yc=null,vs=null,xs=null;function vp(r){if(r=vl(r)){if(typeof Yc!="function")throw Error(P(280));var e=r.stateNode;e&&(e=z0(e),Yc(r.stateNode,r.type,e))}}function e2(r){vs?xs?xs.push(r):xs=[r]:vs=r}function t2(){if(vs){var r=vs,e=xs;if(xs=vs=null,vp(r),e)for(r=0;r>>=0,r===0?32:31-($7(r)/V7|0)|0}var Bl=64,Ll=4194304;function co(r){switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function La(r,e){var t=r.pendingLanes;if(t===0)return 0;var n=0,i=r.suspendedLanes,s=r.pingedLanes,o=t&268435455;if(o!==0){var l=o&~i;l!==0?n=co(l):(s&=o,s!==0&&(n=co(s)))}else o=t&~i,o!==0?n=co(o):s!==0&&(n=co(s));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(n&4&&(n|=t&16),e=r.entangledLanes,e!==0)for(r=r.entanglements,e&=n;0t;t++)e.push(r);return e}function gl(r,e,t){r.pendingLanes|=e,e!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,e=31-Mr(e),r[e]=t}function U7(r,e){var t=r.pendingLanes&~e;r.pendingLanes=e,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=e,r.mutableReadLanes&=e,r.entangledLanes&=e,e=r.entanglements;var n=r.eventTimes;for(r=r.expirationTimes;0=Eo),Ep=String.fromCharCode(32),Np=!1;function w2(r,e){switch(r){case"keyup":return vy.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function S2(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var is=!1;function ky(r,e){switch(r){case"compositionend":return S2(e);case"keypress":return e.which!==32?null:(Np=!0,Ep);case"textInput":return r=e.data,r===Ep&&Np?null:r;default:return null}}function wy(r,e){if(is)return r==="compositionend"||!zd&&w2(r,e)?(r=x2(),pa=Nd=zn=null,is=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-r};r=n}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Ip(t)}}function C2(r,e){return r&&e?r===e?!0:r&&r.nodeType===3?!1:e&&e.nodeType===3?C2(r,e.parentNode):"contains"in r?r.contains(e):r.compareDocumentPosition?!!(r.compareDocumentPosition(e)&16):!1:!1}function E2(){for(var r=window,e=Da();e instanceof r.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)r=e.contentWindow;else break;e=Da(r.document)}return e}function Id(r){var e=r&&r.nodeName&&r.nodeName.toLowerCase();return e&&(e==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||e==="textarea"||r.contentEditable==="true")}function Oy(r){var e=E2(),t=r.focusedElem,n=r.selectionRange;if(e!==t&&t&&t.ownerDocument&&C2(t.ownerDocument.documentElement,t)){if(n!==null&&Id(t)){if(e=n.start,r=n.end,r===void 0&&(r=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(r,t.value.length);else if(r=(e=t.ownerDocument||document)&&e.defaultView||window,r.getSelection){r=r.getSelection();var i=t.textContent.length,s=Math.min(n.start,i);n=n.end===void 0?s:Math.min(n.end,i),!r.extend&&s>n&&(i=n,n=s,s=i),i=Dp(t,s);var o=Dp(t,n);i&&o&&(r.rangeCount!==1||r.anchorNode!==i.node||r.anchorOffset!==i.offset||r.focusNode!==o.node||r.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),r.removeAllRanges(),s>n?(r.addRange(e),r.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),r.addRange(e)))}}for(e=[],r=t;r=r.parentNode;)r.nodeType===1&&e.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,ss=null,Zc=null,Ao=null,ef=!1;function Rp(r,e,t){var n=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;ef||ss==null||ss!==Da(n)||(n=ss,"selectionStart"in n&&Id(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Ao&&Ko(Ao,n)||(Ao=n,n=Va(Zc,"onSelect"),0us||(r.current=lf[us],lf[us]=null,us--)}function ye(r,e){us++,lf[us]=r.current,r.current=e}var Kn={},at=ti(Kn),Tt=ti(!1),Ri=Kn;function Os(r,e){var t=r.type.contextTypes;if(!t)return Kn;var n=r.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in t)i[s]=e[s];return n&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=e,r.__reactInternalMemoizedMaskedChildContext=i),i}function Ct(r){return r=r.childContextTypes,r!=null}function qa(){we(Tt),we(at)}function Hp(r,e,t){if(at.current!==Kn)throw Error(P(168));ye(at,e),ye(Tt,t)}function B2(r,e,t){var n=r.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return t;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(P(108,T7(r)||"Unknown",i));return Oe({},t,n)}function _a(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||Kn,Ri=at.current,ye(at,r),ye(Tt,Tt.current),!0}function qp(r,e,t){var n=r.stateNode;if(!n)throw Error(P(169));t?(r=B2(r,e,Ri),n.__reactInternalMemoizedMergedChildContext=r,we(Tt),we(at),ye(at,r)):we(Tt),ye(Tt,t)}var en=null,I0=!1,Nu=!1;function L2(r){en===null?en=[r]:en.push(r)}function qy(r){I0=!0,L2(r)}function ri(){if(!Nu&&en!==null){Nu=!0;var r=0,e=he;try{var t=en;for(he=1;r>=o,i-=o,rn=1<<32-Mr(e)+i|t<O?(W=I,I=null):W=I.sibling;var K=d(x,I,S[O],E);if(K===null){I===null&&(I=W);break}r&&I&&K.alternate===null&&e(x,I),w=s(K,w,O),z===null?A=K:z.sibling=K,z=K,I=W}if(O===S.length)return t(x,I),Me&&fi(x,O),A;if(I===null){for(;OO?(W=I,I=null):W=I.sibling;var de=d(x,I,K.value,E);if(de===null){I===null&&(I=W);break}r&&I&&de.alternate===null&&e(x,I),w=s(de,w,O),z===null?A=de:z.sibling=de,z=de,I=W}if(K.done)return t(x,I),Me&&fi(x,O),A;if(I===null){for(;!K.done;O++,K=S.next())K=f(x,K.value,E),K!==null&&(w=s(K,w,O),z===null?A=K:z.sibling=K,z=K);return Me&&fi(x,O),A}for(I=n(x,I);!K.done;O++,K=S.next())K=p(I,x,O,K.value,E),K!==null&&(r&&K.alternate!==null&&I.delete(K.key===null?O:K.key),w=s(K,w,O),z===null?A=K:z.sibling=K,z=K);return r&&I.forEach(function(xe){return e(x,xe)}),Me&&fi(x,O),A}function T(x,w,S,E){if(typeof S=="object"&&S!==null&&S.type===ns&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Dl:e:{for(var A=S.key,z=w;z!==null;){if(z.key===A){if(A=S.type,A===ns){if(z.tag===7){t(x,z.sibling),w=i(z,S.props.children),w.return=x,x=w;break e}}else if(z.elementType===A||typeof A=="object"&&A!==null&&A.$$typeof===Tn&&Kp(A)===z.type){t(x,z.sibling),w=i(z,S.props),w.ref=no(x,z,S),w.return=x,x=w;break e}t(x,z);break}else e(x,z);z=z.sibling}S.type===ns?(w=Ei(S.props.children,x.mode,E,S.key),w.return=x,x=w):(E=Sa(S.type,S.key,S.props,null,x.mode,E),E.ref=no(x,w,S),E.return=x,x=E)}return o(x);case rs:e:{for(z=S.key;w!==null;){if(w.key===z)if(w.tag===4&&w.stateNode.containerInfo===S.containerInfo&&w.stateNode.implementation===S.implementation){t(x,w.sibling),w=i(w,S.children||[]),w.return=x,x=w;break e}else{t(x,w);break}else e(x,w);w=w.sibling}w=Bu(S,x.mode,E),w.return=x,x=w}return o(x);case Tn:return z=S._init,T(x,w,z(S._payload),E)}if(uo(S))return g(x,w,S,E);if(Qs(S))return v(x,w,S,E);Ul(x,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,w!==null&&w.tag===6?(t(x,w.sibling),w=i(w,S),w.return=x,x=w):(t(x,w),w=Pu(S,x.mode,E),w.return=x,x=w),o(x)):t(x,w)}return T}var Is=W2(!0),j2=W2(!1),xl={},qr=ti(xl),Zo=ti(xl),el=ti(xl);function vi(r){if(r===xl)throw Error(P(174));return r}function Hd(r,e){switch(ye(el,e),ye(Zo,r),ye(qr,xl),r=e.nodeType,r){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:_c(null,"");break;default:r=r===8?e.parentNode:e,e=r.namespaceURI||null,r=r.tagName,e=_c(e,r)}we(qr),ye(qr,e)}function Ds(){we(qr),we(Zo),we(el)}function Y2(r){vi(el.current);var e=vi(qr.current),t=_c(e,r.type);e!==t&&(ye(Zo,r),ye(qr,t))}function qd(r){Zo.current===r&&(we(qr),we(Zo))}var Ee=ti(0);function Ka(r){for(var e=r;e!==null;){if(e.tag===13){var t=e.memoizedState;if(t!==null&&(t=t.dehydrated,t===null||t.data==="$?"||t.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break;for(;e.sibling===null;){if(e.return===null||e.return===r)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Au=[];function _d(){for(var r=0;rt?t:4,r(!0);var n=Ou.transition;Ou.transition={};try{r(!1),e()}finally{he=t,Ou.transition=n}}function ug(){return ur().memoizedState}function jy(r,e,t){var n=Hn(r);if(t={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null},cg(r))fg(e,t);else if(t=H2(r,e,t,n),t!==null){var i=ht();Tr(t,r,n,i),dg(t,e,n)}}function Yy(r,e,t){var n=Hn(r),i={lane:n,action:t,hasEagerState:!1,eagerState:null,next:null};if(cg(r))fg(e,i);else{var s=r.alternate;if(r.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,t);if(i.hasEagerState=!0,i.eagerState=l,Cr(l,o)){var a=e.interleaved;a===null?(i.next=i,$d(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}t=H2(r,e,i,n),t!==null&&(i=ht(),Tr(t,r,n,i),dg(t,e,n))}}function cg(r){var e=r.alternate;return r===Ae||e!==null&&e===Ae}function fg(r,e){Oo=Ga=!0;var t=r.pending;t===null?e.next=e:(e.next=t.next,t.next=e),r.pending=e}function dg(r,e,t){if(t&4194240){var n=e.lanes;n&=r.pendingLanes,t|=n,e.lanes=t,Td(r,t)}}var Xa={readContext:ar,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useInsertionEffect:nt,useLayoutEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useMutableSource:nt,useSyncExternalStore:nt,useId:nt,unstable_isNewReconciler:!1},Jy={readContext:ar,useCallback:function(r,e){return Rr().memoizedState=[r,e===void 0?null:e],r},useContext:ar,useEffect:Xp,useImperativeHandle:function(r,e,t){return t=t!=null?t.concat([r]):null,va(4194308,4,ig.bind(null,e,r),t)},useLayoutEffect:function(r,e){return va(4194308,4,r,e)},useInsertionEffect:function(r,e){return va(4,2,r,e)},useMemo:function(r,e){var t=Rr();return e=e===void 0?null:e,r=r(),t.memoizedState=[r,e],r},useReducer:function(r,e,t){var n=Rr();return e=t!==void 0?t(e):e,n.memoizedState=n.baseState=e,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:e},n.queue=r,r=r.dispatch=jy.bind(null,Ae,r),[n.memoizedState,r]},useRef:function(r){var e=Rr();return r={current:r},e.memoizedState=r},useState:Gp,useDebugValue:Jd,useDeferredValue:function(r){return Rr().memoizedState=r},useTransition:function(){var r=Gp(!1),e=r[0];return r=Wy.bind(null,r[1]),Rr().memoizedState=r,[e,r]},useMutableSource:function(){},useSyncExternalStore:function(r,e,t){var n=Ae,i=Rr();if(Me){if(t===void 0)throw Error(P(407));t=t()}else{if(t=e(),Je===null)throw Error(P(349));Bi&30||G2(n,e,t)}i.memoizedState=t;var s={value:t,getSnapshot:e};return i.queue=s,Xp(Q2.bind(null,n,s,r),[r]),n.flags|=2048,nl(9,X2.bind(null,n,s,t,e),void 0,null),t},useId:function(){var r=Rr(),e=Je.identifierPrefix;if(Me){var t=nn,n=rn;t=(n&~(1<<32-Mr(n)-1)).toString(32)+t,e=":"+e+"R"+t,t=tl++,0<\/script>",r=r.removeChild(r.firstChild)):typeof n.is=="string"?r=o.createElement(t,{is:n.is}):(r=o.createElement(t),t==="select"&&(o=r,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):r=o.createElementNS(r,t),r[Br]=e,r[Qo]=n,wg(r,e,!1,!1),e.stateNode=r;e:{switch(o=Wc(t,n),t){case"dialog":ke("cancel",r),ke("close",r),i=n;break;case"iframe":case"object":case"embed":ke("load",r),i=n;break;case"video":case"audio":for(i=0;iPs&&(e.flags|=128,n=!0,io(s,!1),e.lanes=4194304)}else{if(!n)if(r=Ka(o),r!==null){if(e.flags|=128,n=!0,t=r.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),io(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Me)return it(e),null}else 2*Re()-s.renderingStartTime>Ps&&t!==1073741824&&(e.flags|=128,n=!0,io(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Re(),e.sibling=null,t=Ee.current,ye(Ee,n?t&1|2:t&1),e):(it(e),null);case 22:case 23:return eh(),n=e.memoizedState!==null,r!==null&&r.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Lt&1073741824&&(it(e),e.subtreeFlags&6&&(e.flags|=8192)):it(e),null;case 24:return null;case 25:return null}throw Error(P(156,e.tag))}function rv(r,e){switch(Rd(e),e.tag){case 1:return Ct(e.type)&&qa(),r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 3:return Ds(),we(Tt),we(at),_d(),r=e.flags,r&65536&&!(r&128)?(e.flags=r&-65537|128,e):null;case 5:return qd(e),null;case 13:if(we(Ee),r=e.memoizedState,r!==null&&r.dehydrated!==null){if(e.alternate===null)throw Error(P(340));zs()}return r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 19:return we(Ee),null;case 4:return Ds(),null;case 10:return Fd(e.type._context),null;case 22:case 23:return eh(),null;case 24:return null;default:return null}}var jl=!1,ot=!1,nv=typeof WeakSet=="function"?WeakSet:Set,q=null;function hs(r,e){var t=r.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Ie(r,e,n)}else t.current=null}function xf(r,e,t){try{t()}catch(n){Ie(r,e,n)}}var o1=!1;function iv(r,e){if(tf=Fa,r=E2(),Id(r)){if("selectionStart"in r)var t={start:r.selectionStart,end:r.selectionEnd};else e:{t=(t=r.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,l=-1,a=-1,u=0,c=0,f=r,d=null;t:for(;;){for(var p;f!==t||i!==0&&f.nodeType!==3||(l=o+i),f!==s||n!==0&&f.nodeType!==3||(a=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===r)break t;if(d===t&&++u===i&&(l=o),d===s&&++c===n&&(a=o),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}t=l===-1||a===-1?null:{start:l,end:a}}else t=null}t=t||{start:0,end:0}}else t=null;for(rf={focusedElem:r,selectionRange:t},Fa=!1,q=e;q!==null;)if(e=q,r=e.child,(e.subtreeFlags&1028)!==0&&r!==null)r.return=e,q=r;else for(;q!==null;){e=q;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,T=g.memoizedState,x=e.stateNode,w=x.getSnapshotBeforeUpdate(e.elementType===e.type?v:gr(e.type,v),T);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(E){Ie(e,e.return,E)}if(r=e.sibling,r!==null){r.return=e.return,q=r;break}q=e.return}return g=o1,o1=!1,g}function zo(r,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&r)===r){var s=i.destroy;i.destroy=void 0,s!==void 0&&xf(e,t,s)}i=i.next}while(i!==n)}}function P0(r,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&r)===r){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function kf(r){var e=r.ref;if(e!==null){var t=r.stateNode;switch(r.tag){case 5:r=t;break;default:r=t}typeof e=="function"?e(r):e.current=r}}function Mg(r){var e=r.alternate;e!==null&&(r.alternate=null,Mg(e)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(e=r.stateNode,e!==null&&(delete e[Br],delete e[Qo],delete e[of],delete e[Vy],delete e[Hy])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Tg(r){return r.tag===5||r.tag===3||r.tag===4}function l1(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Tg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function wf(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(r,e):t.insertBefore(r,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(r,t)):(e=t,e.appendChild(r)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Ha));else if(n!==4&&(r=r.child,r!==null))for(wf(r,e,t),r=r.sibling;r!==null;)wf(r,e,t),r=r.sibling}function Sf(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.insertBefore(r,e):t.appendChild(r);else if(n!==4&&(r=r.child,r!==null))for(Sf(r,e,t),r=r.sibling;r!==null;)Sf(r,e,t),r=r.sibling}var Xe=null,yr=!1;function kn(r,e,t){for(t=t.child;t!==null;)Cg(r,e,t),t=t.sibling}function Cg(r,e,t){if(Vr&&typeof Vr.onCommitFiberUnmount=="function")try{Vr.onCommitFiberUnmount(E0,t)}catch{}switch(t.tag){case 5:ot||hs(t,e);case 6:var n=Xe,i=yr;Xe=null,kn(r,e,t),Xe=n,yr=i,Xe!==null&&(yr?(r=Xe,t=t.stateNode,r.nodeType===8?r.parentNode.removeChild(t):r.removeChild(t)):Xe.removeChild(t.stateNode));break;case 18:Xe!==null&&(yr?(r=Xe,t=t.stateNode,r.nodeType===8?Eu(r.parentNode,t):r.nodeType===1&&Eu(r,t),Yo(r)):Eu(Xe,t.stateNode));break;case 4:n=Xe,i=yr,Xe=t.stateNode.containerInfo,yr=!0,kn(r,e,t),Xe=n,yr=i;break;case 0:case 11:case 14:case 15:if(!ot&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&xf(t,e,o),i=i.next}while(i!==n)}kn(r,e,t);break;case 1:if(!ot&&(hs(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(l){Ie(t,e,l)}kn(r,e,t);break;case 21:kn(r,e,t);break;case 22:t.mode&1?(ot=(n=ot)||t.memoizedState!==null,kn(r,e,t),ot=n):kn(r,e,t);break;default:kn(r,e,t)}}function a1(r){var e=r.updateQueue;if(e!==null){r.updateQueue=null;var t=r.stateNode;t===null&&(t=r.stateNode=new nv),e.forEach(function(n){var i=hv.bind(null,r,n);t.has(n)||(t.add(n),n.then(i,i))})}}function mr(r,e){var t=e.deletions;if(t!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Re()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ov(n/1960))-n,10r?16:r,In===null)var n=!1;else{if(r=In,In=null,e0=0,le&6)throw Error(P(331));var i=le;for(le|=4,q=r.current;q!==null;){var s=q,o=s.child;if(q.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aRe()-Qd?Ci(r,0):Xd|=t),Et(r,e)}function Rg(r,e){e===0&&(r.mode&1?(e=Ll,Ll<<=1,!(Ll&130023424)&&(Ll=4194304)):e=1);var t=ht();r=fn(r,e),r!==null&&(gl(r,e,t),Et(r,t))}function dv(r){var e=r.memoizedState,t=0;e!==null&&(t=e.retryLane),Rg(r,t)}function hv(r,e){var t=0;switch(r.tag){case 13:var n=r.stateNode,i=r.memoizedState;i!==null&&(t=i.retryLane);break;case 19:n=r.stateNode;break;default:throw Error(P(314))}n!==null&&n.delete(e),Rg(r,t)}var Pg;Pg=function(r,e,t){if(r!==null)if(r.memoizedProps!==e.pendingProps||Tt.current)bt=!0;else{if(!(r.lanes&t)&&!(e.flags&128))return bt=!1,ev(r,e,t);bt=!!(r.flags&131072)}else bt=!1,Me&&e.flags&1048576&&F2(e,Wa,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;xa(r,e),r=e.pendingProps;var i=Os(e,at.current);ws(e,t),i=Wd(null,e,n,r,i,t);var s=jd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ct(n)?(s=!0,_a(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Vd(e),i.updater=D0,e.stateNode=i,i._reactInternals=e,df(e,n,r,t),e=mf(null,e,n,!0,s,t)):(e.tag=0,Me&&s&&Dd(e),ft(null,e,i,t),e=e.child),e;case 16:n=e.elementType;e:{switch(xa(r,e),r=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=mv(n),r=gr(n,r),i){case 0:e=pf(null,e,n,r,t);break e;case 1:e=n1(null,e,n,r,t);break e;case 11:e=t1(null,e,n,r,t);break e;case 14:e=r1(null,e,n,gr(n.type,r),t);break e}throw Error(P(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),pf(r,e,n,i,t);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),n1(r,e,n,i,t);case 3:e:{if(vg(e),r===null)throw Error(P(387));n=e.pendingProps,s=e.memoizedState,i=s.element,q2(r,e),Ja(e,n,null,t);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Rs(Error(P(423)),e),e=i1(r,e,n,t,i);break e}else if(n!==i){i=Rs(Error(P(424)),e),e=i1(r,e,n,t,i);break e}else for(Ht=Fn(e.stateNode.containerInfo.firstChild),qt=e,Me=!0,xr=null,t=j2(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(zs(),n===i){e=dn(r,e,t);break e}ft(r,e,n,t)}e=e.child}return e;case 5:return Y2(e),r===null&&uf(e),n=e.type,i=e.pendingProps,s=r!==null?r.memoizedProps:null,o=i.children,nf(n,i)?o=null:s!==null&&nf(n,s)&&(e.flags|=32),yg(r,e),ft(r,e,o,t),e.child;case 6:return r===null&&uf(e),null;case 13:return xg(r,e,t);case 4:return Hd(e,e.stateNode.containerInfo),n=e.pendingProps,r===null?e.child=Is(e,null,n,t):ft(r,e,n,t),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),t1(r,e,n,i,t);case 7:return ft(r,e,e.pendingProps,t),e.child;case 8:return ft(r,e,e.pendingProps.children,t),e.child;case 12:return ft(r,e,e.pendingProps.children,t),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,ye(ja,n._currentValue),n._currentValue=o,s!==null)if(Tr(s.value,o)){if(s.children===i.children&&!Tt.current){e=dn(r,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===n){if(s.tag===1){a=sn(-1,t&-t),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),cf(s.return,t,e),l.lanes|=t;break}a=a.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(P(341));o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),cf(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ft(r,e,i.children,t),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,ws(e,t),i=ar(i),n=n(i),e.flags|=1,ft(r,e,n,t),e.child;case 14:return n=e.type,i=gr(n,e.pendingProps),i=gr(n.type,i),r1(r,e,n,i,t);case 15:return mg(r,e,e.type,e.pendingProps,t);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),xa(r,e),e.tag=1,Ct(n)?(r=!0,_a(e)):r=!1,ws(e,t),U2(e,n,i),df(e,n,i,t),mf(null,e,n,!0,r,t);case 19:return kg(r,e,t);case 22:return gg(r,e,t)}throw Error(P(156,e.tag))};function Bg(r,e){return a2(r,e)}function pv(r,e,t,n){this.tag=r,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(r,e,t,n){return new pv(r,e,t,n)}function rh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function mv(r){if(typeof r=="function")return rh(r)?1:0;if(r!=null){if(r=r.$$typeof,r===wd)return 11;if(r===Sd)return 14}return 2}function qn(r,e){var t=r.alternate;return t===null?(t=nr(r.tag,e,r.key,r.mode),t.elementType=r.elementType,t.type=r.type,t.stateNode=r.stateNode,t.alternate=r,r.alternate=t):(t.pendingProps=e,t.type=r.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=r.flags&14680064,t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,e=r.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=r.sibling,t.index=r.index,t.ref=r.ref,t}function Sa(r,e,t,n,i,s){var o=2;if(n=r,typeof r=="function")rh(r)&&(o=1);else if(typeof r=="string")o=5;else e:switch(r){case ns:return Ei(t.children,i,s,e);case kd:o=8,i|=8;break;case Pc:return r=nr(12,t,e,i|2),r.elementType=Pc,r.lanes=s,r;case Bc:return r=nr(13,t,e,i),r.elementType=Bc,r.lanes=s,r;case Lc:return r=nr(19,t,e,i),r.elementType=Lc,r.lanes=s,r;case W4:return L0(t,i,s,e);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _4:o=10;break e;case U4:o=9;break e;case wd:o=11;break e;case Sd:o=14;break e;case Tn:o=16,n=null;break e}throw Error(P(130,r==null?r:typeof r,""))}return e=nr(o,t,e,i),e.elementType=r,e.type=n,e.lanes=s,e}function Ei(r,e,t,n){return r=nr(7,r,n,e),r.lanes=t,r}function L0(r,e,t,n){return r=nr(22,r,n,e),r.elementType=W4,r.lanes=t,r.stateNode={isHidden:!1},r}function Pu(r,e,t){return r=nr(6,r,null,e),r.lanes=t,r}function Bu(r,e,t){return e=nr(4,r.children!==null?r.children:[],r.key,e),e.lanes=t,e.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},e}function gv(r,e,t,n,i){this.tag=e,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gu(0),this.expirationTimes=gu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gu(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nh(r,e,t,n,i,s,o,l,a){return r=new gv(r,e,t,l,a),e===1?(e=1,s===!0&&(e|=8)):e=0,s=nr(3,null,null,e),r.current=s,s.stateNode=r,s.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vd(s),r}function yv(r,e,t){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vg)}catch(r){console.error(r)}}Vg(),F4.exports=Ut;var lh=F4.exports;const Sv=E4(lh);var g1=lh;Dc.createRoot=g1.createRoot,Dc.hydrateRoot=g1.hydrateRoot;function Qe(r){this.content=r}Qe.prototype={constructor:Qe,find:function(r){for(var e=0;e>1}};Qe.from=function(r){if(r instanceof Qe)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Qe(e)};function Hg(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Hg(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function qg(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let u=0,c=Math.min(o.text.length,l.text.length);for(;ue&&n(a,i+l,s||null,o)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),n,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{l.isText?(s+=l.text.slice(Math.max(e,a)-a,t-a),o=!n):l.isLeaf?(i?s+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(s+=l.type.spec.leafText(l)),o=!n):!o&&l.isBlock&&(s+=n,o=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new ct(n,i)}cutByIndex(e,t){return e==t?ct.empty:e==0&&t==this.content.length?this:new ct(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new ct(i,s)}addToStart(e){return new ct([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ct(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=this.child(n),o=i+s.nodeSize;if(o>=e)return o==e||t>0?Kl(n+1,o):Kl(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ct.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ct(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ct.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;tn.type.rank-i.type.rank),t}};pe.none=[];let i0=class extends Error{},U=class Xi{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Ug(this.content,e+this.openStart,t);return n&&new Xi(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Xi(_g(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Xi.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Xi(F.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new Xi(e,n,i)}};U.empty=new U(F.empty,0,0);function _g(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(_g(s.content,e-i-1,t-i-1)))}function Ug(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=Ug(o.content,e-s-1,t);return l&&r.replaceChild(i,o.copy(l))}function bv(r,e,t){if(t.openStart>r.depth)throw new i0("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new i0("Inconsistent open depths");return Wg(r,e,t,0)}function Wg(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Ro(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(Ni(r.nodeAfter,n),s++));for(let l=s;li&&Nf(r,e,i+1),o=n.depth>i&&Nf(t,n,i+1),l=[];return Ro(null,r,i,l),s&&o&&e.index(i)==t.index(i)?(jg(s,o),Ni(Ai(s,Yg(r,e,t,n,i+1)),l)):(s&&Ni(Ai(s,s0(r,e,i+1)),l),Ro(e,t,i,l),o&&Ni(Ai(o,s0(t,n,i+1)),l)),Ro(n,null,i,l),new F(l)}function s0(r,e,t){let n=[];if(Ro(null,r,t,n),r.depth>t){let i=Nf(r,e,t+1);Ni(Ai(i,s0(r,e,t+1)),n)}return Ro(e,null,t,n),new F(n)}function Mv(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(F.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class sl{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new o0(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),u=s-a;if(n.push(o,l,i+a),!u||(o=o.child(l),o.isText))break;s=u-1,i+=a+1}return new sl(t,n,s)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Jg(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=F.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=F.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)}};Oi.prototype.text=void 0;let Ev=class Of extends Oi{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Jg(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Of(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Of(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Jg(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class $i{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Nv(e,t);if(n.next==null)return $i.empty;let i=Kg(n);n.next&&n.err("Unexpected trailing text");let s=Pv(Rv(i));return Bv(s,n),s}matchType(e){for(let t=0;tu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(n.next[o].next);return s}).join(` -`)}}$i.empty=new $i(!0);class Nv{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Kg(r){let e=[];do e.push(Av(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Av(r){let e=[];do e.push(Ov(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ov(r){let e=Dv(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=zv(r,e);else break;return e}function y1(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function zv(r,e){let t=y1(r),n=t;return r.eat(",")&&(r.next!="}"?n=y1(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function Iv(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.groups.indexOf(e)>-1&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function Dv(r){if(r.eat("(")){let e=Kg(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=Iv(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Rv(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,l,a){let u={term:a,to:l};return e[o].push(u),u}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(o.type=="seq")for(let a=0;;a++){let u=s(o.exprs[a],l);if(a==o.exprs.length-1)return u;i(u,l=t())}else if(o.type=="star"){let a=t();return n(l,a),i(s(o.expr,a),a),[n(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[n(a)]}else{if(o.type=="opt")return[n(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let u=0;u{r[o].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[n.join(",")]=new $i(n.indexOf(r.length-1)>-1);for(let o=0;o-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tn[s]=new e3(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class Lv{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class q0{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Zg(i.attrs),this.excluded=null;let s=Xg(this.attrs);this.instance=s?new pe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,Qg(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new q0(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t-1}}class Fv{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Qe.from(e.nodes),t.marks=Qe.from(e.marks||{}),this.nodes=x1.compile(this.spec.nodes,this),this.marks=q0.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;s.contentMatch=n[o]||(n[o]=$i.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.markSet=l=="_"?null:l?k1(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:k1(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof x1){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new Ev(n,n.defaultAttrs,e,pe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Oi.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function k1(r,e){let t=[];for(let n=0;n-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}let ah=class zf{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=e.nodes[n.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let n=new S1(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new S1(this,t,!0);return n.addAll(e,t.from,t.to),U.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o{n(o=b1(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=b1(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new zf(e,zf.schemaRules(e)))}};const t3={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},$v={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},r3={ol:!0,ul:!0},l0=1,a0=2,Po=4;function w1(r,e,t){return e!=null?(e?l0:0)|(e==="full"?a0:0):r&&r.whitespace=="pre"?l0|a0:t&~Po}let Gl=class{constructor(e,t,n,i,s,o,l){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=o||(l&Po?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(F.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&l0)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=F.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<\/script>",r=r.removeChild(r.firstChild)):typeof n.is=="string"?r=o.createElement(t,{is:n.is}):(r=o.createElement(t),t==="select"&&(o=r,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):r=o.createElementNS(r,t),r[Lr]=e,r[Qo]=n,wg(r,e,!1,!1),e.stateNode=r;e:{switch(o=Wc(t,n),t){case"dialog":ke("cancel",r),ke("close",r),i=n;break;case"iframe":case"object":case"embed":ke("load",r),i=n;break;case"video":case"audio":for(i=0;iPs&&(e.flags|=128,n=!0,io(s,!1),e.lanes=4194304)}else{if(!n)if(r=Ka(o),r!==null){if(e.flags|=128,n=!0,t=r.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),io(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Me)return it(e),null}else 2*Re()-s.renderingStartTime>Ps&&t!==1073741824&&(e.flags|=128,n=!0,io(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(t=s.last,t!==null?t.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Re(),e.sibling=null,t=Ee.current,ye(Ee,n?t&1|2:t&1),e):(it(e),null);case 22:case 23:return eh(),n=e.memoizedState!==null,r!==null&&r.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Lt&1073741824&&(it(e),e.subtreeFlags&6&&(e.flags|=8192)):it(e),null;case 24:return null;case 25:return null}throw Error(P(156,e.tag))}function rv(r,e){switch(Rd(e),e.tag){case 1:return Ct(e.type)&&qa(),r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 3:return Ds(),we(Tt),we(at),_d(),r=e.flags,r&65536&&!(r&128)?(e.flags=r&-65537|128,e):null;case 5:return qd(e),null;case 13:if(we(Ee),r=e.memoizedState,r!==null&&r.dehydrated!==null){if(e.alternate===null)throw Error(P(340));zs()}return r=e.flags,r&65536?(e.flags=r&-65537|128,e):null;case 19:return we(Ee),null;case 4:return Ds(),null;case 10:return Fd(e.type._context),null;case 22:case 23:return eh(),null;case 24:return null;default:return null}}var jl=!1,ot=!1,nv=typeof WeakSet=="function"?WeakSet:Set,q=null;function hs(r,e){var t=r.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Ie(r,e,n)}else t.current=null}function xf(r,e,t){try{t()}catch(n){Ie(r,e,n)}}var o1=!1;function iv(r,e){if(tf=Fa,r=E2(),Id(r)){if("selectionStart"in r)var t={start:r.selectionStart,end:r.selectionEnd};else e:{t=(t=r.ownerDocument)&&t.defaultView||window;var n=t.getSelection&&t.getSelection();if(n&&n.rangeCount!==0){t=n.anchorNode;var i=n.anchorOffset,s=n.focusNode;n=n.focusOffset;try{t.nodeType,s.nodeType}catch{t=null;break e}var o=0,l=-1,a=-1,u=0,c=0,f=r,d=null;t:for(;;){for(var p;f!==t||i!==0&&f.nodeType!==3||(l=o+i),f!==s||n!==0&&f.nodeType!==3||(a=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===r)break t;if(d===t&&++u===i&&(l=o),d===s&&++c===n&&(a=o),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}t=l===-1||a===-1?null:{start:l,end:a}}else t=null}t=t||{start:0,end:0}}else t=null;for(rf={focusedElem:r,selectionRange:t},Fa=!1,q=e;q!==null;)if(e=q,r=e.child,(e.subtreeFlags&1028)!==0&&r!==null)r.return=e,q=r;else for(;q!==null;){e=q;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,T=g.memoizedState,x=e.stateNode,w=x.getSnapshotBeforeUpdate(e.elementType===e.type?v:gr(e.type,v),T);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(E){Ie(e,e.return,E)}if(r=e.sibling,r!==null){r.return=e.return,q=r;break}q=e.return}return g=o1,o1=!1,g}function zo(r,e,t){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&r)===r){var s=i.destroy;i.destroy=void 0,s!==void 0&&xf(e,t,s)}i=i.next}while(i!==n)}}function P0(r,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&r)===r){var n=t.create;t.destroy=n()}t=t.next}while(t!==e)}}function kf(r){var e=r.ref;if(e!==null){var t=r.stateNode;switch(r.tag){case 5:r=t;break;default:r=t}typeof e=="function"?e(r):e.current=r}}function Mg(r){var e=r.alternate;e!==null&&(r.alternate=null,Mg(e)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(e=r.stateNode,e!==null&&(delete e[Lr],delete e[Qo],delete e[of],delete e[Vy],delete e[Hy])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function Tg(r){return r.tag===5||r.tag===3||r.tag===4}function l1(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Tg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function wf(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(r,e):t.insertBefore(r,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(r,t)):(e=t,e.appendChild(r)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=Ha));else if(n!==4&&(r=r.child,r!==null))for(wf(r,e,t),r=r.sibling;r!==null;)wf(r,e,t),r=r.sibling}function Sf(r,e,t){var n=r.tag;if(n===5||n===6)r=r.stateNode,e?t.insertBefore(r,e):t.appendChild(r);else if(n!==4&&(r=r.child,r!==null))for(Sf(r,e,t),r=r.sibling;r!==null;)Sf(r,e,t),r=r.sibling}var Qe=null,yr=!1;function kn(r,e,t){for(t=t.child;t!==null;)Cg(r,e,t),t=t.sibling}function Cg(r,e,t){if(Hr&&typeof Hr.onCommitFiberUnmount=="function")try{Hr.onCommitFiberUnmount(E0,t)}catch{}switch(t.tag){case 5:ot||hs(t,e);case 6:var n=Qe,i=yr;Qe=null,kn(r,e,t),Qe=n,yr=i,Qe!==null&&(yr?(r=Qe,t=t.stateNode,r.nodeType===8?r.parentNode.removeChild(t):r.removeChild(t)):Qe.removeChild(t.stateNode));break;case 18:Qe!==null&&(yr?(r=Qe,t=t.stateNode,r.nodeType===8?Eu(r.parentNode,t):r.nodeType===1&&Eu(r,t),Yo(r)):Eu(Qe,t.stateNode));break;case 4:n=Qe,i=yr,Qe=t.stateNode.containerInfo,yr=!0,kn(r,e,t),Qe=n,yr=i;break;case 0:case 11:case 14:case 15:if(!ot&&(n=t.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&xf(t,e,o),i=i.next}while(i!==n)}kn(r,e,t);break;case 1:if(!ot&&(hs(t,e),n=t.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=t.memoizedProps,n.state=t.memoizedState,n.componentWillUnmount()}catch(l){Ie(t,e,l)}kn(r,e,t);break;case 21:kn(r,e,t);break;case 22:t.mode&1?(ot=(n=ot)||t.memoizedState!==null,kn(r,e,t),ot=n):kn(r,e,t);break;default:kn(r,e,t)}}function a1(r){var e=r.updateQueue;if(e!==null){r.updateQueue=null;var t=r.stateNode;t===null&&(t=r.stateNode=new nv),e.forEach(function(n){var i=hv.bind(null,r,n);t.has(n)||(t.add(n),n.then(i,i))})}}function mr(r,e){var t=e.deletions;if(t!==null)for(var n=0;ni&&(i=o),n&=~s}if(n=i,n=Re()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ov(n/1960))-n,10r?16:r,In===null)var n=!1;else{if(r=In,In=null,e0=0,le&6)throw Error(P(331));var i=le;for(le|=4,q=r.current;q!==null;){var s=q,o=s.child;if(q.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aRe()-Qd?Ci(r,0):Xd|=t),Et(r,e)}function Rg(r,e){e===0&&(r.mode&1?(e=Ll,Ll<<=1,!(Ll&130023424)&&(Ll=4194304)):e=1);var t=ht();r=fn(r,e),r!==null&&(gl(r,e,t),Et(r,t))}function dv(r){var e=r.memoizedState,t=0;e!==null&&(t=e.retryLane),Rg(r,t)}function hv(r,e){var t=0;switch(r.tag){case 13:var n=r.stateNode,i=r.memoizedState;i!==null&&(t=i.retryLane);break;case 19:n=r.stateNode;break;default:throw Error(P(314))}n!==null&&n.delete(e),Rg(r,t)}var Pg;Pg=function(r,e,t){if(r!==null)if(r.memoizedProps!==e.pendingProps||Tt.current)bt=!0;else{if(!(r.lanes&t)&&!(e.flags&128))return bt=!1,ev(r,e,t);bt=!!(r.flags&131072)}else bt=!1,Me&&e.flags&1048576&&F2(e,Wa,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;xa(r,e),r=e.pendingProps;var i=Os(e,at.current);ws(e,t),i=Wd(null,e,n,r,i,t);var s=jd();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ct(n)?(s=!0,_a(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Vd(e),i.updater=D0,e.stateNode=i,i._reactInternals=e,df(e,n,r,t),e=mf(null,e,n,!0,s,t)):(e.tag=0,Me&&s&&Dd(e),ft(null,e,i,t),e=e.child),e;case 16:n=e.elementType;e:{switch(xa(r,e),r=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=mv(n),r=gr(n,r),i){case 0:e=pf(null,e,n,r,t);break e;case 1:e=n1(null,e,n,r,t);break e;case 11:e=t1(null,e,n,r,t);break e;case 14:e=r1(null,e,n,gr(n.type,r),t);break e}throw Error(P(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),pf(r,e,n,i,t);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),n1(r,e,n,i,t);case 3:e:{if(vg(e),r===null)throw Error(P(387));n=e.pendingProps,s=e.memoizedState,i=s.element,q2(r,e),Ja(e,n,null,t);var o=e.memoizedState;if(n=o.element,s.isDehydrated)if(s={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Rs(Error(P(423)),e),e=i1(r,e,n,t,i);break e}else if(n!==i){i=Rs(Error(P(424)),e),e=i1(r,e,n,t,i);break e}else for(Ht=Fn(e.stateNode.containerInfo.firstChild),qt=e,Me=!0,kr=null,t=j2(e,null,n,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(zs(),n===i){e=dn(r,e,t);break e}ft(r,e,n,t)}e=e.child}return e;case 5:return Y2(e),r===null&&uf(e),n=e.type,i=e.pendingProps,s=r!==null?r.memoizedProps:null,o=i.children,nf(n,i)?o=null:s!==null&&nf(n,s)&&(e.flags|=32),yg(r,e),ft(r,e,o,t),e.child;case 6:return r===null&&uf(e),null;case 13:return xg(r,e,t);case 4:return Hd(e,e.stateNode.containerInfo),n=e.pendingProps,r===null?e.child=Is(e,null,n,t):ft(r,e,n,t),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),t1(r,e,n,i,t);case 7:return ft(r,e,e.pendingProps,t),e.child;case 8:return ft(r,e,e.pendingProps.children,t),e.child;case 12:return ft(r,e,e.pendingProps.children,t),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,ye(ja,n._currentValue),n._currentValue=o,s!==null)if(Cr(s.value,o)){if(s.children===i.children&&!Tt.current){e=dn(r,e,t);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var l=s.dependencies;if(l!==null){o=s.child;for(var a=l.firstContext;a!==null;){if(a.context===n){if(s.tag===1){a=sn(-1,t&-t),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=t,a=s.alternate,a!==null&&(a.lanes|=t),cf(s.return,t,e),l.lanes|=t;break}a=a.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(P(341));o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),cf(o,t,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}ft(r,e,i.children,t),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,ws(e,t),i=ar(i),n=n(i),e.flags|=1,ft(r,e,n,t),e.child;case 14:return n=e.type,i=gr(n,e.pendingProps),i=gr(n.type,i),r1(r,e,n,i,t);case 15:return mg(r,e,e.type,e.pendingProps,t);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:gr(n,i),xa(r,e),e.tag=1,Ct(n)?(r=!0,_a(e)):r=!1,ws(e,t),U2(e,n,i),df(e,n,i,t),mf(null,e,n,!0,r,t);case 19:return kg(r,e,t);case 22:return gg(r,e,t)}throw Error(P(156,e.tag))};function Bg(r,e){return a2(r,e)}function pv(r,e,t,n){this.tag=r,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(r,e,t,n){return new pv(r,e,t,n)}function rh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function mv(r){if(typeof r=="function")return rh(r)?1:0;if(r!=null){if(r=r.$$typeof,r===wd)return 11;if(r===Sd)return 14}return 2}function qn(r,e){var t=r.alternate;return t===null?(t=nr(r.tag,e,r.key,r.mode),t.elementType=r.elementType,t.type=r.type,t.stateNode=r.stateNode,t.alternate=r,r.alternate=t):(t.pendingProps=e,t.type=r.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=r.flags&14680064,t.childLanes=r.childLanes,t.lanes=r.lanes,t.child=r.child,t.memoizedProps=r.memoizedProps,t.memoizedState=r.memoizedState,t.updateQueue=r.updateQueue,e=r.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=r.sibling,t.index=r.index,t.ref=r.ref,t}function Sa(r,e,t,n,i,s){var o=2;if(n=r,typeof r=="function")rh(r)&&(o=1);else if(typeof r=="string")o=5;else e:switch(r){case ns:return Ei(t.children,i,s,e);case kd:o=8,i|=8;break;case Pc:return r=nr(12,t,e,i|2),r.elementType=Pc,r.lanes=s,r;case Bc:return r=nr(13,t,e,i),r.elementType=Bc,r.lanes=s,r;case Lc:return r=nr(19,t,e,i),r.elementType=Lc,r.lanes=s,r;case W4:return L0(t,i,s,e);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case _4:o=10;break e;case U4:o=9;break e;case wd:o=11;break e;case Sd:o=14;break e;case Tn:o=16,n=null;break e}throw Error(P(130,r==null?r:typeof r,""))}return e=nr(o,t,e,i),e.elementType=r,e.type=n,e.lanes=s,e}function Ei(r,e,t,n){return r=nr(7,r,n,e),r.lanes=t,r}function L0(r,e,t,n){return r=nr(22,r,n,e),r.elementType=W4,r.lanes=t,r.stateNode={isHidden:!1},r}function Pu(r,e,t){return r=nr(6,r,null,e),r.lanes=t,r}function Bu(r,e,t){return e=nr(4,r.children!==null?r.children:[],r.key,e),e.lanes=t,e.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},e}function gv(r,e,t,n,i){this.tag=e,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gu(0),this.expirationTimes=gu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gu(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nh(r,e,t,n,i,s,o,l,a){return r=new gv(r,e,t,l,a),e===1?(e=1,s===!0&&(e|=8)):e=0,s=nr(3,null,null,e),r.current=s,s.stateNode=r,s.memoizedState={element:n,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vd(s),r}function yv(r,e,t){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vg)}catch(r){console.error(r)}}Vg(),F4.exports=Ut;var lh=F4.exports;const Sv=E4(lh);var g1=lh;Dc.createRoot=g1.createRoot,Dc.hydrateRoot=g1.hydrateRoot;function Ze(r){this.content=r}Ze.prototype={constructor:Ze,find:function(r){for(var e=0;e>1}};Ze.from=function(r){if(r instanceof Ze)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Ze(e)};function Hg(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=Hg(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function qg(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let u=0,c=Math.min(o.text.length,l.text.length);for(;ue&&n(a,i+l,s||null,o)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),n,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{l.isText?(s+=l.text.slice(Math.max(e,a)-a,t-a),o=!n):l.isLeaf?(i?s+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(s+=l.type.spec.leafText(l)),o=!n):!o&&l.isBlock&&(s+=n,o=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new ct(n,i)}cutByIndex(e,t){return e==t?ct.empty:e==0&&t==this.content.length?this:new ct(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new ct(i,s)}addToStart(e){return new ct([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ct(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=this.child(n),o=i+s.nodeSize;if(o>=e)return o==e||t>0?Kl(n+1,o):Kl(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ct.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ct(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ct.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;tn.type.rank-i.type.rank),t}};pe.none=[];let i0=class extends Error{},U=class Xi{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Ug(this.content,e+this.openStart,t);return n&&new Xi(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Xi(_g(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Xi.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Xi(F.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new Xi(e,n,i)}};U.empty=new U(F.empty,0,0);function _g(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(_g(s.content,e-i-1,t-i-1)))}function Ug(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=Ug(o.content,e-s-1,t);return l&&r.replaceChild(i,o.copy(l))}function bv(r,e,t){if(t.openStart>r.depth)throw new i0("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new i0("Inconsistent open depths");return Wg(r,e,t,0)}function Wg(r,e,t,n){let i=r.index(n),s=r.node(n);if(i==e.index(n)&&n=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Ro(r,e,t,n){let i=(e||r).node(t),s=0,o=e?e.index(t):i.childCount;r&&(s=r.index(t),r.depth>t?s++:r.textOffset&&(Ni(r.nodeAfter,n),s++));for(let l=s;li&&Nf(r,e,i+1),o=n.depth>i&&Nf(t,n,i+1),l=[];return Ro(null,r,i,l),s&&o&&e.index(i)==t.index(i)?(jg(s,o),Ni(Ai(s,Yg(r,e,t,n,i+1)),l)):(s&&Ni(Ai(s,s0(r,e,i+1)),l),Ro(e,t,i,l),o&&Ni(Ai(o,s0(t,n,i+1)),l)),Ro(n,null,i,l),new F(l)}function s0(r,e,t){let n=[];if(Ro(null,r,t,n),r.depth>t){let i=Nf(r,e,t+1);Ni(Ai(i,s0(r,e,t+1)),n)}return Ro(e,null,t,n),new F(n)}function Mv(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(F.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class sl{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new o0(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,s=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(s),u=s-a;if(n.push(o,l,i+a),!u||(o=o.child(l),o.isText))break;s=u-1,i+=a+1}return new sl(t,n,s)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,s=>(n.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Jg(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=F.empty,i=0,s=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,s),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=F.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)}};Oi.prototype.text=void 0;let Ev=class Of extends Oi{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Jg(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Of(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Of(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Jg(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class $i{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Nv(e,t);if(n.next==null)return $i.empty;let i=Kg(n);n.next&&n.err("Unexpected trailing text");let s=Pv(Rv(i));return Bv(s,n),s}matchType(e){for(let t=0;tu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i{let s=i+(n.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(n.next[o].next);return s}).join(` +`)}}$i.empty=new $i(!0);class Nv{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Kg(r){let e=[];do e.push(Av(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Av(r){let e=[];do e.push(Ov(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ov(r){let e=Dv(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=zv(r,e);else break;return e}function y1(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function zv(r,e){let t=y1(r),n=t;return r.eat(",")&&(r.next!="}"?n=y1(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function Iv(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let s in t){let o=t[s];o.groups.indexOf(e)>-1&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function Dv(r){if(r.eat("(")){let e=Kg(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=Iv(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Rv(r){let e=[[]];return i(s(r,0),t()),e;function t(){return e.push([])-1}function n(o,l,a){let u={term:a,to:l};return e[o].push(u),u}function i(o,l){o.forEach(a=>a.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((a,u)=>a.concat(s(u,l)),[]);if(o.type=="seq")for(let a=0;;a++){let u=s(o.exprs[a],l);if(a==o.exprs.length-1)return u;i(u,l=t())}else if(o.type=="star"){let a=t();return n(l,a),i(s(o.expr,a),a),[n(a)]}else if(o.type=="plus"){let a=t();return i(s(o.expr,l),a),i(s(o.expr,a),a),[n(a)]}else{if(o.type=="opt")return[n(l)].concat(s(o.expr,l));if(o.type=="range"){let a=l;for(let u=0;u{r[o].forEach(({term:l,to:a})=>{if(!l)return;let u;for(let c=0;c{u||i.push([l,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let s=e[n.join(",")]=new $i(n.indexOf(r.length-1)>-1);for(let o=0;o-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tn[s]=new e3(s,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let s in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};class Lv{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class q0{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=Zg(i.attrs),this.excluded=null;let s=Xg(this.attrs);this.instance=s?new pe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new pe(this,Qg(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((s,o)=>n[s]=new q0(s,i++,t,o)),n}removeFromSet(e){for(var t=0;t-1}}class Fv{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ze.from(e.nodes),t.marks=Ze.from(e.marks||{}),this.nodes=x1.compile(this.spec.nodes,this),this.marks=q0.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;s.contentMatch=n[o]||(n[o]=$i.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.markSet=l=="_"?null:l?k1(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:k1(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof x1){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new Ev(n,n.defaultAttrs,e,pe.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Oi.fromJSON(this,e)}markFromJSON(e){return pe.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function k1(r,e){let t=[];for(let n=0;n-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}let ah=class zf{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=e.nodes[n.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let n=new S1(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new S1(this,t,!0);return n.addAll(e,t.from,t.to),U.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o{n(o=b1(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=b1(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new zf(e,zf.schemaRules(e)))}};const t3={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},$v={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},r3={ol:!0,ul:!0},l0=1,a0=2,Po=4;function w1(r,e,t){return e!=null?(e?l0:0)|(e==="full"?a0:0):r&&r.whitespace=="pre"?l0|a0:t&~Po}let Gl=class{constructor(e,t,n,i,s,o,l){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=pe.none,this.stashMarks=[],this.match=o||(l&Po?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(F.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&l0)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=F.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(F.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t{o.clearMark(l)&&(n=l.addToSet(n))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),o.consuming===!1)s=o;else break}return[t,n]}addElementByRule(e,t,n){let i,s,o;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):i=this.enter(s,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,o&&this.removePendingMark(o,l)}addAll(e,t,n){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=n==null?null:e.childNodes[n];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(n);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let u=t[l];if(u==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let t=Uv(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}};function Vv(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&r3.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Hv(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function qv(r){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,n=[];for(;t=e.exec(r);)n.push(t[1],t[2].trim());return n}function b1(r){let e={};for(let t in r)e[t]=r[t];return e}function _v(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a{if(s.length||o.marks.length){let l=0,a=0;for(;l=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Fr.renderSpec(Vu(n),i(e,t))}static renderSpec(e,t,n=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o,l=n?e.createElementNS(n,i):e.createElement(i),a=t[1],u=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){u=2;for(let c in a)if(a[c]!=null){let f=c.indexOf(" ");f>0?l.setAttributeNS(c.slice(0,f),c.slice(f+1),a[c]):l.setAttribute(c,a[c])}}for(let c=u;cu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:d,contentDOM:p}=Fr.renderSpec(e,f,n);if(l.appendChild(d),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:l,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Fr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=M1(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return M1(e.marks)}}function M1(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Vu(r){return r.document||window.document}const n3=65535,i3=Math.pow(2,16);function Wv(r,e){return r+e*i3}function T1(r){return r&n3}function jv(r){return(r-(r&n3))/i3}const s3=1,o3=2,ba=4,l3=8;let If=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&l3)>0}get deletedBefore(){return(this.delInfo&(s3|ba))>0}get deletedAfter(){return(this.delInfo&(o3|ba))>0}get deletedAcross(){return(this.delInfo&ba)>0}},Bs=class Qi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Qi.empty)return Qi.empty}recover(e){let t=0,n=T1(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[l+s],c=this.ranges[l+o],f=a+u;if(e<=f){let d=u?e==a?-1:e==f?1:t:t,p=a+i+(d<0?0:c);if(n)return p;let g=e==(t<0?a:f)?null:Wv(l/3,e-a),v=e==a?o3:e==f?s3:ba;return(t<0?e!=a:e!=f)&&(v|=l3),new If(p,v,g)}i+=c-u}return n?e+i:new If(e+i,0,null)}touches(e,t){let n=0,i=T1(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let u=this.ranges[l+s],c=a+u;if(e<=c&&l==i*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new bs;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;ns&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Mt.fromReplace(e,this.from,this.to,s)}invert(){return new kl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new po(t.pos,n.pos,this.mark)}merge(e){return e instanceof po&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new po(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new po(t.from,t.to,e.markFromJSON(t.mark))}};zt.jsonID("addMark",ch);let kl=class mo extends zt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new U(uh(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Mt.fromReplace(e,this.from,this.to,n)}invert(){return new ch(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new mo(t.pos,n.pos,this.mark)}merge(e){return e instanceof mo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new mo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new mo(t.from,t.to,e.markFromJSON(t.mark))}};zt.jsonID("removeMark",kl);let fh=class go extends zt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Mt.fromReplace(e,this.pos,this.pos+1,new U(F.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;in.pos?null:new Ma(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ma(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}};zt.jsonID("replaceAround",Ot);function Rf(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Yv(r,e,t,n){let i=[],s=[],o,l;r.doc.nodesBetween(e,t,(a,u,c)=>{if(!a.isInline)return;let f=a.marks;if(!n.isInSet(f)&&c.type.allowsMarkType(n.type)){let d=Math.max(u,e),p=Math.min(u+a.nodeSize,t),g=n.addToSet(f);for(let v=0;vr.step(a)),s.forEach(a=>r.step(a))}function Jv(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(n instanceof q0){let u=o.marks,c;for(;c=n.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let u=Math.min(l+o.nodeSize,t);for(let c=0;cr.step(new kl(o.from,o.to,o.style)))}function Kv(r,e,t,n=t.contentMatch){let i=r.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l=0;l--)r.step(s[l])}function Gv(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Js(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),s=r.$from.index(n),o=r.$to.indexAfter(n);if(nt;g--)v||n.index(g)>0?(v=!0,c=F.from(n.node(g).copy(c)),f++):a--;let d=F.empty,p=0;for(let g=s,v=!1;g>t;g--)v||i.after(g+1)=0;o--){if(n.size){let l=t[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=F.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new Ot(i,s,i,s,new U(n,0,0),t.length,!0))}function t8(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,l)=>{if(o.isTextblock&&!o.hasMarkup(n,i)&&r8(r.doc,r.mapping.slice(s).map(l),n)){r.clearIncompatible(r.mapping.slice(s).map(l,1),n);let a=r.mapping.slice(s),u=a.map(l,1),c=a.map(l+o.nodeSize,1);return r.step(new Ot(u,c,u+1,c-1,new U(F.from(n.create(i,null,o.marks)),0,0),1,!0)),!1}})}function r8(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function n8(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new Ot(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new U(F.from(o),0,0),1,!0))}function Ms(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>s;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),g=n&&n[c+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let v=n&&n[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function i8(r,e,t=1,n){let i=r.doc.resolve(e),s=F.empty,o=F.empty;for(let l=i.depth,a=i.depth-t,u=t-1;l>a;l--,u--){s=F.from(i.node(l).copy(s));let c=n&&n[u];o=F.from(c?c.type.create(c.attrs,o):i.node(l).copy(o))}r.step(new yn(e,e,new U(s.append(o),t,t),!0))}function ni(r,e){let t=r.resolve(e),n=t.index();return a3(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function a3(r,e){return!!(r&&e&&!r.isLeaf&&r.canAppend(e))}function u3(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&a3(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function s8(r,e,t){let n=new yn(e-t,e+t,U.empty,!0);r.step(n)}function o8(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,a=n.index(o)+(l>0?1:0),u=n.node(o),c=!1;if(s==1)c=u.canReplace(a,a,i);else{let f=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(a,a,f[0])}if(c)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function ph(r,e,t=e,n=U.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return f3(i,s,n)?new yn(e,t,n):new l8(i,s,n).fit()}function f3(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}let l8=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=F.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=F.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new U(s,o,l);return e>-1?new Ot(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new yn(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=qu(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,f=null;if(t==1&&(o?u.matchType(o.type)||(f=u.fillBefore(F.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:f};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=qu(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new U(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=qu(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new U(yo(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new U(yo(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v1||a==0||v.content.size)&&(f=T,c.push(d3(v.mark(d.allowedMarks(v.marks)),u==1?a:0,u==l.childCount?p:-1)))}let g=u==l.childCount;g||(p=-1),this.placed=vo(this.placed,t,F.from(c)),this.frontier[t].match=f,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,T=l;v1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t=0;l--){let{match:a,type:u}=this.frontier[l],c=_u(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=vo(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=vo(this.placed,this.depth,F.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(F.empty,!0);t.childCount&&(this.placed=vo(this.placed,this.frontier.length,t))}};function yo(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(yo(r.firstChild.content,e-1,t)))}function vo(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(vo(r.lastChild.content,e-1,t)))}function qu(r,e){for(let t=0;t1&&(n=n.replaceChild(0,d3(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(F.empty,!0)))),r.copy(n)}function _u(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!a8(t,s.content,o)?l:null}function a8(r,e,t){for(let n=t;n0;d--,p--){let g=i.node(d).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(d)>-1?l=d:i.before(d)==p&&o.splice(1,0,-d)}let a=o.indexOf(l),u=[],c=n.openStart;for(let d=n.content,p=0;;p++){let g=d.firstChild;if(u.push(g),p==n.openStart)break;d=g.content}for(let d=c-1;d>=0;d--){let p=u[d].type,g=u8(p);if(g&&i.node(a).type!=p)c=d;else if(g||!p.isTextblock)break}for(let d=n.openStart;d>=0;d--){let p=(d+c+1)%(n.openStart+1),g=u[p];if(g)for(let v=0;v=0&&(r.replace(e,t,n),!(r.steps.length>f));d--){let p=o[d];p<0||(e=i.before(p),t=s.after(p))}}function h3(r,e,t,n,i){if(en){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(F.empty,!0))}return r}function f8(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=o8(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new U(F.from(n),0,0))}function d8(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),s=p3(n,i);for(let o=0;o0&&(a||n.node(l-1).canReplace(n.index(l-1),i.indexAfter(l-1))))return r.delete(n.before(l),i.after(l))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o)return r.delete(n.before(o),t);r.delete(e,t)}function p3(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(se.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}let m3=class Ta extends zt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return Mt.fromReplace(e,this.pos,this.pos+1,new U(F.from(i),0,t.isLeaf?0:1))}getMap(){return Bs.empty}invert(e){return new Ta(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ta(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ta(t.pos,t.attr,t.value)}};zt.jsonID("attr",m3);let Ls=class extends Error{};Ls=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};Ls.prototype=Object.create(Error.prototype);Ls.prototype.constructor=Ls;Ls.prototype.name="TransformError";class h8{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new bs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ls(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=U.empty){let i=ph(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new U(F.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return c8(this,e,t,n),this}replaceRangeWith(e,t,n){return f8(this,e,t,n),this}deleteRange(e,t){return d8(this,e,t),this}lift(e,t){return Xv(this,e,t),this}join(e,t=1){return s8(this,e,t),this}wrap(e,t){return e8(this,e,t),this}setBlockType(e,t=e,n,i=null){return t8(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return n8(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new m3(e,t,n)),this}addNodeMark(e,t){return this.step(new fh(e,t)),this}removeNodeMark(e,t){if(!(t instanceof pe)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t=t.isInSet(n.marks),!t)return this}return this.step(new dh(e,t)),this}split(e,t=1,n){return i8(this,e,t,n),this}addMark(e,t,n){return Yv(this,e,t,n),this}removeMark(e,t,n){return Jv(this,e,t,n),this}clearIncompatible(e,t,n){return Kv(this,e,t,n),this}}const Uu=Object.create(null);let ie=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new p8(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;s--){let o=t<0?Zi(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):Zi(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new zi(e.node(0))}static atStart(e){return Zi(e,e,0,0,1)||new zi(e)}static atEnd(e){return Zi(e,e,e.content.size,e.childCount,-1)||new zi(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Uu[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Uu)throw new RangeError("Duplicate use of selection JSON ID "+e);return Uu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return oe.between(this.$anchor,this.$head).getBookmark()}};ie.prototype.visible=!0;let p8=class{constructor(e,t){this.$from=e,this.$to=t}},E1=!1;function N1(r){!E1&&!r.parent.inlineContent&&(E1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}let oe=class xo extends ie{constructor(e,t=e){N1(e),N1(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return ie.near(n);let i=e.resolve(t.map(this.anchor));return new xo(i.parent.inlineContent?i:n,n)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof xo&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new g3(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new xo(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=ie.findFrom(t,n,!0)||ie.findFrom(t,-n,!0);if(s)t=s.$head;else return ie.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(ie.findFrom(e,-n,!0)||ie.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&te.isSelectable(l))return te.create(r,t-(i<0?l.nodeSize:0))}else{let a=Zi(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function A1(r,e,t){let n=r.steps.length-1;if(n{o==null&&(o=c)}),r.setSelection(ie.near(r.doc.resolve(o),t))}const O1=1,Xl=2,z1=4;class y8 extends h8{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Xl,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Xl)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Xl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||pe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),n=n??t,!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),this.selection.empty||this.setSelection(ie.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=z1,this}get scrolledIntoView(){return(this.updated&z1)>0}}function I1(r,e){return!e||!r?r:r.bind(e)}let wo=class{constructor(e,t,n){this.name=e,this.init=I1(t.init,n),this.apply=I1(t.apply,n)}};const v8=[new wo("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new wo("selection",{init(r,e){return r.selection||ie.atStart(e.doc)},apply(r){return r.selection}}),new wo("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new wo("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class Wu{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=v8.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new wo(n.key,n.spec.state,n))})}}class ms{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;nn.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Wu(e.schema,e.plugins),s=new ms(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Oi.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=ie.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let l in n){let a=n[l],u=a.spec.state;if(a.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){s[o.name]=u.fromJSON.call(a,e,t[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function x3(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=x3(i,e,{})),t[n]=i}return t}let dr=class{constructor(e){this.spec=e,this.props={},e.props&&x3(e.props,this,this.props),this.key=e.key?e.key.key:k3("plugin")}getState(e){return e[this.key]}};const ju=Object.create(null);function k3(r){return r in ju?r+"$"+ ++ju[r]:(ju[r]=0,r+"$")}let ii=class{constructor(e="key"){this.key=k3(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const er=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},ol=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let D1=null;const Qr=function(r,e,t){let n=D1||(D1=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},Vi=function(r,e,t,n){return t&&(R1(r,e,t,n,-1)||R1(r,e,t,n,1))},x8=/^(img|br|input|textarea|hr)$/i;function R1(r,e,t,n,i){for(;;){if(r==t&&e==n)return!0;if(e==(i<0?0:Lr(r))){let s=r.parentNode;if(!s||s.nodeType!=1||w8(r)||x8.test(r.nodeName)||r.contentEditable=="false")return!1;e=er(r)+(i<0?0:1),r=s}else if(r.nodeType==1){if(r=r.childNodes[e+(i<0?-1:0)],r.contentEditable=="false")return!1;e=i<0?Lr(r):0}else return!1}}function Lr(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function k8(r,e,t){for(let n=e==0,i=e==Lr(r);n||i;){if(r==t)return!0;let s=er(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==Lr(r)}}function w8(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const _0=function(r){return r.focusNode&&Vi(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function pi(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function S8(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function b8(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:n.startOffset}}}const _r=typeof navigator<"u"?navigator:null,P1=typeof document<"u"?document:null,si=_r&&_r.userAgent||"",Pf=/Edge\/(\d+)/.exec(si),w3=/MSIE \d/.exec(si),Bf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(si),Nt=!!(w3||Bf||Pf),_n=w3?document.documentMode:Bf?+Bf[1]:Pf?+Pf[1]:0,Cr=!Nt&&/gecko\/(\d+)/i.test(si);Cr&&+(/Firefox\/(\d+)/.exec(si)||[0,0])[1];const Lf=!Nt&&/Chrome\/(\d+)/.exec(si),lt=!!Lf,M8=Lf?+Lf[1]:0,pt=!Nt&&!!_r&&/Apple Computer/.test(_r.vendor),Fs=pt&&(/Mobile\/\w+/.test(si)||!!_r&&_r.maxTouchPoints>2),Kt=Fs||(_r?/Mac/.test(_r.platform):!1),T8=_r?/Win/.test(_r.platform):!1,kr=/Android \d/.test(si),U0=!!P1&&"webkitFontSmoothing"in P1.documentElement.style,C8=U0?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function E8(r){return{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function wn(r,e){return typeof r=="number"?r:r[e]}function N8(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function B1(r,e,t){let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;o=ol(o)){if(o.nodeType!=1)continue;let l=o,a=l==s.body,u=a?E8(s):N8(l),c=0,f=0;if(e.topu.bottom-wn(n,"bottom")&&(f=e.bottom-u.bottom+wn(i,"bottom")),e.leftu.right-wn(n,"right")&&(c=e.right-u.right+wn(i,"right")),c||f)if(a)s.defaultView.scrollBy(c,f);else{let d=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),c&&(l.scrollLeft+=c);let g=l.scrollLeft-d,v=l.scrollTop-p;e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v}}if(a)break}}function A8(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o=t-20){n=l,i=a.top;break}}return{refDOM:n,refTop:i,stack:S3(r.dom)}}function S3(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=ol(n));return e}function O8({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;b3(t,n==0?0:n-e)}function b3(r,e){for(let t=0;t=l){o=Math.max(g.bottom,o),l=Math.min(g.top,l);let v=g.left>e.left?g.left-e.left:g.right=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!a&&g.left<=e.left&&g.right>=e.left&&(a=c,u={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!t&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(s=f+1)}}return!t&&a&&(t=a,i=u,n=0),t&&t.nodeType==3?I8(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:M3(t,i)}function I8(r,e){let t=r.nodeValue.length,n=document.createRange();for(let i=0;i=(s.left+s.right)/2?1:0)}}return{node:r,offset:0}}function mh(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function D8(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function P8(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let l=r.docView.nearestDesc(s,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!o||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!o&&(o=!0,a.left>n.left||a.top>n.top?i=l.posBefore:(a.right-1?i:r.docView.posFromDOM(e,t,-1)}function T3(r,e,t){let n=r.childNodes.length;if(n&&t.tope.top&&i++}n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?l=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(l=P8(r,n,i,e))}l==null&&(l=R8(r,o,e));let a=r.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function L1(r){return r.top=0&&i==n.nodeValue.length?(a--,c=1):t<0?a--:u++,oo(Mn(Qr(n,a,u),c),c<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==Lr(n))){let a=n.childNodes[i-1];if(a.nodeType==1)return Yu(a.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(t<0||i==Lr(n))){let a=n.childNodes[i-1],u=a.nodeType==3?Qr(a,Lr(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return oo(Mn(u,1),!1)}if(s==null&&i=0)}function oo(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function Yu(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function E3(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function F8(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return E3(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=r.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=C3(r,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Qr(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const $8=/[\u0590-\u08ac]/;function V8(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,l=r.domSelection();return!$8.test(n.parent.textContent)||!l.modify?t=="left"||t=="backward"?s:o:E3(r,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:f}=r.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",t,"character");let p=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:g,focusOffset:v}=r.domSelectionRange(),T=g&&!p.contains(g.nodeType==1?g:g.parentNode)||a==g&&u==v;try{l.collapse(c,f),a&&(a!=c||u!=f)&&l.extend&&l.extend(a,u)}catch{}return d!=null&&(l.caretBidiLevel=d),T})}let F1=null,$1=null,V1=!1;function H8(r,e,t){return F1==e&&$1==t?V1:(F1=e,$1=t,V1=t=="up"||t=="down"?F8(r,e,t):V8(r,e,t))}const lr=0,H1=1,xi=2,Ur=3;class wl{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=lr,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;ter(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||o instanceof A3){i=e-s;break}s=l}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof N3&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?er(s.dom)+1:0}}else{let s,o=!0;for(;s=n=c&&t<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,c);e=o;for(let f=l;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=er(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>t||l==this.children.length-1)){t=u;for(let c=l+1;cp&&ot){let p=l;l=a,a=p}let d=document.createRange();d.setEnd(a.node,a.offset),d.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i=n:en){let l=n+s.border,a=o-s.border;if(e>=l&&t<=a){this.dirty=e==n||t==o?xi:H1,e==l&&t==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Ur:s.markDirty(e-l,t-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?xi:Ur}n=o}this.dirty=xi}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?xi:H1;t.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==lr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class q8 extends wl{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Hi extends wl{constructor(e,t,n,i){super(e,[],n,i),this.mark=t}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=Fr.renderSpec(document,t.type.spec.toDOM(t,n))),new Hi(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Ur||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Ur&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=lr){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(s=Vf(s,0,e,n));for(let l=0;l{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},n,i),c=u&&u.dom,f=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=Fr.renderSpec(document,t.type.spec.toDOM(t)));!f&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=I3(c,n,t),u?a=new _8(e,t,n,i,c,f||null,d,u,s,o+1):t.isText?new W0(e,t,n,i,c,d,s):new Un(e,t,n,i,c,f||null,d,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,t,n){return this.dirty==lr&&e.eq(this.node)&&$f(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new W8(this,o&&o.node,e);J8(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?a.syncToMarks(u.spec.marks,n,e):u.type.side>=0&&!f&&a.syncToMarks(c==this.node.childCount?pe.none:this.node.child(c).marks,n,e),a.placeWidget(u,e,i)},(u,c,f,d)=>{a.syncToMarks(u.marks,n,e);let p;a.findNodeMatch(u,c,f,d)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(u,c,f,p,e)||a.updateNextNode(u,c,f,e,d,i)||a.addNode(u,c,f,e,i),i+=u.nodeSize}),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==xi)&&(o&&this.protectLocalComposition(e,o),O3(this.contentDOM,this.children,e),Fs&&K8(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof oe)||nt+this.node.content.size)return null;let s=e.domSelectionRange(),o=G8(s.focusNode,s.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let l=o.nodeValue,a=X8(this.node.content,l,n-t,i-t);return a<0?null:{node:o,pos:a,text:l}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new q8(this,s,t,i);e.input.compositionNodes.push(o),this.children=Vf(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==Ur||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=lr}updateOuterDeco(e){if($f(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=z3(this.dom,this.nodeDOM,Ff(this.outerDeco,this.node,t),Ff(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function q1(r,e,t,n,i){I3(n,e,r);let s=new Un(void 0,r,e,t,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class W0 extends Un{constructor(e,t,n,i,s,o,l){super(e,t,n,i,s,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==Ur||this.dirty!=lr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=lr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=lr,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new W0(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ur)}get domAtom(){return!1}}class A3 extends wl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==lr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class _8 extends Un{constructor(e,t,n,i,s,o,l,a,u,c){super(e,t,n,i,s,o,l,u,c),this.spec=a}update(e,t,n,i){if(this.dirty==Ur)return!1;if(this.spec.update){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function O3(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s>1,o=Math.min(s,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Hi.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(n){let u=t.children[n-1];if(u instanceof Hi)t=u,n=u.children.length;else{l=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=r.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function Y8(r,e){return r.type.side-e.type.side}function J8(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let u=0;us;)l.push(i[o++]);let d=s+c.nodeSize;if(c.isText){let g=d;o!g.inline):l.slice();n(c,p,e.forChild(s,c),f),s=d}}function K8(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function G8(r,e){for(;;){if(r.nodeType==3)return r;if(r.nodeType==1&&e>0){if(r.childNodes.length>e&&r.childNodes[e].nodeType==3)return r.childNodes[e];r=r.childNodes[e-1],e=Lr(r)}else if(r.nodeType==1&&e=t){let u=l=0&&u+e.length+l>=t)return l+u;if(t==n&&a.length>=n+e.length-l&&a.slice(n-l,n-l+e.length)==e)return n}}return-1}function Vf(r,e,t,n,i){let s=[];for(let o=0,l=0;o=t||c<=e?s.push(a):(ut&&s.push(a.slice(t-u,a.size,n)))}return s}function gh(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=n.resolve(o),a,u;if(_0(t)){for(a=l;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&te.isSelectable(c)&&i.parent&&!(c.isInline&&k8(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;u=new te(o==f?l:n.resolve(f))}}else{let c=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;a=n.resolve(c)}if(!u){let c=e=="pointer"||r.state.selection.head{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!D3(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function Z8(r){let e=r.domSelection(),t=document.createRange(),n=r.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.setEnd(n.parentNode,er(n)+1):t.setEnd(n,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!r.state.selection.visible&&Nt&&_n<=11&&(n.disabled=!0,n.disabled=!1)}function R3(r,e){if(e instanceof te){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(Y1(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else Y1(r)}function Y1(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function yh(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||oe.between(e,t,n)}function J1(r){return r.editable&&!r.hasFocus()?!1:P3(r)}function P3(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function e9(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return Vi(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Hf(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ie.findFrom(s,e)}function mi(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function K1(r,e,t){let n=r.state.selection;if(n instanceof oe){if(!n.empty||t.indexOf("s")>-1)return!1;if(r.endOfTextblock(e>0?"forward":"backward")){let i=Hf(r.state,e);return i&&i instanceof te?mi(r,i):!1}else if(!(Kt&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(l))&&!o.contentDOM?te.isSelectable(s)?mi(r,new te(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):U0?mi(r,new oe(r.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else{if(n instanceof te&&n.node.isInline)return mi(r,new oe(e>0?n.$to:n.$from));{let i=Hf(r.state,e);return i?mi(r,i):!1}}}function u0(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Lo(r){let e=r.pmViewDesc;return e&&e.size==0&&(r.nextSibling||r.nodeName!="BR")}function lo(r,e){return e<0?t9(r):B3(r)}function t9(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for(Cr&&t.nodeType==1&&n0){if(t.nodeType!=1)break;{let l=t.childNodes[n-1];if(Lo(l))i=t,s=--n;else if(l.nodeType==3)t=l,n=t.nodeValue.length;else break}}else{if(L3(t))break;{let l=t.previousSibling;for(;l&&Lo(l);)i=t.parentNode,s=er(l),l=l.previousSibling;if(l)t=l,n=u0(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?qf(r,t,n):i&&qf(r,i,s)}function B3(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=u0(t),s,o;for(;;)if(n{r.state==i&&on(r)},50)}function G1(r,e){let t=r.state.doc.resolve(e);if(!(lt||T8)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o1)return s.lefti.top&&o1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function X1(r,e,t){let n=r.state.selection;if(n instanceof oe&&!n.empty||t.indexOf("s")>-1||Kt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=Hf(r.state,e);if(o&&o instanceof te)return mi(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=n instanceof zi?ie.near(o,e):ie.findFrom(o,e);return l?mi(r,l):!1}return!1}function Q1(r,e){if(!(r.state.selection instanceof oe))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function Z1(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function r9(r){if(!pt||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Z1(r,n,"true"),setTimeout(()=>Z1(r,n,"false"),20)}return!1}function n9(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function i9(r,e){let t=e.keyCode,n=n9(e);if(t==8||Kt&&t==72&&n=="c")return Q1(r,-1)||lo(r,-1);if(t==46||Kt&&t==68&&n=="c")return Q1(r,1)||lo(r,1);if(t==13||t==27)return!0;if(t==37||Kt&&t==66&&n=="c"){let i=t==37?G1(r,r.state.selection.from)=="ltr"?-1:1:-1;return K1(r,i,n)||lo(r,i)}else if(t==39||Kt&&t==70&&n=="c"){let i=t==39?G1(r,r.state.selection.from)=="ltr"?1:-1:1;return K1(r,i,n)||lo(r,i)}else{if(t==38||Kt&&t==80&&n=="c")return X1(r,-1,n)||lo(r,-1);if(t==40||Kt&&t==78&&n=="c")return r9(r)||X1(r,1,n)||B3(r);if(n==(Kt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function F3(r,e){r.someProp("transformCopied",p=>{e=p(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let p=n.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let o=r.someProp("clipboardSerializer")||Fr.fromSchema(r.state.schema),l=U3(),a=l.createElement("div");a.appendChild(o.serializeFragment(n,{document:l}));let u=a.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=_3[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let g=l.createElement(c[p]);for(;a.firstChild;)g.appendChild(a.firstChild);a.appendChild(g),f++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${JSON.stringify(t)}`);let d=r.someProp("clipboardTextSerializer",p=>p(e,r))||e.content.textBetween(0,e.content.size,` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=pe.none,n=pe.none;for(let i=0;i{o.clearMark(l)&&(n=l.addToSet(n))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),o.consuming===!1)s=o;else break}return[t,n]}addElementByRule(e,t,n){let i,s,o;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):i=this.enter(s,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,o&&this.removePendingMark(o,l)}addAll(e,t,n){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=n==null?null:e.childNodes[n];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(n);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let u=t[l];if(u==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let t=Uv(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}};function Vv(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&r3.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function Hv(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function qv(r){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,n=[];for(;t=e.exec(r);)n.push(t[1],t[2].trim());return n}function b1(r){let e={};for(let t in r)e[t]=r[t];return e}function _v(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a{if(s.length||o.marks.length){let l=0,a=0;for(;l=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(n),n=s.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&$r.renderSpec(Vu(n),i(e,t))}static renderSpec(e,t,n=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let o,l=n?e.createElementNS(n,i):e.createElement(i),a=t[1],u=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){u=2;for(let c in a)if(a[c]!=null){let f=c.indexOf(" ");f>0?l.setAttributeNS(c.slice(0,f),c.slice(f+1),a[c]):l.setAttribute(c,a[c])}}for(let c=u;cu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:d,contentDOM:p}=$r.renderSpec(e,f,n);if(l.appendChild(d),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:l,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new $r(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=M1(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return M1(e.marks)}}function M1(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Vu(r){return r.document||window.document}const n3=65535,i3=Math.pow(2,16);function Wv(r,e){return r+e*i3}function T1(r){return r&n3}function jv(r){return(r-(r&n3))/i3}const s3=1,o3=2,ba=4,l3=8;let If=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&l3)>0}get deletedBefore(){return(this.delInfo&(s3|ba))>0}get deletedAfter(){return(this.delInfo&(o3|ba))>0}get deletedAcross(){return(this.delInfo&ba)>0}},Bs=class Qi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Qi.empty)return Qi.empty}recover(e){let t=0,n=T1(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[l+s],c=this.ranges[l+o],f=a+u;if(e<=f){let d=u?e==a?-1:e==f?1:t:t,p=a+i+(d<0?0:c);if(n)return p;let g=e==(t<0?a:f)?null:Wv(l/3,e-a),v=e==a?o3:e==f?s3:ba;return(t<0?e!=a:e!=f)&&(v|=l3),new If(p,v,g)}i+=c-u}return n?e+i:new If(e+i,0,null)}touches(e,t){let n=0,i=T1(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let u=this.ranges[l+s],c=a+u;if(e<=c&&l==i*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new bs;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;ns&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return Mt.fromReplace(e,this.from,this.to,s)}invert(){return new kl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new po(t.pos,n.pos,this.mark)}merge(e){return e instanceof po&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new po(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new po(t.from,t.to,e.markFromJSON(t.mark))}};zt.jsonID("addMark",ch);let kl=class mo extends zt{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new U(uh(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Mt.fromReplace(e,this.from,this.to,n)}invert(){return new ch(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new mo(t.pos,n.pos,this.mark)}merge(e){return e instanceof mo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new mo(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new mo(t.from,t.to,e.markFromJSON(t.mark))}};zt.jsonID("removeMark",kl);let fh=class go extends zt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Mt.fromReplace(e,this.pos,this.pos+1,new U(F.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;in.pos?null:new Ma(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ma(t.from,t.to,t.gapFrom,t.gapTo,U.fromJSON(e,t.slice),t.insert,!!t.structure)}};zt.jsonID("replaceAround",Ot);function Rf(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Yv(r,e,t,n){let i=[],s=[],o,l;r.doc.nodesBetween(e,t,(a,u,c)=>{if(!a.isInline)return;let f=a.marks;if(!n.isInSet(f)&&c.type.allowsMarkType(n.type)){let d=Math.max(u,e),p=Math.min(u+a.nodeSize,t),g=n.addToSet(f);for(let v=0;vr.step(a)),s.forEach(a=>r.step(a))}function Jv(r,e,t,n){let i=[],s=0;r.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;s++;let a=null;if(n instanceof q0){let u=o.marks,c;for(;c=n.isInSet(u);)(a||(a=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(a=[n]):a=o.marks;if(a&&a.length){let u=Math.min(l+o.nodeSize,t);for(let c=0;cr.step(new kl(o.from,o.to,o.style)))}function Kv(r,e,t,n=t.contentMatch){let i=r.doc.nodeAt(e),s=[],o=e+1;for(let l=0;l=0;l--)r.step(s[l])}function Gv(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Js(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),s=r.$from.index(n),o=r.$to.indexAfter(n);if(nt;g--)v||n.index(g)>0?(v=!0,c=F.from(n.node(g).copy(c)),f++):a--;let d=F.empty,p=0;for(let g=s,v=!1;g>t;g--)v||i.after(g+1)=0;o--){if(n.size){let l=t[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=F.from(t[o].type.create(t[o].attrs,n))}let i=e.start,s=e.end;r.step(new Ot(i,s,i,s,new U(n,0,0),t.length,!0))}function t8(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=r.steps.length;r.doc.nodesBetween(e,t,(o,l)=>{if(o.isTextblock&&!o.hasMarkup(n,i)&&r8(r.doc,r.mapping.slice(s).map(l),n)){r.clearIncompatible(r.mapping.slice(s).map(l,1),n);let a=r.mapping.slice(s),u=a.map(l,1),c=a.map(l+o.nodeSize,1);return r.step(new Ot(u,c,u+1,c-1,new U(F.from(n.create(i,null,o.marks)),0,0),1,!0)),!1}})}function r8(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function n8(r,e,t,n,i){let s=r.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let o=t.create(n,null,i||s.marks);if(s.isLeaf)return r.replaceWith(e,e+s.nodeSize,o);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new Ot(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new U(F.from(o),0,0),1,!0))}function Ms(r,e,t=1,n){let i=r.resolve(e),s=i.depth-t,o=n&&n[n.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>s;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),g=n&&n[c+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let v=n&&n[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function i8(r,e,t=1,n){let i=r.doc.resolve(e),s=F.empty,o=F.empty;for(let l=i.depth,a=i.depth-t,u=t-1;l>a;l--,u--){s=F.from(i.node(l).copy(s));let c=n&&n[u];o=F.from(c?c.type.create(c.attrs,o):i.node(l).copy(o))}r.step(new yn(e,e,new U(s.append(o),t,t),!0))}function ni(r,e){let t=r.resolve(e),n=t.index();return a3(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function a3(r,e){return!!(r&&e&&!r.isLeaf&&r.canAppend(e))}function u3(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&a3(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function s8(r,e,t){let n=new yn(e-t,e+t,U.empty,!0);r.step(n)}function o8(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let s=n.index(i);if(n.node(i).canReplaceWith(s,s,t))return n.before(i+1);if(s>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let s=n.indexAfter(i);if(n.node(i).canReplaceWith(s,s,t))return n.after(i+1);if(s=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,a=n.index(o)+(l>0?1:0),u=n.node(o),c=!1;if(s==1)c=u.canReplace(a,a,i);else{let f=u.contentMatchAt(a).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(a,a,f[0])}if(c)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function ph(r,e,t=e,n=U.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return f3(i,s,n)?new yn(e,t,n):new l8(i,s,n).fit()}function f3(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}let l8=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=F.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=F.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new U(s,o,l);return e>-1?new Ot(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new yn(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=qu(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,f=null;if(t==1&&(o?u.matchType(o.type)||(f=u.fillBefore(F.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:f};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=qu(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new U(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=qu(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new U(yo(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new U(yo(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v1||a==0||v.content.size)&&(f=T,c.push(d3(v.mark(d.allowedMarks(v.marks)),u==1?a:0,u==l.childCount?p:-1)))}let g=u==l.childCount;g||(p=-1),this.placed=vo(this.placed,t,F.from(c)),this.frontier[t].match=f,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,T=l;v1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t=0;l--){let{match:a,type:u}=this.frontier[l],c=_u(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=vo(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=vo(this.placed,this.depth,F.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(F.empty,!0);t.childCount&&(this.placed=vo(this.placed,this.frontier.length,t))}};function yo(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(yo(r.firstChild.content,e-1,t)))}function vo(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(vo(r.lastChild.content,e-1,t)))}function qu(r,e){for(let t=0;t1&&(n=n.replaceChild(0,d3(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(F.empty,!0)))),r.copy(n)}function _u(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!a8(t,s.content,o)?l:null}function a8(r,e,t){for(let n=t;n0;d--,p--){let g=i.node(d).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(d)>-1?l=d:i.before(d)==p&&o.splice(1,0,-d)}let a=o.indexOf(l),u=[],c=n.openStart;for(let d=n.content,p=0;;p++){let g=d.firstChild;if(u.push(g),p==n.openStart)break;d=g.content}for(let d=c-1;d>=0;d--){let p=u[d].type,g=u8(p);if(g&&i.node(a).type!=p)c=d;else if(g||!p.isTextblock)break}for(let d=n.openStart;d>=0;d--){let p=(d+c+1)%(n.openStart+1),g=u[p];if(g)for(let v=0;v=0&&(r.replace(e,t,n),!(r.steps.length>f));d--){let p=o[d];p<0||(e=i.before(p),t=s.after(p))}}function h3(r,e,t,n,i){if(en){let s=i.contentMatchAt(0),o=s.fillBefore(r).append(r);r=o.append(s.matchFragment(o).fillBefore(F.empty,!0))}return r}function f8(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=o8(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new U(F.from(n),0,0))}function d8(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),s=p3(n,i);for(let o=0;o0&&(a||n.node(l-1).canReplace(n.index(l-1),i.indexAfter(l-1))))return r.delete(n.before(l),i.after(l))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o)return r.delete(n.before(o),t);r.delete(e,t)}function p3(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let s=r.start(i);if(se.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}let m3=class Ta extends zt{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Mt.fail("No node at attribute step's position");let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return Mt.fromReplace(e,this.pos,this.pos+1,new U(F.from(i),0,t.isLeaf?0:1))}getMap(){return Bs.empty}invert(e){return new Ta(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ta(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ta(t.pos,t.attr,t.value)}};zt.jsonID("attr",m3);let Ls=class extends Error{};Ls=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};Ls.prototype=Object.create(Error.prototype);Ls.prototype.constructor=Ls;Ls.prototype.name="TransformError";class h8{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new bs}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ls(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=U.empty){let i=ph(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new U(F.from(n),0,0))}delete(e,t){return this.replace(e,t,U.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return c8(this,e,t,n),this}replaceRangeWith(e,t,n){return f8(this,e,t,n),this}deleteRange(e,t){return d8(this,e,t),this}lift(e,t){return Xv(this,e,t),this}join(e,t=1){return s8(this,e,t),this}wrap(e,t){return e8(this,e,t),this}setBlockType(e,t=e,n,i=null){return t8(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return n8(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new m3(e,t,n)),this}addNodeMark(e,t){return this.step(new fh(e,t)),this}removeNodeMark(e,t){if(!(t instanceof pe)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t=t.isInSet(n.marks),!t)return this}return this.step(new dh(e,t)),this}split(e,t=1,n){return i8(this,e,t,n),this}addMark(e,t,n){return Yv(this,e,t,n),this}removeMark(e,t,n){return Jv(this,e,t,n),this}clearIncompatible(e,t,n){return Kv(this,e,t,n),this}}const Uu=Object.create(null);let ie=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new p8(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;s--){let o=t<0?Zi(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):Zi(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new zi(e.node(0))}static atStart(e){return Zi(e,e,0,0,1)||new zi(e)}static atEnd(e){return Zi(e,e,e.content.size,e.childCount,-1)||new zi(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=Uu[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Uu)throw new RangeError("Duplicate use of selection JSON ID "+e);return Uu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return oe.between(this.$anchor,this.$head).getBookmark()}};ie.prototype.visible=!0;let p8=class{constructor(e,t){this.$from=e,this.$to=t}},E1=!1;function N1(r){!E1&&!r.parent.inlineContent&&(E1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}let oe=class xo extends ie{constructor(e,t=e){N1(e),N1(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return ie.near(n);let i=e.resolve(t.map(this.anchor));return new xo(i.parent.inlineContent?i:n,n)}replace(e,t=U.empty){if(super.replace(e,t),t==U.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof xo&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new g3(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new xo(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=ie.findFrom(t,n,!0)||ie.findFrom(t,-n,!0);if(s)t=s.$head;else return ie.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(ie.findFrom(e,-n,!0)||ie.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&te.isSelectable(l))return te.create(r,t-(i<0?l.nodeSize:0))}else{let a=Zi(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function A1(r,e,t){let n=r.steps.length-1;if(n{o==null&&(o=c)}),r.setSelection(ie.near(r.doc.resolve(o),t))}const O1=1,Xl=2,z1=4;class y8 extends h8{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Xl,this}ensureMarks(e){return pe.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Xl)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Xl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||pe.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(n==null&&(n=t),n=n??t,!e)return this.deleteRange(t,n);let s=this.storedMarks;if(!s){let o=this.doc.resolve(t);s=n==t?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,s)),this.selection.empty||this.setSelection(ie.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=z1,this}get scrolledIntoView(){return(this.updated&z1)>0}}function I1(r,e){return!e||!r?r:r.bind(e)}let wo=class{constructor(e,t,n){this.name=e,this.init=I1(t.init,n),this.apply=I1(t.apply,n)}};const v8=[new wo("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new wo("selection",{init(r,e){return r.selection||ie.atStart(e.doc)},apply(r){return r.selection}}),new wo("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new wo("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}})];class Wu{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=v8.slice(),t&&t.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new wo(n.key,n.spec.state,n))})}}class ms{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;nn.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[n],s=i.spec.state;s&&s.toJSON&&(t[n]=s.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Wu(e.schema,e.plugins),s=new ms(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=Oi.fromJSON(e.schema,t.doc);else if(o.name=="selection")s.selection=ie.fromJSON(s.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let l in n){let a=n[l],u=a.spec.state;if(a.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){s[o.name]=u.fromJSON.call(a,e,t[l],s);return}}s[o.name]=o.init(e,s)}}),s}}function x3(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=x3(i,e,{})),t[n]=i}return t}let dr=class{constructor(e){this.spec=e,this.props={},e.props&&x3(e.props,this,this.props),this.key=e.key?e.key.key:k3("plugin")}getState(e){return e[this.key]}};const ju=Object.create(null);function k3(r){return r in ju?r+"$"+ ++ju[r]:(ju[r]=0,r+"$")}let ii=class{constructor(e="key"){this.key=k3(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};const er=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},ol=function(r){let e=r.assignedSlot||r.parentNode;return e&&e.nodeType==11?e.host:e};let D1=null;const Zr=function(r,e,t){let n=D1||(D1=document.createRange());return n.setEnd(r,t??r.nodeValue.length),n.setStart(r,e||0),n},Vi=function(r,e,t,n){return t&&(R1(r,e,t,n,-1)||R1(r,e,t,n,1))},x8=/^(img|br|input|textarea|hr)$/i;function R1(r,e,t,n,i){for(;;){if(r==t&&e==n)return!0;if(e==(i<0?0:Fr(r))){let s=r.parentNode;if(!s||s.nodeType!=1||w8(r)||x8.test(r.nodeName)||r.contentEditable=="false")return!1;e=er(r)+(i<0?0:1),r=s}else if(r.nodeType==1){if(r=r.childNodes[e+(i<0?-1:0)],r.contentEditable=="false")return!1;e=i<0?Fr(r):0}else return!1}}function Fr(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function k8(r,e,t){for(let n=e==0,i=e==Fr(r);n||i;){if(r==t)return!0;let s=er(r);if(r=r.parentNode,!r)return!1;n=n&&s==0,i=i&&s==Fr(r)}}function w8(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const _0=function(r){return r.focusNode&&Vi(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function pi(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}function S8(r){let e=r.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function b8(r,e,t){if(r.caretPositionFromPoint)try{let n=r.caretPositionFromPoint(e,t);if(n)return{node:n.offsetNode,offset:n.offset}}catch{}if(r.caretRangeFromPoint){let n=r.caretRangeFromPoint(e,t);if(n)return{node:n.startContainer,offset:n.startOffset}}}const Ur=typeof navigator<"u"?navigator:null,P1=typeof document<"u"?document:null,si=Ur&&Ur.userAgent||"",Pf=/Edge\/(\d+)/.exec(si),w3=/MSIE \d/.exec(si),Bf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(si),Nt=!!(w3||Bf||Pf),_n=w3?document.documentMode:Bf?+Bf[1]:Pf?+Pf[1]:0,Er=!Nt&&/gecko\/(\d+)/i.test(si);Er&&+(/Firefox\/(\d+)/.exec(si)||[0,0])[1];const Lf=!Nt&&/Chrome\/(\d+)/.exec(si),lt=!!Lf,M8=Lf?+Lf[1]:0,pt=!Nt&&!!Ur&&/Apple Computer/.test(Ur.vendor),Fs=pt&&(/Mobile\/\w+/.test(si)||!!Ur&&Ur.maxTouchPoints>2),Kt=Fs||(Ur?/Mac/.test(Ur.platform):!1),T8=Ur?/Win/.test(Ur.platform):!1,wr=/Android \d/.test(si),U0=!!P1&&"webkitFontSmoothing"in P1.documentElement.style,C8=U0?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function E8(r){return{left:0,right:r.documentElement.clientWidth,top:0,bottom:r.documentElement.clientHeight}}function wn(r,e){return typeof r=="number"?r:r[e]}function N8(r){let e=r.getBoundingClientRect(),t=e.width/r.offsetWidth||1,n=e.height/r.offsetHeight||1;return{left:e.left,right:e.left+r.clientWidth*t,top:e.top,bottom:e.top+r.clientHeight*n}}function B1(r,e,t){let n=r.someProp("scrollThreshold")||0,i=r.someProp("scrollMargin")||5,s=r.dom.ownerDocument;for(let o=t||r.dom;o;o=ol(o)){if(o.nodeType!=1)continue;let l=o,a=l==s.body,u=a?E8(s):N8(l),c=0,f=0;if(e.topu.bottom-wn(n,"bottom")&&(f=e.bottom-u.bottom+wn(i,"bottom")),e.leftu.right-wn(n,"right")&&(c=e.right-u.right+wn(i,"right")),c||f)if(a)s.defaultView.scrollBy(c,f);else{let d=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),c&&(l.scrollLeft+=c);let g=l.scrollLeft-d,v=l.scrollTop-p;e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v}}if(a)break}}function A8(r){let e=r.dom.getBoundingClientRect(),t=Math.max(0,e.top),n,i;for(let s=(e.left+e.right)/2,o=t+1;o=t-20){n=l,i=a.top;break}}return{refDOM:n,refTop:i,stack:S3(r.dom)}}function S3(r){let e=[],t=r.ownerDocument;for(let n=r;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),r!=t);n=ol(n));return e}function O8({refDOM:r,refTop:e,stack:t}){let n=r?r.getBoundingClientRect().top:0;b3(t,n==0?0:n-e)}function b3(r,e){for(let t=0;t=l){o=Math.max(g.bottom,o),l=Math.min(g.top,l);let v=g.left>e.left?g.left-e.left:g.right=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!a&&g.left<=e.left&&g.right>=e.left&&(a=c,u={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!t&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(s=f+1)}}return!t&&a&&(t=a,i=u,n=0),t&&t.nodeType==3?I8(t,i):!t||n&&t.nodeType==1?{node:r,offset:s}:M3(t,i)}function I8(r,e){let t=r.nodeValue.length,n=document.createRange();for(let i=0;i=(s.left+s.right)/2?1:0)}}return{node:r,offset:0}}function mh(r,e){return r.left>=e.left-1&&r.left<=e.right+1&&r.top>=e.top-1&&r.top<=e.bottom+1}function D8(r,e){let t=r.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return r.docView.posFromDOM(n,i,s)}function P8(r,e,t,n){let i=-1;for(let s=e,o=!1;s!=r.dom;){let l=r.docView.nearestDesc(s,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!o||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!o&&(o=!0,a.left>n.left||a.top>n.top?i=l.posBefore:(a.right-1?i:r.docView.posFromDOM(e,t,-1)}function T3(r,e,t){let n=r.childNodes.length;if(n&&t.tope.top&&i++}n==r.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?l=r.state.doc.content.size:(i==0||n.nodeType!=1||n.childNodes[i-1].nodeName!="BR")&&(l=P8(r,n,i,e))}l==null&&(l=R8(r,o,e));let a=r.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function L1(r){return r.top=0&&i==n.nodeValue.length?(a--,c=1):t<0?a--:u++,oo(Mn(Zr(n,a,u),c),c<0)}if(!r.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(t<0||i==Fr(n))){let a=n.childNodes[i-1];if(a.nodeType==1)return Yu(a.getBoundingClientRect(),!1)}if(s==null&&i=0)}if(s==null&&i&&(t<0||i==Fr(n))){let a=n.childNodes[i-1],u=a.nodeType==3?Zr(a,Fr(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(u)return oo(Mn(u,1),!1)}if(s==null&&i=0)}function oo(r,e){if(r.width==0)return r;let t=e?r.left:r.right;return{top:r.top,bottom:r.bottom,left:t,right:t}}function Yu(r,e){if(r.height==0)return r;let t=e?r.top:r.bottom;return{top:t,bottom:t,left:r.left,right:r.right}}function E3(r,e,t){let n=r.state,i=r.root.activeElement;n!=e&&r.updateState(e),i!=r.dom&&r.focus();try{return t()}finally{n!=e&&r.updateState(n),i!=r.dom&&i&&i.focus()}}function F8(r,e,t){let n=e.selection,i=t=="up"?n.$from:n.$to;return E3(r,e,()=>{let{node:s}=r.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=r.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=C3(r,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Zr(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;uc.top+1&&(t=="up"?o.top-c.top>(c.bottom-o.top)*2:c.bottom-o.bottom>(o.bottom-c.top)*2))return!1}}return!0})}const $8=/[\u0590-\u08ac]/;function V8(r,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let i=n.parentOffset,s=!i,o=i==n.parent.content.size,l=r.domSelection();return!$8.test(n.parent.textContent)||!l.modify?t=="left"||t=="backward"?s:o:E3(r,e,()=>{let{focusNode:a,focusOffset:u,anchorNode:c,anchorOffset:f}=r.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",t,"character");let p=n.depth?r.docView.domAfterPos(n.before()):r.dom,{focusNode:g,focusOffset:v}=r.domSelectionRange(),T=g&&!p.contains(g.nodeType==1?g:g.parentNode)||a==g&&u==v;try{l.collapse(c,f),a&&(a!=c||u!=f)&&l.extend&&l.extend(a,u)}catch{}return d!=null&&(l.caretBidiLevel=d),T})}let F1=null,$1=null,V1=!1;function H8(r,e,t){return F1==e&&$1==t?V1:(F1=e,$1=t,V1=t=="up"||t=="down"?F8(r,e,t):V8(r,e,t))}const lr=0,H1=1,xi=2,Wr=3;class wl{constructor(e,t,n,i){this.parent=e,this.children=t,this.dom=n,this.contentDOM=i,this.dirty=lr,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;ter(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!t||s.node))if(n&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||o instanceof A3){i=e-s;break}s=l}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(let s;n&&!(s=this.children[n-1]).size&&s instanceof N3&&s.side>=0;n--);if(t<=0){let s,o=!0;for(;s=n?this.children[n-1]:null,!(!s||s.dom.parentNode==this.contentDOM);n--,o=!1);return s&&t&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?er(s.dom)+1:0}}else{let s,o=!0;for(;s=n=c&&t<=u-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,c);e=o;for(let f=l;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=er(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(u>t||l==this.children.length-1)){t=u;for(let c=l+1;cp&&ot){let p=l;l=a,a=p}let d=document.createRange();d.setEnd(a.node,a.offset),d.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(d)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i=n:en){let l=n+s.border,a=o-s.border;if(e>=l&&t<=a){this.dirty=e==n||t==o?xi:H1,e==l&&t==a&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Wr:s.markDirty(e-l,t-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?xi:Wr}n=o}this.dirty=xi}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?xi:H1;t.dirty{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==lr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class q8 extends wl{constructor(e,t,n,i){super(e,[],t,null),this.textDOM=n,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Hi extends wl{constructor(e,t,n,i){super(e,[],n,i),this.mark=t}static create(e,t,n,i){let s=i.nodeViews[t.type.name],o=s&&s(t,i,n);return(!o||!o.dom)&&(o=$r.renderSpec(document,t.type.spec.toDOM(t,n))),new Hi(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Wr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return this.dirty!=Wr&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=lr){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty0&&(s=Vf(s,0,e,n));for(let l=0;l{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},n,i),c=u&&u.dom,f=u&&u.contentDOM;if(t.isText){if(!c)c=document.createTextNode(t.text);else if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:f}=$r.renderSpec(document,t.type.spec.toDOM(t)));!f&&!t.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=I3(c,n,t),u?a=new _8(e,t,n,i,c,f||null,d,u,s,o+1):t.isText?new W0(e,t,n,i,c,d,s):new Un(e,t,n,i,c,f||null,d,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>F.empty)}return e}matchesNode(e,t,n){return this.dirty==lr&&e.eq(this.node)&&$f(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,i=t,s=e.composing?this.localCompositionInfo(e,t):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,a=new W8(this,o&&o.node,e);J8(this.node,this.innerDeco,(u,c,f)=>{u.spec.marks?a.syncToMarks(u.spec.marks,n,e):u.type.side>=0&&!f&&a.syncToMarks(c==this.node.childCount?pe.none:this.node.child(c).marks,n,e),a.placeWidget(u,e,i)},(u,c,f,d)=>{a.syncToMarks(u.marks,n,e);let p;a.findNodeMatch(u,c,f,d)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(u,c,f,p,e)||a.updateNextNode(u,c,f,e,d,i)||a.addNode(u,c,f,e,i),i+=u.nodeSize}),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==xi)&&(o&&this.protectLocalComposition(e,o),O3(this.contentDOM,this.children,e),Fs&&K8(this.dom))}localCompositionInfo(e,t){let{from:n,to:i}=e.state.selection;if(!(e.state.selection instanceof oe)||nt+this.node.content.size)return null;let s=e.domSelectionRange(),o=G8(s.focusNode,s.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let l=o.nodeValue,a=X8(this.node.content,l,n-t,i-t);return a<0?null:{node:o,pos:a,text:l}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:i}){if(this.getDesc(t))return;let s=t;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new q8(this,s,t,i);e.input.compositionNodes.push(o),this.children=Vf(this.children,n,n+i.length,e,o)}update(e,t,n,i){return this.dirty==Wr||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,i),!0)}updateInner(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=lr}updateOuterDeco(e){if($f(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=z3(this.dom,this.nodeDOM,Ff(this.outerDeco,this.node,t),Ff(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function q1(r,e,t,n,i){I3(n,e,r);let s=new Un(void 0,r,e,t,n,n,n,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class W0 extends Un{constructor(e,t,n,i,s,o,l){super(e,t,n,i,s,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,i){return this.dirty==Wr||this.dirty!=lr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=lr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=lr,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,n){let i=this.node.cut(e,t),s=document.createTextNode(i.text);return new W0(this.parent,i,this.outerDeco,this.innerDeco,s,s,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Wr)}get domAtom(){return!1}}class A3 extends wl{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==lr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class _8 extends Un{constructor(e,t,n,i,s,o,l,a,u,c){super(e,t,n,i,s,o,l,u,c),this.spec=a}update(e,t,n,i){if(this.dirty==Wr)return!1;if(this.spec.update){let s=this.spec.update(e,t,n);return s&&this.updateInner(e,t,n,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,n,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,i){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function O3(r,e,t){let n=r.firstChild,i=!1;for(let s=0;s>1,o=Math.min(s,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Hi.create(this.top,e[s],t,n);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,s++}}findNodeMatch(e,t,n,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(n){let u=t.children[n-1];if(u instanceof Hi)t=u,n=u.children.length;else{l=u,n--;break}}else{if(t==e)break e;n=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=r.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function Y8(r,e){return r.type.side-e.type.side}function J8(r,e,t,n){let i=e.locals(r),s=0;if(i.length==0){for(let u=0;us;)l.push(i[o++]);let d=s+c.nodeSize;if(c.isText){let g=d;o!g.inline):l.slice();n(c,p,e.forChild(s,c),f),s=d}}function K8(r){if(r.nodeName=="UL"||r.nodeName=="OL"){let e=r.style.cssText;r.style.cssText=e+"; list-style: square !important",window.getComputedStyle(r).listStyle,r.style.cssText=e}}function G8(r,e){for(;;){if(r.nodeType==3)return r;if(r.nodeType==1&&e>0){if(r.childNodes.length>e&&r.childNodes[e].nodeType==3)return r.childNodes[e];r=r.childNodes[e-1],e=Fr(r)}else if(r.nodeType==1&&e=t){let u=l=0&&u+e.length+l>=t)return l+u;if(t==n&&a.length>=n+e.length-l&&a.slice(n-l,n-l+e.length)==e)return n}}return-1}function Vf(r,e,t,n,i){let s=[];for(let o=0,l=0;o=t||c<=e?s.push(a):(ut&&s.push(a.slice(t-u,a.size,n)))}return s}function gh(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),s=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=n.resolve(o),a,u;if(_0(t)){for(a=l;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&te.isSelectable(c)&&i.parent&&!(c.isInline&&k8(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;u=new te(o==f?l:n.resolve(f))}}else{let c=r.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;a=n.resolve(c)}if(!u){let c=e=="pointer"||r.state.selection.head{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!D3(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function Z8(r){let e=r.domSelection(),t=document.createRange(),n=r.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.setEnd(n.parentNode,er(n)+1):t.setEnd(n,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!r.state.selection.visible&&Nt&&_n<=11&&(n.disabled=!0,n.disabled=!1)}function R3(r,e){if(e instanceof te){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(Y1(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else Y1(r)}function Y1(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function yh(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||oe.between(e,t,n)}function J1(r){return r.editable&&!r.hasFocus()?!1:P3(r)}function P3(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function e9(r){let e=r.docView.domFromPos(r.state.selection.anchor,0),t=r.domSelectionRange();return Vi(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Hf(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),s=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ie.findFrom(s,e)}function mi(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function K1(r,e,t){let n=r.state.selection;if(n instanceof oe){if(!n.empty||t.indexOf("s")>-1)return!1;if(r.endOfTextblock(e>0?"forward":"backward")){let i=Hf(r.state,e);return i&&i instanceof te?mi(r,i):!1}else if(!(Kt&&t.indexOf("m")>-1)){let i=n.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=r.docView.descAt(l))&&!o.contentDOM?te.isSelectable(s)?mi(r,new te(e<0?r.state.doc.resolve(i.pos-s.nodeSize):i)):U0?mi(r,new oe(r.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else{if(n instanceof te&&n.node.isInline)return mi(r,new oe(e>0?n.$to:n.$from));{let i=Hf(r.state,e);return i?mi(r,i):!1}}}function u0(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Lo(r){let e=r.pmViewDesc;return e&&e.size==0&&(r.nextSibling||r.nodeName!="BR")}function lo(r,e){return e<0?t9(r):B3(r)}function t9(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,s,o=!1;for(Er&&t.nodeType==1&&n0){if(t.nodeType!=1)break;{let l=t.childNodes[n-1];if(Lo(l))i=t,s=--n;else if(l.nodeType==3)t=l,n=t.nodeValue.length;else break}}else{if(L3(t))break;{let l=t.previousSibling;for(;l&&Lo(l);)i=t.parentNode,s=er(l),l=l.previousSibling;if(l)t=l,n=u0(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?qf(r,t,n):i&&qf(r,i,s)}function B3(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=u0(t),s,o;for(;;)if(n{r.state==i&&on(r)},50)}function G1(r,e){let t=r.state.doc.resolve(e);if(!(lt||T8)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let s=r.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o1)return s.lefti.top&&o1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function X1(r,e,t){let n=r.state.selection;if(n instanceof oe&&!n.empty||t.indexOf("s")>-1||Kt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=Hf(r.state,e);if(o&&o instanceof te)return mi(r,o)}if(!i.parent.inlineContent){let o=e<0?i:s,l=n instanceof zi?ie.near(o,e):ie.findFrom(o,e);return l?mi(r,l):!1}return!1}function Q1(r,e){if(!(r.state.selection instanceof oe))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let o=r.state.tr;return e<0?o.delete(t.pos-s.nodeSize,t.pos):o.delete(t.pos,t.pos+s.nodeSize),r.dispatch(o),!0}return!1}function Z1(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function r9(r){if(!pt||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Z1(r,n,"true"),setTimeout(()=>Z1(r,n,"false"),20)}return!1}function n9(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function i9(r,e){let t=e.keyCode,n=n9(e);if(t==8||Kt&&t==72&&n=="c")return Q1(r,-1)||lo(r,-1);if(t==46||Kt&&t==68&&n=="c")return Q1(r,1)||lo(r,1);if(t==13||t==27)return!0;if(t==37||Kt&&t==66&&n=="c"){let i=t==37?G1(r,r.state.selection.from)=="ltr"?-1:1:-1;return K1(r,i,n)||lo(r,i)}else if(t==39||Kt&&t==70&&n=="c"){let i=t==39?G1(r,r.state.selection.from)=="ltr"?1:-1:1;return K1(r,i,n)||lo(r,i)}else{if(t==38||Kt&&t==80&&n=="c")return X1(r,-1,n)||lo(r,-1);if(t==40||Kt&&t==78&&n=="c")return r9(r)||X1(r,1,n)||B3(r);if(n==(Kt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function F3(r,e){r.someProp("transformCopied",p=>{e=p(e,r)});let t=[],{content:n,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,s--;let p=n.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),n=p.content}let o=r.someProp("clipboardSerializer")||$r.fromSchema(r.state.schema),l=U3(),a=l.createElement("div");a.appendChild(o.serializeFragment(n,{document:l}));let u=a.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=_3[u.nodeName.toLowerCase()]);){for(let p=c.length-1;p>=0;p--){let g=l.createElement(c[p]);for(;a.firstChild;)g.appendChild(a.firstChild);a.appendChild(g),f++}u=a.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${JSON.stringify(t)}`);let d=r.someProp("clipboardTextSerializer",p=>p(e,r))||e.content.textBetween(0,e.content.size,` `);return{dom:a,text:d}}function $3(r,e,t,n,i){let s=i.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=e&&(n||s||!t);if(a){if(r.someProp("transformPastedText",d=>{e=d(e,s||n,r)}),s)return e?new U(F.from(r.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):U.empty;let f=r.someProp("clipboardTextParser",d=>d(e,i,n,r));if(f)l=f;else{let d=i.marks(),{schema:p}=r.state,g=Fr.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let T=o.appendChild(document.createElement("p"));v&&T.appendChild(g.serializeNode(p.text(v,d)))})}}else r.someProp("transformPastedHTML",f=>{t=f(t,r)}),o=l9(t),U0&&a9(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(l||(l=(r.someProp("clipboardParser")||r.someProp("domParser")||ah.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!s9.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)l=u9(em(l,+c[1],+c[2]),c[4]);else if(l=U.maxOpen(o9(l.content,i),!0),l.openStart||l.openEnd){let f=0,d=0;for(let p=l.content.firstChild;f{l=f(l,r)}),l}const s9=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function o9(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(l=>{if(!o)return;let a=i.findWrapping(l.type),u;if(!a)return o=null;if(u=o.length&&s.length&&H3(a,s,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=q3(o[o.length-1],s.length));let c=V3(l,a);o.push(c),i=i.matchType(c.type),s=a}}),o)return F.from(o)}return r}function V3(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,F.from(r));return r}function H3(r,e,t,n,i){if(i1&&(s=0),i=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(F.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(l))}function em(r,e,t){return e]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=U3().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&_3[n[1].toLowerCase()])&&(r=i.map(s=>"<"+s+">").join("")+r+i.map(s=>"").reverse().join("")),t.innerHTML=r,i)for(let s=0;s=0;l-=2){let a=t.nodes[n[l]];if(!a||a.hasRequiredAttrs())break;i=F.from(a.create(n[l+1],i)),s++,o++}return new U(i,s,o)}const mt={},gt={},c9={touchstart:!0,touchmove:!0};class f9{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function d9(r){for(let e in mt){let t=mt[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{p9(r,n)&&!vh(r,n)&&(r.editable||!(n.type in gt))&&t(r,n)},c9[e]?{passive:!0}:void 0)}pt&&r.dom.addEventListener("input",()=>null),Uf(r)}function Dn(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function h9(r){r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function Uf(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>vh(r,n))})}function vh(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function p9(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function m9(r,e){!vh(r,e)&&mt[e.type]&&(r.editable||!(e.type in gt))&&mt[e.type](r,e)}gt.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!j3(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(kr&<&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),Fs&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,pi(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||i9(r,t)?t.preventDefault():Dn(r,"key")};gt.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};gt.keypress=(r,e)=>{let t=e;if(j3(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||Kt&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof oe)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",s=>s(r,n.$from.pos,n.$to.pos,i))&&r.dispatch(r.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function j0(r){return{left:r.clientX,top:r.clientY}}function g9(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function xh(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,l=>o>s.depth?l(r,t,s.nodeAfter,s.before(o),i,!0):l(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function Ts(r,e,t){r.focused||r.focus();let n=r.state.tr.setSelection(e);t=="pointer"&&n.setMeta("pointer",!0),r.dispatch(n)}function y9(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&te.isSelectable(n)?(Ts(r,new te(t),"pointer"),!0):!1}function v9(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof te&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(te.isSelectable(l)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(Ts(r,te.create(r.state.doc,i),"pointer"),!0):!1}function x9(r,e,t,n,i){return xh(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?v9(r,t):y9(r,t))}function k9(r,e,t,n){return xh(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function w9(r,e,t,n){return xh(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||S9(r,t,n)}function S9(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(Ts(r,oe.create(n,0,n.content.size),"pointer"),!0):!1;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)Ts(r,oe.create(n,l+1,l+1+o.content.size),"pointer");else if(te.isSelectable(o))Ts(r,te.create(n,l),"pointer");else continue;return!0}}function kh(r){return c0(r)}const W3=Kt?"metaKey":"ctrlKey";mt.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=kh(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&g9(t,r.input.lastClick)&&!t[W3]&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let o=r.posAtCoords(j0(t));o&&(s=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new b9(r,o,t,!!n)):(s=="doubleClick"?k9:w9)(r,o.pos,o.inside,t)?t.preventDefault():Dn(r,"pointer"))};class b9{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[W3],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);s=c.parent,o=c.depth?c.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:u}=e.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof te&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Cr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Dn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>on(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(j0(e))),this.updateAllowDefault(e),this.allowDefault||!t?Dn(this.view,"pointer"):x9(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pt&&this.mightDrag&&!this.mightDrag.node.isAtom||lt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ts(this.view,ie.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Dn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Dn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}mt.touchstart=r=>{r.input.lastTouch=Date.now(),kh(r),Dn(r,"pointer")};mt.touchmove=r=>{r.input.lastTouch=Date.now(),Dn(r,"pointer")};mt.contextmenu=r=>kh(r);function j3(r,e){return r.composing?!0:pt&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const M9=kr?5e3:-1;gt.compositionstart=gt.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))r.markCursor=r.state.storedMarks||t.marks(),c0(r,!0),r.markCursor=null;else if(c0(r),Cr&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){r.domSelection().collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}Y3(r,M9)};gt.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionID++,Y3(r,20))};function Y3(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>c0(r),e))}function J3(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=T9());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function T9(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function c0(r,e=!1){if(!(kr&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),J3(r),e||r.docView&&r.docView.dirty){let t=gh(r);return t&&!t.eq(r.state.selection)?r.dispatch(r.state.tr.setSelection(t)):r.updateState(r.state),!0}return!1}}function C9(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const $s=Nt&&_n<15||Fs&&C8<604;mt.copy=gt.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=$s?null:t.clipboardData,o=n.content(),{dom:l,text:a}=F3(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):C9(r,l),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function E9(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function N9(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?ll(r,n.value,null,r.input.shiftKey,e):ll(r,n.textContent,n.innerHTML,r.input.shiftKey,e)},50)}function ll(r,e,t,n,i){let s=$3(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",a=>a(r,i,s||U.empty)))return!0;if(!s)return!1;let o=E9(s),l=o?r.state.tr.replaceSelectionWith(o,r.input.shiftKey):r.state.tr.replaceSelection(s);return r.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}gt.paste=(r,e)=>{let t=e;if(r.composing&&!kr)return;let n=$s?null:t.clipboardData;n&&ll(r,n.getData("text/plain"),n.getData("text/html"),r.input.shiftKey,t)?t.preventDefault():N9(r,t)};class A9{constructor(e,t){this.slice=e,this.move=t}}const K3=Kt?"altKey":"ctrlKey";mt.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(j0(t));if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof te?i.to-1:i.to))){if(n&&n.mightDrag)r.dispatch(r.state.tr.setSelection(te.create(r.state.doc,n.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let u=r.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=r.docView&&r.dispatch(r.state.tr.setSelection(te.create(r.state.doc,u.posBefore)))}}let o=r.state.selection.content(),{dom:l,text:a}=F3(r,o);t.dataTransfer.clearData(),t.dataTransfer.setData($s?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",$s||t.dataTransfer.setData("text/plain",a),r.dragging=new A9(o,!t[K3])};mt.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};gt.dragover=gt.dragenter=(r,e)=>e.preventDefault();gt.drop=(r,e)=>{let t=e,n=r.dragging;if(r.dragging=null,!t.dataTransfer)return;let i=r.posAtCoords(j0(t));if(!i)return;let s=r.state.doc.resolve(i.pos),o=n&&n.slice;o?r.someProp("transformPasted",g=>{o=g(o,r)}):o=$3(r,t.dataTransfer.getData($s?"Text":"text/plain"),$s?null:t.dataTransfer.getData("text/html"),!1,s);let l=!!(n&&!t[K3]);if(r.someProp("handleDrop",g=>g(r,t,o||U.empty,l))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?c3(r.state.doc,s.pos,o):s.pos;a==null&&(a=s.pos);let u=r.state.tr;l&&u.deleteSelection();let c=u.mapping.map(a),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,d=u.doc;if(f?u.replaceRangeWith(c,c,o.content.firstChild):u.replaceRange(c,c,o),u.doc.eq(d))return;let p=u.doc.resolve(c);if(f&&te.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new te(p));else{let g=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((v,T,x,w)=>g=w),u.setSelection(yh(r,p,u.doc.resolve(g)))}r.focus(),r.dispatch(u.setMeta("uiEvent","drop"))};mt.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&on(r)},20))};mt.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};mt.beforeinput=(r,e)=>{if(lt&&kr&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,pi(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in gt)mt[r]=gt[r];function al(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class wh{constructor(e,t){this.toDOM=e,this.spec=t||Ii,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new ir(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof wh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&al(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Wn{constructor(e,t){this.attrs=e,this.spec=t||Ii}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new ir(s,o,this)}valid(e,t){return t.from=e&&(!s||s(l.spec))&&n.push(l.copy(l.from+i,l.to+i))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,n,i+l,s)}}map(e,t,n){return this==st||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Ii)}mapInner(e,t,n,i,s){let o;for(let l=0;l{let u=a+n,c;if(c=X3(t,l,u)){for(i||(i=this.children.slice());sl&&f.to=e){this.children[l]==e&&(n=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;ls&&a.type instanceof Wn){let u=Math.max(s,a.from)-s,c=Math.min(o,a.to)-s;ui.map(e,t,Ii));return On.from(n)}forChild(e,t){if(t.isLeaf)return He.empty;let n=[];for(let i=0;it instanceof He)?e:e.reduce((t,n)=>t.concat(n instanceof He?n:n.members),[]))}}}function O9(r,e,t,n,i,s,o){let l=r.slice();for(let u=0,c=s;u{let T=v-g-(p-d);for(let x=0;xw+c-f)continue;let S=l[x]+c-f;p>=S?l[x+1]=d<=S?-2:-1:g>=i&&T&&(l[x]+=T,l[x+1]+=T)}f+=T}),c=t.maps[u].map(c,-1)}let a=!1;for(let u=0;u=n.content.size){a=!0;continue}let d=t.map(r[u+1]+s,-1),p=d-i,{index:g,offset:v}=n.content.findIndex(f),T=n.maybeChild(g);if(T&&v==f&&v+T.nodeSize==p){let x=l[u+2].mapInner(t,T,c+1,r[u]+s+1,o);x!=st?(l[u]=f,l[u+1]=p,l[u+2]=x):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=z9(l,r,e,t,i,s,o),c=f0(u,n,0,o);e=c.local;for(let f=0;ft&&o.to{let u=X3(r,l,a+t);if(u){s=!0;let c=f0(u,l,t+a+1,n);c!=st&&i.push(a,a+l.nodeSize,c)}});let o=G3(s?Q3(r):r,-t).sort(Di);for(let l=0;l0;)e++;r.splice(e,0,t)}function Ku(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=st&&e.push(n)}),r.cursorWrapper&&e.push(He.create(r.state.doc,[r.cursorWrapper.deco])),On.from(e)}const I9={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},D9=Nt&&_n<=11;class R9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class P9{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new R9,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),D9&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,I9)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(J1(this.view)){if(this.suppressingSelectionUpdates)return on(this.view);if(Nt&&_n<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Vi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=ol(s))t.add(s);for(let s=e.anchorNode;s;s=ol(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&J1(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let c=0;c1){let c=a.filter(f=>f.nodeName=="BR");if(c.length==2){let f=c[0],d=c[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(s>-1&&(e.docView.markDirty(s,o),B9(e)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||on(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;ci;T--){let x=n.childNodes[T-1],w=x.pmViewDesc;if(x.nodeName=="BR"&&!w){s=T;break}if(!w||w.size)break}let f=r.state.doc,d=r.someProp("domParser")||ah.fromSchema(r.state.schema),p=f.resolve(o),g=null,v=d.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:$9,context:p});if(u&&u[0].pos!=null){let T=u[0].pos,x=u[1]&&u[1].pos;x==null&&(x=T),g={anchor:T+o,head:x+o}}return{doc:v,sel:g,from:o,to:l}}function $9(r){let e=r.pmViewDesc;if(e)return e.parseRule();if(r.nodeName=="BR"&&r.parentNode){if(pt&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(r.parentNode.lastChild==r||pt&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if(r.nodeName=="IMG"&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}const V9=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function H9(r,e,t,n,i){if(e<0){let O=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,W=gh(r,O);if(W&&!r.state.selection.eq(W)){if(lt&&kr&&r.input.lastKeyCode===13&&Date.now()-100de(r,pi(13,"Enter"))))return;let K=r.state.tr.setSelection(W);O=="pointer"?K.setMeta("pointer",!0):O=="key"&&K.scrollIntoView(),r.composing&&K.setMeta("composition",r.input.compositionID),r.dispatch(K)}return}let s=r.state.doc.resolve(e),o=s.sharedDepth(t);e=s.before(o+1),t=r.state.doc.resolve(t).after(o+1);let l=r.state.selection,a=F9(r,e,t),u=r.state.doc,c=u.slice(a.from,a.to),f,d;r.input.lastKeyCode===8&&Date.now()-100Date.now()-225||kr)&&i.some(O=>O.nodeType==1&&!V9.test(O.nodeName))&&(!p||p.endA>=p.endB)&&r.someProp("handleKeyDown",O=>O(r,pi(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!p)if(n&&l instanceof oe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!r.composing&&!(a.sel&&a.sel.anchor!=a.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(a.sel){let O=sm(r,r.state.doc,a.sel);if(O&&!O.eq(r.state.selection)){let W=r.state.tr.setSelection(O);r.composing&&W.setMeta("composition",r.input.compositionID),r.dispatch(W)}}return}if(lt&&r.cursorWrapper&&a.sel&&a.sel.anchor==r.cursorWrapper.deco.from&&a.sel.head==a.sel.anchor){let O=p.endB-p.start;a.sel={anchor:a.sel.anchor+O,head:a.sel.anchor+O}}r.input.domChangeCount++,r.state.selection.fromr.state.selection.from&&p.start<=r.state.selection.from+2&&r.state.selection.from>=a.from?p.start=r.state.selection.from:p.endA=r.state.selection.to-2&&r.state.selection.to<=a.to&&(p.endB+=r.state.selection.to-p.endA,p.endA=r.state.selection.to)),Nt&&_n<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>a.from&&a.doc.textBetween(p.start-a.from-1,p.start-a.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=a.doc.resolveNoCache(p.start-a.from),v=a.doc.resolveNoCache(p.endB-a.from),T=u.resolve(p.start),x=g.sameParent(v)&&g.parent.inlineContent&&T.end()>=p.endA,w;if((Fs&&r.input.lastIOSEnter>Date.now()-225&&(!x||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!x&&g.posO(r,pi(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>p.start&&_9(u,p.start,p.endA,g,v)&&r.someProp("handleKeyDown",O=>O(r,pi(8,"Backspace")))){kr&<&&r.domObserver.suppressSelectionUpdates();return}lt&&kr&&p.endB==p.start&&(r.input.lastAndroidDelete=Date.now()),kr&&!x&&g.start()!=v.start()&&v.parentOffset==0&&g.depth==v.depth&&a.sel&&a.sel.anchor==a.sel.head&&a.sel.head==p.endA&&(p.endB-=2,v=a.doc.resolveNoCache(p.endB-a.from),setTimeout(()=>{r.someProp("handleKeyDown",function(O){return O(r,pi(13,"Enter"))})},20));let S=p.start,E=p.endA,A,z,I;if(x){if(g.pos==v.pos)Nt&&_n<=11&&g.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>on(r),20)),A=r.state.tr.delete(S,E),z=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(I=q9(g.parent.content.cut(g.parentOffset,v.parentOffset),T.parent.content.cut(T.parentOffset,p.endA-T.start()))))A=r.state.tr,I.type=="add"?A.addMark(S,E,I.mark):A.removeMark(S,E,I.mark);else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let O=g.parent.textBetween(g.parentOffset,v.parentOffset);if(r.someProp("handleTextInput",W=>W(r,S,E,O)))return;A=r.state.tr.insertText(O,S,E)}}if(A||(A=r.state.tr.replace(S,E,a.doc.slice(p.start-a.from,p.endB-a.from))),a.sel){let O=sm(r,A.doc,a.sel);O&&!(lt&&kr&&r.composing&&O.empty&&(p.start!=p.endB||r.input.lastAndroidDeletee.content.size?null:yh(r,e.resolve(t.anchor),e.resolve(t.head))}function q9(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,l,a;for(let c=0;cc.mark(l.addToSet(c.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;ct||Gu(o,!0,!1)0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function U9(r,e,t,n,i){let s=r.findDiffStart(e,t);if(s==null)return null;let{a:o,b:l}=r.findDiffEnd(e,t+r.size,t+e.size);if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=a,o=s+(o-l),l=s}return{start:s,endA:o,endB:l}}class W9{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new f9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(cm),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=am(this),lm(this),this.nodeViews=um(this),this.docView=q1(this.state.doc,om(this),Ku(this),this.dom,this),this.domObserver=new P9(this,(n,i,s,o)=>H9(this,n,i,s,o)),this.domObserver.start(),d9(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Uf(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(cm),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(J3(this),s=!0),this.state=e;let o=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let d=um(this);Y9(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&Uf(this),this.editable=am(this),lm(this);let l=Ku(this),a=om(this),u=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",c=i||!this.docView.matchesNode(e.doc,a,l);(c||!e.selection.eq(n.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&A8(this);if(s){this.domObserver.stop();let d=c&&(Nt||lt)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&j9(n.selection,e.selection);if(c){let p=lt?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,a,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=q1(e.doc,a,l,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&e9(this))?on(this,d):(R3(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&O8(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof te){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&B1(this,t.getBoundingClientRect(),e)}else B1(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;tt.ownerDocument.getSelection()),this._root=t}return e||document}posAtCoords(e){return B8(this,e)}coordsAtPos(e,t=1){return C3(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return H8(this,t||this.state,e)}pasteHTML(e,t){return ll(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ll(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(h9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ku(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return m9(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return pt&&this.root.nodeType===11&&S8(this.dom.ownerDocument)==this.dom?L9(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function om(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[ir.node(0,r.state.doc.content.size,e)]}function lm(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:ir.widget(r.state.selection.head,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function am(r){return!r.someProp("editable",e=>e(r.state)===!1)}function j9(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function um(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function Y9(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function cm(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Gn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},d0={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fm=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),J9=typeof navigator<"u"&&/Mac/.test(navigator.platform),K9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),G9=J9||fm&&+fm[1]<57;for(var et=0;et<10;et++)Gn[48+et]=Gn[96+et]=String(et);for(var et=1;et<=24;et++)Gn[et+111]="F"+et;for(var et=65;et<=90;et++)Gn[et]=String.fromCharCode(et+32),d0[et]=String.fromCharCode(et);for(var Xu in Gn)d0.hasOwnProperty(Xu)||(d0[Xu]=Gn[Xu]);function X9(r){var e=G9&&(r.ctrlKey||r.altKey||r.metaKey)||K9&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?d0:Gn)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Q9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Z9(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let l=0;l127)&&(s=Gn[n.keyCode])&&s!=i){let l=e[Qu(s,n)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const rx=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function nx(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const ix=(r,e,t)=>{let n=nx(r,t);if(!n)return!1;let i=e5(n);if(!i){let o=n.blockRange(),l=o&&Js(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&n5(r,i,e))return!0;if(n.parent.content.size==0&&(Vs(s,"end")||te.isSelectable(s))){let o=ph(r.doc,n.before(),n.after(),U.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=e5(n)}let o=s&&s.nodeBefore;return!o||!te.isSelectable(o)?!1:(e&&e(r.tr.setSelection(te.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function e5(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function ox(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset{let n=ox(r,t);if(!n)return!1;let i=t5(n);if(!i)return!1;let s=i.nodeAfter;if(n5(r,i,e))return!0;if(n.parent.content.size==0&&(Vs(s,"start")||te.isSelectable(s))){let o=ph(r.doc,n.before(),n.after(),U.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset=0;e--){let t=r.node(e);if(r.index(e)+1{let t=r.selection,n=t instanceof te,i;if(n){if(t.node.isTextblock||!ni(r.doc,t.from))return!1;i=t.from}else if(i=u3(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(te.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},cx=(r,e)=>{let t=r.selection,n;if(t instanceof te){if(t.node.isTextblock||!ni(r.doc,t.to))return!1;n=t.to}else if(n=u3(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},fx=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Js(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},dx=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(` -`).scrollIntoView()),!0)};function r5(r){for(let e=0;e{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=r5(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(ie.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},px=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof zi||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=r5(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index(){let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Ms(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Js(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)},gx=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(te.create(r.doc,i))),!0)};function yx(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||ni(r.doc,e.pos))?!1:(t&&t(r.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function n5(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s,o;if(n.type.spec.isolating||i.type.spec.isolating)return!1;if(yx(r,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(s=(o=n.contentMatchAt(n.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,d=F.empty;for(let v=s.length-1;v>=0;v--)d=F.from(s[v].create(null,d));d=F.from(n.copy(d));let p=r.tr.step(new Ot(e.pos-1,f,e.pos,f,new U(d,1,0),s.length,!0)),g=f+2*s.length;ni(p.doc,g)&&p.join(g),t(p.scrollIntoView())}return!0}let a=ie.findFrom(e,1),u=a&&a.$from.blockRange(a.$to),c=u&&Js(u);if(c!=null&&c>=e.depth)return t&&t(r.tr.lift(u,c).scrollIntoView()),!0;if(l&&Vs(i,"start",!0)&&Vs(n,"end")){let f=n,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(t){let v=F.empty;for(let x=d.length-1;x>=0;x--)v=F.from(d[x].copy(v));let T=r.tr.step(new Ot(e.pos-d.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new U(v,d.length,0),0,!0));t(T.scrollIntoView())}return!0}}return!1}function i5(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(oe.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const vx=i5(-1),xx=i5(1);function kx(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&hh(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function dm(r,e=null){return function(t,n){let i=!1;for(let s=0;s{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o=2&&i.node(o.depth-1).type.compatibleContent(r)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let c=t.doc.resolve(o.start-2);a=new o0(c,c,o.depth),o.endIndex=0;c--)s=F.from(t[c].type.create(t[c].attrs,s));r.step(new Ot(e.start-(n?2:0),e.end,e.start,e.end,new U(s,0,0),t.length,!0));let o=0;for(let c=0;co.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?Mx(e,t,r,s):Tx(e,t,s):!0:!1}}function Mx(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);sv;g--)p-=i.child(g).nodeSize,n.delete(p-1,p+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(l?0:1),c+1,o.content.append(a?F.empty:F.from(i))))return!1;let f=s.pos,d=f+o.nodeSize;return n.step(new Ot(f-(l?1:0),d+(a?1:0),f+1,d-1,new U((l?F.empty:F.from(i.copy(F.empty))).append(a?F.empty:F.from(i.copy(F.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function Cx(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let u=a.lastChild&&a.lastChild.type==l.type,c=F.from(u?r.create():null),f=new U(F.from(r.create(null,F.from(l.type.create(null,c)))),u?3:1,0),d=s.start,p=s.end;t(e.tr.step(new Ot(d-(u?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function Y0(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}let J0=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:s}=n,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>{const f=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,u=e||s.tr,c=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(n).map(([d,p])=>[d,(...v)=>{const T=this.buildProps(u,t),x=p(...v)(T);return l.push(x),f}])),run:c};return f}createCan(e){const{rawCommands:t,state:n}=this,i=!1,s=e||n.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i;s.storedMarks&&e.setStoredMarks(s.storedMarks);const l={tr:e,editor:i,view:o,state:Y0({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)(l)]))}};return l}};class Ex{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function _(r,e,t){return r.config[e]===void 0&&r.parent?_(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?_(r.parent,e,t):null}):r.config[e]}function K0(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function s5(r){const e=[],{nodeExtensions:t,markExtensions:n}=K0(r),i=[...t,...n],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return r.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=_(o,"addGlobalAttributes",l);if(!a)return;a().forEach(c=>{c.types.forEach(f=>{Object.entries(c.attributes).forEach(([d,p])=>{e.push({type:f,name:d,attribute:{...s,...p}})})})})}),i.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=_(o,"addAttributes",l);if(!a)return;const u=a();Object.entries(u).forEach(([c,f])=>{const d={...s,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:o.name,name:c,attribute:d})})}),e}function Ke(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function Ue(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}i==="class"?n[i]=[n[i],s].join(" "):i==="style"?n[i]=[n[i],s].join("; "):n[i]=s}),n},{})}function Wf(r,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>Ue(t,n),{})}function o5(r){return typeof r=="function"}function ne(r,e=void 0,...t){return o5(r)?e?r.bind(e)(...t):r(...t):r}function Nx(r={}){return Object.keys(r).length===0&&r.constructor===Object}function Ax(r){return typeof r!="string"?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):r==="true"?!0:r==="false"?!1:r}function hm(r,e){return r.style?r:{...r,getAttrs:t=>{const n=r.getAttrs?r.getAttrs(t):r.attrs;if(n===!1)return!1;const i=e.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):Ax(t.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...n,...i}}}}function pm(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>e==="attrs"&&Nx(t)?!1:t!=null))}function Ox(r,e){var t;const n=s5(r),{nodeExtensions:i,markExtensions:s}=K0(r),o=(t=i.find(u=>_(u,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(u=>{const c=n.filter(x=>x.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=r.reduce((x,w)=>{const S=_(w,"extendNodeSchema",f);return{...x,...S?S(u):{}}},{}),p=pm({...d,content:ne(_(u,"content",f)),marks:ne(_(u,"marks",f)),group:ne(_(u,"group",f)),inline:ne(_(u,"inline",f)),atom:ne(_(u,"atom",f)),selectable:ne(_(u,"selectable",f)),draggable:ne(_(u,"draggable",f)),code:ne(_(u,"code",f)),defining:ne(_(u,"defining",f)),isolating:ne(_(u,"isolating",f)),attrs:Object.fromEntries(c.map(x=>{var w;return[x.name,{default:(w=x==null?void 0:x.attribute)===null||w===void 0?void 0:w.default}]}))}),g=ne(_(u,"parseHTML",f));g&&(p.parseDOM=g.map(x=>hm(x,c)));const v=_(u,"renderHTML",f);v&&(p.toDOM=x=>v({node:x,HTMLAttributes:Wf(x,c)}));const T=_(u,"renderText",f);return T&&(p.toText=T),[u.name,p]})),a=Object.fromEntries(s.map(u=>{const c=n.filter(T=>T.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=r.reduce((T,x)=>{const w=_(x,"extendMarkSchema",f);return{...T,...w?w(u):{}}},{}),p=pm({...d,inclusive:ne(_(u,"inclusive",f)),excludes:ne(_(u,"excludes",f)),group:ne(_(u,"group",f)),spanning:ne(_(u,"spanning",f)),code:ne(_(u,"code",f)),attrs:Object.fromEntries(c.map(T=>{var x;return[T.name,{default:(x=T==null?void 0:T.attribute)===null||x===void 0?void 0:x.default}]}))}),g=ne(_(u,"parseHTML",f));g&&(p.parseDOM=g.map(T=>hm(T,c)));const v=_(u,"renderHTML",f);return v&&(p.toDOM=T=>v({mark:T,HTMLAttributes:Wf(T,c)})),[u.name,p]}));return new Fv({topNode:o,nodes:l,marks:a})}function Zu(r,e){return e.nodes[r]||e.marks[r]||null}function mm(r,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===r.name):e}const zx=(r,e=500)=>{let t="";const n=r.parentOffset;return r.parent.nodesBetween(Math.max(0,n-e),n,(i,s,o,l)=>{var a,u;const c=((u=(a=i.type.spec).toText)===null||u===void 0?void 0:u.call(a,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";t+=c.slice(0,Math.max(0,n-s))}),t};function Mh(r){return Object.prototype.toString.call(r)==="[object RegExp]"}let G0=class{constructor(e){this.find=e.find,this.handler=e.handler}};const Ix=(r,e)=>{if(Mh(e))return e.exec(r);const t=e(r);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=r,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n};function ec(r){var e;const{editor:t,from:n,to:i,text:s,rules:o,plugin:l}=r,{view:a}=t;if(a.composing)return!1;const u=a.state.doc.resolve(n);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(d=>d.type.spec.code))return!1;let c=!1;const f=zx(u)+s;return o.forEach(d=>{if(c)return;const p=Ix(f,d.find);if(!p)return;const g=a.state.tr,v=Y0({state:a.state,transaction:g}),T={from:n-(p[0].length-s.length),to:i},{commands:x,chain:w,can:S}=new J0({editor:t,state:v});d.handler({state:v,range:T,match:p,commands:x,chain:w,can:S})===null||!g.steps.length||(g.setMeta(l,{transform:g,from:n,to:i,text:s}),a.dispatch(g),c=!0)}),c}function Dx(r){const{editor:e,rules:t}=r,n=new dr({state:{init(){return null},apply(i,s){const o=i.getMeta(n);return o||(i.selectionSet||i.docChanged?null:s)}},props:{handleTextInput(i,s,o,l){return ec({editor:e,from:s,to:o,text:l,rules:t,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&ec({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?ec({editor:e,from:o.pos,to:o.pos,text:` -`,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function Rx(r){return typeof r=="number"}let Px=class{constructor(e){this.find=e.find,this.handler=e.handler}};const Bx=(r,e)=>{if(Mh(e))return[...r.matchAll(e)];const t=e(r);return t?t.map(n=>{const i=[n.text];return i.index=n.index,i.input=r,i.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(n.replaceWith)),i}):[]};function Lx(r){const{editor:e,state:t,from:n,to:i,rule:s}=r,{commands:o,chain:l,can:a}=new J0({editor:e,state:t}),u=[];return t.doc.nodesBetween(n,i,(f,d)=>{if(!f.isTextblock||f.type.spec.code)return;const p=Math.max(n,d),g=Math.min(i,d+f.content.size),v=f.textBetween(p-d,g-d,void 0,"");Bx(v,s.find).forEach(x=>{if(x.index===void 0)return;const w=p+x.index+1,S=w+x[0].length,E={from:t.tr.mapping.map(w),to:t.tr.mapping.map(S)},A=s.handler({state:t,range:E,match:x,commands:o,chain:l,can:a});u.push(A)})}),u.every(f=>f!==null)}function Fx(r){const{editor:e,rules:t}=r;let n=null,i=!1,s=!1;return t.map(l=>new dr({view(a){const u=c=>{var f;n=!((f=a.dom.parentElement)===null||f===void 0)&&f.contains(c.target)?a.dom.parentElement:null};return window.addEventListener("dragstart",u),{destroy(){window.removeEventListener("dragstart",u)}}},props:{handleDOMEvents:{drop:a=>(s=n===a.dom.parentElement,!1),paste:(a,u)=>{var c;const f=(c=u.clipboardData)===null||c===void 0?void 0:c.getData("text/html");return i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(a,u,c)=>{const f=a[0],d=f.getMeta("uiEvent")==="paste"&&!i,p=f.getMeta("uiEvent")==="drop"&&!s;if(!d&&!p)return;const g=u.doc.content.findDiffStart(c.doc.content),v=u.doc.content.findDiffEnd(c.doc.content);if(!Rx(g)||!v||g===v.b)return;const T=c.tr,x=Y0({state:c,transaction:T});if(!(!Lx({editor:e,state:x,from:Math.max(g-1,0),to:v.b-1,rule:l})||!T.steps.length))return T}}))}function $x(r){const e=r.filter((t,n)=>r.indexOf(t)!==n);return[...new Set(e)]}class gs{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=gs.resolve(e),this.schema=Ox(this.extensions,t),this.extensions.forEach(n=>{var i;this.editor.extensionStorage[n.name]=n.storage;const s={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Zu(n.name,this.schema)};n.type==="mark"&&(!((i=ne(_(n,"keepOnSplit",s)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(n.name);const o=_(n,"onBeforeCreate",s);o&&this.editor.on("beforeCreate",o);const l=_(n,"onCreate",s);l&&this.editor.on("create",l);const a=_(n,"onUpdate",s);a&&this.editor.on("update",a);const u=_(n,"onSelectionUpdate",s);u&&this.editor.on("selectionUpdate",u);const c=_(n,"onTransaction",s);c&&this.editor.on("transaction",c);const f=_(n,"onFocus",s);f&&this.editor.on("focus",f);const d=_(n,"onBlur",s);d&&this.editor.on("blur",d);const p=_(n,"onDestroy",s);p&&this.editor.on("destroy",p)})}static resolve(e){const t=gs.sort(gs.flatten(e)),n=$x(t.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},i=_(t,"addExtensions",n);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((n,i)=>{const s=_(n,"priority")||100,o=_(i,"priority")||100;return s>o?-1:s{const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Zu(t.name,this.schema)},i=_(t,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=gs.sort([...this.extensions].reverse()),n=[],i=[],s=t.map(o=>{const l={name:o.name,options:o.options,storage:o.storage,editor:e,type:Zu(o.name,this.schema)},a=[],u=_(o,"addKeyboardShortcuts",l);let c={};if(o.type==="mark"&&o.config.exitable&&(c.ArrowRight=()=>Ui.handleExit({editor:e,mark:o})),u){const v=Object.fromEntries(Object.entries(u()).map(([T,x])=>[T,()=>x({editor:e})]));c={...c,...v}}const f=tx(c);a.push(f);const d=_(o,"addInputRules",l);mm(o,e.options.enableInputRules)&&d&&n.push(...d());const p=_(o,"addPasteRules",l);mm(o,e.options.enablePasteRules)&&p&&i.push(...p());const g=_(o,"addProseMirrorPlugins",l);if(g){const v=g();a.push(...v)}return a}).flat();return[Dx({editor:e,rules:n}),...Fx({editor:e,rules:i}),...s]}get attributes(){return s5(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=K0(this.extensions);return Object.fromEntries(t.filter(n=>!!_(n,"addNodeView")).map(n=>{const i=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e,type:Ke(n.name,this.schema)},o=_(n,"addNodeView",s);if(!o)return[];const l=(a,u,c,f)=>{const d=Wf(a,i);return o()({editor:e,node:a,getPos:c,decorations:f,HTMLAttributes:d,extension:n})};return[n.name,l]}))}}function Vx(r){return Object.prototype.toString.call(r).slice(8,-1)}function tc(r){return Vx(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function X0(r,e){const t={...r};return tc(r)&&tc(e)&&Object.keys(e).forEach(n=>{tc(e[n])?n in r?t[n]=X0(r[n],e[n]):Object.assign(t,{[n]:e[n]}):Object.assign(t,{[n]:e[n]})}),t}let jr=class jf{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ne(_(this,"addOptions",{name:this.name}))),this.storage=ne(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new jf(e)}configure(e={}){const t=this.extend();return t.options=X0(this.options,e),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new jf(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ne(_(t,"addOptions",{name:t.name})),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}};function l5(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=` +`))),0,0):U.empty;let f=r.someProp("clipboardTextParser",d=>d(e,i,n,r));if(f)l=f;else{let d=i.marks(),{schema:p}=r.state,g=$r.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let T=o.appendChild(document.createElement("p"));v&&T.appendChild(g.serializeNode(p.text(v,d)))})}}else r.someProp("transformPastedHTML",f=>{t=f(t,r)}),o=l9(t),U0&&a9(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let d=o.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;o=d}if(l||(l=(r.someProp("clipboardParser")||r.someProp("domParser")||ah.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||c),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!s9.test(d.parentNode.nodeName)?{ignore:!0}:null}})),c)l=u9(em(l,+c[1],+c[2]),c[4]);else if(l=U.maxOpen(o9(l.content,i),!0),l.openStart||l.openEnd){let f=0,d=0;for(let p=l.content.firstChild;f{l=f(l,r)}),l}const s9=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function o9(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,o=[];if(r.forEach(l=>{if(!o)return;let a=i.findWrapping(l.type),u;if(!a)return o=null;if(u=o.length&&s.length&&H3(a,s,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=q3(o[o.length-1],s.length));let c=V3(l,a);o.push(c),i=i.matchType(c.type),s=a}}),o)return F.from(o)}return r}function V3(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,F.from(r));return r}function H3(r,e,t,n,i){if(i1&&(s=0),i=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(F.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(l))}function em(r,e,t){return e]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=U3().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&_3[n[1].toLowerCase()])&&(r=i.map(s=>"<"+s+">").join("")+r+i.map(s=>"").reverse().join("")),t.innerHTML=r,i)for(let s=0;s=0;l-=2){let a=t.nodes[n[l]];if(!a||a.hasRequiredAttrs())break;i=F.from(a.create(n[l+1],i)),s++,o++}return new U(i,s,o)}const mt={},gt={},c9={touchstart:!0,touchmove:!0};class f9{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function d9(r){for(let e in mt){let t=mt[e];r.dom.addEventListener(e,r.input.eventHandlers[e]=n=>{p9(r,n)&&!vh(r,n)&&(r.editable||!(n.type in gt))&&t(r,n)},c9[e]?{passive:!0}:void 0)}pt&&r.dom.addEventListener("input",()=>null),Uf(r)}function Dn(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}function h9(r){r.domObserver.stop();for(let e in r.input.eventHandlers)r.dom.removeEventListener(e,r.input.eventHandlers[e]);clearTimeout(r.input.composingTimeout),clearTimeout(r.input.lastIOSEnterFallbackTimeout)}function Uf(r){r.someProp("handleDOMEvents",e=>{for(let t in e)r.input.eventHandlers[t]||r.dom.addEventListener(t,r.input.eventHandlers[t]=n=>vh(r,n))})}function vh(r,e){return r.someProp("handleDOMEvents",t=>{let n=t[e.type];return n?n(r,e)||e.defaultPrevented:!1})}function p9(r,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=r.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function m9(r,e){!vh(r,e)&&mt[e.type]&&(r.editable||!(e.type in gt))&&mt[e.type](r,e)}gt.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!j3(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(wr&<&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),Fs&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,pi(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||i9(r,t)?t.preventDefault():Dn(r,"key")};gt.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};gt.keypress=(r,e)=>{let t=e;if(j3(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||Kt&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof oe)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",s=>s(r,n.$from.pos,n.$to.pos,i))&&r.dispatch(r.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function j0(r){return{left:r.clientX,top:r.clientY}}function g9(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function xh(r,e,t,n,i){if(n==-1)return!1;let s=r.state.doc.resolve(n);for(let o=s.depth+1;o>0;o--)if(r.someProp(e,l=>o>s.depth?l(r,t,s.nodeAfter,s.before(o),i,!0):l(r,t,s.node(o),s.before(o),i,!1)))return!0;return!1}function Ts(r,e,t){r.focused||r.focus();let n=r.state.tr.setSelection(e);t=="pointer"&&n.setMeta("pointer",!0),r.dispatch(n)}function y9(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&te.isSelectable(n)?(Ts(r,new te(t),"pointer"),!0):!1}function v9(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof te&&(n=t.node);let s=r.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(te.isSelectable(l)){n&&t.$from.depth>0&&o>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(o);break}}return i!=null?(Ts(r,te.create(r.state.doc,i),"pointer"),!0):!1}function x9(r,e,t,n,i){return xh(r,"handleClickOn",e,t,n)||r.someProp("handleClick",s=>s(r,e,n))||(i?v9(r,t):y9(r,t))}function k9(r,e,t,n){return xh(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function w9(r,e,t,n){return xh(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||S9(r,t,n)}function S9(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(Ts(r,oe.create(n,0,n.content.size),"pointer"),!0):!1;let i=n.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)Ts(r,oe.create(n,l+1,l+1+o.content.size),"pointer");else if(te.isSelectable(o))Ts(r,te.create(n,l),"pointer");else continue;return!0}}function kh(r){return c0(r)}const W3=Kt?"metaKey":"ctrlKey";mt.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=kh(r),i=Date.now(),s="singleClick";i-r.input.lastClick.time<500&&g9(t,r.input.lastClick)&&!t[W3]&&(r.input.lastClick.type=="singleClick"?s="doubleClick":r.input.lastClick.type=="doubleClick"&&(s="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let o=r.posAtCoords(j0(t));o&&(s=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new b9(r,o,t,!!n)):(s=="doubleClick"?k9:w9)(r,o.pos,o.inside,t)?t.preventDefault():Dn(r,"pointer"))};class b9{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[W3],this.allowDefault=n.shiftKey;let s,o;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);s=c.parent,o=c.depth?c.before():0}const l=i?null:n.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:u}=e.state;(n.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||u instanceof te&&u.from<=o&&u.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Er&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Dn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>on(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(j0(e))),this.updateAllowDefault(e),this.allowDefault||!t?Dn(this.view,"pointer"):x9(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pt&&this.mightDrag&&!this.mightDrag.node.isAtom||lt&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ts(this.view,ie.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Dn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Dn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}mt.touchstart=r=>{r.input.lastTouch=Date.now(),kh(r),Dn(r,"pointer")};mt.touchmove=r=>{r.input.lastTouch=Date.now(),Dn(r,"pointer")};mt.contextmenu=r=>kh(r);function j3(r,e){return r.composing?!0:pt&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const M9=wr?5e3:-1;gt.compositionstart=gt.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))r.markCursor=r.state.storedMarks||t.marks(),c0(r,!0),r.markCursor=null;else if(c0(r),Er&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,s=n.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){r.domSelection().collapse(o,o.nodeValue.length);break}else i=o,s=-1}}r.input.composing=!0}Y3(r,M9)};gt.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionID++,Y3(r,20))};function Y3(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>c0(r),e))}function J3(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=T9());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function T9(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function c0(r,e=!1){if(!(wr&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),J3(r),e||r.docView&&r.docView.dirty){let t=gh(r);return t&&!t.eq(r.state.selection)?r.dispatch(r.state.tr.setSelection(t)):r.updateState(r.state),!0}return!1}}function C9(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const $s=Nt&&_n<15||Fs&&C8<604;mt.copy=gt.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let s=$s?null:t.clipboardData,o=n.content(),{dom:l,text:a}=F3(r,o);s?(t.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",a)):C9(r,l),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function E9(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function N9(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?ll(r,n.value,null,r.input.shiftKey,e):ll(r,n.textContent,n.innerHTML,r.input.shiftKey,e)},50)}function ll(r,e,t,n,i){let s=$3(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",a=>a(r,i,s||U.empty)))return!0;if(!s)return!1;let o=E9(s),l=o?r.state.tr.replaceSelectionWith(o,r.input.shiftKey):r.state.tr.replaceSelection(s);return r.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}gt.paste=(r,e)=>{let t=e;if(r.composing&&!wr)return;let n=$s?null:t.clipboardData;n&&ll(r,n.getData("text/plain"),n.getData("text/html"),r.input.shiftKey,t)?t.preventDefault():N9(r,t)};class A9{constructor(e,t){this.slice=e,this.move=t}}const K3=Kt?"altKey":"ctrlKey";mt.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,s=i.empty?null:r.posAtCoords(j0(t));if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof te?i.to-1:i.to))){if(n&&n.mightDrag)r.dispatch(r.state.tr.setSelection(te.create(r.state.doc,n.mightDrag.pos)));else if(t.target&&t.target.nodeType==1){let u=r.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=r.docView&&r.dispatch(r.state.tr.setSelection(te.create(r.state.doc,u.posBefore)))}}let o=r.state.selection.content(),{dom:l,text:a}=F3(r,o);t.dataTransfer.clearData(),t.dataTransfer.setData($s?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",$s||t.dataTransfer.setData("text/plain",a),r.dragging=new A9(o,!t[K3])};mt.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};gt.dragover=gt.dragenter=(r,e)=>e.preventDefault();gt.drop=(r,e)=>{let t=e,n=r.dragging;if(r.dragging=null,!t.dataTransfer)return;let i=r.posAtCoords(j0(t));if(!i)return;let s=r.state.doc.resolve(i.pos),o=n&&n.slice;o?r.someProp("transformPasted",g=>{o=g(o,r)}):o=$3(r,t.dataTransfer.getData($s?"Text":"text/plain"),$s?null:t.dataTransfer.getData("text/html"),!1,s);let l=!!(n&&!t[K3]);if(r.someProp("handleDrop",g=>g(r,t,o||U.empty,l))){t.preventDefault();return}if(!o)return;t.preventDefault();let a=o?c3(r.state.doc,s.pos,o):s.pos;a==null&&(a=s.pos);let u=r.state.tr;l&&u.deleteSelection();let c=u.mapping.map(a),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,d=u.doc;if(f?u.replaceRangeWith(c,c,o.content.firstChild):u.replaceRange(c,c,o),u.doc.eq(d))return;let p=u.doc.resolve(c);if(f&&te.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new te(p));else{let g=u.mapping.map(a);u.mapping.maps[u.mapping.maps.length-1].forEach((v,T,x,w)=>g=w),u.setSelection(yh(r,p,u.doc.resolve(g)))}r.focus(),r.dispatch(u.setMeta("uiEvent","drop"))};mt.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&on(r)},20))};mt.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};mt.beforeinput=(r,e)=>{if(lt&&wr&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",s=>s(r,pi(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in gt)mt[r]=gt[r];function al(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class wh{constructor(e,t){this.toDOM=e,this.spec=t||Ii,this.side=this.spec.side||0}map(e,t,n,i){let{pos:s,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new ir(s-n,s-n,this)}valid(){return!0}eq(e){return this==e||e instanceof wh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&al(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Wn{constructor(e,t){this.attrs=e,this.spec=t||Ii}map(e,t,n,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return s>=o?null:new ir(s,o,this)}valid(e,t){return t.from=e&&(!s||s(l.spec))&&n.push(l.copy(l.from+i,l.to+i))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,n,i+l,s)}}map(e,t,n){return this==st||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Ii)}mapInner(e,t,n,i,s){let o;for(let l=0;l{let u=a+n,c;if(c=X3(t,l,u)){for(i||(i=this.children.slice());sl&&f.to=e){this.children[l]==e&&(n=this.children[l+2]);break}let s=e+1,o=s+t.content.size;for(let l=0;ls&&a.type instanceof Wn){let u=Math.max(s,a.from)-s,c=Math.min(o,a.to)-s;ui.map(e,t,Ii));return On.from(n)}forChild(e,t){if(t.isLeaf)return He.empty;let n=[];for(let i=0;it instanceof He)?e:e.reduce((t,n)=>t.concat(n instanceof He?n:n.members),[]))}}}function O9(r,e,t,n,i,s,o){let l=r.slice();for(let u=0,c=s;u{let T=v-g-(p-d);for(let x=0;xw+c-f)continue;let S=l[x]+c-f;p>=S?l[x+1]=d<=S?-2:-1:g>=i&&T&&(l[x]+=T,l[x+1]+=T)}f+=T}),c=t.maps[u].map(c,-1)}let a=!1;for(let u=0;u=n.content.size){a=!0;continue}let d=t.map(r[u+1]+s,-1),p=d-i,{index:g,offset:v}=n.content.findIndex(f),T=n.maybeChild(g);if(T&&v==f&&v+T.nodeSize==p){let x=l[u+2].mapInner(t,T,c+1,r[u]+s+1,o);x!=st?(l[u]=f,l[u+1]=p,l[u+2]=x):(l[u+1]=-2,a=!0)}else a=!0}if(a){let u=z9(l,r,e,t,i,s,o),c=f0(u,n,0,o);e=c.local;for(let f=0;ft&&o.to{let u=X3(r,l,a+t);if(u){s=!0;let c=f0(u,l,t+a+1,n);c!=st&&i.push(a,a+l.nodeSize,c)}});let o=G3(s?Q3(r):r,-t).sort(Di);for(let l=0;l0;)e++;r.splice(e,0,t)}function Ku(r){let e=[];return r.someProp("decorations",t=>{let n=t(r.state);n&&n!=st&&e.push(n)}),r.cursorWrapper&&e.push(He.create(r.state.doc,[r.cursorWrapper.deco])),On.from(e)}const I9={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},D9=Nt&&_n<=11;class R9{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class P9{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new R9,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),D9&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,I9)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(J1(this.view)){if(this.suppressingSelectionUpdates)return on(this.view);if(Nt&&_n<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Vi(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let s=e.focusNode;s;s=ol(s))t.add(s);for(let s=e.anchorNode;s;s=ol(s))if(t.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);if(i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);let n=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&J1(e)&&!this.ignoreSelectionChange(n),s=-1,o=-1,l=!1,a=[];if(e.editable)for(let c=0;c1){let c=a.filter(f=>f.nodeName=="BR");if(c.length==2){let f=c[0],d=c[1];f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}}let u=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(s>-1&&(e.docView.markDirty(s,o),B9(e)),this.handleDOMChange(s,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||on(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let c=0;ci;T--){let x=n.childNodes[T-1],w=x.pmViewDesc;if(x.nodeName=="BR"&&!w){s=T;break}if(!w||w.size)break}let f=r.state.doc,d=r.someProp("domParser")||ah.fromSchema(r.state.schema),p=f.resolve(o),g=null,v=d.parse(n,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:$9,context:p});if(u&&u[0].pos!=null){let T=u[0].pos,x=u[1]&&u[1].pos;x==null&&(x=T),g={anchor:T+o,head:x+o}}return{doc:v,sel:g,from:o,to:l}}function $9(r){let e=r.pmViewDesc;if(e)return e.parseRule();if(r.nodeName=="BR"&&r.parentNode){if(pt&&/^(ul|ol)$/i.test(r.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(r.parentNode.lastChild==r||pt&&/^(tr|table)$/i.test(r.parentNode.nodeName))return{ignore:!0}}else if(r.nodeName=="IMG"&&r.getAttribute("mark-placeholder"))return{ignore:!0};return null}const V9=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function H9(r,e,t,n,i){if(e<0){let O=r.input.lastSelectionTime>Date.now()-50?r.input.lastSelectionOrigin:null,W=gh(r,O);if(W&&!r.state.selection.eq(W)){if(lt&&wr&&r.input.lastKeyCode===13&&Date.now()-100de(r,pi(13,"Enter"))))return;let K=r.state.tr.setSelection(W);O=="pointer"?K.setMeta("pointer",!0):O=="key"&&K.scrollIntoView(),r.composing&&K.setMeta("composition",r.input.compositionID),r.dispatch(K)}return}let s=r.state.doc.resolve(e),o=s.sharedDepth(t);e=s.before(o+1),t=r.state.doc.resolve(t).after(o+1);let l=r.state.selection,a=F9(r,e,t),u=r.state.doc,c=u.slice(a.from,a.to),f,d;r.input.lastKeyCode===8&&Date.now()-100Date.now()-225||wr)&&i.some(O=>O.nodeType==1&&!V9.test(O.nodeName))&&(!p||p.endA>=p.endB)&&r.someProp("handleKeyDown",O=>O(r,pi(13,"Enter")))){r.input.lastIOSEnter=0;return}if(!p)if(n&&l instanceof oe&&!l.empty&&l.$head.sameParent(l.$anchor)&&!r.composing&&!(a.sel&&a.sel.anchor!=a.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(a.sel){let O=sm(r,r.state.doc,a.sel);if(O&&!O.eq(r.state.selection)){let W=r.state.tr.setSelection(O);r.composing&&W.setMeta("composition",r.input.compositionID),r.dispatch(W)}}return}if(lt&&r.cursorWrapper&&a.sel&&a.sel.anchor==r.cursorWrapper.deco.from&&a.sel.head==a.sel.anchor){let O=p.endB-p.start;a.sel={anchor:a.sel.anchor+O,head:a.sel.anchor+O}}r.input.domChangeCount++,r.state.selection.fromr.state.selection.from&&p.start<=r.state.selection.from+2&&r.state.selection.from>=a.from?p.start=r.state.selection.from:p.endA=r.state.selection.to-2&&r.state.selection.to<=a.to&&(p.endB+=r.state.selection.to-p.endA,p.endA=r.state.selection.to)),Nt&&_n<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>a.from&&a.doc.textBetween(p.start-a.from-1,p.start-a.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let g=a.doc.resolveNoCache(p.start-a.from),v=a.doc.resolveNoCache(p.endB-a.from),T=u.resolve(p.start),x=g.sameParent(v)&&g.parent.inlineContent&&T.end()>=p.endA,w;if((Fs&&r.input.lastIOSEnter>Date.now()-225&&(!x||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!x&&g.posO(r,pi(13,"Enter")))){r.input.lastIOSEnter=0;return}if(r.state.selection.anchor>p.start&&_9(u,p.start,p.endA,g,v)&&r.someProp("handleKeyDown",O=>O(r,pi(8,"Backspace")))){wr&<&&r.domObserver.suppressSelectionUpdates();return}lt&&wr&&p.endB==p.start&&(r.input.lastAndroidDelete=Date.now()),wr&&!x&&g.start()!=v.start()&&v.parentOffset==0&&g.depth==v.depth&&a.sel&&a.sel.anchor==a.sel.head&&a.sel.head==p.endA&&(p.endB-=2,v=a.doc.resolveNoCache(p.endB-a.from),setTimeout(()=>{r.someProp("handleKeyDown",function(O){return O(r,pi(13,"Enter"))})},20));let S=p.start,E=p.endA,A,z,I;if(x){if(g.pos==v.pos)Nt&&_n<=11&&g.parentOffset==0&&(r.domObserver.suppressSelectionUpdates(),setTimeout(()=>on(r),20)),A=r.state.tr.delete(S,E),z=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(I=q9(g.parent.content.cut(g.parentOffset,v.parentOffset),T.parent.content.cut(T.parentOffset,p.endA-T.start()))))A=r.state.tr,I.type=="add"?A.addMark(S,E,I.mark):A.removeMark(S,E,I.mark);else if(g.parent.child(g.index()).isText&&g.index()==v.index()-(v.textOffset?0:1)){let O=g.parent.textBetween(g.parentOffset,v.parentOffset);if(r.someProp("handleTextInput",W=>W(r,S,E,O)))return;A=r.state.tr.insertText(O,S,E)}}if(A||(A=r.state.tr.replace(S,E,a.doc.slice(p.start-a.from,p.endB-a.from))),a.sel){let O=sm(r,A.doc,a.sel);O&&!(lt&&wr&&r.composing&&O.empty&&(p.start!=p.endB||r.input.lastAndroidDeletee.content.size?null:yh(r,e.resolve(t.anchor),e.resolve(t.head))}function q9(r,e){let t=r.firstChild.marks,n=e.firstChild.marks,i=t,s=n,o,l,a;for(let c=0;cc.mark(l.addToSet(c.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",a=c=>c.mark(l.removeFromSet(c.marks));else return null;let u=[];for(let c=0;ct||Gu(o,!0,!1)0&&(e||r.indexAfter(n)==r.node(n).childCount);)n--,i++,e=!1;if(t){let s=r.node(n).maybeChild(r.indexAfter(n));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function U9(r,e,t,n,i){let s=r.findDiffStart(e,t);if(s==null)return null;let{a:o,b:l}=r.findDiffEnd(e,t+r.size,t+e.size);if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l=l?s-n:0;s-=a,o=s+(o-l),l=s}return{start:s,endA:o,endB:l}}class W9{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new f9,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(cm),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=am(this),lm(this),this.nodeViews=um(this),this.docView=q1(this.state.doc,om(this),Ku(this),this.dom,this),this.domObserver=new P9(this,(n,i,s,o)=>H9(this,n,i,s,o)),this.domObserver.start(),d9(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Uf(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(cm),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(J3(this),s=!0),this.state=e;let o=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let d=um(this);Y9(d,this.nodeViews)&&(this.nodeViews=d,i=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&Uf(this),this.editable=am(this),lm(this);let l=Ku(this),a=om(this),u=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",c=i||!this.docView.matchesNode(e.doc,a,l);(c||!e.selection.eq(n.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&A8(this);if(s){this.domObserver.stop();let d=c&&(Nt||lt)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&j9(n.selection,e.selection);if(c){let p=lt?this.trackWrites=this.domSelectionRange().focusNode:null;(i||!this.docView.update(e.doc,a,l,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=q1(e.doc,a,l,this.dom,this)),p&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&e9(this))?on(this,d):(R3(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&O8(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof te){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&B1(this,t.getBoundingClientRect(),e)}else B1(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;tt.ownerDocument.getSelection()),this._root=t}return e||document}posAtCoords(e){return B8(this,e)}coordsAtPos(e,t=1){return C3(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let i=this.docView.posFromDOM(e,t,n);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return H8(this,t||this.state,e)}pasteHTML(e,t){return ll(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ll(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(h9(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ku(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return m9(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return pt&&this.root.nodeType===11&&S8(this.dom.ownerDocument)==this.dom?L9(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function om(r){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(r.editable),r.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(r.state)),t)for(let n in t)n=="class"?e.class+=" "+t[n]:n=="style"?e.style=(e.style?e.style+";":"")+t[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(t[n]))}),e.translate||(e.translate="no"),[ir.node(0,r.state.doc.content.size,e)]}function lm(r){if(r.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),r.cursorWrapper={dom:e,deco:ir.widget(r.state.selection.head,e,{raw:!0,marks:r.markCursor})}}else r.cursorWrapper=null}function am(r){return!r.someProp("editable",e=>e(r.state)===!1)}function j9(r,e){let t=Math.min(r.$anchor.sharedDepth(r.head),e.$anchor.sharedDepth(e.head));return r.$anchor.start(t)!=e.$anchor.start(t)}function um(r){let e=Object.create(null);function t(n){for(let i in n)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=n[i])}return r.someProp("nodeViews",t),r.someProp("markViews",t),e}function Y9(r,e){let t=0,n=0;for(let i in r){if(r[i]!=e[i])return!0;t++}for(let i in e)n++;return t!=n}function cm(r){if(r.spec.state||r.spec.filterTransaction||r.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Gn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},d0={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},fm=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),J9=typeof navigator<"u"&&/Mac/.test(navigator.platform),K9=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),G9=J9||fm&&+fm[1]<57;for(var et=0;et<10;et++)Gn[48+et]=Gn[96+et]=String(et);for(var et=1;et<=24;et++)Gn[et+111]="F"+et;for(var et=65;et<=90;et++)Gn[et]=String.fromCharCode(et+32),d0[et]=String.fromCharCode(et);for(var Xu in Gn)d0.hasOwnProperty(Xu)||(d0[Xu]=Gn[Xu]);function X9(r){var e=G9&&(r.ctrlKey||r.altKey||r.metaKey)||K9&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?d0:Gn)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Q9=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Z9(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,s,o;for(let l=0;l127)&&(s=Gn[n.keyCode])&&s!=i){let l=e[Qu(s,n)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const rx=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function nx(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const ix=(r,e,t)=>{let n=nx(r,t);if(!n)return!1;let i=e5(n);if(!i){let o=n.blockRange(),l=o&&Js(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&n5(r,i,e))return!0;if(n.parent.content.size==0&&(Vs(s,"end")||te.isSelectable(s))){let o=ph(r.doc,n.before(),n.after(),U.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=e5(n)}let o=s&&s.nodeBefore;return!o||!te.isSelectable(o)?!1:(e&&e(r.tr.setSelection(te.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function e5(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function ox(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset{let n=ox(r,t);if(!n)return!1;let i=t5(n);if(!i)return!1;let s=i.nodeAfter;if(n5(r,i,e))return!0;if(n.parent.content.size==0&&(Vs(s,"start")||te.isSelectable(s))){let o=ph(r.doc,n.before(),n.after(),U.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset=0;e--){let t=r.node(e);if(r.index(e)+1{let t=r.selection,n=t instanceof te,i;if(n){if(t.node.isTextblock||!ni(r.doc,t.from))return!1;i=t.from}else if(i=u3(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(te.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},cx=(r,e)=>{let t=r.selection,n;if(t instanceof te){if(t.node.isTextblock||!ni(r.doc,t.to))return!1;n=t.to}else if(n=u3(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},fx=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Js(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},dx=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(` +`).scrollIntoView()),!0)};function r5(r){for(let e=0;e{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=r5(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(ie.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},px=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof zi||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=r5(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index(){let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Ms(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Js(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)},gx=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(te.create(r.doc,i))),!0)};function yx(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||ni(r.doc,e.pos))?!1:(t&&t(r.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function n5(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s,o;if(n.type.spec.isolating||i.type.spec.isolating)return!1;if(yx(r,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(s=(o=n.contentMatchAt(n.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,d=F.empty;for(let v=s.length-1;v>=0;v--)d=F.from(s[v].create(null,d));d=F.from(n.copy(d));let p=r.tr.step(new Ot(e.pos-1,f,e.pos,f,new U(d,1,0),s.length,!0)),g=f+2*s.length;ni(p.doc,g)&&p.join(g),t(p.scrollIntoView())}return!0}let a=ie.findFrom(e,1),u=a&&a.$from.blockRange(a.$to),c=u&&Js(u);if(c!=null&&c>=e.depth)return t&&t(r.tr.lift(u,c).scrollIntoView()),!0;if(l&&Vs(i,"start",!0)&&Vs(n,"end")){let f=n,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(t){let v=F.empty;for(let x=d.length-1;x>=0;x--)v=F.from(d[x].copy(v));let T=r.tr.step(new Ot(e.pos-d.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new U(v,d.length,0),0,!0));t(T.scrollIntoView())}return!0}}return!1}function i5(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(oe.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const vx=i5(-1),xx=i5(1);function kx(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&hh(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function dm(r,e=null){return function(t,n){let i=!1;for(let s=0;s{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o=2&&i.node(o.depth-1).type.compatibleContent(r)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let c=t.doc.resolve(o.start-2);a=new o0(c,c,o.depth),o.endIndex=0;c--)s=F.from(t[c].type.create(t[c].attrs,s));r.step(new Ot(e.start-(n?2:0),e.end,e.start,e.end,new U(s,0,0),t.length,!0));let o=0;for(let c=0;co.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?Mx(e,t,r,s):Tx(e,t,s):!0:!1}}function Mx(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);sv;g--)p-=i.child(g).nodeSize,n.delete(p-1,p+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(l?0:1),c+1,o.content.append(a?F.empty:F.from(i))))return!1;let f=s.pos,d=f+o.nodeSize;return n.step(new Ot(f-(l?1:0),d+(a?1:0),f+1,d-1,new U((l?F.empty:F.from(i.copy(F.empty))).append(a?F.empty:F.from(i.copy(F.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function Cx(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let u=a.lastChild&&a.lastChild.type==l.type,c=F.from(u?r.create():null),f=new U(F.from(r.create(null,F.from(l.type.create(null,c)))),u?3:1,0),d=s.start,p=s.end;t(e.tr.step(new Ot(d-(u?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function Y0(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}let J0=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:s}=n,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>{const f=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,u=e||s.tr,c=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(n).map(([d,p])=>[d,(...v)=>{const T=this.buildProps(u,t),x=p(...v)(T);return l.push(x),f}])),run:c};return f}createCan(e){const{rawCommands:t,state:n}=this,i=!1,s=e||n.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i;s.storedMarks&&e.setStoredMarks(s.storedMarks);const l={tr:e,editor:i,view:o,state:Y0({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)(l)]))}};return l}};class Ex{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(i=>i.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function _(r,e,t){return r.config[e]===void 0&&r.parent?_(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?_(r.parent,e,t):null}):r.config[e]}function K0(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function s5(r){const e=[],{nodeExtensions:t,markExtensions:n}=K0(r),i=[...t,...n],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return r.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=_(o,"addGlobalAttributes",l);if(!a)return;a().forEach(c=>{c.types.forEach(f=>{Object.entries(c.attributes).forEach(([d,p])=>{e.push({type:f,name:d,attribute:{...s,...p}})})})})}),i.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},a=_(o,"addAttributes",l);if(!a)return;const u=a();Object.entries(u).forEach(([c,f])=>{const d={...s,...f};typeof(d==null?void 0:d.default)=="function"&&(d.default=d.default()),d!=null&&d.isRequired&&(d==null?void 0:d.default)===void 0&&delete d.default,e.push({type:o.name,name:c,attribute:d})})}),e}function Ge(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function Ue(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}i==="class"?n[i]=[n[i],s].join(" "):i==="style"?n[i]=[n[i],s].join("; "):n[i]=s}),n},{})}function Wf(r,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(r.attrs)||{}:{[t.name]:r.attrs[t.name]}).reduce((t,n)=>Ue(t,n),{})}function o5(r){return typeof r=="function"}function ne(r,e=void 0,...t){return o5(r)?e?r.bind(e)(...t):r(...t):r}function Nx(r={}){return Object.keys(r).length===0&&r.constructor===Object}function Ax(r){return typeof r!="string"?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):r==="true"?!0:r==="false"?!1:r}function hm(r,e){return r.style?r:{...r,getAttrs:t=>{const n=r.getAttrs?r.getAttrs(t):r.attrs;if(n===!1)return!1;const i=e.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):Ax(t.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...n,...i}}}}function pm(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>e==="attrs"&&Nx(t)?!1:t!=null))}function Ox(r,e){var t;const n=s5(r),{nodeExtensions:i,markExtensions:s}=K0(r),o=(t=i.find(u=>_(u,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(u=>{const c=n.filter(x=>x.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=r.reduce((x,w)=>{const S=_(w,"extendNodeSchema",f);return{...x,...S?S(u):{}}},{}),p=pm({...d,content:ne(_(u,"content",f)),marks:ne(_(u,"marks",f)),group:ne(_(u,"group",f)),inline:ne(_(u,"inline",f)),atom:ne(_(u,"atom",f)),selectable:ne(_(u,"selectable",f)),draggable:ne(_(u,"draggable",f)),code:ne(_(u,"code",f)),defining:ne(_(u,"defining",f)),isolating:ne(_(u,"isolating",f)),attrs:Object.fromEntries(c.map(x=>{var w;return[x.name,{default:(w=x==null?void 0:x.attribute)===null||w===void 0?void 0:w.default}]}))}),g=ne(_(u,"parseHTML",f));g&&(p.parseDOM=g.map(x=>hm(x,c)));const v=_(u,"renderHTML",f);v&&(p.toDOM=x=>v({node:x,HTMLAttributes:Wf(x,c)}));const T=_(u,"renderText",f);return T&&(p.toText=T),[u.name,p]})),a=Object.fromEntries(s.map(u=>{const c=n.filter(T=>T.type===u.name),f={name:u.name,options:u.options,storage:u.storage,editor:e},d=r.reduce((T,x)=>{const w=_(x,"extendMarkSchema",f);return{...T,...w?w(u):{}}},{}),p=pm({...d,inclusive:ne(_(u,"inclusive",f)),excludes:ne(_(u,"excludes",f)),group:ne(_(u,"group",f)),spanning:ne(_(u,"spanning",f)),code:ne(_(u,"code",f)),attrs:Object.fromEntries(c.map(T=>{var x;return[T.name,{default:(x=T==null?void 0:T.attribute)===null||x===void 0?void 0:x.default}]}))}),g=ne(_(u,"parseHTML",f));g&&(p.parseDOM=g.map(T=>hm(T,c)));const v=_(u,"renderHTML",f);return v&&(p.toDOM=T=>v({mark:T,HTMLAttributes:Wf(T,c)})),[u.name,p]}));return new Fv({topNode:o,nodes:l,marks:a})}function Zu(r,e){return e.nodes[r]||e.marks[r]||null}function mm(r,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===r.name):e}const zx=(r,e=500)=>{let t="";const n=r.parentOffset;return r.parent.nodesBetween(Math.max(0,n-e),n,(i,s,o,l)=>{var a,u;const c=((u=(a=i.type.spec).toText)===null||u===void 0?void 0:u.call(a,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";t+=c.slice(0,Math.max(0,n-s))}),t};function Mh(r){return Object.prototype.toString.call(r)==="[object RegExp]"}let G0=class{constructor(e){this.find=e.find,this.handler=e.handler}};const Ix=(r,e)=>{if(Mh(e))return e.exec(r);const t=e(r);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=r,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n};function ec(r){var e;const{editor:t,from:n,to:i,text:s,rules:o,plugin:l}=r,{view:a}=t;if(a.composing)return!1;const u=a.state.doc.resolve(n);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(d=>d.type.spec.code))return!1;let c=!1;const f=zx(u)+s;return o.forEach(d=>{if(c)return;const p=Ix(f,d.find);if(!p)return;const g=a.state.tr,v=Y0({state:a.state,transaction:g}),T={from:n-(p[0].length-s.length),to:i},{commands:x,chain:w,can:S}=new J0({editor:t,state:v});d.handler({state:v,range:T,match:p,commands:x,chain:w,can:S})===null||!g.steps.length||(g.setMeta(l,{transform:g,from:n,to:i,text:s}),a.dispatch(g),c=!0)}),c}function Dx(r){const{editor:e,rules:t}=r,n=new dr({state:{init(){return null},apply(i,s){const o=i.getMeta(n);return o||(i.selectionSet||i.docChanged?null:s)}},props:{handleTextInput(i,s,o,l){return ec({editor:e,from:s,to:o,text:l,rules:t,plugin:n})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&ec({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:n})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?ec({editor:e,from:o.pos,to:o.pos,text:` +`,rules:t,plugin:n}):!1}},isInputRules:!0});return n}function Rx(r){return typeof r=="number"}let Px=class{constructor(e){this.find=e.find,this.handler=e.handler}};const Bx=(r,e)=>{if(Mh(e))return[...r.matchAll(e)];const t=e(r);return t?t.map(n=>{const i=[n.text];return i.index=n.index,i.input=r,i.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(n.replaceWith)),i}):[]};function Lx(r){const{editor:e,state:t,from:n,to:i,rule:s}=r,{commands:o,chain:l,can:a}=new J0({editor:e,state:t}),u=[];return t.doc.nodesBetween(n,i,(f,d)=>{if(!f.isTextblock||f.type.spec.code)return;const p=Math.max(n,d),g=Math.min(i,d+f.content.size),v=f.textBetween(p-d,g-d,void 0,"");Bx(v,s.find).forEach(x=>{if(x.index===void 0)return;const w=p+x.index+1,S=w+x[0].length,E={from:t.tr.mapping.map(w),to:t.tr.mapping.map(S)},A=s.handler({state:t,range:E,match:x,commands:o,chain:l,can:a});u.push(A)})}),u.every(f=>f!==null)}function Fx(r){const{editor:e,rules:t}=r;let n=null,i=!1,s=!1;return t.map(l=>new dr({view(a){const u=c=>{var f;n=!((f=a.dom.parentElement)===null||f===void 0)&&f.contains(c.target)?a.dom.parentElement:null};return window.addEventListener("dragstart",u),{destroy(){window.removeEventListener("dragstart",u)}}},props:{handleDOMEvents:{drop:a=>(s=n===a.dom.parentElement,!1),paste:(a,u)=>{var c;const f=(c=u.clipboardData)===null||c===void 0?void 0:c.getData("text/html");return i=!!(f!=null&&f.includes("data-pm-slice")),!1}}},appendTransaction:(a,u,c)=>{const f=a[0],d=f.getMeta("uiEvent")==="paste"&&!i,p=f.getMeta("uiEvent")==="drop"&&!s;if(!d&&!p)return;const g=u.doc.content.findDiffStart(c.doc.content),v=u.doc.content.findDiffEnd(c.doc.content);if(!Rx(g)||!v||g===v.b)return;const T=c.tr,x=Y0({state:c,transaction:T});if(!(!Lx({editor:e,state:x,from:Math.max(g-1,0),to:v.b-1,rule:l})||!T.steps.length))return T}}))}function $x(r){const e=r.filter((t,n)=>r.indexOf(t)!==n);return[...new Set(e)]}class gs{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=gs.resolve(e),this.schema=Ox(this.extensions,t),this.extensions.forEach(n=>{var i;this.editor.extensionStorage[n.name]=n.storage;const s={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Zu(n.name,this.schema)};n.type==="mark"&&(!((i=ne(_(n,"keepOnSplit",s)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(n.name);const o=_(n,"onBeforeCreate",s);o&&this.editor.on("beforeCreate",o);const l=_(n,"onCreate",s);l&&this.editor.on("create",l);const a=_(n,"onUpdate",s);a&&this.editor.on("update",a);const u=_(n,"onSelectionUpdate",s);u&&this.editor.on("selectionUpdate",u);const c=_(n,"onTransaction",s);c&&this.editor.on("transaction",c);const f=_(n,"onFocus",s);f&&this.editor.on("focus",f);const d=_(n,"onBlur",s);d&&this.editor.on("blur",d);const p=_(n,"onDestroy",s);p&&this.editor.on("destroy",p)})}static resolve(e){const t=gs.sort(gs.flatten(e)),n=$x(t.map(i=>i.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},i=_(t,"addExtensions",n);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((n,i)=>{const s=_(n,"priority")||100,o=_(i,"priority")||100;return s>o?-1:s{const n={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Zu(t.name,this.schema)},i=_(t,"addCommands",n);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=gs.sort([...this.extensions].reverse()),n=[],i=[],s=t.map(o=>{const l={name:o.name,options:o.options,storage:o.storage,editor:e,type:Zu(o.name,this.schema)},a=[],u=_(o,"addKeyboardShortcuts",l);let c={};if(o.type==="mark"&&o.config.exitable&&(c.ArrowRight=()=>Ui.handleExit({editor:e,mark:o})),u){const v=Object.fromEntries(Object.entries(u()).map(([T,x])=>[T,()=>x({editor:e})]));c={...c,...v}}const f=tx(c);a.push(f);const d=_(o,"addInputRules",l);mm(o,e.options.enableInputRules)&&d&&n.push(...d());const p=_(o,"addPasteRules",l);mm(o,e.options.enablePasteRules)&&p&&i.push(...p());const g=_(o,"addProseMirrorPlugins",l);if(g){const v=g();a.push(...v)}return a}).flat();return[Dx({editor:e,rules:n}),...Fx({editor:e,rules:i}),...s]}get attributes(){return s5(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=K0(this.extensions);return Object.fromEntries(t.filter(n=>!!_(n,"addNodeView")).map(n=>{const i=this.attributes.filter(a=>a.type===n.name),s={name:n.name,options:n.options,storage:n.storage,editor:e,type:Ge(n.name,this.schema)},o=_(n,"addNodeView",s);if(!o)return[];const l=(a,u,c,f)=>{const d=Wf(a,i);return o()({editor:e,node:a,getPos:c,decorations:f,HTMLAttributes:d,extension:n})};return[n.name,l]}))}}function Vx(r){return Object.prototype.toString.call(r).slice(8,-1)}function tc(r){return Vx(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function X0(r,e){const t={...r};return tc(r)&&tc(e)&&Object.keys(e).forEach(n=>{tc(e[n])?n in r?t[n]=X0(r[n],e[n]):Object.assign(t,{[n]:e[n]}):Object.assign(t,{[n]:e[n]})}),t}let Yr=class jf{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ne(_(this,"addOptions",{name:this.name}))),this.storage=ne(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new jf(e)}configure(e={}){const t=this.extend();return t.options=X0(this.options,e),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new jf(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ne(_(t,"addOptions",{name:t.name})),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}};function l5(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=` -`,textSerializers:o={}}=t||{};let l="",a=!0;return r.nodesBetween(n,i,(u,c,f,d)=>{var p;const g=o==null?void 0:o[u.type.name];g?(u.isBlock&&!a&&(l+=s,a=!0),f&&(l+=g({node:u,pos:c,parent:f,index:d,range:e}))):u.isText?(l+=(p=u==null?void 0:u.text)===null||p===void 0?void 0:p.slice(Math.max(n,c)-c,i-c),a=!1):u.isBlock&&!a&&(l+=s,a=!0)}),l}function a5(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const Hx=jr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new dr({key:new ii("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=a5(t);return l5(n,{from:o,to:l},{textSerializers:a})}}})]}}),qx=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),_x=(r=!1)=>({commands:e})=>e.setContent("",r),Ux=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(a)),d=u.resolve(c.map(a+l.nodeSize)),p=f.blockRange(d);if(!p)return;const g=Js(p);if(l.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,v)}(g||g===0)&&e.lift(p,g)})}),!0},Wx=r=>e=>r(e),jx=()=>({state:r,dispatch:e})=>px(r,e),Yx=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1},Jx=r=>({tr:e,state:t,dispatch:n})=>{const i=Ke(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),u=s.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1},Kx=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},Gx=()=>({state:r,dispatch:e})=>rx(r,e),Xx=()=>({commands:r})=>r.keyboardShortcut("Enter"),Qx=()=>({state:r,dispatch:e})=>hx(r,e);function h0(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:Mh(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function Yf(r,e,t={}){return r.find(n=>n.type===e&&h0(n.attrs,t))}function Zx(r,e,t={}){return!!Yf(r,e,t)}function Th(r,e,t={}){if(!r||!e)return;let n=r.parent.childAfter(r.parentOffset);if(r.parentOffset===n.offset&&n.offset!==0&&(n=r.parent.childBefore(r.parentOffset)),!n.node)return;const i=Yf([...n.node.marks],e,t);if(!i)return;let s=n.index,o=r.start()+n.offset,l=s+1,a=o+n.node.nodeSize;for(Yf([...n.node.marks],e,t);s>0&&i.isInSet(r.parent.child(s-1).marks);)s-=1,o-=r.parent.child(s).nodeSize;for(;l({tr:t,state:n,dispatch:i})=>{const s=oi(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:u,to:c}=l;if(i){const f=Th(a,s,e);if(f&&f.from<=u&&f.to>=c){const d=oe.create(o,f.from,f.to);t.setSelection(d)}}return!0},tk=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Ch()&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!u5(t.state.selection))return o(),!0;const l=c5(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},nk=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),ik=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e);function gm(r){const e=`${r}`;return new window.DOMParser().parseFromString(e,"text/html").body}function p0(r,e,t){if(t={slice:!0,parseOptions:{},...t},typeof r=="object"&&r!==null)try{return Array.isArray(r)&&r.length>0?F.fromArray(r.map(n=>e.nodeFromJSON(n))):e.nodeFromJSON(r)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",n),p0("",e,t)}if(typeof r=="string"){const n=ah.fromSchema(e);return t.slice?n.parseSlice(gm(r),t.parseOptions).content:n.parse(gm(r),t.parseOptions)}return p0("",e,t)}function sk(r,e,t){const n=r.steps.length-1;if(n{o===0&&(o=c)}),r.setSelection(ie.near(r.doc.resolve(o),t))}const ok=r=>r.toString().startsWith("<"),lk=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const o=p0(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:l,to:a}=typeof r=="number"?{from:r,to:r}:r,u=!0,c=!0;if((ok(o)?o:[o]).forEach(d=>{d.check(),u=u?d.isText&&d.marks.length===0:!1,c=c?d.isBlock:!1}),l===a&&c){const{parent:d}=n.doc.resolve(l);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(l-=1,a+=1)}u?Array.isArray(e)?n.insertText(e.map(d=>d.text||"").join(""),l,a):typeof e=="object"&&e&&e.text?n.insertText(e.text,l,a):n.insertText(e,l,a):n.replaceWith(l,a,o),t.updateSelection&&sk(n,n.steps.length-1,-1)}return!0},ak=()=>({state:r,dispatch:e})=>ux(r,e),uk=()=>({state:r,dispatch:e})=>cx(r,e),ck=()=>({state:r,dispatch:e})=>ix(r,e),fk=()=>({state:r,dispatch:e})=>lx(r,e);function f5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function dk(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l({editor:e,view:t,tr:n,dispatch:i})=>{const s=dk(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,l))});return a==null||a.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function ul(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?Ke(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(f,d)=>{if(f.isText)return;const p=Math.max(n,d),g=Math.min(i,d+f.nodeSize);l.push({node:f,from:p,to:g})});const a=i-n,u=l.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>h0(f.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=a}const pk=(r,e={})=>({state:t,dispatch:n})=>{const i=Ke(r,t.schema);return ul(t,i,e)?fx(t,n):!1},mk=()=>({state:r,dispatch:e})=>mx(r,e),gk=r=>({state:e,dispatch:t})=>{const n=Ke(r,e.schema);return bx(n)(e,t)},yk=()=>({state:r,dispatch:e})=>dx(r,e);function Q0(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function ym(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const vk=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=Q0(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Ke(r,n.schema)),l==="mark"&&(o=oi(r,n.schema)),i&&t.selection.ranges.forEach(a=>{n.doc.nodesBetween(a.$from.pos,a.$to.pos,(u,c)=>{s&&s===u.type&&t.setNodeMarkup(c,void 0,ym(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&t.addMark(c,c+u.nodeSize,o.create(ym(f.attrs,e)))})})}),!0):!1},xk=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),kk=()=>({tr:r,commands:e})=>e.setTextSelection({from:0,to:r.doc.content.size}),wk=()=>({state:r,dispatch:e})=>sx(r,e),Sk=()=>({state:r,dispatch:e})=>ax(r,e),bk=()=>({state:r,dispatch:e})=>gx(r,e),Mk=()=>({state:r,dispatch:e})=>xx(r,e),Tk=()=>({state:r,dispatch:e})=>vx(r,e);function d5(r,e,t={}){return p0(r,e,{slice:!1,parseOptions:t})}const Ck=(r,e=!1,t={})=>({tr:n,editor:i,dispatch:s})=>{const{doc:o}=n,l=d5(r,i.schema,t);return s&&n.replaceWith(0,o.content.size,l).setMeta("preventUpdate",!e),!0};function Ek(r){for(let e=0;e0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Eh(r){return e=>Nk(e.$from,r)}function Ak(r,e){const t=Fr.fromSchema(e).serializeFragment(r),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Ok(r,e){const t={from:0,to:r.content.size};return l5(r,t,e)}function Z0(r,e){const t=oi(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function zk(r,e){const t=Ke(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function Ik(r,e){const t=Q0(typeof e=="string"?e:e.name,r.schema);return t==="node"?zk(r,e):t==="mark"?Z0(r,e):{}}function h5(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r-1),o=Th(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}function Ea(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function Jf(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?oi(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>h0(f.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,g=d.pos;r.doc.nodesBetween(p,g,(v,T)=>{if(!v.isText&&!v.marks.length)return;const x=Math.max(p,T),w=Math.min(g,T+v.nodeSize),S=w-x;o+=S,l.push(...v.marks.map(E=>({mark:E,from:x,to:w})))})}),o===0)return!1;const a=l.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>h0(f.mark.attrs,t,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=l.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,d)=>f+d.to-d.from,0);return(a>0?a+u:a)>=o}function Dk(r,e,t={}){if(!e)return ul(r,null,t)||Jf(r,null,t);const n=Q0(e,r.schema);return n==="node"?ul(r,e,t):n==="mark"?Jf(r,e,t):!1}function vm(r,e){const{nodeExtensions:t}=K0(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=ne(_(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Rk(r){var e;const t=(e=r.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),n=r.toJSON();return JSON.stringify(t)===JSON.stringify(n)}function Pk(r,e,t){var n;const{selection:i}=e;let s=null;if(u5(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!==null&&n!==void 0?n:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let u=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const p=!d||d.type.allowsMarkType(t),g=!!t.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(t));u=p&&g}return!u}),u})}const Bk=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=oi(r,n.schema);if(i)if(o){const u=Z0(n,a);t.addStoredMark(a.create({...u,...e}))}else l.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;n.doc.nodesBetween(c,f,(d,p)=>{const g=Math.max(p,c),v=Math.min(p+d.nodeSize,f);d.marks.find(x=>x.type===a)?d.marks.forEach(x=>{a===x.type&&t.addMark(g,v,a.create({...x.attrs,...e}))}):t.addMark(g,v,a.create(e))})});return Pk(n,t,a)},Lk=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),Fk=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=Ke(r,t.schema);return s.isTextblock?i().command(({commands:o})=>dm(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>dm(s,e)(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},$k=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=wi(r,0,n.content.size),s=te.create(n,i);e.setSelection(s)}return!0},Vk=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=oe.atStart(n).from,l=oe.atEnd(n).to,a=wi(i,o,l),u=wi(s,o,l),c=oe.create(n,a,u);e.setSelection(c)}return!0},Hk=r=>({state:e,dispatch:t})=>{const n=Ke(r,e.schema);return Cx(n)(e,t)};function xm(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const qk=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,u=i.extensionManager.attributes,c=Ea(u,l.node().type.name,l.node().attrs);if(s instanceof te&&s.node.isBlock)return!l.parentOffset||!Ms(o,l.pos)?!1:(n&&(r&&xm(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(n){const f=a.parentOffset===a.parent.content.size;s instanceof oe&&e.deleteSelection();const d=l.depth===0?void 0:Ek(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&d?[{type:d,attrs:c}]:void 0,g=Ms(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!g&&Ms(e.doc,e.mapping.map(l.pos),1,d?[{type:d}]:void 0)&&(g=!0,p=d?[{type:d,attrs:c}]:void 0),g&&(e.split(e.mapping.map(l.pos),1,p),d&&!f&&!l.parentOffset&&l.parent.type!==d)){const v=e.mapping.map(l.before()),T=e.doc.resolve(v);l.node(-1).canReplaceWith(T.index(),T.index()+1,d)&&e.setNodeMarkup(e.mapping.map(l.before()),d)}r&&xm(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},_k=r=>({tr:e,state:t,dispatch:n,editor:i})=>{var s;const o=Ke(r,t.schema),{$from:l,$to:a}=t.selection,u=t.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(a))return!1;const c=l.node(-1);if(c.type!==o)return!1;const f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){let T=F.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let I=l.depth-x;I>=l.depth-3;I-=1)T=F.from(l.node(I).copy(T));const w=l.indexAfter(-1){if(z>-1)return!1;I.isTextblock&&I.content.size===0&&(z=O+1)}),z>-1&&e.setSelection(oe.near(e.doc.resolve(z))),e.scrollIntoView()}return!0}const d=a.pos===l.end()?c.contentMatchAt(0).defaultType:null,p=Ea(f,c.type.name,c.attrs),g=Ea(f,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const v=d?[{type:o,attrs:p},{type:d,attrs:g}]:[{type:o,attrs:p}];if(!Ms(e.doc,l.pos,2))return!1;if(n){const{selection:T,storedMarks:x}=t,{splittableMarks:w}=i.extensionManager,S=x||T.$to.parentOffset&&T.$from.marks();if(e.split(l.pos,2,v).scrollIntoView(),!S||!n)return!0;const E=S.filter(A=>w.includes(A.type.name));e.ensureMarks(E)}return!0},rc=(r,e)=>{const t=Eh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ni(r.doc,t.pos)&&r.join(t.pos),!0},nc=(r,e)=>{const t=Eh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ni(r.doc,n)&&r.join(n),!0},Uk=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,p=Ke(r,o.schema),g=Ke(e,o.schema),{selection:v,storedMarks:T}=o,{$from:x,$to:w}=v,S=x.blockRange(w),E=T||v.$to.parentOffset&&v.$from.marks();if(!S)return!1;const A=Eh(z=>vm(z.type.name,f))(v);if(S.depth>=1&&A&&S.depth-A.depth<=1){if(A.node.type===p)return u.liftListItem(g);if(vm(A.node.type.name,f)&&p.validContent(A.node.content)&&l)return a().command(()=>(s.setNodeMarkup(A.pos,p),!0)).command(()=>rc(s,p)).command(()=>nc(s,p)).run()}return!t||!E||!l?a().command(()=>c().wrapInList(p,n)?!0:u.clearNodes()).wrapInList(p,n).command(()=>rc(s,p)).command(()=>nc(s,p)).run():a().command(()=>{const z=c().wrapInList(p,n),I=E.filter(O=>d.includes(O.type.name));return s.ensureMarks(I),z?!0:u.clearNodes()}).wrapInList(p,n).command(()=>rc(s,p)).command(()=>nc(s,p)).run()},Wk=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=oi(r,n.schema);return Jf(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},jk=(r,e,t={})=>({state:n,commands:i})=>{const s=Ke(r,n.schema),o=Ke(e,n.schema);return ul(n,s,t)?i.setNode(o):i.setNode(s,t)},Yk=(r,e={})=>({state:t,commands:n})=>{const i=Ke(r,t.schema);return ul(t,i,e)?n.lift(i):n.wrapIn(i,e)},Jk=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},Kk=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},Gk=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=oi(r,n.schema),{$from:u,empty:c,ranges:f}=l;if(!i)return!0;if(c&&o){let{from:d,to:p}=l;const g=(s=u.marks().find(T=>T.type===a))===null||s===void 0?void 0:s.attrs,v=Th(u,a,g);v&&(d=v.from,p=v.to),t.removeMark(d,p,a)}else f.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,a)});return t.removeStoredMark(a),!0},Xk=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=Q0(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Ke(r,n.schema)),l==="mark"&&(o=oi(r,n.schema)),i&&t.selection.ranges.forEach(a=>{const u=a.$from.pos,c=a.$to.pos;n.doc.nodesBetween(u,c,(f,d)=>{s&&s===f.type&&t.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(p=>{if(o===p.type){const g=Math.max(d,u),v=Math.min(d+f.nodeSize,c);t.addMark(g,v,o.create({...p.attrs,...e}))}})})}),!0):!1},Qk=(r,e={})=>({state:t,dispatch:n})=>{const i=Ke(r,t.schema);return kx(i,e)(t,n)},Zk=(r,e={})=>({state:t,dispatch:n})=>{const i=Ke(r,t.schema);return wx(i,e)(t,n)};var ew=Object.freeze({__proto__:null,blur:qx,clearContent:_x,clearNodes:Ux,command:Wx,createParagraphNear:jx,deleteCurrentNode:Yx,deleteNode:Jx,deleteRange:Kx,deleteSelection:Gx,enter:Xx,exitCode:Qx,extendMarkRange:ek,first:tk,focus:rk,forEach:nk,insertContent:ik,insertContentAt:lk,joinUp:ak,joinDown:uk,joinBackward:ck,joinForward:fk,keyboardShortcut:hk,lift:pk,liftEmptyBlock:mk,liftListItem:gk,newlineInCode:yk,resetAttributes:vk,scrollIntoView:xk,selectAll:kk,selectNodeBackward:wk,selectNodeForward:Sk,selectParentNode:bk,selectTextblockEnd:Mk,selectTextblockStart:Tk,setContent:Ck,setMark:Bk,setMeta:Lk,setNode:Fk,setNodeSelection:$k,setTextSelection:Vk,sinkListItem:Hk,splitBlock:qk,splitListItem:_k,toggleList:Uk,toggleMark:Wk,toggleNode:jk,toggleWrap:Yk,undoInputRule:Jk,unsetAllMarks:Kk,unsetMark:Gk,updateAttributes:Xk,wrapIn:Qk,wrapInList:Zk});const tw=jr.create({name:"commands",addCommands(){return{...ew}}}),rw=jr.create({name:"editable",addProseMirrorPlugins(){return[new dr({key:new ii("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nw=jr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new dr({key:new ii("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),iw=jr.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:u}=l,{empty:c,$anchor:f}=a,{pos:d,parent:p}=f,g=ie.atStart(u).from===d;return!c||!g||!p.type.isTextblock||p.textContent.length?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ch()||f5()?s:i},addProseMirrorPlugins(){return[new dr({key:new ii("clearDocument"),appendTransaction:(r,e,t)=>{if(!(r.some(g=>g.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,l=ie.atStart(e.doc).from,a=ie.atEnd(e.doc).to;if(i||!(s===l&&o===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const f=t.tr,d=Y0({state:t,transaction:f}),{commands:p}=new J0({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),sw=jr.create({name:"tabindex",addProseMirrorPlugins(){return[new dr({key:new ii("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ow=Object.freeze({__proto__:null,ClipboardTextSerializer:Hx,Commands:tw,Editable:rw,FocusEvents:nw,Keymap:iw,Tabindex:sw});const lw=`.ProseMirror { +`,textSerializers:o={}}=t||{};let l="",a=!0;return r.nodesBetween(n,i,(u,c,f,d)=>{var p;const g=o==null?void 0:o[u.type.name];g?(u.isBlock&&!a&&(l+=s,a=!0),f&&(l+=g({node:u,pos:c,parent:f,index:d,range:e}))):u.isText?(l+=(p=u==null?void 0:u.text)===null||p===void 0?void 0:p.slice(Math.max(n,c)-c,i-c),a=!1):u.isBlock&&!a&&(l+=s,a=!0)}),l}function a5(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const Hx=Yr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new dr({key:new ii("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=a5(t);return l5(n,{from:o,to:l},{textSerializers:a})}}})]}}),qx=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),_x=(r=!1)=>({commands:e})=>e.setContent("",r),Ux=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(a)),d=u.resolve(c.map(a+l.nodeSize)),p=f.blockRange(d);if(!p)return;const g=Js(p);if(l.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,v)}(g||g===0)&&e.lift(p,g)})}),!0},Wx=r=>e=>r(e),jx=()=>({state:r,dispatch:e})=>px(r,e),Yx=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1},Jx=r=>({tr:e,state:t,dispatch:n})=>{const i=Ge(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),u=s.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1},Kx=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},Gx=()=>({state:r,dispatch:e})=>rx(r,e),Xx=()=>({commands:r})=>r.keyboardShortcut("Enter"),Qx=()=>({state:r,dispatch:e})=>hx(r,e);function h0(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:Mh(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function Yf(r,e,t={}){return r.find(n=>n.type===e&&h0(n.attrs,t))}function Zx(r,e,t={}){return!!Yf(r,e,t)}function Th(r,e,t={}){if(!r||!e)return;let n=r.parent.childAfter(r.parentOffset);if(r.parentOffset===n.offset&&n.offset!==0&&(n=r.parent.childBefore(r.parentOffset)),!n.node)return;const i=Yf([...n.node.marks],e,t);if(!i)return;let s=n.index,o=r.start()+n.offset,l=s+1,a=o+n.node.nodeSize;for(Yf([...n.node.marks],e,t);s>0&&i.isInSet(r.parent.child(s-1).marks);)s-=1,o-=r.parent.child(s).nodeSize;for(;l({tr:t,state:n,dispatch:i})=>{const s=oi(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:u,to:c}=l;if(i){const f=Th(a,s,e);if(f&&f.from<=u&&f.to>=c){const d=oe.create(o,f.from,f.to);t.setSelection(d)}}return!0},tk=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Ch()&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!u5(t.state.selection))return o(),!0;const l=c5(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},nk=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),ik=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e);function gm(r){const e=`${r}`;return new window.DOMParser().parseFromString(e,"text/html").body}function p0(r,e,t){if(t={slice:!0,parseOptions:{},...t},typeof r=="object"&&r!==null)try{return Array.isArray(r)&&r.length>0?F.fromArray(r.map(n=>e.nodeFromJSON(n))):e.nodeFromJSON(r)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",n),p0("",e,t)}if(typeof r=="string"){const n=ah.fromSchema(e);return t.slice?n.parseSlice(gm(r),t.parseOptions).content:n.parse(gm(r),t.parseOptions)}return p0("",e,t)}function sk(r,e,t){const n=r.steps.length-1;if(n{o===0&&(o=c)}),r.setSelection(ie.near(r.doc.resolve(o),t))}const ok=r=>r.toString().startsWith("<"),lk=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const o=p0(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:l,to:a}=typeof r=="number"?{from:r,to:r}:r,u=!0,c=!0;if((ok(o)?o:[o]).forEach(d=>{d.check(),u=u?d.isText&&d.marks.length===0:!1,c=c?d.isBlock:!1}),l===a&&c){const{parent:d}=n.doc.resolve(l);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(l-=1,a+=1)}u?Array.isArray(e)?n.insertText(e.map(d=>d.text||"").join(""),l,a):typeof e=="object"&&e&&e.text?n.insertText(e.text,l,a):n.insertText(e,l,a):n.replaceWith(l,a,o),t.updateSelection&&sk(n,n.steps.length-1,-1)}return!0},ak=()=>({state:r,dispatch:e})=>ux(r,e),uk=()=>({state:r,dispatch:e})=>cx(r,e),ck=()=>({state:r,dispatch:e})=>ix(r,e),fk=()=>({state:r,dispatch:e})=>lx(r,e);function f5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function dk(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l({editor:e,view:t,tr:n,dispatch:i})=>{const s=dk(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,l))});return a==null||a.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function ul(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?Ge(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(f,d)=>{if(f.isText)return;const p=Math.max(n,d),g=Math.min(i,d+f.nodeSize);l.push({node:f,from:p,to:g})});const a=i-n,u=l.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>h0(f.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=a}const pk=(r,e={})=>({state:t,dispatch:n})=>{const i=Ge(r,t.schema);return ul(t,i,e)?fx(t,n):!1},mk=()=>({state:r,dispatch:e})=>mx(r,e),gk=r=>({state:e,dispatch:t})=>{const n=Ge(r,e.schema);return bx(n)(e,t)},yk=()=>({state:r,dispatch:e})=>dx(r,e);function Q0(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function ym(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const vk=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=Q0(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Ge(r,n.schema)),l==="mark"&&(o=oi(r,n.schema)),i&&t.selection.ranges.forEach(a=>{n.doc.nodesBetween(a.$from.pos,a.$to.pos,(u,c)=>{s&&s===u.type&&t.setNodeMarkup(c,void 0,ym(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&t.addMark(c,c+u.nodeSize,o.create(ym(f.attrs,e)))})})}),!0):!1},xk=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),kk=()=>({tr:r,commands:e})=>e.setTextSelection({from:0,to:r.doc.content.size}),wk=()=>({state:r,dispatch:e})=>sx(r,e),Sk=()=>({state:r,dispatch:e})=>ax(r,e),bk=()=>({state:r,dispatch:e})=>gx(r,e),Mk=()=>({state:r,dispatch:e})=>xx(r,e),Tk=()=>({state:r,dispatch:e})=>vx(r,e);function d5(r,e,t={}){return p0(r,e,{slice:!1,parseOptions:t})}const Ck=(r,e=!1,t={})=>({tr:n,editor:i,dispatch:s})=>{const{doc:o}=n,l=d5(r,i.schema,t);return s&&n.replaceWith(0,o.content.size,l).setMeta("preventUpdate",!e),!0};function Ek(r){for(let e=0;e0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Eh(r){return e=>Nk(e.$from,r)}function Ak(r,e){const t=$r.fromSchema(e).serializeFragment(r),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Ok(r,e){const t={from:0,to:r.content.size};return l5(r,t,e)}function Z0(r,e){const t=oi(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function zk(r,e){const t=Ge(e,r.schema),{from:n,to:i}=r.selection,s=[];r.doc.nodesBetween(n,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function Ik(r,e){const t=Q0(typeof e=="string"?e:e.name,r.schema);return t==="node"?zk(r,e):t==="mark"?Z0(r,e):{}}function h5(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const s=t.resolve(r-1),o=Th(s,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,s)=>{n.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),n}function Ea(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function Jf(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?oi(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>h0(f.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,g=d.pos;r.doc.nodesBetween(p,g,(v,T)=>{if(!v.isText&&!v.marks.length)return;const x=Math.max(p,T),w=Math.min(g,T+v.nodeSize),S=w-x;o+=S,l.push(...v.marks.map(E=>({mark:E,from:x,to:w})))})}),o===0)return!1;const a=l.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>h0(f.mark.attrs,t,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=l.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,d)=>f+d.to-d.from,0);return(a>0?a+u:a)>=o}function Dk(r,e,t={}){if(!e)return ul(r,null,t)||Jf(r,null,t);const n=Q0(e,r.schema);return n==="node"?ul(r,e,t):n==="mark"?Jf(r,e,t):!1}function vm(r,e){const{nodeExtensions:t}=K0(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=ne(_(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Rk(r){var e;const t=(e=r.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),n=r.toJSON();return JSON.stringify(t)===JSON.stringify(n)}function Pk(r,e,t){var n;const{selection:i}=e;let s=null;if(u5(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!==null&&n!==void 0?n:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let u=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const p=!d||d.type.allowsMarkType(t),g=!!t.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(t));u=p&&g}return!u}),u})}const Bk=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=oi(r,n.schema);if(i)if(o){const u=Z0(n,a);t.addStoredMark(a.create({...u,...e}))}else l.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;n.doc.nodesBetween(c,f,(d,p)=>{const g=Math.max(p,c),v=Math.min(p+d.nodeSize,f);d.marks.find(x=>x.type===a)?d.marks.forEach(x=>{a===x.type&&t.addMark(g,v,a.create({...x.attrs,...e}))}):t.addMark(g,v,a.create(e))})});return Pk(n,t,a)},Lk=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),Fk=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=Ge(r,t.schema);return s.isTextblock?i().command(({commands:o})=>dm(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>dm(s,e)(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},$k=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=wi(r,0,n.content.size),s=te.create(n,i);e.setSelection(s)}return!0},Vk=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=oe.atStart(n).from,l=oe.atEnd(n).to,a=wi(i,o,l),u=wi(s,o,l),c=oe.create(n,a,u);e.setSelection(c)}return!0},Hk=r=>({state:e,dispatch:t})=>{const n=Ge(r,e.schema);return Cx(n)(e,t)};function xm(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const qk=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,u=i.extensionManager.attributes,c=Ea(u,l.node().type.name,l.node().attrs);if(s instanceof te&&s.node.isBlock)return!l.parentOffset||!Ms(o,l.pos)?!1:(n&&(r&&xm(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(n){const f=a.parentOffset===a.parent.content.size;s instanceof oe&&e.deleteSelection();const d=l.depth===0?void 0:Ek(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&d?[{type:d,attrs:c}]:void 0,g=Ms(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!g&&Ms(e.doc,e.mapping.map(l.pos),1,d?[{type:d}]:void 0)&&(g=!0,p=d?[{type:d,attrs:c}]:void 0),g&&(e.split(e.mapping.map(l.pos),1,p),d&&!f&&!l.parentOffset&&l.parent.type!==d)){const v=e.mapping.map(l.before()),T=e.doc.resolve(v);l.node(-1).canReplaceWith(T.index(),T.index()+1,d)&&e.setNodeMarkup(e.mapping.map(l.before()),d)}r&&xm(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},_k=r=>({tr:e,state:t,dispatch:n,editor:i})=>{var s;const o=Ge(r,t.schema),{$from:l,$to:a}=t.selection,u=t.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(a))return!1;const c=l.node(-1);if(c.type!==o)return!1;const f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){let T=F.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let I=l.depth-x;I>=l.depth-3;I-=1)T=F.from(l.node(I).copy(T));const w=l.indexAfter(-1){if(z>-1)return!1;I.isTextblock&&I.content.size===0&&(z=O+1)}),z>-1&&e.setSelection(oe.near(e.doc.resolve(z))),e.scrollIntoView()}return!0}const d=a.pos===l.end()?c.contentMatchAt(0).defaultType:null,p=Ea(f,c.type.name,c.attrs),g=Ea(f,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const v=d?[{type:o,attrs:p},{type:d,attrs:g}]:[{type:o,attrs:p}];if(!Ms(e.doc,l.pos,2))return!1;if(n){const{selection:T,storedMarks:x}=t,{splittableMarks:w}=i.extensionManager,S=x||T.$to.parentOffset&&T.$from.marks();if(e.split(l.pos,2,v).scrollIntoView(),!S||!n)return!0;const E=S.filter(A=>w.includes(A.type.name));e.ensureMarks(E)}return!0},rc=(r,e)=>{const t=Eh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ni(r.doc,t.pos)&&r.join(t.pos),!0},nc=(r,e)=>{const t=Eh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&ni(r.doc,n)&&r.join(n),!0},Uk=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,p=Ge(r,o.schema),g=Ge(e,o.schema),{selection:v,storedMarks:T}=o,{$from:x,$to:w}=v,S=x.blockRange(w),E=T||v.$to.parentOffset&&v.$from.marks();if(!S)return!1;const A=Eh(z=>vm(z.type.name,f))(v);if(S.depth>=1&&A&&S.depth-A.depth<=1){if(A.node.type===p)return u.liftListItem(g);if(vm(A.node.type.name,f)&&p.validContent(A.node.content)&&l)return a().command(()=>(s.setNodeMarkup(A.pos,p),!0)).command(()=>rc(s,p)).command(()=>nc(s,p)).run()}return!t||!E||!l?a().command(()=>c().wrapInList(p,n)?!0:u.clearNodes()).wrapInList(p,n).command(()=>rc(s,p)).command(()=>nc(s,p)).run():a().command(()=>{const z=c().wrapInList(p,n),I=E.filter(O=>d.includes(O.type.name));return s.ensureMarks(I),z?!0:u.clearNodes()}).wrapInList(p,n).command(()=>rc(s,p)).command(()=>nc(s,p)).run()},Wk=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=oi(r,n.schema);return Jf(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},jk=(r,e,t={})=>({state:n,commands:i})=>{const s=Ge(r,n.schema),o=Ge(e,n.schema);return ul(n,s,t)?i.setNode(o):i.setNode(s,t)},Yk=(r,e={})=>({state:t,commands:n})=>{const i=Ge(r,t.schema);return ul(t,i,e)?n.lift(i):n.wrapIn(i,e)},Jk=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},Kk=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},Gk=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=oi(r,n.schema),{$from:u,empty:c,ranges:f}=l;if(!i)return!0;if(c&&o){let{from:d,to:p}=l;const g=(s=u.marks().find(T=>T.type===a))===null||s===void 0?void 0:s.attrs,v=Th(u,a,g);v&&(d=v.from,p=v.to),t.removeMark(d,p,a)}else f.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,a)});return t.removeStoredMark(a),!0},Xk=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=Q0(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=Ge(r,n.schema)),l==="mark"&&(o=oi(r,n.schema)),i&&t.selection.ranges.forEach(a=>{const u=a.$from.pos,c=a.$to.pos;n.doc.nodesBetween(u,c,(f,d)=>{s&&s===f.type&&t.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(p=>{if(o===p.type){const g=Math.max(d,u),v=Math.min(d+f.nodeSize,c);t.addMark(g,v,o.create({...p.attrs,...e}))}})})}),!0):!1},Qk=(r,e={})=>({state:t,dispatch:n})=>{const i=Ge(r,t.schema);return kx(i,e)(t,n)},Zk=(r,e={})=>({state:t,dispatch:n})=>{const i=Ge(r,t.schema);return wx(i,e)(t,n)};var ew=Object.freeze({__proto__:null,blur:qx,clearContent:_x,clearNodes:Ux,command:Wx,createParagraphNear:jx,deleteCurrentNode:Yx,deleteNode:Jx,deleteRange:Kx,deleteSelection:Gx,enter:Xx,exitCode:Qx,extendMarkRange:ek,first:tk,focus:rk,forEach:nk,insertContent:ik,insertContentAt:lk,joinUp:ak,joinDown:uk,joinBackward:ck,joinForward:fk,keyboardShortcut:hk,lift:pk,liftEmptyBlock:mk,liftListItem:gk,newlineInCode:yk,resetAttributes:vk,scrollIntoView:xk,selectAll:kk,selectNodeBackward:wk,selectNodeForward:Sk,selectParentNode:bk,selectTextblockEnd:Mk,selectTextblockStart:Tk,setContent:Ck,setMark:Bk,setMeta:Lk,setNode:Fk,setNodeSelection:$k,setTextSelection:Vk,sinkListItem:Hk,splitBlock:qk,splitListItem:_k,toggleList:Uk,toggleMark:Wk,toggleNode:jk,toggleWrap:Yk,undoInputRule:Jk,unsetAllMarks:Kk,unsetMark:Gk,updateAttributes:Xk,wrapIn:Qk,wrapInList:Zk});const tw=Yr.create({name:"commands",addCommands(){return{...ew}}}),rw=Yr.create({name:"editable",addProseMirrorPlugins(){return[new dr({key:new ii("editable"),props:{editable:()=>this.editor.options.editable}})]}}),nw=Yr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new dr({key:new ii("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),iw=Yr.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:u}=l,{empty:c,$anchor:f}=a,{pos:d,parent:p}=f,g=ie.atStart(u).from===d;return!c||!g||!p.type.isTextblock||p.textContent.length?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ch()||f5()?s:i},addProseMirrorPlugins(){return[new dr({key:new ii("clearDocument"),appendTransaction:(r,e,t)=>{if(!(r.some(g=>g.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,l=ie.atStart(e.doc).from,a=ie.atEnd(e.doc).to;if(i||!(s===l&&o===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const f=t.tr,d=Y0({state:t,transaction:f}),{commands:p}=new J0({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}}),sw=Yr.create({name:"tabindex",addProseMirrorPlugins(){return[new dr({key:new ii("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var ow=Object.freeze({__proto__:null,ClipboardTextSerializer:Hx,Commands:tw,Editable:rw,FocusEvents:nw,Keymap:iw,Tabindex:sw});const lw=`.ProseMirror { position: relative; } @@ -124,16 +124,16 @@ img.ProseMirror-separator { opacity: 0 }`;function aw(r,e){const t=document.querySelector("style[data-tiptap-style]");if(t!==null)return t;const n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.setAttribute("data-tiptap-style",""),n.innerHTML=r,document.getElementsByTagName("head")[0].appendChild(n),n}let uw=class extends Ex{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=aw(lw,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=o5(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:n});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(n)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(ow):[],...this.options.extensions].filter(n=>["extension","node","mark"].includes(n==null?void 0:n.type));this.extensionManager=new gs(t,this)}createCommandManager(){this.commandManager=new J0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=d5(this.options.content,this.schema,this.options.parseOptions),t=c5(e,this.options.autofocus);this.view=new W9(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ms.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(o)});return}const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),s=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),s&&this.emit("blur",{editor:this,event:s.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Ik(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return Dk(this.state,n,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Ak(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=` -`,textSerializers:n={}}=e||{};return Ok(this.state.doc,{blockSeparator:t,textSerializers:{...a5(this.schema),...n}})}get isEmpty(){return Rk(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Hs(r){return new G0({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ne(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];let a=t.to;if(o){const u=l.search(/\S/),c=t.from+l.indexOf(o),f=c+o.length;if(h5(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(v=>v===r.type&&v!==p.mark.type)).filter(p=>p.to>c).length)return null;ft.from&&s.delete(t.from+u,c),a=t.from+u+o.length,s.addMark(t.from+u,a,r.type.create(i||{})),s.removeStoredMark(r.type)}}})}function cw(r){return new G0({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ne(r.getAttributes,void 0,n)||{},{tr:s}=e,o=t.from;let l=t.to;if(n[1]){const a=n[0].lastIndexOf(n[1]);let u=o+a;u>l?u=l:l=u+n[1].length;const c=n[0][n[0].length-1];s.insertText(c,o+n[0].length-1),s.replaceWith(u,l,r.type.create(i))}else n[0]&&s.replaceWith(o,l,r.type.create(i))}})}function Kf(r){return new G0({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),s=ne(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,s)}})}function cl(r){return new G0({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const s=ne(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),u=a&&hh(a,r.type,s);if(!u)return null;if(o.wrap(a,u),r.keepMarks&&r.editor){const{selection:f,storedMarks:d}=e,{splittableMarks:p}=r.editor.extensionManager,g=d||f.$to.parentOffset&&f.$from.marks();if(g){const v=g.filter(T=>p.includes(T.type.name));o.ensureMarks(v)}}if(r.keepAttributes){const f=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===r.type&&ni(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,c))&&o.join(t.from-1)}})}let Ui=class Gf{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ne(_(this,"addOptions",{name:this.name}))),this.storage=ne(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Gf(e)}configure(e={}){const t=this.extend();return t.options=X0(this.options,e),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Gf(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ne(_(t,"addOptions",{name:t.name})),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===t.name))return!1;const a=o.find(u=>(u==null?void 0:u.type.name)===t.name);return a&&n.removeStoredMark(a),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}},jt=class Xf{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ne(_(this,"addOptions",{name:this.name}))),this.storage=ne(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Xf(e)}configure(e={}){const t=this.extend();return t.options=X0(this.options,e),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Xf(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ne(_(t,"addOptions",{name:t.name})),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}};function qs(r){return new Px({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ne(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];let a=t.to;if(o){const u=l.search(/\S/),c=t.from+l.indexOf(o),f=c+o.length;if(h5(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(v=>v===r.type&&v!==p.mark.type)).filter(p=>p.to>c).length)return null;ft.from&&s.delete(t.from+u,c),a=t.from+u+o.length,s.addMark(t.from+u,a,r.type.create(i||{})),s.removeStoredMark(r.type)}}})}class fw extends uw{constructor(){super(...arguments),this.contentComponent=null}}const dw=({renderers:r})=>Gt.createElement(Gt.Fragment,null,Object.entries(r).map(([e,t])=>Sv.createPortal(t.reactElement,t.element,e)));class hw extends Gt.Component{constructor(e){super(e),this.editorContentRef=Gt.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?lh.flushSync(e):e()}setRenderer(e,t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>({renderers:{...n,[e]:t}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:t})=>{const n={...t};return delete n[e],{renderers:n}})})}componentWillUnmount(){const{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...t}=this.props;return Gt.createElement(Gt.Fragment,null,Gt.createElement("div",{ref:this.editorContentRef,...t}),Gt.createElement(dw,{renderers:this.state.renderers}))}}const pw=Gt.memo(hw),mw=Ze.createContext({onDragStart:void 0}),gw=()=>Ze.useContext(mw);Gt.forwardRef((r,e)=>{const{onDragStart:t}=gw(),n=r.as||"div";return Gt.createElement(n,{...r,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...r.style}})});function yw(){const[,r]=Ze.useState(0);return()=>r(e=>e+1)}const vw=(r={},e=[])=>{const[t,n]=Ze.useState(null),i=yw(),{onBeforeCreate:s,onBlur:o,onCreate:l,onDestroy:a,onFocus:u,onSelectionUpdate:c,onTransaction:f,onUpdate:d}=r,p=Ze.useRef(s),g=Ze.useRef(o),v=Ze.useRef(l),T=Ze.useRef(a),x=Ze.useRef(u),w=Ze.useRef(c),S=Ze.useRef(f),E=Ze.useRef(d);return Ze.useEffect(()=>{t&&(s&&(t.off("beforeCreate",p.current),t.on("beforeCreate",s),p.current=s),o&&(t.off("blur",g.current),t.on("blur",o),g.current=o),l&&(t.off("create",v.current),t.on("create",l),v.current=l),a&&(t.off("destroy",T.current),t.on("destroy",a),T.current=a),u&&(t.off("focus",x.current),t.on("focus",u),x.current=u),c&&(t.off("selectionUpdate",w.current),t.on("selectionUpdate",c),w.current=c),f&&(t.off("transaction",S.current),t.on("transaction",f),S.current=f),d&&(t.off("update",E.current),t.on("update",d),E.current=d))},[s,o,l,a,u,c,f,d,t]),Ze.useEffect(()=>{let A=!0;const z=new fw(r);return n(z),z.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{A&&i()})})}),()=>{z.destroy(),A=!1}},e),t},xw=/^\s*>\s$/,kw=jt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:r}){return["blockquote",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setBlockquote:()=>({commands:r})=>r.wrapIn(this.name),toggleBlockquote:()=>({commands:r})=>r.toggleWrap(this.name),unsetBlockquote:()=>({commands:r})=>r.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[cl({find:xw,type:this.type})]}}),ww=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Sw=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,bw=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Mw=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Tw=Ui.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>r.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return["strong",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Hs({find:ww,type:this.type}),Hs({find:bw,type:this.type})]},addPasteRules(){return[qs({find:Sw,type:this.type}),qs({find:Mw,type:this.type})]}}),Cw=jt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Ue(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),km=Ui.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["span",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:r,commands:e})=>{const t=Z0(r,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),wm=/^\s*([-+*])\s$/,Ew=jt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Cw.name,this.editor.getAttributes(km.name)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=cl({find:wm,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=cl({find:wm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(km.name),editor:this.editor})),[r]}}),Nw=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Aw=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Ow=Ui.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:r}){return["code",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setCode:()=>({commands:r})=>r.setMark(this.name),toggleCode:()=>({commands:r})=>r.toggleMark(this.name),unsetCode:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Hs({find:Nw,type:this.type})]},addPasteRules(){return[qs({find:Aw,type:this.type})]}}),zw=/^```([a-z]+)?[\s\n]$/,Iw=/^~~~([a-z]+)?[\s\n]$/,Dw=jt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:r=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=r.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",Ue(this.options.HTMLAttributes,e),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:r})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=r,{selection:t}=e,{$from:n,empty:i}=t;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(` +`,textSerializers:n={}}=e||{};return Ok(this.state.doc,{blockSeparator:t,textSerializers:{...a5(this.schema),...n}})}get isEmpty(){return Rk(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Hs(r){return new G0({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ne(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];let a=t.to;if(o){const u=l.search(/\S/),c=t.from+l.indexOf(o),f=c+o.length;if(h5(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(v=>v===r.type&&v!==p.mark.type)).filter(p=>p.to>c).length)return null;ft.from&&s.delete(t.from+u,c),a=t.from+u+o.length,s.addMark(t.from+u,a,r.type.create(i||{})),s.removeStoredMark(r.type)}}})}function cw(r){return new G0({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ne(r.getAttributes,void 0,n)||{},{tr:s}=e,o=t.from;let l=t.to;if(n[1]){const a=n[0].lastIndexOf(n[1]);let u=o+a;u>l?u=l:l=u+n[1].length;const c=n[0][n[0].length-1];s.insertText(c,o+n[0].length-1),s.replaceWith(u,l,r.type.create(i))}else n[0]&&s.replaceWith(o,l,r.type.create(i))}})}function Kf(r){return new G0({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),s=ne(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,s)}})}function cl(r){return new G0({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const s=ne(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),u=a&&hh(a,r.type,s);if(!u)return null;if(o.wrap(a,u),r.keepMarks&&r.editor){const{selection:f,storedMarks:d}=e,{splittableMarks:p}=r.editor.extensionManager,g=d||f.$to.parentOffset&&f.$from.marks();if(g){const v=g.filter(T=>p.includes(T.type.name));o.ensureMarks(v)}}if(r.keepAttributes){const f=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,s).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===r.type&&ni(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,c))&&o.join(t.from-1)}})}let Ui=class Gf{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ne(_(this,"addOptions",{name:this.name}))),this.storage=ne(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Gf(e)}configure(e={}){const t=this.extend();return t.options=X0(this.options,e),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Gf(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ne(_(t,"addOptions",{name:t.name})),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===t.name))return!1;const a=o.find(u=>(u==null?void 0:u.type.name)===t.name);return a&&n.removeStoredMark(a),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}},jt=class Xf{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ne(_(this,"addOptions",{name:this.name}))),this.storage=ne(_(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Xf(e)}configure(e={}){const t=this.extend();return t.options=X0(this.options,e),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Xf(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ne(_(t,"addOptions",{name:t.name})),t.storage=ne(_(t,"addStorage",{name:t.name,options:t.options})),t}};function qs(r){return new Px({find:r.find,handler:({state:e,range:t,match:n})=>{const i=ne(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:s}=e,o=n[n.length-1],l=n[0];let a=t.to;if(o){const u=l.search(/\S/),c=t.from+l.indexOf(o),f=c+o.length;if(h5(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(v=>v===r.type&&v!==p.mark.type)).filter(p=>p.to>c).length)return null;ft.from&&s.delete(t.from+u,c),a=t.from+u+o.length,s.addMark(t.from+u,a,r.type.create(i||{})),s.removeStoredMark(r.type)}}})}class fw extends uw{constructor(){super(...arguments),this.contentComponent=null}}const dw=({renderers:r})=>Gt.createElement(Gt.Fragment,null,Object.entries(r).map(([e,t])=>Sv.createPortal(t.reactElement,t.element,e)));class hw extends Gt.Component{constructor(e){super(e),this.editorContentRef=Gt.createRef(),this.initialized=!1,this.state={renderers:{}}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?lh.flushSync(e):e()}setRenderer(e,t){this.maybeFlushSync(()=>{this.setState(({renderers:n})=>({renderers:{...n,[e]:t}}))})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(({renderers:t})=>{const n={...t};return delete n[e],{renderers:n}})})}componentWillUnmount(){const{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){const{editor:e,...t}=this.props;return Gt.createElement(Gt.Fragment,null,Gt.createElement("div",{ref:this.editorContentRef,...t}),Gt.createElement(dw,{renderers:this.state.renderers}))}}const pw=Gt.memo(hw),mw=je.createContext({onDragStart:void 0}),gw=()=>je.useContext(mw);Gt.forwardRef((r,e)=>{const{onDragStart:t}=gw(),n=r.as||"div";return Gt.createElement(n,{...r,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...r.style}})});function yw(){const[,r]=je.useState(0);return()=>r(e=>e+1)}const vw=(r={},e=[])=>{const[t,n]=je.useState(null),i=yw(),{onBeforeCreate:s,onBlur:o,onCreate:l,onDestroy:a,onFocus:u,onSelectionUpdate:c,onTransaction:f,onUpdate:d}=r,p=je.useRef(s),g=je.useRef(o),v=je.useRef(l),T=je.useRef(a),x=je.useRef(u),w=je.useRef(c),S=je.useRef(f),E=je.useRef(d);return je.useEffect(()=>{t&&(s&&(t.off("beforeCreate",p.current),t.on("beforeCreate",s),p.current=s),o&&(t.off("blur",g.current),t.on("blur",o),g.current=o),l&&(t.off("create",v.current),t.on("create",l),v.current=l),a&&(t.off("destroy",T.current),t.on("destroy",a),T.current=a),u&&(t.off("focus",x.current),t.on("focus",u),x.current=u),c&&(t.off("selectionUpdate",w.current),t.on("selectionUpdate",c),w.current=c),f&&(t.off("transaction",S.current),t.on("transaction",f),S.current=f),d&&(t.off("update",E.current),t.on("update",d),E.current=d))},[s,o,l,a,u,c,f,d,t]),je.useEffect(()=>{let A=!0;const z=new fw(r);return n(z),z.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{A&&i()})})}),()=>{z.destroy(),A=!1}},e),t},xw=/^\s*>\s$/,kw=jt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:r}){return["blockquote",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setBlockquote:()=>({commands:r})=>r.wrapIn(this.name),toggleBlockquote:()=>({commands:r})=>r.toggleWrap(this.name),unsetBlockquote:()=>({commands:r})=>r.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[cl({find:xw,type:this.type})]}}),ww=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Sw=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,bw=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Mw=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Tw=Ui.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>r.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return["strong",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Hs({find:ww,type:this.type}),Hs({find:bw,type:this.type})]},addPasteRules(){return[qs({find:Sw,type:this.type}),qs({find:Mw,type:this.type})]}}),Cw=jt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Ue(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),km=Ui.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["span",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:r,commands:e})=>{const t=Z0(r,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),wm=/^\s*([-+*])\s$/,Ew=jt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Cw.name,this.editor.getAttributes(km.name)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=cl({find:wm,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=cl({find:wm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(km.name),editor:this.editor})),[r]}}),Nw=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,Aw=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,Ow=Ui.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:r}){return["code",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setCode:()=>({commands:r})=>r.setMark(this.name),toggleCode:()=>({commands:r})=>r.toggleMark(this.name),unsetCode:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Hs({find:Nw,type:this.type})]},addPasteRules(){return[qs({find:Aw,type:this.type})]}}),zw=/^```([a-z]+)?[\s\n]$/,Iw=/^~~~([a-z]+)?[\s\n]$/,Dw=jt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:r=>{var e;const{languageClassPrefix:t}=this.options,s=[...((e=r.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",Ue(this.options.HTMLAttributes,e),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:r})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=r,{selection:t}=e,{$from:n,empty:i}=t;if(!i||n.parent.type!==this.type)return!1;const s=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(` `);return!s||!o?!1:r.chain().command(({tr:l})=>(l.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:r})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=r,{selection:t,doc:n}=e,{$from:i,empty:s}=t;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||n.nodeAt(l)?!1:r.commands.exitCode()}}},addInputRules(){return[Kf({find:zw,type:this.type,getAttributes:r=>({language:r[1]})}),Kf({find:Iw,type:this.type,getAttributes:r=>({language:r[1]})})]},addProseMirrorPlugins(){return[new dr({key:new ii("codeBlockVSCodeHandler"),props:{handlePaste:(r,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,s=i==null?void 0:i.mode;if(!t||!s)return!1;const{tr:o}=r.state;return o.replaceSelectionWith(this.type.create({language:s})),o.setSelection(oe.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.insertText(t.replace(/\r\n?/g,` -`)),o.setMeta("paste",!0),r.dispatch(o),!0}}})]}}),Rw=jt.create({name:"doc",topNode:!0,content:"block+"});function Pw(r={}){return new dr({view(e){return new Bw(e,r)}})}class Bw{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n;if(t){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let u=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(u){let c=u.getBoundingClientRect(),f=l?c.bottom:c.top;l&&a&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:c.left,right:c.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!n){let l=this.editorView.coordsAtPos(this.cursorPos);n={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let l=i.getBoundingClientRect();s=l.left-i.scrollLeft,o=l.top-i.scrollTop}this.element.style.left=n.left-s+"px",this.element.style.top=n.top-o+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=c3(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Lw=jr.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Pw(this.options)]}});class De extends ie{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return De.valid(n)?new De(n):ie.near(n)}content(){return U.empty}eq(e){return e instanceof De&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new De(e.resolve(t.pos))}getBookmark(){return new Nh(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Fw(e)||!$w(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&De.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){s=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let a=e.doc.resolve(i);if(De.valid(a))return a}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!te.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(De.valid(l))return l}return null}}}De.prototype.visible=!1;De.findFrom=De.findGapCursorFrom;ie.jsonID("gapcursor",De);class Nh{constructor(e){this.pos=e}map(e){return new Nh(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return De.valid(t)?new De(t):ie.near(t)}}function Fw(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function $w(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Vw(){return new dr({props:{decorations:Uw,createSelectionBetween(r,e,t){return e.pos==t.pos&&De.valid(t)?new De(t):null},handleClick:qw,handleKeyDown:Hw,handleDOMEvents:{beforeinput:_w}}})}const Hw=Z3({ArrowLeft:Ql("horiz",-1),ArrowRight:Ql("horiz",1),ArrowUp:Ql("vert",-1),ArrowDown:Ql("vert",1)});function Ql(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof oe){if(!s.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=n.doc.resolve(e>0?l.after():l.before())}let u=De.findGapCursorFrom(l,e,a);return u?(i&&i(n.tr.setSelection(new De(u))),!0):!1}}function qw(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!De.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&te.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new De(n))),!0)}function _w(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof De))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=F.empty;for(let o=n.length-1;o>=0;o--)i=F.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new U(i,0,0));return s.setSelection(oe.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function Uw(r){if(!(r.selection instanceof De))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",He.create(r.doc,[ir.widget(r.selection.head,e,{key:"gapcursor"})])}const Ww=jr.create({name:"gapCursor",addProseMirrorPlugins(){return[Vw()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=ne(_(r,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),jw=jt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",Ue(this.options.HTMLAttributes,r)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&a&&o){const f=a.filter(d=>l.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Yw=jt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:e}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,Ue(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.setNode(this.name,r):!1,toggleHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.toggleNode(this.name,"paragraph",r):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((r,e)=>({...r,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(r=>Kf({find:new RegExp(`^(#{1,${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}});var m0=200,Je=function(){};Je.prototype.append=function(e){return e.length?(e=Je.from(e),!this.length&&e||e.length=t?Je.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Je.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Je.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};Je.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i};Je.from=function(e){return e instanceof Je?e:e&&e.length?new p5(e):Je.empty};var p5=function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,l){for(var a=s;a=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=m0)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=m0)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Je);Je.empty=new p5([]);var Jw=function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return nl&&this.right.forEachInner(n,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(n,i-l,Math.max(s,l)-l,o+l)===!1||s=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Je);const Kw=500;class wr{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,l,a,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(n,d+1),s=i.maps.length),s--,c.push(f);return}if(i){c.push(new Rr(f.map));let p=f.step.map(i.slice(s)),g;p&&o.maybeStep(p).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],u.push(new Rr(g,void 0,void 0,u.length+c.length))),s--,g&&i.appendMap(g,s)}else o.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(s)):f.selection,a=new wr(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,n,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;cXw&&(l=Gw(l,u),o-=u),new wr(l.append(s),o)}remapping(e,t){let n=new bs;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new wr(this.items.append(e.map(t=>new Rr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(d=>{d.selection&&l--},i);let a=t;this.items.forEach(d=>{let p=s.getMirror(--a);if(p==null)return;o=Math.min(o,p);let g=s.maps[p];if(d.step){let v=e.steps[p].invert(e.docs[p]),T=d.selection&&d.selection.map(s.slice(a+1,p));T&&l++,n.push(new Rr(g,v,T))}else n.push(new Rr(g))},i);let u=[];for(let d=t;dKw&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(n)),u=a&&a.getMap();if(n--,u&&t.appendMap(u,n),a){let c=o.selection&&o.selection.map(t.slice(n));c&&s++;let f=new Rr(u.invert(),a,c),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else o.map&&n--},this.items.length,0),new wr(Je.from(i.reverse()),s)}}wr.empty=new wr(Je.empty,0);function Gw(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class Rr{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Rr(t.getMap().invert(),t,this.selection)}}}class En{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const Xw=20;function Qw(r,e,t,n){let i=t.getMeta(jn),s;if(i)return i.historyState;t.getMeta(eS)&&(r=new En(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(jn))return o.getMeta(jn).redo?new En(r.done.addTransform(t,void 0,n,Na(e)),r.undone,Sm(t.mapping.maps[t.steps.length-1]),r.prevTime,r.prevComposition):new En(r.done,r.undone.addTransform(t,void 0,n,Na(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=r.prevTime==0||!o&&r.prevComposition!=l&&(r.prevTime<(t.time||0)-n.newGroupDelay||!Zw(t,r.prevRanges)),u=o?ic(r.prevRanges,t.mapping):Sm(t.mapping.maps[t.steps.length-1]);return new En(r.done.addTransform(t,a?e.selection.getBookmark():void 0,n,Na(e)),wr.empty,u,t.time,l??r.prevComposition)}else return(s=t.getMeta("rebased"))?new En(r.done.rebased(t,s),r.undone.rebased(t,s),ic(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new En(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),ic(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function Zw(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s=e[s]&&(t=!0)}),t}function Sm(r){let e=[];return r.forEach((t,n,i,s)=>e.push(i,s)),e}function ic(r,e){if(!r)return null;let t=[];for(let n=0;n{let t=jn.getState(r);return!t||t.done.eventCount==0?!1:(e&&m5(t,r,e,!1),!0)},y5=(r,e)=>{let t=jn.getState(r);return!t||t.undone.eventCount==0?!1:(e&&m5(t,r,e,!0),!0)},rS=jr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>g5(r,e),redo:()=>({state:r,dispatch:e})=>y5(r,e)}},addProseMirrorPlugins(){return[tS(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),nS=jt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:r}){return["hr",Ue(this.options.HTMLAttributes,r)]},addCommands(){return{setHorizontalRule:()=>({chain:r})=>r().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{$to:i}=e.selection,s=i.end();if(i.nodeAfter)e.setSelection(oe.create(e.doc,i.pos));else{const o=(n=i.parent.type.contentMatch.defaultType)===null||n===void 0?void 0:n.create();o&&(e.insert(s,o),e.setSelection(oe.create(e.doc,s)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[cw({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),iS=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,sS=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,oS=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,lS=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,aS=Ui.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>r.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Hs({find:iS,type:this.type}),Hs({find:oS,type:this.type})]},addPasteRules(){return[qs({find:sS,type:this.type}),qs({find:lS,type:this.type})]}}),uS=jt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Ue(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),cS=jt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Ue(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Mm=Ui.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["span",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:r,commands:e})=>{const t=Z0(r,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Tm=/^(\d+)\.\s$/,fS=jt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",Ue(this.options.HTMLAttributes,t),0]:["ol",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cS.name,this.editor.getAttributes(Mm.name)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=cl({find:Tm,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=cl({find:Tm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Mm.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),dS=jt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),hS=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,pS=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,mS=Ui.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>r.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["s",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Hs({find:hS,type:this.type})]},addPasteRules(){return[qs({find:pS,type:this.type})]}}),gS=jt.create({name:"text",group:"inline"}),yS=jr.create({name:"starterKit",addExtensions(){var r,e,t,n,i,s,o,l,a,u,c,f,d,p,g,v,T,x;const w=[];return this.options.blockquote!==!1&&w.push(kw.configure((r=this.options)===null||r===void 0?void 0:r.blockquote)),this.options.bold!==!1&&w.push(Tw.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&w.push(Ew.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&w.push(Ow.configure((n=this.options)===null||n===void 0?void 0:n.code)),this.options.codeBlock!==!1&&w.push(Dw.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&w.push(Rw.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&w.push(Lw.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&w.push(Ww.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&w.push(jw.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&w.push(Yw.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&w.push(rS.configure((c=this.options)===null||c===void 0?void 0:c.history)),this.options.horizontalRule!==!1&&w.push(nS.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&w.push(aS.configure((d=this.options)===null||d===void 0?void 0:d.italic)),this.options.listItem!==!1&&w.push(uS.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&w.push(fS.configure((g=this.options)===null||g===void 0?void 0:g.orderedList)),this.options.paragraph!==!1&&w.push(dS.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&w.push(mS.configure((T=this.options)===null||T===void 0?void 0:T.strike)),this.options.text!==!1&&w.push(gS.configure((x=this.options)===null||x===void 0?void 0:x.text)),w}});function v5(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=v5(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function x5(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let u=0,c=Math.min(o.text.length,l.text.length);for(;ue&&n(a,i+l,s||null,o)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),n,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{l.isText?(s+=l.text.slice(Math.max(e,a)-a,t-a),o=!n):l.isLeaf?(i?s+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(s+=l.type.spec.leafText(l)),o=!n):!o&&l.isBlock&&(s+=n,o=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new j(n,i)}cutByIndex(e,t){return e==t?j.empty:e==0&&t==this.content.length?this:new j(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new j(i,s)}addToStart(e){return new j([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new j(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=this.child(n),o=i+s.nodeSize;if(o>=e)return o==e||t>0?Zl(n+1,o):Zl(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return j.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new j(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return j.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;tn.type.rank-i.type.rank),t}}Ft.none=[];class vS extends Error{}class ee{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=w5(this.content,e+this.openStart,t);return n&&new ee(n,this.openStart,this.openEnd)}removeBetween(e,t){return new ee(k5(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ee.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ee(j.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new ee(e,n,i)}}ee.empty=new ee(j.empty,0,0);function k5(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(k5(s.content,e-i-1,t-i-1)))}function w5(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=w5(o.content,e-s-1,t);return l&&r.replaceChild(i,o.copy(l))}class Zf{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}class g0{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=e.nodes[n.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let n=new Em(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Em(this,t,!0);return n.addAll(e,t.from,t.to),ee.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o{n(o=Nm(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=Nm(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new g0(e,g0.schemaRules(e)))}}const S5={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},b5={ol:!0,ul:!0},y0=1,v0=2,Fo=4;function Cm(r,e,t){return e!=null?(e?y0:0)|(e==="full"?v0:0):r&&r.whitespace=="pre"?y0|v0:t&~Fo}class ea{constructor(e,t,n,i,s,o,l){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=Ft.none,this.stashMarks=[],this.match=o||(l&Fo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(j.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&y0)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=j.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t{let s=o=>{this[i](o)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n;if(t){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let u=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(u){let c=u.getBoundingClientRect(),f=l?c.bottom:c.top;l&&a&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),n={left:c.left,right:c.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!n){let l=this.editorView.coordsAtPos(this.cursorPos);n={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let s,o;if(!i||i==document.body&&getComputedStyle(i).position=="static")s=-pageXOffset,o=-pageYOffset;else{let l=i.getBoundingClientRect();s=l.left-i.scrollLeft,o=l.top-i.scrollTop}this.element.style.left=n.left-s+"px",this.element.style.top=n.top-o+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!s){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=c3(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Lw=Yr.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Pw(this.options)]}});class De extends ie{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return De.valid(n)?new De(n):ie.near(n)}content(){return U.empty}eq(e){return e instanceof De&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new De(e.resolve(t.pos))}getBookmark(){return new Nh(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Fw(e)||!$w(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&De.valid(e))return e;let i=e.pos,s=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){s=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let a=e.doc.resolve(i);if(De.valid(a))return a}for(;;){let o=t>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!te.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*t),n=!1;continue e}break}s=o,i+=t;let l=e.doc.resolve(i);if(De.valid(l))return l}return null}}}De.prototype.visible=!1;De.findFrom=De.findGapCursorFrom;ie.jsonID("gapcursor",De);class Nh{constructor(e){this.pos=e}map(e){return new Nh(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return De.valid(t)?new De(t):ie.near(t)}}function Fw(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function $w(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Vw(){return new dr({props:{decorations:Uw,createSelectionBetween(r,e,t){return e.pos==t.pos&&De.valid(t)?new De(t):null},handleClick:qw,handleKeyDown:Hw,handleDOMEvents:{beforeinput:_w}}})}const Hw=Z3({ArrowLeft:Ql("horiz",-1),ArrowRight:Ql("horiz",1),ArrowUp:Ql("vert",-1),ArrowDown:Ql("vert",1)});function Ql(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,s){let o=n.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof oe){if(!s.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=n.doc.resolve(e>0?l.after():l.before())}let u=De.findGapCursorFrom(l,e,a);return u?(i&&i(n.tr.setSelection(new De(u))),!0):!1}}function qw(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!De.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&te.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new De(n))),!0)}function _w(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof De))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=F.empty;for(let o=n.length-1;o>=0;o--)i=F.from(n[o].createAndFill(null,i));let s=r.state.tr.replace(t.pos,t.pos,new U(i,0,0));return s.setSelection(oe.near(s.doc.resolve(t.pos+1))),r.dispatch(s),!1}function Uw(r){if(!(r.selection instanceof De))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",He.create(r.doc,[ir.widget(r.selection.head,e,{key:"gapcursor"})])}const Ww=Yr.create({name:"gapCursor",addProseMirrorPlugins(){return[Vw()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=ne(_(r,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),jw=jt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",Ue(this.options.HTMLAttributes,r)]},renderText(){return` +`},addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:s}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,a=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&a&&o){const f=a.filter(d=>l.includes(d.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Yw=jt.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:e}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,Ue(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.setNode(this.name,r):!1,toggleHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.toggleNode(this.name,"paragraph",r):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((r,e)=>({...r,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(r=>Kf({find:new RegExp(`^(#{1,${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}});var m0=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ke.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};Ke.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},t,n),i};Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new p5(e):Ke.empty};var p5=function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,l){for(var a=s;a=o;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=m0)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=m0)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ke);Ke.empty=new p5([]);var Jw=function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return nl&&this.right.forEachInner(n,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(n,i-l,Math.max(s,l)-l,o+l)===!1||s=s?this.right.slice(n-s,i-s):this.left.slice(n,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Ke);const Kw=500;class Sr{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,s;t&&(i=this.remapping(n,this.items.length),s=i.maps.length);let o=e.tr,l,a,u=[],c=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(n,d+1),s=i.maps.length),s--,c.push(f);return}if(i){c.push(new Pr(f.map));let p=f.step.map(i.slice(s)),g;p&&o.maybeStep(p).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],u.push(new Pr(g,void 0,void 0,u.length+c.length))),s--,g&&i.appendMap(g,s)}else o.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(s)):f.selection,a=new Sr(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,n,i){let s=[],o=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let c=0;cXw&&(l=Gw(l,u),o-=u),new Sr(l.append(s),o)}remapping(e,t){let n=new bs;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new Sr(this.items.append(e.map(t=>new Pr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),s=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(d=>{d.selection&&l--},i);let a=t;this.items.forEach(d=>{let p=s.getMirror(--a);if(p==null)return;o=Math.min(o,p);let g=s.maps[p];if(d.step){let v=e.steps[p].invert(e.docs[p]),T=d.selection&&d.selection.map(s.slice(a+1,p));T&&l++,n.push(new Pr(g,v,T))}else n.push(new Pr(g))},i);let u=[];for(let d=t;dKw&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=e)i.push(o),o.selection&&s++;else if(o.step){let a=o.step.map(t.slice(n)),u=a&&a.getMap();if(n--,u&&t.appendMap(u,n),a){let c=o.selection&&o.selection.map(t.slice(n));c&&s++;let f=new Pr(u.invert(),a,c),d,p=i.length-1;(d=i.length&&i[p].merge(f))?i[p]=d:i.push(f)}}else o.map&&n--},this.items.length,0),new Sr(Ke.from(i.reverse()),s)}}Sr.empty=new Sr(Ke.empty,0);function Gw(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class Pr{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Pr(t.getMap().invert(),t,this.selection)}}}class En{constructor(e,t,n,i,s){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=s}}const Xw=20;function Qw(r,e,t,n){let i=t.getMeta(jn),s;if(i)return i.historyState;t.getMeta(eS)&&(r=new En(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(jn))return o.getMeta(jn).redo?new En(r.done.addTransform(t,void 0,n,Na(e)),r.undone,Sm(t.mapping.maps[t.steps.length-1]),r.prevTime,r.prevComposition):new En(r.done,r.undone.addTransform(t,void 0,n,Na(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=r.prevTime==0||!o&&r.prevComposition!=l&&(r.prevTime<(t.time||0)-n.newGroupDelay||!Zw(t,r.prevRanges)),u=o?ic(r.prevRanges,t.mapping):Sm(t.mapping.maps[t.steps.length-1]);return new En(r.done.addTransform(t,a?e.selection.getBookmark():void 0,n,Na(e)),Sr.empty,u,t.time,l??r.prevComposition)}else return(s=t.getMeta("rebased"))?new En(r.done.rebased(t,s),r.undone.rebased(t,s),ic(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new En(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),ic(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function Zw(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let s=0;s=e[s]&&(t=!0)}),t}function Sm(r){let e=[];return r.forEach((t,n,i,s)=>e.push(i,s)),e}function ic(r,e){if(!r)return null;let t=[];for(let n=0;n{let t=jn.getState(r);return!t||t.done.eventCount==0?!1:(e&&m5(t,r,e,!1),!0)},y5=(r,e)=>{let t=jn.getState(r);return!t||t.undone.eventCount==0?!1:(e&&m5(t,r,e,!0),!0)},rS=Yr.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>g5(r,e),redo:()=>({state:r,dispatch:e})=>y5(r,e)}},addProseMirrorPlugins(){return[tS(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),nS=jt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:r}){return["hr",Ue(this.options.HTMLAttributes,r)]},addCommands(){return{setHorizontalRule:()=>({chain:r})=>r().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{var n;if(t){const{$to:i}=e.selection,s=i.end();if(i.nodeAfter)e.setSelection(oe.create(e.doc,i.pos));else{const o=(n=i.parent.type.contentMatch.defaultType)===null||n===void 0?void 0:n.create();o&&(e.insert(s,o),e.setSelection(oe.create(e.doc,s)))}e.scrollIntoView()}return!0}).run()}},addInputRules(){return[cw({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),iS=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,sS=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,oS=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,lS=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,aS=Ui.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>r.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Hs({find:iS,type:this.type}),Hs({find:oS,type:this.type})]},addPasteRules(){return[qs({find:sS,type:this.type}),qs({find:lS,type:this.type})]}}),uS=jt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Ue(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),cS=jt.create({name:"listItem",addOptions(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Ue(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Mm=Ui.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["span",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:r,commands:e})=>{const t=Z0(r,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Tm=/^(\d+)\.\s$/,fS=jt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",Ue(this.options.HTMLAttributes,t),0]:["ol",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cS.name,this.editor.getAttributes(Mm.name)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=cl({find:Tm,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=cl({find:Tm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Mm.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),dS=jt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),hS=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,pS=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,mS=Ui.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>r.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["s",Ue(this.options.HTMLAttributes,r),0]},addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Hs({find:hS,type:this.type})]},addPasteRules(){return[qs({find:pS,type:this.type})]}}),gS=jt.create({name:"text",group:"inline"}),yS=Yr.create({name:"starterKit",addExtensions(){var r,e,t,n,i,s,o,l,a,u,c,f,d,p,g,v,T,x;const w=[];return this.options.blockquote!==!1&&w.push(kw.configure((r=this.options)===null||r===void 0?void 0:r.blockquote)),this.options.bold!==!1&&w.push(Tw.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&w.push(Ew.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&w.push(Ow.configure((n=this.options)===null||n===void 0?void 0:n.code)),this.options.codeBlock!==!1&&w.push(Dw.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&w.push(Rw.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&w.push(Lw.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&w.push(Ww.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&w.push(jw.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&w.push(Yw.configure((u=this.options)===null||u===void 0?void 0:u.heading)),this.options.history!==!1&&w.push(rS.configure((c=this.options)===null||c===void 0?void 0:c.history)),this.options.horizontalRule!==!1&&w.push(nS.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&w.push(aS.configure((d=this.options)===null||d===void 0?void 0:d.italic)),this.options.listItem!==!1&&w.push(uS.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&w.push(fS.configure((g=this.options)===null||g===void 0?void 0:g.orderedList)),this.options.paragraph!==!1&&w.push(dS.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&w.push(mS.configure((T=this.options)===null||T===void 0?void 0:T.strike)),this.options.text!==!1&&w.push(gS.configure((x=this.options)===null||x===void 0?void 0:x.text)),w}});function v5(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),s=e.child(n);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)t++;return t}if(i.content.size||s.content.size){let o=v5(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function x5(r,e,t,n){for(let i=r.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:n};let o=r.child(--i),l=e.child(--s),a=o.nodeSize;if(o==l){t-=a,n-=a;continue}if(!o.sameMarkup(l))return{a:t,b:n};if(o.isText&&o.text!=l.text){let u=0,c=Math.min(o.text.length,l.text.length);for(;ue&&n(a,i+l,s||null,o)!==!1&&a.content.size){let c=l+1;a.nodesBetween(Math.max(0,e-c),Math.min(a.content.size,t-c),n,i+c)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let s="",o=!0;return this.nodesBetween(e,t,(l,a)=>{l.isText?(s+=l.text.slice(Math.max(e,a)-a,t-a),o=!n):l.isLeaf?(i?s+=typeof i=="function"?i(l):i:l.type.spec.leafText&&(s+=l.type.spec.leafText(l)),o=!n):!o&&l.isBlock&&(s+=n,o=!0)},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),s=1);se)for(let s=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),i+=l.nodeSize),o=a}return new j(n,i)}cutByIndex(e,t){return e==t?j.empty:e==0&&t==this.content.length?this:new j(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new j(i,s)}addToStart(e){return new j([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new j(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let s=this.child(n),o=i+s.nodeSize;if(o>=e)return o==e||t>0?Zl(n+1,o):Zl(n,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return j.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new j(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return j.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(s)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;tn.type.rank-i.type.rank),t}}Ft.none=[];class vS extends Error{}class ee{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=w5(this.content,e+this.openStart,t);return n&&new ee(n,this.openStart,this.openEnd)}removeBetween(e,t){return new ee(k5(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ee.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ee(j.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)n++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new ee(e,n,i)}}ee.empty=new ee(j.empty,0,0);function k5(r,e,t){let{index:n,offset:i}=r.findIndex(e),s=r.maybeChild(n),{index:o,offset:l}=r.findIndex(t);if(i==e||s.isText){if(l!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,s.copy(k5(s.content,e-i-1,t-i-1)))}function w5(r,e,t,n){let{index:i,offset:s}=r.findIndex(e),o=r.maybeChild(i);if(s==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let l=w5(o.content,e-s-1,t);return l&&r.replaceChild(i,o.copy(l))}class Zf{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}class g0{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(n=>{n.tag?this.tags.push(n):n.style&&this.styles.push(n)}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let i=e.nodes[n.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let n=new Em(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Em(this,t,!0);return n.addAll(e,t.from,t.to),ee.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let s=i.priority==null?50:i.priority,o=0;for(;o{n(o=Nm(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{n(o=Nm(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new g0(e,g0.schemaRules(e)))}}const S5={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},xS={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},b5={ol:!0,ul:!0},y0=1,v0=2,Fo=4;function Cm(r,e,t){return e!=null?(e?y0:0)|(e==="full"?v0:0):r&&r.whitespace=="pre"?y0|v0:t&~Fo}class ea{constructor(e,t,n,i,s,o,l){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=i,this.solid=s,this.options=l,this.content=[],this.activeMarks=Ft.none,this.stashMarks=[],this.match=o||(l&Fo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(j.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&y0)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let s=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=j.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(j.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t{o.clearMark(l)&&(n=l.addToSet(n))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),o.consuming===!1)s=o;else break}return[t,n]}addElementByRule(e,t,n){let i,s,o;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):i=this.enter(s,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,o&&this.removePendingMark(o,l)}addAll(e,t,n){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=n==null?null:e.childNodes[n];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(n);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let u=t[l];if(u==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let t=MS(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function kS(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&b5.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function wS(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function SS(r){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,n=[];for(;t=e.exec(r);)n.push(t[1],t[2].trim());return n}function Nm(r){let e={};for(let t in r)e[t]=r[t];return e}function bS(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a0}get deletedBefore(){return(this.delInfo&(C5|Aa))>0}get deletedAfter(){return(this.delInfo&(E5|Aa))>0}get deletedAcross(){return(this.delInfo&Aa)>0}}class tr{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&tr.empty)return tr.empty}recover(e){let t=0,n=Am(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[l+s],c=this.ranges[l+o],f=a+u;if(e<=f){let d=u?e==a?-1:e==f?1:t:t,p=a+i+(d<0?0:c);if(n)return p;let g=e==(t<0?a:f)?null:TS(l/3,e-a),v=e==a?E5:e==f?C5:Aa;return(t<0?e!=a:e!=f)&&(v|=N5),new Om(p,v,g)}i+=c-u}return n?e+i:new Om(e+i,0,null)}touches(e,t){let n=0,i=Am(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let u=this.ranges[l+s],c=a+u;if(e<=c&&l==i*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return _e.fromReplace(e,this.from,this.to,s)}invert(){return new bi(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Si(t.pos,n.pos,this.mark)}merge(e){return e instanceof Si&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Si(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Si(t.from,t.to,e.markFromJSON(t.mark))}}It.jsonID("addMark",Si);class bi extends It{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new ee(Ah(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return _e.fromReplace(e,this.from,this.to,n)}invert(){return new Si(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new bi(t.pos,n.pos,this.mark)}merge(e){return e instanceof bi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new bi(t.from,t.to,e.markFromJSON(t.mark))}}It.jsonID("removeMark",bi);class Mi extends It{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _e.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return _e.fromReplace(e,this.pos,this.pos+1,new ee(j.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;in.pos?null:new At(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new At(t.from,t.to,t.gapFrom,t.gapTo,ee.fromJSON(e,t.slice),t.insert,!!t.structure)}}It.jsonID("replaceAround",At);function ed(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function ES(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Ks(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),s=r.$from.index(n),o=r.$to.indexAfter(n);if(ns;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),g=n&&n[c+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let v=n&&n[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function Wi(r,e){let t=r.resolve(e),n=t.index();return O5(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function O5(r,e){return!!(r&&e&&!r.isLeaf&&r.canAppend(e))}function z5(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&O5(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function I5(r,e,t=e,n=ee.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return OS(i,s,n)?new Zt(e,t,n):new zS(i,s,n).fit()}function OS(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class zS{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=j.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=j.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new ee(s,o,l);return e>-1?new At(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Zt(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=ac(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,f=null;if(t==1&&(o?u.matchType(o.type)||(f=u.fillBefore(j.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:f};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ac(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ee(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ac(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new ee(So(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new ee(So(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v1||a==0||v.content.size)&&(f=T,c.push(D5(v.mark(d.allowedMarks(v.marks)),u==1?a:0,u==l.childCount?p:-1)))}let g=u==l.childCount;g||(p=-1),this.placed=bo(this.placed,t,j.from(c)),this.frontier[t].match=f,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,T=l;v1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t=0;l--){let{match:a,type:u}=this.frontier[l],c=uc(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=bo(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=bo(this.placed,this.depth,j.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(j.empty,!0);t.childCount&&(this.placed=bo(this.placed,this.frontier.length,t))}}function So(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(So(r.firstChild.content,e-1,t)))}function bo(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(bo(r.lastChild.content,e-1,t)))}function ac(r,e){for(let t=0;t1&&(n=n.replaceChild(0,D5(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(j.empty,!0)))),r.copy(n)}function uc(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!IS(t,s.content,o)?l:null}function IS(r,e,t){for(let n=t;n=0;s--){let o=t<0?ts(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):ts(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new qr(e.node(0))}static atStart(e){return ts(e,e,0,0,1)||new qr(e)}static atEnd(e){return ts(e,e,e.content.size,e.childCount,-1)||new qr(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=cc[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in cc)throw new RangeError("Duplicate use of selection JSON ID "+e);return cc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Pe.between(this.$anchor,this.$head).getBookmark()}}me.prototype.visible=!0;class DS{constructor(e,t){this.$from=e,this.$to=t}}let Im=!1;function Dm(r){!Im&&!r.parent.inlineContent&&(Im=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class Pe extends me{constructor(e,t=e){Dm(e),Dm(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return me.near(n);let i=e.resolve(t.map(this.anchor));return new Pe(i.parent.inlineContent?i:n,n)}replace(e,t=ee.empty){if(super.replace(e,t),t==ee.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new eu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Pe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=me.findFrom(t,n,!0)||me.findFrom(t,-n,!0);if(s)t=s.$head;else return me.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(me.findFrom(e,-n,!0)||me.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&Se.isSelectable(l))return Se.create(r,t-(i<0?l.nodeSize:0))}else{let a=ts(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function Rm(r,e,t){let n=r.steps.length-1;if(n{o==null&&(o=c)}),r.setSelection(me.near(r.doc.resolve(o),t))}function Pm(r,e){return!e||!r?r:r.bind(e)}class ta{constructor(e,t,n){this.name=e,this.init=Pm(t.init,n),this.apply=Pm(t.apply,n)}}new ta("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new ta("selection",{init(r,e){return r.selection||me.atStart(e.doc)},apply(r){return r.selection}}),new ta("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new ta("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}});function R5(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=R5(i,e,{})),t[n]=i}return t}class Sl{constructor(e){this.spec=e,this.props={},e.props&&R5(e.props,this,this.props),this.key=e.key?e.key.key:P5("plugin")}getState(e){return e[this.key]}}const fc=Object.create(null);function P5(r){return r in fc?r+"$"+ ++fc[r]:(fc[r]=0,r+"$")}class bl{constructor(e="key"){this.key=P5(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const PS=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function BS(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const LS=(r,e,t)=>{let n=BS(r,t);if(!n)return!1;let i=B5(n);if(!i){let o=n.blockRange(),l=o&&Ks(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&$5(r,i,e))return!0;if(n.parent.content.size==0&&(_s(s,"end")||Se.isSelectable(s))){let o=I5(r.doc,n.before(),n.after(),ee.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=B5(n)}let o=s&&s.nodeBefore;return!o||!Se.isSelectable(o)?!1:(e&&e(r.tr.setSelection(Se.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function B5(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function $S(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset{let n=$S(r,t);if(!n)return!1;let i=L5(n);if(!i)return!1;let s=i.nodeAfter;if($5(r,i,e))return!0;if(n.parent.content.size==0&&(_s(s,"start")||Se.isSelectable(s))){let o=I5(r.doc,n.before(),n.after(),ee.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset=0;e--){let t=r.node(e);if(r.index(e)+1{let t=r.selection,n=t instanceof Se,i;if(n){if(t.node.isTextblock||!Wi(r.doc,t.from))return!1;i=t.from}else if(i=z5(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(Se.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},_S=(r,e)=>{let t=r.selection,n;if(t instanceof Se){if(t.node.isTextblock||!Wi(r.doc,t.to))return!1;n=t.to}else if(n=z5(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},US=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Ks(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},WS=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(` -`).scrollIntoView()),!0)};function F5(r){for(let e=0;e{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=F5(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(me.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},YS=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof qr||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=F5(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index(){let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Cs(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Ks(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)},KS=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(Se.create(r.doc,i))),!0)};function GS(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Wi(r.doc,e.pos))?!1:(t&&t(r.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function $5(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s,o;if(n.type.spec.isolating||i.type.spec.isolating)return!1;if(GS(r,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(s=(o=n.contentMatchAt(n.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,d=j.empty;for(let v=s.length-1;v>=0;v--)d=j.from(s[v].create(null,d));d=j.from(n.copy(d));let p=r.tr.step(new At(e.pos-1,f,e.pos,f,new ee(d,1,0),s.length,!0)),g=f+2*s.length;Wi(p.doc,g)&&p.join(g),t(p.scrollIntoView())}return!0}let a=me.findFrom(e,1),u=a&&a.$from.blockRange(a.$to),c=u&&Ks(u);if(c!=null&&c>=e.depth)return t&&t(r.tr.lift(u,c).scrollIntoView()),!0;if(l&&_s(i,"start",!0)&&_s(n,"end")){let f=n,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(t){let v=j.empty;for(let x=d.length-1;x>=0;x--)v=j.from(d[x].copy(v));let T=r.tr.step(new At(e.pos-d.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new ee(v,d.length,0),0,!0));t(T.scrollIntoView())}return!0}}return!1}function V5(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(Pe.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const XS=V5(-1),QS=V5(1);function ZS(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&A5(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Bm(r,e=null){return function(t,n){let i=!1;for(let s=0;s{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o=2&&i.node(o.depth-1).type.compatibleContent(r)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let c=t.doc.resolve(o.start-2);a=new Zf(c,c,o.depth),o.endIndex=0;c--)s=j.from(t[c].type.create(t[c].attrs,s));r.step(new At(e.start-(n?2:0),e.end,e.start,e.end,new ee(s,0,0),t.length,!0));let o=0;for(let c=0;co.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?nb(e,t,r,s):ib(e,t,s):!0:!1}}function nb(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);sv;g--)p-=i.child(g).nodeSize,n.delete(p-1,p+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(l?0:1),c+1,o.content.append(a?j.empty:j.from(i))))return!1;let f=s.pos,d=f+o.nodeSize;return n.step(new At(f-(l?1:0),d+(a?1:0),f+1,d-1,new ee((l?j.empty:j.from(i.copy(j.empty))).append(a?j.empty:j.from(i.copy(j.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function sb(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let u=a.lastChild&&a.lastChild.type==l.type,c=j.from(u?r.create():null),f=new ee(j.from(r.create(null,j.from(l.type.create(null,c)))),u?3:1,0),d=s.start,p=s.end;t(e.tr.step(new At(d-(u?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function H5(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}class ob{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:s}=n,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>{const f=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,u=e||s.tr,c=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(n).map(([d,p])=>[d,(...v)=>{const T=this.buildProps(u,t),x=p(...v)(T);return l.push(x),f}])),run:c};return f}createCan(e){const{rawCommands:t,state:n}=this,i=!1,s=e||n.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i;s.storedMarks&&e.setStoredMarks(s.storedMarks);const l={tr:e,editor:i,view:o,state:H5({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)(l)]))}};return l}}function Vt(r,e,t){return r.config[e]===void 0&&r.parent?Vt(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?Vt(r.parent,e,t):null}):r.config[e]}function lb(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function ut(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function ab(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}i==="class"?n[i]=[n[i],s].join(" "):i==="style"?n[i]=[n[i],s].join("; "):n[i]=s}),n},{})}function ub(r){return typeof r=="function"}function Sr(r,e=void 0,...t){return ub(r)?e?r.bind(e)(...t):r(...t):r}function cb(r){return Object.prototype.toString.call(r)==="[object RegExp]"}class Lm{constructor(e){this.find=e.find,this.handler=e.handler}}class dc{constructor(e){this.find=e.find,this.handler=e.handler}}function fb(r){return Object.prototype.toString.call(r).slice(8,-1)}function hc(r){return fb(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function zh(r,e){const t={...r};return hc(r)&&hc(e)&&Object.keys(e).forEach(n=>{hc(e[n])?n in r?t[n]=zh(r[n],e[n]):Object.assign(t,{[n]:e[n]}):Object.assign(t,{[n]:e[n]})}),t}class Wr{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sr(Vt(this,"addOptions",{name:this.name}))),this.storage=Sr(Vt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Wr(e)}configure(e={}){const t=this.extend();return t.options=zh(this.options,e),t.storage=Sr(Vt(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Wr(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Sr(Vt(t,"addOptions",{name:t.name})),t.storage=Sr(Vt(t,"addStorage",{name:t.name,options:t.options})),t}}function db(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Ft.none,n=Ft.none;for(let i=0;i{o.clearMark(l)&&(n=l.addToSet(n))}):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),o.consuming===!1)s=o;else break}return[t,n]}addElementByRule(e,t,n){let i,s,o;t.node?(s=this.parser.schema.nodes[t.node],s.isLeaf?this.insertNode(s.create(t.attrs))||this.leafFallback(e):i=this.enter(s,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,o&&this.removePendingMark(o,l)}addAll(e,t,n){let i=t||0;for(let s=t?e.childNodes[t]:e.firstChild,o=n==null?null:e.childNodes[n];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let t,n;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=s,!o.length)||s.solid)break}if(!t)return!1;this.sync(n);for(let i=0;ithis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),s=-(n?n.depth+1:0)+(i?0:1),o=(l,a)=>{for(;l>=0;l--){let u=t[l];if(u==""){if(l==t.length-1||l==0)continue;for(;a>=s;a--)if(o(l-1,a))return!0;return!1}else{let c=a>0||a==0&&i?this.nodes[a].type:n&&a>=s?n.node(a-s).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}addPendingMark(e){let t=MS(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function kS(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&b5.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function wS(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function SS(r){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,n=[];for(;t=e.exec(r);)n.push(t[1],t[2].trim());return n}function Nm(r){let e={};for(let t in r)e[t]=r[t];return e}function bS(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let s=[],o=l=>{s.push(l);for(let a=0;a0}get deletedBefore(){return(this.delInfo&(C5|Aa))>0}get deletedAfter(){return(this.delInfo&(E5|Aa))>0}get deletedAcross(){return(this.delInfo&Aa)>0}}class tr{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&tr.empty)return tr.empty}recover(e){let t=0,n=Am(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[l+s],c=this.ranges[l+o],f=a+u;if(e<=f){let d=u?e==a?-1:e==f?1:t:t,p=a+i+(d<0?0:c);if(n)return p;let g=e==(t<0?a:f)?null:TS(l/3,e-a),v=e==a?E5:e==f?C5:Aa;return(t<0?e!=a:e!=f)&&(v|=N5),new Om(p,v,g)}i+=c-u}return n?e+i:new Om(e+i,0,null)}touches(e,t){let n=0,i=Am(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let u=this.ranges[l+s],c=a+u;if(e<=c&&l==i*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,s=0;i!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return _e.fromReplace(e,this.from,this.to,s)}invert(){return new bi(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Si(t.pos,n.pos,this.mark)}merge(e){return e instanceof Si&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Si(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Si(t.from,t.to,e.markFromJSON(t.mark))}}It.jsonID("addMark",Si);class bi extends It{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new ee(Ah(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return _e.fromReplace(e,this.from,this.to,n)}invert(){return new Si(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new bi(t.pos,n.pos,this.mark)}merge(e){return e instanceof bi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new bi(t.from,t.to,e.markFromJSON(t.mark))}}It.jsonID("removeMark",bi);class Mi extends It{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _e.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return _e.fromReplace(e,this.pos,this.pos+1,new ee(j.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;in.pos?null:new At(t.pos,n.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new At(t.from,t.to,t.gapFrom,t.gapTo,ee.fromJSON(e,t.slice),t.insert,!!t.structure)}}It.jsonID("replaceAround",At);function ed(r,e,t){let n=r.resolve(e),i=t-e,s=n.depth;for(;i>0&&s>0&&n.indexAfter(s)==n.node(s).childCount;)s--,i--;if(i>0){let o=n.node(s).maybeChild(n.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function ES(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Ks(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),s=r.$from.index(n),o=r.$to.indexAfter(n);if(ns;u--,c--){let f=i.node(u),d=i.index(u);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(d,f.childCount),g=n&&n[c+1];g&&(p=p.replaceChild(0,g.type.create(g.attrs)));let v=n&&n[c]||f;if(!f.canReplace(d+1,f.childCount)||!v.type.validContent(p))return!1}let l=i.indexAfter(s),a=n&&n[0];return i.node(s).canReplaceWith(l,l,a?a.type:i.node(s+1).type)}function Wi(r,e){let t=r.resolve(e),n=t.index();return O5(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function O5(r,e){return!!(r&&e&&!r.isLeaf&&r.canAppend(e))}function z5(r,e,t=-1){let n=r.resolve(e);for(let i=n.depth;;i--){let s,o,l=n.index(i);if(i==n.depth?(s=n.nodeBefore,o=n.nodeAfter):t>0?(s=n.node(i+1),l++,o=n.node(i).maybeChild(l)):(s=n.node(i).maybeChild(l-1),o=n.node(i+1)),s&&!s.isTextblock&&O5(s,o)&&n.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function I5(r,e,t=e,n=ee.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),s=r.resolve(t);return OS(i,s,n)?new Zt(e,t,n):new zS(i,s,n).fit()}function OS(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class zS{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=j.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=j.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let s=this.placed,o=n.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let a=new ee(s,o,l);return e>-1?new At(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Zt(n.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),s.type.spec.isolating&&i<=n){e=n;break}t=s.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,s=null;n?(s=ac(this.unplaced.content,n-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:u}=this.frontier[l],c,f=null;if(t==1&&(o?u.matchType(o.type)||(f=u.fillBefore(j.from(o),!1)):s&&a.compatibleContent(s.type)))return{sliceDepth:n,frontierDepth:l,parent:s,inject:f};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ac(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ee(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=ac(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new ee(So(e,t-1,1),t-1,s?t-1:n)}else this.unplaced=new ee(So(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v1||a==0||v.content.size)&&(f=T,c.push(D5(v.mark(d.allowedMarks(v.marks)),u==1?a:0,u==l.childCount?p:-1)))}let g=u==l.childCount;g||(p=-1),this.placed=bo(this.placed,t,j.from(c)),this.frontier[t].match=f,g&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,T=l;v1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],s=t=0;l--){let{match:a,type:u}=this.frontier[l],c=uc(e,l,u,a,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=bo(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=bo(this.placed,this.depth,j.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(j.empty,!0);t.childCount&&(this.placed=bo(this.placed,this.frontier.length,t))}}function So(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(So(r.firstChild.content,e-1,t)))}function bo(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(bo(r.lastChild.content,e-1,t)))}function ac(r,e){for(let t=0;t1&&(n=n.replaceChild(0,D5(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(j.empty,!0)))),r.copy(n)}function uc(r,e,t,n,i){let s=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==s.childCount&&!t.compatibleContent(s.type))return null;let l=n.fillBefore(s.content,!0,o);return l&&!IS(t,s.content,o)?l:null}function IS(r,e,t){for(let n=t;n=0;s--){let o=t<0?ts(e.node(0),e.node(s),e.before(s+1),e.index(s),t,n):ts(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new _r(e.node(0))}static atStart(e){return ts(e,e,0,0,1)||new _r(e)}static atEnd(e){return ts(e,e,e.content.size,e.childCount,-1)||new _r(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=cc[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in cc)throw new RangeError("Duplicate use of selection JSON ID "+e);return cc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Pe.between(this.$anchor,this.$head).getBookmark()}}me.prototype.visible=!0;class DS{constructor(e,t){this.$from=e,this.$to=t}}let Im=!1;function Dm(r){!Im&&!r.parent.inlineContent&&(Im=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class Pe extends me{constructor(e,t=e){Dm(e),Dm(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return me.near(n);let i=e.resolve(t.map(this.anchor));return new Pe(i.parent.inlineContent?i:n,n)}replace(e,t=ee.empty){if(super.replace(e,t),t==ee.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new eu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Pe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let s=me.findFrom(t,n,!0)||me.findFrom(t,-n,!0);if(s)t=s.$head;else return me.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(me.findFrom(e,-n,!0)||me.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let l=e.child(o);if(l.isAtom){if(!s&&Se.isSelectable(l))return Se.create(r,t-(i<0?l.nodeSize:0))}else{let a=ts(r,l,t+i,i<0?l.childCount:0,i,s);if(a)return a}t+=l.nodeSize*i}return null}function Rm(r,e,t){let n=r.steps.length-1;if(n{o==null&&(o=c)}),r.setSelection(me.near(r.doc.resolve(o),t))}function Pm(r,e){return!e||!r?r:r.bind(e)}class ta{constructor(e,t,n){this.name=e,this.init=Pm(t.init,n),this.apply=Pm(t.apply,n)}}new ta("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new ta("selection",{init(r,e){return r.selection||me.atStart(e.doc)},apply(r){return r.selection}}),new ta("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new ta("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}});function R5(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=R5(i,e,{})),t[n]=i}return t}class Sl{constructor(e){this.spec=e,this.props={},e.props&&R5(e.props,this,this.props),this.key=e.key?e.key.key:P5("plugin")}getState(e){return e[this.key]}}const fc=Object.create(null);function P5(r){return r in fc?r+"$"+ ++fc[r]:(fc[r]=0,r+"$")}class bl{constructor(e="key"){this.key=P5(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const PS=(r,e)=>r.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function BS(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const LS=(r,e,t)=>{let n=BS(r,t);if(!n)return!1;let i=B5(n);if(!i){let o=n.blockRange(),l=o&&Ks(o);return l==null?!1:(e&&e(r.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&$5(r,i,e))return!0;if(n.parent.content.size==0&&(_s(s,"end")||Se.isSelectable(s))){let o=I5(r.doc,n.before(),n.after(),ee.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;s=B5(n)}let o=s&&s.nodeBefore;return!o||!Se.isSelectable(o)?!1:(e&&e(r.tr.setSelection(Se.create(r.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function B5(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function $S(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset{let n=$S(r,t);if(!n)return!1;let i=L5(n);if(!i)return!1;let s=i.nodeAfter;if($5(r,i,e))return!0;if(n.parent.content.size==0&&(_s(s,"start")||Se.isSelectable(s))){let o=I5(r.doc,n.before(),n.after(),ee.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,s=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset=0;e--){let t=r.node(e);if(r.index(e)+1{let t=r.selection,n=t instanceof Se,i;if(n){if(t.node.isTextblock||!Wi(r.doc,t.from))return!1;i=t.from}else if(i=z5(r.doc,t.from,-1),i==null)return!1;if(e){let s=r.tr.join(i);n&&s.setSelection(Se.create(s.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},_S=(r,e)=>{let t=r.selection,n;if(t instanceof Se){if(t.node.isTextblock||!Wi(r.doc,t.to))return!1;n=t.to}else if(n=z5(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},US=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),s=i&&Ks(i);return s==null?!1:(e&&e(r.tr.lift(i,s).scrollIntoView()),!0)},WS=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(` +`).scrollIntoView()),!0)};function F5(r){for(let e=0;e{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),s=t.indexAfter(-1),o=F5(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let l=t.after(),a=r.tr.replaceWith(l,l,o.createAndFill());a.setSelection(me.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},YS=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof _r||n.parent.inlineContent||i.parent.inlineContent)return!1;let s=F5(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index(){let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Cs(r.doc,s))return e&&e(r.tr.split(s).scrollIntoView()),!0}let n=t.blockRange(),i=n&&Ks(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)},KS=(r,e)=>{let{$from:t,to:n}=r.selection,i,s=t.sharedDepth(n);return s==0?!1:(i=t.before(s),e&&e(r.tr.setSelection(Se.create(r.doc,i))),!0)};function GS(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(s-1,s)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Wi(r.doc,e.pos))?!1:(t&&t(r.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),!0)}function $5(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,s,o;if(n.type.spec.isolating||i.type.spec.isolating)return!1;if(GS(r,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(s=(o=n.contentMatchAt(n.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,d=j.empty;for(let v=s.length-1;v>=0;v--)d=j.from(s[v].create(null,d));d=j.from(n.copy(d));let p=r.tr.step(new At(e.pos-1,f,e.pos,f,new ee(d,1,0),s.length,!0)),g=f+2*s.length;Wi(p.doc,g)&&p.join(g),t(p.scrollIntoView())}return!0}let a=me.findFrom(e,1),u=a&&a.$from.blockRange(a.$to),c=u&&Ks(u);if(c!=null&&c>=e.depth)return t&&t(r.tr.lift(u,c).scrollIntoView()),!0;if(l&&_s(i,"start",!0)&&_s(n,"end")){let f=n,d=[];for(;d.push(f),!f.isTextblock;)f=f.lastChild;let p=i,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(t){let v=j.empty;for(let x=d.length-1;x>=0;x--)v=j.from(d[x].copy(v));let T=r.tr.step(new At(e.pos-d.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new ee(v,d.length,0),0,!0));t(T.scrollIntoView())}return!0}}return!1}function V5(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(Pe.create(e.doc,r<0?i.start(s):i.end(s)))),!0):!1}}const XS=V5(-1),QS=V5(1);function ZS(r,e=null){return function(t,n){let{$from:i,$to:s}=t.selection,o=i.blockRange(s),l=o&&A5(o,r,e);return l?(n&&n(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Bm(r,e=null){return function(t,n){let i=!1;for(let s=0;s{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(r,e)))if(a.type==r)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,r)}})}if(!i)return!1;if(n){let s=t.tr;for(let o=0;o=2&&i.node(o.depth-1).type.compatibleContent(r)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let c=t.doc.resolve(o.start-2);a=new Zf(c,c,o.depth),o.endIndex=0;c--)s=j.from(t[c].type.create(t[c].attrs,s));r.step(new At(e.start-(n?2:0),e.end,e.start,e.end,new ee(s,0,0),t.length,!0));let o=0;for(let c=0;co.childCount>0&&o.firstChild.type==r);return s?t?n.node(s.depth-1).type==r?nb(e,t,r,s):ib(e,t,s):!0:!1}}function nb(r,e,t,n){let i=r.tr,s=n.end,o=n.$to.end(n.depth);sv;g--)p-=i.child(g).nodeSize,n.delete(p-1,p+1);let s=n.doc.resolve(t.start),o=s.nodeAfter;if(n.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,u=s.node(-1),c=s.index(-1);if(!u.canReplace(c+(l?0:1),c+1,o.content.append(a?j.empty:j.from(i))))return!1;let f=s.pos,d=f+o.nodeSize;return n.step(new At(f-(l?1:0),d+(a?1:0),f+1,d-1,new ee((l?j.empty:j.from(i.copy(j.empty))).append(a?j.empty:j.from(i.copy(j.empty))),l?0:1,a?0:1),l?0:1)),e(n.scrollIntoView()),!0}function sb(r){return function(e,t){let{$from:n,$to:i}=e.selection,s=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,a=l.child(o-1);if(a.type!=r)return!1;if(t){let u=a.lastChild&&a.lastChild.type==l.type,c=j.from(u?r.create():null),f=new ee(j.from(r.create(null,j.from(l.type.create(null,c)))),u?3:1,0),d=s.start,p=s.end;t(e.tr.step(new At(d-(u?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}function H5(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,s=t.storedMarks,t}}}class ob{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:s}=n,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>{const f=a(...c)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i,l=[],a=!!e,u=e||s.tr,c=()=>(!a&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(d=>d===!0)),f={...Object.fromEntries(Object.entries(n).map(([d,p])=>[d,(...v)=>{const T=this.buildProps(u,t),x=p(...v)(T);return l.push(x),f}])),run:c};return f}createCan(e){const{rawCommands:t,state:n}=this,i=!1,s=e||n.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([a,u])=>[a,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:s}=this,{view:o}=i;s.storedMarks&&e.setStoredMarks(s.storedMarks);const l={tr:e,editor:i,view:o,state:H5({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([a,u])=>[a,(...c)=>u(...c)(l)]))}};return l}}function Vt(r,e,t){return r.config[e]===void 0&&r.parent?Vt(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?Vt(r.parent,e,t):null}):r.config[e]}function lb(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function ut(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function ab(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,s])=>{if(!n[i]){n[i]=s;return}i==="class"?n[i]=[n[i],s].join(" "):i==="style"?n[i]=[n[i],s].join("; "):n[i]=s}),n},{})}function ub(r){return typeof r=="function"}function br(r,e=void 0,...t){return ub(r)?e?r.bind(e)(...t):r(...t):r}function cb(r){return Object.prototype.toString.call(r)==="[object RegExp]"}class Lm{constructor(e){this.find=e.find,this.handler=e.handler}}class dc{constructor(e){this.find=e.find,this.handler=e.handler}}function fb(r){return Object.prototype.toString.call(r).slice(8,-1)}function hc(r){return fb(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function zh(r,e){const t={...r};return hc(r)&&hc(e)&&Object.keys(e).forEach(n=>{hc(e[n])?n in r?t[n]=zh(r[n],e[n]):Object.assign(t,{[n]:e[n]}):Object.assign(t,{[n]:e[n]})}),t}class jr{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=br(Vt(this,"addOptions",{name:this.name}))),this.storage=br(Vt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new jr(e)}configure(e={}){const t=this.extend();return t.options=zh(this.options,e),t.storage=br(Vt(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new jr(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=br(Vt(t,"addOptions",{name:t.name})),t.storage=br(Vt(t,"addStorage",{name:t.name,options:t.options})),t}}function db(r,e,t){const{from:n,to:i}=e,{blockSeparator:s=` -`,textSerializers:o={}}=t||{};let l="",a=!0;return r.nodesBetween(n,i,(u,c,f,d)=>{var p;const g=o==null?void 0:o[u.type.name];g?(u.isBlock&&!a&&(l+=s,a=!0),f&&(l+=g({node:u,pos:c,parent:f,index:d,range:e}))):u.isText?(l+=(p=u==null?void 0:u.text)===null||p===void 0?void 0:p.slice(Math.max(n,c)-c,i-c),a=!1):u.isBlock&&!a&&(l+=s,a=!0)}),l}function hb(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Wr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Sl({key:new bl("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=hb(t);return db(n,{from:o,to:l},{textSerializers:a})}}})]}});const pb=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),mb=(r=!1)=>({commands:e})=>e.setContent("",r),gb=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(a)),d=u.resolve(c.map(a+l.nodeSize)),p=f.blockRange(d);if(!p)return;const g=Ks(p);if(l.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,v)}(g||g===0)&&e.lift(p,g)})}),!0},yb=r=>e=>r(e),vb=()=>({state:r,dispatch:e})=>YS(r,e),xb=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1},kb=r=>({tr:e,state:t,dispatch:n})=>{const i=ut(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),u=s.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1},wb=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},Sb=()=>({state:r,dispatch:e})=>PS(r,e),bb=()=>({commands:r})=>r.keyboardShortcut("Enter"),Mb=()=>({state:r,dispatch:e})=>jS(r,e);function x0(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:cb(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function td(r,e,t={}){return r.find(n=>n.type===e&&x0(n.attrs,t))}function Tb(r,e,t={}){return!!td(r,e,t)}function q5(r,e,t={}){if(!r||!e)return;let n=r.parent.childAfter(r.parentOffset);if(r.parentOffset===n.offset&&n.offset!==0&&(n=r.parent.childBefore(r.parentOffset)),!n.node)return;const i=td([...n.node.marks],e,t);if(!i)return;let s=n.index,o=r.start()+n.offset,l=s+1,a=o+n.node.nodeSize;for(td([...n.node.marks],e,t);s>0&&i.isInSet(r.parent.child(s-1).marks);)s-=1,o-=r.parent.child(s).nodeSize;for(;l({tr:t,state:n,dispatch:i})=>{const s=li(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:u,to:c}=l;if(i){const f=q5(a,s,e);if(f&&f.from<=u&&f.to>=c){const d=Pe.create(o,f.from,f.to);t.setSelection(d)}}return!0},Eb=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Ih()&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!_5(t.state.selection))return o(),!0;const l=Nb(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Ob=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),zb=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e);function Fm(r){const e=`${r}`;return new window.DOMParser().parseFromString(e,"text/html").body}function k0(r,e,t){if(t={slice:!0,parseOptions:{},...t},typeof r=="object"&&r!==null)try{return Array.isArray(r)&&r.length>0?j.fromArray(r.map(n=>e.nodeFromJSON(n))):e.nodeFromJSON(r)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",n),k0("",e,t)}if(typeof r=="string"){const n=g0.fromSchema(e);return t.slice?n.parseSlice(Fm(r),t.parseOptions).content:n.parse(Fm(r),t.parseOptions)}return k0("",e,t)}function Ib(r,e,t){const n=r.steps.length-1;if(n{o===0&&(o=c)}),r.setSelection(me.near(r.doc.resolve(o),t))}const Db=r=>r.toString().startsWith("<"),Rb=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const o=k0(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:l,to:a}=typeof r=="number"?{from:r,to:r}:r,u=!0,c=!0;if((Db(o)?o:[o]).forEach(d=>{d.check(),u=u?d.isText&&d.marks.length===0:!1,c=c?d.isBlock:!1}),l===a&&c){const{parent:d}=n.doc.resolve(l);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(l-=1,a+=1)}u?Array.isArray(e)?n.insertText(e.map(d=>d.text||"").join(""),l,a):typeof e=="object"&&e&&e.text?n.insertText(e.text,l,a):n.insertText(e,l,a):n.replaceWith(l,a,o),t.updateSelection&&Ib(n,n.steps.length-1,-1)}return!0},Pb=()=>({state:r,dispatch:e})=>qS(r,e),Bb=()=>({state:r,dispatch:e})=>_S(r,e),Lb=()=>({state:r,dispatch:e})=>LS(r,e),Fb=()=>({state:r,dispatch:e})=>VS(r,e);function U5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function $b(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l({editor:e,view:t,tr:n,dispatch:i})=>{const s=$b(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,l))});return a==null||a.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function Dh(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?ut(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(f,d)=>{if(f.isText)return;const p=Math.max(n,d),g=Math.min(i,d+f.nodeSize);l.push({node:f,from:p,to:g})});const a=i-n,u=l.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>x0(f.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=a}const Hb=(r,e={})=>({state:t,dispatch:n})=>{const i=ut(r,t.schema);return Dh(t,i,e)?US(t,n):!1},qb=()=>({state:r,dispatch:e})=>JS(r,e),_b=r=>({state:e,dispatch:t})=>{const n=ut(r,e.schema);return rb(n)(e,t)},Ub=()=>({state:r,dispatch:e})=>WS(r,e);function W5(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function $m(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const Wb=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=W5(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=ut(r,n.schema)),l==="mark"&&(o=li(r,n.schema)),i&&t.selection.ranges.forEach(a=>{n.doc.nodesBetween(a.$from.pos,a.$to.pos,(u,c)=>{s&&s===u.type&&t.setNodeMarkup(c,void 0,$m(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&t.addMark(c,c+u.nodeSize,o.create($m(f.attrs,e)))})})}),!0):!1},jb=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),Yb=()=>({tr:r,commands:e})=>e.setTextSelection({from:0,to:r.doc.content.size}),Jb=()=>({state:r,dispatch:e})=>FS(r,e),Kb=()=>({state:r,dispatch:e})=>HS(r,e),Gb=()=>({state:r,dispatch:e})=>KS(r,e),Xb=()=>({state:r,dispatch:e})=>QS(r,e),Qb=()=>({state:r,dispatch:e})=>XS(r,e);function Zb(r,e,t={}){return k0(r,e,{slice:!1,parseOptions:t})}const eM=(r,e=!1,t={})=>({tr:n,editor:i,dispatch:s})=>{const{doc:o}=n,l=Zb(r,i.schema,t);return s&&n.replaceWith(0,o.content.size,l).setMeta("preventUpdate",!e),!0};function tM(r){for(let e=0;e0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Rh(r){return e=>rM(e.$from,r)}function nM(r,e){const t=li(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function Oa(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function iM(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?li(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>x0(f.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,g=d.pos;r.doc.nodesBetween(p,g,(v,T)=>{if(!v.isText&&!v.marks.length)return;const x=Math.max(p,T),w=Math.min(g,T+v.nodeSize),S=w-x;o+=S,l.push(...v.marks.map(E=>({mark:E,from:x,to:w})))})}),o===0)return!1;const a=l.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>x0(f.mark.attrs,t,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=l.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,d)=>f+d.to-d.from,0);return(a>0?a+u:a)>=o}function Vm(r,e){const{nodeExtensions:t}=lb(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=Sr(Vt(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function sM(r,e,t){var n;const{selection:i}=e;let s=null;if(_5(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!==null&&n!==void 0?n:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let u=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const p=!d||d.type.allowsMarkType(t),g=!!t.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(t));u=p&&g}return!u}),u})}const oM=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=li(r,n.schema);if(i)if(o){const u=nM(n,a);t.addStoredMark(a.create({...u,...e}))}else l.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;n.doc.nodesBetween(c,f,(d,p)=>{const g=Math.max(p,c),v=Math.min(p+d.nodeSize,f);d.marks.find(x=>x.type===a)?d.marks.forEach(x=>{a===x.type&&t.addMark(g,v,a.create({...x.attrs,...e}))}):t.addMark(g,v,a.create(e))})});return sM(n,t,a)},lM=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),aM=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=ut(r,t.schema);return s.isTextblock?i().command(({commands:o})=>Bm(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>Bm(s,e)(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},uM=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=Ti(r,0,n.content.size),s=Se.create(n,i);e.setSelection(s)}return!0},cM=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=Pe.atStart(n).from,l=Pe.atEnd(n).to,a=Ti(i,o,l),u=Ti(s,o,l),c=Pe.create(n,a,u);e.setSelection(c)}return!0},fM=r=>({state:e,dispatch:t})=>{const n=ut(r,e.schema);return sb(n)(e,t)};function Hm(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const dM=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,u=i.extensionManager.attributes,c=Oa(u,l.node().type.name,l.node().attrs);if(s instanceof Se&&s.node.isBlock)return!l.parentOffset||!Cs(o,l.pos)?!1:(n&&(r&&Hm(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(n){const f=a.parentOffset===a.parent.content.size;s instanceof Pe&&e.deleteSelection();const d=l.depth===0?void 0:tM(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&d?[{type:d,attrs:c}]:void 0,g=Cs(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!g&&Cs(e.doc,e.mapping.map(l.pos),1,d?[{type:d}]:void 0)&&(g=!0,p=d?[{type:d,attrs:c}]:void 0),g&&(e.split(e.mapping.map(l.pos),1,p),d&&!f&&!l.parentOffset&&l.parent.type!==d)){const v=e.mapping.map(l.before()),T=e.doc.resolve(v);l.node(-1).canReplaceWith(T.index(),T.index()+1,d)&&e.setNodeMarkup(e.mapping.map(l.before()),d)}r&&Hm(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},hM=r=>({tr:e,state:t,dispatch:n,editor:i})=>{var s;const o=ut(r,t.schema),{$from:l,$to:a}=t.selection,u=t.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(a))return!1;const c=l.node(-1);if(c.type!==o)return!1;const f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){let T=j.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let I=l.depth-x;I>=l.depth-3;I-=1)T=j.from(l.node(I).copy(T));const w=l.indexAfter(-1){if(z>-1)return!1;I.isTextblock&&I.content.size===0&&(z=O+1)}),z>-1&&e.setSelection(Pe.near(e.doc.resolve(z))),e.scrollIntoView()}return!0}const d=a.pos===l.end()?c.contentMatchAt(0).defaultType:null,p=Oa(f,c.type.name,c.attrs),g=Oa(f,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const v=d?[{type:o,attrs:p},{type:d,attrs:g}]:[{type:o,attrs:p}];if(!Cs(e.doc,l.pos,2))return!1;if(n){const{selection:T,storedMarks:x}=t,{splittableMarks:w}=i.extensionManager,S=x||T.$to.parentOffset&&T.$from.marks();if(e.split(l.pos,2,v).scrollIntoView(),!S||!n)return!0;const E=S.filter(A=>w.includes(A.type.name));e.ensureMarks(E)}return!0},pc=(r,e)=>{const t=Rh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Wi(r.doc,t.pos)&&r.join(t.pos),!0},mc=(r,e)=>{const t=Rh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Wi(r.doc,n)&&r.join(n),!0},pM=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,p=ut(r,o.schema),g=ut(e,o.schema),{selection:v,storedMarks:T}=o,{$from:x,$to:w}=v,S=x.blockRange(w),E=T||v.$to.parentOffset&&v.$from.marks();if(!S)return!1;const A=Rh(z=>Vm(z.type.name,f))(v);if(S.depth>=1&&A&&S.depth-A.depth<=1){if(A.node.type===p)return u.liftListItem(g);if(Vm(A.node.type.name,f)&&p.validContent(A.node.content)&&l)return a().command(()=>(s.setNodeMarkup(A.pos,p),!0)).command(()=>pc(s,p)).command(()=>mc(s,p)).run()}return!t||!E||!l?a().command(()=>c().wrapInList(p,n)?!0:u.clearNodes()).wrapInList(p,n).command(()=>pc(s,p)).command(()=>mc(s,p)).run():a().command(()=>{const z=c().wrapInList(p,n),I=E.filter(O=>d.includes(O.type.name));return s.ensureMarks(I),z?!0:u.clearNodes()}).wrapInList(p,n).command(()=>pc(s,p)).command(()=>mc(s,p)).run()},mM=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=li(r,n.schema);return iM(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},gM=(r,e,t={})=>({state:n,commands:i})=>{const s=ut(r,n.schema),o=ut(e,n.schema);return Dh(n,s,t)?i.setNode(o):i.setNode(s,t)},yM=(r,e={})=>({state:t,commands:n})=>{const i=ut(r,t.schema);return Dh(t,i,e)?n.lift(i):n.wrapIn(i,e)},vM=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},xM=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},kM=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=li(r,n.schema),{$from:u,empty:c,ranges:f}=l;if(!i)return!0;if(c&&o){let{from:d,to:p}=l;const g=(s=u.marks().find(T=>T.type===a))===null||s===void 0?void 0:s.attrs,v=q5(u,a,g);v&&(d=v.from,p=v.to),t.removeMark(d,p,a)}else f.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,a)});return t.removeStoredMark(a),!0},wM=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=W5(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=ut(r,n.schema)),l==="mark"&&(o=li(r,n.schema)),i&&t.selection.ranges.forEach(a=>{const u=a.$from.pos,c=a.$to.pos;n.doc.nodesBetween(u,c,(f,d)=>{s&&s===f.type&&t.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(p=>{if(o===p.type){const g=Math.max(d,u),v=Math.min(d+f.nodeSize,c);t.addMark(g,v,o.create({...p.attrs,...e}))}})})}),!0):!1},SM=(r,e={})=>({state:t,dispatch:n})=>{const i=ut(r,t.schema);return ZS(i,e)(t,n)},bM=(r,e={})=>({state:t,dispatch:n})=>{const i=ut(r,t.schema);return eb(i,e)(t,n)};var MM=Object.freeze({__proto__:null,blur:pb,clearContent:mb,clearNodes:gb,command:yb,createParagraphNear:vb,deleteCurrentNode:xb,deleteNode:kb,deleteRange:wb,deleteSelection:Sb,enter:bb,exitCode:Mb,extendMarkRange:Cb,first:Eb,focus:Ab,forEach:Ob,insertContent:zb,insertContentAt:Rb,joinUp:Pb,joinDown:Bb,joinBackward:Lb,joinForward:Fb,keyboardShortcut:Vb,lift:Hb,liftEmptyBlock:qb,liftListItem:_b,newlineInCode:Ub,resetAttributes:Wb,scrollIntoView:jb,selectAll:Yb,selectNodeBackward:Jb,selectNodeForward:Kb,selectParentNode:Gb,selectTextblockEnd:Xb,selectTextblockStart:Qb,setContent:eM,setMark:oM,setMeta:lM,setNode:aM,setNodeSelection:uM,setTextSelection:cM,sinkListItem:fM,splitBlock:dM,splitListItem:hM,toggleList:pM,toggleMark:mM,toggleNode:gM,toggleWrap:yM,undoInputRule:vM,unsetAllMarks:xM,unsetMark:kM,updateAttributes:wM,wrapIn:SM,wrapInList:bM});Wr.create({name:"commands",addCommands(){return{...MM}}});Wr.create({name:"editable",addProseMirrorPlugins(){return[new Sl({key:new bl("editable"),props:{editable:()=>this.editor.options.editable}})]}});Wr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new Sl({key:new bl("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}});Wr.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:u}=l,{empty:c,$anchor:f}=a,{pos:d,parent:p}=f,g=me.atStart(u).from===d;return!c||!g||!p.type.isTextblock||p.textContent.length?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ih()||U5()?s:i},addProseMirrorPlugins(){return[new Sl({key:new bl("clearDocument"),appendTransaction:(r,e,t)=>{if(!(r.some(g=>g.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,l=me.atStart(e.doc).from,a=me.atEnd(e.doc).to;if(i||!(s===l&&o===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const f=t.tr,d=H5({state:t,transaction:f}),{commands:p}=new ob({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}});Wr.create({name:"tabindex",addProseMirrorPlugins(){return[new Sl({key:new bl("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});let TM=class rd{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Sr(Vt(this,"addOptions",{name:this.name}))),this.storage=Sr(Vt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new rd(e)}configure(e={}){const t=this.extend();return t.options=zh(this.options,e),t.storage=Sr(Vt(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new rd(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Sr(Vt(t,"addOptions",{name:t.name})),t.storage=Sr(Vt(t,"addStorage",{name:t.name,options:t.options})),t}};class $t{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new $t(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}let Yn=class j5{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new j5(t,$t.range(this,e))}};class B{constructor(e,t){this.position=void 0;var n="KaTeX parse error: "+e,i,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start;var l=s.end;i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var a=o.slice(i,l).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var c;l+15":">","<":"<",'"':""","'":"'"},zM=/[&><"']/g;function IM(r){return String(r).replace(zM,e=>OM[e])}var Y5=function r(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?r(e.body[0]):e:e.type==="font"?r(e.body):e},DM=function(e){var t=Y5(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},RM=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},PM=function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return t!=null?t[1]:"_relative"},G={contains:CM,deflt:EM,escape:IM,hyphenate:AM,getBaseElem:Y5,isCharacterBox:DM,protocolFromUrl:PM},za={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand ",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function BM(r){if(r.default)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Ph{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in za)if(za.hasOwnProperty(t)){var n=za[t];this[t]=e[t]!==void 0?n.processor?n.processor(e[t]):e[t]:BM(n)}}reportNonstrict(e,t,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new B("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var i=this.strict;if(typeof i=="function")try{i=i(e,t,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){e.url&&!e.protocol&&(e.protocol=G.protocolFromUrl(e.url));var t=typeof this.trust=="function"?this.trust(e):this.trust;return!!t}}class Sn{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Pr[LM[this.id]]}sub(){return Pr[FM[this.id]]}fracNum(){return Pr[$M[this.id]]}fracDen(){return Pr[VM[this.id]]}cramp(){return Pr[HM[this.id]]}text(){return Pr[qM[this.id]]}isTight(){return this.size>=2}}var Bh=0,w0=1,Es=2,ln=3,hl=4,sr=5,Us=6,dt=7,Pr=[new Sn(Bh,0,!1),new Sn(w0,0,!0),new Sn(Es,1,!1),new Sn(ln,1,!0),new Sn(hl,2,!1),new Sn(sr,2,!0),new Sn(Us,3,!1),new Sn(dt,3,!0)],LM=[hl,sr,hl,sr,Us,dt,Us,dt],FM=[sr,sr,sr,sr,dt,dt,dt,dt],$M=[Es,ln,hl,sr,Us,dt,Us,dt],VM=[ln,ln,sr,sr,dt,dt,dt,dt],HM=[w0,w0,ln,ln,sr,sr,dt,dt],qM=[Bh,w0,Es,ln,Es,ln,Es,ln],Y={DISPLAY:Pr[Bh],TEXT:Pr[Es],SCRIPT:Pr[hl],SCRIPTSCRIPT:Pr[Us]},nd=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function _M(r){for(var e=0;e=i[0]&&r<=i[1])return t.name}return null}var Ia=[];nd.forEach(r=>r.blocks.forEach(e=>Ia.push(...e)));function J5(r){for(var e=0;e=Ia[e]&&r<=Ia[e+1])return!0;return!1}var Gi=80,UM=function(e,t){return"M95,"+(622+e+t)+` +`,textSerializers:o={}}=t||{};let l="",a=!0;return r.nodesBetween(n,i,(u,c,f,d)=>{var p;const g=o==null?void 0:o[u.type.name];g?(u.isBlock&&!a&&(l+=s,a=!0),f&&(l+=g({node:u,pos:c,parent:f,index:d,range:e}))):u.isText?(l+=(p=u==null?void 0:u.text)===null||p===void 0?void 0:p.slice(Math.max(n,c)-c,i-c),a=!1):u.isBlock&&!a&&(l+=s,a=!0)}),l}function hb(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}jr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Sl({key:new bl("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(c=>c.$from.pos)),l=Math.max(...s.map(c=>c.$to.pos)),a=hb(t);return db(n,{from:o,to:l},{textSerializers:a})}}})]}});const pb=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),mb=(r=!1)=>({commands:e})=>e.setContent("",r),gb=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:s,$to:o})=>{r.doc.nodesBetween(s.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(a)),d=u.resolve(c.map(a+l.nodeSize)),p=f.blockRange(d);if(!p)return;const g=Ks(p);if(l.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,v)}(g||g===0)&&e.lift(p,g)})}),!0},yb=r=>e=>r(e),vb=()=>({state:r,dispatch:e})=>YS(r,e),xb=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===n.type){if(e){const l=i.before(s),a=i.after(s);r.delete(l,a).scrollIntoView()}return!0}return!1},kb=r=>({tr:e,state:t,dispatch:n})=>{const i=ut(r,t.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(n){const a=s.before(o),u=s.after(o);e.delete(a,u).scrollIntoView()}return!0}return!1},wb=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},Sb=()=>({state:r,dispatch:e})=>PS(r,e),bb=()=>({commands:r})=>r.keyboardShortcut("Enter"),Mb=()=>({state:r,dispatch:e})=>jS(r,e);function x0(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:cb(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function td(r,e,t={}){return r.find(n=>n.type===e&&x0(n.attrs,t))}function Tb(r,e,t={}){return!!td(r,e,t)}function q5(r,e,t={}){if(!r||!e)return;let n=r.parent.childAfter(r.parentOffset);if(r.parentOffset===n.offset&&n.offset!==0&&(n=r.parent.childBefore(r.parentOffset)),!n.node)return;const i=td([...n.node.marks],e,t);if(!i)return;let s=n.index,o=r.start()+n.offset,l=s+1,a=o+n.node.nodeSize;for(td([...n.node.marks],e,t);s>0&&i.isInSet(r.parent.child(s-1).marks);)s-=1,o-=r.parent.child(s).nodeSize;for(;l({tr:t,state:n,dispatch:i})=>{const s=li(r,n.schema),{doc:o,selection:l}=t,{$from:a,from:u,to:c}=l;if(i){const f=q5(a,s,e);if(f&&f.from<=u&&f.to>=c){const d=Pe.create(o,f.from,f.to);t.setSelection(d)}}return!0},Eb=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n({editor:t,view:n,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{Ih()&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(s&&r===null&&!_5(t.state.selection))return o(),!0;const l=Nb(i.doc,r)||t.state.selection,a=t.state.selection.eq(l);return s&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Ob=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),zb=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e);function Fm(r){const e=`${r}`;return new window.DOMParser().parseFromString(e,"text/html").body}function k0(r,e,t){if(t={slice:!0,parseOptions:{},...t},typeof r=="object"&&r!==null)try{return Array.isArray(r)&&r.length>0?j.fromArray(r.map(n=>e.nodeFromJSON(n))):e.nodeFromJSON(r)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",n),k0("",e,t)}if(typeof r=="string"){const n=g0.fromSchema(e);return t.slice?n.parseSlice(Fm(r),t.parseOptions).content:n.parse(Fm(r),t.parseOptions)}return k0("",e,t)}function Ib(r,e,t){const n=r.steps.length-1;if(n{o===0&&(o=c)}),r.setSelection(me.near(r.doc.resolve(o),t))}const Db=r=>r.toString().startsWith("<"),Rb=(r,e,t)=>({tr:n,dispatch:i,editor:s})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const o=k0(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(o.toString()==="<>")return!0;let{from:l,to:a}=typeof r=="number"?{from:r,to:r}:r,u=!0,c=!0;if((Db(o)?o:[o]).forEach(d=>{d.check(),u=u?d.isText&&d.marks.length===0:!1,c=c?d.isBlock:!1}),l===a&&c){const{parent:d}=n.doc.resolve(l);d.isTextblock&&!d.type.spec.code&&!d.childCount&&(l-=1,a+=1)}u?Array.isArray(e)?n.insertText(e.map(d=>d.text||"").join(""),l,a):typeof e=="object"&&e&&e.text?n.insertText(e.text,l,a):n.insertText(e,l,a):n.replaceWith(l,a,o),t.updateSelection&&Ib(n,n.steps.length-1,-1)}return!0},Pb=()=>({state:r,dispatch:e})=>qS(r,e),Bb=()=>({state:r,dispatch:e})=>_S(r,e),Lb=()=>({state:r,dispatch:e})=>LS(r,e),Fb=()=>({state:r,dispatch:e})=>VS(r,e);function U5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function $b(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,s,o;for(let l=0;l({editor:e,view:t,tr:n,dispatch:i})=>{const s=$b(r).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,l))});return a==null||a.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function Dh(r,e,t={}){const{from:n,to:i,empty:s}=r.selection,o=e?ut(e,r.schema):null,l=[];r.doc.nodesBetween(n,i,(f,d)=>{if(f.isText)return;const p=Math.max(n,d),g=Math.min(i,d+f.nodeSize);l.push({node:f,from:p,to:g})});const a=i-n,u=l.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>x0(f.node.attrs,t,{strict:!1}));return s?!!u.length:u.reduce((f,d)=>f+d.to-d.from,0)>=a}const Hb=(r,e={})=>({state:t,dispatch:n})=>{const i=ut(r,t.schema);return Dh(t,i,e)?US(t,n):!1},qb=()=>({state:r,dispatch:e})=>JS(r,e),_b=r=>({state:e,dispatch:t})=>{const n=ut(r,e.schema);return rb(n)(e,t)},Ub=()=>({state:r,dispatch:e})=>WS(r,e);function W5(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function $m(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const Wb=(r,e)=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=W5(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=ut(r,n.schema)),l==="mark"&&(o=li(r,n.schema)),i&&t.selection.ranges.forEach(a=>{n.doc.nodesBetween(a.$from.pos,a.$to.pos,(u,c)=>{s&&s===u.type&&t.setNodeMarkup(c,void 0,$m(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&t.addMark(c,c+u.nodeSize,o.create($m(f.attrs,e)))})})}),!0):!1},jb=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),Yb=()=>({tr:r,commands:e})=>e.setTextSelection({from:0,to:r.doc.content.size}),Jb=()=>({state:r,dispatch:e})=>FS(r,e),Kb=()=>({state:r,dispatch:e})=>HS(r,e),Gb=()=>({state:r,dispatch:e})=>KS(r,e),Xb=()=>({state:r,dispatch:e})=>QS(r,e),Qb=()=>({state:r,dispatch:e})=>XS(r,e);function Zb(r,e,t={}){return k0(r,e,{slice:!1,parseOptions:t})}const eM=(r,e=!1,t={})=>({tr:n,editor:i,dispatch:s})=>{const{doc:o}=n,l=Zb(r,i.schema,t);return s&&n.replaceWith(0,o.content.size,l).setMeta("preventUpdate",!e),!0};function tM(r){for(let e=0;e0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function Rh(r){return e=>rM(e.$from,r)}function nM(r,e){const t=li(e,r.schema),{from:n,to:i,empty:s}=r.selection,o=[];s?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function Oa(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(s=>s.type===e&&s.name===n);return i?i.attribute.keepOnSplit:!1}))}function iM(r,e,t={}){const{empty:n,ranges:i}=r.selection,s=e?li(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>x0(f.attrs,t,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:f,$to:d})=>{const p=f.pos,g=d.pos;r.doc.nodesBetween(p,g,(v,T)=>{if(!v.isText&&!v.marks.length)return;const x=Math.max(p,T),w=Math.min(g,T+v.nodeSize),S=w-x;o+=S,l.push(...v.marks.map(E=>({mark:E,from:x,to:w})))})}),o===0)return!1;const a=l.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>x0(f.mark.attrs,t,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),u=l.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,d)=>f+d.to-d.from,0);return(a>0?a+u:a)>=o}function Vm(r,e){const{nodeExtensions:t}=lb(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},s=br(Vt(n,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function sM(r,e,t){var n;const{selection:i}=e;let s=null;if(_5(i)&&(s=i.$cursor),s){const l=(n=r.storedMarks)!==null&&n!==void 0?n:s.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:l,$to:a})=>{let u=l.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(l.pos,a.pos,(c,f,d)=>{if(u)return!1;if(c.isInline){const p=!d||d.type.allowsMarkType(t),g=!!t.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(t));u=p&&g}return!u}),u})}const oM=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:s}=t,{empty:o,ranges:l}=s,a=li(r,n.schema);if(i)if(o){const u=nM(n,a);t.addStoredMark(a.create({...u,...e}))}else l.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;n.doc.nodesBetween(c,f,(d,p)=>{const g=Math.max(p,c),v=Math.min(p+d.nodeSize,f);d.marks.find(x=>x.type===a)?d.marks.forEach(x=>{a===x.type&&t.addMark(g,v,a.create({...x.attrs,...e}))}):t.addMark(g,v,a.create(e))})});return sM(n,t,a)},lM=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),aM=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const s=ut(r,t.schema);return s.isTextblock?i().command(({commands:o})=>Bm(s,e)(t)?!0:o.clearNodes()).command(({state:o})=>Bm(s,e)(o,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},uM=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=Ti(r,0,n.content.size),s=Se.create(n,i);e.setSelection(s)}return!0},cM=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:s}=typeof r=="number"?{from:r,to:r}:r,o=Pe.atStart(n).from,l=Pe.atEnd(n).to,a=Ti(i,o,l),u=Ti(s,o,l),c=Pe.create(n,a,u);e.setSelection(c)}return!0},fM=r=>({state:e,dispatch:t})=>{const n=ut(r,e.schema);return sb(n)(e,t)};function Hm(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const dM=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:s,doc:o}=e,{$from:l,$to:a}=s,u=i.extensionManager.attributes,c=Oa(u,l.node().type.name,l.node().attrs);if(s instanceof Se&&s.node.isBlock)return!l.parentOffset||!Cs(o,l.pos)?!1:(n&&(r&&Hm(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(n){const f=a.parentOffset===a.parent.content.size;s instanceof Pe&&e.deleteSelection();const d=l.depth===0?void 0:tM(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=f&&d?[{type:d,attrs:c}]:void 0,g=Cs(e.doc,e.mapping.map(l.pos),1,p);if(!p&&!g&&Cs(e.doc,e.mapping.map(l.pos),1,d?[{type:d}]:void 0)&&(g=!0,p=d?[{type:d,attrs:c}]:void 0),g&&(e.split(e.mapping.map(l.pos),1,p),d&&!f&&!l.parentOffset&&l.parent.type!==d)){const v=e.mapping.map(l.before()),T=e.doc.resolve(v);l.node(-1).canReplaceWith(T.index(),T.index()+1,d)&&e.setNodeMarkup(e.mapping.map(l.before()),d)}r&&Hm(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},hM=r=>({tr:e,state:t,dispatch:n,editor:i})=>{var s;const o=ut(r,t.schema),{$from:l,$to:a}=t.selection,u=t.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(a))return!1;const c=l.node(-1);if(c.type!==o)return!1;const f=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==o||l.index(-2)!==l.node(-2).childCount-1)return!1;if(n){let T=j.empty;const x=l.index(-1)?1:l.index(-2)?2:3;for(let I=l.depth-x;I>=l.depth-3;I-=1)T=j.from(l.node(I).copy(T));const w=l.indexAfter(-1){if(z>-1)return!1;I.isTextblock&&I.content.size===0&&(z=O+1)}),z>-1&&e.setSelection(Pe.near(e.doc.resolve(z))),e.scrollIntoView()}return!0}const d=a.pos===l.end()?c.contentMatchAt(0).defaultType:null,p=Oa(f,c.type.name,c.attrs),g=Oa(f,l.node().type.name,l.node().attrs);e.delete(l.pos,a.pos);const v=d?[{type:o,attrs:p},{type:d,attrs:g}]:[{type:o,attrs:p}];if(!Cs(e.doc,l.pos,2))return!1;if(n){const{selection:T,storedMarks:x}=t,{splittableMarks:w}=i.extensionManager,S=x||T.$to.parentOffset&&T.$from.marks();if(e.split(l.pos,2,v).scrollIntoView(),!S||!n)return!0;const E=S.filter(A=>w.includes(A.type.name));e.ensureMarks(E)}return!0},pc=(r,e)=>{const t=Rh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Wi(r.doc,t.pos)&&r.join(t.pos),!0},mc=(r,e)=>{const t=Rh(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Wi(r.doc,n)&&r.join(n),!0},pM=(r,e,t,n={})=>({editor:i,tr:s,state:o,dispatch:l,chain:a,commands:u,can:c})=>{const{extensions:f,splittableMarks:d}=i.extensionManager,p=ut(r,o.schema),g=ut(e,o.schema),{selection:v,storedMarks:T}=o,{$from:x,$to:w}=v,S=x.blockRange(w),E=T||v.$to.parentOffset&&v.$from.marks();if(!S)return!1;const A=Rh(z=>Vm(z.type.name,f))(v);if(S.depth>=1&&A&&S.depth-A.depth<=1){if(A.node.type===p)return u.liftListItem(g);if(Vm(A.node.type.name,f)&&p.validContent(A.node.content)&&l)return a().command(()=>(s.setNodeMarkup(A.pos,p),!0)).command(()=>pc(s,p)).command(()=>mc(s,p)).run()}return!t||!E||!l?a().command(()=>c().wrapInList(p,n)?!0:u.clearNodes()).wrapInList(p,n).command(()=>pc(s,p)).command(()=>mc(s,p)).run():a().command(()=>{const z=c().wrapInList(p,n),I=E.filter(O=>d.includes(O.type.name));return s.ensureMarks(I),z?!0:u.clearNodes()}).wrapInList(p,n).command(()=>pc(s,p)).command(()=>mc(s,p)).run()},mM=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,o=li(r,n.schema);return iM(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},gM=(r,e,t={})=>({state:n,commands:i})=>{const s=ut(r,n.schema),o=ut(e,n.schema);return Dh(n,s,t)?i.setNode(o):i.setNode(s,t)},yM=(r,e={})=>({state:t,commands:n})=>{const i=ut(r,t.schema);return Dh(t,i,e)?n.lift(i):n.wrapIn(i,e)},vM=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(s.text){const a=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,r.schema.text(s.text,a))}else o.delete(s.from,s.to)}return!0}}return!1},xM=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(s=>{r.removeMark(s.$from.pos,s.$to.pos)}),!0},kM=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=li(r,n.schema),{$from:u,empty:c,ranges:f}=l;if(!i)return!0;if(c&&o){let{from:d,to:p}=l;const g=(s=u.marks().find(T=>T.type===a))===null||s===void 0?void 0:s.attrs,v=q5(u,a,g);v&&(d=v.from,p=v.to),t.removeMark(d,p,a)}else f.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,a)});return t.removeStoredMark(a),!0},wM=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let s=null,o=null;const l=W5(typeof r=="string"?r:r.name,n.schema);return l?(l==="node"&&(s=ut(r,n.schema)),l==="mark"&&(o=li(r,n.schema)),i&&t.selection.ranges.forEach(a=>{const u=a.$from.pos,c=a.$to.pos;n.doc.nodesBetween(u,c,(f,d)=>{s&&s===f.type&&t.setNodeMarkup(d,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(p=>{if(o===p.type){const g=Math.max(d,u),v=Math.min(d+f.nodeSize,c);t.addMark(g,v,o.create({...p.attrs,...e}))}})})}),!0):!1},SM=(r,e={})=>({state:t,dispatch:n})=>{const i=ut(r,t.schema);return ZS(i,e)(t,n)},bM=(r,e={})=>({state:t,dispatch:n})=>{const i=ut(r,t.schema);return eb(i,e)(t,n)};var MM=Object.freeze({__proto__:null,blur:pb,clearContent:mb,clearNodes:gb,command:yb,createParagraphNear:vb,deleteCurrentNode:xb,deleteNode:kb,deleteRange:wb,deleteSelection:Sb,enter:bb,exitCode:Mb,extendMarkRange:Cb,first:Eb,focus:Ab,forEach:Ob,insertContent:zb,insertContentAt:Rb,joinUp:Pb,joinDown:Bb,joinBackward:Lb,joinForward:Fb,keyboardShortcut:Vb,lift:Hb,liftEmptyBlock:qb,liftListItem:_b,newlineInCode:Ub,resetAttributes:Wb,scrollIntoView:jb,selectAll:Yb,selectNodeBackward:Jb,selectNodeForward:Kb,selectParentNode:Gb,selectTextblockEnd:Xb,selectTextblockStart:Qb,setContent:eM,setMark:oM,setMeta:lM,setNode:aM,setNodeSelection:uM,setTextSelection:cM,sinkListItem:fM,splitBlock:dM,splitListItem:hM,toggleList:pM,toggleMark:mM,toggleNode:gM,toggleWrap:yM,undoInputRule:vM,unsetAllMarks:xM,unsetMark:kM,updateAttributes:wM,wrapIn:SM,wrapInList:bM});jr.create({name:"commands",addCommands(){return{...MM}}});jr.create({name:"editable",addProseMirrorPlugins(){return[new Sl({key:new bl("editable"),props:{editable:()=>this.editor.options.editable}})]}});jr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new Sl({key:new bl("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}});jr.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:u}=l,{empty:c,$anchor:f}=a,{pos:d,parent:p}=f,g=me.atStart(u).from===d;return!c||!g||!p.type.isTextblock||p.textContent.length?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},s={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Ih()||U5()?s:i},addProseMirrorPlugins(){return[new Sl({key:new bl("clearDocument"),appendTransaction:(r,e,t)=>{if(!(r.some(g=>g.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:s,to:o}=e.selection,l=me.atStart(e.doc).from,a=me.atEnd(e.doc).to;if(i||!(s===l&&o===a)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const f=t.tr,d=H5({state:t,transaction:f}),{commands:p}=new ob({editor:this.editor,state:d});if(p.clearNodes(),!!f.steps.length)return f}})]}});jr.create({name:"tabindex",addProseMirrorPlugins(){return[new Sl({key:new bl("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});let TM=class rd{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=br(Vt(this,"addOptions",{name:this.name}))),this.storage=br(Vt(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new rd(e)}configure(e={}){const t=this.extend();return t.options=zh(this.options,e),t.storage=br(Vt(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new rd(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=br(Vt(t,"addOptions",{name:t.name})),t.storage=br(Vt(t,"addStorage",{name:t.name,options:t.options})),t}};class $t{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new $t(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}let Yn=class j5{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new j5(t,$t.range(this,e))}};class B{constructor(e,t){this.position=void 0;var n="KaTeX parse error: "+e,i,s=t&&t.loc;if(s&&s.start<=s.end){var o=s.lexer.input;i=s.start;var l=s.end;i===o.length?n+=" at end of input: ":n+=" at position "+(i+1)+": ";var a=o.slice(i,l).replace(/[^]/g,"$&̲"),u;i>15?u="…"+o.slice(i-15,i):u=o.slice(0,i);var c;l+15":">","<":"<",'"':""","'":"'"},zM=/[&><"']/g;function IM(r){return String(r).replace(zM,e=>OM[e])}var Y5=function r(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?r(e.body[0]):e:e.type==="font"?r(e.body):e},DM=function(e){var t=Y5(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},RM=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},PM=function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return t!=null?t[1]:"_relative"},G={contains:CM,deflt:EM,escape:IM,hyphenate:AM,getBaseElem:Y5,isCharacterBox:DM,protocolFromUrl:PM},za={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand ",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function BM(r){if(r.default)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Ph{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in za)if(za.hasOwnProperty(t)){var n=za[t];this[t]=e[t]!==void 0?n.processor?n.processor(e[t]):e[t]:BM(n)}}reportNonstrict(e,t,n){var i=this.strict;if(typeof i=="function"&&(i=i(e,t,n)),!(!i||i==="ignore")){if(i===!0||i==="error")throw new B("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),n);i==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,n){var i=this.strict;if(typeof i=="function")try{i=i(e,t,n)}catch{i="error"}return!i||i==="ignore"?!1:i===!0||i==="error"?!0:i==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+i+"': "+t+" ["+e+"]")),!1)}isTrusted(e){e.url&&!e.protocol&&(e.protocol=G.protocolFromUrl(e.url));var t=typeof this.trust=="function"?this.trust(e):this.trust;return!!t}}class Sn{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Br[LM[this.id]]}sub(){return Br[FM[this.id]]}fracNum(){return Br[$M[this.id]]}fracDen(){return Br[VM[this.id]]}cramp(){return Br[HM[this.id]]}text(){return Br[qM[this.id]]}isTight(){return this.size>=2}}var Bh=0,w0=1,Es=2,ln=3,hl=4,sr=5,Us=6,dt=7,Br=[new Sn(Bh,0,!1),new Sn(w0,0,!0),new Sn(Es,1,!1),new Sn(ln,1,!0),new Sn(hl,2,!1),new Sn(sr,2,!0),new Sn(Us,3,!1),new Sn(dt,3,!0)],LM=[hl,sr,hl,sr,Us,dt,Us,dt],FM=[sr,sr,sr,sr,dt,dt,dt,dt],$M=[Es,ln,hl,sr,Us,dt,Us,dt],VM=[ln,ln,sr,sr,dt,dt,dt,dt],HM=[w0,w0,ln,ln,sr,sr,dt,dt],qM=[Bh,w0,Es,ln,Es,ln,Es,ln],Y={DISPLAY:Br[Bh],TEXT:Br[Es],SCRIPT:Br[hl],SCRIPTSCRIPT:Br[Us]},nd=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function _M(r){for(var e=0;e=i[0]&&r<=i[1])return t.name}return null}var Ia=[];nd.forEach(r=>r.blocks.forEach(e=>Ia.push(...e)));function J5(r){for(var e=0;e=Ia[e]&&r<=Ia[e+1])return!0;return!1}var Gi=80,UM=function(e,t){return"M95,"+(622+e+t)+` c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 @@ -387,10 +387,21 @@ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6 c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Ml{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return G.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;tt.toText();return this.children.map(e).join("")}}var $r={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},ra={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},_m={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function eT(r,e){$r[r]=e}function Lh(r,e,t){if(!$r[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=$r[e][n];if(!i&&r[0]in _m&&(n=_m[r[0]].charCodeAt(0),i=$r[e][n]),!i&&t==="text"&&J5(n)&&(i=$r[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var gc={};function tT(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!gc[e]){var t=gc[e]={cssEmPerMu:ra.quad[e]/18};for(var n in ra)ra.hasOwnProperty(n)&&(t[n]=ra[n][e])}return gc[e]}var rT=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Um=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Wm=function(e,t){return t.size<2?e:rT[e-1][t.size-1]};class tn{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||tn.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Um[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new tn(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Wm(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Um[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Wm(tn.BASESIZE,e);return this.size===t&&this.textSize===tn.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==tn.BASESIZE?["sizing","reset-size"+this.size,"size"+tn.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=tT(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}tn.BASESIZE=6;var id={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},nT={ex:!0,em:!0,mu:!0},K5=function(e){return typeof e!="string"&&(e=e.unit),e in id||e in nT||e==="ex"},Ne=function(e,t){var n;if(e.unit in id)n=id[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new B("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},L=function(e){return+e.toFixed(4)+"em"},Xn=function(e){return e.filter(t=>t).join(" ")},G5=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},X5=function(e){var t=document.createElement(e);t.className=Xn(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var s=0;s",t};class Tl{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,G5.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return G.contains(this.classes,e)}toNode(){return X5.call(this,"span")}toMarkup(){return Q5.call(this,"span")}}class Fh{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,G5.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return G.contains(this.classes,e)}toNode(){return X5.call(this,"a")}toMarkup(){return Q5.call(this,"a")}}class iT{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return G.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=""+this.alt+"0&&(t=document.createElement("span"),t.style.marginRight=L(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Xn(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(t=t||document.createElement("span"),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=G.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+G.escape(n)+'"');var s=G.escape(this.text);return e?(t+=">",t+=s,t+="",t):s}}class hn{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(var i=0;i":""}}class sd{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e=" but got "+String(r)+".")}var lT={bin:1,close:1,inner:1,open:1,punct:1,rel:1},aT={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},ve={math:{},text:{}};function h(r,e,t,n,i,s){ve[r][i]={font:e,group:t,replace:n},s&&n&&(ve[r][n]=ve[r][i])}var m="math",D="text",y="main",b="ams",Te="accent-token",H="bin",xt="close",Gs="inner",J="mathord",$e="op-token",Yt="open",tu="punct",M="rel",vn="spacing",C="textord";h(m,y,M,"≡","\\equiv",!0);h(m,y,M,"≺","\\prec",!0);h(m,y,M,"≻","\\succ",!0);h(m,y,M,"∼","\\sim",!0);h(m,y,M,"⊥","\\perp");h(m,y,M,"⪯","\\preceq",!0);h(m,y,M,"⪰","\\succeq",!0);h(m,y,M,"≃","\\simeq",!0);h(m,y,M,"∣","\\mid",!0);h(m,y,M,"≪","\\ll",!0);h(m,y,M,"≫","\\gg",!0);h(m,y,M,"≍","\\asymp",!0);h(m,y,M,"∥","\\parallel");h(m,y,M,"⋈","\\bowtie",!0);h(m,y,M,"⌣","\\smile",!0);h(m,y,M,"⊑","\\sqsubseteq",!0);h(m,y,M,"⊒","\\sqsupseteq",!0);h(m,y,M,"≐","\\doteq",!0);h(m,y,M,"⌢","\\frown",!0);h(m,y,M,"∋","\\ni",!0);h(m,y,M,"∝","\\propto",!0);h(m,y,M,"⊢","\\vdash",!0);h(m,y,M,"⊣","\\dashv",!0);h(m,y,M,"∋","\\owns");h(m,y,tu,".","\\ldotp");h(m,y,tu,"⋅","\\cdotp");h(m,y,C,"#","\\#");h(D,y,C,"#","\\#");h(m,y,C,"&","\\&");h(D,y,C,"&","\\&");h(m,y,C,"ℵ","\\aleph",!0);h(m,y,C,"∀","\\forall",!0);h(m,y,C,"ℏ","\\hbar",!0);h(m,y,C,"∃","\\exists",!0);h(m,y,C,"∇","\\nabla",!0);h(m,y,C,"♭","\\flat",!0);h(m,y,C,"ℓ","\\ell",!0);h(m,y,C,"♮","\\natural",!0);h(m,y,C,"♣","\\clubsuit",!0);h(m,y,C,"℘","\\wp",!0);h(m,y,C,"♯","\\sharp",!0);h(m,y,C,"♢","\\diamondsuit",!0);h(m,y,C,"ℜ","\\Re",!0);h(m,y,C,"♡","\\heartsuit",!0);h(m,y,C,"ℑ","\\Im",!0);h(m,y,C,"♠","\\spadesuit",!0);h(m,y,C,"§","\\S",!0);h(D,y,C,"§","\\S");h(m,y,C,"¶","\\P",!0);h(D,y,C,"¶","\\P");h(m,y,C,"†","\\dag");h(D,y,C,"†","\\dag");h(D,y,C,"†","\\textdagger");h(m,y,C,"‡","\\ddag");h(D,y,C,"‡","\\ddag");h(D,y,C,"‡","\\textdaggerdbl");h(m,y,xt,"⎱","\\rmoustache",!0);h(m,y,Yt,"⎰","\\lmoustache",!0);h(m,y,xt,"⟯","\\rgroup",!0);h(m,y,Yt,"⟮","\\lgroup",!0);h(m,y,H,"∓","\\mp",!0);h(m,y,H,"⊖","\\ominus",!0);h(m,y,H,"⊎","\\uplus",!0);h(m,y,H,"⊓","\\sqcap",!0);h(m,y,H,"∗","\\ast");h(m,y,H,"⊔","\\sqcup",!0);h(m,y,H,"◯","\\bigcirc",!0);h(m,y,H,"∙","\\bullet",!0);h(m,y,H,"‡","\\ddagger");h(m,y,H,"≀","\\wr",!0);h(m,y,H,"⨿","\\amalg");h(m,y,H,"&","\\And");h(m,y,M,"⟵","\\longleftarrow",!0);h(m,y,M,"⇐","\\Leftarrow",!0);h(m,y,M,"⟸","\\Longleftarrow",!0);h(m,y,M,"⟶","\\longrightarrow",!0);h(m,y,M,"⇒","\\Rightarrow",!0);h(m,y,M,"⟹","\\Longrightarrow",!0);h(m,y,M,"↔","\\leftrightarrow",!0);h(m,y,M,"⟷","\\longleftrightarrow",!0);h(m,y,M,"⇔","\\Leftrightarrow",!0);h(m,y,M,"⟺","\\Longleftrightarrow",!0);h(m,y,M,"↦","\\mapsto",!0);h(m,y,M,"⟼","\\longmapsto",!0);h(m,y,M,"↗","\\nearrow",!0);h(m,y,M,"↩","\\hookleftarrow",!0);h(m,y,M,"↪","\\hookrightarrow",!0);h(m,y,M,"↘","\\searrow",!0);h(m,y,M,"↼","\\leftharpoonup",!0);h(m,y,M,"⇀","\\rightharpoonup",!0);h(m,y,M,"↙","\\swarrow",!0);h(m,y,M,"↽","\\leftharpoondown",!0);h(m,y,M,"⇁","\\rightharpoondown",!0);h(m,y,M,"↖","\\nwarrow",!0);h(m,y,M,"⇌","\\rightleftharpoons",!0);h(m,b,M,"≮","\\nless",!0);h(m,b,M,"","\\@nleqslant");h(m,b,M,"","\\@nleqq");h(m,b,M,"⪇","\\lneq",!0);h(m,b,M,"≨","\\lneqq",!0);h(m,b,M,"","\\@lvertneqq");h(m,b,M,"⋦","\\lnsim",!0);h(m,b,M,"⪉","\\lnapprox",!0);h(m,b,M,"⊀","\\nprec",!0);h(m,b,M,"⋠","\\npreceq",!0);h(m,b,M,"⋨","\\precnsim",!0);h(m,b,M,"⪹","\\precnapprox",!0);h(m,b,M,"≁","\\nsim",!0);h(m,b,M,"","\\@nshortmid");h(m,b,M,"∤","\\nmid",!0);h(m,b,M,"⊬","\\nvdash",!0);h(m,b,M,"⊭","\\nvDash",!0);h(m,b,M,"⋪","\\ntriangleleft");h(m,b,M,"⋬","\\ntrianglelefteq",!0);h(m,b,M,"⊊","\\subsetneq",!0);h(m,b,M,"","\\@varsubsetneq");h(m,b,M,"⫋","\\subsetneqq",!0);h(m,b,M,"","\\@varsubsetneqq");h(m,b,M,"≯","\\ngtr",!0);h(m,b,M,"","\\@ngeqslant");h(m,b,M,"","\\@ngeqq");h(m,b,M,"⪈","\\gneq",!0);h(m,b,M,"≩","\\gneqq",!0);h(m,b,M,"","\\@gvertneqq");h(m,b,M,"⋧","\\gnsim",!0);h(m,b,M,"⪊","\\gnapprox",!0);h(m,b,M,"⊁","\\nsucc",!0);h(m,b,M,"⋡","\\nsucceq",!0);h(m,b,M,"⋩","\\succnsim",!0);h(m,b,M,"⪺","\\succnapprox",!0);h(m,b,M,"≆","\\ncong",!0);h(m,b,M,"","\\@nshortparallel");h(m,b,M,"∦","\\nparallel",!0);h(m,b,M,"⊯","\\nVDash",!0);h(m,b,M,"⋫","\\ntriangleright");h(m,b,M,"⋭","\\ntrianglerighteq",!0);h(m,b,M,"","\\@nsupseteqq");h(m,b,M,"⊋","\\supsetneq",!0);h(m,b,M,"","\\@varsupsetneq");h(m,b,M,"⫌","\\supsetneqq",!0);h(m,b,M,"","\\@varsupsetneqq");h(m,b,M,"⊮","\\nVdash",!0);h(m,b,M,"⪵","\\precneqq",!0);h(m,b,M,"⪶","\\succneqq",!0);h(m,b,M,"","\\@nsubseteqq");h(m,b,H,"⊴","\\unlhd");h(m,b,H,"⊵","\\unrhd");h(m,b,M,"↚","\\nleftarrow",!0);h(m,b,M,"↛","\\nrightarrow",!0);h(m,b,M,"⇍","\\nLeftarrow",!0);h(m,b,M,"⇏","\\nRightarrow",!0);h(m,b,M,"↮","\\nleftrightarrow",!0);h(m,b,M,"⇎","\\nLeftrightarrow",!0);h(m,b,M,"△","\\vartriangle");h(m,b,C,"ℏ","\\hslash");h(m,b,C,"▽","\\triangledown");h(m,b,C,"◊","\\lozenge");h(m,b,C,"Ⓢ","\\circledS");h(m,b,C,"®","\\circledR");h(D,b,C,"®","\\circledR");h(m,b,C,"∡","\\measuredangle",!0);h(m,b,C,"∄","\\nexists");h(m,b,C,"℧","\\mho");h(m,b,C,"Ⅎ","\\Finv",!0);h(m,b,C,"⅁","\\Game",!0);h(m,b,C,"‵","\\backprime");h(m,b,C,"▲","\\blacktriangle");h(m,b,C,"▼","\\blacktriangledown");h(m,b,C,"■","\\blacksquare");h(m,b,C,"⧫","\\blacklozenge");h(m,b,C,"★","\\bigstar");h(m,b,C,"∢","\\sphericalangle",!0);h(m,b,C,"∁","\\complement",!0);h(m,b,C,"ð","\\eth",!0);h(D,y,C,"ð","ð");h(m,b,C,"╱","\\diagup");h(m,b,C,"╲","\\diagdown");h(m,b,C,"□","\\square");h(m,b,C,"□","\\Box");h(m,b,C,"◊","\\Diamond");h(m,b,C,"¥","\\yen",!0);h(D,b,C,"¥","\\yen",!0);h(m,b,C,"✓","\\checkmark",!0);h(D,b,C,"✓","\\checkmark");h(m,b,C,"ℶ","\\beth",!0);h(m,b,C,"ℸ","\\daleth",!0);h(m,b,C,"ℷ","\\gimel",!0);h(m,b,C,"ϝ","\\digamma",!0);h(m,b,C,"ϰ","\\varkappa");h(m,b,Yt,"┌","\\@ulcorner",!0);h(m,b,xt,"┐","\\@urcorner",!0);h(m,b,Yt,"└","\\@llcorner",!0);h(m,b,xt,"┘","\\@lrcorner",!0);h(m,b,M,"≦","\\leqq",!0);h(m,b,M,"⩽","\\leqslant",!0);h(m,b,M,"⪕","\\eqslantless",!0);h(m,b,M,"≲","\\lesssim",!0);h(m,b,M,"⪅","\\lessapprox",!0);h(m,b,M,"≊","\\approxeq",!0);h(m,b,H,"⋖","\\lessdot");h(m,b,M,"⋘","\\lll",!0);h(m,b,M,"≶","\\lessgtr",!0);h(m,b,M,"⋚","\\lesseqgtr",!0);h(m,b,M,"⪋","\\lesseqqgtr",!0);h(m,b,M,"≑","\\doteqdot");h(m,b,M,"≓","\\risingdotseq",!0);h(m,b,M,"≒","\\fallingdotseq",!0);h(m,b,M,"∽","\\backsim",!0);h(m,b,M,"⋍","\\backsimeq",!0);h(m,b,M,"⫅","\\subseteqq",!0);h(m,b,M,"⋐","\\Subset",!0);h(m,b,M,"⊏","\\sqsubset",!0);h(m,b,M,"≼","\\preccurlyeq",!0);h(m,b,M,"⋞","\\curlyeqprec",!0);h(m,b,M,"≾","\\precsim",!0);h(m,b,M,"⪷","\\precapprox",!0);h(m,b,M,"⊲","\\vartriangleleft");h(m,b,M,"⊴","\\trianglelefteq");h(m,b,M,"⊨","\\vDash",!0);h(m,b,M,"⊪","\\Vvdash",!0);h(m,b,M,"⌣","\\smallsmile");h(m,b,M,"⌢","\\smallfrown");h(m,b,M,"≏","\\bumpeq",!0);h(m,b,M,"≎","\\Bumpeq",!0);h(m,b,M,"≧","\\geqq",!0);h(m,b,M,"⩾","\\geqslant",!0);h(m,b,M,"⪖","\\eqslantgtr",!0);h(m,b,M,"≳","\\gtrsim",!0);h(m,b,M,"⪆","\\gtrapprox",!0);h(m,b,H,"⋗","\\gtrdot");h(m,b,M,"⋙","\\ggg",!0);h(m,b,M,"≷","\\gtrless",!0);h(m,b,M,"⋛","\\gtreqless",!0);h(m,b,M,"⪌","\\gtreqqless",!0);h(m,b,M,"≖","\\eqcirc",!0);h(m,b,M,"≗","\\circeq",!0);h(m,b,M,"≜","\\triangleq",!0);h(m,b,M,"∼","\\thicksim");h(m,b,M,"≈","\\thickapprox");h(m,b,M,"⫆","\\supseteqq",!0);h(m,b,M,"⋑","\\Supset",!0);h(m,b,M,"⊐","\\sqsupset",!0);h(m,b,M,"≽","\\succcurlyeq",!0);h(m,b,M,"⋟","\\curlyeqsucc",!0);h(m,b,M,"≿","\\succsim",!0);h(m,b,M,"⪸","\\succapprox",!0);h(m,b,M,"⊳","\\vartriangleright");h(m,b,M,"⊵","\\trianglerighteq");h(m,b,M,"⊩","\\Vdash",!0);h(m,b,M,"∣","\\shortmid");h(m,b,M,"∥","\\shortparallel");h(m,b,M,"≬","\\between",!0);h(m,b,M,"⋔","\\pitchfork",!0);h(m,b,M,"∝","\\varpropto");h(m,b,M,"◀","\\blacktriangleleft");h(m,b,M,"∴","\\therefore",!0);h(m,b,M,"∍","\\backepsilon");h(m,b,M,"▶","\\blacktriangleright");h(m,b,M,"∵","\\because",!0);h(m,b,M,"⋘","\\llless");h(m,b,M,"⋙","\\gggtr");h(m,b,H,"⊲","\\lhd");h(m,b,H,"⊳","\\rhd");h(m,b,M,"≂","\\eqsim",!0);h(m,y,M,"⋈","\\Join");h(m,b,M,"≑","\\Doteq",!0);h(m,b,H,"∔","\\dotplus",!0);h(m,b,H,"∖","\\smallsetminus");h(m,b,H,"⋒","\\Cap",!0);h(m,b,H,"⋓","\\Cup",!0);h(m,b,H,"⩞","\\doublebarwedge",!0);h(m,b,H,"⊟","\\boxminus",!0);h(m,b,H,"⊞","\\boxplus",!0);h(m,b,H,"⋇","\\divideontimes",!0);h(m,b,H,"⋉","\\ltimes",!0);h(m,b,H,"⋊","\\rtimes",!0);h(m,b,H,"⋋","\\leftthreetimes",!0);h(m,b,H,"⋌","\\rightthreetimes",!0);h(m,b,H,"⋏","\\curlywedge",!0);h(m,b,H,"⋎","\\curlyvee",!0);h(m,b,H,"⊝","\\circleddash",!0);h(m,b,H,"⊛","\\circledast",!0);h(m,b,H,"⋅","\\centerdot");h(m,b,H,"⊺","\\intercal",!0);h(m,b,H,"⋒","\\doublecap");h(m,b,H,"⋓","\\doublecup");h(m,b,H,"⊠","\\boxtimes",!0);h(m,b,M,"⇢","\\dashrightarrow",!0);h(m,b,M,"⇠","\\dashleftarrow",!0);h(m,b,M,"⇇","\\leftleftarrows",!0);h(m,b,M,"⇆","\\leftrightarrows",!0);h(m,b,M,"⇚","\\Lleftarrow",!0);h(m,b,M,"↞","\\twoheadleftarrow",!0);h(m,b,M,"↢","\\leftarrowtail",!0);h(m,b,M,"↫","\\looparrowleft",!0);h(m,b,M,"⇋","\\leftrightharpoons",!0);h(m,b,M,"↶","\\curvearrowleft",!0);h(m,b,M,"↺","\\circlearrowleft",!0);h(m,b,M,"↰","\\Lsh",!0);h(m,b,M,"⇈","\\upuparrows",!0);h(m,b,M,"↿","\\upharpoonleft",!0);h(m,b,M,"⇃","\\downharpoonleft",!0);h(m,y,M,"⊶","\\origof",!0);h(m,y,M,"⊷","\\imageof",!0);h(m,b,M,"⊸","\\multimap",!0);h(m,b,M,"↭","\\leftrightsquigarrow",!0);h(m,b,M,"⇉","\\rightrightarrows",!0);h(m,b,M,"⇄","\\rightleftarrows",!0);h(m,b,M,"↠","\\twoheadrightarrow",!0);h(m,b,M,"↣","\\rightarrowtail",!0);h(m,b,M,"↬","\\looparrowright",!0);h(m,b,M,"↷","\\curvearrowright",!0);h(m,b,M,"↻","\\circlearrowright",!0);h(m,b,M,"↱","\\Rsh",!0);h(m,b,M,"⇊","\\downdownarrows",!0);h(m,b,M,"↾","\\upharpoonright",!0);h(m,b,M,"⇂","\\downharpoonright",!0);h(m,b,M,"⇝","\\rightsquigarrow",!0);h(m,b,M,"⇝","\\leadsto");h(m,b,M,"⇛","\\Rrightarrow",!0);h(m,b,M,"↾","\\restriction");h(m,y,C,"‘","`");h(m,y,C,"$","\\$");h(D,y,C,"$","\\$");h(D,y,C,"$","\\textdollar");h(m,y,C,"%","\\%");h(D,y,C,"%","\\%");h(m,y,C,"_","\\_");h(D,y,C,"_","\\_");h(D,y,C,"_","\\textunderscore");h(m,y,C,"∠","\\angle",!0);h(m,y,C,"∞","\\infty",!0);h(m,y,C,"′","\\prime");h(m,y,C,"△","\\triangle");h(m,y,C,"Γ","\\Gamma",!0);h(m,y,C,"Δ","\\Delta",!0);h(m,y,C,"Θ","\\Theta",!0);h(m,y,C,"Λ","\\Lambda",!0);h(m,y,C,"Ξ","\\Xi",!0);h(m,y,C,"Π","\\Pi",!0);h(m,y,C,"Σ","\\Sigma",!0);h(m,y,C,"Υ","\\Upsilon",!0);h(m,y,C,"Φ","\\Phi",!0);h(m,y,C,"Ψ","\\Psi",!0);h(m,y,C,"Ω","\\Omega",!0);h(m,y,C,"A","Α");h(m,y,C,"B","Β");h(m,y,C,"E","Ε");h(m,y,C,"Z","Ζ");h(m,y,C,"H","Η");h(m,y,C,"I","Ι");h(m,y,C,"K","Κ");h(m,y,C,"M","Μ");h(m,y,C,"N","Ν");h(m,y,C,"O","Ο");h(m,y,C,"P","Ρ");h(m,y,C,"T","Τ");h(m,y,C,"X","Χ");h(m,y,C,"¬","\\neg",!0);h(m,y,C,"¬","\\lnot");h(m,y,C,"⊤","\\top");h(m,y,C,"⊥","\\bot");h(m,y,C,"∅","\\emptyset");h(m,b,C,"∅","\\varnothing");h(m,y,J,"α","\\alpha",!0);h(m,y,J,"β","\\beta",!0);h(m,y,J,"γ","\\gamma",!0);h(m,y,J,"δ","\\delta",!0);h(m,y,J,"ϵ","\\epsilon",!0);h(m,y,J,"ζ","\\zeta",!0);h(m,y,J,"η","\\eta",!0);h(m,y,J,"θ","\\theta",!0);h(m,y,J,"ι","\\iota",!0);h(m,y,J,"κ","\\kappa",!0);h(m,y,J,"λ","\\lambda",!0);h(m,y,J,"μ","\\mu",!0);h(m,y,J,"ν","\\nu",!0);h(m,y,J,"ξ","\\xi",!0);h(m,y,J,"ο","\\omicron",!0);h(m,y,J,"π","\\pi",!0);h(m,y,J,"ρ","\\rho",!0);h(m,y,J,"σ","\\sigma",!0);h(m,y,J,"τ","\\tau",!0);h(m,y,J,"υ","\\upsilon",!0);h(m,y,J,"ϕ","\\phi",!0);h(m,y,J,"χ","\\chi",!0);h(m,y,J,"ψ","\\psi",!0);h(m,y,J,"ω","\\omega",!0);h(m,y,J,"ε","\\varepsilon",!0);h(m,y,J,"ϑ","\\vartheta",!0);h(m,y,J,"ϖ","\\varpi",!0);h(m,y,J,"ϱ","\\varrho",!0);h(m,y,J,"ς","\\varsigma",!0);h(m,y,J,"φ","\\varphi",!0);h(m,y,H,"∗","*",!0);h(m,y,H,"+","+");h(m,y,H,"−","-",!0);h(m,y,H,"⋅","\\cdot",!0);h(m,y,H,"∘","\\circ",!0);h(m,y,H,"÷","\\div",!0);h(m,y,H,"±","\\pm",!0);h(m,y,H,"×","\\times",!0);h(m,y,H,"∩","\\cap",!0);h(m,y,H,"∪","\\cup",!0);h(m,y,H,"∖","\\setminus",!0);h(m,y,H,"∧","\\land");h(m,y,H,"∨","\\lor");h(m,y,H,"∧","\\wedge",!0);h(m,y,H,"∨","\\vee",!0);h(m,y,C,"√","\\surd");h(m,y,Yt,"⟨","\\langle",!0);h(m,y,Yt,"∣","\\lvert");h(m,y,Yt,"∥","\\lVert");h(m,y,xt,"?","?");h(m,y,xt,"!","!");h(m,y,xt,"⟩","\\rangle",!0);h(m,y,xt,"∣","\\rvert");h(m,y,xt,"∥","\\rVert");h(m,y,M,"=","=");h(m,y,M,":",":");h(m,y,M,"≈","\\approx",!0);h(m,y,M,"≅","\\cong",!0);h(m,y,M,"≥","\\ge");h(m,y,M,"≥","\\geq",!0);h(m,y,M,"←","\\gets");h(m,y,M,">","\\gt",!0);h(m,y,M,"∈","\\in",!0);h(m,y,M,"","\\@not");h(m,y,M,"⊂","\\subset",!0);h(m,y,M,"⊃","\\supset",!0);h(m,y,M,"⊆","\\subseteq",!0);h(m,y,M,"⊇","\\supseteq",!0);h(m,b,M,"⊈","\\nsubseteq",!0);h(m,b,M,"⊉","\\nsupseteq",!0);h(m,y,M,"⊨","\\models");h(m,y,M,"←","\\leftarrow",!0);h(m,y,M,"≤","\\le");h(m,y,M,"≤","\\leq",!0);h(m,y,M,"<","\\lt",!0);h(m,y,M,"→","\\rightarrow",!0);h(m,y,M,"→","\\to");h(m,b,M,"≱","\\ngeq",!0);h(m,b,M,"≰","\\nleq",!0);h(m,y,vn," ","\\ ");h(m,y,vn," ","\\space");h(m,y,vn," ","\\nobreakspace");h(D,y,vn," ","\\ ");h(D,y,vn," "," ");h(D,y,vn," ","\\space");h(D,y,vn," ","\\nobreakspace");h(m,y,vn,null,"\\nobreak");h(m,y,vn,null,"\\allowbreak");h(m,y,tu,",",",");h(m,y,tu,";",";");h(m,b,H,"⊼","\\barwedge",!0);h(m,b,H,"⊻","\\veebar",!0);h(m,y,H,"⊙","\\odot",!0);h(m,y,H,"⊕","\\oplus",!0);h(m,y,H,"⊗","\\otimes",!0);h(m,y,C,"∂","\\partial",!0);h(m,y,H,"⊘","\\oslash",!0);h(m,b,H,"⊚","\\circledcirc",!0);h(m,b,H,"⊡","\\boxdot",!0);h(m,y,H,"△","\\bigtriangleup");h(m,y,H,"▽","\\bigtriangledown");h(m,y,H,"†","\\dagger");h(m,y,H,"⋄","\\diamond");h(m,y,H,"⋆","\\star");h(m,y,H,"◃","\\triangleleft");h(m,y,H,"▹","\\triangleright");h(m,y,Yt,"{","\\{");h(D,y,C,"{","\\{");h(D,y,C,"{","\\textbraceleft");h(m,y,xt,"}","\\}");h(D,y,C,"}","\\}");h(D,y,C,"}","\\textbraceright");h(m,y,Yt,"{","\\lbrace");h(m,y,xt,"}","\\rbrace");h(m,y,Yt,"[","\\lbrack",!0);h(D,y,C,"[","\\lbrack",!0);h(m,y,xt,"]","\\rbrack",!0);h(D,y,C,"]","\\rbrack",!0);h(m,y,Yt,"(","\\lparen",!0);h(m,y,xt,")","\\rparen",!0);h(D,y,C,"<","\\textless",!0);h(D,y,C,">","\\textgreater",!0);h(m,y,Yt,"⌊","\\lfloor",!0);h(m,y,xt,"⌋","\\rfloor",!0);h(m,y,Yt,"⌈","\\lceil",!0);h(m,y,xt,"⌉","\\rceil",!0);h(m,y,C,"\\","\\backslash");h(m,y,C,"∣","|");h(m,y,C,"∣","\\vert");h(D,y,C,"|","\\textbar",!0);h(m,y,C,"∥","\\|");h(m,y,C,"∥","\\Vert");h(D,y,C,"∥","\\textbardbl");h(D,y,C,"~","\\textasciitilde");h(D,y,C,"\\","\\textbackslash");h(D,y,C,"^","\\textasciicircum");h(m,y,M,"↑","\\uparrow",!0);h(m,y,M,"⇑","\\Uparrow",!0);h(m,y,M,"↓","\\downarrow",!0);h(m,y,M,"⇓","\\Downarrow",!0);h(m,y,M,"↕","\\updownarrow",!0);h(m,y,M,"⇕","\\Updownarrow",!0);h(m,y,$e,"∐","\\coprod");h(m,y,$e,"⋁","\\bigvee");h(m,y,$e,"⋀","\\bigwedge");h(m,y,$e,"⨄","\\biguplus");h(m,y,$e,"⋂","\\bigcap");h(m,y,$e,"⋃","\\bigcup");h(m,y,$e,"∫","\\int");h(m,y,$e,"∫","\\intop");h(m,y,$e,"∬","\\iint");h(m,y,$e,"∭","\\iiint");h(m,y,$e,"∏","\\prod");h(m,y,$e,"∑","\\sum");h(m,y,$e,"⨂","\\bigotimes");h(m,y,$e,"⨁","\\bigoplus");h(m,y,$e,"⨀","\\bigodot");h(m,y,$e,"∮","\\oint");h(m,y,$e,"∯","\\oiint");h(m,y,$e,"∰","\\oiiint");h(m,y,$e,"⨆","\\bigsqcup");h(m,y,$e,"∫","\\smallint");h(D,y,Gs,"…","\\textellipsis");h(m,y,Gs,"…","\\mathellipsis");h(D,y,Gs,"…","\\ldots",!0);h(m,y,Gs,"…","\\ldots",!0);h(m,y,Gs,"⋯","\\@cdots",!0);h(m,y,Gs,"⋱","\\ddots",!0);h(m,y,C,"⋮","\\varvdots");h(m,y,Te,"ˊ","\\acute");h(m,y,Te,"ˋ","\\grave");h(m,y,Te,"¨","\\ddot");h(m,y,Te,"~","\\tilde");h(m,y,Te,"ˉ","\\bar");h(m,y,Te,"˘","\\breve");h(m,y,Te,"ˇ","\\check");h(m,y,Te,"^","\\hat");h(m,y,Te,"⃗","\\vec");h(m,y,Te,"˙","\\dot");h(m,y,Te,"˚","\\mathring");h(m,y,J,"","\\@imath");h(m,y,J,"","\\@jmath");h(m,y,C,"ı","ı");h(m,y,C,"ȷ","ȷ");h(D,y,C,"ı","\\i",!0);h(D,y,C,"ȷ","\\j",!0);h(D,y,C,"ß","\\ss",!0);h(D,y,C,"æ","\\ae",!0);h(D,y,C,"œ","\\oe",!0);h(D,y,C,"ø","\\o",!0);h(D,y,C,"Æ","\\AE",!0);h(D,y,C,"Œ","\\OE",!0);h(D,y,C,"Ø","\\O",!0);h(D,y,Te,"ˊ","\\'");h(D,y,Te,"ˋ","\\`");h(D,y,Te,"ˆ","\\^");h(D,y,Te,"˜","\\~");h(D,y,Te,"ˉ","\\=");h(D,y,Te,"˘","\\u");h(D,y,Te,"˙","\\.");h(D,y,Te,"¸","\\c");h(D,y,Te,"˚","\\r");h(D,y,Te,"ˇ","\\v");h(D,y,Te,"¨",'\\"');h(D,y,Te,"˝","\\H");h(D,y,Te,"◯","\\textcircled");var Z5={"--":!0,"---":!0,"``":!0,"''":!0};h(D,y,C,"–","--",!0);h(D,y,C,"–","\\textendash");h(D,y,C,"—","---",!0);h(D,y,C,"—","\\textemdash");h(D,y,C,"‘","`",!0);h(D,y,C,"‘","\\textquoteleft");h(D,y,C,"’","'",!0);h(D,y,C,"’","\\textquoteright");h(D,y,C,"“","``",!0);h(D,y,C,"“","\\textquotedblleft");h(D,y,C,"”","''",!0);h(D,y,C,"”","\\textquotedblright");h(m,y,C,"°","\\degree",!0);h(D,y,C,"°","\\degree");h(D,y,C,"°","\\textdegree",!0);h(m,y,C,"£","\\pounds");h(m,y,C,"£","\\mathsterling",!0);h(D,y,C,"£","\\pounds");h(D,y,C,"£","\\textsterling",!0);h(m,b,C,"✠","\\maltese");h(D,b,C,"✠","\\maltese");var Ym='0123456789/@."';for(var yc=0;yc{if(Xn(r.classes)!==Xn(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n in r.style)if(r.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&r.style[i]!==e.style[i])return!1;return!0},pT=r=>{for(var e=0;et&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},wt=function(e,t,n,i){var s=new Tl(e,t,n,i);return $h(s),s},e6=(r,e,t,n)=>new Tl(r,e,t,n),mT=function(e,t,n){var i=wt([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=L(i.height),i.maxFontSize=1,i},gT=function(e,t,n,i){var s=new Fh(e,t,n,i);return $h(s),s},t6=function(e){var t=new Ml(e);return $h(t),t},yT=function(e,t){return e instanceof Ml?wt([],[e],t):e},vT=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,s=i,o=1;o{var t=wt(["mspace"],[],e),n=Ne(r,e);return t.style.marginRight=L(n),t},oa=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",i+"-"+s},r6={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},n6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},wT=function(e,t){var[n,i,s]=n6[e],o=new Qn(n),l=new hn([o],{width:L(i),height:L(s),style:"width:"+L(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),a=e6(["overlay"],[l],t);return a.height=s,a.style.height=L(s),a.style.width=L(i),a},N={fontMap:r6,makeSymbol:vr,mathsym:cT,makeSpan:wt,makeSvgSpan:e6,makeLineSpan:mT,makeAnchor:gT,makeFragment:t6,wrapFragment:yT,makeVList:xT,makeOrd:dT,makeGlue:kT,staticSvg:wT,svgData:n6,tryCombineChars:pT},Ce={number:3,unit:"mu"},ci={number:4,unit:"mu"},Gr={number:5,unit:"mu"},ST={mord:{mop:Ce,mbin:ci,mrel:Gr,minner:Ce},mop:{mord:Ce,mop:Ce,mrel:Gr,minner:Ce},mbin:{mord:ci,mop:ci,mopen:ci,minner:ci},mrel:{mord:Gr,mop:Gr,mopen:Gr,minner:Gr},mopen:{},mclose:{mop:Ce,mbin:ci,mrel:Gr,minner:Ce},mpunct:{mord:Ce,mop:Ce,mrel:Gr,mopen:Ce,mclose:Ce,mpunct:Ce,minner:Ce},minner:{mord:Ce,mop:Ce,mbin:ci,mrel:Gr,mopen:Ce,mpunct:Ce,minner:Ce}},bT={mord:{mop:Ce},mop:{mord:Ce,mop:Ce},mbin:{},mrel:{},mopen:{},mclose:{mop:Ce},mpunct:{},minner:{mop:Ce}},i6={},b0={},M0={};function $(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,l={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},a=0;a{var T=v.classes[0],x=g.classes[0];T==="mbin"&&G.contains(TT,x)?v.classes[0]="mord":x==="mbin"&&G.contains(MT,T)&&(g.classes[0]="mord")},{node:f},d,p),Qm(s,(g,v)=>{var T=ld(v),x=ld(g),w=T&&x?g.hasClass("mtight")?bT[T][x]:ST[T][x]:null;if(w)return N.makeGlue(w,u)},{node:f},d,p),s},Qm=function r(e,t,n,i,s){i&&e.push(i);for(var o=0;od=>{e.splice(f+1,0,d),o++})(o)}i&&e.pop()},s6=function(e){return e instanceof Ml||e instanceof Fh||e instanceof Tl&&e.hasClass("enclosing")?e:null},NT=function r(e,t){var n=s6(e);if(n){var i=n.children;if(i.length){if(t==="right")return r(i[i.length-1],"right");if(t==="left")return r(i[0],"left")}}return e},ld=function(e,t){return e?(t&&(e=NT(e,t)),ET[e.classes[0]]||null):null},pl=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return pn(t.concat(n))},ae=function(e,t,n){if(!e)return pn();if(b0[e.type]){var i=b0[e.type](e,t);if(n&&t.size!==n.size){i=pn(t.sizingClasses(n),[i],t);var s=t.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new B("Got group of unknown type: '"+e.type+"'")};function la(r,e){var t=pn(["base"],r,e),n=pn(["strut"]);return n.style.height=L(t.height+t.depth),t.depth&&(n.style.verticalAlign=L(-t.depth)),t.children.unshift(n),t}function ad(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=We(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],o=[],l=0;l0&&(s.push(la(o,e)),o=[]),s.push(n[l]));o.length>0&&s.push(la(o,e));var u;t?(u=la(We(t,e,!0)),u.classes=["tag"],s.push(u)):i&&s.push(i);var c=pn(["katex-html"],s);if(c.setAttribute("aria-hidden","true"),u){var f=u.children[0];f.style.height=L(c.height+c.depth),c.depth&&(f.style.verticalAlign=L(-c.depth))}return c}function o6(r){return new Ml(r)}class rr{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Xn(this.classes));for(var n=0;n0&&(e+=' class ="'+G.escape(Xn(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Vo{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return G.escape(this.toText())}toText(){return this.text}}class AT{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",L(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var R={MathNode:rr,TextNode:Vo,SpaceNode:AT,newDocumentFragment:o6},fr=function(e,t,n){return ve[t][e]&&ve[t][e].replace&&e.charCodeAt(0)!==55349&&!(Z5.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ve[t][e].replace),new R.TextNode(e)},Vh=function(e){return e.length===1?e[0]:new R.MathNode("mrow",e)},Hh=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(G.contains(["\\imath","\\jmath"],s))return null;ve[i][s]&&ve[i][s].replace&&(s=ve[i][s].replace);var o=N.fontMap[n].fontName;return Lh(s,o,i)?N.fontMap[n].variant:null},Dt=function(e,t,n){if(e.length===1){var i=ge(e[0],t);return n&&i instanceof rr&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,l=0;l0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),s.pop())}}}s.push(a),o=a}return s},Zn=function(e,t,n){return Vh(Dt(e,t,n))},ge=function(e,t){if(!e)return new R.MathNode("mrow");if(M0[e.type]){var n=M0[e.type](e,t);return n}else throw new B("Got group of unknown type: '"+e.type+"'")};function Zm(r,e,t,n,i){var s=Dt(r,t),o;s.length===1&&s[0]instanceof rr&&G.contains(["mrow","mtable"],s[0].type)?o=s[0]:o=new R.MathNode("mrow",s);var l=new R.MathNode("annotation",[new R.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var a=new R.MathNode("semantics",[o,l]),u=new R.MathNode("math",[a]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var c=i?"katex":"katex-mathml";return N.makeSpan([c],[u])}var l6=function(e){return new tn({style:e.displayMode?Y.DISPLAY:Y.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},a6=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=N.makeSpan(n,[e])}return e},OT=function(e,t,n){var i=l6(n),s;if(n.output==="mathml")return Zm(e,t,i,n.displayMode,!0);if(n.output==="html"){var o=ad(e,i);s=N.makeSpan(["katex"],[o])}else{var l=Zm(e,t,i,n.displayMode,!1),a=ad(e,i);s=N.makeSpan(["katex"],[l,a])}return a6(s,n)},zT=function(e,t,n){var i=l6(n),s=ad(e,i),o=N.makeSpan(["katex"],[s]);return a6(o,n)},IT={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},DT=function(e){var t=new R.MathNode("mo",[new R.TextNode(IT[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},RT={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},PT=function(e){return e.type==="ordgroup"?e.body.length:1},BT=function(e,t){function n(){var l=4e5,a=e.label.slice(1);if(G.contains(["widehat","widecheck","widetilde","utilde"],a)){var u=e,c=PT(u.base),f,d,p;if(c>5)a==="widehat"||a==="widecheck"?(f=420,l=2364,p=.42,d=a+"4"):(f=312,l=2340,p=.34,d="tilde4");else{var g=[1,1,2,2,3,3][c];a==="widehat"||a==="widecheck"?(l=[0,1062,2364,2364,2364][g],f=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],d=a+g):(l=[0,600,1033,2339,2340][g],f=[0,260,286,306,312][g],p=[0,.26,.286,.3,.306,.34][g],d="tilde"+g)}var v=new Qn(d),T=new hn([v],{width:"100%",height:L(p),viewBox:"0 0 "+l+" "+f,preserveAspectRatio:"none"});return{span:N.makeSvgSpan([],[T],t),minWidth:0,height:p}}else{var x=[],w=RT[a],[S,E,A]=w,z=A/1e3,I=S.length,O,W;if(I===1){var K=w[3];O=["hide-tail"],W=[K]}else if(I===2)O=["halfarrow-left","halfarrow-right"],W=["xMinYMin","xMaxYMin"];else if(I===3)O=["brace-left","brace-center","brace-right"],W=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+I+" children.");for(var de=0;de0&&(i.style.minWidth=L(s)),i},LT=function(e,t,n,i,s){var o,l=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=N.makeSpan(["stretchy",t],[],s),t==="fbox"){var a=s.color&&s.getColor();a&&(o.style.borderColor=a)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new sd({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new sd({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new hn(u,{width:"100%",height:L(l)});o=N.makeSvgSpan([],[c],s)}return o.height=l,o.style.height=L(l),o},mn={encloseSpan:LT,mathMLnode:DT,svgSpan:BT};function re(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function qh(r){var e=nu(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function nu(r){return r&&(r.type==="atom"||aT.hasOwnProperty(r.type))?r:null}var _h=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=re(r.base,"accent"),t=n.base,r.base=t,i=oT(ae(r,e)),r.base=n):(n=re(r,"accent"),t=n.base);var s=ae(t,e.havingCrampedStyle()),o=n.isShifty&&G.isCharacterBox(t),l=0;if(o){var a=G.getBaseElem(t),u=ae(a,e.havingCrampedStyle());l=jm(u).skew}var c=n.label==="\\c",f=c?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),d;if(n.isStretchy)d=mn.svgSpan(n,e),d=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:d,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+L(2*l)+")",marginLeft:L(2*l)}:void 0}]},e);else{var p,g;n.label==="\\vec"?(p=N.staticSvg("vec",e),g=N.svgData.vec[1]):(p=N.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=jm(p),p.italic=0,g=p.width,c&&(f+=p.depth)),d=N.makeSpan(["accent-body"],[p]);var v=n.label==="\\textcircled";v&&(d.classes.push("accent-full"),f=s.height);var T=l;v||(T-=g/2),d.style.left=L(T),n.label==="\\textcircled"&&(d.style.top=".2em"),d=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-f},{type:"elem",elem:d}]},e)}var x=N.makeSpan(["mord","accent"],[d],e);return i?(i.children[0]=x,i.height=Math.max(x.height,i.height),i.classes[0]="mord",i):x},u6=(r,e)=>{var t=r.isStretchy?mn.mathMLnode(r.label):new R.MathNode("mo",[fr(r.label,r.mode)]),n=new R.MathNode("mover",[ge(r.base,e),t]);return n.setAttribute("accent","true"),n},FT=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));$({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=T0(e[0]),n=!FT.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:_h,mathmlBuilder:u6});$({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:_h,mathmlBuilder:u6});$({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=ae(r.base,e),n=mn.svgSpan(r,e),i=r.label==="\\utilde"?.12:0,s=N.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]},e);return N.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=mn.mathMLnode(r.label),n=new R.MathNode("munder",[ge(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var aa=r=>{var e=new R.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};$({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=N.wrapFragment(ae(r.body,n,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;r.below&&(n=e.havingStyle(t.sub()),o=N.wrapFragment(ae(r.below,n,e),e),o.classes.push(s+"-arrow-pad"));var l=mn.svgSpan(r,e),a=-e.fontMetrics().axisHeight+.5*l.height,u=-e.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(u-=i.depth);var c;if(o){var f=-e.fontMetrics().axisHeight+o.height+.5*l.height+.111;c=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:a},{type:"elem",elem:o,shift:f}]},e)}else c=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:a}]},e);return c.children[0].children[0].children[1].classes.push("svg-align"),N.makeSpan(["mrel","x-arrow"],[c],e)},mathmlBuilder(r,e){var t=mn.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=aa(ge(r.body,e));if(r.below){var s=aa(ge(r.below,e));n=new R.MathNode("munderover",[t,s,i])}else n=new R.MathNode("mover",[t,i])}else if(r.below){var o=aa(ge(r.below,e));n=new R.MathNode("munder",[t,o])}else n=aa(),n=new R.MathNode("mover",[t,n]);return n}});var $T=N.makeSpan;function c6(r,e){var t=We(r.body,e,!0);return $T([r.mclass],t,e)}function f6(r,e){var t,n=Dt(r.body,e);return r.mclass==="minner"?t=new R.MathNode("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new R.MathNode("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new R.MathNode("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}$({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:Be(i),isCharacterBox:G.isCharacterBox(i)}},htmlBuilder:c6,mathmlBuilder:f6});var iu=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};$({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:iu(e[0]),body:Be(e[1]),isCharacterBox:G.isCharacterBox(e[1])}}});$({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],s=e[0],o;n!=="\\stackrel"?o=iu(i):o="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Be(i)},a={type:"supsub",mode:s.mode,base:l,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[a],isCharacterBox:G.isCharacterBox(a)}},htmlBuilder:c6,mathmlBuilder:f6});$({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:iu(e[0]),body:Be(e[0])}},htmlBuilder(r,e){var t=We(r.body,e,!0),n=N.makeSpan([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=Dt(r.body,e),n=new R.MathNode("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var VT={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},e4=()=>({type:"styling",body:[],mode:"math",style:"display"}),t4=r=>r.type==="textord"&&r.text==="@",HT=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function qT(r,e,t){var n=VT[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),l=t.callFunction("\\\\cdright",[e[1]],[]),a={type:"ordgroup",mode:"math",body:[i,o,l]};return t.callFunction("\\\\cdparent",[a],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function _T(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new B("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],s=0;s-1))if("<>AV".indexOf(u)>-1)for(var f=0;f<2;f++){for(var d=!0,p=a+1;pAV=|." after @',o[a]);var g=qT(u,c,r),v={type:"styling",body:[g],mode:"math",style:"display"};n.push(v),l=e4()}s%2===0?n.push(l):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var T=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:T,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}$({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=N.wrapFragment(ae(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=L(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new R.MathNode("mrow",[ge(r.label,e)]);return t=new R.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new R.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});$({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=N.wrapFragment(ae(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new R.MathNode("mrow",[ge(r.fragment,e)])}});$({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=re(e[0],"ordgroup"),i=n.body,s="",o=0;o=1114111)throw new B("\\@char with invalid code point "+s);return a<=65535?u=String.fromCharCode(a):(a-=65536,u=String.fromCharCode((a>>10)+55296,(a&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var d6=(r,e)=>{var t=We(r.body,e.withColor(r.color),!1);return N.makeFragment(t)},h6=(r,e)=>{var t=Dt(r.body,e.withColor(r.color)),n=new R.MathNode("mstyle",t);return n.setAttribute("mathcolor",r.color),n};$({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=re(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:Be(i)}},htmlBuilder:d6,mathmlBuilder:h6});$({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=re(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:s}},htmlBuilder:d6,mathmlBuilder:h6});$({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&re(i,"size").value}},htmlBuilder(r,e){var t=N.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=L(Ne(r.size,e)))),t},mathmlBuilder(r,e){var t=new R.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",L(Ne(r.size,e)))),t}});var ud={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},p6=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new B("Expected a control sequence",r);return e},UT=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},m6=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};$({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(ud[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=ud[n.text]),re(e.parseFunction(),"internal");throw new B("Invalid token after macro prefix",n)}});$({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B("Expected a control sequence",n);for(var s=0,o,l=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),l[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new B('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new B('Argument number "'+n.text+'" out of order');s++,l.push([])}else{if(n.text==="EOF")throw new B("Expected a macro definition");l[s].push(n.text)}var{tokens:a}=e.gullet.consumeArg();return o&&a.unshift(o),(t==="\\edef"||t==="\\xdef")&&(a=e.gullet.expandTokens(a),a.reverse()),e.gullet.macros.set(i,{tokens:a,numArgs:s,delimiters:l},t===ud[t]),{type:"internal",mode:e.mode}}});$({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=p6(e.gullet.popToken());e.gullet.consumeSpaces();var i=UT(e);return m6(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});$({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=p6(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return m6(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Mo=function(e,t,n){var i=ve.math[e]&&ve.math[e].replace,s=Lh(i||e,t,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},Uh=function(e,t,n,i){var s=n.havingBaseStyle(t),o=N.makeSpan(i.concat(s.sizingClasses(n)),[e],n),l=s.sizeMultiplier/n.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=s.sizeMultiplier,o},g6=function(e,t,n){var i=t.havingBaseStyle(n),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=L(s),e.height-=s,e.depth+=s},WT=function(e,t,n,i,s,o){var l=N.makeSymbol(e,"Main-Regular",s,i),a=Uh(l,t,i,o);return n&&g6(a,i,t),a},jT=function(e,t,n,i){return N.makeSymbol(e,"Size"+t+"-Regular",n,i)},y6=function(e,t,n,i,s,o){var l=jT(e,t,s,i),a=Uh(N.makeSpan(["delimsizing","size"+t],[l],i),Y.TEXT,i,o);return n&&g6(a,i,Y.TEXT),a},wc=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=N.makeSpan(["delimsizinginner",i],[N.makeSpan([],[N.makeSymbol(e,t,n)])]);return{type:"elem",elem:s}},Sc=function(e,t,n){var i=$r["Size4-Regular"][e.charCodeAt(0)]?$r["Size4-Regular"][e.charCodeAt(0)][4]:$r["Size1-Regular"][e.charCodeAt(0)][4],s=new Qn("inner",QM(e,Math.round(1e3*t))),o=new hn([s],{width:L(i),height:L(t),style:"width:"+L(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),l=N.makeSvgSpan([],[o],n);return l.height=t,l.style.height=L(t),l.style.width=L(i),{type:"elem",elem:l}},cd=.008,ua={type:"kern",size:-1*cd},YT=["|","\\lvert","\\rvert","\\vert"],JT=["\\|","\\lVert","\\rVert","\\Vert"],v6=function(e,t,n,i,s,o){var l,a,u,c,f="",d=0;l=u=c=e,a=null;var p="Size1-Regular";e==="\\uparrow"?u=c="⏐":e==="\\Uparrow"?u=c="‖":e==="\\downarrow"?l=u="⏐":e==="\\Downarrow"?l=u="‖":e==="\\updownarrow"?(l="\\uparrow",u="⏐",c="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",u="‖",c="\\Downarrow"):G.contains(YT,e)?(u="∣",f="vert",d=333):G.contains(JT,e)?(u="∥",f="doublevert",d=556):e==="["||e==="\\lbrack"?(l="⎡",u="⎢",c="⎣",p="Size4-Regular",f="lbrack",d=667):e==="]"||e==="\\rbrack"?(l="⎤",u="⎥",c="⎦",p="Size4-Regular",f="rbrack",d=667):e==="\\lfloor"||e==="⌊"?(u=l="⎢",c="⎣",p="Size4-Regular",f="lfloor",d=667):e==="\\lceil"||e==="⌈"?(l="⎡",u=c="⎢",p="Size4-Regular",f="lceil",d=667):e==="\\rfloor"||e==="⌋"?(u=l="⎥",c="⎦",p="Size4-Regular",f="rfloor",d=667):e==="\\rceil"||e==="⌉"?(l="⎤",u=c="⎥",p="Size4-Regular",f="rceil",d=667):e==="("||e==="\\lparen"?(l="⎛",u="⎜",c="⎝",p="Size4-Regular",f="lparen",d=875):e===")"||e==="\\rparen"?(l="⎞",u="⎟",c="⎠",p="Size4-Regular",f="rparen",d=875):e==="\\{"||e==="\\lbrace"?(l="⎧",a="⎨",c="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",a="⎬",c="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",c="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",c="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",c="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",c="⎩",u="⎪",p="Size4-Regular");var g=Mo(l,p,s),v=g.height+g.depth,T=Mo(u,p,s),x=T.height+T.depth,w=Mo(c,p,s),S=w.height+w.depth,E=0,A=1;if(a!==null){var z=Mo(a,p,s);E=z.height+z.depth,A=2}var I=v+S+E,O=Math.max(0,Math.ceil((t-I)/(A*x))),W=I+O*A*x,K=i.fontMetrics().axisHeight;n&&(K*=i.sizeMultiplier);var de=W/2-K,xe=[];if(f.length>0){var Rt=W-v-S,Ge=Math.round(W*1e3),Pt=ZM(f,Math.round(Rt*1e3)),Jt=new Qn(f,Pt),Nr=(d/1e3).toFixed(3)+"em",V=(Ge/1e3).toFixed(3)+"em",Q=new hn([Jt],{width:Nr,height:V,viewBox:"0 0 "+d+" "+Ge}),X=N.makeSvgSpan([],[Q],i);X.height=Ge/1e3,X.style.width=Nr,X.style.height=V,xe.push({type:"elem",elem:X})}else{if(xe.push(wc(c,p,s)),xe.push(ua),a===null){var ce=W-v-S+2*cd;xe.push(Sc(u,ce,i))}else{var ue=(W-v-S-E)/2+2*cd;xe.push(Sc(u,ue,i)),xe.push(ua),xe.push(wc(a,p,s)),xe.push(ua),xe.push(Sc(u,ue,i))}xe.push(ua),xe.push(wc(l,p,s))}var Ar=i.havingBaseStyle(Y.TEXT),hr=N.makeVList({positionType:"bottom",positionData:de,children:xe},Ar);return Uh(N.makeSpan(["delimsizing","mult"],[hr],Ar),Y.TEXT,i,o)},bc=80,Mc=.08,Tc=function(e,t,n,i,s){var o=XM(e,i,n),l=new Qn(e,o),a=new hn([l],{width:"400em",height:L(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return N.makeSvgSpan(["hide-tail"],[a],s)},KT=function(e,t){var n=t.havingBaseSizing(),i=S6("\\surd",e*n.sizeMultiplier,w6,n),s=n.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l,a=0,u=0,c=0,f;return i.type==="small"?(c=1e3+1e3*o+bc,e<1?s=1:e<1.4&&(s=.7),a=(1+o+Mc)/s,u=(1+o)/s,l=Tc("sqrtMain",a,c,o,t),l.style.minWidth="0.853em",f=.833/s):i.type==="large"?(c=(1e3+bc)*Ho[i.size],u=(Ho[i.size]+o)/s,a=(Ho[i.size]+o+Mc)/s,l=Tc("sqrtSize"+i.size,a,c,o,t),l.style.minWidth="1.02em",f=1/s):(a=e+o+Mc,u=e+o,c=Math.floor(1e3*e+o)+bc,l=Tc("sqrtTall",a,c,o,t),l.style.minWidth="0.742em",f=1.056),l.height=u,l.style.height=L(a),{span:l,advanceWidth:f,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},x6=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],GT=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],k6=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ho=[0,1.2,1.8,2.4,3],XT=function(e,t,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),G.contains(x6,e)||G.contains(k6,e))return y6(e,t,!1,n,i,s);if(G.contains(GT,e))return v6(e,Ho[t],!1,n,i,s);throw new B("Illegal delimiter: '"+e+"'")},QT=[{type:"small",style:Y.SCRIPTSCRIPT},{type:"small",style:Y.SCRIPT},{type:"small",style:Y.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ZT=[{type:"small",style:Y.SCRIPTSCRIPT},{type:"small",style:Y.SCRIPT},{type:"small",style:Y.TEXT},{type:"stack"}],w6=[{type:"small",style:Y.SCRIPTSCRIPT},{type:"small",style:Y.SCRIPT},{type:"small",style:Y.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],eC=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},S6=function(e,t,n,i){for(var s=Math.min(2,3-i.style.size),o=s;ot)return n[o]}return n[n.length-1]},b6=function(e,t,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;G.contains(k6,e)?l=QT:G.contains(x6,e)?l=w6:l=ZT;var a=S6(e,t,l,i);return a.type==="small"?WT(e,a.style,n,i,s,o):a.type==="large"?y6(e,a.size,n,i,s,o):v6(e,t,n,i,s,o)},tC=function(e,t,n,i,s,o){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,a=901,u=5/i.fontMetrics().ptPerEm,c=Math.max(t-l,n+l),f=Math.max(c/500*a,2*c-u);return b6(e,f,!0,i,s,o)},an={sqrtImage:KT,sizedDelim:XT,sizeToMaxHeight:Ho,customSizedDelim:b6,leftRightDelim:tC},r4={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},rC=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function su(r,e){var t=nu(r);if(t&&G.contains(rC,t.text))return t;throw t?new B("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new B("Invalid delimiter type '"+r.type+"'",r)}$({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=su(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:r4[r.funcName].size,mclass:r4[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?N.makeSpan([r.mclass]):an.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(fr(r.delim,r.mode));var t=new R.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=L(an.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function n4(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}$({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new B("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:su(e[0],r).text,color:t}}});$({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=su(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=re(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{n4(r);for(var t=We(r.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o{n4(r);var t=Dt(r.body,e);if(r.left!=="."){var n=new R.MathNode("mo",[fr(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new R.MathNode("mo",[fr(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return Vh(t)}});$({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=su(e[0],r);if(!r.parser.leftrightDepth)throw new B("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=pl(e,[]);else{t=an.sizedDelim(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?fr("|","text"):fr(r.delim,r.mode),n=new R.MathNode("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var Wh=(r,e)=>{var t=N.wrapFragment(ae(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,s,o=0,l=G.isCharacterBox(r.body);if(n==="sout")s=N.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var a=Ne({number:.6,unit:"pt"},e),u=Ne({number:.35,unit:"ex"},e),c=e.havingBaseSizing();i=i/c.sizeMultiplier;var f=t.height+t.depth+a+u;t.style.paddingLeft=L(f/2+a);var d=Math.floor(1e3*f*i),p=KM(d),g=new hn([new Qn("phase",p)],{width:"400em",height:L(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});s=N.makeSvgSpan(["hide-tail"],[g],e),s.style.height=L(f),o=t.depth+a+u}else{/cancel/.test(n)?l||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var v=0,T=0,x=0;/box/.test(n)?(x=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),v=e.fontMetrics().fboxsep+(n==="colorbox"?0:x),T=v):n==="angl"?(x=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),v=4*x,T=Math.max(0,.25-t.depth)):(v=l?.2:0,T=v),s=mn.encloseSpan(t,n,v,T,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=L(x)):n==="angl"&&x!==.049&&(s.style.borderTopWidth=L(x),s.style.borderRightWidth=L(x)),o=t.depth+T,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var w;if(r.backgroundColor)w=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var S=/cancel|phase/.test(n)?["svg-align"]:[];w=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:S}]},e)}return/cancel/.test(n)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(n)&&!l?N.makeSpan(["mord","cancel-lap"],[w],e):N.makeSpan(["mord"],[w],e)},jh=(r,e)=>{var t=0,n=new R.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ge(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(r.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};$({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=re(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:Wh,mathmlBuilder:jh});$({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=re(e[0],"color-token").color,o=re(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:l}},htmlBuilder:Wh,mathmlBuilder:jh});$({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});$({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Wh,mathmlBuilder:jh});$({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var M6={};function Yr(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,l={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},a=0;a{var e=r.parser.settings;if(!e.displayMode)throw new B("{"+r.envName+"} can be used only in display mode.")};function Yh(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function ai(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:l,autoTag:a,singleRow:u,emptySingleRow:c,maxNumCols:f,leqno:d}=e;if(r.gullet.beginGroup(),u||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=r.gullet.expandMacroAsText("\\arraystretch");if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B("Invalid \\arraystretch: "+p)}r.gullet.beginGroup();var g=[],v=[g],T=[],x=[],w=a!=null?[]:void 0;function S(){a&&r.gullet.macros.set("\\@eqnsw","1",!0)}function E(){w&&(r.gullet.macros.get("\\df@tag")?(w.push(r.subparse([new Yn("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!a&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(S(),x.push(i4(r));;){var A=r.parseExpression(!1,u?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),A={type:"ordgroup",mode:r.mode,body:A},t&&(A={type:"styling",mode:r.mode,style:t,body:[A]}),g.push(A);var z=r.fetch().text;if(z==="&"){if(f&&g.length===f){if(u||l)throw new B("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(z==="\\end"){E(),g.length===1&&A.type==="styling"&&A.body[0].body.length===0&&(v.length>1||!c)&&v.pop(),x.length0&&(S+=.25),u.push({pos:S,isDashed:Ol[zl]})}for(E(o[0]),n=0;n0&&(de+=w,IOl))for(n=0;n=l)){var pr=void 0;(i>0||e.hskipBeforeAndAfter)&&(pr=G.deflt(ue.pregap,d),pr!==0&&(Pt=N.makeSpan(["arraycolsep"],[]),Pt.style.width=L(pr),Ge.push(Pt)));var Yi=[];for(n=0;n0){for(var G6=N.makeLineSpan("hline",t,c),X6=N.makeLineSpan("hdashline",t,c),uu=[{type:"elem",elem:a,shift:0}];u.length>0;){var op=u.pop(),lp=op.pos-xe;op.isDashed?uu.push({type:"elem",elem:X6,shift:lp}):uu.push({type:"elem",elem:G6,shift:lp})}a=N.makeVList({positionType:"individualShift",children:uu},t)}if(Nr.length===0)return N.makeSpan(["mord"],[a],t);var cu=N.makeVList({positionType:"individualShift",children:Nr},t);return cu=N.makeSpan(["tag"],[cu],t),N.makeFragment([a,cu])},nC={c:"center ",l:"left ",r:"right "},Kr=function(e,t){for(var n=[],i=new R.MathNode("mtd",[],["mtr-glue"]),s=new R.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var g=e.cols,v="",T=!1,x=0,w=g.length;g[0].type==="separator"&&(d+="top ",x=1),g[g.length-1].type==="separator"&&(d+="bottom ",w-=1);for(var S=x;S0?"left ":"",d+=O[O.length-1].length>0?"right ":"";for(var W=1;W-1?"alignat":"align",s=e.envName==="split",o=ai(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:Yh(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),l,a=0,u={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var c="",f=0;f0&&p&&(T=1),n[g]={type:"align",align:v,pregap:T,postgap:0}}return o.colSeparationType=p?"align":"alignat",o};Yr({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=nu(e[0]),n=t?[e[0]]:re(e[0],"ordgroup").body,i=n.map(function(o){var l=qh(o),a=l.text;if("lcr".indexOf(a)!==-1)return{type:"align",align:a};if(a==="|")return{type:"separator",separator:"|"};if(a===":")return{type:"separator",separator:":"};throw new B("Unknown column alignment: "+a,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return ai(r.parser,s,Jh(r.envName))},htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,"lcr".indexOf(t)===-1)throw new B("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var s=ai(r.parser,n,Jh(r.envName)),o=Math.max(0,...s.body.map(l=>l.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=ai(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=nu(e[0]),n=t?[e[0]]:re(e[0],"ordgroup").body,i=n.map(function(o){var l=qh(o),a=l.text;if("lc".indexOf(a)!==-1)return{type:"align",align:a};throw new B("Unknown column alignment: "+a,o)});if(i.length>1)throw new B("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=ai(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new B("{subarray} can contain only one column");return s},htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=ai(r.parser,e,Jh(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:C6,htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){G.contains(["gather","gather*"],r.envName)&&ou(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Yh(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return ai(r.parser,e,"display")},htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:C6,htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){ou(r);var e={autoTag:Yh(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return ai(r.parser,e,"display")},htmlBuilder:Jr,mathmlBuilder:Kr});Yr({type:"array",names:["CD"],props:{numArgs:0},handler(r){return ou(r),_T(r.parser)},htmlBuilder:Jr,mathmlBuilder:Kr});k("\\nonumber","\\gdef\\@eqnsw{0}");k("\\notag","\\nonumber");$({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new B(r.funcName+" valid only within array environment")}});var s4=M6;$({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new B("Invalid environment name",i);for(var s="",o=0;o{var t=r.font,n=e.withFont(t);return ae(r.body,n)},N6=(r,e)=>{var t=r.font,n=e.withFont(t);return ge(r.body,n)},o4={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};$({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=T0(e[0]),s=n;return s in o4&&(s=o4[s]),{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:E6,mathmlBuilder:N6});$({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0],i=G.isCharacterBox(n);return{type:"mclass",mode:t.mode,mclass:iu(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});$({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:s}=t,o=t.parseExpression(!0,i),l="math"+n.slice(1);return{type:"font",mode:s,font:l,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:E6,mathmlBuilder:N6});var A6=(r,e)=>{var t=e;return r==="display"?t=t.id>=Y.SCRIPT.id?t.text():Y.DISPLAY:r==="text"&&t.size===Y.DISPLAY.size?t=Y.TEXT:r==="script"?t=Y.SCRIPT:r==="scriptscript"&&(t=Y.SCRIPTSCRIPT),t},Kh=(r,e)=>{var t=A6(r.size,e.style),n=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(n);var o=ae(r.numer,s,e);if(r.continued){var l=8.5/e.fontMetrics().ptPerEm,a=3.5/e.fontMetrics().ptPerEm;o.height=o.height0?g=3*d:g=7*d,v=e.fontMetrics().denom1):(f>0?(p=e.fontMetrics().num2,g=d):(p=e.fontMetrics().num3,g=3*d),v=e.fontMetrics().denom2);var T;if(c){var w=e.fontMetrics().axisHeight;p-o.depth-(w+.5*f){var t=new R.MathNode("mfrac",[ge(r.numer,e),ge(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=Ne(r.barSize,e);t.setAttribute("linethickness",L(n))}var i=A6(r.size,e.style);if(i.size!==e.style.size){t=new R.MathNode("mstyle",[t]);var s=i.size===Y.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var l=new R.MathNode("mo",[new R.TextNode(r.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}if(o.push(t),r.rightDelim!=null){var a=new R.MathNode("mo",[new R.TextNode(r.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}return Vh(o)}return t};$({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1],o,l=null,a=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",a=")";break;case"\\\\bracefrac":o=!1,l="\\{",a="\\}";break;case"\\\\brackfrac":o=!1,l="[",a="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:l,rightDelim:a,size:u,barSize:null}},htmlBuilder:Kh,mathmlBuilder:Gh});$({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});$({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var l4=["display","text","script","scriptscript"],a4=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};$({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],s=T0(e[0]),o=s.type==="atom"&&s.family==="open"?a4(s.text):null,l=T0(e[1]),a=l.type==="atom"&&l.family==="close"?a4(l.text):null,u=re(e[2],"size"),c,f=null;u.isBlank?c=!0:(f=u.value,c=f.number>0);var d="auto",p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=re(p.body[0],"textord");d=l4[Number(g.text)]}}else p=re(p,"textord"),d=l4[Number(p.text)];return{type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:c,barSize:f,leftDelim:o,rightDelim:a,size:d}},htmlBuilder:Kh,mathmlBuilder:Gh});$({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:re(e[0],"size").value,token:i}}});$({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=RM(re(e[1],"infix").size),o=e[2],l=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:o,continued:!1,hasBarLine:l,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Kh,mathmlBuilder:Gh});var O6=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?ae(r.sup,e.havingStyle(t.sup()),e):ae(r.sub,e.havingStyle(t.sub()),e),i=re(r.base,"horizBrace")):i=re(r,"horizBrace");var s=ae(i.base,e.havingBaseStyle(Y.DISPLAY)),o=mn.svgSpan(i,e),l;if(i.isOver?(l=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=N.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),n){var a=N.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e);i.isOver?l=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:n}]},e):l=N.makeVList({positionType:"bottom",positionData:a.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:a}]},e)}return N.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e)},iC=(r,e)=>{var t=mn.mathMLnode(r.label);return new R.MathNode(r.isOver?"mover":"munder",[ge(r.base,e),t])};$({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:O6,mathmlBuilder:iC});$({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=re(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:Be(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=We(r.body,e,!1);return N.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=Zn(r.body,e);return t instanceof rr||(t=new rr("mrow",[t])),t.setAttribute("href",r.href),t}});$({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=re(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:t,funcName:n,token:i}=r,s=re(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,a={};switch(n){case"\\htmlClass":a.class=s,l={command:"\\htmlClass",class:s};break;case"\\htmlId":a.id=s,l={command:"\\htmlId",id:s};break;case"\\htmlStyle":a.style=s,l={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),c=0;c{var t=We(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=N.makeSpan(n,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>Zn(r.body,e)});$({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Be(e[0]),mathml:Be(e[1])}},htmlBuilder:(r,e)=>{var t=We(r.html,e,!1);return N.makeFragment(t)},mathmlBuilder:(r,e)=>Zn(r.mathml,e)});var Cc=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!K5(n))throw new B("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};$({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(t[0])for(var a=re(t[0],"raw").string,u=a.split(","),c=0;c{var t=Ne(r.height,e),n=0;r.totalheight.number>0&&(n=Ne(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=Ne(r.width,e));var s={height:L(t+n)};i>0&&(s.width=L(i)),n>0&&(s.verticalAlign=L(-n));var o=new iT(r.src,r.alt,s);return o.height=t,o.depth=n,o},mathmlBuilder:(r,e)=>{var t=new R.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var n=Ne(r.height,e),i=0;if(r.totalheight.number>0&&(i=Ne(r.totalheight,e)-n,t.setAttribute("valign",L(-i))),t.setAttribute("height",L(n+i)),r.width.number>0){var s=Ne(r.width,e);t.setAttribute("width",L(s))}return t.setAttribute("src",r.src),t}});$({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=re(e[0],"size");if(t.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return N.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=Ne(r.dimension,e);return new R.SpaceNode(t)}});$({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=N.makeSpan([],[ae(r.body,e)]),t=N.makeSpan(["inner"],[t],e)):t=N.makeSpan(["inner"],[ae(r.body,e)]);var n=N.makeSpan(["fix"],[]),i=N.makeSpan([r.alignment],[t,n],e),s=N.makeSpan(["strut"]);return s.style.height=L(i.height+i.depth),i.depth&&(s.style.verticalAlign=L(-i.depth)),i.children.unshift(s),i=N.makeSpan(["thinbox"],[i],e),N.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new R.MathNode("mpadded",[ge(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}});$({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var s=t==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:o}}});$({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new B("Mismatched "+r.funcName)}});var u4=(r,e)=>{switch(e.style.size){case Y.DISPLAY.size:return r.display;case Y.TEXT.size:return r.text;case Y.SCRIPT.size:return r.script;case Y.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};$({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Be(e[0]),text:Be(e[1]),script:Be(e[2]),scriptscript:Be(e[3])}},htmlBuilder:(r,e)=>{var t=u4(r,e),n=We(t,e,!1);return N.makeFragment(n)},mathmlBuilder:(r,e)=>{var t=u4(r,e);return Zn(t,e)}});var z6=(r,e,t,n,i,s,o)=>{r=N.makeSpan([],[r]);var l=t&&G.isCharacterBox(t),a,u;if(e){var c=ae(e,n.havingStyle(i.sup()),n);u={elem:c,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-c.depth)}}if(t){var f=ae(t,n.havingStyle(i.sub()),n);a={elem:f,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-f.height)}}var d;if(u&&a){var p=n.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+r.depth+o;d=N.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:L(-s)},{type:"kern",size:a.kern},{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:L(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(a){var g=r.height-o;d=N.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:L(-s)},{type:"kern",size:a.kern},{type:"elem",elem:r}]},n)}else if(u){var v=r.depth+o;d=N.makeVList({positionType:"bottom",positionData:v,children:[{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:L(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return r;var T=[d];if(a&&s!==0&&!l){var x=N.makeSpan(["mspace"],[],n);x.style.marginRight=L(s),T.unshift(x)}return N.makeSpan(["mop","op-limits"],T,n)},I6=["\\smallint"],Xs=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=re(r.base,"op"),i=!0):s=re(r,"op");var o=e.style,l=!1;o.size===Y.DISPLAY.size&&s.symbol&&!G.contains(I6,s.name)&&(l=!0);var a;if(s.symbol){var u=l?"Size2-Regular":"Size1-Regular",c="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(c=s.name.slice(1),s.name=c==="oiint"?"\\iint":"\\iiint"),a=N.makeSymbol(s.name,u,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),c.length>0){var f=a.italic,d=N.staticSvg(c+"Size"+(l?"2":"1"),e);a=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},e),s.name="\\"+c,a.classes.unshift("mop"),a.italic=f}}else if(s.body){var p=We(s.body,e,!0);p.length===1&&p[0]instanceof cr?(a=p[0],a.classes[0]="mop"):a=N.makeSpan(["mop"],p,e)}else{for(var g=[],v=1;v{var t;if(r.symbol)t=new rr("mo",[fr(r.name,r.mode)]),G.contains(I6,r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new rr("mo",Dt(r.body,e));else{t=new rr("mi",[new Vo(r.name.slice(1))]);var n=new rr("mo",[fr("⁡","text")]);r.parentIsSupSub?t=new rr("mrow",[t,n]):t=o6([t,n])}return t},sC={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};$({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=sC[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Xs,mathmlBuilder:Cl});$({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Be(n)}},htmlBuilder:Xs,mathmlBuilder:Cl});var oC={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};$({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Xs,mathmlBuilder:Cl});$({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Xs,mathmlBuilder:Cl});$({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=oC[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Xs,mathmlBuilder:Cl});var D6=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=re(r.base,"operatorname"),i=!0):s=re(r,"operatorname");var o;if(s.body.length>0){for(var l=s.body.map(f=>{var d=f.text;return typeof d=="string"?{type:"textord",mode:f.mode,text:d}:f}),a=We(l,e.withFont("mathrm"),!0),u=0;u{for(var t=Dt(r.body,e.withFont("mathrm")),n=!0,i=0;ic.toText()).join("");t=[new R.TextNode(l)]}var a=new R.MathNode("mi",t);a.setAttribute("mathvariant","normal");var u=new R.MathNode("mo",[fr("⁡","text")]);return r.parentIsSupSub?new R.MathNode("mrow",[a,u]):R.newDocumentFragment([a,u])};$({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:Be(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:D6,mathmlBuilder:lC});k("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");ji({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?N.makeFragment(We(r.body,e,!1)):N.makeSpan(["mord"],We(r.body,e,!0),e)},mathmlBuilder(r,e){return Zn(r.body,e,!0)}});$({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=ae(r.body,e.havingCrampedStyle()),n=N.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return N.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new R.MathNode("mo",[new R.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new R.MathNode("mover",[ge(r.body,e),t]);return n.setAttribute("accent","true"),n}});$({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:Be(n)}},htmlBuilder:(r,e)=>{var t=We(r.body,e.withPhantom(),!1);return N.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=Dt(r.body,e);return new R.MathNode("mphantom",t)}});$({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"hphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=N.makeSpan([],[ae(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var n=0;n{var t=Dt(Be(r.body),e),n=new R.MathNode("mphantom",t),i=new R.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});$({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=N.makeSpan(["inner"],[ae(r.body,e.withPhantom())]),n=N.makeSpan(["fix"],[]);return N.makeSpan(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=Dt(Be(r.body),e),n=new R.MathNode("mphantom",t),i=new R.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});$({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=re(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=ae(r.body,e),n=Ne(r.dy,e);return N.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new R.MathNode("mpadded",[ge(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}});$({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});$({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],s=re(e[0],"size"),o=re(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&re(i,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=N.makeSpan(["mord","rule"],[],e),n=Ne(r.width,e),i=Ne(r.height,e),s=r.shift?Ne(r.shift,e):0;return t.style.borderRightWidth=L(n),t.style.borderTopWidth=L(i),t.style.bottom=L(s),t.width=n,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=Ne(r.width,e),n=Ne(r.height,e),i=r.shift?Ne(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new R.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",L(t)),o.setAttribute("height",L(n));var l=new R.MathNode("mpadded",[o]);return i>=0?l.setAttribute("height",L(i)):(l.setAttribute("height",L(i)),l.setAttribute("depth",L(-i))),l.setAttribute("voffset",L(i)),l}});function R6(r,e,t){for(var n=We(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s{var t=e.havingSize(r.size);return R6(r.body,t,e)};$({type:"sizing",names:c4,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:c4.indexOf(n)+1,body:s}},htmlBuilder:aC,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=Dt(r.body,t),i=new R.MathNode("mstyle",n);return i.setAttribute("mathsize",L(t.sizeMultiplier)),i}});$({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,s=!1,o=t[0]&&re(t[0],"ordgroup");if(o)for(var l="",a=0;a{var t=N.makeSpan([],[ae(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var n=0;n{var t=new R.MathNode("mpadded",[ge(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});$({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(r,e){var t=ae(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=N.wrapFragment(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idt.height+t.depth+o&&(o=(o+f-t.height-t.depth)/2);var d=a.height-t.height-o-u;t.style.paddingLeft=L(c);var p=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+d)},{type:"elem",elem:a},{type:"kern",size:u}]},e);if(r.index){var g=e.havingStyle(Y.SCRIPTSCRIPT),v=ae(r.index,g,e),T=.6*(p.height-p.depth),x=N.makeVList({positionType:"shift",positionData:-T,children:[{type:"elem",elem:v}]},e),w=N.makeSpan(["root"],[x]);return N.makeSpan(["mord","sqrt"],[w,p],e)}else return N.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new R.MathNode("mroot",[ge(t,e),ge(n,e)]):new R.MathNode("msqrt",[ge(t,e)])}});var f4={display:Y.DISPLAY,text:Y.TEXT,script:Y.SCRIPT,scriptscript:Y.SCRIPTSCRIPT};$({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!0,t),o=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(r,e){var t=f4[r.style],n=e.havingStyle(t).withFont("");return R6(r.body,n,e)},mathmlBuilder(r,e){var t=f4[r.style],n=e.havingStyle(t),i=Dt(r.body,n),s=new R.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[r.style];return s.setAttribute("scriptlevel",l[0]),s.setAttribute("displaystyle",l[1]),s}});var uC=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===Y.DISPLAY.size||n.alwaysHandleSupSub);return i?Xs:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(t.style.size===Y.DISPLAY.size||n.limits);return s?D6:null}else{if(n.type==="accent")return G.isCharacterBox(n.base)?_h:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?O6:null}else return null}else return null};ji({type:"supsub",htmlBuilder(r,e){var t=uC(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:s}=r,o=ae(n,e),l,a,u=e.fontMetrics(),c=0,f=0,d=n&&G.isCharacterBox(n);if(i){var p=e.havingStyle(e.style.sup());l=ae(i,p,e),d||(c=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());a=ae(s,g,e),d||(f=o.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var v;e.style===Y.DISPLAY?v=u.sup1:e.style.cramped?v=u.sup3:v=u.sup2;var T=e.sizeMultiplier,x=L(.5/u.ptPerEm/T),w=null;if(a){var S=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof cr||S)&&(w=L(-o.italic))}var E;if(l&&a){c=Math.max(c,v,l.depth+.25*u.xHeight),f=Math.max(f,u.sub2);var A=u.defaultRuleThickness,z=4*A;if(c-l.depth-(a.height-f)0&&(c+=I,f-=I)}var O=[{type:"elem",elem:a,shift:f,marginRight:x,marginLeft:w},{type:"elem",elem:l,shift:-c,marginRight:x}];E=N.makeVList({positionType:"individualShift",children:O},e)}else if(a){f=Math.max(f,u.sub1,a.height-.8*u.xHeight);var W=[{type:"elem",elem:a,marginLeft:w,marginRight:x}];E=N.makeVList({positionType:"shift",positionData:f,children:W},e)}else if(l)c=Math.max(c,v,l.depth+.25*u.xHeight),E=N.makeVList({positionType:"shift",positionData:-c,children:[{type:"elem",elem:l,marginRight:x}]},e);else throw new Error("supsub must have either sup or sub.");var K=ld(o,"right")||"mord";return N.makeSpan([K],[o,N.makeSpan(["msupsub"],[E])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[ge(r.base,e)];r.sub&&s.push(ge(r.sub,e)),r.sup&&s.push(ge(r.sup,e));var o;if(t)o=n?"mover":"munder";else if(r.sub)if(r.sup){var u=r.base;u&&u.type==="op"&&u.limits&&e.style===Y.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Y.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var a=r.base;a&&a.type==="op"&&a.limits&&(e.style===Y.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===Y.DISPLAY)?o="munder":o="msub"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===Y.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Y.DISPLAY)?o="mover":o="msup"}return new R.MathNode(o,s)}});ji({type:"atom",htmlBuilder(r,e){return N.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new R.MathNode("mo",[fr(r.text,r.mode)]);if(r.family==="bin"){var n=Hh(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var P6={mi:"italic",mn:"normal",mtext:"normal"};ji({type:"mathord",htmlBuilder(r,e){return N.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new R.MathNode("mi",[fr(r.text,r.mode,e)]),n=Hh(r,e)||"italic";return n!==P6[t.type]&&t.setAttribute("mathvariant",n),t}});ji({type:"textord",htmlBuilder(r,e){return N.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=fr(r.text,r.mode,e),n=Hh(r,e)||"normal",i;return r.mode==="text"?i=new R.MathNode("mtext",[t]):/[0-9]/.test(r.text)?i=new R.MathNode("mn",[t]):r.text==="\\prime"?i=new R.MathNode("mo",[t]):i=new R.MathNode("mi",[t]),n!==P6[i.type]&&i.setAttribute("mathvariant",n),i}});var Ec={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Nc={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ji({type:"spacing",htmlBuilder(r,e){if(Nc.hasOwnProperty(r.text)){var t=Nc[r.text].className||"";if(r.mode==="text"){var n=N.makeOrd(r,e,"textord");return n.classes.push(t),n}else return N.makeSpan(["mspace",t],[N.mathsym(r.text,r.mode,e)],e)}else{if(Ec.hasOwnProperty(r.text))return N.makeSpan(["mspace",Ec[r.text]],[],e);throw new B('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(Nc.hasOwnProperty(r.text))t=new R.MathNode("mtext",[new R.TextNode(" ")]);else{if(Ec.hasOwnProperty(r.text))return new R.MathNode("mspace");throw new B('Unknown type of space "'+r.text+'"')}return t}});var d4=()=>{var r=new R.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};ji({type:"tag",mathmlBuilder(r,e){var t=new R.MathNode("mtable",[new R.MathNode("mtr",[d4(),new R.MathNode("mtd",[Zn(r.body,e)]),d4(),new R.MathNode("mtd",[Zn(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var h4={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},p4={"\\textbf":"textbf","\\textmd":"textmd"},cC={"\\textit":"textit","\\textup":"textup"},m4=(r,e)=>{var t=r.font;return t?h4[t]?e.withTextFontFamily(h4[t]):p4[t]?e.withTextFontWeight(p4[t]):e.withTextFontShape(cC[t]):e};$({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:Be(i),font:n}},htmlBuilder(r,e){var t=m4(r,e),n=We(r.body,t,!0);return N.makeSpan(["mord","text"],n,t)},mathmlBuilder(r,e){var t=m4(r,e);return Zn(r.body,t)}});$({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ae(r.body,e),n=N.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=N.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]},e);return N.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new R.MathNode("mo",[new R.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new R.MathNode("munder",[ge(r.body,e),t]);return n.setAttribute("accentunder","true"),n}});$({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ae(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return N.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new R.MathNode("mpadded",[ge(r.body,e)],["vcenter"])}});$({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new B("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=g4(r),n=[],i=e.havingStyle(e.style.text()),s=0;sr.body.replace(/ /g,r.star?"␣":" "),Rn=i6,B6=`[ \r +-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class Ml{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return G.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;tt.toText();return this.children.map(e).join("")}}var Vr={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},ra={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},_m={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function eT(r,e){Vr[r]=e}function Lh(r,e,t){if(!Vr[e])throw new Error("Font metrics not found for font: "+e+".");var n=r.charCodeAt(0),i=Vr[e][n];if(!i&&r[0]in _m&&(n=_m[r[0]].charCodeAt(0),i=Vr[e][n]),!i&&t==="text"&&J5(n)&&(i=Vr[e][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var gc={};function tT(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!gc[e]){var t=gc[e]={cssEmPerMu:ra.quad[e]/18};for(var n in ra)ra.hasOwnProperty(n)&&(t[n]=ra[n][e])}return gc[e]}var rT=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Um=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Wm=function(e,t){return t.size<2?e:rT[e-1][t.size-1]};class tn{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||tn.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Um[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new tn(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Wm(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Um[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Wm(tn.BASESIZE,e);return this.size===t&&this.textSize===tn.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==tn.BASESIZE?["sizing","reset-size"+this.size,"size"+tn.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=tT(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}tn.BASESIZE=6;var id={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},nT={ex:!0,em:!0,mu:!0},K5=function(e){return typeof e!="string"&&(e=e.unit),e in id||e in nT||e==="ex"},Ne=function(e,t){var n;if(e.unit in id)n=id[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")n=t.fontMetrics().cssEmPerMu;else{var i;if(t.style.isTight()?i=t.havingStyle(t.style.text()):i=t,e.unit==="ex")n=i.fontMetrics().xHeight;else if(e.unit==="em")n=i.fontMetrics().quad;else throw new B("Invalid unit: '"+e.unit+"'");i!==t&&(n*=i.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},L=function(e){return+e.toFixed(4)+"em"},Xn=function(e){return e.filter(t=>t).join(" ")},G5=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var i=t.getColor();i&&(this.style.color=i)}},X5=function(e){var t=document.createElement(e);t.className=Xn(this.classes);for(var n in this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var i in this.attributes)this.attributes.hasOwnProperty(i)&&t.setAttribute(i,this.attributes[i]);for(var s=0;s",t};class Tl{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,G5.call(this,e,n,i),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return G.contains(this.classes,e)}toNode(){return X5.call(this,"span")}toMarkup(){return Q5.call(this,"span")}}class Fh{constructor(e,t,n,i){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,G5.call(this,t,i),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return G.contains(this.classes,e)}toNode(){return X5.call(this,"a")}toMarkup(){return Q5.call(this,"a")}}class iT{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return G.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=""+this.alt+"0&&(t=document.createElement("span"),t.style.marginRight=L(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=Xn(this.classes));for(var n in this.style)this.style.hasOwnProperty(n)&&(t=t||document.createElement("span"),t.style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(n+="margin-right:"+this.italic+"em;");for(var i in this.style)this.style.hasOwnProperty(i)&&(n+=G.hyphenate(i)+":"+this.style[i]+";");n&&(e=!0,t+=' style="'+G.escape(n)+'"');var s=G.escape(this.text);return e?(t+=">",t+=s,t+="",t):s}}class hn{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);for(var i=0;i":""}}class sd{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);return t}toMarkup(){var e=" but got "+String(r)+".")}var lT={bin:1,close:1,inner:1,open:1,punct:1,rel:1},aT={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},ve={math:{},text:{}};function h(r,e,t,n,i,s){ve[r][i]={font:e,group:t,replace:n},s&&n&&(ve[r][n]=ve[r][i])}var m="math",D="text",y="main",b="ams",Te="accent-token",H="bin",xt="close",Gs="inner",J="mathord",$e="op-token",Yt="open",tu="punct",M="rel",vn="spacing",C="textord";h(m,y,M,"≡","\\equiv",!0);h(m,y,M,"≺","\\prec",!0);h(m,y,M,"≻","\\succ",!0);h(m,y,M,"∼","\\sim",!0);h(m,y,M,"⊥","\\perp");h(m,y,M,"⪯","\\preceq",!0);h(m,y,M,"⪰","\\succeq",!0);h(m,y,M,"≃","\\simeq",!0);h(m,y,M,"∣","\\mid",!0);h(m,y,M,"≪","\\ll",!0);h(m,y,M,"≫","\\gg",!0);h(m,y,M,"≍","\\asymp",!0);h(m,y,M,"∥","\\parallel");h(m,y,M,"⋈","\\bowtie",!0);h(m,y,M,"⌣","\\smile",!0);h(m,y,M,"⊑","\\sqsubseteq",!0);h(m,y,M,"⊒","\\sqsupseteq",!0);h(m,y,M,"≐","\\doteq",!0);h(m,y,M,"⌢","\\frown",!0);h(m,y,M,"∋","\\ni",!0);h(m,y,M,"∝","\\propto",!0);h(m,y,M,"⊢","\\vdash",!0);h(m,y,M,"⊣","\\dashv",!0);h(m,y,M,"∋","\\owns");h(m,y,tu,".","\\ldotp");h(m,y,tu,"⋅","\\cdotp");h(m,y,C,"#","\\#");h(D,y,C,"#","\\#");h(m,y,C,"&","\\&");h(D,y,C,"&","\\&");h(m,y,C,"ℵ","\\aleph",!0);h(m,y,C,"∀","\\forall",!0);h(m,y,C,"ℏ","\\hbar",!0);h(m,y,C,"∃","\\exists",!0);h(m,y,C,"∇","\\nabla",!0);h(m,y,C,"♭","\\flat",!0);h(m,y,C,"ℓ","\\ell",!0);h(m,y,C,"♮","\\natural",!0);h(m,y,C,"♣","\\clubsuit",!0);h(m,y,C,"℘","\\wp",!0);h(m,y,C,"♯","\\sharp",!0);h(m,y,C,"♢","\\diamondsuit",!0);h(m,y,C,"ℜ","\\Re",!0);h(m,y,C,"♡","\\heartsuit",!0);h(m,y,C,"ℑ","\\Im",!0);h(m,y,C,"♠","\\spadesuit",!0);h(m,y,C,"§","\\S",!0);h(D,y,C,"§","\\S");h(m,y,C,"¶","\\P",!0);h(D,y,C,"¶","\\P");h(m,y,C,"†","\\dag");h(D,y,C,"†","\\dag");h(D,y,C,"†","\\textdagger");h(m,y,C,"‡","\\ddag");h(D,y,C,"‡","\\ddag");h(D,y,C,"‡","\\textdaggerdbl");h(m,y,xt,"⎱","\\rmoustache",!0);h(m,y,Yt,"⎰","\\lmoustache",!0);h(m,y,xt,"⟯","\\rgroup",!0);h(m,y,Yt,"⟮","\\lgroup",!0);h(m,y,H,"∓","\\mp",!0);h(m,y,H,"⊖","\\ominus",!0);h(m,y,H,"⊎","\\uplus",!0);h(m,y,H,"⊓","\\sqcap",!0);h(m,y,H,"∗","\\ast");h(m,y,H,"⊔","\\sqcup",!0);h(m,y,H,"◯","\\bigcirc",!0);h(m,y,H,"∙","\\bullet",!0);h(m,y,H,"‡","\\ddagger");h(m,y,H,"≀","\\wr",!0);h(m,y,H,"⨿","\\amalg");h(m,y,H,"&","\\And");h(m,y,M,"⟵","\\longleftarrow",!0);h(m,y,M,"⇐","\\Leftarrow",!0);h(m,y,M,"⟸","\\Longleftarrow",!0);h(m,y,M,"⟶","\\longrightarrow",!0);h(m,y,M,"⇒","\\Rightarrow",!0);h(m,y,M,"⟹","\\Longrightarrow",!0);h(m,y,M,"↔","\\leftrightarrow",!0);h(m,y,M,"⟷","\\longleftrightarrow",!0);h(m,y,M,"⇔","\\Leftrightarrow",!0);h(m,y,M,"⟺","\\Longleftrightarrow",!0);h(m,y,M,"↦","\\mapsto",!0);h(m,y,M,"⟼","\\longmapsto",!0);h(m,y,M,"↗","\\nearrow",!0);h(m,y,M,"↩","\\hookleftarrow",!0);h(m,y,M,"↪","\\hookrightarrow",!0);h(m,y,M,"↘","\\searrow",!0);h(m,y,M,"↼","\\leftharpoonup",!0);h(m,y,M,"⇀","\\rightharpoonup",!0);h(m,y,M,"↙","\\swarrow",!0);h(m,y,M,"↽","\\leftharpoondown",!0);h(m,y,M,"⇁","\\rightharpoondown",!0);h(m,y,M,"↖","\\nwarrow",!0);h(m,y,M,"⇌","\\rightleftharpoons",!0);h(m,b,M,"≮","\\nless",!0);h(m,b,M,"","\\@nleqslant");h(m,b,M,"","\\@nleqq");h(m,b,M,"⪇","\\lneq",!0);h(m,b,M,"≨","\\lneqq",!0);h(m,b,M,"","\\@lvertneqq");h(m,b,M,"⋦","\\lnsim",!0);h(m,b,M,"⪉","\\lnapprox",!0);h(m,b,M,"⊀","\\nprec",!0);h(m,b,M,"⋠","\\npreceq",!0);h(m,b,M,"⋨","\\precnsim",!0);h(m,b,M,"⪹","\\precnapprox",!0);h(m,b,M,"≁","\\nsim",!0);h(m,b,M,"","\\@nshortmid");h(m,b,M,"∤","\\nmid",!0);h(m,b,M,"⊬","\\nvdash",!0);h(m,b,M,"⊭","\\nvDash",!0);h(m,b,M,"⋪","\\ntriangleleft");h(m,b,M,"⋬","\\ntrianglelefteq",!0);h(m,b,M,"⊊","\\subsetneq",!0);h(m,b,M,"","\\@varsubsetneq");h(m,b,M,"⫋","\\subsetneqq",!0);h(m,b,M,"","\\@varsubsetneqq");h(m,b,M,"≯","\\ngtr",!0);h(m,b,M,"","\\@ngeqslant");h(m,b,M,"","\\@ngeqq");h(m,b,M,"⪈","\\gneq",!0);h(m,b,M,"≩","\\gneqq",!0);h(m,b,M,"","\\@gvertneqq");h(m,b,M,"⋧","\\gnsim",!0);h(m,b,M,"⪊","\\gnapprox",!0);h(m,b,M,"⊁","\\nsucc",!0);h(m,b,M,"⋡","\\nsucceq",!0);h(m,b,M,"⋩","\\succnsim",!0);h(m,b,M,"⪺","\\succnapprox",!0);h(m,b,M,"≆","\\ncong",!0);h(m,b,M,"","\\@nshortparallel");h(m,b,M,"∦","\\nparallel",!0);h(m,b,M,"⊯","\\nVDash",!0);h(m,b,M,"⋫","\\ntriangleright");h(m,b,M,"⋭","\\ntrianglerighteq",!0);h(m,b,M,"","\\@nsupseteqq");h(m,b,M,"⊋","\\supsetneq",!0);h(m,b,M,"","\\@varsupsetneq");h(m,b,M,"⫌","\\supsetneqq",!0);h(m,b,M,"","\\@varsupsetneqq");h(m,b,M,"⊮","\\nVdash",!0);h(m,b,M,"⪵","\\precneqq",!0);h(m,b,M,"⪶","\\succneqq",!0);h(m,b,M,"","\\@nsubseteqq");h(m,b,H,"⊴","\\unlhd");h(m,b,H,"⊵","\\unrhd");h(m,b,M,"↚","\\nleftarrow",!0);h(m,b,M,"↛","\\nrightarrow",!0);h(m,b,M,"⇍","\\nLeftarrow",!0);h(m,b,M,"⇏","\\nRightarrow",!0);h(m,b,M,"↮","\\nleftrightarrow",!0);h(m,b,M,"⇎","\\nLeftrightarrow",!0);h(m,b,M,"△","\\vartriangle");h(m,b,C,"ℏ","\\hslash");h(m,b,C,"▽","\\triangledown");h(m,b,C,"◊","\\lozenge");h(m,b,C,"Ⓢ","\\circledS");h(m,b,C,"®","\\circledR");h(D,b,C,"®","\\circledR");h(m,b,C,"∡","\\measuredangle",!0);h(m,b,C,"∄","\\nexists");h(m,b,C,"℧","\\mho");h(m,b,C,"Ⅎ","\\Finv",!0);h(m,b,C,"⅁","\\Game",!0);h(m,b,C,"‵","\\backprime");h(m,b,C,"▲","\\blacktriangle");h(m,b,C,"▼","\\blacktriangledown");h(m,b,C,"■","\\blacksquare");h(m,b,C,"⧫","\\blacklozenge");h(m,b,C,"★","\\bigstar");h(m,b,C,"∢","\\sphericalangle",!0);h(m,b,C,"∁","\\complement",!0);h(m,b,C,"ð","\\eth",!0);h(D,y,C,"ð","ð");h(m,b,C,"╱","\\diagup");h(m,b,C,"╲","\\diagdown");h(m,b,C,"□","\\square");h(m,b,C,"□","\\Box");h(m,b,C,"◊","\\Diamond");h(m,b,C,"¥","\\yen",!0);h(D,b,C,"¥","\\yen",!0);h(m,b,C,"✓","\\checkmark",!0);h(D,b,C,"✓","\\checkmark");h(m,b,C,"ℶ","\\beth",!0);h(m,b,C,"ℸ","\\daleth",!0);h(m,b,C,"ℷ","\\gimel",!0);h(m,b,C,"ϝ","\\digamma",!0);h(m,b,C,"ϰ","\\varkappa");h(m,b,Yt,"┌","\\@ulcorner",!0);h(m,b,xt,"┐","\\@urcorner",!0);h(m,b,Yt,"└","\\@llcorner",!0);h(m,b,xt,"┘","\\@lrcorner",!0);h(m,b,M,"≦","\\leqq",!0);h(m,b,M,"⩽","\\leqslant",!0);h(m,b,M,"⪕","\\eqslantless",!0);h(m,b,M,"≲","\\lesssim",!0);h(m,b,M,"⪅","\\lessapprox",!0);h(m,b,M,"≊","\\approxeq",!0);h(m,b,H,"⋖","\\lessdot");h(m,b,M,"⋘","\\lll",!0);h(m,b,M,"≶","\\lessgtr",!0);h(m,b,M,"⋚","\\lesseqgtr",!0);h(m,b,M,"⪋","\\lesseqqgtr",!0);h(m,b,M,"≑","\\doteqdot");h(m,b,M,"≓","\\risingdotseq",!0);h(m,b,M,"≒","\\fallingdotseq",!0);h(m,b,M,"∽","\\backsim",!0);h(m,b,M,"⋍","\\backsimeq",!0);h(m,b,M,"⫅","\\subseteqq",!0);h(m,b,M,"⋐","\\Subset",!0);h(m,b,M,"⊏","\\sqsubset",!0);h(m,b,M,"≼","\\preccurlyeq",!0);h(m,b,M,"⋞","\\curlyeqprec",!0);h(m,b,M,"≾","\\precsim",!0);h(m,b,M,"⪷","\\precapprox",!0);h(m,b,M,"⊲","\\vartriangleleft");h(m,b,M,"⊴","\\trianglelefteq");h(m,b,M,"⊨","\\vDash",!0);h(m,b,M,"⊪","\\Vvdash",!0);h(m,b,M,"⌣","\\smallsmile");h(m,b,M,"⌢","\\smallfrown");h(m,b,M,"≏","\\bumpeq",!0);h(m,b,M,"≎","\\Bumpeq",!0);h(m,b,M,"≧","\\geqq",!0);h(m,b,M,"⩾","\\geqslant",!0);h(m,b,M,"⪖","\\eqslantgtr",!0);h(m,b,M,"≳","\\gtrsim",!0);h(m,b,M,"⪆","\\gtrapprox",!0);h(m,b,H,"⋗","\\gtrdot");h(m,b,M,"⋙","\\ggg",!0);h(m,b,M,"≷","\\gtrless",!0);h(m,b,M,"⋛","\\gtreqless",!0);h(m,b,M,"⪌","\\gtreqqless",!0);h(m,b,M,"≖","\\eqcirc",!0);h(m,b,M,"≗","\\circeq",!0);h(m,b,M,"≜","\\triangleq",!0);h(m,b,M,"∼","\\thicksim");h(m,b,M,"≈","\\thickapprox");h(m,b,M,"⫆","\\supseteqq",!0);h(m,b,M,"⋑","\\Supset",!0);h(m,b,M,"⊐","\\sqsupset",!0);h(m,b,M,"≽","\\succcurlyeq",!0);h(m,b,M,"⋟","\\curlyeqsucc",!0);h(m,b,M,"≿","\\succsim",!0);h(m,b,M,"⪸","\\succapprox",!0);h(m,b,M,"⊳","\\vartriangleright");h(m,b,M,"⊵","\\trianglerighteq");h(m,b,M,"⊩","\\Vdash",!0);h(m,b,M,"∣","\\shortmid");h(m,b,M,"∥","\\shortparallel");h(m,b,M,"≬","\\between",!0);h(m,b,M,"⋔","\\pitchfork",!0);h(m,b,M,"∝","\\varpropto");h(m,b,M,"◀","\\blacktriangleleft");h(m,b,M,"∴","\\therefore",!0);h(m,b,M,"∍","\\backepsilon");h(m,b,M,"▶","\\blacktriangleright");h(m,b,M,"∵","\\because",!0);h(m,b,M,"⋘","\\llless");h(m,b,M,"⋙","\\gggtr");h(m,b,H,"⊲","\\lhd");h(m,b,H,"⊳","\\rhd");h(m,b,M,"≂","\\eqsim",!0);h(m,y,M,"⋈","\\Join");h(m,b,M,"≑","\\Doteq",!0);h(m,b,H,"∔","\\dotplus",!0);h(m,b,H,"∖","\\smallsetminus");h(m,b,H,"⋒","\\Cap",!0);h(m,b,H,"⋓","\\Cup",!0);h(m,b,H,"⩞","\\doublebarwedge",!0);h(m,b,H,"⊟","\\boxminus",!0);h(m,b,H,"⊞","\\boxplus",!0);h(m,b,H,"⋇","\\divideontimes",!0);h(m,b,H,"⋉","\\ltimes",!0);h(m,b,H,"⋊","\\rtimes",!0);h(m,b,H,"⋋","\\leftthreetimes",!0);h(m,b,H,"⋌","\\rightthreetimes",!0);h(m,b,H,"⋏","\\curlywedge",!0);h(m,b,H,"⋎","\\curlyvee",!0);h(m,b,H,"⊝","\\circleddash",!0);h(m,b,H,"⊛","\\circledast",!0);h(m,b,H,"⋅","\\centerdot");h(m,b,H,"⊺","\\intercal",!0);h(m,b,H,"⋒","\\doublecap");h(m,b,H,"⋓","\\doublecup");h(m,b,H,"⊠","\\boxtimes",!0);h(m,b,M,"⇢","\\dashrightarrow",!0);h(m,b,M,"⇠","\\dashleftarrow",!0);h(m,b,M,"⇇","\\leftleftarrows",!0);h(m,b,M,"⇆","\\leftrightarrows",!0);h(m,b,M,"⇚","\\Lleftarrow",!0);h(m,b,M,"↞","\\twoheadleftarrow",!0);h(m,b,M,"↢","\\leftarrowtail",!0);h(m,b,M,"↫","\\looparrowleft",!0);h(m,b,M,"⇋","\\leftrightharpoons",!0);h(m,b,M,"↶","\\curvearrowleft",!0);h(m,b,M,"↺","\\circlearrowleft",!0);h(m,b,M,"↰","\\Lsh",!0);h(m,b,M,"⇈","\\upuparrows",!0);h(m,b,M,"↿","\\upharpoonleft",!0);h(m,b,M,"⇃","\\downharpoonleft",!0);h(m,y,M,"⊶","\\origof",!0);h(m,y,M,"⊷","\\imageof",!0);h(m,b,M,"⊸","\\multimap",!0);h(m,b,M,"↭","\\leftrightsquigarrow",!0);h(m,b,M,"⇉","\\rightrightarrows",!0);h(m,b,M,"⇄","\\rightleftarrows",!0);h(m,b,M,"↠","\\twoheadrightarrow",!0);h(m,b,M,"↣","\\rightarrowtail",!0);h(m,b,M,"↬","\\looparrowright",!0);h(m,b,M,"↷","\\curvearrowright",!0);h(m,b,M,"↻","\\circlearrowright",!0);h(m,b,M,"↱","\\Rsh",!0);h(m,b,M,"⇊","\\downdownarrows",!0);h(m,b,M,"↾","\\upharpoonright",!0);h(m,b,M,"⇂","\\downharpoonright",!0);h(m,b,M,"⇝","\\rightsquigarrow",!0);h(m,b,M,"⇝","\\leadsto");h(m,b,M,"⇛","\\Rrightarrow",!0);h(m,b,M,"↾","\\restriction");h(m,y,C,"‘","`");h(m,y,C,"$","\\$");h(D,y,C,"$","\\$");h(D,y,C,"$","\\textdollar");h(m,y,C,"%","\\%");h(D,y,C,"%","\\%");h(m,y,C,"_","\\_");h(D,y,C,"_","\\_");h(D,y,C,"_","\\textunderscore");h(m,y,C,"∠","\\angle",!0);h(m,y,C,"∞","\\infty",!0);h(m,y,C,"′","\\prime");h(m,y,C,"△","\\triangle");h(m,y,C,"Γ","\\Gamma",!0);h(m,y,C,"Δ","\\Delta",!0);h(m,y,C,"Θ","\\Theta",!0);h(m,y,C,"Λ","\\Lambda",!0);h(m,y,C,"Ξ","\\Xi",!0);h(m,y,C,"Π","\\Pi",!0);h(m,y,C,"Σ","\\Sigma",!0);h(m,y,C,"Υ","\\Upsilon",!0);h(m,y,C,"Φ","\\Phi",!0);h(m,y,C,"Ψ","\\Psi",!0);h(m,y,C,"Ω","\\Omega",!0);h(m,y,C,"A","Α");h(m,y,C,"B","Β");h(m,y,C,"E","Ε");h(m,y,C,"Z","Ζ");h(m,y,C,"H","Η");h(m,y,C,"I","Ι");h(m,y,C,"K","Κ");h(m,y,C,"M","Μ");h(m,y,C,"N","Ν");h(m,y,C,"O","Ο");h(m,y,C,"P","Ρ");h(m,y,C,"T","Τ");h(m,y,C,"X","Χ");h(m,y,C,"¬","\\neg",!0);h(m,y,C,"¬","\\lnot");h(m,y,C,"⊤","\\top");h(m,y,C,"⊥","\\bot");h(m,y,C,"∅","\\emptyset");h(m,b,C,"∅","\\varnothing");h(m,y,J,"α","\\alpha",!0);h(m,y,J,"β","\\beta",!0);h(m,y,J,"γ","\\gamma",!0);h(m,y,J,"δ","\\delta",!0);h(m,y,J,"ϵ","\\epsilon",!0);h(m,y,J,"ζ","\\zeta",!0);h(m,y,J,"η","\\eta",!0);h(m,y,J,"θ","\\theta",!0);h(m,y,J,"ι","\\iota",!0);h(m,y,J,"κ","\\kappa",!0);h(m,y,J,"λ","\\lambda",!0);h(m,y,J,"μ","\\mu",!0);h(m,y,J,"ν","\\nu",!0);h(m,y,J,"ξ","\\xi",!0);h(m,y,J,"ο","\\omicron",!0);h(m,y,J,"π","\\pi",!0);h(m,y,J,"ρ","\\rho",!0);h(m,y,J,"σ","\\sigma",!0);h(m,y,J,"τ","\\tau",!0);h(m,y,J,"υ","\\upsilon",!0);h(m,y,J,"ϕ","\\phi",!0);h(m,y,J,"χ","\\chi",!0);h(m,y,J,"ψ","\\psi",!0);h(m,y,J,"ω","\\omega",!0);h(m,y,J,"ε","\\varepsilon",!0);h(m,y,J,"ϑ","\\vartheta",!0);h(m,y,J,"ϖ","\\varpi",!0);h(m,y,J,"ϱ","\\varrho",!0);h(m,y,J,"ς","\\varsigma",!0);h(m,y,J,"φ","\\varphi",!0);h(m,y,H,"∗","*",!0);h(m,y,H,"+","+");h(m,y,H,"−","-",!0);h(m,y,H,"⋅","\\cdot",!0);h(m,y,H,"∘","\\circ",!0);h(m,y,H,"÷","\\div",!0);h(m,y,H,"±","\\pm",!0);h(m,y,H,"×","\\times",!0);h(m,y,H,"∩","\\cap",!0);h(m,y,H,"∪","\\cup",!0);h(m,y,H,"∖","\\setminus",!0);h(m,y,H,"∧","\\land");h(m,y,H,"∨","\\lor");h(m,y,H,"∧","\\wedge",!0);h(m,y,H,"∨","\\vee",!0);h(m,y,C,"√","\\surd");h(m,y,Yt,"⟨","\\langle",!0);h(m,y,Yt,"∣","\\lvert");h(m,y,Yt,"∥","\\lVert");h(m,y,xt,"?","?");h(m,y,xt,"!","!");h(m,y,xt,"⟩","\\rangle",!0);h(m,y,xt,"∣","\\rvert");h(m,y,xt,"∥","\\rVert");h(m,y,M,"=","=");h(m,y,M,":",":");h(m,y,M,"≈","\\approx",!0);h(m,y,M,"≅","\\cong",!0);h(m,y,M,"≥","\\ge");h(m,y,M,"≥","\\geq",!0);h(m,y,M,"←","\\gets");h(m,y,M,">","\\gt",!0);h(m,y,M,"∈","\\in",!0);h(m,y,M,"","\\@not");h(m,y,M,"⊂","\\subset",!0);h(m,y,M,"⊃","\\supset",!0);h(m,y,M,"⊆","\\subseteq",!0);h(m,y,M,"⊇","\\supseteq",!0);h(m,b,M,"⊈","\\nsubseteq",!0);h(m,b,M,"⊉","\\nsupseteq",!0);h(m,y,M,"⊨","\\models");h(m,y,M,"←","\\leftarrow",!0);h(m,y,M,"≤","\\le");h(m,y,M,"≤","\\leq",!0);h(m,y,M,"<","\\lt",!0);h(m,y,M,"→","\\rightarrow",!0);h(m,y,M,"→","\\to");h(m,b,M,"≱","\\ngeq",!0);h(m,b,M,"≰","\\nleq",!0);h(m,y,vn," ","\\ ");h(m,y,vn," ","\\space");h(m,y,vn," ","\\nobreakspace");h(D,y,vn," ","\\ ");h(D,y,vn," "," ");h(D,y,vn," ","\\space");h(D,y,vn," ","\\nobreakspace");h(m,y,vn,null,"\\nobreak");h(m,y,vn,null,"\\allowbreak");h(m,y,tu,",",",");h(m,y,tu,";",";");h(m,b,H,"⊼","\\barwedge",!0);h(m,b,H,"⊻","\\veebar",!0);h(m,y,H,"⊙","\\odot",!0);h(m,y,H,"⊕","\\oplus",!0);h(m,y,H,"⊗","\\otimes",!0);h(m,y,C,"∂","\\partial",!0);h(m,y,H,"⊘","\\oslash",!0);h(m,b,H,"⊚","\\circledcirc",!0);h(m,b,H,"⊡","\\boxdot",!0);h(m,y,H,"△","\\bigtriangleup");h(m,y,H,"▽","\\bigtriangledown");h(m,y,H,"†","\\dagger");h(m,y,H,"⋄","\\diamond");h(m,y,H,"⋆","\\star");h(m,y,H,"◃","\\triangleleft");h(m,y,H,"▹","\\triangleright");h(m,y,Yt,"{","\\{");h(D,y,C,"{","\\{");h(D,y,C,"{","\\textbraceleft");h(m,y,xt,"}","\\}");h(D,y,C,"}","\\}");h(D,y,C,"}","\\textbraceright");h(m,y,Yt,"{","\\lbrace");h(m,y,xt,"}","\\rbrace");h(m,y,Yt,"[","\\lbrack",!0);h(D,y,C,"[","\\lbrack",!0);h(m,y,xt,"]","\\rbrack",!0);h(D,y,C,"]","\\rbrack",!0);h(m,y,Yt,"(","\\lparen",!0);h(m,y,xt,")","\\rparen",!0);h(D,y,C,"<","\\textless",!0);h(D,y,C,">","\\textgreater",!0);h(m,y,Yt,"⌊","\\lfloor",!0);h(m,y,xt,"⌋","\\rfloor",!0);h(m,y,Yt,"⌈","\\lceil",!0);h(m,y,xt,"⌉","\\rceil",!0);h(m,y,C,"\\","\\backslash");h(m,y,C,"∣","|");h(m,y,C,"∣","\\vert");h(D,y,C,"|","\\textbar",!0);h(m,y,C,"∥","\\|");h(m,y,C,"∥","\\Vert");h(D,y,C,"∥","\\textbardbl");h(D,y,C,"~","\\textasciitilde");h(D,y,C,"\\","\\textbackslash");h(D,y,C,"^","\\textasciicircum");h(m,y,M,"↑","\\uparrow",!0);h(m,y,M,"⇑","\\Uparrow",!0);h(m,y,M,"↓","\\downarrow",!0);h(m,y,M,"⇓","\\Downarrow",!0);h(m,y,M,"↕","\\updownarrow",!0);h(m,y,M,"⇕","\\Updownarrow",!0);h(m,y,$e,"∐","\\coprod");h(m,y,$e,"⋁","\\bigvee");h(m,y,$e,"⋀","\\bigwedge");h(m,y,$e,"⨄","\\biguplus");h(m,y,$e,"⋂","\\bigcap");h(m,y,$e,"⋃","\\bigcup");h(m,y,$e,"∫","\\int");h(m,y,$e,"∫","\\intop");h(m,y,$e,"∬","\\iint");h(m,y,$e,"∭","\\iiint");h(m,y,$e,"∏","\\prod");h(m,y,$e,"∑","\\sum");h(m,y,$e,"⨂","\\bigotimes");h(m,y,$e,"⨁","\\bigoplus");h(m,y,$e,"⨀","\\bigodot");h(m,y,$e,"∮","\\oint");h(m,y,$e,"∯","\\oiint");h(m,y,$e,"∰","\\oiiint");h(m,y,$e,"⨆","\\bigsqcup");h(m,y,$e,"∫","\\smallint");h(D,y,Gs,"…","\\textellipsis");h(m,y,Gs,"…","\\mathellipsis");h(D,y,Gs,"…","\\ldots",!0);h(m,y,Gs,"…","\\ldots",!0);h(m,y,Gs,"⋯","\\@cdots",!0);h(m,y,Gs,"⋱","\\ddots",!0);h(m,y,C,"⋮","\\varvdots");h(m,y,Te,"ˊ","\\acute");h(m,y,Te,"ˋ","\\grave");h(m,y,Te,"¨","\\ddot");h(m,y,Te,"~","\\tilde");h(m,y,Te,"ˉ","\\bar");h(m,y,Te,"˘","\\breve");h(m,y,Te,"ˇ","\\check");h(m,y,Te,"^","\\hat");h(m,y,Te,"⃗","\\vec");h(m,y,Te,"˙","\\dot");h(m,y,Te,"˚","\\mathring");h(m,y,J,"","\\@imath");h(m,y,J,"","\\@jmath");h(m,y,C,"ı","ı");h(m,y,C,"ȷ","ȷ");h(D,y,C,"ı","\\i",!0);h(D,y,C,"ȷ","\\j",!0);h(D,y,C,"ß","\\ss",!0);h(D,y,C,"æ","\\ae",!0);h(D,y,C,"œ","\\oe",!0);h(D,y,C,"ø","\\o",!0);h(D,y,C,"Æ","\\AE",!0);h(D,y,C,"Œ","\\OE",!0);h(D,y,C,"Ø","\\O",!0);h(D,y,Te,"ˊ","\\'");h(D,y,Te,"ˋ","\\`");h(D,y,Te,"ˆ","\\^");h(D,y,Te,"˜","\\~");h(D,y,Te,"ˉ","\\=");h(D,y,Te,"˘","\\u");h(D,y,Te,"˙","\\.");h(D,y,Te,"¸","\\c");h(D,y,Te,"˚","\\r");h(D,y,Te,"ˇ","\\v");h(D,y,Te,"¨",'\\"');h(D,y,Te,"˝","\\H");h(D,y,Te,"◯","\\textcircled");var Z5={"--":!0,"---":!0,"``":!0,"''":!0};h(D,y,C,"–","--",!0);h(D,y,C,"–","\\textendash");h(D,y,C,"—","---",!0);h(D,y,C,"—","\\textemdash");h(D,y,C,"‘","`",!0);h(D,y,C,"‘","\\textquoteleft");h(D,y,C,"’","'",!0);h(D,y,C,"’","\\textquoteright");h(D,y,C,"“","``",!0);h(D,y,C,"“","\\textquotedblleft");h(D,y,C,"”","''",!0);h(D,y,C,"”","\\textquotedblright");h(m,y,C,"°","\\degree",!0);h(D,y,C,"°","\\degree");h(D,y,C,"°","\\textdegree",!0);h(m,y,C,"£","\\pounds");h(m,y,C,"£","\\mathsterling",!0);h(D,y,C,"£","\\pounds");h(D,y,C,"£","\\textsterling",!0);h(m,b,C,"✠","\\maltese");h(D,b,C,"✠","\\maltese");var Ym='0123456789/@."';for(var yc=0;yc{if(Xn(r.classes)!==Xn(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var n in r.style)if(r.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;for(var i in e.style)if(e.style.hasOwnProperty(i)&&r.style[i]!==e.style[i])return!1;return!0},pT=r=>{for(var e=0;et&&(t=o.height),o.depth>n&&(n=o.depth),o.maxFontSize>i&&(i=o.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=i},wt=function(e,t,n,i){var s=new Tl(e,t,n,i);return $h(s),s},e6=(r,e,t,n)=>new Tl(r,e,t,n),mT=function(e,t,n){var i=wt([e],[],t);return i.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i.style.borderBottomWidth=L(i.height),i.maxFontSize=1,i},gT=function(e,t,n,i){var s=new Fh(e,t,n,i);return $h(s),s},t6=function(e){var t=new Ml(e);return $h(t),t},yT=function(e,t){return e instanceof Ml?wt([],[e],t):e},vT=function(e){if(e.positionType==="individualShift"){for(var t=e.children,n=[t[0]],i=-t[0].shift-t[0].elem.depth,s=i,o=1;o{var t=wt(["mspace"],[],e),n=Ne(r,e);return t.style.marginRight=L(n),t},oa=function(e,t,n){var i="";switch(e){case"amsrm":i="AMS";break;case"textrm":i="Main";break;case"textsf":i="SansSerif";break;case"texttt":i="Typewriter";break;default:i=e}var s;return t==="textbf"&&n==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",i+"-"+s},r6={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},n6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},wT=function(e,t){var[n,i,s]=n6[e],o=new Qn(n),l=new hn([o],{width:L(i),height:L(s),style:"width:"+L(i),viewBox:"0 0 "+1e3*i+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),a=e6(["overlay"],[l],t);return a.height=s,a.style.height=L(s),a.style.width=L(i),a},N={fontMap:r6,makeSymbol:vr,mathsym:cT,makeSpan:wt,makeSvgSpan:e6,makeLineSpan:mT,makeAnchor:gT,makeFragment:t6,wrapFragment:yT,makeVList:xT,makeOrd:dT,makeGlue:kT,staticSvg:wT,svgData:n6,tryCombineChars:pT},Ce={number:3,unit:"mu"},ci={number:4,unit:"mu"},Xr={number:5,unit:"mu"},ST={mord:{mop:Ce,mbin:ci,mrel:Xr,minner:Ce},mop:{mord:Ce,mop:Ce,mrel:Xr,minner:Ce},mbin:{mord:ci,mop:ci,mopen:ci,minner:ci},mrel:{mord:Xr,mop:Xr,mopen:Xr,minner:Xr},mopen:{},mclose:{mop:Ce,mbin:ci,mrel:Xr,minner:Ce},mpunct:{mord:Ce,mop:Ce,mrel:Xr,mopen:Ce,mclose:Ce,mpunct:Ce,minner:Ce},minner:{mord:Ce,mop:Ce,mbin:ci,mrel:Xr,mopen:Ce,mpunct:Ce,minner:Ce}},bT={mord:{mop:Ce},mop:{mord:Ce,mop:Ce},mbin:{},mrel:{},mopen:{},mclose:{mop:Ce},mpunct:{},minner:{mop:Ce}},i6={},b0={},M0={};function $(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,l={type:e,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:n.allowedInMath===void 0?!0:n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},a=0;a{var T=v.classes[0],x=g.classes[0];T==="mbin"&&G.contains(TT,x)?v.classes[0]="mord":x==="mbin"&&G.contains(MT,T)&&(g.classes[0]="mord")},{node:f},d,p),Qm(s,(g,v)=>{var T=ld(v),x=ld(g),w=T&&x?g.hasClass("mtight")?bT[T][x]:ST[T][x]:null;if(w)return N.makeGlue(w,u)},{node:f},d,p),s},Qm=function r(e,t,n,i,s){i&&e.push(i);for(var o=0;od=>{e.splice(f+1,0,d),o++})(o)}i&&e.pop()},s6=function(e){return e instanceof Ml||e instanceof Fh||e instanceof Tl&&e.hasClass("enclosing")?e:null},NT=function r(e,t){var n=s6(e);if(n){var i=n.children;if(i.length){if(t==="right")return r(i[i.length-1],"right");if(t==="left")return r(i[0],"left")}}return e},ld=function(e,t){return e?(t&&(e=NT(e,t)),ET[e.classes[0]]||null):null},pl=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return pn(t.concat(n))},ae=function(e,t,n){if(!e)return pn();if(b0[e.type]){var i=b0[e.type](e,t);if(n&&t.size!==n.size){i=pn(t.sizingClasses(n),[i],t);var s=t.sizeMultiplier/n.sizeMultiplier;i.height*=s,i.depth*=s}return i}else throw new B("Got group of unknown type: '"+e.type+"'")};function la(r,e){var t=pn(["base"],r,e),n=pn(["strut"]);return n.style.height=L(t.height+t.depth),t.depth&&(n.style.verticalAlign=L(-t.depth)),t.children.unshift(n),t}function ad(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var n=We(r,e,"root"),i;n.length===2&&n[1].hasClass("tag")&&(i=n.pop());for(var s=[],o=[],l=0;l0&&(s.push(la(o,e)),o=[]),s.push(n[l]));o.length>0&&s.push(la(o,e));var u;t?(u=la(We(t,e,!0)),u.classes=["tag"],s.push(u)):i&&s.push(i);var c=pn(["katex-html"],s);if(c.setAttribute("aria-hidden","true"),u){var f=u.children[0];f.style.height=L(c.height+c.depth),c.depth&&(f.style.verticalAlign=L(-c.depth))}return c}function o6(r){return new Ml(r)}class rr{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=Xn(this.classes));for(var n=0;n0&&(e+=' class ="'+G.escape(Xn(this.classes))+'"'),e+=">";for(var n=0;n",e}toText(){return this.children.map(e=>e.toText()).join("")}}class Vo{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return G.escape(this.toText())}toText(){return this.text}}class AT{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",L(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var R={MathNode:rr,TextNode:Vo,SpaceNode:AT,newDocumentFragment:o6},fr=function(e,t,n){return ve[t][e]&&ve[t][e].replace&&e.charCodeAt(0)!==55349&&!(Z5.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)==="tt"||n.font&&n.font.slice(4,6)==="tt"))&&(e=ve[t][e].replace),new R.TextNode(e)},Vh=function(e){return e.length===1?e[0]:new R.MathNode("mrow",e)},Hh=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var n=t.font;if(!n||n==="mathnormal")return null;var i=e.mode;if(n==="mathit")return"italic";if(n==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(n==="mathbf")return"bold";if(n==="mathbb")return"double-struck";if(n==="mathfrak")return"fraktur";if(n==="mathscr"||n==="mathcal")return"script";if(n==="mathsf")return"sans-serif";if(n==="mathtt")return"monospace";var s=e.text;if(G.contains(["\\imath","\\jmath"],s))return null;ve[i][s]&&ve[i][s].replace&&(s=ve[i][s].replace);var o=N.fontMap[n].fontName;return Lh(s,o,i)?N.fontMap[n].variant:null},Dt=function(e,t,n){if(e.length===1){var i=ge(e[0],t);return n&&i instanceof rr&&i.type==="mo"&&(i.setAttribute("lspace","0em"),i.setAttribute("rspace","0em")),[i]}for(var s=[],o,l=0;l0&&(f.text=f.text.slice(0,1)+"̸"+f.text.slice(1),s.pop())}}}s.push(a),o=a}return s},Zn=function(e,t,n){return Vh(Dt(e,t,n))},ge=function(e,t){if(!e)return new R.MathNode("mrow");if(M0[e.type]){var n=M0[e.type](e,t);return n}else throw new B("Got group of unknown type: '"+e.type+"'")};function Zm(r,e,t,n,i){var s=Dt(r,t),o;s.length===1&&s[0]instanceof rr&&G.contains(["mrow","mtable"],s[0].type)?o=s[0]:o=new R.MathNode("mrow",s);var l=new R.MathNode("annotation",[new R.TextNode(e)]);l.setAttribute("encoding","application/x-tex");var a=new R.MathNode("semantics",[o,l]),u=new R.MathNode("math",[a]);u.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&u.setAttribute("display","block");var c=i?"katex":"katex-mathml";return N.makeSpan([c],[u])}var l6=function(e){return new tn({style:e.displayMode?Y.DISPLAY:Y.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},a6=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=N.makeSpan(n,[e])}return e},OT=function(e,t,n){var i=l6(n),s;if(n.output==="mathml")return Zm(e,t,i,n.displayMode,!0);if(n.output==="html"){var o=ad(e,i);s=N.makeSpan(["katex"],[o])}else{var l=Zm(e,t,i,n.displayMode,!1),a=ad(e,i);s=N.makeSpan(["katex"],[l,a])}return a6(s,n)},zT=function(e,t,n){var i=l6(n),s=ad(e,i),o=N.makeSpan(["katex"],[s]);return a6(o,n)},IT={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},DT=function(e){var t=new R.MathNode("mo",[new R.TextNode(IT[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},RT={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},PT=function(e){return e.type==="ordgroup"?e.body.length:1},BT=function(e,t){function n(){var l=4e5,a=e.label.slice(1);if(G.contains(["widehat","widecheck","widetilde","utilde"],a)){var u=e,c=PT(u.base),f,d,p;if(c>5)a==="widehat"||a==="widecheck"?(f=420,l=2364,p=.42,d=a+"4"):(f=312,l=2340,p=.34,d="tilde4");else{var g=[1,1,2,2,3,3][c];a==="widehat"||a==="widecheck"?(l=[0,1062,2364,2364,2364][g],f=[0,239,300,360,420][g],p=[0,.24,.3,.3,.36,.42][g],d=a+g):(l=[0,600,1033,2339,2340][g],f=[0,260,286,306,312][g],p=[0,.26,.286,.3,.306,.34][g],d="tilde"+g)}var v=new Qn(d),T=new hn([v],{width:"100%",height:L(p),viewBox:"0 0 "+l+" "+f,preserveAspectRatio:"none"});return{span:N.makeSvgSpan([],[T],t),minWidth:0,height:p}}else{var x=[],w=RT[a],[S,E,A]=w,z=A/1e3,I=S.length,O,W;if(I===1){var K=w[3];O=["hide-tail"],W=[K]}else if(I===2)O=["halfarrow-left","halfarrow-right"],W=["xMinYMin","xMaxYMin"];else if(I===3)O=["brace-left","brace-center","brace-right"],W=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support + `+I+" children.");for(var de=0;de0&&(i.style.minWidth=L(s)),i},LT=function(e,t,n,i,s){var o,l=e.height+e.depth+n+i;if(/fbox|color|angl/.test(t)){if(o=N.makeSpan(["stretchy",t],[],s),t==="fbox"){var a=s.color&&s.getColor();a&&(o.style.borderColor=a)}}else{var u=[];/^[bx]cancel$/.test(t)&&u.push(new sd({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&u.push(new sd({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new hn(u,{width:"100%",height:L(l)});o=N.makeSvgSpan([],[c],s)}return o.height=l,o.style.height=L(l),o},mn={encloseSpan:LT,mathMLnode:DT,svgSpan:BT};function re(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function qh(r){var e=nu(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function nu(r){return r&&(r.type==="atom"||aT.hasOwnProperty(r.type))?r:null}var _h=(r,e)=>{var t,n,i;r&&r.type==="supsub"?(n=re(r.base,"accent"),t=n.base,r.base=t,i=oT(ae(r,e)),r.base=n):(n=re(r,"accent"),t=n.base);var s=ae(t,e.havingCrampedStyle()),o=n.isShifty&&G.isCharacterBox(t),l=0;if(o){var a=G.getBaseElem(t),u=ae(a,e.havingCrampedStyle());l=jm(u).skew}var c=n.label==="\\c",f=c?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),d;if(n.isStretchy)d=mn.svgSpan(n,e),d=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:d,wrapperClasses:["svg-align"],wrapperStyle:l>0?{width:"calc(100% - "+L(2*l)+")",marginLeft:L(2*l)}:void 0}]},e);else{var p,g;n.label==="\\vec"?(p=N.staticSvg("vec",e),g=N.svgData.vec[1]):(p=N.makeOrd({mode:n.mode,text:n.label},e,"textord"),p=jm(p),p.italic=0,g=p.width,c&&(f+=p.depth)),d=N.makeSpan(["accent-body"],[p]);var v=n.label==="\\textcircled";v&&(d.classes.push("accent-full"),f=s.height);var T=l;v||(T-=g/2),d.style.left=L(T),n.label==="\\textcircled"&&(d.style.top=".2em"),d=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-f},{type:"elem",elem:d}]},e)}var x=N.makeSpan(["mord","accent"],[d],e);return i?(i.children[0]=x,i.height=Math.max(x.height,i.height),i.classes[0]="mord",i):x},u6=(r,e)=>{var t=r.isStretchy?mn.mathMLnode(r.label):new R.MathNode("mo",[fr(r.label,r.mode)]),n=new R.MathNode("mover",[ge(r.base,e),t]);return n.setAttribute("accent","true"),n},FT=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));$({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=T0(e[0]),n=!FT.test(r.funcName),i=!n||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:n,isShifty:i,base:t}},htmlBuilder:_h,mathmlBuilder:u6});$({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],n=r.parser.mode;return n==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:_h,mathmlBuilder:u6});$({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"accentUnder",mode:t.mode,label:n,base:i}},htmlBuilder:(r,e)=>{var t=ae(r.base,e),n=mn.svgSpan(r,e),i=r.label==="\\utilde"?.12:0,s=N.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:i},{type:"elem",elem:t}]},e);return N.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=mn.mathMLnode(r.label),n=new R.MathNode("munder",[ge(r.base,e),t]);return n.setAttribute("accentunder","true"),n}});var aa=r=>{var e=new R.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};$({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n,funcName:i}=r;return{type:"xArrow",mode:n.mode,label:i,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,n=e.havingStyle(t.sup()),i=N.wrapFragment(ae(r.body,n,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";i.classes.push(s+"-arrow-pad");var o;r.below&&(n=e.havingStyle(t.sub()),o=N.wrapFragment(ae(r.below,n,e),e),o.classes.push(s+"-arrow-pad"));var l=mn.svgSpan(r,e),a=-e.fontMetrics().axisHeight+.5*l.height,u=-e.fontMetrics().axisHeight-.5*l.height-.111;(i.depth>.25||r.label==="\\xleftequilibrium")&&(u-=i.depth);var c;if(o){var f=-e.fontMetrics().axisHeight+o.height+.5*l.height+.111;c=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:a},{type:"elem",elem:o,shift:f}]},e)}else c=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:a}]},e);return c.children[0].children[0].children[1].classes.push("svg-align"),N.makeSpan(["mrel","x-arrow"],[c],e)},mathmlBuilder(r,e){var t=mn.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var n;if(r.body){var i=aa(ge(r.body,e));if(r.below){var s=aa(ge(r.below,e));n=new R.MathNode("munderover",[t,s,i])}else n=new R.MathNode("mover",[t,i])}else if(r.below){var o=aa(ge(r.below,e));n=new R.MathNode("munder",[t,o])}else n=aa(),n=new R.MathNode("mover",[t,n]);return n}});var $T=N.makeSpan;function c6(r,e){var t=We(r.body,e,!0);return $T([r.mclass],t,e)}function f6(r,e){var t,n=Dt(r.body,e);return r.mclass==="minner"?t=new R.MathNode("mpadded",n):r.mclass==="mord"?r.isCharacterBox?(t=n[0],t.type="mi"):t=new R.MathNode("mi",n):(r.isCharacterBox?(t=n[0],t.type="mo"):t=new R.MathNode("mo",n),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}$({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+n.slice(5),body:Be(i),isCharacterBox:G.isCharacterBox(i)}},htmlBuilder:c6,mathmlBuilder:f6});var iu=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};$({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:iu(e[0]),body:Be(e[1]),isCharacterBox:G.isCharacterBox(e[1])}}});$({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:n}=r,i=e[1],s=e[0],o;n!=="\\stackrel"?o=iu(i):o="mrel";var l={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:n!=="\\stackrel",body:Be(i)},a={type:"supsub",mode:s.mode,base:l,sup:n==="\\underset"?null:s,sub:n==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[a],isCharacterBox:G.isCharacterBox(a)}},htmlBuilder:c6,mathmlBuilder:f6});$({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:iu(e[0]),body:Be(e[0])}},htmlBuilder(r,e){var t=We(r.body,e,!0),n=N.makeSpan([r.mclass],t,e);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(r,e){var t=Dt(r.body,e),n=new R.MathNode("mstyle",t);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});var VT={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},e4=()=>({type:"styling",body:[],mode:"math",style:"display"}),t4=r=>r.type==="textord"&&r.text==="@",HT=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function qT(r,e,t){var n=VT[r];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(n,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var i=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:n,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),l=t.callFunction("\\\\cdright",[e[1]],[]),a={type:"ordgroup",mode:"math",body:[i,o,l]};return t.callFunction("\\\\cdparent",[a],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var u={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[u],[])}default:return{type:"textord",text:" ",mode:"math"}}}function _T(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new B("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var n=[],i=[n],s=0;s-1))if("<>AV".indexOf(u)>-1)for(var f=0;f<2;f++){for(var d=!0,p=a+1;pAV=|." after @',o[a]);var g=qT(u,c,r),v={type:"styling",body:[g],mode:"math",style:"display"};n.push(v),l=e4()}s%2===0?n.push(l):n.shift(),n=[],i.push(n)}r.gullet.endGroup(),r.gullet.endGroup();var T=new Array(i[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:T,colSeparationType:"CD",hLinesBeforeRow:new Array(i.length+1).fill([])}}$({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"cdlabel",mode:t.mode,side:n.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),n=N.wrapFragment(ae(r.label,t,e),e);return n.classes.push("cd-label-"+r.side),n.style.bottom=L(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(r,e){var t=new R.MathNode("mrow",[ge(r.label,e)]);return t=new R.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new R.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});$({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=N.wrapFragment(ae(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new R.MathNode("mrow",[ge(r.fragment,e)])}});$({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,n=re(e[0],"ordgroup"),i=n.body,s="",o=0;o=1114111)throw new B("\\@char with invalid code point "+s);return a<=65535?u=String.fromCharCode(a):(a-=65536,u=String.fromCharCode((a>>10)+55296,(a&1023)+56320)),{type:"textord",mode:t.mode,text:u}}});var d6=(r,e)=>{var t=We(r.body,e.withColor(r.color),!1);return N.makeFragment(t)},h6=(r,e)=>{var t=Dt(r.body,e.withColor(r.color)),n=new R.MathNode("mstyle",t);return n.setAttribute("mathcolor",r.color),n};$({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,n=re(e[0],"color-token").color,i=e[1];return{type:"color",mode:t.mode,color:n,body:Be(i)}},htmlBuilder:d6,mathmlBuilder:h6});$({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:n}=r,i=re(e[0],"color-token").color;t.gullet.macros.set("\\current@color",i);var s=t.parseExpression(!0,n);return{type:"color",mode:t.mode,color:i,body:s}},htmlBuilder:d6,mathmlBuilder:h6});$({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:n}=r,i=n.gullet.future().text==="["?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:i&&re(i,"size").value}},htmlBuilder(r,e){var t=N.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=L(Ne(r.size,e)))),t},mathmlBuilder(r,e){var t=new R.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",L(Ne(r.size,e)))),t}});var ud={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},p6=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new B("Expected a control sequence",r);return e},UT=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},m6=(r,e,t,n)=>{var i=r.gullet.macros.get(t.text);i==null&&(t.noexpand=!0,i={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,i,n)};$({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var n=e.fetch();if(ud[n.text])return(t==="\\global"||t==="\\\\globallong")&&(n.text=ud[n.text]),re(e.parseFunction(),"internal");throw new B("Invalid token after macro prefix",n)}});$({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=e.gullet.popToken(),i=n.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B("Expected a control sequence",n);for(var s=0,o,l=[[]];e.gullet.future().text!=="{";)if(n=e.gullet.popToken(),n.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),l[s].push("{");break}if(n=e.gullet.popToken(),!/^[1-9]$/.test(n.text))throw new B('Invalid argument number "'+n.text+'"');if(parseInt(n.text)!==s+1)throw new B('Argument number "'+n.text+'" out of order');s++,l.push([])}else{if(n.text==="EOF")throw new B("Expected a macro definition");l[s].push(n.text)}var{tokens:a}=e.gullet.consumeArg();return o&&a.unshift(o),(t==="\\edef"||t==="\\xdef")&&(a=e.gullet.expandTokens(a),a.reverse()),e.gullet.macros.set(i,{tokens:a,numArgs:s,delimiters:l},t===ud[t]),{type:"internal",mode:e.mode}}});$({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=p6(e.gullet.popToken());e.gullet.consumeSpaces();var i=UT(e);return m6(e,n,i,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});$({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,n=p6(e.gullet.popToken()),i=e.gullet.popToken(),s=e.gullet.popToken();return m6(e,n,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(i),{type:"internal",mode:e.mode}}});var Mo=function(e,t,n){var i=ve.math[e]&&ve.math[e].replace,s=Lh(i||e,t,n);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},Uh=function(e,t,n,i){var s=n.havingBaseStyle(t),o=N.makeSpan(i.concat(s.sizingClasses(n)),[e],n),l=s.sizeMultiplier/n.sizeMultiplier;return o.height*=l,o.depth*=l,o.maxFontSize=s.sizeMultiplier,o},g6=function(e,t,n){var i=t.havingBaseStyle(n),s=(1-t.sizeMultiplier/i.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=L(s),e.height-=s,e.depth+=s},WT=function(e,t,n,i,s,o){var l=N.makeSymbol(e,"Main-Regular",s,i),a=Uh(l,t,i,o);return n&&g6(a,i,t),a},jT=function(e,t,n,i){return N.makeSymbol(e,"Size"+t+"-Regular",n,i)},y6=function(e,t,n,i,s,o){var l=jT(e,t,s,i),a=Uh(N.makeSpan(["delimsizing","size"+t],[l],i),Y.TEXT,i,o);return n&&g6(a,i,Y.TEXT),a},wc=function(e,t,n){var i;t==="Size1-Regular"?i="delim-size1":i="delim-size4";var s=N.makeSpan(["delimsizinginner",i],[N.makeSpan([],[N.makeSymbol(e,t,n)])]);return{type:"elem",elem:s}},Sc=function(e,t,n){var i=Vr["Size4-Regular"][e.charCodeAt(0)]?Vr["Size4-Regular"][e.charCodeAt(0)][4]:Vr["Size1-Regular"][e.charCodeAt(0)][4],s=new Qn("inner",QM(e,Math.round(1e3*t))),o=new hn([s],{width:L(i),height:L(t),style:"width:"+L(i),viewBox:"0 0 "+1e3*i+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),l=N.makeSvgSpan([],[o],n);return l.height=t,l.style.height=L(t),l.style.width=L(i),{type:"elem",elem:l}},cd=.008,ua={type:"kern",size:-1*cd},YT=["|","\\lvert","\\rvert","\\vert"],JT=["\\|","\\lVert","\\rVert","\\Vert"],v6=function(e,t,n,i,s,o){var l,a,u,c,f="",d=0;l=u=c=e,a=null;var p="Size1-Regular";e==="\\uparrow"?u=c="⏐":e==="\\Uparrow"?u=c="‖":e==="\\downarrow"?l=u="⏐":e==="\\Downarrow"?l=u="‖":e==="\\updownarrow"?(l="\\uparrow",u="⏐",c="\\downarrow"):e==="\\Updownarrow"?(l="\\Uparrow",u="‖",c="\\Downarrow"):G.contains(YT,e)?(u="∣",f="vert",d=333):G.contains(JT,e)?(u="∥",f="doublevert",d=556):e==="["||e==="\\lbrack"?(l="⎡",u="⎢",c="⎣",p="Size4-Regular",f="lbrack",d=667):e==="]"||e==="\\rbrack"?(l="⎤",u="⎥",c="⎦",p="Size4-Regular",f="rbrack",d=667):e==="\\lfloor"||e==="⌊"?(u=l="⎢",c="⎣",p="Size4-Regular",f="lfloor",d=667):e==="\\lceil"||e==="⌈"?(l="⎡",u=c="⎢",p="Size4-Regular",f="lceil",d=667):e==="\\rfloor"||e==="⌋"?(u=l="⎥",c="⎦",p="Size4-Regular",f="rfloor",d=667):e==="\\rceil"||e==="⌉"?(l="⎤",u=c="⎥",p="Size4-Regular",f="rceil",d=667):e==="("||e==="\\lparen"?(l="⎛",u="⎜",c="⎝",p="Size4-Regular",f="lparen",d=875):e===")"||e==="\\rparen"?(l="⎞",u="⎟",c="⎠",p="Size4-Regular",f="rparen",d=875):e==="\\{"||e==="\\lbrace"?(l="⎧",a="⎨",c="⎩",u="⎪",p="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(l="⎫",a="⎬",c="⎭",u="⎪",p="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(l="⎧",c="⎩",u="⎪",p="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(l="⎫",c="⎭",u="⎪",p="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(l="⎧",c="⎭",u="⎪",p="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(l="⎫",c="⎩",u="⎪",p="Size4-Regular");var g=Mo(l,p,s),v=g.height+g.depth,T=Mo(u,p,s),x=T.height+T.depth,w=Mo(c,p,s),S=w.height+w.depth,E=0,A=1;if(a!==null){var z=Mo(a,p,s);E=z.height+z.depth,A=2}var I=v+S+E,O=Math.max(0,Math.ceil((t-I)/(A*x))),W=I+O*A*x,K=i.fontMetrics().axisHeight;n&&(K*=i.sizeMultiplier);var de=W/2-K,xe=[];if(f.length>0){var Rt=W-v-S,Xe=Math.round(W*1e3),Pt=ZM(f,Math.round(Rt*1e3)),Jt=new Qn(f,Pt),Ar=(d/1e3).toFixed(3)+"em",V=(Xe/1e3).toFixed(3)+"em",Q=new hn([Jt],{width:Ar,height:V,viewBox:"0 0 "+d+" "+Xe}),X=N.makeSvgSpan([],[Q],i);X.height=Xe/1e3,X.style.width=Ar,X.style.height=V,xe.push({type:"elem",elem:X})}else{if(xe.push(wc(c,p,s)),xe.push(ua),a===null){var ce=W-v-S+2*cd;xe.push(Sc(u,ce,i))}else{var ue=(W-v-S-E)/2+2*cd;xe.push(Sc(u,ue,i)),xe.push(ua),xe.push(wc(a,p,s)),xe.push(ua),xe.push(Sc(u,ue,i))}xe.push(ua),xe.push(wc(l,p,s))}var Or=i.havingBaseStyle(Y.TEXT),hr=N.makeVList({positionType:"bottom",positionData:de,children:xe},Or);return Uh(N.makeSpan(["delimsizing","mult"],[hr],Or),Y.TEXT,i,o)},bc=80,Mc=.08,Tc=function(e,t,n,i,s){var o=XM(e,i,n),l=new Qn(e,o),a=new hn([l],{width:"400em",height:L(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"});return N.makeSvgSpan(["hide-tail"],[a],s)},KT=function(e,t){var n=t.havingBaseSizing(),i=S6("\\surd",e*n.sizeMultiplier,w6,n),s=n.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l,a=0,u=0,c=0,f;return i.type==="small"?(c=1e3+1e3*o+bc,e<1?s=1:e<1.4&&(s=.7),a=(1+o+Mc)/s,u=(1+o)/s,l=Tc("sqrtMain",a,c,o,t),l.style.minWidth="0.853em",f=.833/s):i.type==="large"?(c=(1e3+bc)*Ho[i.size],u=(Ho[i.size]+o)/s,a=(Ho[i.size]+o+Mc)/s,l=Tc("sqrtSize"+i.size,a,c,o,t),l.style.minWidth="1.02em",f=1/s):(a=e+o+Mc,u=e+o,c=Math.floor(1e3*e+o)+bc,l=Tc("sqrtTall",a,c,o,t),l.style.minWidth="0.742em",f=1.056),l.height=u,l.style.height=L(a),{span:l,advanceWidth:f,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},x6=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],GT=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],k6=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Ho=[0,1.2,1.8,2.4,3],XT=function(e,t,n,i,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),G.contains(x6,e)||G.contains(k6,e))return y6(e,t,!1,n,i,s);if(G.contains(GT,e))return v6(e,Ho[t],!1,n,i,s);throw new B("Illegal delimiter: '"+e+"'")},QT=[{type:"small",style:Y.SCRIPTSCRIPT},{type:"small",style:Y.SCRIPT},{type:"small",style:Y.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],ZT=[{type:"small",style:Y.SCRIPTSCRIPT},{type:"small",style:Y.SCRIPT},{type:"small",style:Y.TEXT},{type:"stack"}],w6=[{type:"small",style:Y.SCRIPTSCRIPT},{type:"small",style:Y.SCRIPT},{type:"small",style:Y.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],eC=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},S6=function(e,t,n,i){for(var s=Math.min(2,3-i.style.size),o=s;ot)return n[o]}return n[n.length-1]},b6=function(e,t,n,i,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var l;G.contains(k6,e)?l=QT:G.contains(x6,e)?l=w6:l=ZT;var a=S6(e,t,l,i);return a.type==="small"?WT(e,a.style,n,i,s,o):a.type==="large"?y6(e,a.size,n,i,s,o):v6(e,t,n,i,s,o)},tC=function(e,t,n,i,s,o){var l=i.fontMetrics().axisHeight*i.sizeMultiplier,a=901,u=5/i.fontMetrics().ptPerEm,c=Math.max(t-l,n+l),f=Math.max(c/500*a,2*c-u);return b6(e,f,!0,i,s,o)},an={sqrtImage:KT,sizedDelim:XT,sizeToMaxHeight:Ho,customSizedDelim:b6,leftRightDelim:tC},r4={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},rC=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function su(r,e){var t=nu(r);if(t&&G.contains(rC,t.text))return t;throw t?new B("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new B("Invalid delimiter type '"+r.type+"'",r)}$({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=su(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:r4[r.funcName].size,mclass:r4[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?N.makeSpan([r.mclass]):an.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(fr(r.delim,r.mode));var t=new R.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var n=L(an.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",n),t.setAttribute("maxsize",n),t}});function n4(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}$({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new B("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:su(e[0],r).text,color:t}}});$({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=su(e[0],r),n=r.parser;++n.leftrightDepth;var i=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var s=re(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:i,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{n4(r);for(var t=We(r.body,e,!0,["mopen","mclose"]),n=0,i=0,s=!1,o=0;o{n4(r);var t=Dt(r.body,e);if(r.left!=="."){var n=new R.MathNode("mo",[fr(r.left,r.mode)]);n.setAttribute("fence","true"),t.unshift(n)}if(r.right!=="."){var i=new R.MathNode("mo",[fr(r.right,r.mode)]);i.setAttribute("fence","true"),r.rightColor&&i.setAttribute("mathcolor",r.rightColor),t.push(i)}return Vh(t)}});$({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=su(e[0],r);if(!r.parser.leftrightDepth)throw new B("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=pl(e,[]);else{t=an.sizedDelim(r.delim,1,e,r.mode,[]);var n={delim:r.delim,options:e};t.isMiddle=n}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?fr("|","text"):fr(r.delim,r.mode),n=new R.MathNode("mo",[t]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});var Wh=(r,e)=>{var t=N.wrapFragment(ae(r.body,e),e),n=r.label.slice(1),i=e.sizeMultiplier,s,o=0,l=G.isCharacterBox(r.body);if(n==="sout")s=N.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/i,o=-.5*e.fontMetrics().xHeight;else if(n==="phase"){var a=Ne({number:.6,unit:"pt"},e),u=Ne({number:.35,unit:"ex"},e),c=e.havingBaseSizing();i=i/c.sizeMultiplier;var f=t.height+t.depth+a+u;t.style.paddingLeft=L(f/2+a);var d=Math.floor(1e3*f*i),p=KM(d),g=new hn([new Qn("phase",p)],{width:"400em",height:L(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});s=N.makeSvgSpan(["hide-tail"],[g],e),s.style.height=L(f),o=t.depth+a+u}else{/cancel/.test(n)?l||t.classes.push("cancel-pad"):n==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var v=0,T=0,x=0;/box/.test(n)?(x=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),v=e.fontMetrics().fboxsep+(n==="colorbox"?0:x),T=v):n==="angl"?(x=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),v=4*x,T=Math.max(0,.25-t.depth)):(v=l?.2:0,T=v),s=mn.encloseSpan(t,n,v,T,e),/fbox|boxed|fcolorbox/.test(n)?(s.style.borderStyle="solid",s.style.borderWidth=L(x)):n==="angl"&&x!==.049&&(s.style.borderTopWidth=L(x),s.style.borderRightWidth=L(x)),o=t.depth+T,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var w;if(r.backgroundColor)w=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var S=/cancel|phase/.test(n)?["svg-align"]:[];w=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:S}]},e)}return/cancel/.test(n)&&(w.height=t.height,w.depth=t.depth),/cancel/.test(n)&&!l?N.makeSpan(["mord","cancel-lap"],[w],e):N.makeSpan(["mord"],[w],e)},jh=(r,e)=>{var t=0,n=new R.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[ge(r.body,e)]);switch(r.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*t+"pt"),n.setAttribute("height","+"+2*t+"pt"),n.setAttribute("lspace",t+"pt"),n.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var i=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);n.setAttribute("style","border: "+i+"em solid "+String(r.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&n.setAttribute("mathbackground",r.backgroundColor),n};$({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=re(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:n.mode,label:i,backgroundColor:s,body:o}},htmlBuilder:Wh,mathmlBuilder:jh});$({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:n,funcName:i}=r,s=re(e[0],"color-token").color,o=re(e[1],"color-token").color,l=e[2];return{type:"enclose",mode:n.mode,label:i,backgroundColor:o,borderColor:s,body:l}},htmlBuilder:Wh,mathmlBuilder:jh});$({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});$({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"enclose",mode:t.mode,label:n,body:i}},htmlBuilder:Wh,mathmlBuilder:jh});$({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var M6={};function Jr(r){for(var{type:e,names:t,props:n,handler:i,htmlBuilder:s,mathmlBuilder:o}=r,l={type:e,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},a=0;a{var e=r.parser.settings;if(!e.displayMode)throw new B("{"+r.envName+"} can be used only in display mode.")};function Yh(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function ai(r,e,t){var{hskipBeforeAndAfter:n,addJot:i,cols:s,arraystretch:o,colSeparationType:l,autoTag:a,singleRow:u,emptySingleRow:c,maxNumCols:f,leqno:d}=e;if(r.gullet.beginGroup(),u||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var p=r.gullet.expandMacroAsText("\\arraystretch");if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B("Invalid \\arraystretch: "+p)}r.gullet.beginGroup();var g=[],v=[g],T=[],x=[],w=a!=null?[]:void 0;function S(){a&&r.gullet.macros.set("\\@eqnsw","1",!0)}function E(){w&&(r.gullet.macros.get("\\df@tag")?(w.push(r.subparse([new Yn("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):w.push(!!a&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(S(),x.push(i4(r));;){var A=r.parseExpression(!1,u?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),A={type:"ordgroup",mode:r.mode,body:A},t&&(A={type:"styling",mode:r.mode,style:t,body:[A]}),g.push(A);var z=r.fetch().text;if(z==="&"){if(f&&g.length===f){if(u||l)throw new B("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(z==="\\end"){E(),g.length===1&&A.type==="styling"&&A.body[0].body.length===0&&(v.length>1||!c)&&v.pop(),x.length0&&(S+=.25),u.push({pos:S,isDashed:Ol[zl]})}for(E(o[0]),n=0;n0&&(de+=w,IOl))for(n=0;n=l)){var pr=void 0;(i>0||e.hskipBeforeAndAfter)&&(pr=G.deflt(ue.pregap,d),pr!==0&&(Pt=N.makeSpan(["arraycolsep"],[]),Pt.style.width=L(pr),Xe.push(Pt)));var Yi=[];for(n=0;n0){for(var G6=N.makeLineSpan("hline",t,c),X6=N.makeLineSpan("hdashline",t,c),uu=[{type:"elem",elem:a,shift:0}];u.length>0;){var op=u.pop(),lp=op.pos-xe;op.isDashed?uu.push({type:"elem",elem:X6,shift:lp}):uu.push({type:"elem",elem:G6,shift:lp})}a=N.makeVList({positionType:"individualShift",children:uu},t)}if(Ar.length===0)return N.makeSpan(["mord"],[a],t);var cu=N.makeVList({positionType:"individualShift",children:Ar},t);return cu=N.makeSpan(["tag"],[cu],t),N.makeFragment([a,cu])},nC={c:"center ",l:"left ",r:"right "},Gr=function(e,t){for(var n=[],i=new R.MathNode("mtd",[],["mtr-glue"]),s=new R.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var g=e.cols,v="",T=!1,x=0,w=g.length;g[0].type==="separator"&&(d+="top ",x=1),g[g.length-1].type==="separator"&&(d+="bottom ",w-=1);for(var S=x;S0?"left ":"",d+=O[O.length-1].length>0?"right ":"";for(var W=1;W-1?"alignat":"align",s=e.envName==="split",o=ai(e.parser,{cols:n,addJot:!0,autoTag:s?void 0:Yh(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),l,a=0,u={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var c="",f=0;f0&&p&&(T=1),n[g]={type:"align",align:v,pregap:T,postgap:0}}return o.colSeparationType=p?"align":"alignat",o};Jr({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=nu(e[0]),n=t?[e[0]]:re(e[0],"ordgroup").body,i=n.map(function(o){var l=qh(o),a=l.text;if("lcr".indexOf(a)!==-1)return{type:"align",align:a};if(a==="|")return{type:"separator",separator:"|"};if(a===":")return{type:"separator",separator:":"};throw new B("Unknown column alignment: "+a,o)}),s={cols:i,hskipBeforeAndAfter:!0,maxNumCols:i.length};return ai(r.parser,s,Jh(r.envName))},htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",n={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var i=r.parser;if(i.consumeSpaces(),i.fetch().text==="["){if(i.consume(),i.consumeSpaces(),t=i.fetch().text,"lcr".indexOf(t)===-1)throw new B("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),n.cols=[{type:"align",align:t}]}}var s=ai(r.parser,n,Jh(r.envName)),o=Math.max(0,...s.body.map(l=>l.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=ai(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=nu(e[0]),n=t?[e[0]]:re(e[0],"ordgroup").body,i=n.map(function(o){var l=qh(o),a=l.text;if("lc".indexOf(a)!==-1)return{type:"align",align:a};throw new B("Unknown column alignment: "+a,o)});if(i.length>1)throw new B("{subarray} can contain only one column");var s={cols:i,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=ai(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new B("{subarray} can contain only one column");return s},htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=ai(r.parser,e,Jh(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:C6,htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){G.contains(["gather","gather*"],r.envName)&&ou(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Yh(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return ai(r.parser,e,"display")},htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:C6,htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){ou(r);var e={autoTag:Yh(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return ai(r.parser,e,"display")},htmlBuilder:Kr,mathmlBuilder:Gr});Jr({type:"array",names:["CD"],props:{numArgs:0},handler(r){return ou(r),_T(r.parser)},htmlBuilder:Kr,mathmlBuilder:Gr});k("\\nonumber","\\gdef\\@eqnsw{0}");k("\\notag","\\nonumber");$({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new B(r.funcName+" valid only within array environment")}});var s4=M6;$({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];if(i.type!=="ordgroup")throw new B("Invalid environment name",i);for(var s="",o=0;o{var t=r.font,n=e.withFont(t);return ae(r.body,n)},N6=(r,e)=>{var t=r.font,n=e.withFont(t);return ge(r.body,n)},o4={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};$({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=T0(e[0]),s=n;return s in o4&&(s=o4[s]),{type:"font",mode:t.mode,font:s.slice(1),body:i}},htmlBuilder:E6,mathmlBuilder:N6});$({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,n=e[0],i=G.isCharacterBox(n);return{type:"mclass",mode:t.mode,mclass:iu(n),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:n}],isCharacterBox:i}}});$({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n,breakOnTokenText:i}=r,{mode:s}=t,o=t.parseExpression(!0,i),l="math"+n.slice(1);return{type:"font",mode:s,font:l,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:E6,mathmlBuilder:N6});var A6=(r,e)=>{var t=e;return r==="display"?t=t.id>=Y.SCRIPT.id?t.text():Y.DISPLAY:r==="text"&&t.size===Y.DISPLAY.size?t=Y.TEXT:r==="script"?t=Y.SCRIPT:r==="scriptscript"&&(t=Y.SCRIPTSCRIPT),t},Kh=(r,e)=>{var t=A6(r.size,e.style),n=t.fracNum(),i=t.fracDen(),s;s=e.havingStyle(n);var o=ae(r.numer,s,e);if(r.continued){var l=8.5/e.fontMetrics().ptPerEm,a=3.5/e.fontMetrics().ptPerEm;o.height=o.height0?g=3*d:g=7*d,v=e.fontMetrics().denom1):(f>0?(p=e.fontMetrics().num2,g=d):(p=e.fontMetrics().num3,g=3*d),v=e.fontMetrics().denom2);var T;if(c){var w=e.fontMetrics().axisHeight;p-o.depth-(w+.5*f){var t=new R.MathNode("mfrac",[ge(r.numer,e),ge(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var n=Ne(r.barSize,e);t.setAttribute("linethickness",L(n))}var i=A6(r.size,e.style);if(i.size!==e.style.size){t=new R.MathNode("mstyle",[t]);var s=i.size===Y.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var l=new R.MathNode("mo",[new R.TextNode(r.leftDelim.replace("\\",""))]);l.setAttribute("fence","true"),o.push(l)}if(o.push(t),r.rightDelim!=null){var a=new R.MathNode("mo",[new R.TextNode(r.rightDelim.replace("\\",""))]);a.setAttribute("fence","true"),o.push(a)}return Vh(o)}return t};$({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1],o,l=null,a=null,u="auto";switch(n){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,l="(",a=")";break;case"\\\\bracefrac":o=!1,l="\\{",a="\\}";break;case"\\\\brackfrac":o=!1,l="[",a="]";break;default:throw new Error("Unrecognized genfrac command")}switch(n){case"\\dfrac":case"\\dbinom":u="display";break;case"\\tfrac":case"\\tbinom":u="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:i,denom:s,hasBarLine:o,leftDelim:l,rightDelim:a,size:u,barSize:null}},htmlBuilder:Kh,mathmlBuilder:Gh});$({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:i,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});$({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:n}=r,i;switch(t){case"\\over":i="\\frac";break;case"\\choose":i="\\binom";break;case"\\atop":i="\\\\atopfrac";break;case"\\brace":i="\\\\bracefrac";break;case"\\brack":i="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:i,token:n}}});var l4=["display","text","script","scriptscript"],a4=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};$({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,n=e[4],i=e[5],s=T0(e[0]),o=s.type==="atom"&&s.family==="open"?a4(s.text):null,l=T0(e[1]),a=l.type==="atom"&&l.family==="close"?a4(l.text):null,u=re(e[2],"size"),c,f=null;u.isBlank?c=!0:(f=u.value,c=f.number>0);var d="auto",p=e[3];if(p.type==="ordgroup"){if(p.body.length>0){var g=re(p.body[0],"textord");d=l4[Number(g.text)]}}else p=re(p,"textord"),d=l4[Number(p.text)];return{type:"genfrac",mode:t.mode,numer:n,denom:i,continued:!1,hasBarLine:c,barSize:f,leftDelim:o,rightDelim:a,size:d}},htmlBuilder:Kh,mathmlBuilder:Gh});$({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:n,token:i}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:re(e[0],"size").value,token:i}}});$({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0],s=RM(re(e[1],"infix").size),o=e[2],l=s.number>0;return{type:"genfrac",mode:t.mode,numer:i,denom:o,continued:!1,hasBarLine:l,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Kh,mathmlBuilder:Gh});var O6=(r,e)=>{var t=e.style,n,i;r.type==="supsub"?(n=r.sup?ae(r.sup,e.havingStyle(t.sup()),e):ae(r.sub,e.havingStyle(t.sub()),e),i=re(r.base,"horizBrace")):i=re(r,"horizBrace");var s=ae(i.base,e.havingBaseStyle(Y.DISPLAY)),o=mn.svgSpan(i,e),l;if(i.isOver?(l=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),l.children[0].children[0].children[1].classes.push("svg-align")):(l=N.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),l.children[0].children[0].children[0].classes.push("svg-align")),n){var a=N.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e);i.isOver?l=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:n}]},e):l=N.makeVList({positionType:"bottom",positionData:a.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:a}]},e)}return N.makeSpan(["mord",i.isOver?"mover":"munder"],[l],e)},iC=(r,e)=>{var t=mn.mathMLnode(r.label);return new R.MathNode(r.isOver?"mover":"munder",[ge(r.base,e),t])};$({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:n}=r;return{type:"horizBrace",mode:t.mode,label:n,isOver:/^\\over/.test(n),base:e[0]}},htmlBuilder:O6,mathmlBuilder:iC});$({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[1],i=re(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:i})?{type:"href",mode:t.mode,href:i,body:Be(n)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=We(r.body,e,!1);return N.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=Zn(r.body,e);return t instanceof rr||(t=new rr("mrow",[t])),t.setAttribute("href",r.href),t}});$({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=re(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:n}))return t.formatUnsupportedCmd("\\url");for(var i=[],s=0;s{var{parser:t,funcName:n,token:i}=r,s=re(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l,a={};switch(n){case"\\htmlClass":a.class=s,l={command:"\\htmlClass",class:s};break;case"\\htmlId":a.id=s,l={command:"\\htmlId",id:s};break;case"\\htmlStyle":a.style=s,l={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var u=s.split(","),c=0;c{var t=We(r.body,e,!1),n=["enclosing"];r.attributes.class&&n.push(...r.attributes.class.trim().split(/\s+/));var i=N.makeSpan(n,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&i.setAttribute(s,r.attributes[s]);return i},mathmlBuilder:(r,e)=>Zn(r.body,e)});$({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Be(e[0]),mathml:Be(e[1])}},htmlBuilder:(r,e)=>{var t=We(r.html,e,!1);return N.makeFragment(t)},mathmlBuilder:(r,e)=>Zn(r.mathml,e)});var Cc=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!K5(n))throw new B("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};$({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:n}=r,i={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},l="";if(t[0])for(var a=re(t[0],"raw").string,u=a.split(","),c=0;c{var t=Ne(r.height,e),n=0;r.totalheight.number>0&&(n=Ne(r.totalheight,e)-t);var i=0;r.width.number>0&&(i=Ne(r.width,e));var s={height:L(t+n)};i>0&&(s.width=L(i)),n>0&&(s.verticalAlign=L(-n));var o=new iT(r.src,r.alt,s);return o.height=t,o.depth=n,o},mathmlBuilder:(r,e)=>{var t=new R.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var n=Ne(r.height,e),i=0;if(r.totalheight.number>0&&(i=Ne(r.totalheight,e)-n,t.setAttribute("valign",L(-i))),t.setAttribute("height",L(n+i)),r.width.number>0){var s=Ne(r.width,e);t.setAttribute("width",L(s))}return t.setAttribute("src",r.src),t}});$({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=re(e[0],"size");if(t.settings.strict){var s=n[1]==="m",o=i.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, "+("not "+i.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:i.value}},htmlBuilder(r,e){return N.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=Ne(r.dimension,e);return new R.SpaceNode(t)}});$({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"lap",mode:t.mode,alignment:n.slice(5),body:i}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=N.makeSpan([],[ae(r.body,e)]),t=N.makeSpan(["inner"],[t],e)):t=N.makeSpan(["inner"],[ae(r.body,e)]);var n=N.makeSpan(["fix"],[]),i=N.makeSpan([r.alignment],[t,n],e),s=N.makeSpan(["strut"]);return s.style.height=L(i.height+i.depth),i.depth&&(s.style.verticalAlign=L(-i.depth)),i.children.unshift(s),i=N.makeSpan(["thinbox"],[i],e),N.makeSpan(["mord","vbox"],[i],e)},mathmlBuilder:(r,e)=>{var t=new R.MathNode("mpadded",[ge(r.body,e)]);if(r.alignment!=="rlap"){var n=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",n+"width")}return t.setAttribute("width","0px"),t}});$({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:n}=r,i=n.mode;n.switchMode("math");var s=t==="\\("?"\\)":"$",o=n.parseExpression(!1,s);return n.expect(s),n.switchMode(i),{type:"styling",mode:n.mode,style:"text",body:o}}});$({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new B("Mismatched "+r.funcName)}});var u4=(r,e)=>{switch(e.style.size){case Y.DISPLAY.size:return r.display;case Y.TEXT.size:return r.text;case Y.SCRIPT.size:return r.script;case Y.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};$({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Be(e[0]),text:Be(e[1]),script:Be(e[2]),scriptscript:Be(e[3])}},htmlBuilder:(r,e)=>{var t=u4(r,e),n=We(t,e,!1);return N.makeFragment(n)},mathmlBuilder:(r,e)=>{var t=u4(r,e);return Zn(t,e)}});var z6=(r,e,t,n,i,s,o)=>{r=N.makeSpan([],[r]);var l=t&&G.isCharacterBox(t),a,u;if(e){var c=ae(e,n.havingStyle(i.sup()),n);u={elem:c,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-c.depth)}}if(t){var f=ae(t,n.havingStyle(i.sub()),n);a={elem:f,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-f.height)}}var d;if(u&&a){var p=n.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+r.depth+o;d=N.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:L(-s)},{type:"kern",size:a.kern},{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:L(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(a){var g=r.height-o;d=N.makeVList({positionType:"top",positionData:g,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:L(-s)},{type:"kern",size:a.kern},{type:"elem",elem:r}]},n)}else if(u){var v=r.depth+o;d=N.makeVList({positionType:"bottom",positionData:v,children:[{type:"elem",elem:r},{type:"kern",size:u.kern},{type:"elem",elem:u.elem,marginLeft:L(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else return r;var T=[d];if(a&&s!==0&&!l){var x=N.makeSpan(["mspace"],[],n);x.style.marginRight=L(s),T.unshift(x)}return N.makeSpan(["mop","op-limits"],T,n)},I6=["\\smallint"],Xs=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=re(r.base,"op"),i=!0):s=re(r,"op");var o=e.style,l=!1;o.size===Y.DISPLAY.size&&s.symbol&&!G.contains(I6,s.name)&&(l=!0);var a;if(s.symbol){var u=l?"Size2-Regular":"Size1-Regular",c="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(c=s.name.slice(1),s.name=c==="oiint"?"\\iint":"\\iiint"),a=N.makeSymbol(s.name,u,"math",e,["mop","op-symbol",l?"large-op":"small-op"]),c.length>0){var f=a.italic,d=N.staticSvg(c+"Size"+(l?"2":"1"),e);a=N.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},e),s.name="\\"+c,a.classes.unshift("mop"),a.italic=f}}else if(s.body){var p=We(s.body,e,!0);p.length===1&&p[0]instanceof cr?(a=p[0],a.classes[0]="mop"):a=N.makeSpan(["mop"],p,e)}else{for(var g=[],v=1;v{var t;if(r.symbol)t=new rr("mo",[fr(r.name,r.mode)]),G.contains(I6,r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new rr("mo",Dt(r.body,e));else{t=new rr("mi",[new Vo(r.name.slice(1))]);var n=new rr("mo",[fr("⁡","text")]);r.parentIsSupSub?t=new rr("mrow",[t,n]):t=o6([t,n])}return t},sC={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};$({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=n;return i.length===1&&(i=sC[i]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:Xs,mathmlBuilder:Cl});$({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Be(n)}},htmlBuilder:Xs,mathmlBuilder:Cl});var oC={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};$({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Xs,mathmlBuilder:Cl});$({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:Xs,mathmlBuilder:Cl});$({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r,n=t;return n.length===1&&(n=oC[n]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:Xs,mathmlBuilder:Cl});var D6=(r,e)=>{var t,n,i=!1,s;r.type==="supsub"?(t=r.sup,n=r.sub,s=re(r.base,"operatorname"),i=!0):s=re(r,"operatorname");var o;if(s.body.length>0){for(var l=s.body.map(f=>{var d=f.text;return typeof d=="string"?{type:"textord",mode:f.mode,text:d}:f}),a=We(l,e.withFont("mathrm"),!0),u=0;u{for(var t=Dt(r.body,e.withFont("mathrm")),n=!0,i=0;ic.toText()).join("");t=[new R.TextNode(l)]}var a=new R.MathNode("mi",t);a.setAttribute("mathvariant","normal");var u=new R.MathNode("mo",[fr("⁡","text")]);return r.parentIsSupSub?new R.MathNode("mrow",[a,u]):R.newDocumentFragment([a,u])};$({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:n}=r,i=e[0];return{type:"operatorname",mode:t.mode,body:Be(i),alwaysHandleSupSub:n==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:D6,mathmlBuilder:lC});k("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");ji({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?N.makeFragment(We(r.body,e,!1)):N.makeSpan(["mord"],We(r.body,e,!0),e)},mathmlBuilder(r,e){return Zn(r.body,e,!0)}});$({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,n=e[0];return{type:"overline",mode:t.mode,body:n}},htmlBuilder(r,e){var t=ae(r.body,e.havingCrampedStyle()),n=N.makeLineSpan("overline-line",e),i=e.fontMetrics().defaultRuleThickness,s=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*i},{type:"elem",elem:n},{type:"kern",size:i}]},e);return N.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new R.MathNode("mo",[new R.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new R.MathNode("mover",[ge(r.body,e),t]);return n.setAttribute("accent","true"),n}});$({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"phantom",mode:t.mode,body:Be(n)}},htmlBuilder:(r,e)=>{var t=We(r.body,e.withPhantom(),!1);return N.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=Dt(r.body,e);return new R.MathNode("mphantom",t)}});$({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"hphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=N.makeSpan([],[ae(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var n=0;n{var t=Dt(Be(r.body),e),n=new R.MathNode("mphantom",t),i=new R.MathNode("mpadded",[n]);return i.setAttribute("height","0px"),i.setAttribute("depth","0px"),i}});$({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,n=e[0];return{type:"vphantom",mode:t.mode,body:n}},htmlBuilder:(r,e)=>{var t=N.makeSpan(["inner"],[ae(r.body,e.withPhantom())]),n=N.makeSpan(["fix"],[]);return N.makeSpan(["mord","rlap"],[t,n],e)},mathmlBuilder:(r,e)=>{var t=Dt(Be(r.body),e),n=new R.MathNode("mphantom",t),i=new R.MathNode("mpadded",[n]);return i.setAttribute("width","0px"),i}});$({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,n=re(e[0],"size").value,i=e[1];return{type:"raisebox",mode:t.mode,dy:n,body:i}},htmlBuilder(r,e){var t=ae(r.body,e),n=Ne(r.dy,e);return N.makeVList({positionType:"shift",positionData:-n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new R.MathNode("mpadded",[ge(r.body,e)]),n=r.dy.number+r.dy.unit;return t.setAttribute("voffset",n),t}});$({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});$({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(r,e,t){var{parser:n}=r,i=t[0],s=re(e[0],"size"),o=re(e[1],"size");return{type:"rule",mode:n.mode,shift:i&&re(i,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=N.makeSpan(["mord","rule"],[],e),n=Ne(r.width,e),i=Ne(r.height,e),s=r.shift?Ne(r.shift,e):0;return t.style.borderRightWidth=L(n),t.style.borderTopWidth=L(i),t.style.bottom=L(s),t.width=n,t.height=i+s,t.depth=-s,t.maxFontSize=i*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=Ne(r.width,e),n=Ne(r.height,e),i=r.shift?Ne(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new R.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",L(t)),o.setAttribute("height",L(n));var l=new R.MathNode("mpadded",[o]);return i>=0?l.setAttribute("height",L(i)):(l.setAttribute("height",L(i)),l.setAttribute("depth",L(-i))),l.setAttribute("voffset",L(i)),l}});function R6(r,e,t){for(var n=We(r,e,!1),i=e.sizeMultiplier/t.sizeMultiplier,s=0;s{var t=e.havingSize(r.size);return R6(r.body,t,e)};$({type:"sizing",names:c4,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!1,t);return{type:"sizing",mode:i.mode,size:c4.indexOf(n)+1,body:s}},htmlBuilder:aC,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),n=Dt(r.body,t),i=new R.MathNode("mstyle",n);return i.setAttribute("mathsize",L(t.sizeMultiplier)),i}});$({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:n}=r,i=!1,s=!1,o=t[0]&&re(t[0],"ordgroup");if(o)for(var l="",a=0;a{var t=N.makeSpan([],[ae(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var n=0;n{var t=new R.MathNode("mpadded",[ge(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});$({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:n}=r,i=t[0],s=e[0];return{type:"sqrt",mode:n.mode,body:s,index:i}},htmlBuilder(r,e){var t=ae(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=N.wrapFragment(t,e);var n=e.fontMetrics(),i=n.defaultRuleThickness,s=i;e.style.idt.height+t.depth+o&&(o=(o+f-t.height-t.depth)/2);var d=a.height-t.height-o-u;t.style.paddingLeft=L(c);var p=N.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+d)},{type:"elem",elem:a},{type:"kern",size:u}]},e);if(r.index){var g=e.havingStyle(Y.SCRIPTSCRIPT),v=ae(r.index,g,e),T=.6*(p.height-p.depth),x=N.makeVList({positionType:"shift",positionData:-T,children:[{type:"elem",elem:v}]},e),w=N.makeSpan(["root"],[x]);return N.makeSpan(["mord","sqrt"],[w,p],e)}else return N.makeSpan(["mord","sqrt"],[p],e)},mathmlBuilder(r,e){var{body:t,index:n}=r;return n?new R.MathNode("mroot",[ge(t,e),ge(n,e)]):new R.MathNode("msqrt",[ge(t,e)])}});var f4={display:Y.DISPLAY,text:Y.TEXT,script:Y.SCRIPT,scriptscript:Y.SCRIPTSCRIPT};$({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:n,parser:i}=r,s=i.parseExpression(!0,t),o=n.slice(1,n.length-5);return{type:"styling",mode:i.mode,style:o,body:s}},htmlBuilder(r,e){var t=f4[r.style],n=e.havingStyle(t).withFont("");return R6(r.body,n,e)},mathmlBuilder(r,e){var t=f4[r.style],n=e.havingStyle(t),i=Dt(r.body,n),s=new R.MathNode("mstyle",i),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},l=o[r.style];return s.setAttribute("scriptlevel",l[0]),s.setAttribute("displaystyle",l[1]),s}});var uC=function(e,t){var n=e.base;if(n)if(n.type==="op"){var i=n.limits&&(t.style.size===Y.DISPLAY.size||n.alwaysHandleSupSub);return i?Xs:null}else if(n.type==="operatorname"){var s=n.alwaysHandleSupSub&&(t.style.size===Y.DISPLAY.size||n.limits);return s?D6:null}else{if(n.type==="accent")return G.isCharacterBox(n.base)?_h:null;if(n.type==="horizBrace"){var o=!e.sub;return o===n.isOver?O6:null}else return null}else return null};ji({type:"supsub",htmlBuilder(r,e){var t=uC(r,e);if(t)return t(r,e);var{base:n,sup:i,sub:s}=r,o=ae(n,e),l,a,u=e.fontMetrics(),c=0,f=0,d=n&&G.isCharacterBox(n);if(i){var p=e.havingStyle(e.style.sup());l=ae(i,p,e),d||(c=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/e.sizeMultiplier)}if(s){var g=e.havingStyle(e.style.sub());a=ae(s,g,e),d||(f=o.depth+g.fontMetrics().subDrop*g.sizeMultiplier/e.sizeMultiplier)}var v;e.style===Y.DISPLAY?v=u.sup1:e.style.cramped?v=u.sup3:v=u.sup2;var T=e.sizeMultiplier,x=L(.5/u.ptPerEm/T),w=null;if(a){var S=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof cr||S)&&(w=L(-o.italic))}var E;if(l&&a){c=Math.max(c,v,l.depth+.25*u.xHeight),f=Math.max(f,u.sub2);var A=u.defaultRuleThickness,z=4*A;if(c-l.depth-(a.height-f)0&&(c+=I,f-=I)}var O=[{type:"elem",elem:a,shift:f,marginRight:x,marginLeft:w},{type:"elem",elem:l,shift:-c,marginRight:x}];E=N.makeVList({positionType:"individualShift",children:O},e)}else if(a){f=Math.max(f,u.sub1,a.height-.8*u.xHeight);var W=[{type:"elem",elem:a,marginLeft:w,marginRight:x}];E=N.makeVList({positionType:"shift",positionData:f,children:W},e)}else if(l)c=Math.max(c,v,l.depth+.25*u.xHeight),E=N.makeVList({positionType:"shift",positionData:-c,children:[{type:"elem",elem:l,marginRight:x}]},e);else throw new Error("supsub must have either sup or sub.");var K=ld(o,"right")||"mord";return N.makeSpan([K],[o,N.makeSpan(["msupsub"],[E])],e)},mathmlBuilder(r,e){var t=!1,n,i;r.base&&r.base.type==="horizBrace"&&(i=!!r.sup,i===r.base.isOver&&(t=!0,n=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[ge(r.base,e)];r.sub&&s.push(ge(r.sub,e)),r.sup&&s.push(ge(r.sup,e));var o;if(t)o=n?"mover":"munder";else if(r.sub)if(r.sup){var u=r.base;u&&u.type==="op"&&u.limits&&e.style===Y.DISPLAY||u&&u.type==="operatorname"&&u.alwaysHandleSupSub&&(e.style===Y.DISPLAY||u.limits)?o="munderover":o="msubsup"}else{var a=r.base;a&&a.type==="op"&&a.limits&&(e.style===Y.DISPLAY||a.alwaysHandleSupSub)||a&&a.type==="operatorname"&&a.alwaysHandleSupSub&&(a.limits||e.style===Y.DISPLAY)?o="munder":o="msub"}else{var l=r.base;l&&l.type==="op"&&l.limits&&(e.style===Y.DISPLAY||l.alwaysHandleSupSub)||l&&l.type==="operatorname"&&l.alwaysHandleSupSub&&(l.limits||e.style===Y.DISPLAY)?o="mover":o="msup"}return new R.MathNode(o,s)}});ji({type:"atom",htmlBuilder(r,e){return N.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new R.MathNode("mo",[fr(r.text,r.mode)]);if(r.family==="bin"){var n=Hh(r,e);n==="bold-italic"&&t.setAttribute("mathvariant",n)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var P6={mi:"italic",mn:"normal",mtext:"normal"};ji({type:"mathord",htmlBuilder(r,e){return N.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new R.MathNode("mi",[fr(r.text,r.mode,e)]),n=Hh(r,e)||"italic";return n!==P6[t.type]&&t.setAttribute("mathvariant",n),t}});ji({type:"textord",htmlBuilder(r,e){return N.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=fr(r.text,r.mode,e),n=Hh(r,e)||"normal",i;return r.mode==="text"?i=new R.MathNode("mtext",[t]):/[0-9]/.test(r.text)?i=new R.MathNode("mn",[t]):r.text==="\\prime"?i=new R.MathNode("mo",[t]):i=new R.MathNode("mi",[t]),n!==P6[i.type]&&i.setAttribute("mathvariant",n),i}});var Ec={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Nc={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ji({type:"spacing",htmlBuilder(r,e){if(Nc.hasOwnProperty(r.text)){var t=Nc[r.text].className||"";if(r.mode==="text"){var n=N.makeOrd(r,e,"textord");return n.classes.push(t),n}else return N.makeSpan(["mspace",t],[N.mathsym(r.text,r.mode,e)],e)}else{if(Ec.hasOwnProperty(r.text))return N.makeSpan(["mspace",Ec[r.text]],[],e);throw new B('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(Nc.hasOwnProperty(r.text))t=new R.MathNode("mtext",[new R.TextNode(" ")]);else{if(Ec.hasOwnProperty(r.text))return new R.MathNode("mspace");throw new B('Unknown type of space "'+r.text+'"')}return t}});var d4=()=>{var r=new R.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};ji({type:"tag",mathmlBuilder(r,e){var t=new R.MathNode("mtable",[new R.MathNode("mtr",[d4(),new R.MathNode("mtd",[Zn(r.body,e)]),d4(),new R.MathNode("mtd",[Zn(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var h4={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},p4={"\\textbf":"textbf","\\textmd":"textmd"},cC={"\\textit":"textit","\\textup":"textup"},m4=(r,e)=>{var t=r.font;return t?h4[t]?e.withTextFontFamily(h4[t]):p4[t]?e.withTextFontWeight(p4[t]):e.withTextFontShape(cC[t]):e};$({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:n}=r,i=e[0];return{type:"text",mode:t.mode,body:Be(i),font:n}},htmlBuilder(r,e){var t=m4(r,e),n=We(r.body,t,!0);return N.makeSpan(["mord","text"],n,t)},mathmlBuilder(r,e){var t=m4(r,e);return Zn(r.body,t)}});$({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ae(r.body,e),n=N.makeLineSpan("underline-line",e),i=e.fontMetrics().defaultRuleThickness,s=N.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:i},{type:"elem",elem:n},{type:"kern",size:3*i},{type:"elem",elem:t}]},e);return N.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new R.MathNode("mo",[new R.TextNode("‾")]);t.setAttribute("stretchy","true");var n=new R.MathNode("munder",[ge(r.body,e),t]);return n.setAttribute("accentunder","true"),n}});$({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=ae(r.body,e),n=e.fontMetrics().axisHeight,i=.5*(t.height-n-(t.depth+n));return N.makeVList({positionType:"shift",positionData:i,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new R.MathNode("mpadded",[ge(r.body,e)],["vcenter"])}});$({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new B("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=g4(r),n=[],i=e.havingStyle(e.style.text()),s=0;sr.body.replace(/ /g,r.star?"␣":" "),Rn=i6,B6=`[ \r ]`,fC="\\\\[a-zA-Z@]+",dC="\\\\[^\uD800-\uDFFF]",hC="("+fC+")"+B6+"*",pC=`\\\\( |[ \r ]+ ?)[ \r ]*`,fd="[̀-ͯ]",mC=new RegExp(fd+"+$"),gC="("+B6+"+)|"+(pC+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(fd+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(fd+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+hC)+("|"+dC+")");let y4=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(gC,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Yn("EOF",new $t(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B("Unexpected character: '"+e[t]+"'",new Yn(e[t],new $t(this,t,t+1)));var i=n[6]||n[3]||(n[2]?"\\ ":" ");if(this.catcodes[i]===14){var s=e.indexOf(` -`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new Yn(i,new $t(this,t,this.tokenRegex.lastIndex))}};class yC{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var vC=T6;k("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});k("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});k("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});k("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});k("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});k("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");k("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var v4={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};k("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new B("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=v4[e.text],n==null||n>=t)throw new B("Invalid base-"+t+" digit "+e.text);for(var i;(i=v4[r.future().text])!=null&&i{var n=r.consumeArg().tokens;if(n.length!==1)throw new B("\\newcommand's first argument must be a macro name");var i=n[0].text,s=r.isDefined(i);if(s&&!e)throw new B("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!t)throw new B("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(n=r.consumeArg().tokens,n.length===1&&n[0].text==="["){for(var l="",a=r.expandNextToken();a.text!=="]"&&a.text!=="EOF";)l+=a.text,a=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new B("Invalid number of arguments: "+l);o=parseInt(l),n=r.consumeArg().tokens}return r.macros.set(i,{tokens:n,numArgs:o}),""};k("\\newcommand",r=>Xh(r,!1,!0));k("\\renewcommand",r=>Xh(r,!0,!1));k("\\providecommand",r=>Xh(r,!0,!0));k("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});k("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});k("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Rn[t],ve.math[t],ve.text[t]),""});k("\\bgroup","{");k("\\egroup","}");k("~","\\nobreakspace");k("\\lq","`");k("\\rq","'");k("\\aa","\\r a");k("\\AA","\\r A");k("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");k("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");k("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");k("ℬ","\\mathscr{B}");k("ℰ","\\mathscr{E}");k("ℱ","\\mathscr{F}");k("ℋ","\\mathscr{H}");k("ℐ","\\mathscr{I}");k("ℒ","\\mathscr{L}");k("ℳ","\\mathscr{M}");k("ℛ","\\mathscr{R}");k("ℭ","\\mathfrak{C}");k("ℌ","\\mathfrak{H}");k("ℨ","\\mathfrak{Z}");k("\\Bbbk","\\Bbb{k}");k("·","\\cdotp");k("\\llap","\\mathllap{\\textrm{#1}}");k("\\rlap","\\mathrlap{\\textrm{#1}}");k("\\clap","\\mathclap{\\textrm{#1}}");k("\\mathstrut","\\vphantom{(}");k("\\underbar","\\underline{\\text{#1}}");k("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');k("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");k("\\ne","\\neq");k("≠","\\neq");k("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");k("∉","\\notin");k("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");k("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");k("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");k("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");k("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");k("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");k("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");k("⟂","\\perp");k("‼","\\mathclose{!\\mkern-0.8mu!}");k("∌","\\notni");k("⌜","\\ulcorner");k("⌝","\\urcorner");k("⌞","\\llcorner");k("⌟","\\lrcorner");k("©","\\copyright");k("®","\\textregistered");k("️","\\textregistered");k("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');k("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');k("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');k("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');k("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");k("⋮","\\vdots");k("\\varGamma","\\mathit{\\Gamma}");k("\\varDelta","\\mathit{\\Delta}");k("\\varTheta","\\mathit{\\Theta}");k("\\varLambda","\\mathit{\\Lambda}");k("\\varXi","\\mathit{\\Xi}");k("\\varPi","\\mathit{\\Pi}");k("\\varSigma","\\mathit{\\Sigma}");k("\\varUpsilon","\\mathit{\\Upsilon}");k("\\varPhi","\\mathit{\\Phi}");k("\\varPsi","\\mathit{\\Psi}");k("\\varOmega","\\mathit{\\Omega}");k("\\substack","\\begin{subarray}{c}#1\\end{subarray}");k("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");k("\\boxed","\\fbox{$\\displaystyle{#1}$}");k("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");k("\\implies","\\DOTSB\\;\\Longrightarrow\\;");k("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var x4={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};k("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in x4?e=x4[t]:(t.slice(0,4)==="\\not"||t in ve.math&&G.contains(["bin","rel"],ve.math[t].group))&&(e="\\dotsb"),e});var Qh={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};k("\\dotso",function(r){var e=r.future().text;return e in Qh?"\\ldots\\,":"\\ldots"});k("\\dotsc",function(r){var e=r.future().text;return e in Qh&&e!==","?"\\ldots\\,":"\\ldots"});k("\\cdots",function(r){var e=r.future().text;return e in Qh?"\\@cdots\\,":"\\@cdots"});k("\\dotsb","\\cdots");k("\\dotsm","\\cdots");k("\\dotsi","\\!\\cdots");k("\\dotsx","\\ldots\\,");k("\\DOTSI","\\relax");k("\\DOTSB","\\relax");k("\\DOTSX","\\relax");k("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");k("\\,","\\tmspace+{3mu}{.1667em}");k("\\thinspace","\\,");k("\\>","\\mskip{4mu}");k("\\:","\\tmspace+{4mu}{.2222em}");k("\\medspace","\\:");k("\\;","\\tmspace+{5mu}{.2777em}");k("\\thickspace","\\;");k("\\!","\\tmspace-{3mu}{.1667em}");k("\\negthinspace","\\!");k("\\negmedspace","\\tmspace-{4mu}{.2222em}");k("\\negthickspace","\\tmspace-{5mu}{.277em}");k("\\enspace","\\kern.5em ");k("\\enskip","\\hskip.5em\\relax");k("\\quad","\\hskip1em\\relax");k("\\qquad","\\hskip2em\\relax");k("\\tag","\\@ifstar\\tag@literal\\tag@paren");k("\\tag@paren","\\tag@literal{({#1})}");k("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new B("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});k("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");k("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");k("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");k("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");k("\\newline","\\\\\\relax");k("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var L6=L($r["Main-Regular"]["T".charCodeAt(0)][1]-.7*$r["Main-Regular"]["A".charCodeAt(0)][1]);k("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+L6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");k("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+L6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");k("\\hspace","\\@ifstar\\@hspacer\\@hspace");k("\\@hspace","\\hskip #1\\relax");k("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");k("\\ordinarycolon",":");k("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");k("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');k("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');k("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');k("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');k("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');k("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');k("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');k("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');k("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');k("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');k("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');k("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');k("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');k("∷","\\dblcolon");k("∹","\\eqcolon");k("≔","\\coloneqq");k("≕","\\eqqcolon");k("⩴","\\Coloneqq");k("\\ratio","\\vcentcolon");k("\\coloncolon","\\dblcolon");k("\\colonequals","\\coloneqq");k("\\coloncolonequals","\\Coloneqq");k("\\equalscolon","\\eqqcolon");k("\\equalscoloncolon","\\Eqqcolon");k("\\colonminus","\\coloneq");k("\\coloncolonminus","\\Coloneq");k("\\minuscolon","\\eqcolon");k("\\minuscoloncolon","\\Eqcolon");k("\\coloncolonapprox","\\Colonapprox");k("\\coloncolonsim","\\Colonsim");k("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");k("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");k("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");k("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");k("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");k("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");k("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");k("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");k("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");k("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");k("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");k("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");k("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");k("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");k("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");k("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");k("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");k("\\nleqq","\\html@mathml{\\@nleqq}{≰}");k("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");k("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");k("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");k("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");k("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");k("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");k("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");k("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");k("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");k("\\imath","\\html@mathml{\\@imath}{ı}");k("\\jmath","\\html@mathml{\\@jmath}{ȷ}");k("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");k("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");k("⟦","\\llbracket");k("⟧","\\rrbracket");k("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");k("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");k("⦃","\\lBrace");k("⦄","\\rBrace");k("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");k("⦵","\\minuso");k("\\darr","\\downarrow");k("\\dArr","\\Downarrow");k("\\Darr","\\Downarrow");k("\\lang","\\langle");k("\\rang","\\rangle");k("\\uarr","\\uparrow");k("\\uArr","\\Uparrow");k("\\Uarr","\\Uparrow");k("\\N","\\mathbb{N}");k("\\R","\\mathbb{R}");k("\\Z","\\mathbb{Z}");k("\\alef","\\aleph");k("\\alefsym","\\aleph");k("\\Alpha","\\mathrm{A}");k("\\Beta","\\mathrm{B}");k("\\bull","\\bullet");k("\\Chi","\\mathrm{X}");k("\\clubs","\\clubsuit");k("\\cnums","\\mathbb{C}");k("\\Complex","\\mathbb{C}");k("\\Dagger","\\ddagger");k("\\diamonds","\\diamondsuit");k("\\empty","\\emptyset");k("\\Epsilon","\\mathrm{E}");k("\\Eta","\\mathrm{H}");k("\\exist","\\exists");k("\\harr","\\leftrightarrow");k("\\hArr","\\Leftrightarrow");k("\\Harr","\\Leftrightarrow");k("\\hearts","\\heartsuit");k("\\image","\\Im");k("\\infin","\\infty");k("\\Iota","\\mathrm{I}");k("\\isin","\\in");k("\\Kappa","\\mathrm{K}");k("\\larr","\\leftarrow");k("\\lArr","\\Leftarrow");k("\\Larr","\\Leftarrow");k("\\lrarr","\\leftrightarrow");k("\\lrArr","\\Leftrightarrow");k("\\Lrarr","\\Leftrightarrow");k("\\Mu","\\mathrm{M}");k("\\natnums","\\mathbb{N}");k("\\Nu","\\mathrm{N}");k("\\Omicron","\\mathrm{O}");k("\\plusmn","\\pm");k("\\rarr","\\rightarrow");k("\\rArr","\\Rightarrow");k("\\Rarr","\\Rightarrow");k("\\real","\\Re");k("\\reals","\\mathbb{R}");k("\\Reals","\\mathbb{R}");k("\\Rho","\\mathrm{P}");k("\\sdot","\\cdot");k("\\sect","\\S");k("\\spades","\\spadesuit");k("\\sub","\\subset");k("\\sube","\\subseteq");k("\\supe","\\supseteq");k("\\Tau","\\mathrm{T}");k("\\thetasym","\\vartheta");k("\\weierp","\\wp");k("\\Zeta","\\mathrm{Z}");k("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");k("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");k("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");k("\\bra","\\mathinner{\\langle{#1}|}");k("\\ket","\\mathinner{|{#1}\\rangle}");k("\\braket","\\mathinner{\\langle{#1}\\rangle}");k("\\Bra","\\left\\langle#1\\right|");k("\\Ket","\\left|#1\\right\\rangle");var F6=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var a=f=>d=>{r&&(d.macros.set("|",o),i.length&&d.macros.set("\\|",l));var p=f;if(!f&&i.length){var g=d.future();g.text==="|"&&(d.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",a(!1)),i.length&&e.macros.set("\\|",a(!0));var u=e.consumeArg().tokens,c=e.expandTokens([...s,...u,...t]);return e.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};k("\\bra@ket",F6(!1));k("\\bra@set",F6(!0));k("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");k("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");k("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");k("\\angln","{\\angl n}");k("\\blue","\\textcolor{##6495ed}{#1}");k("\\orange","\\textcolor{##ffa500}{#1}");k("\\pink","\\textcolor{##ff00af}{#1}");k("\\red","\\textcolor{##df0030}{#1}");k("\\green","\\textcolor{##28ae7b}{#1}");k("\\gray","\\textcolor{gray}{#1}");k("\\purple","\\textcolor{##9d38bd}{#1}");k("\\blueA","\\textcolor{##ccfaff}{#1}");k("\\blueB","\\textcolor{##80f6ff}{#1}");k("\\blueC","\\textcolor{##63d9ea}{#1}");k("\\blueD","\\textcolor{##11accd}{#1}");k("\\blueE","\\textcolor{##0c7f99}{#1}");k("\\tealA","\\textcolor{##94fff5}{#1}");k("\\tealB","\\textcolor{##26edd5}{#1}");k("\\tealC","\\textcolor{##01d1c1}{#1}");k("\\tealD","\\textcolor{##01a995}{#1}");k("\\tealE","\\textcolor{##208170}{#1}");k("\\greenA","\\textcolor{##b6ffb0}{#1}");k("\\greenB","\\textcolor{##8af281}{#1}");k("\\greenC","\\textcolor{##74cf70}{#1}");k("\\greenD","\\textcolor{##1fab54}{#1}");k("\\greenE","\\textcolor{##0d923f}{#1}");k("\\goldA","\\textcolor{##ffd0a9}{#1}");k("\\goldB","\\textcolor{##ffbb71}{#1}");k("\\goldC","\\textcolor{##ff9c39}{#1}");k("\\goldD","\\textcolor{##e07d10}{#1}");k("\\goldE","\\textcolor{##a75a05}{#1}");k("\\redA","\\textcolor{##fca9a9}{#1}");k("\\redB","\\textcolor{##ff8482}{#1}");k("\\redC","\\textcolor{##f9685d}{#1}");k("\\redD","\\textcolor{##e84d39}{#1}");k("\\redE","\\textcolor{##bc2612}{#1}");k("\\maroonA","\\textcolor{##ffbde0}{#1}");k("\\maroonB","\\textcolor{##ff92c6}{#1}");k("\\maroonC","\\textcolor{##ed5fa6}{#1}");k("\\maroonD","\\textcolor{##ca337c}{#1}");k("\\maroonE","\\textcolor{##9e034e}{#1}");k("\\purpleA","\\textcolor{##ddd7ff}{#1}");k("\\purpleB","\\textcolor{##c6b9fc}{#1}");k("\\purpleC","\\textcolor{##aa87ff}{#1}");k("\\purpleD","\\textcolor{##7854ab}{#1}");k("\\purpleE","\\textcolor{##543b78}{#1}");k("\\mintA","\\textcolor{##f5f9e8}{#1}");k("\\mintB","\\textcolor{##edf2df}{#1}");k("\\mintC","\\textcolor{##e0e5cc}{#1}");k("\\grayA","\\textcolor{##f6f7f7}{#1}");k("\\grayB","\\textcolor{##f0f1f2}{#1}");k("\\grayC","\\textcolor{##e3e5e6}{#1}");k("\\grayD","\\textcolor{##d6d8da}{#1}");k("\\grayE","\\textcolor{##babec2}{#1}");k("\\grayF","\\textcolor{##888d93}{#1}");k("\\grayG","\\textcolor{##626569}{#1}");k("\\grayH","\\textcolor{##3b3e40}{#1}");k("\\grayI","\\textcolor{##21242c}{#1}");k("\\kaBlue","\\textcolor{##314453}{#1}");k("\\kaGreen","\\textcolor{##71B307}{#1}");var $6={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class xC{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new yC(vC,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new y4(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Yn("EOF",n.loc)),this.pushTokens(i),t.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,o=0,l=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new B("Extra }",s)}else if(s.text==="EOF")throw new B("Unexpected end of input in a macro argument, expected '"+(e&&n?e[l]:"}")+"'",s);if(e&&n)if((o===0||o===1&&e[l]==="{")&&s.text===e[l]){if(++l,l===e.length){t.splice(-l,l);break}}else l=0}while(o!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;ithis.settings.maxExpand)throw new B("Too many expansions: infinite loop or need to increase maxExpand setting");var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var l=s.length-1;l>=0;--l){var a=s[l];if(a.text==="#"){if(l===0)throw new B("Incomplete placeholder at end of macro body",a);if(a=s[--l],a.text==="#")s.splice(l+1,1);else if(/^[1-9]$/.test(a.text))s.splice(l,2,...o[+a.text-1]);else throw new B("Not a valid argument number",a)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Yn(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var l=new y4(i,this.settings),a=[],u=l.lex();u.text!=="EOF";)a.push(u),u=l.lex();a.reverse();var c={tokens:a,numArgs:s};return c}return i}isDefined(e){return this.macros.has(e)||Rn.hasOwnProperty(e)||ve.math.hasOwnProperty(e)||ve.text.hasOwnProperty(e)||$6.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Rn.hasOwnProperty(e)&&!Rn[e].primitive}}var k4=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ca=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ac={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},w4={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let V6=class dd{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new xC(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yn("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(dd.endOfExpression.indexOf(i.text)!==-1||t&&i.text===t||e&&Rn[i.text]&&Rn[i.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var l=ve[this.mode][t].group,a=$t.range(e),u;if(lT.hasOwnProperty(l)){var c=l;u={type:"atom",mode:this.mode,family:c,loc:a,text:t}}else u={type:l,mode:this.mode,loc:a,text:t};o=u}else if(t.charCodeAt(0)>=128)this.settings.strict&&(J5(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:$t.range(e),text:t};else return null;if(this.consume(),s)for(var f=0;f.5?t+=i.toLowerCase():t+=i}return t}var U6={},tp={},El={};Object.defineProperty(El,"__esModule",{value:!0});var MC=function(){function r(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:"";TC(this,r),this.type=e,this.value=t,this.name=null}return MC(r,[{key:"equals",value:function(t){return this.type===t.type&&this.value===t.value}},{key:"toString",value:function(){if(CC.indexOf(this.type)>=0)return this.type;var t=typeof this.value=="function"?this.name:this.value;return this.type+"["+t+"]"}}]),r}();fe.TYPE_LPAREN="LPAREN";fe.TYPE_RPAREN="RPAREN";fe.TYPE_PLUS="PLUS";fe.TYPE_MINUS="MINUS";fe.TYPE_TIMES="TIMES";fe.TYPE_DIVIDE="DIVIDE";fe.TYPE_COMMAND="COMMAND";fe.TYPE_SYMBOL="SYMBOL";fe.TYPE_WHITESPACE="WHITESPACE";fe.TYPE_ABS="ABSOLUTEVAL";fe.TYPE_BANG="BANG";fe.TYPE_COMMA="COMMA";fe.TYPE_POWER="POWER";fe.TYPE_NUMBER="NUMBER";fe.patterns=new Map([[fe.TYPE_LPAREN,/(\(|\[|{|\\left\(|\\left\[)/],[fe.TYPE_RPAREN,/(\)|]|}|\\right\)|\\right])/],[fe.TYPE_PLUS,/\+/],[fe.TYPE_MINUS,/-/],[fe.TYPE_TIMES,/\*/],[fe.TYPE_DIVIDE,/\//],[fe.TYPE_COMMAND,/\\[A-Za-z]+/],[fe.TYPE_SYMBOL,/[A-Za-z_][A-Za-z_0-9]*/],[fe.TYPE_WHITESPACE,/\s+/],[fe.TYPE_ABS,/\|/],[fe.TYPE_BANG,/!/],[fe.TYPE_COMMA,/,/],[fe.TYPE_POWER,/\^/],[fe.TYPE_NUMBER,/\d+(\.\d+)?/]]);El.default=fe;var CC=["TPLUS","TMINUS","TTIMES","TDIVIDE","TWS","TABS","TBANG","TCOMMA","TPOWER"],lu={};Object.defineProperty(lu,"__esModule",{value:!0});lu.default={frac:2,sqrt:1,sin:1,cos:1,tan:1,asin:1,acos:1,atan:1,sec:1,csc:1,cot:1,asec:1,acsc:1,acot:1};var Er={};Object.defineProperty(Er,"__esModule",{value:!0});var EC=Er.fact=function(e){e=Math.round(e);var t=1;if(e<0)throw"Can't factorial a negative.";for(e;e>1;e--)t*=e;return t},NC=Er.frac=function(e,t){return e/t},AC=Er.logn=function(e,t){return Math.log(e)/Math.log(t)},OC=Er.rootn=function(e,t){return Math.pow(e,1/t)},zC=Er.sec=function(e){return 1/Math.cos(e)},IC=Er.csc=function(e){return 1/Math.sin(e)},DC=Er.cot=function(e){return 1/Math.tan(e)},W6={fact:EC,frac:NC,logn:AC,rootn:OC,sec:zC,csc:IC,cot:DC},Oc=!0,S4=!1,b4=void 0;try{for(var zc=Object.getOwnPropertyNames(Math)[Symbol.iterator](),M4;!(Oc=(M4=zc.next()).done);Oc=!0){var T4=M4.value;W6[T4]=Math[T4]}}catch(r){S4=!0,b4=r}finally{try{!Oc&&zc.return&&zc.return()}finally{if(S4)throw b4}}Er.default=W6;var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.default=BC;var RC=El,Ic=PC(RC);function PC(r){return r&&r.__esModule?r:{default:r}}function BC(r){return r.type===Ic.default.TYPE_COMMAND&&["\\cdot","\\times"].includes(r.value)?new Ic.default(Ic.default.TYPE_TIMES,"*"):r}Object.defineProperty(tp,"__esModule",{value:!0});var LC=function(){function r(e,t){var n=[],i=!0,s=!1,o=void 0;try{for(var l=e[Symbol.iterator](),a;!(i=(a=l.next()).done)&&(n.push(a.value),!(t&&n.length===t));i=!0);}catch(u){s=!0,o=u}finally{try{!i&&l.return&&l.return()}finally{if(s)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),FC=function(){function r(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:JC,n=new GC(r,e,t);return n.lex(),n.tokens.toString=function(){return n.tokens.map(function(i){return i.toString()}).join(" ")},n.tokens}var GC=function(){function r(e,t,n){jC(this,r),this.buffer=e,this.constants=Object.assign({},t,_C.default),this.opts=n,this.tokens=[]}return FC(r,[{key:"lex",value:function(){this.lexExpression(),this.replaceConstants(),this.replaceCommands()}},{key:"lexExpression",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.hasNext();){var n=t?this.nextCharToken():this.next();if(this.tokens.push((0,WC.default)(n)),this.opts.latex&&XC(n)){var i=1;n.type===Bt.default.TYPE_COMMAND&&(i=HC.default[n.value.substr(1).toLowerCase()]);for(var s=0;s0}},{key:"next",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;if(this.skipWhitespace(),!this.hasNext())throw"Lexer error: reached end of stream";var n=!0,i=!1,s=void 0;try{for(var o=Bt.default.patterns[Symbol.iterator](),l;!(n=(l=o.next()).done);n=!0){var a=l.value,u=LC(a,2),c=u[0],f=u[1],d=new RegExp(/^/.source+f.source),p=d.exec(this.buffer.substr(0,t));if(p)return this.buffer=this.buffer.substr(p[0].length),new Bt.default(c,p[0])}}catch(g){i=!0,s=g}finally{try{!n&&o.return&&o.return()}finally{if(i)throw s}}throw"Lexer error: can't match any token"}},{key:"nextCharToken",value:function(){return this.skipWhitespace(),this.buffer.charAt(0)==="\\"?this.next():this.next(1)}},{key:"replaceCommands",value:function(){var t=!0,n=!1,i=void 0;try{for(var s=this.tokens[Symbol.iterator](),o;!(t=(o=s.next()).done);t=!0){var l=o.value;l.type===Bt.default.TYPE_COMMAND&&(l.value=l.value.substr(1).toLowerCase(),l.name=l.value,l.value=this.constants[l.name])}}catch(a){n=!0,i=a}finally{try{!t&&s.return&&s.return()}finally{if(n)throw i}}}},{key:"replaceConstants",value:function(){var t=!0,n=!1,i=void 0;try{for(var s=this.tokens[Symbol.iterator](),o;!(t=(o=s.next()).done);t=!0){var l=o.value;l.type===Bt.default.TYPE_SYMBOL&&(typeof this.constants[l.value]=="function"?(l.type=Bt.default.TYPE_FUNCTION,l.name=l.value,l.value=this.constants[l.value]):typeof this.constants[l.value]=="number"&&(l.type=Bt.default.TYPE_NUMBER,l.value=l.fn=this.constants[l.value]))}}catch(a){n=!0,i=a}finally{try{!t&&s.return&&s.return()}finally{if(n)throw i}}}},{key:"skipWhitespace",value:function(){var t=new RegExp(/^/.source+Bt.default.patterns.get(Bt.default.TYPE_WHITESPACE).source);this.buffer=this.buffer.replace(t,"")}}]),r}();function XC(r){return YC.indexOf(r.type)!==-1}function QC(r){return r.type===Bt.default.TYPE_LPAREN&&r.value==="{"}function ZC(r){return r.type===Bt.default.TYPE_RPAREN&&r.value==="}"}var np={},ip={};Object.defineProperty(ip,"__esModule",{value:!0});var eE=function(){function r(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:"";tE(this,r),this.type=e,this.value=t,this.name=null,this.children=[]}return eE(r,[{key:"addChild",value:function(t){return this.children.push(t),this}},{key:"evaluate",value:function(t){var n=0;switch(this.type){case r.TYPE_FUNCTION:var i=this.children.map(function(s){return s.evaluate(t)});n=this.value.apply(this,i);break;case r.TYPE_INVERSE:n=1/this.child.evaluate(t);break;case r.TYPE_NEGATE:n=-this.child.evaluate(t);break;case r.TYPE_NUMBER:n=this.value;break;case r.TYPE_POWER:n=Math.pow(this.children[0].evaluate(t),this.children[1].evaluate(t));break;case r.TYPE_PRODUCT:n=this.children.reduce(function(s,o){return s*o.evaluate(t)},1);break;case r.TYPE_SUM:n=this.children.reduce(function(s,o){return s+o.evaluate(t)},0);break;case r.TYPE_SYMBOL:if(isFinite(t[this.value]))return t[this.value];throw new Error("Symbol "+this.value+" is undefined or not a number")}return n}},{key:"isUnary",value:function(){return rE.indexOf(this.type)>=0}},{key:"printTree",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n="",i=" ",s=0;s1||this.isUnary()){var t=new r(this.type,this.value);for(var n in this.children)t.addChild(this.children[n].simplify());return t}else return this.children.length===1?this.children[0].simplify():this}},{key:"toString",value:function(){var t=typeof this.value=="function"?this.name:this.value;return this.children.length+" "+this.type+" ["+t+"]"}},{key:"child",get:function(){return this.children[0]}},{key:"nodeCount",get:function(){var t=1,n=!0,i=!1,s=void 0;try{for(var o=this.children[Symbol.iterator](),l;!(n=(l=o.next()).done);n=!0){var a=l.value;t+=a.nodeCount}}catch(u){i=!0,s=u}finally{try{!n&&o.return&&o.return()}finally{if(i)throw s}}return t}}]),r}();xn.TYPE_FUNCTION="FUNCTION";xn.TYPE_INVERSE="INVERSE";xn.TYPE_NEGATE="NEGATE";xn.TYPE_NUMBER="NUMBER";xn.TYPE_POWER="POWER";xn.TYPE_PRODUCT="PRODUCT";xn.TYPE_SUM="SUM";xn.TYPE_SYMBOL="SYMBOL";ip.default=xn;var rE=["FACTORIAL","FUNCTION","INVERSE","NEGATE"];Object.defineProperty(np,"__esModule",{value:!0});var nE=function(){function r(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:[];uE(this,r),this.cursor=0,this.tokens=e}return nE(r,[{key:"parse",value:function(){var t=this.sum();if(t=t.simplify(),this.currentToken!==void 0)throw console.log(t.printTree()),"Parsing error: Expected end of input, but got "+this.currentToken.type+" "+this.currentToken.value;return t}},{key:"accept",value:function(t){return this.currentToken&&this.currentToken.type===t?(this.cursor++,!0):!1}},{key:"expect",value:function(t){if(!this.accept(t))throw"Expected "+t+" but got "+(this.currentToken?this.currentToken.toString():"end of input.")}},{key:"sum",value:function(){var t=new be.default(be.default.TYPE_SUM);for(t.addChild(this.product());;)if(this.accept(ze.default.TYPE_PLUS))t.addChild(this.product());else if(this.accept(ze.default.TYPE_MINUS))t.addChild(new be.default(be.default.TYPE_NEGATE).addChild(this.product()));else break;return t}},{key:"product",value:function(){var t=new be.default(be.default.TYPE_PRODUCT);for(t.addChild(this.power());;)if(this.accept(ze.default.TYPE_TIMES))t.addChild(this.power());else if(this.accept(ze.default.TYPE_DIVIDE))t.addChild(new be.default(be.default.TYPE_INVERSE).addChild(this.power()));else if(this.accept(ze.default.TYPE_LPAREN))this.cursor--,t.addChild(this.power());else if(this.accept(ze.default.TYPE_SYMBOL)||this.accept(ze.default.TYPE_NUMBER)||this.accept(ze.default.TYPE_FUNCTION))this.cursor--,t.addChild(this.power());else break;return t}},{key:"power",value:function(){var t=new be.default(be.default.TYPE_POWER);return t.addChild(this.val()),this.accept(ze.default.TYPE_POWER)&&t.addChild(this.power()),t}},{key:"val",value:function(){var t={};if(this.accept(ze.default.TYPE_SYMBOL))t=new be.default(be.default.TYPE_SYMBOL,this.prevToken.value);else if(this.accept(ze.default.TYPE_NUMBER))t=new be.default(be.default.TYPE_NUMBER,parseFloat(this.prevToken.value));else if(this.accept(ze.default.TYPE_COMMAND)){var n=this.prevToken;t=new be.default(be.default.TYPE_FUNCTION,n.value),t.name=n.name;for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=(0,pE.default)(r,e,t),i=(0,gE.default)(n).simplify(),s=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return i.evaluate(l)};return s.ast=i,s.expression=r,s.tokens=n,s}function C4(r,e,t){try{const n=/\\pi({})?/g;let i=r.replace(n,"{PI}").trim(),s;const l=/^(.*)\s*:=\s*/.exec(i);l&&l[0]&&(i=i.substring(l[0].length),s=l[1].trim());const a=i.split("=");a[a.length-1].length>0?i=a[a.length-1]:a.length>=2&&(i=a[a.length-2]);const u={};let c,f=[];s&&(f=vE(s)),i=Ns(i.replace("}","}")),console.log({aliases:f,changedLatex:i,variables:e});for(const v in e){const T=e[v];u[v]=T.value;for(const x of T.aliases){const w=x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),S=new RegExp("(^|(?<=[^a-zA-Z]))"+w+"($|(?=[^a-zA-Z]))","g");console.log("changedLatex before",i),i=i.replace(S,v),console.log("changedLatex after",i);for(const E of f)x===E&&(c=v)}}const d=dE(i,{},{latex:!0}),p=new Set(d.tokens.filter(v=>v.type==="SYMBOL").map(v=>v.value));console.log({usedVars:p,res:d});const g=d(u);if(s!==void 0){if(c===void 0&&(c=_6()),p.has(c))return;e[c]={value:g,aliases:f};const v=t[c];if(v!=null)for(const T of v)T.onUpdate()}return{definedVariableID:c,variablesUsed:p,result:g}}catch(n){console.log(n);return}}function vE(r){return[Ns(r),Ns(r,!0)]}function Y6(r,e=!1){r=r.trim();let t="main",n=0,i=!1,s="",o="",l="",a="",u=!1;for(const p of r){let g=!0;p==="\\"?(!i&&n===0&&(u=!0),i=!i):i=!1,p===" "&&n===0&&(u=!1),i||(p==="_"&&n===0&&t==="main"&&(t="sub",g=!1),p==="^"&&n===0&&t==="main"&&(t="sup",g=!1),p==="{"&&n++,p==="}"&&(n--,n===0&&(u=!1))),t==="main"&&p===" "&&n===0&&(t="after",g=!1),t==="main"&&p==="\\"&&n===0&&s!=""&&(t="after"),g&&(t==="main"?s+=p:t==="sub"?l+=p:t==="sup"?o+=p:t==="after"&&(a+=p),(t==="sub"||t=="sup")&&n===0&&!u&&(t="main"))}o.startsWith("{")&&o.endsWith("}")&&(o=o.substring(1,o.length-1)),l.startsWith("{")&&l.endsWith("}")&&(l=l.substring(1,l.length-1));let c=l.trim(),f=o.trim();e&&c.indexOf(" ")===-1?c=l!==""?`_${c}`:"":c=l!==""?`_{${c}}`:"",e&&f.indexOf(" ")===-1?f=o!==""?`^${o.trim()}`:"":f=o!==""?`^{${o.trim()}}`:"";const d=a!==""?" "+Y6(a):"";return`${s}${c}${f}${d}`}function Ns(r,e=!1){if(r=r.trim(),r.startsWith("{")&&r.endsWith("}"))return Ns(r.substring(1,r.length-1));const t=/(?![^\\])\\color{\w*}/g;if(t.test(r))return Ns(r.replace(t," "));const n=/\\textcolor{\w*}/g;return n.test(r)?Ns(r.replace(n," ")):Y6(r,e)}function xE(r,e,t,n,i){let s=C4(r,i.variables,i.variableListeners);const o=()=>{var l;s!=null&&s.result?((l=s.result.toString().split(".")[1])==null?void 0:l.length)>5?t.innerText="="+s.result.toFixed(4):t.innerText="="+s.result.toString():t.innerText="=Error",n?t.style.display="inline-block":t.style.display="none"};if(o(),s!=null&&s.variablesUsed)for(const l of s.variablesUsed){let a=i.variableListeners[l];a==null&&(a=[]),a.push({id:e,onUpdate:()=>{s=C4(r,i.variables,i.variableListeners),o()}}),i.variableListeners[l]=a}return s}const J6={addInlineMath:!0,evaluation:!1},kE=TM.create({name:"inlineMath",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return J6},addAttributes(){return{latex:{default:"x_1",parseHTML:r=>r.getAttribute("data-latex"),renderHTML:r=>({"data-latex":r.latex})},evaluate:{default:"no",parseHTML:r=>r.getAttribute("data-evaluate"),renderHTML:r=>({"data-evaluate":r.evaluate})},display:{default:"no",parseHTML:r=>r.getAttribute("data-display"),renderHTML:r=>({"data-display":r.display})}}},addInputRules(){return[new Lm({find:new RegExp("\\$([^\\s])([^$]*)\\$$",""),handler:r=>{if(r.match[1].startsWith("$"))return;let e=r.match[1]+r.match[2];e=e.trim();const t=e.endsWith("=");t&&(e=e.substring(0,e.length-1));let n=[{type:"inlineMath",attrs:{latex:e,evaluate:t?"yes":"no",display:"no"}}];r.chain().insertContentAt({from:r.range.from,to:r.range.to},n,{updateSelection:!0}).run()}}),new Lm({find:new RegExp("\\$\\$([^\\s])([^$]*)\\$\\$$",""),handler:r=>{let e=r.match[1]+r.match[2];const t=e.endsWith("=");t&&(e=e.substring(0,e.length-1));let n=[{type:"inlineMath",attrs:{latex:e,evaluate:t?"yes":"no",display:"yes"}}];r.chain().insertContentAt({from:r.range.from,to:r.range.to},n,{updateSelection:!0}).run()}})]},addPasteRules(){return[new dc({find:new RegExp("\\$([^\\s])([^$]*)\\$$","g"),handler:r=>{const e=r.match[1]+r.match[2];r.chain().insertContentAt({from:r.range.from,to:r.range.to},[{type:"inlineMath",attrs:{latex:e,evaluate:"no",display:"no"}}],{updateSelection:!0}).run()}}),new dc({find:new RegExp("\\$\\$([^\\s])([^$]*)\\$\\$$","g"),handler:r=>{const e=r.match[1]+r.match[2];r.chain().insertContentAt({from:r.range.from,to:r.range.to},[{type:"inlineMath",attrs:{latex:e,evaluate:"no",display:"yes"}}],{updateSelection:!0}).run()}}),new dc({find:/\\\(((.|[\r\n])*?)\\\)/g,handler:r=>{r.chain().insertContentAt({from:r.range.from,to:r.range.to},[{type:"inlineMath",attrs:{latex:r.match[1]}}],{updateSelection:!0}).run()}})]},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:r,HTMLAttributes:e}){let t="x";return r.attrs.latex&&typeof r.attrs.latex=="string"&&(t=r.attrs.latex),["span",ab(e,{"data-type":this.name}),"$"+t+"$"]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:r,state:e})=>{let t=!1;const{selection:n}=e,{empty:i,anchor:s}=n;return i?(e.doc.nodesBetween(s-1,s,(o,l)=>{if(o.type.name===this.name){t=!0;const a=o.attrs.display==="yes",[u,c]=a?["$$","$"]:["$",""];r.insertText(u+(o.attrs.latex||"")+c,l,s)}}),t):!1})}},addNodeView(){return({HTMLAttributes:r,node:e,getPos:t,editor:n})=>{const i=document.createElement("span"),s=document.createElement("span");i.appendChild(s);let o="x_1";"data-latex"in r&&typeof r["data-latex"]=="string"&&(o=r["data-latex"]);let l=e.attrs.display==="yes";bC.render(o,s,{displayMode:l,throwOnError:!1,...this.options.katexOptions??{}}),i.classList.add("tiptap-math","latex");let a=e.attrs.evaluate==="yes";const u=_6();if(this.options.evaluation){i.title="Click to toggle result",i.style.cursor="pointer";const f=document.createElement("span");i.append(f),f.classList.add("tiptap-math","result"),f.classList.add("katex");const d=xE(o,u,f,a,this.editor.storage.inlineMath);return i.addEventListener("click",p=>{n.isEditable&&typeof t=="function"&&n.chain().command(({tr:g})=>{const v=t();return g.setNodeAttribute(v,"evaluate",a?"no":"yes"),!0}).run(),p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation()}),{dom:i,destroy:()=>{if(d!=null&&d.variablesUsed)for(const p of d.variablesUsed){let g=this.editor.storage.inlineMath.variableListeners[p];g==null&&(g=[]),this.editor.storage.inlineMath.variableListeners[p]=g.filter(v=>v.id!==u)}}}}else return{dom:i}}},addStorage(){return{variables:{},variableListeners:{}}}}),wE="mathExtension",SE=Wr.create({name:wE,addOptions(){return J6},addExtensions(){const r=[];return this.options.addInlineMath!==!1&&r.push(kE.configure(this.options)),r}});const bE=()=>{const r=vw({extensions:[yS,SE.configure({evaluation:!0,katexOptions:{macros:{"\\B":"\\mathbb{B}"}}})],content:"

Hello World!

"});return Zr.jsx(pw,{editor:r,className:"tiptap-editor"})};function ME(){return Zr.jsxs(Zr.Fragment,{children:[Zr.jsx("h1",{children:"TipTap + Math"}),Zr.jsxs("p",{children:["Visit"," ",Zr.jsx("a",{href:"https://github.com/aarkue/tiptap-math-extension/",children:"https://github.com/aarkue/tiptap-math-extension/"})," ","for more information."]}),Zr.jsx(bE,{})]})}Dc.createRoot(document.getElementById("root")).render(Zr.jsx(Gt.StrictMode,{children:Zr.jsx(ME,{})})); +`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new Yn(i,new $t(this,t,this.tokenRegex.lastIndex))}};class yC{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var i=0;i0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var vC=T6;k("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});k("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});k("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});k("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});k("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});k("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");k("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var v4={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};k("\\char",function(r){var e=r.popToken(),t,n="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")n=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new B("\\char` missing argument");n=e.text.charCodeAt(0)}else t=10;if(t){if(n=v4[e.text],n==null||n>=t)throw new B("Invalid base-"+t+" digit "+e.text);for(var i;(i=v4[r.future().text])!=null&&i{var n=r.consumeArg().tokens;if(n.length!==1)throw new B("\\newcommand's first argument must be a macro name");var i=n[0].text,s=r.isDefined(i);if(s&&!e)throw new B("\\newcommand{"+i+"} attempting to redefine "+(i+"; use \\renewcommand"));if(!s&&!t)throw new B("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");var o=0;if(n=r.consumeArg().tokens,n.length===1&&n[0].text==="["){for(var l="",a=r.expandNextToken();a.text!=="]"&&a.text!=="EOF";)l+=a.text,a=r.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new B("Invalid number of arguments: "+l);o=parseInt(l),n=r.consumeArg().tokens}return r.macros.set(i,{tokens:n,numArgs:o}),""};k("\\newcommand",r=>Xh(r,!1,!0));k("\\renewcommand",r=>Xh(r,!0,!1));k("\\providecommand",r=>Xh(r,!0,!0));k("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});k("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});k("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),Rn[t],ve.math[t],ve.text[t]),""});k("\\bgroup","{");k("\\egroup","}");k("~","\\nobreakspace");k("\\lq","`");k("\\rq","'");k("\\aa","\\r a");k("\\AA","\\r A");k("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");k("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");k("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");k("ℬ","\\mathscr{B}");k("ℰ","\\mathscr{E}");k("ℱ","\\mathscr{F}");k("ℋ","\\mathscr{H}");k("ℐ","\\mathscr{I}");k("ℒ","\\mathscr{L}");k("ℳ","\\mathscr{M}");k("ℛ","\\mathscr{R}");k("ℭ","\\mathfrak{C}");k("ℌ","\\mathfrak{H}");k("ℨ","\\mathfrak{Z}");k("\\Bbbk","\\Bbb{k}");k("·","\\cdotp");k("\\llap","\\mathllap{\\textrm{#1}}");k("\\rlap","\\mathrlap{\\textrm{#1}}");k("\\clap","\\mathclap{\\textrm{#1}}");k("\\mathstrut","\\vphantom{(}");k("\\underbar","\\underline{\\text{#1}}");k("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');k("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");k("\\ne","\\neq");k("≠","\\neq");k("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");k("∉","\\notin");k("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");k("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");k("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");k("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");k("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");k("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");k("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");k("⟂","\\perp");k("‼","\\mathclose{!\\mkern-0.8mu!}");k("∌","\\notni");k("⌜","\\ulcorner");k("⌝","\\urcorner");k("⌞","\\llcorner");k("⌟","\\lrcorner");k("©","\\copyright");k("®","\\textregistered");k("️","\\textregistered");k("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');k("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');k("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');k("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');k("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");k("⋮","\\vdots");k("\\varGamma","\\mathit{\\Gamma}");k("\\varDelta","\\mathit{\\Delta}");k("\\varTheta","\\mathit{\\Theta}");k("\\varLambda","\\mathit{\\Lambda}");k("\\varXi","\\mathit{\\Xi}");k("\\varPi","\\mathit{\\Pi}");k("\\varSigma","\\mathit{\\Sigma}");k("\\varUpsilon","\\mathit{\\Upsilon}");k("\\varPhi","\\mathit{\\Phi}");k("\\varPsi","\\mathit{\\Psi}");k("\\varOmega","\\mathit{\\Omega}");k("\\substack","\\begin{subarray}{c}#1\\end{subarray}");k("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");k("\\boxed","\\fbox{$\\displaystyle{#1}$}");k("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");k("\\implies","\\DOTSB\\;\\Longrightarrow\\;");k("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var x4={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};k("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in x4?e=x4[t]:(t.slice(0,4)==="\\not"||t in ve.math&&G.contains(["bin","rel"],ve.math[t].group))&&(e="\\dotsb"),e});var Qh={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};k("\\dotso",function(r){var e=r.future().text;return e in Qh?"\\ldots\\,":"\\ldots"});k("\\dotsc",function(r){var e=r.future().text;return e in Qh&&e!==","?"\\ldots\\,":"\\ldots"});k("\\cdots",function(r){var e=r.future().text;return e in Qh?"\\@cdots\\,":"\\@cdots"});k("\\dotsb","\\cdots");k("\\dotsm","\\cdots");k("\\dotsi","\\!\\cdots");k("\\dotsx","\\ldots\\,");k("\\DOTSI","\\relax");k("\\DOTSB","\\relax");k("\\DOTSX","\\relax");k("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");k("\\,","\\tmspace+{3mu}{.1667em}");k("\\thinspace","\\,");k("\\>","\\mskip{4mu}");k("\\:","\\tmspace+{4mu}{.2222em}");k("\\medspace","\\:");k("\\;","\\tmspace+{5mu}{.2777em}");k("\\thickspace","\\;");k("\\!","\\tmspace-{3mu}{.1667em}");k("\\negthinspace","\\!");k("\\negmedspace","\\tmspace-{4mu}{.2222em}");k("\\negthickspace","\\tmspace-{5mu}{.277em}");k("\\enspace","\\kern.5em ");k("\\enskip","\\hskip.5em\\relax");k("\\quad","\\hskip1em\\relax");k("\\qquad","\\hskip2em\\relax");k("\\tag","\\@ifstar\\tag@literal\\tag@paren");k("\\tag@paren","\\tag@literal{({#1})}");k("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new B("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});k("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");k("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");k("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");k("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");k("\\newline","\\\\\\relax");k("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var L6=L(Vr["Main-Regular"]["T".charCodeAt(0)][1]-.7*Vr["Main-Regular"]["A".charCodeAt(0)][1]);k("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+L6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");k("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+L6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");k("\\hspace","\\@ifstar\\@hspacer\\@hspace");k("\\@hspace","\\hskip #1\\relax");k("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");k("\\ordinarycolon",":");k("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");k("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');k("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');k("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');k("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');k("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');k("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');k("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');k("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');k("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');k("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');k("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');k("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');k("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');k("∷","\\dblcolon");k("∹","\\eqcolon");k("≔","\\coloneqq");k("≕","\\eqqcolon");k("⩴","\\Coloneqq");k("\\ratio","\\vcentcolon");k("\\coloncolon","\\dblcolon");k("\\colonequals","\\coloneqq");k("\\coloncolonequals","\\Coloneqq");k("\\equalscolon","\\eqqcolon");k("\\equalscoloncolon","\\Eqqcolon");k("\\colonminus","\\coloneq");k("\\coloncolonminus","\\Coloneq");k("\\minuscolon","\\eqcolon");k("\\minuscoloncolon","\\Eqcolon");k("\\coloncolonapprox","\\Colonapprox");k("\\coloncolonsim","\\Colonsim");k("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");k("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");k("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");k("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");k("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");k("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");k("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");k("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");k("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");k("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");k("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");k("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");k("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");k("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");k("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");k("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");k("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");k("\\nleqq","\\html@mathml{\\@nleqq}{≰}");k("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");k("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");k("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");k("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");k("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");k("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");k("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");k("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");k("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");k("\\imath","\\html@mathml{\\@imath}{ı}");k("\\jmath","\\html@mathml{\\@jmath}{ȷ}");k("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");k("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");k("⟦","\\llbracket");k("⟧","\\rrbracket");k("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");k("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");k("⦃","\\lBrace");k("⦄","\\rBrace");k("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");k("⦵","\\minuso");k("\\darr","\\downarrow");k("\\dArr","\\Downarrow");k("\\Darr","\\Downarrow");k("\\lang","\\langle");k("\\rang","\\rangle");k("\\uarr","\\uparrow");k("\\uArr","\\Uparrow");k("\\Uarr","\\Uparrow");k("\\N","\\mathbb{N}");k("\\R","\\mathbb{R}");k("\\Z","\\mathbb{Z}");k("\\alef","\\aleph");k("\\alefsym","\\aleph");k("\\Alpha","\\mathrm{A}");k("\\Beta","\\mathrm{B}");k("\\bull","\\bullet");k("\\Chi","\\mathrm{X}");k("\\clubs","\\clubsuit");k("\\cnums","\\mathbb{C}");k("\\Complex","\\mathbb{C}");k("\\Dagger","\\ddagger");k("\\diamonds","\\diamondsuit");k("\\empty","\\emptyset");k("\\Epsilon","\\mathrm{E}");k("\\Eta","\\mathrm{H}");k("\\exist","\\exists");k("\\harr","\\leftrightarrow");k("\\hArr","\\Leftrightarrow");k("\\Harr","\\Leftrightarrow");k("\\hearts","\\heartsuit");k("\\image","\\Im");k("\\infin","\\infty");k("\\Iota","\\mathrm{I}");k("\\isin","\\in");k("\\Kappa","\\mathrm{K}");k("\\larr","\\leftarrow");k("\\lArr","\\Leftarrow");k("\\Larr","\\Leftarrow");k("\\lrarr","\\leftrightarrow");k("\\lrArr","\\Leftrightarrow");k("\\Lrarr","\\Leftrightarrow");k("\\Mu","\\mathrm{M}");k("\\natnums","\\mathbb{N}");k("\\Nu","\\mathrm{N}");k("\\Omicron","\\mathrm{O}");k("\\plusmn","\\pm");k("\\rarr","\\rightarrow");k("\\rArr","\\Rightarrow");k("\\Rarr","\\Rightarrow");k("\\real","\\Re");k("\\reals","\\mathbb{R}");k("\\Reals","\\mathbb{R}");k("\\Rho","\\mathrm{P}");k("\\sdot","\\cdot");k("\\sect","\\S");k("\\spades","\\spadesuit");k("\\sub","\\subset");k("\\sube","\\subseteq");k("\\supe","\\supseteq");k("\\Tau","\\mathrm{T}");k("\\thetasym","\\vartheta");k("\\weierp","\\wp");k("\\Zeta","\\mathrm{Z}");k("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");k("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");k("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");k("\\bra","\\mathinner{\\langle{#1}|}");k("\\ket","\\mathinner{|{#1}\\rangle}");k("\\braket","\\mathinner{\\langle{#1}\\rangle}");k("\\Bra","\\left\\langle#1\\right|");k("\\Ket","\\left|#1\\right\\rangle");var F6=r=>e=>{var t=e.consumeArg().tokens,n=e.consumeArg().tokens,i=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),l=e.macros.get("\\|");e.macros.beginGroup();var a=f=>d=>{r&&(d.macros.set("|",o),i.length&&d.macros.set("\\|",l));var p=f;if(!f&&i.length){var g=d.future();g.text==="|"&&(d.popToken(),p=!0)}return{tokens:p?i:n,numArgs:0}};e.macros.set("|",a(!1)),i.length&&e.macros.set("\\|",a(!0));var u=e.consumeArg().tokens,c=e.expandTokens([...s,...u,...t]);return e.macros.endGroup(),{tokens:c.reverse(),numArgs:0}};k("\\bra@ket",F6(!1));k("\\bra@set",F6(!0));k("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");k("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");k("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");k("\\angln","{\\angl n}");k("\\blue","\\textcolor{##6495ed}{#1}");k("\\orange","\\textcolor{##ffa500}{#1}");k("\\pink","\\textcolor{##ff00af}{#1}");k("\\red","\\textcolor{##df0030}{#1}");k("\\green","\\textcolor{##28ae7b}{#1}");k("\\gray","\\textcolor{gray}{#1}");k("\\purple","\\textcolor{##9d38bd}{#1}");k("\\blueA","\\textcolor{##ccfaff}{#1}");k("\\blueB","\\textcolor{##80f6ff}{#1}");k("\\blueC","\\textcolor{##63d9ea}{#1}");k("\\blueD","\\textcolor{##11accd}{#1}");k("\\blueE","\\textcolor{##0c7f99}{#1}");k("\\tealA","\\textcolor{##94fff5}{#1}");k("\\tealB","\\textcolor{##26edd5}{#1}");k("\\tealC","\\textcolor{##01d1c1}{#1}");k("\\tealD","\\textcolor{##01a995}{#1}");k("\\tealE","\\textcolor{##208170}{#1}");k("\\greenA","\\textcolor{##b6ffb0}{#1}");k("\\greenB","\\textcolor{##8af281}{#1}");k("\\greenC","\\textcolor{##74cf70}{#1}");k("\\greenD","\\textcolor{##1fab54}{#1}");k("\\greenE","\\textcolor{##0d923f}{#1}");k("\\goldA","\\textcolor{##ffd0a9}{#1}");k("\\goldB","\\textcolor{##ffbb71}{#1}");k("\\goldC","\\textcolor{##ff9c39}{#1}");k("\\goldD","\\textcolor{##e07d10}{#1}");k("\\goldE","\\textcolor{##a75a05}{#1}");k("\\redA","\\textcolor{##fca9a9}{#1}");k("\\redB","\\textcolor{##ff8482}{#1}");k("\\redC","\\textcolor{##f9685d}{#1}");k("\\redD","\\textcolor{##e84d39}{#1}");k("\\redE","\\textcolor{##bc2612}{#1}");k("\\maroonA","\\textcolor{##ffbde0}{#1}");k("\\maroonB","\\textcolor{##ff92c6}{#1}");k("\\maroonC","\\textcolor{##ed5fa6}{#1}");k("\\maroonD","\\textcolor{##ca337c}{#1}");k("\\maroonE","\\textcolor{##9e034e}{#1}");k("\\purpleA","\\textcolor{##ddd7ff}{#1}");k("\\purpleB","\\textcolor{##c6b9fc}{#1}");k("\\purpleC","\\textcolor{##aa87ff}{#1}");k("\\purpleD","\\textcolor{##7854ab}{#1}");k("\\purpleE","\\textcolor{##543b78}{#1}");k("\\mintA","\\textcolor{##f5f9e8}{#1}");k("\\mintB","\\textcolor{##edf2df}{#1}");k("\\mintC","\\textcolor{##e0e5cc}{#1}");k("\\grayA","\\textcolor{##f6f7f7}{#1}");k("\\grayB","\\textcolor{##f0f1f2}{#1}");k("\\grayC","\\textcolor{##e3e5e6}{#1}");k("\\grayD","\\textcolor{##d6d8da}{#1}");k("\\grayE","\\textcolor{##babec2}{#1}");k("\\grayF","\\textcolor{##888d93}{#1}");k("\\grayG","\\textcolor{##626569}{#1}");k("\\grayH","\\textcolor{##3b3e40}{#1}");k("\\grayI","\\textcolor{##21242c}{#1}");k("\\kaBlue","\\textcolor{##314453}{#1}");k("\\kaGreen","\\textcolor{##71B307}{#1}");var $6={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class xC{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new yC(vC,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new y4(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,i;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:i,end:n}=this.consumeArg(["]"])}else({tokens:i,start:t,end:n}=this.consumeArg());return this.pushToken(new Yn("EOF",n.loc)),this.pushTokens(i),t.range(n,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var i=this.future(),s,o=0,l=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new B("Extra }",s)}else if(s.text==="EOF")throw new B("Unexpected end of input in a macro argument, expected '"+(e&&n?e[l]:"}")+"'",s);if(e&&n)if((o===0||o===1&&e[l]==="{")&&s.text===e[l]){if(++l,l===e.length){t.splice(-l,l);break}}else l=0}while(o!==0||n);return i.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B("The length of delimiters doesn't match the number of args!");for(var n=t[0],i=0;ithis.settings.maxExpand)throw new B("Too many expansions: infinite loop or need to increase maxExpand setting");var s=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){s=s.slice();for(var l=s.length-1;l>=0;--l){var a=s[l];if(a.text==="#"){if(l===0)throw new B("Incomplete placeholder at end of macro body",a);if(a=s[--l],a.text==="#")s.splice(l+1,1);else if(/^[1-9]$/.test(a.text))s.splice(l,2,...o[+a.text-1]);else throw new B("Not a valid argument number",a)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Yn(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),t.push(i)}return t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(n=>n.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var i=typeof t=="function"?t(this):t;if(typeof i=="string"){var s=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var l=new y4(i,this.settings),a=[],u=l.lex();u.text!=="EOF";)a.push(u),u=l.lex();a.reverse();var c={tokens:a,numArgs:s};return c}return i}isDefined(e){return this.macros.has(e)||Rn.hasOwnProperty(e)||ve.math.hasOwnProperty(e)||ve.text.hasOwnProperty(e)||$6.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:Rn.hasOwnProperty(e)&&!Rn[e].primitive}}var k4=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,ca=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Ac={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},w4={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let V6=class dd{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new xC(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Yn("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(dd.endOfExpression.indexOf(i.text)!==-1||t&&i.text===t||e&&Rn[i.text]&&Rn[i.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;n.push(s)}return this.mode==="text"&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t=-1,n,i=0;i=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var l=ve[this.mode][t].group,a=$t.range(e),u;if(lT.hasOwnProperty(l)){var c=l;u={type:"atom",mode:this.mode,family:c,loc:a,text:t}}else u={type:l,mode:this.mode,loc:a,text:t};o=u}else if(t.charCodeAt(0)>=128)this.settings.strict&&(J5(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:$t.range(e),text:t};else return null;if(this.consume(),s)for(var f=0;f.5?t+=i.toLowerCase():t+=i}return t}var U6={},tp={},El={};Object.defineProperty(El,"__esModule",{value:!0});var MC=function(){function r(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:"";TC(this,r),this.type=e,this.value=t,this.name=null}return MC(r,[{key:"equals",value:function(t){return this.type===t.type&&this.value===t.value}},{key:"toString",value:function(){if(CC.indexOf(this.type)>=0)return this.type;var t=typeof this.value=="function"?this.name:this.value;return this.type+"["+t+"]"}}]),r}();fe.TYPE_LPAREN="LPAREN";fe.TYPE_RPAREN="RPAREN";fe.TYPE_PLUS="PLUS";fe.TYPE_MINUS="MINUS";fe.TYPE_TIMES="TIMES";fe.TYPE_DIVIDE="DIVIDE";fe.TYPE_COMMAND="COMMAND";fe.TYPE_SYMBOL="SYMBOL";fe.TYPE_WHITESPACE="WHITESPACE";fe.TYPE_ABS="ABSOLUTEVAL";fe.TYPE_BANG="BANG";fe.TYPE_COMMA="COMMA";fe.TYPE_POWER="POWER";fe.TYPE_NUMBER="NUMBER";fe.patterns=new Map([[fe.TYPE_LPAREN,/(\(|\[|{|\\left\(|\\left\[)/],[fe.TYPE_RPAREN,/(\)|]|}|\\right\)|\\right])/],[fe.TYPE_PLUS,/\+/],[fe.TYPE_MINUS,/-/],[fe.TYPE_TIMES,/\*/],[fe.TYPE_DIVIDE,/\//],[fe.TYPE_COMMAND,/\\[A-Za-z]+/],[fe.TYPE_SYMBOL,/[A-Za-z_][A-Za-z_0-9]*/],[fe.TYPE_WHITESPACE,/\s+/],[fe.TYPE_ABS,/\|/],[fe.TYPE_BANG,/!/],[fe.TYPE_COMMA,/,/],[fe.TYPE_POWER,/\^/],[fe.TYPE_NUMBER,/\d+(\.\d+)?/]]);El.default=fe;var CC=["TPLUS","TMINUS","TTIMES","TDIVIDE","TWS","TABS","TBANG","TCOMMA","TPOWER"],lu={};Object.defineProperty(lu,"__esModule",{value:!0});lu.default={frac:2,sqrt:1,sin:1,cos:1,tan:1,asin:1,acos:1,atan:1,sec:1,csc:1,cot:1,asec:1,acsc:1,acot:1};var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});var EC=Nr.fact=function(e){e=Math.round(e);var t=1;if(e<0)throw"Can't factorial a negative.";for(e;e>1;e--)t*=e;return t},NC=Nr.frac=function(e,t){return e/t},AC=Nr.logn=function(e,t){return Math.log(e)/Math.log(t)},OC=Nr.rootn=function(e,t){return Math.pow(e,1/t)},zC=Nr.sec=function(e){return 1/Math.cos(e)},IC=Nr.csc=function(e){return 1/Math.sin(e)},DC=Nr.cot=function(e){return 1/Math.tan(e)},W6={fact:EC,frac:NC,logn:AC,rootn:OC,sec:zC,csc:IC,cot:DC},Oc=!0,S4=!1,b4=void 0;try{for(var zc=Object.getOwnPropertyNames(Math)[Symbol.iterator](),M4;!(Oc=(M4=zc.next()).done);Oc=!0){var T4=M4.value;W6[T4]=Math[T4]}}catch(r){S4=!0,b4=r}finally{try{!Oc&&zc.return&&zc.return()}finally{if(S4)throw b4}}Nr.default=W6;var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.default=BC;var RC=El,Ic=PC(RC);function PC(r){return r&&r.__esModule?r:{default:r}}function BC(r){return r.type===Ic.default.TYPE_COMMAND&&["\\cdot","\\times"].includes(r.value)?new Ic.default(Ic.default.TYPE_TIMES,"*"):r}Object.defineProperty(tp,"__esModule",{value:!0});var LC=function(){function r(e,t){var n=[],i=!0,s=!1,o=void 0;try{for(var l=e[Symbol.iterator](),a;!(i=(a=l.next()).done)&&(n.push(a.value),!(t&&n.length===t));i=!0);}catch(u){s=!0,o=u}finally{try{!i&&l.return&&l.return()}finally{if(s)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),FC=function(){function r(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:JC,n=new GC(r,e,t);return n.lex(),n.tokens.toString=function(){return n.tokens.map(function(i){return i.toString()}).join(" ")},n.tokens}var GC=function(){function r(e,t,n){jC(this,r),this.buffer=e,this.constants=Object.assign({},t,_C.default),this.opts=n,this.tokens=[]}return FC(r,[{key:"lex",value:function(){this.lexExpression(),this.replaceConstants(),this.replaceCommands()}},{key:"lexExpression",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.hasNext();){var n=t?this.nextCharToken():this.next();if(this.tokens.push((0,WC.default)(n)),this.opts.latex&&XC(n)){var i=1;n.type===Bt.default.TYPE_COMMAND&&(i=HC.default[n.value.substr(1).toLowerCase()]);for(var s=0;s0}},{key:"next",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;if(this.skipWhitespace(),!this.hasNext())throw"Lexer error: reached end of stream";var n=!0,i=!1,s=void 0;try{for(var o=Bt.default.patterns[Symbol.iterator](),l;!(n=(l=o.next()).done);n=!0){var a=l.value,u=LC(a,2),c=u[0],f=u[1],d=new RegExp(/^/.source+f.source),p=d.exec(this.buffer.substr(0,t));if(p)return this.buffer=this.buffer.substr(p[0].length),new Bt.default(c,p[0])}}catch(g){i=!0,s=g}finally{try{!n&&o.return&&o.return()}finally{if(i)throw s}}throw"Lexer error: can't match any token"}},{key:"nextCharToken",value:function(){return this.skipWhitespace(),this.buffer.charAt(0)==="\\"?this.next():this.next(1)}},{key:"replaceCommands",value:function(){var t=!0,n=!1,i=void 0;try{for(var s=this.tokens[Symbol.iterator](),o;!(t=(o=s.next()).done);t=!0){var l=o.value;l.type===Bt.default.TYPE_COMMAND&&(l.value=l.value.substr(1).toLowerCase(),l.name=l.value,l.value=this.constants[l.name])}}catch(a){n=!0,i=a}finally{try{!t&&s.return&&s.return()}finally{if(n)throw i}}}},{key:"replaceConstants",value:function(){var t=!0,n=!1,i=void 0;try{for(var s=this.tokens[Symbol.iterator](),o;!(t=(o=s.next()).done);t=!0){var l=o.value;l.type===Bt.default.TYPE_SYMBOL&&(typeof this.constants[l.value]=="function"?(l.type=Bt.default.TYPE_FUNCTION,l.name=l.value,l.value=this.constants[l.value]):typeof this.constants[l.value]=="number"&&(l.type=Bt.default.TYPE_NUMBER,l.value=l.fn=this.constants[l.value]))}}catch(a){n=!0,i=a}finally{try{!t&&s.return&&s.return()}finally{if(n)throw i}}}},{key:"skipWhitespace",value:function(){var t=new RegExp(/^/.source+Bt.default.patterns.get(Bt.default.TYPE_WHITESPACE).source);this.buffer=this.buffer.replace(t,"")}}]),r}();function XC(r){return YC.indexOf(r.type)!==-1}function QC(r){return r.type===Bt.default.TYPE_LPAREN&&r.value==="{"}function ZC(r){return r.type===Bt.default.TYPE_RPAREN&&r.value==="}"}var np={},ip={};Object.defineProperty(ip,"__esModule",{value:!0});var eE=function(){function r(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:"";tE(this,r),this.type=e,this.value=t,this.name=null,this.children=[]}return eE(r,[{key:"addChild",value:function(t){return this.children.push(t),this}},{key:"evaluate",value:function(t){var n=0;switch(this.type){case r.TYPE_FUNCTION:var i=this.children.map(function(s){return s.evaluate(t)});n=this.value.apply(this,i);break;case r.TYPE_INVERSE:n=1/this.child.evaluate(t);break;case r.TYPE_NEGATE:n=-this.child.evaluate(t);break;case r.TYPE_NUMBER:n=this.value;break;case r.TYPE_POWER:n=Math.pow(this.children[0].evaluate(t),this.children[1].evaluate(t));break;case r.TYPE_PRODUCT:n=this.children.reduce(function(s,o){return s*o.evaluate(t)},1);break;case r.TYPE_SUM:n=this.children.reduce(function(s,o){return s+o.evaluate(t)},0);break;case r.TYPE_SYMBOL:if(isFinite(t[this.value]))return t[this.value];throw new Error("Symbol "+this.value+" is undefined or not a number")}return n}},{key:"isUnary",value:function(){return rE.indexOf(this.type)>=0}},{key:"printTree",value:function(){for(var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n="",i=" ",s=0;s1||this.isUnary()){var t=new r(this.type,this.value);for(var n in this.children)t.addChild(this.children[n].simplify());return t}else return this.children.length===1?this.children[0].simplify():this}},{key:"toString",value:function(){var t=typeof this.value=="function"?this.name:this.value;return this.children.length+" "+this.type+" ["+t+"]"}},{key:"child",get:function(){return this.children[0]}},{key:"nodeCount",get:function(){var t=1,n=!0,i=!1,s=void 0;try{for(var o=this.children[Symbol.iterator](),l;!(n=(l=o.next()).done);n=!0){var a=l.value;t+=a.nodeCount}}catch(u){i=!0,s=u}finally{try{!n&&o.return&&o.return()}finally{if(i)throw s}}return t}}]),r}();xn.TYPE_FUNCTION="FUNCTION";xn.TYPE_INVERSE="INVERSE";xn.TYPE_NEGATE="NEGATE";xn.TYPE_NUMBER="NUMBER";xn.TYPE_POWER="POWER";xn.TYPE_PRODUCT="PRODUCT";xn.TYPE_SUM="SUM";xn.TYPE_SYMBOL="SYMBOL";ip.default=xn;var rE=["FACTORIAL","FUNCTION","INVERSE","NEGATE"];Object.defineProperty(np,"__esModule",{value:!0});var nE=function(){function r(e,t){for(var n=0;n0&&arguments[0]!==void 0?arguments[0]:[];uE(this,r),this.cursor=0,this.tokens=e}return nE(r,[{key:"parse",value:function(){var t=this.sum();if(t=t.simplify(),this.currentToken!==void 0)throw console.log(t.printTree()),"Parsing error: Expected end of input, but got "+this.currentToken.type+" "+this.currentToken.value;return t}},{key:"accept",value:function(t){return this.currentToken&&this.currentToken.type===t?(this.cursor++,!0):!1}},{key:"expect",value:function(t){if(!this.accept(t))throw"Expected "+t+" but got "+(this.currentToken?this.currentToken.toString():"end of input.")}},{key:"sum",value:function(){var t=new be.default(be.default.TYPE_SUM);for(t.addChild(this.product());;)if(this.accept(ze.default.TYPE_PLUS))t.addChild(this.product());else if(this.accept(ze.default.TYPE_MINUS))t.addChild(new be.default(be.default.TYPE_NEGATE).addChild(this.product()));else break;return t}},{key:"product",value:function(){var t=new be.default(be.default.TYPE_PRODUCT);for(t.addChild(this.power());;)if(this.accept(ze.default.TYPE_TIMES))t.addChild(this.power());else if(this.accept(ze.default.TYPE_DIVIDE))t.addChild(new be.default(be.default.TYPE_INVERSE).addChild(this.power()));else if(this.accept(ze.default.TYPE_LPAREN))this.cursor--,t.addChild(this.power());else if(this.accept(ze.default.TYPE_SYMBOL)||this.accept(ze.default.TYPE_NUMBER)||this.accept(ze.default.TYPE_FUNCTION))this.cursor--,t.addChild(this.power());else break;return t}},{key:"power",value:function(){var t=new be.default(be.default.TYPE_POWER);return t.addChild(this.val()),this.accept(ze.default.TYPE_POWER)&&t.addChild(this.power()),t}},{key:"val",value:function(){var t={};if(this.accept(ze.default.TYPE_SYMBOL))t=new be.default(be.default.TYPE_SYMBOL,this.prevToken.value);else if(this.accept(ze.default.TYPE_NUMBER))t=new be.default(be.default.TYPE_NUMBER,parseFloat(this.prevToken.value));else if(this.accept(ze.default.TYPE_COMMAND)){var n=this.prevToken;t=new be.default(be.default.TYPE_FUNCTION,n.value),t.name=n.name;for(var i=0;i1&&arguments[1]!==void 0?arguments[1]:{},t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=(0,pE.default)(r,e,t),i=(0,gE.default)(n).simplify(),s=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return i.evaluate(l)};return s.ast=i,s.expression=r,s.tokens=n,s}function C4(r,e,t){try{const n=/\\pi({})?/g;let i=r.replace(n,"{PI}").trim(),s;const l=/^(.*)\s*:=\s*/.exec(i);l&&l[0]&&(i=i.substring(l[0].length),s=l[1].trim());const a=i.split("=");a[a.length-1].length>0?i=a[a.length-1]:a.length>=2&&(i=a[a.length-2]);const u={};let c,f=[];s&&(f=vE(s)),i=Ns(i.replace("}","}")),console.log({aliases:f,changedLatex:i,variables:e});for(const v in e){const T=e[v];u[v]=T.value;for(const x of T.aliases){const w=x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),S=new RegExp("(^|(?<=[^a-zA-Z]))"+w+"($|(?=[^a-zA-Z]))","g");console.log("changedLatex before",i),i=i.replace(S,v),console.log("changedLatex after",i);for(const E of f)x===E&&(c=v)}}const d=dE(i,{},{latex:!0}),p=new Set(d.tokens.filter(v=>v.type==="SYMBOL").map(v=>v.value));console.log({usedVars:p,res:d});const g=d(u);if(s!==void 0){if(c===void 0&&(c=_6()),p.has(c))return;e[c]={value:g,aliases:f};const v=t[c];if(v!=null)for(const T of v)T.onUpdate()}return{definedVariableID:c,variablesUsed:p,result:g}}catch(n){console.log(n);return}}function vE(r){return[Ns(r),Ns(r,!0)]}function Y6(r,e=!1){r=r.trim();let t="main",n=0,i=!1,s="",o="",l="",a="",u=!1;for(const p of r){let g=!0;p==="\\"?(!i&&n===0&&(u=!0),i=!i):i=!1,p===" "&&n===0&&(u=!1),i||(p==="_"&&n===0&&t==="main"&&(t="sub",g=!1),p==="^"&&n===0&&t==="main"&&(t="sup",g=!1),p==="{"&&n++,p==="}"&&(n--,n===0&&(u=!1))),t==="main"&&p===" "&&n===0&&(t="after",g=!1),t==="main"&&p==="\\"&&n===0&&s!=""&&(t="after"),g&&(t==="main"?s+=p:t==="sub"?l+=p:t==="sup"?o+=p:t==="after"&&(a+=p),(t==="sub"||t=="sup")&&n===0&&!u&&(t="main"))}o.startsWith("{")&&o.endsWith("}")&&(o=o.substring(1,o.length-1)),l.startsWith("{")&&l.endsWith("}")&&(l=l.substring(1,l.length-1));let c=l.trim(),f=o.trim();e&&c.indexOf(" ")===-1?c=l!==""?`_${c}`:"":c=l!==""?`_{${c}}`:"",e&&f.indexOf(" ")===-1?f=o!==""?`^${o.trim()}`:"":f=o!==""?`^{${o.trim()}}`:"";const d=a!==""?" "+Y6(a):"";return`${s}${c}${f}${d}`}function Ns(r,e=!1){if(r=r.trim(),r.startsWith("{")&&r.endsWith("}"))return Ns(r.substring(1,r.length-1));const t=/(?![^\\])\\color{\w*}/g;if(t.test(r))return Ns(r.replace(t," "));const n=/\\textcolor{\w*}/g;return n.test(r)?Ns(r.replace(n," ")):Y6(r,e)}function xE(r,e,t,n,i){let s=C4(r,i.variables,i.variableListeners);const o=()=>{var l;s!=null&&s.result?((l=s.result.toString().split(".")[1])==null?void 0:l.length)>5?t.innerText="="+s.result.toFixed(4):t.innerText="="+s.result.toString():t.innerText="=Error",n?t.style.display="inline-block":t.style.display="none"};if(o(),s!=null&&s.variablesUsed)for(const l of s.variablesUsed){let a=i.variableListeners[l];a==null&&(a=[]),a.push({id:e,onUpdate:()=>{s=C4(r,i.variables,i.variableListeners),o()}}),i.variableListeners[l]=a}return s}const J6={addInlineMath:!0,evaluation:!1},kE=TM.create({name:"inlineMath",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return J6},addAttributes(){return{latex:{default:"x_1",parseHTML:r=>r.getAttribute("data-latex"),renderHTML:r=>({"data-latex":r.latex})},evaluate:{default:"no",parseHTML:r=>r.getAttribute("data-evaluate"),renderHTML:r=>({"data-evaluate":r.evaluate})},display:{default:"no",parseHTML:r=>r.getAttribute("data-display"),renderHTML:r=>({"data-display":r.display})}}},addInputRules(){return[new Lm({find:new RegExp("\\$([^\\s])([^$]*)\\$$",""),handler:r=>{if(r.match[1].startsWith("$"))return;let e=r.match[1]+r.match[2];e=e.trim();const t=e.endsWith("=");t&&(e=e.substring(0,e.length-1));let n=[{type:"inlineMath",attrs:{latex:e,evaluate:t?"yes":"no",display:"no"}}];r.chain().insertContentAt({from:r.range.from,to:r.range.to},n,{updateSelection:!0}).run()}}),new Lm({find:new RegExp("\\$\\$([^\\s])([^$]*)\\$\\$$",""),handler:r=>{let e=r.match[1]+r.match[2];const t=e.endsWith("=");t&&(e=e.substring(0,e.length-1));let n=[{type:"inlineMath",attrs:{latex:e,evaluate:t?"yes":"no",display:"yes"}}];r.chain().insertContentAt({from:r.range.from,to:r.range.to},n,{updateSelection:!0}).run()}})]},addPasteRules(){return[new dc({find:new RegExp("\\$([^\\s])([^$]*)\\$$","g"),handler:r=>{const e=r.match[1]+r.match[2];r.chain().insertContentAt({from:r.range.from,to:r.range.to},[{type:"inlineMath",attrs:{latex:e,evaluate:"no",display:"no"}}],{updateSelection:!0}).run()}}),new dc({find:new RegExp("\\$\\$([^\\s])([^$]*)\\$\\$$","g"),handler:r=>{const e=r.match[1]+r.match[2];r.chain().insertContentAt({from:r.range.from,to:r.range.to},[{type:"inlineMath",attrs:{latex:e,evaluate:"no",display:"yes"}}],{updateSelection:!0}).run()}}),new dc({find:/\\\(((.|[\r\n])*?)\\\)/g,handler:r=>{r.chain().insertContentAt({from:r.range.from,to:r.range.to},[{type:"inlineMath",attrs:{latex:r.match[1]}}],{updateSelection:!0}).run()}})]},parseHTML(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML({node:r,HTMLAttributes:e}){let t="x";return r.attrs.latex&&typeof r.attrs.latex=="string"&&(t=r.attrs.latex),["span",ab(e,{"data-type":this.name}),"$"+t+"$"]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:r,state:e})=>{let t=!1;const{selection:n}=e,{empty:i,anchor:s}=n;return i?(e.doc.nodesBetween(s-1,s,(o,l)=>{if(o.type.name===this.name){t=!0;const a=o.attrs.display==="yes",[u,c]=a?["$$","$"]:["$",""];r.insertText(u+(o.attrs.latex||"")+c,l,s)}}),t):!1})}},addNodeView(){return({HTMLAttributes:r,node:e,getPos:t,editor:n})=>{const i=document.createElement("span"),s=document.createElement("span");i.appendChild(s);let o="x_1";"data-latex"in r&&typeof r["data-latex"]=="string"&&(o=r["data-latex"]);let l=e.attrs.display==="yes";bC.render(o,s,{displayMode:l,throwOnError:!1,...this.options.katexOptions??{}}),i.classList.add("tiptap-math","latex");let a=e.attrs.evaluate==="yes";const u=_6();if(this.options.evaluation){i.title="Click to toggle result",i.style.cursor="pointer";const f=document.createElement("span");i.append(f),f.classList.add("tiptap-math","result"),f.classList.add("katex");const d=xE(o,u,f,a,this.editor.storage.inlineMath);return i.addEventListener("click",p=>{n.isEditable&&typeof t=="function"&&n.chain().command(({tr:g})=>{const v=t();return g.setNodeAttribute(v,"evaluate",a?"no":"yes"),!0}).run(),p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation()}),{dom:i,destroy:()=>{if(d!=null&&d.variablesUsed)for(const p of d.variablesUsed){let g=this.editor.storage.inlineMath.variableListeners[p];g==null&&(g=[]),this.editor.storage.inlineMath.variableListeners[p]=g.filter(v=>v.id!==u)}}}}else return{dom:i}}},addStorage(){return{variables:{},variableListeners:{}}}}),wE="mathExtension",SE=jr.create({name:wE,addOptions(){return J6},addExtensions(){const r=[];return this.options.addInlineMath!==!1&&r.push(kE.configure(this.options)),r}});const bE=()=>{const r=vw({extensions:[yS,SE.configure({evaluation:!1,katexOptions:{macros:{"\\B":"\\mathbb{B}"}}})],content:`

Hello World! +
+
+ This is a sum: +
+
+ This is a block math expression: +
+ +
+
+ Cool, right?

`});return je.useEffect(()=>{r&&(console.log({editor:r}),window.tiptapEditor=r)},[r]),xr.jsxs("div",{children:[xr.jsx("button",{onClick:()=>{r==null||r.commands.insertContent({type:"inlineMath",attrs:{latex:"x^2 = \\sqrt{x^4}"}})},children:"Insert Math"}),xr.jsx(pw,{editor:r,className:"tiptap-editor"})]})};function ME(){return xr.jsxs(xr.Fragment,{children:[xr.jsx("h1",{children:"TipTap + Math"}),xr.jsxs("p",{children:["Visit"," ",xr.jsx("a",{href:"https://github.com/aarkue/tiptap-math-extension/",children:"https://github.com/aarkue/tiptap-math-extension/"})," ","for more information."]}),xr.jsx(bE,{})]})}Dc.createRoot(document.getElementById("root")).render(xr.jsx(Gt.StrictMode,{children:xr.jsx(ME,{})})); diff --git a/example/dist/assets/index-6160bb1b.css b/example/dist/assets/index-6160bb1b.css new file mode 100644 index 0000000..210b189 --- /dev/null +++ b/example/dist/assets/index-6160bb1b.css @@ -0,0 +1 @@ +#root{margin:0 auto;padding:2rem}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(./KaTeX_AMS-Regular-0cdd387c.woff2) format("woff2"),url(./KaTeX_AMS-Regular-30da91e8.woff) format("woff"),url(./KaTeX_AMS-Regular-68534840.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(./KaTeX_Caligraphic-Bold-de7701e4.woff2) format("woff2"),url(./KaTeX_Caligraphic-Bold-1ae6bd74.woff) format("woff"),url(./KaTeX_Caligraphic-Bold-07d8e303.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(./KaTeX_Caligraphic-Regular-5d53e70a.woff2) format("woff2"),url(./KaTeX_Caligraphic-Regular-3398dd02.woff) format("woff"),url(./KaTeX_Caligraphic-Regular-ed0b7437.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(./KaTeX_Fraktur-Bold-74444efd.woff2) format("woff2"),url(./KaTeX_Fraktur-Bold-9be7ceb8.woff) format("woff"),url(./KaTeX_Fraktur-Bold-9163df9c.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(./KaTeX_Fraktur-Regular-51814d27.woff2) format("woff2"),url(./KaTeX_Fraktur-Regular-5e28753b.woff) format("woff"),url(./KaTeX_Fraktur-Regular-1e6f9579.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(./KaTeX_Main-Bold-0f60d1b8.woff2) format("woff2"),url(./KaTeX_Main-Bold-c76c5d69.woff) format("woff"),url(./KaTeX_Main-Bold-138ac28d.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(./KaTeX_Main-BoldItalic-99cd42a3.woff2) format("woff2"),url(./KaTeX_Main-BoldItalic-a6f7ec0d.woff) format("woff"),url(./KaTeX_Main-BoldItalic-70ee1f64.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(./KaTeX_Main-Italic-97479ca6.woff2) format("woff2"),url(./KaTeX_Main-Italic-f1d6ef86.woff) format("woff"),url(./KaTeX_Main-Italic-0d85ae7c.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(./KaTeX_Main-Regular-c2342cd8.woff2) format("woff2"),url(./KaTeX_Main-Regular-c6368d87.woff) format("woff"),url(./KaTeX_Main-Regular-d0332f52.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(./KaTeX_Math-BoldItalic-dc47344d.woff2) format("woff2"),url(./KaTeX_Math-BoldItalic-850c0af5.woff) format("woff"),url(./KaTeX_Math-BoldItalic-f9377ab0.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(./KaTeX_Math-Italic-7af58c5e.woff2) format("woff2"),url(./KaTeX_Math-Italic-8a8d2445.woff) format("woff"),url(./KaTeX_Math-Italic-08ce98e5.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(./KaTeX_SansSerif-Bold-e99ae511.woff2) format("woff2"),url(./KaTeX_SansSerif-Bold-ece03cfd.woff) format("woff"),url(./KaTeX_SansSerif-Bold-1ece03f7.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(./KaTeX_SansSerif-Italic-00b26ac8.woff2) format("woff2"),url(./KaTeX_SansSerif-Italic-91ee6750.woff) format("woff"),url(./KaTeX_SansSerif-Italic-3931dd81.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(./KaTeX_SansSerif-Regular-68e8c73e.woff2) format("woff2"),url(./KaTeX_SansSerif-Regular-11e4dc8a.woff) format("woff"),url(./KaTeX_SansSerif-Regular-f36ea897.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(./KaTeX_Script-Regular-036d4e95.woff2) format("woff2"),url(./KaTeX_Script-Regular-d96cdf2b.woff) format("woff"),url(./KaTeX_Script-Regular-1c67f068.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(./KaTeX_Size1-Regular-6b47c401.woff2) format("woff2"),url(./KaTeX_Size1-Regular-c943cc98.woff) format("woff"),url(./KaTeX_Size1-Regular-95b6d2f1.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(./KaTeX_Size2-Regular-d04c5421.woff2) format("woff2"),url(./KaTeX_Size2-Regular-2014c523.woff) format("woff"),url(./KaTeX_Size2-Regular-a6b2099f.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(./KaTeX_Size3-Regular-6ab6b62e.woff) format("woff"),url(./KaTeX_Size3-Regular-500e04d5.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(./KaTeX_Size4-Regular-a4af7d41.woff2) format("woff2"),url(./KaTeX_Size4-Regular-99f9c675.woff) format("woff"),url(./KaTeX_Size4-Regular-c647367d.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(./KaTeX_Typewriter-Regular-71d517d6.woff2) format("woff2"),url(./KaTeX_Typewriter-Regular-e14fed02.woff) format("woff"),url(./KaTeX_Typewriter-Regular-f01f3e87.ttf) format("truetype")}.katex{font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.10"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;--alt-bg-color: #151414;--alt-fg-color: #fafafa}body{margin:0}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff;--alt-bg-color: #fafafa}a:hover{color:#747bff}}.tiptap-editor{padding:.5rem}.ProseMirror{background-color:var(--alt-bg-color);padding:8px;border-radius:8px;font-size:1.2rem}.tiptap-math.latex{display:inline-flex;align-items:center;width:fit-content}.tiptap-math.latex.ProseMirror-selectednode{outline:1px solid black}.tiptap-math.result{background-color:#78e65618;border-bottom:rgb(68,194,68) 2px solid;padding-left:4px;padding-right:2px;height:fit-content} diff --git a/example/dist/assets/index-eeae6c16.css b/example/dist/assets/index-eeae6c16.css deleted file mode 100644 index 75ed847..0000000 --- a/example/dist/assets/index-eeae6c16.css +++ /dev/null @@ -1 +0,0 @@ -#root{margin:0 auto;padding:2rem}@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(./KaTeX_AMS-Regular-0cdd387c.woff2) format("woff2"),url(./KaTeX_AMS-Regular-30da91e8.woff) format("woff"),url(./KaTeX_AMS-Regular-68534840.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(./KaTeX_Caligraphic-Bold-de7701e4.woff2) format("woff2"),url(./KaTeX_Caligraphic-Bold-1ae6bd74.woff) format("woff"),url(./KaTeX_Caligraphic-Bold-07d8e303.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(./KaTeX_Caligraphic-Regular-5d53e70a.woff2) format("woff2"),url(./KaTeX_Caligraphic-Regular-3398dd02.woff) format("woff"),url(./KaTeX_Caligraphic-Regular-ed0b7437.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(./KaTeX_Fraktur-Bold-74444efd.woff2) format("woff2"),url(./KaTeX_Fraktur-Bold-9be7ceb8.woff) format("woff"),url(./KaTeX_Fraktur-Bold-9163df9c.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(./KaTeX_Fraktur-Regular-51814d27.woff2) format("woff2"),url(./KaTeX_Fraktur-Regular-5e28753b.woff) format("woff"),url(./KaTeX_Fraktur-Regular-1e6f9579.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(./KaTeX_Main-Bold-0f60d1b8.woff2) format("woff2"),url(./KaTeX_Main-Bold-c76c5d69.woff) format("woff"),url(./KaTeX_Main-Bold-138ac28d.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(./KaTeX_Main-BoldItalic-99cd42a3.woff2) format("woff2"),url(./KaTeX_Main-BoldItalic-a6f7ec0d.woff) format("woff"),url(./KaTeX_Main-BoldItalic-70ee1f64.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(./KaTeX_Main-Italic-97479ca6.woff2) format("woff2"),url(./KaTeX_Main-Italic-f1d6ef86.woff) format("woff"),url(./KaTeX_Main-Italic-0d85ae7c.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(./KaTeX_Main-Regular-c2342cd8.woff2) format("woff2"),url(./KaTeX_Main-Regular-c6368d87.woff) format("woff"),url(./KaTeX_Main-Regular-d0332f52.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(./KaTeX_Math-BoldItalic-dc47344d.woff2) format("woff2"),url(./KaTeX_Math-BoldItalic-850c0af5.woff) format("woff"),url(./KaTeX_Math-BoldItalic-f9377ab0.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(./KaTeX_Math-Italic-7af58c5e.woff2) format("woff2"),url(./KaTeX_Math-Italic-8a8d2445.woff) format("woff"),url(./KaTeX_Math-Italic-08ce98e5.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:700;src:url(./KaTeX_SansSerif-Bold-e99ae511.woff2) format("woff2"),url(./KaTeX_SansSerif-Bold-ece03cfd.woff) format("woff"),url(./KaTeX_SansSerif-Bold-1ece03f7.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:italic;font-weight:400;src:url(./KaTeX_SansSerif-Italic-00b26ac8.woff2) format("woff2"),url(./KaTeX_SansSerif-Italic-91ee6750.woff) format("woff"),url(./KaTeX_SansSerif-Italic-3931dd81.ttf) format("truetype")}@font-face{font-family:KaTeX_SansSerif;font-style:normal;font-weight:400;src:url(./KaTeX_SansSerif-Regular-68e8c73e.woff2) format("woff2"),url(./KaTeX_SansSerif-Regular-11e4dc8a.woff) format("woff"),url(./KaTeX_SansSerif-Regular-f36ea897.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(./KaTeX_Script-Regular-036d4e95.woff2) format("woff2"),url(./KaTeX_Script-Regular-d96cdf2b.woff) format("woff"),url(./KaTeX_Script-Regular-1c67f068.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(./KaTeX_Size1-Regular-6b47c401.woff2) format("woff2"),url(./KaTeX_Size1-Regular-c943cc98.woff) format("woff"),url(./KaTeX_Size1-Regular-95b6d2f1.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(./KaTeX_Size2-Regular-d04c5421.woff2) format("woff2"),url(./KaTeX_Size2-Regular-2014c523.woff) format("woff"),url(./KaTeX_Size2-Regular-a6b2099f.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(data:font/woff2;base64,d09GMgABAAAAAA4oAA4AAAAAHbQAAA3TAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRQIDgmcDBEICo1oijYBNgIkA14LMgAEIAWJAAeBHAyBHBvbGiMRdnO0IkRRkiYDgr9KsJ1NUAf2kILNxgUmgqIgq1P89vcbIcmsQbRps3vCcXdYOKSWEPEKgZgQkprQQsxIXUgq0DqpGKmIvrgkeVGtEQD9DzAO29fM9jYhxZEsL2FeURH2JN4MIcTdO049NCVdxQ/w9NrSYFEBKTDKpLKfNkCGDc1RwjZLQcm3vqJ2UW9Xfa3tgAHz6ivp6vgC2yD4/6352ndnN0X0TL7seypkjZlMsjmZnf0Mm5Q+JykRWQBKCVCVPbARPXWyQtb5VgLB6Biq7/Uixcj2WGqdI8tGSgkuRG+t910GKP2D7AQH0DB9FMDW/obJZ8giFI3Wg8Cvevz0M+5m0rTh7XDBlvo9Y4vm13EXmfttwI4mBo1EG15fxJhUiCLbiiyCf/ZA6MFAhg3pGIZGdGIVjtPn6UcMk9A/UUr9PhoNsCENw1APAq0gpH73e+M+0ueyHbabc3vkbcdtzcf/fiy+NxQEjf9ud/ELBHAXJ0nk4z+MXH2Ev/kWyV4k7SkvpPc9Qr38F6RPWnM9cN6DJ0AdD1BhtgABtmoRoFCvPsBAumNm6soZG2Gk5GyVTo2sJncSyp0jQTYoR6WDvTwaaEcHsxHfvuWhHA3a6bN7twRKtcGok6NsCi7jYRrM2jExsUFMxMQYuJbMhuWNOumEJy9hi29Dmg5zMp/A5+hhPG19j1vBrq8JTLr8ki5VLPmG/PynJHVul440bxg5xuymHUFPBshC+nA9I1FmwbRBTNHAcik3Oae0cxKoI3MOriM42UrPe51nsaGxJ+WfXubAsP84aabUlQSJ1IiE0iPETLUU4CATgfXSCSpuRFRmCGbO+wSpAnzaeaCYW1VNEysRtuXCEL1kUFUbbtMv3Tilt/1c11jt3Q5bbMa84cpWipp8Elw3MZhOHsOlwwVUQM3lAR35JiFQbaYCRnMF2lxAWoOg2gyoIV4PouX8HytNIfLhqpJtXB4vjiViUI8IJ7bkC4ikkQvKksnOTKICwnqWSZ9YS5f0WCxmpgjbIq7EJcM4aI2nmhLNY2JIUgOjXZFWBHb+x5oh6cwb0Tv1ackHdKi0I9OO2wE9aogIOn540CCCziyhN+IaejtgAONKznHlHyutPrHGwCx9S6B8kfS4Mfi4Eyv7OU730bT1SCBjt834cXsf43zVjPUqqJjgrjeGnBxSG4aYAKFuVbeCfkDIjAqMb6yLNIbCuvXhMH2/+k2vkNpkORhR59N1CkzoOENvneIosjYmuTxlhUzaGEJQ/iWqx4dmwpmKjrwTiTGTCVozNAYqk/zXOndWxuWSmJkQpJw3pK5KX6QrLt5LATMqpmPAQhkhK6PUjzHUn7E0gHE0kPE0iKkolgkUx9SZmVAdDgpffdyJKg3k7VmzYGCwVXGz/tXmkOIp+vcWs+EMuhhvN0h9uhfzWJziBQmCREGSIFmQIkgVpAnSBRmC//6hkLZwaVhwxlrJSOdqlFtOYxlau9F2QN5Y98xmIAsiM1HVp2VFX+DHHGg6Ecjh3vmqtidX3qHI2qycTk/iwxSt5UzTmEP92ZBnEWTk4Mx8Mpl78ZDokxg/KWb+Q0QkvdKVmq3TMW+RXEgrsziSAfNXFMhDc60N5N9jQzjfO0kBKpUZl0ZmwJ41j/B9Hz6wmRaJB84niNmQrzp9eSlQCDDzazGDdVi3P36VZQ+Jy4f9UBNp+3zTjqI4abaFAm+GShVaXlsGdF3FYzZcDI6cori4kMxUECl9IjJZpzkvitAoxKue+90pDMvcKRxLl53TmOKCmV/xRolNKSqqUxc6LStOETmFOiLZZptlZepcKiAzteG8PEdpnQpbOMNcMsR4RR2Bs0cKFEvSmIjAFcnarqwUL4lDhHmnVkwu1IwshbiCcgvOheZuYyOteufZZwlcTlLgnZ3o/WcYdzZHW/WGaqaVfmTZ1aWCceJjkbZqsfbkOtcFlUZM/jy+hXHDbaUobWqqXaeWobbLO99yG5N3U4wxco0rQGGcOLASFMXeJoham8M+/x6O2WywK2l4HGbq1CoUyC/IZikQhdq3SiuNrvAEj0AVu9x2x3lp/xWzahaxidezFVtdcb5uEnzyl0ZmYiuKI0exvCd4Xc9CV1KB0db00z92wDPde0kukbvZIWN6jUWFTmPIC/Y4UPCm8UfDTFZpZNon1qLFTkBhxzB+FjQRA2Q/YRJT8pQigslMaUpFyAG8TMlXigiqmAZX4xgijKjRlGpLE0GdplRfCaJo0JQaSxNBk6ZmMzcya0FmrcisDdn0Q3HI2sWSppYigmlM1XT/kLQZSNpMJG0WkjYbSZuDpM1F0uYhFc1HxU4m1QJjDK6iL0S5uSj5rgXc3RejEigtcRBtqYPQsiTskmO5vosV+q4VGIKbOkDg0jtRrq+Em1YloaTFar3EGr1EUC8R0kus1Uus00usL97ABr2BjXoDm/QGNhuWtMVBKOwg/i78lT7hBsAvDmwHc/ao3vmUbBmhjeYySZNWvGkfZAgISDSaDo1SVpzGDsAEkF8B+gEapViUoZgUWXcRIGFZNm6gWbAKk0bp0k1MHG9fLYtV4iS2SmLEQFARzRcnf9PUS0LVn05/J9MiRRBU3v2IrvW974v4N00L7ZMk0wXP1409CHo/an8zTRHD3eSJ6m8D4YMkZNl3M79sqeuAsr/m3f+8/yl7A50aiAEJgeBeMWzu7ui9UfUBCe2TIqZIoOd/3/udRBOQidQZUERzb2/VwZN1H/Sju82ew2H2Wfr6qvfVf3hqwDvAIpkQVFy4B9Pe9e4/XvPeceu7h3dvO56iJPf0+A6cqA2ip18ER+iFgggiuOkvj24bby0N9j2UHIkgqIt+sVgfodC4YghLSMjSZbH0VR/6dMDrYJeKHilKTemt6v6kvzvn3/RrdWtr0GoN/xL+Sex/cPYLUpepx9cz/D46UPU5KXgAQa+NDps1v6J3xP1i2HtaDB0M9aX2deA7SYff//+gUCovMmIK/qfsFcOk+4Y5ZN97XlG6zebqtMbKgeRFi51vnxTQYBUik2rS/Cn6PC8ADR8FGxsRPB82dzfND90gIcshOcYUkfjherBz53odpm6TP8txlwOZ71xmfHHOvq053qFF/MRlS3jP0ELudrf2OeN8DHvp6ZceLe8qKYvWz/7yp0u4dKPfli3CYq0O13Ih71mylJ80tOi10On8wi+F4+LWgDPeJ30msSQt9/vkmHq9/Lvo2b461mP801v3W4xTcs6CbvF9UDdrSt+A8OUbpSh55qAUFXWznBBfdeJ8a4d7ugT5tvxUza3h9m4H7ptTqiG4z0g5dc0X29OcGlhpGFMpQo9ytTS+NViZpNdvU4kWx+LKxNY10kQ1yqGXrhe4/1nvP7E+nd5A92TtaRplbHSqoIdOqtRWti+fkB5/n1+/VvCmz12pG1kpQWsfi1ftlBobm0bpngs16CHkbIwdLnParxtTV3QYRlfJ0KFskH7pdN/YDn+yRuSd7sNH3aO0DYPggk6uWuXrfOc+fa3VTxFVvKaNxHsiHmsXyCLIE5yuOeN3/Jdf8HBL/5M6shjyhxHx9BjB1O0+4NLOnjLLSxwO7ukN4jMbOIcD879KLSi6Pk61Oqm2377n8079PXEEQ7cy7OKEC9nbpet118fxweTafpt69x/Bt8UqGzNQt7aelpc44dn5cqhwf71+qKp/Zf/+a0zcizOUWpl/iBcSXip0pplkatCchoH5c5aUM8I7/dWxAej8WicPL1URFZ9BDJelUwEwTkGqUhgSlydVes95YdXvhh9Gfz/aeFWvgVb4tuLbcv4+wLdutVZv/cUonwBD/6eDlE0aSiKK/uoH3+J1wDE/jMVqY2ysGufN84oIXB0sPzy8ollX/LegY74DgJXJR57sn+VGza0x3DnuIgABFM15LmajjjsNlYj+JEZGbuRYcAMOWxFkPN2w6Wd46xo4gVWQR/X4lyI/R6K/YK0110GzudPRW7Y+UOBGTfNNzHeYT0fiH0taunBpq9HEW8OKSaBGj21L0MqenEmNRWBAWDWAk4CpNoEZJ2tTaPFgbQYj8HxtFilErs3BTRwT8uO1NXQaWfIotchmPkAF5mMBAliEmZiOGVgCG9LgRzpscMAOOwowlT3JhusdazXGSC/hxR3UlmWVwWHpOIKheqONvjyhSiTHIkVUco5bnji8m//zL7PKaT1Vl5I6UE609f+gkr6MZKVyKc7zJRmCahLsdlyA5fdQkRSan9LgnnLEyGSkaKJCJog0wAgvepWBt80+1yKln1bMVtCljfNWDueKLsWwaEbBSfSPTEmVRsUcYYMnEjcjeyCZzBXK9E9BYBXLKjOSpUDR+nEV3TFSUdQaz+ot98QxgXwx0GQ+EEUAKB2qZPkQQ0GqFD8UPFMqyaCHM24BZmSGic9EYMagKizOw9Hz50DMrDLrqqLkTAhplMictiCAx5S3BIUQdeJeLnBy2CNtMfz6cV4u8XKoFZQesbf9YZiIERiHjaNodDW6LgcirX/mPnJIkBGDUpTBhSa0EIr38D5hCIszhCM8URGBqImoWjpvpt1ebu/v3Gl3qJfMnNM+9V+kiRFyROTPHQWOcs1dNW94/ukKMPZBvDi55i5CttdeJz84DLngLqjcdwEZ87bFFR8CIG35OAkDVN6VRDZ7aq67NteYqZ2lpT8oYB2CytoBd6VuAx4WgiAsnuj3WohG+LugzXiQRDeM3XYXlULv4dp5VFYC) format("woff2"),url(./KaTeX_Size3-Regular-6ab6b62e.woff) format("woff"),url(./KaTeX_Size3-Regular-500e04d5.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(./KaTeX_Size4-Regular-a4af7d41.woff2) format("woff2"),url(./KaTeX_Size4-Regular-99f9c675.woff) format("woff"),url(./KaTeX_Size4-Regular-c647367d.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(./KaTeX_Typewriter-Regular-71d517d6.woff2) format("woff2"),url(./KaTeX_Typewriter-Regular-e14fed02.woff) format("woff"),url(./KaTeX_Typewriter-Regular-f01f3e87.ttf) format("truetype")}.katex{text-rendering:auto;font: 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.7"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-text-size-adjust:100%;--alt-bg-color: #151414;--alt-fg-color: #fafafa}body{margin:0}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff;--alt-bg-color: #fafafa}a:hover{color:#747bff}}.tiptap-editor{padding:.5rem}.ProseMirror{background-color:var(--alt-bg-color);padding:8px;border-radius:8px;font-size:1.2rem}.tiptap-math.latex{display:inline-flex;align-items:center;width:fit-content}.tiptap-math.latex.ProseMirror-selectednode{outline:1px solid black}.tiptap-math.result{background-color:#78e65618;border-bottom:rgb(68,194,68) 2px solid;padding-left:4px;padding-right:2px;height:fit-content} diff --git a/example/dist/index.html b/example/dist/index.html index d861b28..a10bc3d 100644 --- a/example/dist/index.html +++ b/example/dist/index.html @@ -4,8 +4,8 @@ TipTap Math Extension - - + +