regen.mde 0.2.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +409 -295
- package/bin/build-corpus-editor.js +5 -3
- package/bin/postinstall.js +259 -187
- package/bin/regen-mdeditor-install.js +1 -1
- package/bin/regen-mdeditor-uninstall.js +1 -1
- package/desktop/BuildCorpusEditor/BuildCorpusBridge.cs +493 -270
- package/desktop/BuildCorpusEditor/EditorForm.cs +853 -540
- package/desktop/BuildCorpusEditor/Program.cs +85 -81
- package/dist/release/regen-mde-0.3.0-win-x64-setup.exe +0 -0
- package/dist/release/{regen.mde-0.2.2-win-x64.zip → regen-mde-0.3.0-win-x64.zip} +0 -0
- package/dist/release/regen-mde-0.7.0-win-x64-setup.exe +0 -0
- package/dist/release/regen-mde-0.7.0-win-x64.zip +0 -0
- package/dist/windows-editor/BuildCorpusEditor.dll +0 -0
- package/dist/windows-editor/BuildCorpusEditor.exe +0 -0
- package/dist/windows-editor/BuildCorpusEditor.pdb +0 -0
- package/dist/windows-editor/wwwroot/assets/index-C_VxJk4k.js +375 -0
- package/dist/windows-editor/wwwroot/assets/index-Wt9zSjIw.css +1 -0
- package/dist/windows-editor/wwwroot/index.html +3 -3
- package/editor-web/index.html +1 -1
- package/editor-web/src/main.jsx +1044 -399
- package/editor-web/src/styles.css +846 -602
- package/installer/install-regen-mde.ps1 +49 -10
- package/installer/regen-mde.nsi +16 -16
- package/package.json +90 -86
- package/pyproject.toml +35 -33
- package/requirements.txt +6 -4
- package/scripts/package-windows-editor.ps1 +8 -8
- package/scripts/release-dual.mjs +105 -0
- package/scripts/run-editor-implementation-plane.ps1 +29 -6
- package/src/build_corpus/docx_exporter.py +1055 -798
- package/src/build_corpus/equations.py +80 -0
- package/src/build_corpus/exporter.py +1488 -1195
- package/src/build_corpus/frontmatter.py +302 -0
- package/src/build_corpus/ppt_exporter.py +543 -532
- package/dist/release/regen.mde-0.2.2-win-x64-setup.exe +0 -0
- package/dist/windows-editor/wwwroot/assets/index-DjJ6xmhy.js +0 -326
- package/dist/windows-editor/wwwroot/assets/index-_dwMNNsm.css +0 -1
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
var VB=Object.defineProperty;var qB=(n,e,t)=>e in n?VB(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var dt=(n,e,t)=>qB(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function gR(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Sy={exports:{}},Au={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var oA;function HB(){if(oA)return Au;oA=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,s){var l=null;if(s!==void 0&&(l=""+s),r.key!==void 0&&(l=""+r.key),"key"in r){s={};for(var o in r)o!=="key"&&(s[o]=r[o])}else s=r;return r=s.ref,{$$typeof:n,type:i,key:l,ref:r!==void 0?r:null,props:s}}return Au.Fragment=e,Au.jsx=t,Au.jsxs=t,Au}var aA;function YB(){return aA||(aA=1,Sy.exports=HB()),Sy.exports}var _=YB(),vy={exports:{}},ze={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var cA;function UB(){if(cA)return ze;cA=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function O(Q){return Q===null||typeof Q!="object"?null:(Q=g&&Q[g]||Q["@@iterator"],typeof Q=="function"?Q:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,x={};function k(Q,Z,G){this.props=Q,this.context=Z,this.refs=x,this.updater=G||b}k.prototype.isReactComponent={},k.prototype.setState=function(Q,Z){if(typeof Q!="object"&&typeof Q!="function"&&Q!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,Q,Z,"setState")},k.prototype.forceUpdate=function(Q){this.updater.enqueueForceUpdate(this,Q,"forceUpdate")};function C(){}C.prototype=k.prototype;function A(Q,Z,G){this.props=Q,this.context=Z,this.refs=x,this.updater=G||b}var P=A.prototype=new C;P.constructor=A,v(P,k.prototype),P.isPureReactComponent=!0;var E=Array.isArray;function D(){}var $={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function W(Q,Z,G){var oe=G.ref;return{$$typeof:n,type:Q,key:Z,ref:oe!==void 0?oe:null,props:G}}function te(Q,Z){return W(Q.type,Z,Q.props)}function ae(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===n}function re(Q){var Z={"=":"=0",":":"=2"};return"$"+Q.replace(/[=:]/g,function(G){return Z[G]})}var ce=/\/+/g;function se(Q,Z){return typeof Q=="object"&&Q!==null&&Q.key!=null?re(""+Q.key):Z.toString(36)}function z(Q){switch(Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason;default:switch(typeof Q.status=="string"?Q.then(D,D):(Q.status="pending",Q.then(function(Z){Q.status==="pending"&&(Q.status="fulfilled",Q.value=Z)},function(Z){Q.status==="pending"&&(Q.status="rejected",Q.reason=Z)})),Q.status){case"fulfilled":return Q.value;case"rejected":throw Q.reason}}throw Q}function B(Q,Z,G,oe,ye){var Re=typeof Q;(Re==="undefined"||Re==="boolean")&&(Q=null);var _e=!1;if(Q===null)_e=!0;else switch(Re){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(Q.$$typeof){case n:case e:_e=!0;break;case d:return _e=Q._init,B(_e(Q._payload),Z,G,oe,ye)}}if(_e)return ye=ye(Q),_e=oe===""?"."+se(Q,0):oe,E(ye)?(G="",_e!=null&&(G=_e.replace(ce,"$&/")+"/"),B(ye,Z,G,"",function(dr){return dr})):ye!=null&&(ae(ye)&&(ye=te(ye,G+(ye.key==null||Q&&Q.key===ye.key?"":(""+ye.key).replace(ce,"$&/")+"/")+_e)),Z.push(ye)),1;_e=0;var xt=oe===""?".":oe+":";if(E(Q))for(var ot=0;ot<Q.length;ot++)oe=Q[ot],Re=xt+se(oe,ot),_e+=B(oe,Z,G,Re,ye);else if(ot=O(Q),typeof ot=="function")for(Q=ot.call(Q),ot=0;!(oe=Q.next()).done;)oe=oe.value,Re=xt+se(oe,ot++),_e+=B(oe,Z,G,Re,ye);else if(Re==="object"){if(typeof Q.then=="function")return B(z(Q),Z,G,oe,ye);throw Z=String(Q),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(Q).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return _e}function K(Q,Z,G){if(Q==null)return Q;var oe=[],ye=0;return B(Q,oe,"","",function(Re){return Z.call(G,Re,ye++)}),oe}function he(Q){if(Q._status===-1){var Z=Q._result;Z=Z(),Z.then(function(G){(Q._status===0||Q._status===-1)&&(Q._status=1,Q._result=G)},function(G){(Q._status===0||Q._status===-1)&&(Q._status=2,Q._result=G)}),Q._status===-1&&(Q._status=0,Q._result=Z)}if(Q._status===1)return Q._result.default;throw Q._result}var ge=typeof reportError=="function"?reportError:function(Q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof Q=="object"&&Q!==null&&typeof Q.message=="string"?String(Q.message):String(Q),error:Q});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",Q);return}console.error(Q)},J={map:K,forEach:function(Q,Z,G){K(Q,function(){Z.apply(this,arguments)},G)},count:function(Q){var Z=0;return K(Q,function(){Z++}),Z},toArray:function(Q){return K(Q,function(Z){return Z})||[]},only:function(Q){if(!ae(Q))throw Error("React.Children.only expected to receive a single React element child.");return Q}};return ze.Activity=p,ze.Children=J,ze.Component=k,ze.Fragment=t,ze.Profiler=r,ze.PureComponent=A,ze.StrictMode=i,ze.Suspense=c,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,ze.__COMPILER_RUNTIME={__proto__:null,c:function(Q){return $.H.useMemoCache(Q)}},ze.cache=function(Q){return function(){return Q.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.cloneElement=function(Q,Z,G){if(Q==null)throw Error("The argument must be a React element, but you passed "+Q+".");var oe=v({},Q.props),ye=Q.key;if(Z!=null)for(Re in Z.key!==void 0&&(ye=""+Z.key),Z)!H.call(Z,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&Z.ref===void 0||(oe[Re]=Z[Re]);var Re=arguments.length-2;if(Re===1)oe.children=G;else if(1<Re){for(var _e=Array(Re),xt=0;xt<Re;xt++)_e[xt]=arguments[xt+2];oe.children=_e}return W(Q.type,ye,oe)},ze.createContext=function(Q){return Q={$$typeof:l,_currentValue:Q,_currentValue2:Q,_threadCount:0,Provider:null,Consumer:null},Q.Provider=Q,Q.Consumer={$$typeof:s,_context:Q},Q},ze.createElement=function(Q,Z,G){var oe,ye={},Re=null;if(Z!=null)for(oe in Z.key!==void 0&&(Re=""+Z.key),Z)H.call(Z,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ye[oe]=Z[oe]);var _e=arguments.length-2;if(_e===1)ye.children=G;else if(1<_e){for(var xt=Array(_e),ot=0;ot<_e;ot++)xt[ot]=arguments[ot+2];ye.children=xt}if(Q&&Q.defaultProps)for(oe in _e=Q.defaultProps,_e)ye[oe]===void 0&&(ye[oe]=_e[oe]);return W(Q,Re,ye)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(Q){return{$$typeof:o,render:Q}},ze.isValidElement=ae,ze.lazy=function(Q){return{$$typeof:d,_payload:{_status:-1,_result:Q},_init:he}},ze.memo=function(Q,Z){return{$$typeof:h,type:Q,compare:Z===void 0?null:Z}},ze.startTransition=function(Q){var Z=$.T,G={};$.T=G;try{var oe=Q(),ye=$.S;ye!==null&&ye(G,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(D,ge)}catch(Re){ge(Re)}finally{Z!==null&&G.types!==null&&(Z.types=G.types),$.T=Z}},ze.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},ze.use=function(Q){return $.H.use(Q)},ze.useActionState=function(Q,Z,G){return $.H.useActionState(Q,Z,G)},ze.useCallback=function(Q,Z){return $.H.useCallback(Q,Z)},ze.useContext=function(Q){return $.H.useContext(Q)},ze.useDebugValue=function(){},ze.useDeferredValue=function(Q,Z){return $.H.useDeferredValue(Q,Z)},ze.useEffect=function(Q,Z){return $.H.useEffect(Q,Z)},ze.useEffectEvent=function(Q){return $.H.useEffectEvent(Q)},ze.useId=function(){return $.H.useId()},ze.useImperativeHandle=function(Q,Z,G){return $.H.useImperativeHandle(Q,Z,G)},ze.useInsertionEffect=function(Q,Z){return $.H.useInsertionEffect(Q,Z)},ze.useLayoutEffect=function(Q,Z){return $.H.useLayoutEffect(Q,Z)},ze.useMemo=function(Q,Z){return $.H.useMemo(Q,Z)},ze.useOptimistic=function(Q,Z){return $.H.useOptimistic(Q,Z)},ze.useReducer=function(Q,Z,G){return $.H.useReducer(Q,Z,G)},ze.useRef=function(Q){return $.H.useRef(Q)},ze.useState=function(Q){return $.H.useState(Q)},ze.useSyncExternalStore=function(Q,Z,G){return $.H.useSyncExternalStore(Q,Z,G)},ze.useTransition=function(){return $.H.useTransition()},ze.version="19.2.6",ze}var uA;function of(){return uA||(uA=1,vy.exports=UB()),vy.exports}var Ee=of();const $e=gR(Ee);var xy={exports:{}},Mu={},ky={exports:{}},wy={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var hA;function WB(){return hA||(hA=1,(function(n){function e(B,K){var he=B.length;B.push(K);e:for(;0<he;){var ge=he-1>>>1,J=B[ge];if(0<r(J,K))B[ge]=K,B[he]=J,he=ge;else break e}}function t(B){return B.length===0?null:B[0]}function i(B){if(B.length===0)return null;var K=B[0],he=B.pop();if(he!==K){B[0]=he;e:for(var ge=0,J=B.length,Q=J>>>1;ge<Q;){var Z=2*(ge+1)-1,G=B[Z],oe=Z+1,ye=B[oe];if(0>r(G,he))oe<J&&0>r(ye,G)?(B[ge]=ye,B[oe]=he,ge=oe):(B[ge]=G,B[Z]=he,ge=Z);else if(oe<J&&0>r(ye,he))B[ge]=ye,B[oe]=he,ge=oe;else break e}}return K}function r(B,K){var he=B.sortIndex-K.sortIndex;return he!==0?he:B.id-K.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;n.unstable_now=function(){return s.now()}}else{var l=Date,o=l.now();n.unstable_now=function(){return l.now()-o}}var c=[],h=[],d=1,p=null,g=3,O=!1,b=!1,v=!1,x=!1,k=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function P(B){for(var K=t(h);K!==null;){if(K.callback===null)i(h);else if(K.startTime<=B)i(h),K.sortIndex=K.expirationTime,e(c,K);else break;K=t(h)}}function E(B){if(v=!1,P(B),!b)if(t(c)!==null)b=!0,D||(D=!0,re());else{var K=t(h);K!==null&&z(E,K.startTime-B)}}var D=!1,$=-1,H=5,W=-1;function te(){return x?!0:!(n.unstable_now()-W<H)}function ae(){if(x=!1,D){var B=n.unstable_now();W=B;var K=!0;try{e:{b=!1,v&&(v=!1,C($),$=-1),O=!0;var he=g;try{t:{for(P(B),p=t(c);p!==null&&!(p.expirationTime>B&&te());){var ge=p.callback;if(typeof ge=="function"){p.callback=null,g=p.priorityLevel;var J=ge(p.expirationTime<=B);if(B=n.unstable_now(),typeof J=="function"){p.callback=J,P(B),K=!0;break t}p===t(c)&&i(c),P(B)}else i(c);p=t(c)}if(p!==null)K=!0;else{var Q=t(h);Q!==null&&z(E,Q.startTime-B),K=!1}}break e}finally{p=null,g=he,O=!1}K=void 0}}finally{K?re():D=!1}}}var re;if(typeof A=="function")re=function(){A(ae)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,se=ce.port2;ce.port1.onmessage=ae,re=function(){se.postMessage(null)}}else re=function(){k(ae,0)};function z(B,K){$=k(function(){B(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(B){B.callback=null},n.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<B?Math.floor(1e3/B):5},n.unstable_getCurrentPriorityLevel=function(){return g},n.unstable_next=function(B){switch(g){case 1:case 2:case 3:var K=3;break;default:K=g}var he=g;g=K;try{return B()}finally{g=he}},n.unstable_requestPaint=function(){x=!0},n.unstable_runWithPriority=function(B,K){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var he=g;g=B;try{return K()}finally{g=he}},n.unstable_scheduleCallback=function(B,K,he){var ge=n.unstable_now();switch(typeof he=="object"&&he!==null?(he=he.delay,he=typeof he=="number"&&0<he?ge+he:ge):he=ge,B){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=he+J,B={id:d++,callback:K,priorityLevel:B,startTime:he,expirationTime:J,sortIndex:-1},he>ge?(B.sortIndex=he,e(h,B),t(c)===null&&B===t(h)&&(v?(C($),$=-1):v=!0,z(E,he-ge))):(B.sortIndex=J,e(c,B),b||O||(b=!0,D||(D=!0,re()))),B},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(B){var K=g;return function(){var he=g;g=K;try{return B.apply(this,arguments)}finally{g=he}}}})(wy)),wy}var fA;function GB(){return fA||(fA=1,ky.exports=WB()),ky.exports}var Ty={exports:{}},vn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var dA;function FB(){if(dA)return vn;dA=1;var n=of();function e(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)h+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function s(c,h,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:c,containerInfo:h,implementation:d}}var l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,vn.createPortal=function(c,h){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return s(c,h,null,d)},vn.flushSync=function(c){var h=l.T,d=i.p;try{if(l.T=null,i.p=2,c)return c()}finally{l.T=h,i.p=d,i.d.f()}},vn.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,i.d.C(c,h))},vn.prefetchDNS=function(c){typeof c=="string"&&i.d.D(c)},vn.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var d=h.as,p=o(d,h.crossOrigin),g=typeof h.integrity=="string"?h.integrity:void 0,O=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;d==="style"?i.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:O}):d==="script"&&i.d.X(c,{crossOrigin:p,integrity:g,fetchPriority:O,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},vn.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var d=o(h.as,h.crossOrigin);i.d.M(c,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&i.d.M(c)},vn.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var d=h.as,p=o(d,h.crossOrigin);i.d.L(c,d,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},vn.preloadModule=function(c,h){if(typeof c=="string")if(h){var d=o(h.as,h.crossOrigin);i.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else i.d.m(c)},vn.requestFormReset=function(c){i.d.r(c)},vn.unstable_batchedUpdates=function(c,h){return c(h)},vn.useFormState=function(c,h,d){return l.H.useFormState(c,h,d)},vn.useFormStatus=function(){return l.H.useHostTransitionStatus()},vn.version="19.2.6",vn}var pA;function OR(){if(pA)return Ty.exports;pA=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Ty.exports=FB(),Ty.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var mA;function KB(){if(mA)return Mu;mA=1;var n=GB(),e=of(),t=OR();function i(a){var u="https://react.dev/errors/"+a;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var u=a,f=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do u=a,(u.flags&4098)!==0&&(f=u.return),a=u.return;while(a)}return u.tag===3?f:null}function l(a){if(a.tag===13){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function o(a){if(a.tag===31){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function c(a){if(s(a)!==a)throw Error(i(188))}function h(a){var u=a.alternate;if(!u){if(u=s(a),u===null)throw Error(i(188));return u!==a?null:a}for(var f=a,m=u;;){var y=f.return;if(y===null)break;var S=y.alternate;if(S===null){if(m=y.return,m!==null){f=m;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===f)return c(y),a;if(S===m)return c(y),u;S=S.sibling}throw Error(i(188))}if(f.return!==m.return)f=y,m=S;else{for(var w=!1,T=y.child;T;){if(T===f){w=!0,f=y,m=S;break}if(T===m){w=!0,m=y,f=S;break}T=T.sibling}if(!w){for(T=S.child;T;){if(T===f){w=!0,f=S,m=y;break}if(T===m){w=!0,m=S,f=y;break}T=T.sibling}if(!w)throw Error(i(189))}}if(f.alternate!==m)throw Error(i(190))}if(f.tag!==3)throw Error(i(188));return f.stateNode.current===f?a:u}function d(a){var u=a.tag;if(u===5||u===26||u===27||u===6)return a;for(a=a.child;a!==null;){if(u=d(a),u!==null)return u;a=a.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),A=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),W=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function re(a){return a===null||typeof a!="object"?null:(a=ae&&a[ae]||a["@@iterator"],typeof a=="function"?a:null)}var ce=Symbol.for("react.client.reference");function se(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ce?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case v:return"Fragment";case k:return"Profiler";case x:return"StrictMode";case E:return"Suspense";case D:return"SuspenseList";case W:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case b:return"Portal";case A:return a.displayName||"Context";case C:return(a._context.displayName||"Context")+".Consumer";case P:var u=a.render;return a=a.displayName,a||(a=u.displayName||u.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case $:return u=a.displayName||null,u!==null?u:se(a.type)||"Memo";case H:u=a._payload,a=a._init;try{return se(a(u))}catch{}}return null}var z=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he={pending:!1,data:null,method:null,action:null},ge=[],J=-1;function Q(a){return{current:a}}function Z(a){0>J||(a.current=ge[J],ge[J]=null,J--)}function G(a,u){J++,ge[J]=a.current,a.current=u}var oe=Q(null),ye=Q(null),Re=Q(null),_e=Q(null);function xt(a,u){switch(G(Re,u),G(ye,a),G(oe,null),u.nodeType){case 9:case 11:a=(a=u.documentElement)&&(a=a.namespaceURI)?EC(a):0;break;default:if(a=u.tagName,u=u.namespaceURI)u=EC(u),a=$C(u,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Z(oe),G(oe,a)}function ot(){Z(oe),Z(ye),Z(Re)}function dr(a){a.memoizedState!==null&&G(_e,a);var u=oe.current,f=$C(u,a.type);u!==f&&(G(ye,a),G(oe,f))}function Vr(a){ye.current===a&&(Z(oe),Z(ye)),_e.current===a&&(Z(_e),ku._currentValue=he)}var Yo,Dc;function qr(a){if(Yo===void 0)try{throw Error()}catch(f){var u=f.stack.trim().match(/\n( *(at )?)/);Yo=u&&u[1]||"",Dc=-1<f.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+Yo+a+Dc}var Bs=!1;function Uo(a,u){if(!a||Bs)return"";Bs=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(u){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(V){var I=V}Reflect.construct(a,[],ee)}else{try{ee.call()}catch(V){I=V}a.call(ee.prototype)}}else{try{throw Error()}catch(V){I=V}(ee=a())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(V){if(V&&I&&typeof V.stack=="string")return[V.stack,I.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=m.DetermineComponentFrameRoot(),w=S[0],T=S[1];if(w&&T){var R=w.split(`
|
|
44
|
+
`),X=T.split(`
|
|
45
|
+
`);for(y=m=0;m<R.length&&!R[m].includes("DetermineComponentFrameRoot");)m++;for(;y<X.length&&!X[y].includes("DetermineComponentFrameRoot");)y++;if(m===R.length||y===X.length)for(m=R.length-1,y=X.length-1;1<=m&&0<=y&&R[m]!==X[y];)y--;for(;1<=m&&0<=y;m--,y--)if(R[m]!==X[y]){if(m!==1||y!==1)do if(m--,y--,0>y||R[m]!==X[y]){var U=`
|
|
46
|
+
`+R[m].replace(" at new "," at ");return a.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",a.displayName)),U}while(1<=m&&0<=y);break}}}finally{Bs=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?qr(f):""}function Wt(a,u){switch(a.tag){case 26:case 27:case 5:return qr(a.type);case 16:return qr("Lazy");case 13:return a.child!==u&&u!==null?qr("Suspense Fallback"):qr("Suspense");case 19:return qr("SuspenseList");case 0:case 15:return Uo(a.type,!1);case 11:return Uo(a.type.render,!1);case 1:return Uo(a.type,!0);case 31:return qr("Activity");default:return""}}function Nc(a){try{var u="",f=null;do u+=Wt(a,f),f=a,a=a.return;while(a);return u}catch(m){return`
|
|
47
|
+
Error generating stack: `+m.message+`
|
|
48
|
+
`+m.stack}}var Wi=Object.prototype.hasOwnProperty,Wo=n.unstable_scheduleCallback,Hr=n.unstable_cancelCallback,Vl=n.unstable_shouldYield,wf=n.unstable_requestPaint,En=n.unstable_now,sO=n.unstable_getCurrentPriorityLevel,Tf=n.unstable_ImmediatePriority,Cf=n.unstable_UserBlockingPriority,Go=n.unstable_NormalPriority,lO=n.unstable_LowPriority,ni=n.unstable_IdlePriority,oO=n.log,uk=n.unstable_setDisableYieldValue,q=null,ie=null;function Me(a){if(typeof oO=="function"&&uk(a),ie&&typeof ie.setStrictMode=="function")try{ie.setStrictMode(q,a)}catch{}}var ve=Math.clz32?Math.clz32:ii,Be=Math.log,_n=Math.LN2;function ii(a){return a>>>=0,a===0?32:31-(Be(a)/_n|0)|0}var Gi=256,Yr=262144,ri=4194304;function Sn(a){var u=a&42;if(u!==0)return u;switch(a&-a){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Fo(a,u,f){var m=a.pendingLanes;if(m===0)return 0;var y=0,S=a.suspendedLanes,w=a.pingedLanes;a=a.warmLanes;var T=m&134217727;return T!==0?(m=T&~S,m!==0?y=Sn(m):(w&=T,w!==0?y=Sn(w):f||(f=T&~a,f!==0&&(y=Sn(f))))):(T=m&~S,T!==0?y=Sn(T):w!==0?y=Sn(w):f||(f=m&~a,f!==0&&(y=Sn(f)))),y===0?0:u!==0&&u!==y&&(u&S)===0&&(S=y&-y,f=u&-u,S>=f||S===32&&(f&4194048)!==0)?u:y}function zc(a,u){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&u)===0}function $5(a,u){switch(a){case 1:case 2:case 4:case 8:case 64:return u+250;case 16:case 32: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 u+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hk(){var a=ri;return ri<<=1,(ri&62914560)===0&&(ri=4194304),a}function aO(a){for(var u=[],f=0;31>f;f++)u.push(a);return u}function Lc(a,u){a.pendingLanes|=u,u!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function R5(a,u,f,m,y,S){var w=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var T=a.entanglements,R=a.expirationTimes,X=a.hiddenUpdates;for(f=w&~f;0<f;){var U=31-ve(f),ee=1<<U;T[U]=0,R[U]=-1;var I=X[U];if(I!==null)for(X[U]=null,U=0;U<I.length;U++){var V=I[U];V!==null&&(V.lane&=-536870913)}f&=~ee}m!==0&&fk(a,m,0),S!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=S&~(w&~u))}function fk(a,u,f){a.pendingLanes|=u,a.suspendedLanes&=~u;var m=31-ve(u);a.entangledLanes|=u,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function dk(a,u){var f=a.entangledLanes|=u;for(a=a.entanglements;f;){var m=31-ve(f),y=1<<m;y&u|a[m]&u&&(a[m]|=u),f&=~y}}function pk(a,u){var f=u&-u;return f=(f&42)!==0?1:cO(f),(f&(a.suspendedLanes|u))!==0?0:f}function cO(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function uO(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function mk(){var a=K.p;return a!==0?a:(a=window.event,a===void 0?32:eA(a.type))}function gk(a,u){var f=K.p;try{return K.p=a,u()}finally{K.p=f}}var Zs=Math.random().toString(36).slice(2),on="__reactFiber$"+Zs,Bn="__reactProps$"+Zs,Ko="__reactContainer$"+Zs,hO="__reactEvents$"+Zs,P5="__reactListeners$"+Zs,D5="__reactHandles$"+Zs,Ok="__reactResources$"+Zs,_c="__reactMarker$"+Zs;function fO(a){delete a[on],delete a[Bn],delete a[hO],delete a[P5],delete a[D5]}function Jo(a){var u=a[on];if(u)return u;for(var f=a.parentNode;f;){if(u=f[Ko]||f[on]){if(f=u.alternate,u.child!==null||f!==null&&f.child!==null)for(a=_C(a);a!==null;){if(f=a[on])return f;a=_C(a)}return u}a=f,f=a.parentNode}return null}function ea(a){if(a=a[on]||a[Ko]){var u=a.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return a}return null}function Bc(a){var u=a.tag;if(u===5||u===26||u===27||u===6)return a.stateNode;throw Error(i(33))}function ta(a){var u=a[Ok];return u||(u=a[Ok]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function Jt(a){a[_c]=!0}var yk=new Set,bk={};function ql(a,u){na(a,u),na(a+"Capture",u)}function na(a,u){for(bk[a]=u,a=0;a<u.length;a++)yk.add(u[a])}var N5=RegExp("^[: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]*$"),Sk={},vk={};function z5(a){return Wi.call(vk,a)?!0:Wi.call(Sk,a)?!1:N5.test(a)?vk[a]=!0:(Sk[a]=!0,!1)}function Af(a,u,f){if(z5(u))if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(u);return;case"boolean":var m=u.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(u);return}}a.setAttribute(u,""+f)}}function Mf(a,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttribute(u,""+f)}}function Ur(a,u,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(u,f,""+m)}}function Ti(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function xk(a){var u=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function L5(a,u,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,u);if(!a.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var y=m.get,S=m.set;return Object.defineProperty(a,u,{configurable:!0,get:function(){return y.call(this)},set:function(w){f=""+w,S.call(this,w)}}),Object.defineProperty(a,u,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(w){f=""+w},stopTracking:function(){a._valueTracker=null,delete a[u]}}}}function dO(a){if(!a._valueTracker){var u=xk(a)?"checked":"value";a._valueTracker=L5(a,u,""+a[u])}}function kk(a){if(!a)return!1;var u=a._valueTracker;if(!u)return!0;var f=u.getValue(),m="";return a&&(m=xk(a)?a.checked?"true":"false":a.value),a=m,a!==f?(u.setValue(a),!0):!1}function Qf(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var _5=/[\n"\\]/g;function Ci(a){return a.replace(_5,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function pO(a,u,f,m,y,S,w,T){a.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?a.type=w:a.removeAttribute("type"),u!=null?w==="number"?(u===0&&a.value===""||a.value!=u)&&(a.value=""+Ti(u)):a.value!==""+Ti(u)&&(a.value=""+Ti(u)):w!=="submit"&&w!=="reset"||a.removeAttribute("value"),u!=null?mO(a,w,Ti(u)):f!=null?mO(a,w,Ti(f)):m!=null&&a.removeAttribute("value"),y==null&&S!=null&&(a.defaultChecked=!!S),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?a.name=""+Ti(T):a.removeAttribute("name")}function wk(a,u,f,m,y,S,w,T){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),u!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||u!=null)){dO(a);return}f=f!=null?""+Ti(f):"",u=u!=null?""+Ti(u):f,T||u===a.value||(a.value=u),a.defaultValue=u}m=m??y,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=T?a.checked:!!m,a.defaultChecked=!!m,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.name=w),dO(a)}function mO(a,u,f){u==="number"&&Qf(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function ia(a,u,f,m){if(a=a.options,u){u={};for(var y=0;y<f.length;y++)u["$"+f[y]]=!0;for(f=0;f<a.length;f++)y=u.hasOwnProperty("$"+a[f].value),a[f].selected!==y&&(a[f].selected=y),y&&m&&(a[f].defaultSelected=!0)}else{for(f=""+Ti(f),u=null,y=0;y<a.length;y++){if(a[y].value===f){a[y].selected=!0,m&&(a[y].defaultSelected=!0);return}u!==null||a[y].disabled||(u=a[y])}u!==null&&(u.selected=!0)}}function Tk(a,u,f){if(u!=null&&(u=""+Ti(u),u!==a.value&&(a.value=u),f==null)){a.defaultValue!==u&&(a.defaultValue=u);return}a.defaultValue=f!=null?""+Ti(f):""}function Ck(a,u,f,m){if(u==null){if(m!=null){if(f!=null)throw Error(i(92));if(z(m)){if(1<m.length)throw Error(i(93));m=m[0]}f=m}f==null&&(f=""),u=f}f=Ti(u),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),dO(a)}function ra(a,u){if(u){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=u;return}}a.textContent=u}var B5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ak(a,u,f){var m=u.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(u,""):u==="float"?a.cssFloat="":a[u]="":m?a.setProperty(u,f):typeof f!="number"||f===0||B5.has(u)?u==="float"?a.cssFloat=f:a[u]=(""+f).trim():a[u]=f+"px"}function Mk(a,u,f){if(u!=null&&typeof u!="object")throw Error(i(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||u!=null&&u.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var y in u)m=u[y],u.hasOwnProperty(y)&&f[y]!==m&&Ak(a,y,m)}else for(var S in u)u.hasOwnProperty(S)&&Ak(a,S,u[S])}function gO(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Z5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),j5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ef(a){return j5.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Wr(){}var OO=null;function yO(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var sa=null,la=null;function Qk(a){var u=ea(a);if(u&&(a=u.stateNode)){var f=a[Bn]||null;e:switch(a=u.stateNode,u.type){case"input":if(pO(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),u=f.name,f.type==="radio"&&u!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Ci(""+u)+'"][type="radio"]'),u=0;u<f.length;u++){var m=f[u];if(m!==a&&m.form===a.form){var y=m[Bn]||null;if(!y)throw Error(i(90));pO(m,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(u=0;u<f.length;u++)m=f[u],m.form===a.form&&kk(m)}break e;case"textarea":Tk(a,f.value,f.defaultValue);break e;case"select":u=f.value,u!=null&&ia(a,!!f.multiple,u,!1)}}}var bO=!1;function Ek(a,u,f){if(bO)return a(u,f);bO=!0;try{var m=a(u);return m}finally{if(bO=!1,(sa!==null||la!==null)&&(Od(),sa&&(u=sa,a=la,la=sa=null,Qk(u),a)))for(u=0;u<a.length;u++)Qk(a[u])}}function Zc(a,u){var f=a.stateNode;if(f===null)return null;var m=f[Bn]||null;if(m===null)return null;f=m[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(i(231,u,typeof f));return f}var Gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),SO=!1;if(Gr)try{var jc={};Object.defineProperty(jc,"passive",{get:function(){SO=!0}}),window.addEventListener("test",jc,jc),window.removeEventListener("test",jc,jc)}catch{SO=!1}var js=null,vO=null,$f=null;function $k(){if($f)return $f;var a,u=vO,f=u.length,m,y="value"in js?js.value:js.textContent,S=y.length;for(a=0;a<f&&u[a]===y[a];a++);var w=f-a;for(m=1;m<=w&&u[f-m]===y[S-m];m++);return $f=y.slice(a,1<m?1-m:void 0)}function Rf(a){var u=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&u===13&&(a=13)):a=u,a===10&&(a=13),32<=a||a===13?a:0}function Pf(){return!0}function Rk(){return!1}function Zn(a){function u(f,m,y,S,w){this._reactName=f,this._targetInst=y,this.type=m,this.nativeEvent=S,this.target=w,this.currentTarget=null;for(var T in a)a.hasOwnProperty(T)&&(f=a[T],this[T]=f?f(S):S[T]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Pf:Rk,this.isPropagationStopped=Rk,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Pf)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Pf)},persist:function(){},isPersistent:Pf}),u}var Hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Df=Zn(Hl),Xc=p({},Hl,{view:0,detail:0}),X5=Zn(Xc),xO,kO,Ic,Nf=p({},Xc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:TO,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Ic&&(Ic&&a.type==="mousemove"?(xO=a.screenX-Ic.screenX,kO=a.screenY-Ic.screenY):kO=xO=0,Ic=a),xO)},movementY:function(a){return"movementY"in a?a.movementY:kO}}),Pk=Zn(Nf),I5=p({},Nf,{dataTransfer:0}),V5=Zn(I5),q5=p({},Xc,{relatedTarget:0}),wO=Zn(q5),H5=p({},Hl,{animationName:0,elapsedTime:0,pseudoElement:0}),Y5=Zn(H5),U5=p({},Hl,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),W5=Zn(U5),G5=p({},Hl,{data:0}),Dk=Zn(G5),F5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},K5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},J5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e_(a){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(a):(a=J5[a])?!!u[a]:!1}function TO(){return e_}var t_=p({},Xc,{key:function(a){if(a.key){var u=F5[a.key]||a.key;if(u!=="Unidentified")return u}return a.type==="keypress"?(a=Rf(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?K5[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:TO,charCode:function(a){return a.type==="keypress"?Rf(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Rf(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),n_=Zn(t_),i_=p({},Nf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Nk=Zn(i_),r_=p({},Xc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:TO}),s_=Zn(r_),l_=p({},Hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),o_=Zn(l_),a_=p({},Nf,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),c_=Zn(a_),u_=p({},Hl,{newState:0,oldState:0}),h_=Zn(u_),f_=[9,13,27,32],CO=Gr&&"CompositionEvent"in window,Vc=null;Gr&&"documentMode"in document&&(Vc=document.documentMode);var d_=Gr&&"TextEvent"in window&&!Vc,zk=Gr&&(!CO||Vc&&8<Vc&&11>=Vc),Lk=" ",_k=!1;function Bk(a,u){switch(a){case"keyup":return f_.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zk(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var oa=!1;function p_(a,u){switch(a){case"compositionend":return Zk(u);case"keypress":return u.which!==32?null:(_k=!0,Lk);case"textInput":return a=u.data,a===Lk&&_k?null:a;default:return null}}function m_(a,u){if(oa)return a==="compositionend"||!CO&&Bk(a,u)?(a=$k(),$f=vO=js=null,oa=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return zk&&u.locale!=="ko"?null:u.data;default:return null}}var g_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jk(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u==="input"?!!g_[a.type]:u==="textarea"}function Xk(a,u,f,m){sa?la?la.push(m):la=[m]:sa=m,u=wd(u,"onChange"),0<u.length&&(f=new Df("onChange","change",null,f,m),a.push({event:f,listeners:u}))}var qc=null,Hc=null;function O_(a){wC(a,0)}function zf(a){var u=Bc(a);if(kk(u))return a}function Ik(a,u){if(a==="change")return u}var Vk=!1;if(Gr){var AO;if(Gr){var MO="oninput"in document;if(!MO){var qk=document.createElement("div");qk.setAttribute("oninput","return;"),MO=typeof qk.oninput=="function"}AO=MO}else AO=!1;Vk=AO&&(!document.documentMode||9<document.documentMode)}function Hk(){qc&&(qc.detachEvent("onpropertychange",Yk),Hc=qc=null)}function Yk(a){if(a.propertyName==="value"&&zf(Hc)){var u=[];Xk(u,Hc,a,yO(a)),Ek(O_,u)}}function y_(a,u,f){a==="focusin"?(Hk(),qc=u,Hc=f,qc.attachEvent("onpropertychange",Yk)):a==="focusout"&&Hk()}function b_(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return zf(Hc)}function S_(a,u){if(a==="click")return zf(u)}function v_(a,u){if(a==="input"||a==="change")return zf(u)}function x_(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var si=typeof Object.is=="function"?Object.is:x_;function Yc(a,u){if(si(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var f=Object.keys(a),m=Object.keys(u);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var y=f[m];if(!Wi.call(u,y)||!si(a[y],u[y]))return!1}return!0}function Uk(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Wk(a,u){var f=Uk(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=u&&m>=u)return{node:f,offset:u-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Uk(f)}}function Gk(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?Gk(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function Fk(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var u=Qf(a.document);u instanceof a.HTMLIFrameElement;){try{var f=typeof u.contentWindow.location.href=="string"}catch{f=!1}if(f)a=u.contentWindow;else break;u=Qf(a.document)}return u}function QO(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}var k_=Gr&&"documentMode"in document&&11>=document.documentMode,aa=null,EO=null,Uc=null,$O=!1;function Kk(a,u,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;$O||aa==null||aa!==Qf(m)||(m=aa,"selectionStart"in m&&QO(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Uc&&Yc(Uc,m)||(Uc=m,m=wd(EO,"onSelect"),0<m.length&&(u=new Df("onSelect","select",null,u,f),a.push({event:u,listeners:m}),u.target=aa)))}function Yl(a,u){var f={};return f[a.toLowerCase()]=u.toLowerCase(),f["Webkit"+a]="webkit"+u,f["Moz"+a]="moz"+u,f}var ca={animationend:Yl("Animation","AnimationEnd"),animationiteration:Yl("Animation","AnimationIteration"),animationstart:Yl("Animation","AnimationStart"),transitionrun:Yl("Transition","TransitionRun"),transitionstart:Yl("Transition","TransitionStart"),transitioncancel:Yl("Transition","TransitionCancel"),transitionend:Yl("Transition","TransitionEnd")},RO={},Jk={};Gr&&(Jk=document.createElement("div").style,"AnimationEvent"in window||(delete ca.animationend.animation,delete ca.animationiteration.animation,delete ca.animationstart.animation),"TransitionEvent"in window||delete ca.transitionend.transition);function Ul(a){if(RO[a])return RO[a];if(!ca[a])return a;var u=ca[a],f;for(f in u)if(u.hasOwnProperty(f)&&f in Jk)return RO[a]=u[f];return a}var ew=Ul("animationend"),tw=Ul("animationiteration"),nw=Ul("animationstart"),w_=Ul("transitionrun"),T_=Ul("transitionstart"),C_=Ul("transitioncancel"),iw=Ul("transitionend"),rw=new Map,PO="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");PO.push("scrollEnd");function Fi(a,u){rw.set(a,u),ql(u,[a])}var Lf=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ai=[],ua=0,DO=0;function _f(){for(var a=ua,u=DO=ua=0;u<a;){var f=Ai[u];Ai[u++]=null;var m=Ai[u];Ai[u++]=null;var y=Ai[u];Ai[u++]=null;var S=Ai[u];if(Ai[u++]=null,m!==null&&y!==null){var w=m.pending;w===null?y.next=y:(y.next=w.next,w.next=y),m.pending=y}S!==0&&sw(f,y,S)}}function Bf(a,u,f,m){Ai[ua++]=a,Ai[ua++]=u,Ai[ua++]=f,Ai[ua++]=m,DO|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function NO(a,u,f,m){return Bf(a,u,f,m),Zf(a)}function Wl(a,u){return Bf(a,null,null,u),Zf(a)}function sw(a,u,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var y=!1,S=a.return;S!==null;)S.childLanes|=f,m=S.alternate,m!==null&&(m.childLanes|=f),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(y=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,y&&u!==null&&(y=31-ve(f),a=S.hiddenUpdates,m=a[y],m===null?a[y]=[u]:m.push(u),u.lane=f|536870912),S):null}function Zf(a){if(50<gu)throw gu=0,V0=null,Error(i(185));for(var u=a.return;u!==null;)a=u,u=a.return;return a.tag===3?a.stateNode:null}var ha={};function A_(a,u,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(a,u,f,m){return new A_(a,u,f,m)}function zO(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Fr(a,u){var f=a.alternate;return f===null?(f=li(a.tag,u,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=u,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,u=a.dependencies,f.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function lw(a,u){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=u,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,u=f.dependencies,a.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),a}function jf(a,u,f,m,y,S){var w=0;if(m=a,typeof a=="function")zO(a)&&(w=1);else if(typeof a=="string")w=RB(a,f,oe.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case W:return a=li(31,f,u,y),a.elementType=W,a.lanes=S,a;case v:return Gl(f.children,y,S,u);case x:w=8,y|=24;break;case k:return a=li(12,f,u,y|2),a.elementType=k,a.lanes=S,a;case E:return a=li(13,f,u,y),a.elementType=E,a.lanes=S,a;case D:return a=li(19,f,u,y),a.elementType=D,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case A:w=10;break e;case C:w=9;break e;case P:w=11;break e;case $:w=14;break e;case H:w=16,m=null;break e}w=29,f=Error(i(130,a===null?"null":typeof a,"")),m=null}return u=li(w,f,u,y),u.elementType=a,u.type=m,u.lanes=S,u}function Gl(a,u,f,m){return a=li(7,a,m,u),a.lanes=f,a}function LO(a,u,f){return a=li(6,a,null,u),a.lanes=f,a}function ow(a){var u=li(18,null,null,0);return u.stateNode=a,u}function _O(a,u,f){return u=li(4,a.children!==null?a.children:[],a.key,u),u.lanes=f,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}var aw=new WeakMap;function Mi(a,u){if(typeof a=="object"&&a!==null){var f=aw.get(a);return f!==void 0?f:(u={value:a,source:u,stack:Nc(u)},aw.set(a,u),u)}return{value:a,source:u,stack:Nc(u)}}var fa=[],da=0,Xf=null,Wc=0,Qi=[],Ei=0,Xs=null,pr=1,mr="";function Kr(a,u){fa[da++]=Wc,fa[da++]=Xf,Xf=a,Wc=u}function cw(a,u,f){Qi[Ei++]=pr,Qi[Ei++]=mr,Qi[Ei++]=Xs,Xs=a;var m=pr;a=mr;var y=32-ve(m)-1;m&=~(1<<y),f+=1;var S=32-ve(u)+y;if(30<S){var w=y-y%5;S=(m&(1<<w)-1).toString(32),m>>=w,y-=w,pr=1<<32-ve(u)+y|f<<y|m,mr=S+a}else pr=1<<S|f<<y|m,mr=a}function BO(a){a.return!==null&&(Kr(a,1),cw(a,1,0))}function ZO(a){for(;a===Xf;)Xf=fa[--da],fa[da]=null,Wc=fa[--da],fa[da]=null;for(;a===Xs;)Xs=Qi[--Ei],Qi[Ei]=null,mr=Qi[--Ei],Qi[Ei]=null,pr=Qi[--Ei],Qi[Ei]=null}function uw(a,u){Qi[Ei++]=pr,Qi[Ei++]=mr,Qi[Ei++]=Xs,pr=u.id,mr=u.overflow,Xs=a}var an=null,kt=null,Ue=!1,Is=null,$i=!1,jO=Error(i(519));function Vs(a){var u=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gc(Mi(u,a)),jO}function hw(a){var u=a.stateNode,f=a.type,m=a.memoizedProps;switch(u[on]=a,u[Bn]=m,f){case"dialog":Ie("cancel",u),Ie("close",u);break;case"iframe":case"object":case"embed":Ie("load",u);break;case"video":case"audio":for(f=0;f<yu.length;f++)Ie(yu[f],u);break;case"source":Ie("error",u);break;case"img":case"image":case"link":Ie("error",u),Ie("load",u);break;case"details":Ie("toggle",u);break;case"input":Ie("invalid",u),wk(u,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ie("invalid",u);break;case"textarea":Ie("invalid",u),Ck(u,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||u.textContent===""+f||m.suppressHydrationWarning===!0||MC(u.textContent,f)?(m.popover!=null&&(Ie("beforetoggle",u),Ie("toggle",u)),m.onScroll!=null&&Ie("scroll",u),m.onScrollEnd!=null&&Ie("scrollend",u),m.onClick!=null&&(u.onclick=Wr),u=!0):u=!1,u||Vs(a,!0)}function fw(a){for(an=a.return;an;)switch(an.tag){case 5:case 31:case 13:$i=!1;return;case 27:case 3:$i=!0;return;default:an=an.return}}function pa(a){if(a!==an)return!1;if(!Ue)return fw(a),Ue=!0,!1;var u=a.tag,f;if((f=u!==3&&u!==27)&&((f=u===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||sy(a.type,a.memoizedProps)),f=!f),f&&kt&&Vs(a),fw(a),u===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));kt=LC(a)}else if(u===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(317));kt=LC(a)}else u===27?(u=kt,rl(a.type)?(a=uy,uy=null,kt=a):kt=u):kt=an?Pi(a.stateNode.nextSibling):null;return!0}function Fl(){kt=an=null,Ue=!1}function XO(){var a=Is;return a!==null&&(Vn===null?Vn=a:Vn.push.apply(Vn,a),Is=null),a}function Gc(a){Is===null?Is=[a]:Is.push(a)}var IO=Q(null),Kl=null,Jr=null;function qs(a,u,f){G(IO,u._currentValue),u._currentValue=f}function es(a){a._currentValue=IO.current,Z(IO)}function VO(a,u,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,m!==null&&(m.childLanes|=u)):m!==null&&(m.childLanes&u)!==u&&(m.childLanes|=u),a===f)break;a=a.return}}function qO(a,u,f,m){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var S=y.dependencies;if(S!==null){var w=y.child;S=S.firstContext;e:for(;S!==null;){var T=S;S=y;for(var R=0;R<u.length;R++)if(T.context===u[R]){S.lanes|=f,T=S.alternate,T!==null&&(T.lanes|=f),VO(S.return,f,a),m||(w=null);break e}S=T.next}}else if(y.tag===18){if(w=y.return,w===null)throw Error(i(341));w.lanes|=f,S=w.alternate,S!==null&&(S.lanes|=f),VO(w,f,a),w=null}else w=y.child;if(w!==null)w.return=y;else for(w=y;w!==null;){if(w===a){w=null;break}if(y=w.sibling,y!==null){y.return=w.return,w=y;break}w=w.return}y=w}}function ma(a,u,f,m){a=null;for(var y=u,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var w=y.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var T=y.type;si(y.pendingProps.value,w.value)||(a!==null?a.push(T):a=[T])}}else if(y===_e.current){if(w=y.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(ku):a=[ku])}y=y.return}a!==null&&qO(u,a,f,m),u.flags|=262144}function If(a){for(a=a.firstContext;a!==null;){if(!si(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Jl(a){Kl=a,Jr=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function cn(a){return dw(Kl,a)}function Vf(a,u){return Kl===null&&Jl(a),dw(a,u)}function dw(a,u){var f=u._currentValue;if(u={context:u,memoizedValue:f,next:null},Jr===null){if(a===null)throw Error(i(308));Jr=u,a.dependencies={lanes:0,firstContext:u},a.flags|=524288}else Jr=Jr.next=u;return f}var M_=typeof AbortController<"u"?AbortController:function(){var a=[],u=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){u.aborted=!0,a.forEach(function(f){return f()})}},Q_=n.unstable_scheduleCallback,E_=n.unstable_NormalPriority,jt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function HO(){return{controller:new M_,data:new Map,refCount:0}}function Fc(a){a.refCount--,a.refCount===0&&Q_(E_,function(){a.controller.abort()})}var Kc=null,YO=0,ga=0,Oa=null;function $_(a,u){if(Kc===null){var f=Kc=[];YO=0,ga=G0(),Oa={status:"pending",value:void 0,then:function(m){f.push(m)}}}return YO++,u.then(pw,pw),u}function pw(){if(--YO===0&&Kc!==null){Oa!==null&&(Oa.status="fulfilled");var a=Kc;Kc=null,ga=0,Oa=null;for(var u=0;u<a.length;u++)(0,a[u])()}}function R_(a,u){var f=[],m={status:"pending",value:null,reason:null,then:function(y){f.push(y)}};return a.then(function(){m.status="fulfilled",m.value=u;for(var y=0;y<f.length;y++)(0,f[y])(u)},function(y){for(m.status="rejected",m.reason=y,y=0;y<f.length;y++)(0,f[y])(void 0)}),m}var mw=B.S;B.S=function(a,u){KT=En(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&$_(a,u),mw!==null&&mw(a,u)};var eo=Q(null);function UO(){var a=eo.current;return a!==null?a:ft.pooledCache}function qf(a,u){u===null?G(eo,eo.current):G(eo,u.pool)}function gw(){var a=UO();return a===null?null:{parent:jt._currentValue,pool:a}}var ya=Error(i(460)),WO=Error(i(474)),Hf=Error(i(542)),Yf={then:function(){}};function Ow(a){return a=a.status,a==="fulfilled"||a==="rejected"}function yw(a,u,f){switch(f=a[f],f===void 0?a.push(u):f!==u&&(u.then(Wr,Wr),u=f),u.status){case"fulfilled":return u.value;case"rejected":throw a=u.reason,Sw(a),a;default:if(typeof u.status=="string")u.then(Wr,Wr);else{if(a=ft,a!==null&&100<a.shellSuspendCounter)throw Error(i(482));a=u,a.status="pending",a.then(function(m){if(u.status==="pending"){var y=u;y.status="fulfilled",y.value=m}},function(m){if(u.status==="pending"){var y=u;y.status="rejected",y.reason=m}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw a=u.reason,Sw(a),a}throw no=u,ya}}function to(a){try{var u=a._init;return u(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(no=f,ya):f}}var no=null;function bw(){if(no===null)throw Error(i(459));var a=no;return no=null,a}function Sw(a){if(a===ya||a===Hf)throw Error(i(483))}var ba=null,Jc=0;function Uf(a){var u=Jc;return Jc+=1,ba===null&&(ba=[]),yw(ba,a,u)}function eu(a,u){u=u.props.ref,a.ref=u!==void 0?u:null}function Wf(a,u){throw u.$$typeof===g?Error(i(525)):(a=Object.prototype.toString.call(u),Error(i(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a)))}function vw(a){function u(L,N){if(a){var j=L.deletions;j===null?(L.deletions=[N],L.flags|=16):j.push(N)}}function f(L,N){if(!a)return null;for(;N!==null;)u(L,N),N=N.sibling;return null}function m(L){for(var N=new Map;L!==null;)L.key!==null?N.set(L.key,L):N.set(L.index,L),L=L.sibling;return N}function y(L,N){return L=Fr(L,N),L.index=0,L.sibling=null,L}function S(L,N,j){return L.index=j,a?(j=L.alternate,j!==null?(j=j.index,j<N?(L.flags|=67108866,N):j):(L.flags|=67108866,N)):(L.flags|=1048576,N)}function w(L){return a&&L.alternate===null&&(L.flags|=67108866),L}function T(L,N,j,F){return N===null||N.tag!==6?(N=LO(j,L.mode,F),N.return=L,N):(N=y(N,j),N.return=L,N)}function R(L,N,j,F){var Ce=j.type;return Ce===v?U(L,N,j.props.children,F,j.key):N!==null&&(N.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===H&&to(Ce)===N.type)?(N=y(N,j.props),eu(N,j),N.return=L,N):(N=jf(j.type,j.key,j.props,null,L.mode,F),eu(N,j),N.return=L,N)}function X(L,N,j,F){return N===null||N.tag!==4||N.stateNode.containerInfo!==j.containerInfo||N.stateNode.implementation!==j.implementation?(N=_O(j,L.mode,F),N.return=L,N):(N=y(N,j.children||[]),N.return=L,N)}function U(L,N,j,F,Ce){return N===null||N.tag!==7?(N=Gl(j,L.mode,F,Ce),N.return=L,N):(N=y(N,j),N.return=L,N)}function ee(L,N,j){if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return N=LO(""+N,L.mode,j),N.return=L,N;if(typeof N=="object"&&N!==null){switch(N.$$typeof){case O:return j=jf(N.type,N.key,N.props,null,L.mode,j),eu(j,N),j.return=L,j;case b:return N=_O(N,L.mode,j),N.return=L,N;case H:return N=to(N),ee(L,N,j)}if(z(N)||re(N))return N=Gl(N,L.mode,j,null),N.return=L,N;if(typeof N.then=="function")return ee(L,Uf(N),j);if(N.$$typeof===A)return ee(L,Vf(L,N),j);Wf(L,N)}return null}function I(L,N,j,F){var Ce=N!==null?N.key:null;if(typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint")return Ce!==null?null:T(L,N,""+j,F);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case O:return j.key===Ce?R(L,N,j,F):null;case b:return j.key===Ce?X(L,N,j,F):null;case H:return j=to(j),I(L,N,j,F)}if(z(j)||re(j))return Ce!==null?null:U(L,N,j,F,null);if(typeof j.then=="function")return I(L,N,Uf(j),F);if(j.$$typeof===A)return I(L,N,Vf(L,j),F);Wf(L,j)}return null}function V(L,N,j,F,Ce){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return L=L.get(j)||null,T(N,L,""+F,Ce);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case O:return L=L.get(F.key===null?j:F.key)||null,R(N,L,F,Ce);case b:return L=L.get(F.key===null?j:F.key)||null,X(N,L,F,Ce);case H:return F=to(F),V(L,N,j,F,Ce)}if(z(F)||re(F))return L=L.get(j)||null,U(N,L,F,Ce,null);if(typeof F.then=="function")return V(L,N,j,Uf(F),Ce);if(F.$$typeof===A)return V(L,N,j,Vf(N,F),Ce);Wf(N,F)}return null}function be(L,N,j,F){for(var Ce=null,Fe=null,Se=N,Ze=N=0,He=null;Se!==null&&Ze<j.length;Ze++){Se.index>Ze?(He=Se,Se=null):He=Se.sibling;var Ke=I(L,Se,j[Ze],F);if(Ke===null){Se===null&&(Se=He);break}a&&Se&&Ke.alternate===null&&u(L,Se),N=S(Ke,N,Ze),Fe===null?Ce=Ke:Fe.sibling=Ke,Fe=Ke,Se=He}if(Ze===j.length)return f(L,Se),Ue&&Kr(L,Ze),Ce;if(Se===null){for(;Ze<j.length;Ze++)Se=ee(L,j[Ze],F),Se!==null&&(N=S(Se,N,Ze),Fe===null?Ce=Se:Fe.sibling=Se,Fe=Se);return Ue&&Kr(L,Ze),Ce}for(Se=m(Se);Ze<j.length;Ze++)He=V(Se,L,Ze,j[Ze],F),He!==null&&(a&&He.alternate!==null&&Se.delete(He.key===null?Ze:He.key),N=S(He,N,Ze),Fe===null?Ce=He:Fe.sibling=He,Fe=He);return a&&Se.forEach(function(cl){return u(L,cl)}),Ue&&Kr(L,Ze),Ce}function Qe(L,N,j,F){if(j==null)throw Error(i(151));for(var Ce=null,Fe=null,Se=N,Ze=N=0,He=null,Ke=j.next();Se!==null&&!Ke.done;Ze++,Ke=j.next()){Se.index>Ze?(He=Se,Se=null):He=Se.sibling;var cl=I(L,Se,Ke.value,F);if(cl===null){Se===null&&(Se=He);break}a&&Se&&cl.alternate===null&&u(L,Se),N=S(cl,N,Ze),Fe===null?Ce=cl:Fe.sibling=cl,Fe=cl,Se=He}if(Ke.done)return f(L,Se),Ue&&Kr(L,Ze),Ce;if(Se===null){for(;!Ke.done;Ze++,Ke=j.next())Ke=ee(L,Ke.value,F),Ke!==null&&(N=S(Ke,N,Ze),Fe===null?Ce=Ke:Fe.sibling=Ke,Fe=Ke);return Ue&&Kr(L,Ze),Ce}for(Se=m(Se);!Ke.done;Ze++,Ke=j.next())Ke=V(Se,L,Ze,Ke.value,F),Ke!==null&&(a&&Ke.alternate!==null&&Se.delete(Ke.key===null?Ze:Ke.key),N=S(Ke,N,Ze),Fe===null?Ce=Ke:Fe.sibling=Ke,Fe=Ke);return a&&Se.forEach(function(IB){return u(L,IB)}),Ue&&Kr(L,Ze),Ce}function ut(L,N,j,F){if(typeof j=="object"&&j!==null&&j.type===v&&j.key===null&&(j=j.props.children),typeof j=="object"&&j!==null){switch(j.$$typeof){case O:e:{for(var Ce=j.key;N!==null;){if(N.key===Ce){if(Ce=j.type,Ce===v){if(N.tag===7){f(L,N.sibling),F=y(N,j.props.children),F.return=L,L=F;break e}}else if(N.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===H&&to(Ce)===N.type){f(L,N.sibling),F=y(N,j.props),eu(F,j),F.return=L,L=F;break e}f(L,N);break}else u(L,N);N=N.sibling}j.type===v?(F=Gl(j.props.children,L.mode,F,j.key),F.return=L,L=F):(F=jf(j.type,j.key,j.props,null,L.mode,F),eu(F,j),F.return=L,L=F)}return w(L);case b:e:{for(Ce=j.key;N!==null;){if(N.key===Ce)if(N.tag===4&&N.stateNode.containerInfo===j.containerInfo&&N.stateNode.implementation===j.implementation){f(L,N.sibling),F=y(N,j.children||[]),F.return=L,L=F;break e}else{f(L,N);break}else u(L,N);N=N.sibling}F=_O(j,L.mode,F),F.return=L,L=F}return w(L);case H:return j=to(j),ut(L,N,j,F)}if(z(j))return be(L,N,j,F);if(re(j)){if(Ce=re(j),typeof Ce!="function")throw Error(i(150));return j=Ce.call(j),Qe(L,N,j,F)}if(typeof j.then=="function")return ut(L,N,Uf(j),F);if(j.$$typeof===A)return ut(L,N,Vf(L,j),F);Wf(L,j)}return typeof j=="string"&&j!==""||typeof j=="number"||typeof j=="bigint"?(j=""+j,N!==null&&N.tag===6?(f(L,N.sibling),F=y(N,j),F.return=L,L=F):(f(L,N),F=LO(j,L.mode,F),F.return=L,L=F),w(L)):f(L,N)}return function(L,N,j,F){try{Jc=0;var Ce=ut(L,N,j,F);return ba=null,Ce}catch(Se){if(Se===ya||Se===Hf)throw Se;var Fe=li(29,Se,null,L.mode);return Fe.lanes=F,Fe.return=L,Fe}finally{}}}var io=vw(!0),xw=vw(!1),Hs=!1;function GO(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function FO(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ys(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Us(a,u,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Je&2)!==0){var y=m.pending;return y===null?u.next=u:(u.next=y.next,y.next=u),m.pending=u,u=Zf(a),sw(a,null,f),u}return Bf(a,m,u,f),Zf(a)}function tu(a,u,f){if(u=u.updateQueue,u!==null&&(u=u.shared,(f&4194048)!==0)){var m=u.lanes;m&=a.pendingLanes,f|=m,u.lanes=f,dk(a,f)}}function KO(a,u){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var y=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var w={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?y=S=w:S=S.next=w,f=f.next}while(f!==null);S===null?y=S=u:S=S.next=u}else y=S=u;f={baseState:m.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=u}var JO=!1;function nu(){if(JO){var a=Oa;if(a!==null)throw a}}function iu(a,u,f,m){JO=!1;var y=a.updateQueue;Hs=!1;var S=y.firstBaseUpdate,w=y.lastBaseUpdate,T=y.shared.pending;if(T!==null){y.shared.pending=null;var R=T,X=R.next;R.next=null,w===null?S=X:w.next=X,w=R;var U=a.alternate;U!==null&&(U=U.updateQueue,T=U.lastBaseUpdate,T!==w&&(T===null?U.firstBaseUpdate=X:T.next=X,U.lastBaseUpdate=R))}if(S!==null){var ee=y.baseState;w=0,U=X=R=null,T=S;do{var I=T.lane&-536870913,V=I!==T.lane;if(V?(qe&I)===I:(m&I)===I){I!==0&&I===ga&&(JO=!0),U!==null&&(U=U.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var be=a,Qe=T;I=u;var ut=f;switch(Qe.tag){case 1:if(be=Qe.payload,typeof be=="function"){ee=be.call(ut,ee,I);break e}ee=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=Qe.payload,I=typeof be=="function"?be.call(ut,ee,I):be,I==null)break e;ee=p({},ee,I);break e;case 2:Hs=!0}}I=T.callback,I!==null&&(a.flags|=64,V&&(a.flags|=8192),V=y.callbacks,V===null?y.callbacks=[I]:V.push(I))}else V={lane:I,tag:T.tag,payload:T.payload,callback:T.callback,next:null},U===null?(X=U=V,R=ee):U=U.next=V,w|=I;if(T=T.next,T===null){if(T=y.shared.pending,T===null)break;V=T,T=V.next,V.next=null,y.lastBaseUpdate=V,y.shared.pending=null}}while(!0);U===null&&(R=ee),y.baseState=R,y.firstBaseUpdate=X,y.lastBaseUpdate=U,S===null&&(y.shared.lanes=0),Js|=w,a.lanes=w,a.memoizedState=ee}}function kw(a,u){if(typeof a!="function")throw Error(i(191,a));a.call(u)}function ww(a,u){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)kw(f[a],u)}var Sa=Q(null),Gf=Q(0);function Tw(a,u){a=us,G(Gf,a),G(Sa,u),us=a|u.baseLanes}function e0(){G(Gf,us),G(Sa,Sa.current)}function t0(){us=Gf.current,Z(Sa),Z(Gf)}var oi=Q(null),Ri=null;function Ws(a){var u=a.alternate;G(_t,_t.current&1),G(oi,a),Ri===null&&(u===null||Sa.current!==null||u.memoizedState!==null)&&(Ri=a)}function n0(a){G(_t,_t.current),G(oi,a),Ri===null&&(Ri=a)}function Cw(a){a.tag===22?(G(_t,_t.current),G(oi,a),Ri===null&&(Ri=a)):Gs()}function Gs(){G(_t,_t.current),G(oi,oi.current)}function ai(a){Z(oi),Ri===a&&(Ri=null),Z(_t)}var _t=Q(0);function Ff(a){for(var u=a;u!==null;){if(u.tag===13){var f=u.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||ay(f)||cy(f)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var ts=0,Le=null,at=null,Xt=null,Kf=!1,va=!1,ro=!1,Jf=0,ru=0,xa=null,P_=0;function $t(){throw Error(i(321))}function i0(a,u){if(u===null)return!1;for(var f=0;f<u.length&&f<a.length;f++)if(!si(a[f],u[f]))return!1;return!0}function r0(a,u,f,m,y,S){return ts=S,Le=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,B.H=a===null||a.memoizedState===null?cT:b0,ro=!1,S=f(m,y),ro=!1,va&&(S=Mw(u,f,m,y)),Aw(a),S}function Aw(a){B.H=ou;var u=at!==null&&at.next!==null;if(ts=0,Xt=at=Le=null,Kf=!1,ru=0,xa=null,u)throw Error(i(300));a===null||It||(a=a.dependencies,a!==null&&If(a)&&(It=!0))}function Mw(a,u,f,m){Le=a;var y=0;do{if(va&&(xa=null),ru=0,va=!1,25<=y)throw Error(i(301));if(y+=1,Xt=at=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}B.H=uT,S=u(f,m)}while(va);return S}function D_(){var a=B.H,u=a.useState()[0];return u=typeof u.then=="function"?su(u):u,a=a.useState()[0],(at!==null?at.memoizedState:null)!==a&&(Le.flags|=1024),u}function s0(){var a=Jf!==0;return Jf=0,a}function l0(a,u,f){u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~f}function o0(a){if(Kf){for(a=a.memoizedState;a!==null;){var u=a.queue;u!==null&&(u.pending=null),a=a.next}Kf=!1}ts=0,Xt=at=Le=null,va=!1,ru=Jf=0,xa=null}function $n(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xt===null?Le.memoizedState=Xt=a:Xt=Xt.next=a,Xt}function Bt(){if(at===null){var a=Le.alternate;a=a!==null?a.memoizedState:null}else a=at.next;var u=Xt===null?Le.memoizedState:Xt.next;if(u!==null)Xt=u,at=a;else{if(a===null)throw Le.alternate===null?Error(i(467)):Error(i(310));at=a,a={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Xt===null?Le.memoizedState=Xt=a:Xt=Xt.next=a}return Xt}function ed(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function su(a){var u=ru;return ru+=1,xa===null&&(xa=[]),a=yw(xa,a,u),u=Le,(Xt===null?u.memoizedState:Xt.next)===null&&(u=u.alternate,B.H=u===null||u.memoizedState===null?cT:b0),a}function td(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return su(a);if(a.$$typeof===A)return cn(a)}throw Error(i(438,String(a)))}function a0(a){var u=null,f=Le.updateQueue;if(f!==null&&(u=f.memoCache),u==null){var m=Le.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(u={data:m.data.map(function(y){return y.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),f===null&&(f=ed(),Le.updateQueue=f),f.memoCache=u,f=u.data[u.index],f===void 0)for(f=u.data[u.index]=Array(a),m=0;m<a;m++)f[m]=te;return u.index++,f}function ns(a,u){return typeof u=="function"?u(a):u}function nd(a){var u=Bt();return c0(u,at,a)}function c0(a,u,f){var m=a.queue;if(m===null)throw Error(i(311));m.lastRenderedReducer=f;var y=a.baseQueue,S=m.pending;if(S!==null){if(y!==null){var w=y.next;y.next=S.next,S.next=w}u.baseQueue=y=S,m.pending=null}if(S=a.baseState,y===null)a.memoizedState=S;else{u=y.next;var T=w=null,R=null,X=u,U=!1;do{var ee=X.lane&-536870913;if(ee!==X.lane?(qe&ee)===ee:(ts&ee)===ee){var I=X.revertLane;if(I===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ee===ga&&(U=!0);else if((ts&I)===I){X=X.next,I===ga&&(U=!0);continue}else ee={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},R===null?(T=R=ee,w=S):R=R.next=ee,Le.lanes|=I,Js|=I;ee=X.action,ro&&f(S,ee),S=X.hasEagerState?X.eagerState:f(S,ee)}else I={lane:ee,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},R===null?(T=R=I,w=S):R=R.next=I,Le.lanes|=ee,Js|=ee;X=X.next}while(X!==null&&X!==u);if(R===null?w=S:R.next=T,!si(S,a.memoizedState)&&(It=!0,U&&(f=Oa,f!==null)))throw f;a.memoizedState=S,a.baseState=w,a.baseQueue=R,m.lastRenderedState=S}return y===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function u0(a){var u=Bt(),f=u.queue;if(f===null)throw Error(i(311));f.lastRenderedReducer=a;var m=f.dispatch,y=f.pending,S=u.memoizedState;if(y!==null){f.pending=null;var w=y=y.next;do S=a(S,w.action),w=w.next;while(w!==y);si(S,u.memoizedState)||(It=!0),u.memoizedState=S,u.baseQueue===null&&(u.baseState=S),f.lastRenderedState=S}return[S,m]}function Qw(a,u,f){var m=Le,y=Bt(),S=Ue;if(S){if(f===void 0)throw Error(i(407));f=f()}else f=u();var w=!si((at||y).memoizedState,f);if(w&&(y.memoizedState=f,It=!0),y=y.queue,d0(Rw.bind(null,m,y,a),[a]),y.getSnapshot!==u||w||Xt!==null&&Xt.memoizedState.tag&1){if(m.flags|=2048,ka(9,{destroy:void 0},$w.bind(null,m,y,f,u),null),ft===null)throw Error(i(349));S||(ts&127)!==0||Ew(m,u,f)}return f}function Ew(a,u,f){a.flags|=16384,a={getSnapshot:u,value:f},u=Le.updateQueue,u===null?(u=ed(),Le.updateQueue=u,u.stores=[a]):(f=u.stores,f===null?u.stores=[a]:f.push(a))}function $w(a,u,f,m){u.value=f,u.getSnapshot=m,Pw(u)&&Dw(a)}function Rw(a,u,f){return f(function(){Pw(u)&&Dw(a)})}function Pw(a){var u=a.getSnapshot;a=a.value;try{var f=u();return!si(a,f)}catch{return!0}}function Dw(a){var u=Wl(a,2);u!==null&&qn(u,a,2)}function h0(a){var u=$n();if(typeof a=="function"){var f=a;if(a=f(),ro){Me(!0);try{f()}finally{Me(!1)}}}return u.memoizedState=u.baseState=a,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:a},u}function Nw(a,u,f,m){return a.baseState=f,c0(a,at,typeof m=="function"?m:ns)}function N_(a,u,f,m,y){if(sd(a))throw Error(i(485));if(a=u.action,a!==null){var S={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){S.listeners.push(w)}};B.T!==null?f(!0):S.isTransition=!1,m(S),f=u.pending,f===null?(S.next=u.pending=S,zw(u,S)):(S.next=f.next,u.pending=f.next=S)}}function zw(a,u){var f=u.action,m=u.payload,y=a.state;if(u.isTransition){var S=B.T,w={};B.T=w;try{var T=f(y,m),R=B.S;R!==null&&R(w,T),Lw(a,u,T)}catch(X){f0(a,u,X)}finally{S!==null&&w.types!==null&&(S.types=w.types),B.T=S}}else try{S=f(y,m),Lw(a,u,S)}catch(X){f0(a,u,X)}}function Lw(a,u,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){_w(a,u,m)},function(m){return f0(a,u,m)}):_w(a,u,f)}function _w(a,u,f){u.status="fulfilled",u.value=f,Bw(u),a.state=f,u=a.pending,u!==null&&(f=u.next,f===u?a.pending=null:(f=f.next,u.next=f,zw(a,f)))}function f0(a,u,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do u.status="rejected",u.reason=f,Bw(u),u=u.next;while(u!==m)}a.action=null}function Bw(a){a=a.listeners;for(var u=0;u<a.length;u++)(0,a[u])()}function Zw(a,u){return u}function jw(a,u){if(Ue){var f=ft.formState;if(f!==null){e:{var m=Le;if(Ue){if(kt){t:{for(var y=kt,S=$i;y.nodeType!==8;){if(!S){y=null;break t}if(y=Pi(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){kt=Pi(y.nextSibling),m=y.data==="F!";break e}}Vs(m)}m=!1}m&&(u=f[0])}}return f=$n(),f.memoizedState=f.baseState=u,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zw,lastRenderedState:u},f.queue=m,f=lT.bind(null,Le,m),m.dispatch=f,m=h0(!1),S=y0.bind(null,Le,!1,m.queue),m=$n(),y={state:u,dispatch:null,action:a,pending:null},m.queue=y,f=N_.bind(null,Le,y,S,f),y.dispatch=f,m.memoizedState=a,[u,f,!1]}function Xw(a){var u=Bt();return Iw(u,at,a)}function Iw(a,u,f){if(u=c0(a,u,Zw)[0],a=nd(ns)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var m=su(u)}catch(w){throw w===ya?Hf:w}else m=u;u=Bt();var y=u.queue,S=y.dispatch;return f!==u.memoizedState&&(Le.flags|=2048,ka(9,{destroy:void 0},z_.bind(null,y,f),null)),[m,S,a]}function z_(a,u){a.action=u}function Vw(a){var u=Bt(),f=at;if(f!==null)return Iw(u,f,a);Bt(),u=u.memoizedState,f=Bt();var m=f.queue.dispatch;return f.memoizedState=a,[u,m,!1]}function ka(a,u,f,m){return a={tag:a,create:f,deps:m,inst:u,next:null},u=Le.updateQueue,u===null&&(u=ed(),Le.updateQueue=u),f=u.lastEffect,f===null?u.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,u.lastEffect=a),a}function qw(){return Bt().memoizedState}function id(a,u,f,m){var y=$n();Le.flags|=a,y.memoizedState=ka(1|u,{destroy:void 0},f,m===void 0?null:m)}function rd(a,u,f,m){var y=Bt();m=m===void 0?null:m;var S=y.memoizedState.inst;at!==null&&m!==null&&i0(m,at.memoizedState.deps)?y.memoizedState=ka(u,S,f,m):(Le.flags|=a,y.memoizedState=ka(1|u,S,f,m))}function Hw(a,u){id(8390656,8,a,u)}function d0(a,u){rd(2048,8,a,u)}function L_(a){Le.flags|=4;var u=Le.updateQueue;if(u===null)u=ed(),Le.updateQueue=u,u.events=[a];else{var f=u.events;f===null?u.events=[a]:f.push(a)}}function Yw(a){var u=Bt().memoizedState;return L_({ref:u,nextImpl:a}),function(){if((Je&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}function Uw(a,u){return rd(4,2,a,u)}function Ww(a,u){return rd(4,4,a,u)}function Gw(a,u){if(typeof u=="function"){a=a();var f=u(a);return function(){typeof f=="function"?f():u(null)}}if(u!=null)return a=a(),u.current=a,function(){u.current=null}}function Fw(a,u,f){f=f!=null?f.concat([a]):null,rd(4,4,Gw.bind(null,u,a),f)}function p0(){}function Kw(a,u){var f=Bt();u=u===void 0?null:u;var m=f.memoizedState;return u!==null&&i0(u,m[1])?m[0]:(f.memoizedState=[a,u],a)}function Jw(a,u){var f=Bt();u=u===void 0?null:u;var m=f.memoizedState;if(u!==null&&i0(u,m[1]))return m[0];if(m=a(),ro){Me(!0);try{a()}finally{Me(!1)}}return f.memoizedState=[m,u],m}function m0(a,u,f){return f===void 0||(ts&1073741824)!==0&&(qe&261930)===0?a.memoizedState=u:(a.memoizedState=f,a=eC(),Le.lanes|=a,Js|=a,f)}function eT(a,u,f,m){return si(f,u)?f:Sa.current!==null?(a=m0(a,f,m),si(a,u)||(It=!0),a):(ts&42)===0||(ts&1073741824)!==0&&(qe&261930)===0?(It=!0,a.memoizedState=f):(a=eC(),Le.lanes|=a,Js|=a,u)}function tT(a,u,f,m,y){var S=K.p;K.p=S!==0&&8>S?S:8;var w=B.T,T={};B.T=T,y0(a,!1,u,f);try{var R=y(),X=B.S;if(X!==null&&X(T,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var U=R_(R,m);lu(a,u,U,hi(a))}else lu(a,u,m,hi(a))}catch(ee){lu(a,u,{then:function(){},status:"rejected",reason:ee},hi())}finally{K.p=S,w!==null&&T.types!==null&&(w.types=T.types),B.T=w}}function __(){}function g0(a,u,f,m){if(a.tag!==5)throw Error(i(476));var y=nT(a).queue;tT(a,y,u,he,f===null?__:function(){return iT(a),f(m)})}function nT(a){var u=a.memoizedState;if(u!==null)return u;u={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:he},next:null};var f={};return u.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:f},next:null},a.memoizedState=u,a=a.alternate,a!==null&&(a.memoizedState=u),u}function iT(a){var u=nT(a);u.next===null&&(u=a.alternate.memoizedState),lu(a,u.next.queue,{},hi())}function O0(){return cn(ku)}function rT(){return Bt().memoizedState}function sT(){return Bt().memoizedState}function B_(a){for(var u=a.return;u!==null;){switch(u.tag){case 24:case 3:var f=hi();a=Ys(f);var m=Us(u,a,f);m!==null&&(qn(m,u,f),tu(m,u,f)),u={cache:HO()},a.payload=u;return}u=u.return}}function Z_(a,u,f){var m=hi();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},sd(a)?oT(u,f):(f=NO(a,u,f,m),f!==null&&(qn(f,a,m),aT(f,u,m)))}function lT(a,u,f){var m=hi();lu(a,u,f,m)}function lu(a,u,f,m){var y={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(sd(a))oT(u,y);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=u.lastRenderedReducer,S!==null))try{var w=u.lastRenderedState,T=S(w,f);if(y.hasEagerState=!0,y.eagerState=T,si(T,w))return Bf(a,u,y,0),ft===null&&_f(),!1}catch{}finally{}if(f=NO(a,u,y,m),f!==null)return qn(f,a,m),aT(f,u,m),!0}return!1}function y0(a,u,f,m){if(m={lane:2,revertLane:G0(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},sd(a)){if(u)throw Error(i(479))}else u=NO(a,f,m,2),u!==null&&qn(u,a,2)}function sd(a){var u=a.alternate;return a===Le||u!==null&&u===Le}function oT(a,u){va=Kf=!0;var f=a.pending;f===null?u.next=u:(u.next=f.next,f.next=u),a.pending=u}function aT(a,u,f){if((f&4194048)!==0){var m=u.lanes;m&=a.pendingLanes,f|=m,u.lanes=f,dk(a,f)}}var ou={readContext:cn,use:td,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};ou.useEffectEvent=$t;var cT={readContext:cn,use:td,useCallback:function(a,u){return $n().memoizedState=[a,u===void 0?null:u],a},useContext:cn,useEffect:Hw,useImperativeHandle:function(a,u,f){f=f!=null?f.concat([a]):null,id(4194308,4,Gw.bind(null,u,a),f)},useLayoutEffect:function(a,u){return id(4194308,4,a,u)},useInsertionEffect:function(a,u){id(4,2,a,u)},useMemo:function(a,u){var f=$n();u=u===void 0?null:u;var m=a();if(ro){Me(!0);try{a()}finally{Me(!1)}}return f.memoizedState=[m,u],m},useReducer:function(a,u,f){var m=$n();if(f!==void 0){var y=f(u);if(ro){Me(!0);try{f(u)}finally{Me(!1)}}}else y=u;return m.memoizedState=m.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},m.queue=a,a=a.dispatch=Z_.bind(null,Le,a),[m.memoizedState,a]},useRef:function(a){var u=$n();return a={current:a},u.memoizedState=a},useState:function(a){a=h0(a);var u=a.queue,f=lT.bind(null,Le,u);return u.dispatch=f,[a.memoizedState,f]},useDebugValue:p0,useDeferredValue:function(a,u){var f=$n();return m0(f,a,u)},useTransition:function(){var a=h0(!1);return a=tT.bind(null,Le,a.queue,!0,!1),$n().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,u,f){var m=Le,y=$n();if(Ue){if(f===void 0)throw Error(i(407));f=f()}else{if(f=u(),ft===null)throw Error(i(349));(qe&127)!==0||Ew(m,u,f)}y.memoizedState=f;var S={value:f,getSnapshot:u};return y.queue=S,Hw(Rw.bind(null,m,S,a),[a]),m.flags|=2048,ka(9,{destroy:void 0},$w.bind(null,m,S,f,u),null),f},useId:function(){var a=$n(),u=ft.identifierPrefix;if(Ue){var f=mr,m=pr;f=(m&~(1<<32-ve(m)-1)).toString(32)+f,u="_"+u+"R_"+f,f=Jf++,0<f&&(u+="H"+f.toString(32)),u+="_"}else f=P_++,u="_"+u+"r_"+f.toString(32)+"_";return a.memoizedState=u},useHostTransitionStatus:O0,useFormState:jw,useActionState:jw,useOptimistic:function(a){var u=$n();u.memoizedState=u.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=f,u=y0.bind(null,Le,!0,f),f.dispatch=u,[a,u]},useMemoCache:a0,useCacheRefresh:function(){return $n().memoizedState=B_.bind(null,Le)},useEffectEvent:function(a){var u=$n(),f={impl:a};return u.memoizedState=f,function(){if((Je&2)!==0)throw Error(i(440));return f.impl.apply(void 0,arguments)}}},b0={readContext:cn,use:td,useCallback:Kw,useContext:cn,useEffect:d0,useImperativeHandle:Fw,useInsertionEffect:Uw,useLayoutEffect:Ww,useMemo:Jw,useReducer:nd,useRef:qw,useState:function(){return nd(ns)},useDebugValue:p0,useDeferredValue:function(a,u){var f=Bt();return eT(f,at.memoizedState,a,u)},useTransition:function(){var a=nd(ns)[0],u=Bt().memoizedState;return[typeof a=="boolean"?a:su(a),u]},useSyncExternalStore:Qw,useId:rT,useHostTransitionStatus:O0,useFormState:Xw,useActionState:Xw,useOptimistic:function(a,u){var f=Bt();return Nw(f,at,a,u)},useMemoCache:a0,useCacheRefresh:sT};b0.useEffectEvent=Yw;var uT={readContext:cn,use:td,useCallback:Kw,useContext:cn,useEffect:d0,useImperativeHandle:Fw,useInsertionEffect:Uw,useLayoutEffect:Ww,useMemo:Jw,useReducer:u0,useRef:qw,useState:function(){return u0(ns)},useDebugValue:p0,useDeferredValue:function(a,u){var f=Bt();return at===null?m0(f,a,u):eT(f,at.memoizedState,a,u)},useTransition:function(){var a=u0(ns)[0],u=Bt().memoizedState;return[typeof a=="boolean"?a:su(a),u]},useSyncExternalStore:Qw,useId:rT,useHostTransitionStatus:O0,useFormState:Vw,useActionState:Vw,useOptimistic:function(a,u){var f=Bt();return at!==null?Nw(f,at,a,u):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:a0,useCacheRefresh:sT};uT.useEffectEvent=Yw;function S0(a,u,f,m){u=a.memoizedState,f=f(m,u),f=f==null?u:p({},u,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var v0={enqueueSetState:function(a,u,f){a=a._reactInternals;var m=hi(),y=Ys(m);y.payload=u,f!=null&&(y.callback=f),u=Us(a,y,m),u!==null&&(qn(u,a,m),tu(u,a,m))},enqueueReplaceState:function(a,u,f){a=a._reactInternals;var m=hi(),y=Ys(m);y.tag=1,y.payload=u,f!=null&&(y.callback=f),u=Us(a,y,m),u!==null&&(qn(u,a,m),tu(u,a,m))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var f=hi(),m=Ys(f);m.tag=2,u!=null&&(m.callback=u),u=Us(a,m,f),u!==null&&(qn(u,a,f),tu(u,a,f))}};function hT(a,u,f,m,y,S,w){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,S,w):u.prototype&&u.prototype.isPureReactComponent?!Yc(f,m)||!Yc(y,S):!0}function fT(a,u,f,m){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(f,m),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(f,m),u.state!==a&&v0.enqueueReplaceState(u,u.state,null)}function so(a,u){var f=u;if("ref"in u){f={};for(var m in u)m!=="ref"&&(f[m]=u[m])}if(a=a.defaultProps){f===u&&(f=p({},f));for(var y in a)f[y]===void 0&&(f[y]=a[y])}return f}function dT(a){Lf(a)}function pT(a){console.error(a)}function mT(a){Lf(a)}function ld(a,u){try{var f=a.onUncaughtError;f(u.value,{componentStack:u.stack})}catch(m){setTimeout(function(){throw m})}}function gT(a,u,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function x0(a,u,f){return f=Ys(f),f.tag=3,f.payload={element:null},f.callback=function(){ld(a,u)},f}function OT(a){return a=Ys(a),a.tag=3,a}function yT(a,u,f,m){var y=f.type.getDerivedStateFromError;if(typeof y=="function"){var S=m.value;a.payload=function(){return y(S)},a.callback=function(){gT(u,f,m)}}var w=f.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){gT(u,f,m),typeof y!="function"&&(el===null?el=new Set([this]):el.add(this));var T=m.stack;this.componentDidCatch(m.value,{componentStack:T!==null?T:""})})}function j_(a,u,f,m,y){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(u=f.alternate,u!==null&&ma(u,f,y,!0),f=oi.current,f!==null){switch(f.tag){case 31:case 13:return Ri===null?yd():f.alternate===null&&Rt===0&&(Rt=3),f.flags&=-257,f.flags|=65536,f.lanes=y,m===Yf?f.flags|=16384:(u=f.updateQueue,u===null?f.updateQueue=new Set([m]):u.add(m),Y0(a,m,y)),!1;case 22:return f.flags|=65536,m===Yf?f.flags|=16384:(u=f.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=u):(f=u.retryQueue,f===null?u.retryQueue=new Set([m]):f.add(m)),Y0(a,m,y)),!1}throw Error(i(435,f.tag))}return Y0(a,m,y),yd(),!1}if(Ue)return u=oi.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=y,m!==jO&&(a=Error(i(422),{cause:m}),Gc(Mi(a,f)))):(m!==jO&&(u=Error(i(423),{cause:m}),Gc(Mi(u,f))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,m=Mi(m,f),y=x0(a.stateNode,m,y),KO(a,y),Rt!==4&&(Rt=2)),!1;var S=Error(i(520),{cause:m});if(S=Mi(S,f),mu===null?mu=[S]:mu.push(S),Rt!==4&&(Rt=2),u===null)return!0;m=Mi(m,f),f=u;do{switch(f.tag){case 3:return f.flags|=65536,a=y&-y,f.lanes|=a,a=x0(f.stateNode,m,a),KO(f,a),!1;case 1:if(u=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(el===null||!el.has(S))))return f.flags|=65536,y&=-y,f.lanes|=y,y=OT(y),yT(y,a,f,m),KO(f,y),!1}f=f.return}while(f!==null);return!1}var k0=Error(i(461)),It=!1;function un(a,u,f,m){u.child=a===null?xw(u,null,f,m):io(u,a.child,f,m)}function bT(a,u,f,m,y){f=f.render;var S=u.ref;if("ref"in m){var w={};for(var T in m)T!=="ref"&&(w[T]=m[T])}else w=m;return Jl(u),m=r0(a,u,f,w,S,y),T=s0(),a!==null&&!It?(l0(a,u,y),is(a,u,y)):(Ue&&T&&BO(u),u.flags|=1,un(a,u,m,y),u.child)}function ST(a,u,f,m,y){if(a===null){var S=f.type;return typeof S=="function"&&!zO(S)&&S.defaultProps===void 0&&f.compare===null?(u.tag=15,u.type=S,vT(a,u,S,m,y)):(a=jf(f.type,null,m,u,u.mode,y),a.ref=u.ref,a.return=u,u.child=a)}if(S=a.child,!$0(a,y)){var w=S.memoizedProps;if(f=f.compare,f=f!==null?f:Yc,f(w,m)&&a.ref===u.ref)return is(a,u,y)}return u.flags|=1,a=Fr(S,m),a.ref=u.ref,a.return=u,u.child=a}function vT(a,u,f,m,y){if(a!==null){var S=a.memoizedProps;if(Yc(S,m)&&a.ref===u.ref)if(It=!1,u.pendingProps=m=S,$0(a,y))(a.flags&131072)!==0&&(It=!0);else return u.lanes=a.lanes,is(a,u,y)}return w0(a,u,f,m,y)}function xT(a,u,f,m){var y=m.children,S=a!==null?a.memoizedState:null;if(a===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((u.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,a!==null){for(m=u.child=a.child,y=0;m!==null;)y=y|m.lanes|m.childLanes,m=m.sibling;m=y&~S}else m=0,u.child=null;return kT(a,u,S,f,m)}if((f&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},a!==null&&qf(u,S!==null?S.cachePool:null),S!==null?Tw(u,S):e0(),Cw(u);else return m=u.lanes=536870912,kT(a,u,S!==null?S.baseLanes|f:f,f,m)}else S!==null?(qf(u,S.cachePool),Tw(u,S),Gs(),u.memoizedState=null):(a!==null&&qf(u,null),e0(),Gs());return un(a,u,y,f),u.child}function au(a,u){return a!==null&&a.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function kT(a,u,f,m,y){var S=UO();return S=S===null?null:{parent:jt._currentValue,pool:S},u.memoizedState={baseLanes:f,cachePool:S},a!==null&&qf(u,null),e0(),Cw(u),a!==null&&ma(a,u,m,!0),u.childLanes=y,null}function od(a,u){return u=cd({mode:u.mode,children:u.children},a.mode),u.ref=a.ref,a.child=u,u.return=a,u}function wT(a,u,f){return io(u,a.child,null,f),a=od(u,u.pendingProps),a.flags|=2,ai(u),u.memoizedState=null,a}function X_(a,u,f){var m=u.pendingProps,y=(u.flags&128)!==0;if(u.flags&=-129,a===null){if(Ue){if(m.mode==="hidden")return a=od(u,m),u.lanes=536870912,au(null,a);if(n0(u),(a=kt)?(a=zC(a,$i),a=a!==null&&a.data==="&"?a:null,a!==null&&(u.memoizedState={dehydrated:a,treeContext:Xs!==null?{id:pr,overflow:mr}:null,retryLane:536870912,hydrationErrors:null},f=ow(a),f.return=u,u.child=f,an=u,kt=null)):a=null,a===null)throw Vs(u);return u.lanes=536870912,null}return od(u,m)}var S=a.memoizedState;if(S!==null){var w=S.dehydrated;if(n0(u),y)if(u.flags&256)u.flags&=-257,u=wT(a,u,f);else if(u.memoizedState!==null)u.child=a.child,u.flags|=128,u=null;else throw Error(i(558));else if(It||ma(a,u,f,!1),y=(f&a.childLanes)!==0,It||y){if(m=ft,m!==null&&(w=pk(m,f),w!==0&&w!==S.retryLane))throw S.retryLane=w,Wl(a,w),qn(m,a,w),k0;yd(),u=wT(a,u,f)}else a=S.treeContext,kt=Pi(w.nextSibling),an=u,Ue=!0,Is=null,$i=!1,a!==null&&uw(u,a),u=od(u,m),u.flags|=4096;return u}return a=Fr(a.child,{mode:m.mode,children:m.children}),a.ref=u.ref,u.child=a,a.return=u,a}function ad(a,u){var f=u.ref;if(f===null)a!==null&&a.ref!==null&&(u.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(i(284));(a===null||a.ref!==f)&&(u.flags|=4194816)}}function w0(a,u,f,m,y){return Jl(u),f=r0(a,u,f,m,void 0,y),m=s0(),a!==null&&!It?(l0(a,u,y),is(a,u,y)):(Ue&&m&&BO(u),u.flags|=1,un(a,u,f,y),u.child)}function TT(a,u,f,m,y,S){return Jl(u),u.updateQueue=null,f=Mw(u,m,f,y),Aw(a),m=s0(),a!==null&&!It?(l0(a,u,S),is(a,u,S)):(Ue&&m&&BO(u),u.flags|=1,un(a,u,f,S),u.child)}function CT(a,u,f,m,y){if(Jl(u),u.stateNode===null){var S=ha,w=f.contextType;typeof w=="object"&&w!==null&&(S=cn(w)),S=new f(m,S),u.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=v0,u.stateNode=S,S._reactInternals=u,S=u.stateNode,S.props=m,S.state=u.memoizedState,S.refs={},GO(u),w=f.contextType,S.context=typeof w=="object"&&w!==null?cn(w):ha,S.state=u.memoizedState,w=f.getDerivedStateFromProps,typeof w=="function"&&(S0(u,f,w,m),S.state=u.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(w=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),w!==S.state&&v0.enqueueReplaceState(S,S.state,null),iu(u,m,S,y),nu(),S.state=u.memoizedState),typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!0}else if(a===null){S=u.stateNode;var T=u.memoizedProps,R=so(f,T);S.props=R;var X=S.context,U=f.contextType;w=ha,typeof U=="object"&&U!==null&&(w=cn(U));var ee=f.getDerivedStateFromProps;U=typeof ee=="function"||typeof S.getSnapshotBeforeUpdate=="function",T=u.pendingProps!==T,U||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(T||X!==w)&&fT(u,S,m,w),Hs=!1;var I=u.memoizedState;S.state=I,iu(u,m,S,y),nu(),X=u.memoizedState,T||I!==X||Hs?(typeof ee=="function"&&(S0(u,f,ee,m),X=u.memoizedState),(R=Hs||hT(u,f,R,m,I,X,w))?(U||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(u.flags|=4194308)):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=m,u.memoizedState=X),S.props=m,S.state=X,S.context=w,m=R):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!1)}else{S=u.stateNode,FO(a,u),w=u.memoizedProps,U=so(f,w),S.props=U,ee=u.pendingProps,I=S.context,X=f.contextType,R=ha,typeof X=="object"&&X!==null&&(R=cn(X)),T=f.getDerivedStateFromProps,(X=typeof T=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(w!==ee||I!==R)&&fT(u,S,m,R),Hs=!1,I=u.memoizedState,S.state=I,iu(u,m,S,y),nu();var V=u.memoizedState;w!==ee||I!==V||Hs||a!==null&&a.dependencies!==null&&If(a.dependencies)?(typeof T=="function"&&(S0(u,f,T,m),V=u.memoizedState),(U=Hs||hT(u,f,U,m,I,V,R)||a!==null&&a.dependencies!==null&&If(a.dependencies))?(X||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,V,R),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,V,R)),typeof S.componentDidUpdate=="function"&&(u.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof S.componentDidUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=1024),u.memoizedProps=m,u.memoizedState=V),S.props=m,S.state=V,S.context=R,m=U):(typeof S.componentDidUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&I===a.memoizedState||(u.flags|=1024),m=!1)}return S=m,ad(a,u),m=(u.flags&128)!==0,S||m?(S=u.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:S.render(),u.flags|=1,a!==null&&m?(u.child=io(u,a.child,null,y),u.child=io(u,null,f,y)):un(a,u,f,y),u.memoizedState=S.state,a=u.child):a=is(a,u,y),a}function AT(a,u,f,m){return Fl(),u.flags|=256,un(a,u,f,m),u.child}var T0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function C0(a){return{baseLanes:a,cachePool:gw()}}function A0(a,u,f){return a=a!==null?a.childLanes&~f:0,u&&(a|=ui),a}function MT(a,u,f){var m=u.pendingProps,y=!1,S=(u.flags&128)!==0,w;if((w=S)||(w=a!==null&&a.memoizedState===null?!1:(_t.current&2)!==0),w&&(y=!0,u.flags&=-129),w=(u.flags&32)!==0,u.flags&=-33,a===null){if(Ue){if(y?Ws(u):Gs(),(a=kt)?(a=zC(a,$i),a=a!==null&&a.data!=="&"?a:null,a!==null&&(u.memoizedState={dehydrated:a,treeContext:Xs!==null?{id:pr,overflow:mr}:null,retryLane:536870912,hydrationErrors:null},f=ow(a),f.return=u,u.child=f,an=u,kt=null)):a=null,a===null)throw Vs(u);return cy(a)?u.lanes=32:u.lanes=536870912,null}var T=m.children;return m=m.fallback,y?(Gs(),y=u.mode,T=cd({mode:"hidden",children:T},y),m=Gl(m,y,f,null),T.return=u,m.return=u,T.sibling=m,u.child=T,m=u.child,m.memoizedState=C0(f),m.childLanes=A0(a,w,f),u.memoizedState=T0,au(null,m)):(Ws(u),M0(u,T))}var R=a.memoizedState;if(R!==null&&(T=R.dehydrated,T!==null)){if(S)u.flags&256?(Ws(u),u.flags&=-257,u=Q0(a,u,f)):u.memoizedState!==null?(Gs(),u.child=a.child,u.flags|=128,u=null):(Gs(),T=m.fallback,y=u.mode,m=cd({mode:"visible",children:m.children},y),T=Gl(T,y,f,null),T.flags|=2,m.return=u,T.return=u,m.sibling=T,u.child=m,io(u,a.child,null,f),m=u.child,m.memoizedState=C0(f),m.childLanes=A0(a,w,f),u.memoizedState=T0,u=au(null,m));else if(Ws(u),cy(T)){if(w=T.nextSibling&&T.nextSibling.dataset,w)var X=w.dgst;w=X,m=Error(i(419)),m.stack="",m.digest=w,Gc({value:m,source:null,stack:null}),u=Q0(a,u,f)}else if(It||ma(a,u,f,!1),w=(f&a.childLanes)!==0,It||w){if(w=ft,w!==null&&(m=pk(w,f),m!==0&&m!==R.retryLane))throw R.retryLane=m,Wl(a,m),qn(w,a,m),k0;ay(T)||yd(),u=Q0(a,u,f)}else ay(T)?(u.flags|=192,u.child=a.child,u=null):(a=R.treeContext,kt=Pi(T.nextSibling),an=u,Ue=!0,Is=null,$i=!1,a!==null&&uw(u,a),u=M0(u,m.children),u.flags|=4096);return u}return y?(Gs(),T=m.fallback,y=u.mode,R=a.child,X=R.sibling,m=Fr(R,{mode:"hidden",children:m.children}),m.subtreeFlags=R.subtreeFlags&65011712,X!==null?T=Fr(X,T):(T=Gl(T,y,f,null),T.flags|=2),T.return=u,m.return=u,m.sibling=T,u.child=m,au(null,m),m=u.child,T=a.child.memoizedState,T===null?T=C0(f):(y=T.cachePool,y!==null?(R=jt._currentValue,y=y.parent!==R?{parent:R,pool:R}:y):y=gw(),T={baseLanes:T.baseLanes|f,cachePool:y}),m.memoizedState=T,m.childLanes=A0(a,w,f),u.memoizedState=T0,au(a.child,m)):(Ws(u),f=a.child,a=f.sibling,f=Fr(f,{mode:"visible",children:m.children}),f.return=u,f.sibling=null,a!==null&&(w=u.deletions,w===null?(u.deletions=[a],u.flags|=16):w.push(a)),u.child=f,u.memoizedState=null,f)}function M0(a,u){return u=cd({mode:"visible",children:u},a.mode),u.return=a,a.child=u}function cd(a,u){return a=li(22,a,null,u),a.lanes=0,a}function Q0(a,u,f){return io(u,a.child,null,f),a=M0(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function QT(a,u,f){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u),VO(a.return,u,f)}function E0(a,u,f,m,y,S){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:y,treeForkCount:S}:(w.isBackwards=u,w.rendering=null,w.renderingStartTime=0,w.last=m,w.tail=f,w.tailMode=y,w.treeForkCount=S)}function ET(a,u,f){var m=u.pendingProps,y=m.revealOrder,S=m.tail;m=m.children;var w=_t.current,T=(w&2)!==0;if(T?(w=w&1|2,u.flags|=128):w&=1,G(_t,w),un(a,u,m,f),m=Ue?Wc:0,!T&&a!==null&&(a.flags&128)!==0)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&QT(a,f,u);else if(a.tag===19)QT(a,f,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(f=u.child,y=null;f!==null;)a=f.alternate,a!==null&&Ff(a)===null&&(y=f),f=f.sibling;f=y,f===null?(y=u.child,u.child=null):(y=f.sibling,f.sibling=null),E0(u,!1,y,f,S,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,y=u.child,u.child=null;y!==null;){if(a=y.alternate,a!==null&&Ff(a)===null){u.child=y;break}a=y.sibling,y.sibling=f,f=y,y=a}E0(u,!0,f,null,S,m);break;case"together":E0(u,!1,null,null,void 0,m);break;default:u.memoizedState=null}return u.child}function is(a,u,f){if(a!==null&&(u.dependencies=a.dependencies),Js|=u.lanes,(f&u.childLanes)===0)if(a!==null){if(ma(a,u,f,!1),(f&u.childLanes)===0)return null}else return null;if(a!==null&&u.child!==a.child)throw Error(i(153));if(u.child!==null){for(a=u.child,f=Fr(a,a.pendingProps),u.child=f,f.return=u;a.sibling!==null;)a=a.sibling,f=f.sibling=Fr(a,a.pendingProps),f.return=u;f.sibling=null}return u.child}function $0(a,u){return(a.lanes&u)!==0?!0:(a=a.dependencies,!!(a!==null&&If(a)))}function I_(a,u,f){switch(u.tag){case 3:xt(u,u.stateNode.containerInfo),qs(u,jt,a.memoizedState.cache),Fl();break;case 27:case 5:dr(u);break;case 4:xt(u,u.stateNode.containerInfo);break;case 10:qs(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,n0(u),null;break;case 13:var m=u.memoizedState;if(m!==null)return m.dehydrated!==null?(Ws(u),u.flags|=128,null):(f&u.child.childLanes)!==0?MT(a,u,f):(Ws(u),a=is(a,u,f),a!==null?a.sibling:null);Ws(u);break;case 19:var y=(a.flags&128)!==0;if(m=(f&u.childLanes)!==0,m||(ma(a,u,f,!1),m=(f&u.childLanes)!==0),y){if(m)return ET(a,u,f);u.flags|=128}if(y=u.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),G(_t,_t.current),m)break;return null;case 22:return u.lanes=0,xT(a,u,f,u.pendingProps);case 24:qs(u,jt,a.memoizedState.cache)}return is(a,u,f)}function $T(a,u,f){if(a!==null)if(a.memoizedProps!==u.pendingProps)It=!0;else{if(!$0(a,f)&&(u.flags&128)===0)return It=!1,I_(a,u,f);It=(a.flags&131072)!==0}else It=!1,Ue&&(u.flags&1048576)!==0&&cw(u,Wc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var m=u.pendingProps;if(a=to(u.elementType),u.type=a,typeof a=="function")zO(a)?(m=so(a,m),u.tag=1,u=CT(null,u,a,m,f)):(u.tag=0,u=w0(null,u,a,m,f));else{if(a!=null){var y=a.$$typeof;if(y===P){u.tag=11,u=bT(null,u,a,m,f);break e}else if(y===$){u.tag=14,u=ST(null,u,a,m,f);break e}}throw u=se(a)||a,Error(i(306,u,""))}}return u;case 0:return w0(a,u,u.type,u.pendingProps,f);case 1:return m=u.type,y=so(m,u.pendingProps),CT(a,u,m,y,f);case 3:e:{if(xt(u,u.stateNode.containerInfo),a===null)throw Error(i(387));m=u.pendingProps;var S=u.memoizedState;y=S.element,FO(a,u),iu(u,m,null,f);var w=u.memoizedState;if(m=w.cache,qs(u,jt,m),m!==S.cache&&qO(u,[jt],f,!0),nu(),m=w.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:w.cache},u.updateQueue.baseState=S,u.memoizedState=S,u.flags&256){u=AT(a,u,m,f);break e}else if(m!==y){y=Mi(Error(i(424)),u),Gc(y),u=AT(a,u,m,f);break e}else{switch(a=u.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(kt=Pi(a.firstChild),an=u,Ue=!0,Is=null,$i=!0,f=xw(u,null,m,f),u.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Fl(),m===y){u=is(a,u,f);break e}un(a,u,m,f)}u=u.child}return u;case 26:return ad(a,u),a===null?(f=XC(u.type,null,u.pendingProps,null))?u.memoizedState=f:Ue||(f=u.type,a=u.pendingProps,m=Td(Re.current).createElement(f),m[on]=u,m[Bn]=a,hn(m,f,a),Jt(m),u.stateNode=m):u.memoizedState=XC(u.type,a.memoizedProps,u.pendingProps,a.memoizedState),null;case 27:return dr(u),a===null&&Ue&&(m=u.stateNode=BC(u.type,u.pendingProps,Re.current),an=u,$i=!0,y=kt,rl(u.type)?(uy=y,kt=Pi(m.firstChild)):kt=y),un(a,u,u.pendingProps.children,f),ad(a,u),a===null&&(u.flags|=4194304),u.child;case 5:return a===null&&Ue&&((y=m=kt)&&(m=bB(m,u.type,u.pendingProps,$i),m!==null?(u.stateNode=m,an=u,kt=Pi(m.firstChild),$i=!1,y=!0):y=!1),y||Vs(u)),dr(u),y=u.type,S=u.pendingProps,w=a!==null?a.memoizedProps:null,m=S.children,sy(y,S)?m=null:w!==null&&sy(y,w)&&(u.flags|=32),u.memoizedState!==null&&(y=r0(a,u,D_,null,null,f),ku._currentValue=y),ad(a,u),un(a,u,m,f),u.child;case 6:return a===null&&Ue&&((a=f=kt)&&(f=SB(f,u.pendingProps,$i),f!==null?(u.stateNode=f,an=u,kt=null,a=!0):a=!1),a||Vs(u)),null;case 13:return MT(a,u,f);case 4:return xt(u,u.stateNode.containerInfo),m=u.pendingProps,a===null?u.child=io(u,null,m,f):un(a,u,m,f),u.child;case 11:return bT(a,u,u.type,u.pendingProps,f);case 7:return un(a,u,u.pendingProps,f),u.child;case 8:return un(a,u,u.pendingProps.children,f),u.child;case 12:return un(a,u,u.pendingProps.children,f),u.child;case 10:return m=u.pendingProps,qs(u,u.type,m.value),un(a,u,m.children,f),u.child;case 9:return y=u.type._context,m=u.pendingProps.children,Jl(u),y=cn(y),m=m(y),u.flags|=1,un(a,u,m,f),u.child;case 14:return ST(a,u,u.type,u.pendingProps,f);case 15:return vT(a,u,u.type,u.pendingProps,f);case 19:return ET(a,u,f);case 31:return X_(a,u,f);case 22:return xT(a,u,f,u.pendingProps);case 24:return Jl(u),m=cn(jt),a===null?(y=UO(),y===null&&(y=ft,S=HO(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=f),y=S),u.memoizedState={parent:m,cache:y},GO(u),qs(u,jt,y)):((a.lanes&f)!==0&&(FO(a,u),iu(u,null,null,f),nu()),y=a.memoizedState,S=u.memoizedState,y.parent!==m?(y={parent:m,cache:m},u.memoizedState=y,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=y),qs(u,jt,m)):(m=S.cache,qs(u,jt,m),m!==y.cache&&qO(u,[jt],f,!0))),un(a,u,u.pendingProps.children,f),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function rs(a){a.flags|=4}function R0(a,u,f,m,y){if((u=(a.mode&32)!==0)&&(u=!1),u){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(rC())a.flags|=8192;else throw no=Yf,WO}else a.flags&=-16777217}function RT(a,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!YC(u))if(rC())a.flags|=8192;else throw no=Yf,WO}function ud(a,u){u!==null&&(a.flags|=4),a.flags&16384&&(u=a.tag!==22?hk():536870912,a.lanes|=u,Aa|=u)}function cu(a,u){if(!Ue)switch(a.tailMode){case"hidden":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function wt(a){var u=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(u)for(var y=a.child;y!==null;)f|=y.lanes|y.childLanes,m|=y.subtreeFlags&65011712,m|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)f|=y.lanes|y.childLanes,m|=y.subtreeFlags,m|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=m,a.childLanes=f,u}function V_(a,u,f){var m=u.pendingProps;switch(ZO(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(u),null;case 1:return wt(u),null;case 3:return f=u.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),es(jt),ot(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(pa(u)?rs(u):a===null||a.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,XO())),wt(u),null;case 26:var y=u.type,S=u.memoizedState;return a===null?(rs(u),S!==null?(wt(u),RT(u,S)):(wt(u),R0(u,y,null,m,f))):S?S!==a.memoizedState?(rs(u),wt(u),RT(u,S)):(wt(u),u.flags&=-16777217):(a=a.memoizedProps,a!==m&&rs(u),wt(u),R0(u,y,a,m,f)),null;case 27:if(Vr(u),f=Re.current,y=u.type,a!==null&&u.stateNode!=null)a.memoizedProps!==m&&rs(u);else{if(!m){if(u.stateNode===null)throw Error(i(166));return wt(u),null}a=oe.current,pa(u)?hw(u):(a=BC(y,m,f),u.stateNode=a,rs(u))}return wt(u),null;case 5:if(Vr(u),y=u.type,a!==null&&u.stateNode!=null)a.memoizedProps!==m&&rs(u);else{if(!m){if(u.stateNode===null)throw Error(i(166));return wt(u),null}if(S=oe.current,pa(u))hw(u);else{var w=Td(Re.current);switch(S){case 1:S=w.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=w.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=w.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=w.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=w.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof m.is=="string"?w.createElement("select",{is:m.is}):w.createElement("select"),m.multiple?S.multiple=!0:m.size&&(S.size=m.size);break;default:S=typeof m.is=="string"?w.createElement(y,{is:m.is}):w.createElement(y)}}S[on]=u,S[Bn]=m;e:for(w=u.child;w!==null;){if(w.tag===5||w.tag===6)S.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===u)break e;for(;w.sibling===null;){if(w.return===null||w.return===u)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}u.stateNode=S;e:switch(hn(S,y,m),y){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&rs(u)}}return wt(u),R0(u,u.type,a===null?null:a.memoizedProps,u.pendingProps,f),null;case 6:if(a&&u.stateNode!=null)a.memoizedProps!==m&&rs(u);else{if(typeof m!="string"&&u.stateNode===null)throw Error(i(166));if(a=Re.current,pa(u)){if(a=u.stateNode,f=u.memoizedProps,m=null,y=an,y!==null)switch(y.tag){case 27:case 5:m=y.memoizedProps}a[on]=u,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||MC(a.nodeValue,f)),a||Vs(u,!0)}else a=Td(a).createTextNode(m),a[on]=u,u.stateNode=a}return wt(u),null;case 31:if(f=u.memoizedState,a===null||a.memoizedState!==null){if(m=pa(u),f!==null){if(a===null){if(!m)throw Error(i(318));if(a=u.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(i(557));a[on]=u}else Fl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;wt(u),a=!1}else f=XO(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return u.flags&256?(ai(u),u):(ai(u),null);if((u.flags&128)!==0)throw Error(i(558))}return wt(u),null;case 13:if(m=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=pa(u),m!==null&&m.dehydrated!==null){if(a===null){if(!y)throw Error(i(318));if(y=u.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(i(317));y[on]=u}else Fl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;wt(u),y=!1}else y=XO(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return u.flags&256?(ai(u),u):(ai(u),null)}return ai(u),(u.flags&128)!==0?(u.lanes=f,u):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=u.child,y=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(y=m.alternate.memoizedState.cachePool.pool),S=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(S=m.memoizedState.cachePool.pool),S!==y&&(m.flags|=2048)),f!==a&&f&&(u.child.flags|=8192),ud(u,u.updateQueue),wt(u),null);case 4:return ot(),a===null&&ey(u.stateNode.containerInfo),wt(u),null;case 10:return es(u.type),wt(u),null;case 19:if(Z(_t),m=u.memoizedState,m===null)return wt(u),null;if(y=(u.flags&128)!==0,S=m.rendering,S===null)if(y)cu(m,!1);else{if(Rt!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(S=Ff(a),S!==null){for(u.flags|=128,cu(m,!1),a=S.updateQueue,u.updateQueue=a,ud(u,a),u.subtreeFlags=0,a=f,f=u.child;f!==null;)lw(f,a),f=f.sibling;return G(_t,_t.current&1|2),Ue&&Kr(u,m.treeForkCount),u.child}a=a.sibling}m.tail!==null&&En()>md&&(u.flags|=128,y=!0,cu(m,!1),u.lanes=4194304)}else{if(!y)if(a=Ff(S),a!==null){if(u.flags|=128,y=!0,a=a.updateQueue,u.updateQueue=a,ud(u,a),cu(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!Ue)return wt(u),null}else 2*En()-m.renderingStartTime>md&&f!==536870912&&(u.flags|=128,y=!0,cu(m,!1),u.lanes=4194304);m.isBackwards?(S.sibling=u.child,u.child=S):(a=m.last,a!==null?a.sibling=S:u.child=S,m.last=S)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=En(),a.sibling=null,f=_t.current,G(_t,y?f&1|2:f&1),Ue&&Kr(u,m.treeForkCount),a):(wt(u),null);case 22:case 23:return ai(u),t0(),m=u.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(u.flags|=8192):m&&(u.flags|=8192),m?(f&536870912)!==0&&(u.flags&128)===0&&(wt(u),u.subtreeFlags&6&&(u.flags|=8192)):wt(u),f=u.updateQueue,f!==null&&ud(u,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==f&&(u.flags|=2048),a!==null&&Z(eo),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),u.memoizedState.cache!==f&&(u.flags|=2048),es(jt),wt(u),null;case 25:return null;case 30:return null}throw Error(i(156,u.tag))}function q_(a,u){switch(ZO(u),u.tag){case 1:return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return es(jt),ot(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 26:case 27:case 5:return Vr(u),null;case 31:if(u.memoizedState!==null){if(ai(u),u.alternate===null)throw Error(i(340));Fl()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 13:if(ai(u),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(i(340));Fl()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return Z(_t),null;case 4:return ot(),null;case 10:return es(u.type),null;case 22:case 23:return ai(u),t0(),a!==null&&Z(eo),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 24:return es(jt),null;case 25:return null;default:return null}}function PT(a,u){switch(ZO(u),u.tag){case 3:es(jt),ot();break;case 26:case 27:case 5:Vr(u);break;case 4:ot();break;case 31:u.memoizedState!==null&&ai(u);break;case 13:ai(u);break;case 19:Z(_t);break;case 10:es(u.type);break;case 22:case 23:ai(u),t0(),a!==null&&Z(eo);break;case 24:es(jt)}}function uu(a,u){try{var f=u.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var y=m.next;f=y;do{if((f.tag&a)===a){m=void 0;var S=f.create,w=f.inst;m=S(),w.destroy=m}f=f.next}while(f!==y)}}catch(T){st(u,u.return,T)}}function Fs(a,u,f){try{var m=u.updateQueue,y=m!==null?m.lastEffect:null;if(y!==null){var S=y.next;m=S;do{if((m.tag&a)===a){var w=m.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,y=u;var R=f,X=T;try{X()}catch(U){st(y,R,U)}}}m=m.next}while(m!==S)}}catch(U){st(u,u.return,U)}}function DT(a){var u=a.updateQueue;if(u!==null){var f=a.stateNode;try{ww(u,f)}catch(m){st(a,a.return,m)}}}function NT(a,u,f){f.props=so(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){st(a,u,m)}}function hu(a,u){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(y){st(a,u,y)}}function gr(a,u){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(y){st(a,u,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(y){st(a,u,y)}else f.current=null}function zT(a){var u=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(y){st(a,a.return,y)}}function P0(a,u,f){try{var m=a.stateNode;dB(m,a.type,f,u),m[Bn]=u}catch(y){st(a,a.return,y)}}function LT(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&rl(a.type)||a.tag===4}function D0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||LT(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&rl(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function N0(a,u,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,u?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,u):(u=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,u.appendChild(a),f=f._reactRootContainer,f!=null||u.onclick!==null||(u.onclick=Wr));else if(m!==4&&(m===27&&rl(a.type)&&(f=a.stateNode,u=null),a=a.child,a!==null))for(N0(a,u,f),a=a.sibling;a!==null;)N0(a,u,f),a=a.sibling}function hd(a,u,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,u?f.insertBefore(a,u):f.appendChild(a);else if(m!==4&&(m===27&&rl(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(hd(a,u,f),a=a.sibling;a!==null;)hd(a,u,f),a=a.sibling}function _T(a){var u=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,y=u.attributes;y.length;)u.removeAttributeNode(y[0]);hn(u,m,f),u[on]=a,u[Bn]=f}catch(S){st(a,a.return,S)}}var ss=!1,Vt=!1,z0=!1,BT=typeof WeakSet=="function"?WeakSet:Set,en=null;function H_(a,u){if(a=a.containerInfo,iy=Rd,a=Fk(a),QO(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var y=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var w=0,T=-1,R=-1,X=0,U=0,ee=a,I=null;t:for(;;){for(var V;ee!==f||y!==0&&ee.nodeType!==3||(T=w+y),ee!==S||m!==0&&ee.nodeType!==3||(R=w+m),ee.nodeType===3&&(w+=ee.nodeValue.length),(V=ee.firstChild)!==null;)I=ee,ee=V;for(;;){if(ee===a)break t;if(I===f&&++X===y&&(T=w),I===S&&++U===m&&(R=w),(V=ee.nextSibling)!==null)break;ee=I,I=ee.parentNode}ee=V}f=T===-1||R===-1?null:{start:T,end:R}}else f=null}f=f||{start:0,end:0}}else f=null;for(ry={focusedElem:a,selectionRange:f},Rd=!1,en=u;en!==null;)if(u=en,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,en=a;else for(;en!==null;){switch(u=en,S=u.alternate,a=u.flags,u.tag){case 0:if((a&4)!==0&&(a=u.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)y=a[f],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,f=u,y=S.memoizedProps,S=S.memoizedState,m=f.stateNode;try{var be=so(f.type,y);a=m.getSnapshotBeforeUpdate(be,S),m.__reactInternalSnapshotBeforeUpdate=a}catch(Qe){st(f,f.return,Qe)}}break;case 3:if((a&1024)!==0){if(a=u.stateNode.containerInfo,f=a.nodeType,f===9)oy(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":oy(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(i(163))}if(a=u.sibling,a!==null){a.return=u.return,en=a;break}en=u.return}}function ZT(a,u,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:as(a,f),m&4&&uu(5,f);break;case 1:if(as(a,f),m&4)if(a=f.stateNode,u===null)try{a.componentDidMount()}catch(w){st(f,f.return,w)}else{var y=so(f.type,u.memoizedProps);u=u.memoizedState;try{a.componentDidUpdate(y,u,a.__reactInternalSnapshotBeforeUpdate)}catch(w){st(f,f.return,w)}}m&64&&DT(f),m&512&&hu(f,f.return);break;case 3:if(as(a,f),m&64&&(a=f.updateQueue,a!==null)){if(u=null,f.child!==null)switch(f.child.tag){case 27:case 5:u=f.child.stateNode;break;case 1:u=f.child.stateNode}try{ww(a,u)}catch(w){st(f,f.return,w)}}break;case 27:u===null&&m&4&&_T(f);case 26:case 5:as(a,f),u===null&&m&4&&zT(f),m&512&&hu(f,f.return);break;case 12:as(a,f);break;case 31:as(a,f),m&4&&IT(a,f);break;case 13:as(a,f),m&4&&VT(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=tB.bind(null,f),vB(a,f))));break;case 22:if(m=f.memoizedState!==null||ss,!m){u=u!==null&&u.memoizedState!==null||Vt,y=ss;var S=Vt;ss=m,(Vt=u)&&!S?cs(a,f,(f.subtreeFlags&8772)!==0):as(a,f),ss=y,Vt=S}break;case 30:break;default:as(a,f)}}function jT(a){var u=a.alternate;u!==null&&(a.alternate=null,jT(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&fO(u)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Mt=null,jn=!1;function ls(a,u,f){for(f=f.child;f!==null;)XT(a,u,f),f=f.sibling}function XT(a,u,f){if(ie&&typeof ie.onCommitFiberUnmount=="function")try{ie.onCommitFiberUnmount(q,f)}catch{}switch(f.tag){case 26:Vt||gr(f,u),ls(a,u,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:Vt||gr(f,u);var m=Mt,y=jn;rl(f.type)&&(Mt=f.stateNode,jn=!1),ls(a,u,f),Su(f.stateNode),Mt=m,jn=y;break;case 5:Vt||gr(f,u);case 6:if(m=Mt,y=jn,Mt=null,ls(a,u,f),Mt=m,jn=y,Mt!==null)if(jn)try{(Mt.nodeType===9?Mt.body:Mt.nodeName==="HTML"?Mt.ownerDocument.body:Mt).removeChild(f.stateNode)}catch(S){st(f,u,S)}else try{Mt.removeChild(f.stateNode)}catch(S){st(f,u,S)}break;case 18:Mt!==null&&(jn?(a=Mt,DC(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),Na(a)):DC(Mt,f.stateNode));break;case 4:m=Mt,y=jn,Mt=f.stateNode.containerInfo,jn=!0,ls(a,u,f),Mt=m,jn=y;break;case 0:case 11:case 14:case 15:Fs(2,f,u),Vt||Fs(4,f,u),ls(a,u,f);break;case 1:Vt||(gr(f,u),m=f.stateNode,typeof m.componentWillUnmount=="function"&&NT(f,u,m)),ls(a,u,f);break;case 21:ls(a,u,f);break;case 22:Vt=(m=Vt)||f.memoizedState!==null,ls(a,u,f),Vt=m;break;default:ls(a,u,f)}}function IT(a,u){if(u.memoizedState===null&&(a=u.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Na(a)}catch(f){st(u,u.return,f)}}}function VT(a,u){if(u.memoizedState===null&&(a=u.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Na(a)}catch(f){st(u,u.return,f)}}function Y_(a){switch(a.tag){case 31:case 13:case 19:var u=a.stateNode;return u===null&&(u=a.stateNode=new BT),u;case 22:return a=a.stateNode,u=a._retryCache,u===null&&(u=a._retryCache=new BT),u;default:throw Error(i(435,a.tag))}}function fd(a,u){var f=Y_(a);u.forEach(function(m){if(!f.has(m)){f.add(m);var y=nB.bind(null,a,m);m.then(y,y)}})}function Xn(a,u){var f=u.deletions;if(f!==null)for(var m=0;m<f.length;m++){var y=f[m],S=a,w=u,T=w;e:for(;T!==null;){switch(T.tag){case 27:if(rl(T.type)){Mt=T.stateNode,jn=!1;break e}break;case 5:Mt=T.stateNode,jn=!1;break e;case 3:case 4:Mt=T.stateNode.containerInfo,jn=!0;break e}T=T.return}if(Mt===null)throw Error(i(160));XT(S,w,y),Mt=null,jn=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)qT(u,a),u=u.sibling}var Ki=null;function qT(a,u){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Xn(u,a),In(a),m&4&&(Fs(3,a,a.return),uu(3,a),Fs(5,a,a.return));break;case 1:Xn(u,a),In(a),m&512&&(Vt||f===null||gr(f,f.return)),m&64&&ss&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var y=Ki;if(Xn(u,a),In(a),m&512&&(Vt||f===null||gr(f,f.return)),m&4){var S=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,y=y.ownerDocument||y;t:switch(m){case"title":S=y.getElementsByTagName("title")[0],(!S||S[_c]||S[on]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(m),y.head.insertBefore(S,y.querySelector("head > title"))),hn(S,m,f),S[on]=a,Jt(S),m=S;break e;case"link":var w=qC("link","href",y).get(m+(f.href||""));if(w){for(var T=0;T<w.length;T++)if(S=w[T],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){w.splice(T,1);break t}}S=y.createElement(m),hn(S,m,f),y.head.appendChild(S);break;case"meta":if(w=qC("meta","content",y).get(m+(f.content||""))){for(T=0;T<w.length;T++)if(S=w[T],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){w.splice(T,1);break t}}S=y.createElement(m),hn(S,m,f),y.head.appendChild(S);break;default:throw Error(i(468,m))}S[on]=a,Jt(S),m=S}a.stateNode=m}else HC(y,a.type,a.stateNode);else a.stateNode=VC(y,m,a.memoizedProps);else S!==m?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,m===null?HC(y,a.type,a.stateNode):VC(y,m,a.memoizedProps)):m===null&&a.stateNode!==null&&P0(a,a.memoizedProps,f.memoizedProps)}break;case 27:Xn(u,a),In(a),m&512&&(Vt||f===null||gr(f,f.return)),f!==null&&m&4&&P0(a,a.memoizedProps,f.memoizedProps);break;case 5:if(Xn(u,a),In(a),m&512&&(Vt||f===null||gr(f,f.return)),a.flags&32){y=a.stateNode;try{ra(y,"")}catch(be){st(a,a.return,be)}}m&4&&a.stateNode!=null&&(y=a.memoizedProps,P0(a,y,f!==null?f.memoizedProps:y)),m&1024&&(z0=!0);break;case 6:if(Xn(u,a),In(a),m&4){if(a.stateNode===null)throw Error(i(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(be){st(a,a.return,be)}}break;case 3:if(Md=null,y=Ki,Ki=Cd(u.containerInfo),Xn(u,a),Ki=y,In(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{Na(u.containerInfo)}catch(be){st(a,a.return,be)}z0&&(z0=!1,HT(a));break;case 4:m=Ki,Ki=Cd(a.stateNode.containerInfo),Xn(u,a),In(a),Ki=m;break;case 12:Xn(u,a),In(a);break;case 31:Xn(u,a),In(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,fd(a,m)));break;case 13:Xn(u,a),In(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(pd=En()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,fd(a,m)));break;case 22:y=a.memoizedState!==null;var R=f!==null&&f.memoizedState!==null,X=ss,U=Vt;if(ss=X||y,Vt=U||R,Xn(u,a),Vt=U,ss=X,In(a),m&8192)e:for(u=a.stateNode,u._visibility=y?u._visibility&-2:u._visibility|1,y&&(f===null||R||ss||Vt||lo(a)),f=null,u=a;;){if(u.tag===5||u.tag===26){if(f===null){R=f=u;try{if(S=R.stateNode,y)w=S.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{T=R.stateNode;var ee=R.memoizedProps.style,I=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;T.style.display=I==null||typeof I=="boolean"?"":(""+I).trim()}}catch(be){st(R,R.return,be)}}}else if(u.tag===6){if(f===null){R=u;try{R.stateNode.nodeValue=y?"":R.memoizedProps}catch(be){st(R,R.return,be)}}}else if(u.tag===18){if(f===null){R=u;try{var V=R.stateNode;y?NC(V,!0):NC(R.stateNode,!1)}catch(be){st(R,R.return,be)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===a)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break e;for(;u.sibling===null;){if(u.return===null||u.return===a)break e;f===u&&(f=null),u=u.return}f===u&&(f=null),u.sibling.return=u.return,u=u.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,fd(a,f))));break;case 19:Xn(u,a),In(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,fd(a,m)));break;case 30:break;case 21:break;default:Xn(u,a),In(a)}}function In(a){var u=a.flags;if(u&2){try{for(var f,m=a.return;m!==null;){if(LT(m)){f=m;break}m=m.return}if(f==null)throw Error(i(160));switch(f.tag){case 27:var y=f.stateNode,S=D0(a);hd(a,S,y);break;case 5:var w=f.stateNode;f.flags&32&&(ra(w,""),f.flags&=-33);var T=D0(a);hd(a,T,w);break;case 3:case 4:var R=f.stateNode.containerInfo,X=D0(a);N0(a,X,R);break;default:throw Error(i(161))}}catch(U){st(a,a.return,U)}a.flags&=-3}u&4096&&(a.flags&=-4097)}function HT(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var u=a;HT(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),a=a.sibling}}function as(a,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)ZT(a,u.alternate,u),u=u.sibling}function lo(a){for(a=a.child;a!==null;){var u=a;switch(u.tag){case 0:case 11:case 14:case 15:Fs(4,u,u.return),lo(u);break;case 1:gr(u,u.return);var f=u.stateNode;typeof f.componentWillUnmount=="function"&&NT(u,u.return,f),lo(u);break;case 27:Su(u.stateNode);case 26:case 5:gr(u,u.return),lo(u);break;case 22:u.memoizedState===null&&lo(u);break;case 30:lo(u);break;default:lo(u)}a=a.sibling}}function cs(a,u,f){for(f=f&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var m=u.alternate,y=a,S=u,w=S.flags;switch(S.tag){case 0:case 11:case 15:cs(y,S,f),uu(4,S);break;case 1:if(cs(y,S,f),m=S,y=m.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(X){st(m,m.return,X)}if(m=S,y=m.updateQueue,y!==null){var T=m.stateNode;try{var R=y.shared.hiddenCallbacks;if(R!==null)for(y.shared.hiddenCallbacks=null,y=0;y<R.length;y++)kw(R[y],T)}catch(X){st(m,m.return,X)}}f&&w&64&&DT(S),hu(S,S.return);break;case 27:_T(S);case 26:case 5:cs(y,S,f),f&&m===null&&w&4&&zT(S),hu(S,S.return);break;case 12:cs(y,S,f);break;case 31:cs(y,S,f),f&&w&4&&IT(y,S);break;case 13:cs(y,S,f),f&&w&4&&VT(y,S);break;case 22:S.memoizedState===null&&cs(y,S,f),hu(S,S.return);break;case 30:break;default:cs(y,S,f)}u=u.sibling}}function L0(a,u){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(a=u.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Fc(f))}function _0(a,u){a=null,u.alternate!==null&&(a=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==a&&(u.refCount++,a!=null&&Fc(a))}function Ji(a,u,f,m){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)YT(a,u,f,m),u=u.sibling}function YT(a,u,f,m){var y=u.flags;switch(u.tag){case 0:case 11:case 15:Ji(a,u,f,m),y&2048&&uu(9,u);break;case 1:Ji(a,u,f,m);break;case 3:Ji(a,u,f,m),y&2048&&(a=null,u.alternate!==null&&(a=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==a&&(u.refCount++,a!=null&&Fc(a)));break;case 12:if(y&2048){Ji(a,u,f,m),a=u.stateNode;try{var S=u.memoizedProps,w=S.id,T=S.onPostCommit;typeof T=="function"&&T(w,u.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(R){st(u,u.return,R)}}else Ji(a,u,f,m);break;case 31:Ji(a,u,f,m);break;case 13:Ji(a,u,f,m);break;case 23:break;case 22:S=u.stateNode,w=u.alternate,u.memoizedState!==null?S._visibility&2?Ji(a,u,f,m):fu(a,u):S._visibility&2?Ji(a,u,f,m):(S._visibility|=2,wa(a,u,f,m,(u.subtreeFlags&10256)!==0||!1)),y&2048&&L0(w,u);break;case 24:Ji(a,u,f,m),y&2048&&_0(u.alternate,u);break;default:Ji(a,u,f,m)}}function wa(a,u,f,m,y){for(y=y&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var S=a,w=u,T=f,R=m,X=w.flags;switch(w.tag){case 0:case 11:case 15:wa(S,w,T,R,y),uu(8,w);break;case 23:break;case 22:var U=w.stateNode;w.memoizedState!==null?U._visibility&2?wa(S,w,T,R,y):fu(S,w):(U._visibility|=2,wa(S,w,T,R,y)),y&&X&2048&&L0(w.alternate,w);break;case 24:wa(S,w,T,R,y),y&&X&2048&&_0(w.alternate,w);break;default:wa(S,w,T,R,y)}u=u.sibling}}function fu(a,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var f=a,m=u,y=m.flags;switch(m.tag){case 22:fu(f,m),y&2048&&L0(m.alternate,m);break;case 24:fu(f,m),y&2048&&_0(m.alternate,m);break;default:fu(f,m)}u=u.sibling}}var du=8192;function Ta(a,u,f){if(a.subtreeFlags&du)for(a=a.child;a!==null;)UT(a,u,f),a=a.sibling}function UT(a,u,f){switch(a.tag){case 26:Ta(a,u,f),a.flags&du&&a.memoizedState!==null&&PB(f,Ki,a.memoizedState,a.memoizedProps);break;case 5:Ta(a,u,f);break;case 3:case 4:var m=Ki;Ki=Cd(a.stateNode.containerInfo),Ta(a,u,f),Ki=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=du,du=16777216,Ta(a,u,f),du=m):Ta(a,u,f));break;default:Ta(a,u,f)}}function WT(a){var u=a.alternate;if(u!==null&&(a=u.child,a!==null)){u.child=null;do u=a.sibling,a.sibling=null,a=u;while(a!==null)}}function pu(a){var u=a.deletions;if((a.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var m=u[f];en=m,FT(m,a)}WT(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)GT(a),a=a.sibling}function GT(a){switch(a.tag){case 0:case 11:case 15:pu(a),a.flags&2048&&Fs(9,a,a.return);break;case 3:pu(a);break;case 12:pu(a);break;case 22:var u=a.stateNode;a.memoizedState!==null&&u._visibility&2&&(a.return===null||a.return.tag!==13)?(u._visibility&=-3,dd(a)):pu(a);break;default:pu(a)}}function dd(a){var u=a.deletions;if((a.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var m=u[f];en=m,FT(m,a)}WT(a)}for(a=a.child;a!==null;){switch(u=a,u.tag){case 0:case 11:case 15:Fs(8,u,u.return),dd(u);break;case 22:f=u.stateNode,f._visibility&2&&(f._visibility&=-3,dd(u));break;default:dd(u)}a=a.sibling}}function FT(a,u){for(;en!==null;){var f=en;switch(f.tag){case 0:case 11:case 15:Fs(8,f,u);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Fc(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,en=m;else e:for(f=a;en!==null;){m=en;var y=m.sibling,S=m.return;if(jT(m),m===f){en=null;break e}if(y!==null){y.return=S,en=y;break e}en=S}}}var U_={getCacheForType:function(a){var u=cn(jt),f=u.data.get(a);return f===void 0&&(f=a(),u.data.set(a,f)),f},cacheSignal:function(){return cn(jt).controller.signal}},W_=typeof WeakMap=="function"?WeakMap:Map,Je=0,ft=null,Xe=null,qe=0,rt=0,ci=null,Ks=!1,Ca=!1,B0=!1,us=0,Rt=0,Js=0,oo=0,Z0=0,ui=0,Aa=0,mu=null,Vn=null,j0=!1,pd=0,KT=0,md=1/0,gd=null,el=null,Gt=0,tl=null,Ma=null,hs=0,X0=0,I0=null,JT=null,gu=0,V0=null;function hi(){return(Je&2)!==0&&qe!==0?qe&-qe:B.T!==null?G0():mk()}function eC(){if(ui===0)if((qe&536870912)===0||Ue){var a=Yr;Yr<<=1,(Yr&3932160)===0&&(Yr=262144),ui=a}else ui=536870912;return a=oi.current,a!==null&&(a.flags|=32),ui}function qn(a,u,f){(a===ft&&(rt===2||rt===9)||a.cancelPendingCommit!==null)&&(Qa(a,0),nl(a,qe,ui,!1)),Lc(a,f),((Je&2)===0||a!==ft)&&(a===ft&&((Je&2)===0&&(oo|=f),Rt===4&&nl(a,qe,ui,!1)),Or(a))}function tC(a,u,f){if((Je&6)!==0)throw Error(i(327));var m=!f&&(u&127)===0&&(u&a.expiredLanes)===0||zc(a,u),y=m?K_(a,u):H0(a,u,!0),S=m;do{if(y===0){Ca&&!m&&nl(a,u,0,!1);break}else{if(f=a.current.alternate,S&&!G_(f)){y=H0(a,u,!1),S=!1;continue}if(y===2){if(S=u,a.errorRecoveryDisabledLanes&S)var w=0;else w=a.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){u=w;e:{var T=a;y=mu;var R=T.current.memoizedState.isDehydrated;if(R&&(Qa(T,w).flags|=256),w=H0(T,w,!1),w!==2){if(B0&&!R){T.errorRecoveryDisabledLanes|=S,oo|=S,y=4;break e}S=Vn,Vn=y,S!==null&&(Vn===null?Vn=S:Vn.push.apply(Vn,S))}y=w}if(S=!1,y!==2)continue}}if(y===1){Qa(a,0),nl(a,u,0,!0);break}e:{switch(m=a,S=y,S){case 0:case 1:throw Error(i(345));case 4:if((u&4194048)!==u)break;case 6:nl(m,u,ui,!Ks);break e;case 2:Vn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((u&62914560)===u&&(y=pd+300-En(),10<y)){if(nl(m,u,ui,!Ks),Fo(m,0,!0)!==0)break e;hs=u,m.timeoutHandle=RC(nC.bind(null,m,f,Vn,gd,j0,u,ui,oo,Aa,Ks,S,"Throttled",-0,0),y);break e}nC(m,f,Vn,gd,j0,u,ui,oo,Aa,Ks,S,null,-0,0)}}break}while(!0);Or(a)}function nC(a,u,f,m,y,S,w,T,R,X,U,ee,I,V){if(a.timeoutHandle=-1,ee=u.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wr},UT(u,S,ee);var be=(S&62914560)===S?pd-En():(S&4194048)===S?KT-En():0;if(be=DB(ee,be),be!==null){hs=S,a.cancelPendingCommit=be(uC.bind(null,a,u,S,f,m,y,w,T,R,U,ee,null,I,V)),nl(a,S,w,!X);return}}uC(a,u,S,f,m,y,w,T,R)}function G_(a){for(var u=a;;){var f=u.tag;if((f===0||f===11||f===15)&&u.flags&16384&&(f=u.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var y=f[m],S=y.getSnapshot;y=y.value;try{if(!si(S(),y))return!1}catch{return!1}}if(f=u.child,u.subtreeFlags&16384&&f!==null)f.return=u,u=f;else{if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function nl(a,u,f,m){u&=~Z0,u&=~oo,a.suspendedLanes|=u,a.pingedLanes&=~u,m&&(a.warmLanes|=u),m=a.expirationTimes;for(var y=u;0<y;){var S=31-ve(y),w=1<<S;m[S]=-1,y&=~w}f!==0&&fk(a,f,u)}function Od(){return(Je&6)===0?(Ou(0),!1):!0}function q0(){if(Xe!==null){if(rt===0)var a=Xe.return;else a=Xe,Jr=Kl=null,o0(a),ba=null,Jc=0,a=Xe;for(;a!==null;)PT(a.alternate,a),a=a.return;Xe=null}}function Qa(a,u){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,gB(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),hs=0,q0(),ft=a,Xe=f=Fr(a.current,null),qe=u,rt=0,ci=null,Ks=!1,Ca=zc(a,u),B0=!1,Aa=ui=Z0=oo=Js=Rt=0,Vn=mu=null,j0=!1,(u&8)!==0&&(u|=u&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=u;0<m;){var y=31-ve(m),S=1<<y;u|=a[y],m&=~S}return us=u,_f(),f}function iC(a,u){Le=null,B.H=ou,u===ya||u===Hf?(u=bw(),rt=3):u===WO?(u=bw(),rt=4):rt=u===k0?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,ci=u,Xe===null&&(Rt=1,ld(a,Mi(u,a.current)))}function rC(){var a=oi.current;return a===null?!0:(qe&4194048)===qe?Ri===null:(qe&62914560)===qe||(qe&536870912)!==0?a===Ri:!1}function sC(){var a=B.H;return B.H=ou,a===null?ou:a}function lC(){var a=B.A;return B.A=U_,a}function yd(){Rt=4,Ks||(qe&4194048)!==qe&&oi.current!==null||(Ca=!0),(Js&134217727)===0&&(oo&134217727)===0||ft===null||nl(ft,qe,ui,!1)}function H0(a,u,f){var m=Je;Je|=2;var y=sC(),S=lC();(ft!==a||qe!==u)&&(gd=null,Qa(a,u)),u=!1;var w=Rt;e:do try{if(rt!==0&&Xe!==null){var T=Xe,R=ci;switch(rt){case 8:q0(),w=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(u=!0);var X=rt;if(rt=0,ci=null,Ea(a,T,R,X),f&&Ca){w=0;break e}break;default:X=rt,rt=0,ci=null,Ea(a,T,R,X)}}F_(),w=Rt;break}catch(U){iC(a,U)}while(!0);return u&&a.shellSuspendCounter++,Jr=Kl=null,Je=m,B.H=y,B.A=S,Xe===null&&(ft=null,qe=0,_f()),w}function F_(){for(;Xe!==null;)oC(Xe)}function K_(a,u){var f=Je;Je|=2;var m=sC(),y=lC();ft!==a||qe!==u?(gd=null,md=En()+500,Qa(a,u)):Ca=zc(a,u);e:do try{if(rt!==0&&Xe!==null){u=Xe;var S=ci;t:switch(rt){case 1:rt=0,ci=null,Ea(a,u,S,1);break;case 2:case 9:if(Ow(S)){rt=0,ci=null,aC(u);break}u=function(){rt!==2&&rt!==9||ft!==a||(rt=7),Or(a)},S.then(u,u);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:Ow(S)?(rt=0,ci=null,aC(u)):(rt=0,ci=null,Ea(a,u,S,7));break;case 5:var w=null;switch(Xe.tag){case 26:w=Xe.memoizedState;case 5:case 27:var T=Xe;if(w?YC(w):T.stateNode.complete){rt=0,ci=null;var R=T.sibling;if(R!==null)Xe=R;else{var X=T.return;X!==null?(Xe=X,bd(X)):Xe=null}break t}}rt=0,ci=null,Ea(a,u,S,5);break;case 6:rt=0,ci=null,Ea(a,u,S,6);break;case 8:q0(),Rt=6;break e;default:throw Error(i(462))}}J_();break}catch(U){iC(a,U)}while(!0);return Jr=Kl=null,B.H=m,B.A=y,Je=f,Xe!==null?0:(ft=null,qe=0,_f(),Rt)}function J_(){for(;Xe!==null&&!Vl();)oC(Xe)}function oC(a){var u=$T(a.alternate,a,us);a.memoizedProps=a.pendingProps,u===null?bd(a):Xe=u}function aC(a){var u=a,f=u.alternate;switch(u.tag){case 15:case 0:u=TT(f,u,u.pendingProps,u.type,void 0,qe);break;case 11:u=TT(f,u,u.pendingProps,u.type.render,u.ref,qe);break;case 5:o0(u);default:PT(f,u),u=Xe=lw(u,us),u=$T(f,u,us)}a.memoizedProps=a.pendingProps,u===null?bd(a):Xe=u}function Ea(a,u,f,m){Jr=Kl=null,o0(u),ba=null,Jc=0;var y=u.return;try{if(j_(a,y,u,f,qe)){Rt=1,ld(a,Mi(f,a.current)),Xe=null;return}}catch(S){if(y!==null)throw Xe=y,S;Rt=1,ld(a,Mi(f,a.current)),Xe=null;return}u.flags&32768?(Ue||m===1?a=!0:Ca||(qe&536870912)!==0?a=!1:(Ks=a=!0,(m===2||m===9||m===3||m===6)&&(m=oi.current,m!==null&&m.tag===13&&(m.flags|=16384))),cC(u,a)):bd(u)}function bd(a){var u=a;do{if((u.flags&32768)!==0){cC(u,Ks);return}a=u.return;var f=V_(u.alternate,u,us);if(f!==null){Xe=f;return}if(u=u.sibling,u!==null){Xe=u;return}Xe=u=a}while(u!==null);Rt===0&&(Rt=5)}function cC(a,u){do{var f=q_(a.alternate,a);if(f!==null){f.flags&=32767,Xe=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!u&&(a=a.sibling,a!==null)){Xe=a;return}Xe=a=f}while(a!==null);Rt=6,Xe=null}function uC(a,u,f,m,y,S,w,T,R){a.cancelPendingCommit=null;do Sd();while(Gt!==0);if((Je&6)!==0)throw Error(i(327));if(u!==null){if(u===a.current)throw Error(i(177));if(S=u.lanes|u.childLanes,S|=DO,R5(a,f,S,w,T,R),a===ft&&(Xe=ft=null,qe=0),Ma=u,tl=a,hs=f,X0=S,I0=y,JT=m,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,iB(Go,function(){return mC(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||m){m=B.T,B.T=null,y=K.p,K.p=2,w=Je,Je|=4;try{H_(a,u,f)}finally{Je=w,K.p=y,B.T=m}}Gt=1,hC(),fC(),dC()}}function hC(){if(Gt===1){Gt=0;var a=tl,u=Ma,f=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||f){f=B.T,B.T=null;var m=K.p;K.p=2;var y=Je;Je|=4;try{qT(u,a);var S=ry,w=Fk(a.containerInfo),T=S.focusedElem,R=S.selectionRange;if(w!==T&&T&&T.ownerDocument&&Gk(T.ownerDocument.documentElement,T)){if(R!==null&&QO(T)){var X=R.start,U=R.end;if(U===void 0&&(U=X),"selectionStart"in T)T.selectionStart=X,T.selectionEnd=Math.min(U,T.value.length);else{var ee=T.ownerDocument||document,I=ee&&ee.defaultView||window;if(I.getSelection){var V=I.getSelection(),be=T.textContent.length,Qe=Math.min(R.start,be),ut=R.end===void 0?Qe:Math.min(R.end,be);!V.extend&&Qe>ut&&(w=ut,ut=Qe,Qe=w);var L=Wk(T,Qe),N=Wk(T,ut);if(L&&N&&(V.rangeCount!==1||V.anchorNode!==L.node||V.anchorOffset!==L.offset||V.focusNode!==N.node||V.focusOffset!==N.offset)){var j=ee.createRange();j.setStart(L.node,L.offset),V.removeAllRanges(),Qe>ut?(V.addRange(j),V.extend(N.node,N.offset)):(j.setEnd(N.node,N.offset),V.addRange(j))}}}}for(ee=[],V=T;V=V.parentNode;)V.nodeType===1&&ee.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<ee.length;T++){var F=ee[T];F.element.scrollLeft=F.left,F.element.scrollTop=F.top}}Rd=!!iy,ry=iy=null}finally{Je=y,K.p=m,B.T=f}}a.current=u,Gt=2}}function fC(){if(Gt===2){Gt=0;var a=tl,u=Ma,f=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||f){f=B.T,B.T=null;var m=K.p;K.p=2;var y=Je;Je|=4;try{ZT(a,u.alternate,u)}finally{Je=y,K.p=m,B.T=f}}Gt=3}}function dC(){if(Gt===4||Gt===3){Gt=0,wf();var a=tl,u=Ma,f=hs,m=JT;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?Gt=5:(Gt=0,Ma=tl=null,pC(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(el=null),uO(f),u=u.stateNode,ie&&typeof ie.onCommitFiberRoot=="function")try{ie.onCommitFiberRoot(q,u,void 0,(u.current.flags&128)===128)}catch{}if(m!==null){u=B.T,y=K.p,K.p=2,B.T=null;try{for(var S=a.onRecoverableError,w=0;w<m.length;w++){var T=m[w];S(T.value,{componentStack:T.stack})}}finally{B.T=u,K.p=y}}(hs&3)!==0&&Sd(),Or(a),y=a.pendingLanes,(f&261930)!==0&&(y&42)!==0?a===V0?gu++:(gu=0,V0=a):gu=0,Ou(0)}}function pC(a,u){(a.pooledCacheLanes&=u)===0&&(u=a.pooledCache,u!=null&&(a.pooledCache=null,Fc(u)))}function Sd(){return hC(),fC(),dC(),mC()}function mC(){if(Gt!==5)return!1;var a=tl,u=X0;X0=0;var f=uO(hs),m=B.T,y=K.p;try{K.p=32>f?32:f,B.T=null,f=I0,I0=null;var S=tl,w=hs;if(Gt=0,Ma=tl=null,hs=0,(Je&6)!==0)throw Error(i(331));var T=Je;if(Je|=4,GT(S.current),YT(S,S.current,w,f),Je=T,Ou(0,!1),ie&&typeof ie.onPostCommitFiberRoot=="function")try{ie.onPostCommitFiberRoot(q,S)}catch{}return!0}finally{K.p=y,B.T=m,pC(a,u)}}function gC(a,u,f){u=Mi(f,u),u=x0(a.stateNode,u,2),a=Us(a,u,2),a!==null&&(Lc(a,2),Or(a))}function st(a,u,f){if(a.tag===3)gC(a,a,f);else for(;u!==null;){if(u.tag===3){gC(u,a,f);break}else if(u.tag===1){var m=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(el===null||!el.has(m))){a=Mi(f,a),f=OT(2),m=Us(u,f,2),m!==null&&(yT(f,m,u,a),Lc(m,2),Or(m));break}}u=u.return}}function Y0(a,u,f){var m=a.pingCache;if(m===null){m=a.pingCache=new W_;var y=new Set;m.set(u,y)}else y=m.get(u),y===void 0&&(y=new Set,m.set(u,y));y.has(f)||(B0=!0,y.add(f),a=eB.bind(null,a,u,f),u.then(a,a))}function eB(a,u,f){var m=a.pingCache;m!==null&&m.delete(u),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,ft===a&&(qe&f)===f&&(Rt===4||Rt===3&&(qe&62914560)===qe&&300>En()-pd?(Je&2)===0&&Qa(a,0):Z0|=f,Aa===qe&&(Aa=0)),Or(a)}function OC(a,u){u===0&&(u=hk()),a=Wl(a,u),a!==null&&(Lc(a,u),Or(a))}function tB(a){var u=a.memoizedState,f=0;u!==null&&(f=u.retryLane),OC(a,f)}function nB(a,u){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,y=a.memoizedState;y!==null&&(f=y.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(i(314))}m!==null&&m.delete(u),OC(a,f)}function iB(a,u){return Wo(a,u)}var vd=null,$a=null,U0=!1,xd=!1,W0=!1,il=0;function Or(a){a!==$a&&a.next===null&&($a===null?vd=$a=a:$a=$a.next=a),xd=!0,U0||(U0=!0,sB())}function Ou(a,u){if(!W0&&xd){W0=!0;do for(var f=!1,m=vd;m!==null;){if(a!==0){var y=m.pendingLanes;if(y===0)var S=0;else{var w=m.suspendedLanes,T=m.pingedLanes;S=(1<<31-ve(42|a)+1)-1,S&=y&~(w&~T),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,vC(m,S))}else S=qe,S=Fo(m,m===ft?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||zc(m,S)||(f=!0,vC(m,S));m=m.next}while(f);W0=!1}}function rB(){yC()}function yC(){xd=U0=!1;var a=0;il!==0&&mB()&&(a=il);for(var u=En(),f=null,m=vd;m!==null;){var y=m.next,S=bC(m,u);S===0?(m.next=null,f===null?vd=y:f.next=y,y===null&&($a=f)):(f=m,(a!==0||(S&3)!==0)&&(xd=!0)),m=y}Gt!==0&&Gt!==5||Ou(a),il!==0&&(il=0)}function bC(a,u){for(var f=a.suspendedLanes,m=a.pingedLanes,y=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var w=31-ve(S),T=1<<w,R=y[w];R===-1?((T&f)===0||(T&m)!==0)&&(y[w]=$5(T,u)):R<=u&&(a.expiredLanes|=T),S&=~T}if(u=ft,f=qe,f=Fo(a,a===u?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===u&&(rt===2||rt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Hr(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||zc(a,f)){if(u=f&-f,u===a.callbackPriority)return u;switch(m!==null&&Hr(m),uO(f)){case 2:case 8:f=Cf;break;case 32:f=Go;break;case 268435456:f=ni;break;default:f=Go}return m=SC.bind(null,a),f=Wo(f,m),a.callbackPriority=u,a.callbackNode=f,u}return m!==null&&m!==null&&Hr(m),a.callbackPriority=2,a.callbackNode=null,2}function SC(a,u){if(Gt!==0&&Gt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(Sd()&&a.callbackNode!==f)return null;var m=qe;return m=Fo(a,a===ft?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(tC(a,m,u),bC(a,En()),a.callbackNode!=null&&a.callbackNode===f?SC.bind(null,a):null)}function vC(a,u){if(Sd())return null;tC(a,u,!0)}function sB(){OB(function(){(Je&6)!==0?Wo(Tf,rB):yC()})}function G0(){if(il===0){var a=ga;a===0&&(a=Gi,Gi<<=1,(Gi&261888)===0&&(Gi=256)),il=a}return il}function xC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ef(""+a)}function kC(a,u){var f=u.ownerDocument.createElement("input");return f.name=u.name,f.value=u.value,a.id&&f.setAttribute("form",a.id),u.parentNode.insertBefore(f,u),a=new FormData(a),f.parentNode.removeChild(f),a}function lB(a,u,f,m,y){if(u==="submit"&&f&&f.stateNode===y){var S=xC((y[Bn]||null).action),w=m.submitter;w&&(u=(u=w[Bn]||null)?xC(u.formAction):w.getAttribute("formAction"),u!==null&&(S=u,w=null));var T=new Df("action","action",null,m,y);a.push({event:T,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(il!==0){var R=w?kC(y,w):new FormData(y);g0(f,{pending:!0,data:R,method:y.method,action:S},null,R)}}else typeof S=="function"&&(T.preventDefault(),R=w?kC(y,w):new FormData(y),g0(f,{pending:!0,data:R,method:y.method,action:S},S,R))},currentTarget:y}]})}}for(var F0=0;F0<PO.length;F0++){var K0=PO[F0],oB=K0.toLowerCase(),aB=K0[0].toUpperCase()+K0.slice(1);Fi(oB,"on"+aB)}Fi(ew,"onAnimationEnd"),Fi(tw,"onAnimationIteration"),Fi(nw,"onAnimationStart"),Fi("dblclick","onDoubleClick"),Fi("focusin","onFocus"),Fi("focusout","onBlur"),Fi(w_,"onTransitionRun"),Fi(T_,"onTransitionStart"),Fi(C_,"onTransitionCancel"),Fi(iw,"onTransitionEnd"),na("onMouseEnter",["mouseout","mouseover"]),na("onMouseLeave",["mouseout","mouseover"]),na("onPointerEnter",["pointerout","pointerover"]),na("onPointerLeave",["pointerout","pointerover"]),ql("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ql("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ql("onBeforeInput",["compositionend","keypress","textInput","paste"]),ql("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ql("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var yu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),cB=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(yu));function wC(a,u){u=(u&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],y=m.event;m=m.listeners;e:{var S=void 0;if(u)for(var w=m.length-1;0<=w;w--){var T=m[w],R=T.instance,X=T.currentTarget;if(T=T.listener,R!==S&&y.isPropagationStopped())break e;S=T,y.currentTarget=X;try{S(y)}catch(U){Lf(U)}y.currentTarget=null,S=R}else for(w=0;w<m.length;w++){if(T=m[w],R=T.instance,X=T.currentTarget,T=T.listener,R!==S&&y.isPropagationStopped())break e;S=T,y.currentTarget=X;try{S(y)}catch(U){Lf(U)}y.currentTarget=null,S=R}}}}function Ie(a,u){var f=u[hO];f===void 0&&(f=u[hO]=new Set);var m=a+"__bubble";f.has(m)||(TC(u,a,2,!1),f.add(m))}function J0(a,u,f){var m=0;u&&(m|=4),TC(f,a,m,u)}var kd="_reactListening"+Math.random().toString(36).slice(2);function ey(a){if(!a[kd]){a[kd]=!0,yk.forEach(function(f){f!=="selectionchange"&&(cB.has(f)||J0(f,!1,a),J0(f,!0,a))});var u=a.nodeType===9?a:a.ownerDocument;u===null||u[kd]||(u[kd]=!0,J0("selectionchange",!1,u))}}function TC(a,u,f,m){switch(eA(u)){case 2:var y=LB;break;case 8:y=_B;break;default:y=my}f=y.bind(null,u,f,a),y=void 0,!SO||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(y=!0),m?y!==void 0?a.addEventListener(u,f,{capture:!0,passive:y}):a.addEventListener(u,f,!0):y!==void 0?a.addEventListener(u,f,{passive:y}):a.addEventListener(u,f,!1)}function ty(a,u,f,m,y){var S=m;if((u&1)===0&&(u&2)===0&&m!==null)e:for(;;){if(m===null)return;var w=m.tag;if(w===3||w===4){var T=m.stateNode.containerInfo;if(T===y)break;if(w===4)for(w=m.return;w!==null;){var R=w.tag;if((R===3||R===4)&&w.stateNode.containerInfo===y)return;w=w.return}for(;T!==null;){if(w=Jo(T),w===null)return;if(R=w.tag,R===5||R===6||R===26||R===27){m=S=w;continue e}T=T.parentNode}}m=m.return}Ek(function(){var X=S,U=yO(f),ee=[];e:{var I=rw.get(a);if(I!==void 0){var V=Df,be=a;switch(a){case"keypress":if(Rf(f)===0)break e;case"keydown":case"keyup":V=n_;break;case"focusin":be="focus",V=wO;break;case"focusout":be="blur",V=wO;break;case"beforeblur":case"afterblur":V=wO;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=Pk;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=V5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=s_;break;case ew:case tw:case nw:V=Y5;break;case iw:V=o_;break;case"scroll":case"scrollend":V=X5;break;case"wheel":V=c_;break;case"copy":case"cut":case"paste":V=W5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=Nk;break;case"toggle":case"beforetoggle":V=h_}var Qe=(u&4)!==0,ut=!Qe&&(a==="scroll"||a==="scrollend"),L=Qe?I!==null?I+"Capture":null:I;Qe=[];for(var N=X,j;N!==null;){var F=N;if(j=F.stateNode,F=F.tag,F!==5&&F!==26&&F!==27||j===null||L===null||(F=Zc(N,L),F!=null&&Qe.push(bu(N,F,j))),ut)break;N=N.return}0<Qe.length&&(I=new V(I,be,null,f,U),ee.push({event:I,listeners:Qe}))}}if((u&7)===0){e:{if(I=a==="mouseover"||a==="pointerover",V=a==="mouseout"||a==="pointerout",I&&f!==OO&&(be=f.relatedTarget||f.fromElement)&&(Jo(be)||be[Ko]))break e;if((V||I)&&(I=U.window===U?U:(I=U.ownerDocument)?I.defaultView||I.parentWindow:window,V?(be=f.relatedTarget||f.toElement,V=X,be=be?Jo(be):null,be!==null&&(ut=s(be),Qe=be.tag,be!==ut||Qe!==5&&Qe!==27&&Qe!==6)&&(be=null)):(V=null,be=X),V!==be)){if(Qe=Pk,F="onMouseLeave",L="onMouseEnter",N="mouse",(a==="pointerout"||a==="pointerover")&&(Qe=Nk,F="onPointerLeave",L="onPointerEnter",N="pointer"),ut=V==null?I:Bc(V),j=be==null?I:Bc(be),I=new Qe(F,N+"leave",V,f,U),I.target=ut,I.relatedTarget=j,F=null,Jo(U)===X&&(Qe=new Qe(L,N+"enter",be,f,U),Qe.target=j,Qe.relatedTarget=ut,F=Qe),ut=F,V&&be)t:{for(Qe=uB,L=V,N=be,j=0,F=L;F;F=Qe(F))j++;F=0;for(var Ce=N;Ce;Ce=Qe(Ce))F++;for(;0<j-F;)L=Qe(L),j--;for(;0<F-j;)N=Qe(N),F--;for(;j--;){if(L===N||N!==null&&L===N.alternate){Qe=L;break t}L=Qe(L),N=Qe(N)}Qe=null}else Qe=null;V!==null&&CC(ee,I,V,Qe,!1),be!==null&&ut!==null&&CC(ee,ut,be,Qe,!0)}}e:{if(I=X?Bc(X):window,V=I.nodeName&&I.nodeName.toLowerCase(),V==="select"||V==="input"&&I.type==="file")var Fe=Ik;else if(jk(I))if(Vk)Fe=v_;else{Fe=b_;var Se=y_}else V=I.nodeName,!V||V.toLowerCase()!=="input"||I.type!=="checkbox"&&I.type!=="radio"?X&&gO(X.elementType)&&(Fe=Ik):Fe=S_;if(Fe&&(Fe=Fe(a,X))){Xk(ee,Fe,f,U);break e}Se&&Se(a,I,X),a==="focusout"&&X&&I.type==="number"&&X.memoizedProps.value!=null&&mO(I,"number",I.value)}switch(Se=X?Bc(X):window,a){case"focusin":(jk(Se)||Se.contentEditable==="true")&&(aa=Se,EO=X,Uc=null);break;case"focusout":Uc=EO=aa=null;break;case"mousedown":$O=!0;break;case"contextmenu":case"mouseup":case"dragend":$O=!1,Kk(ee,f,U);break;case"selectionchange":if(k_)break;case"keydown":case"keyup":Kk(ee,f,U)}var Ze;if(CO)e:{switch(a){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else oa?Bk(a,f)&&(He="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(He="onCompositionStart");He&&(zk&&f.locale!=="ko"&&(oa||He!=="onCompositionStart"?He==="onCompositionEnd"&&oa&&(Ze=$k()):(js=U,vO="value"in js?js.value:js.textContent,oa=!0)),Se=wd(X,He),0<Se.length&&(He=new Dk(He,a,null,f,U),ee.push({event:He,listeners:Se}),Ze?He.data=Ze:(Ze=Zk(f),Ze!==null&&(He.data=Ze)))),(Ze=d_?p_(a,f):m_(a,f))&&(He=wd(X,"onBeforeInput"),0<He.length&&(Se=new Dk("onBeforeInput","beforeinput",null,f,U),ee.push({event:Se,listeners:He}),Se.data=Ze)),lB(ee,a,X,f,U)}wC(ee,u)})}function bu(a,u,f){return{instance:a,listener:u,currentTarget:f}}function wd(a,u){for(var f=u+"Capture",m=[];a!==null;){var y=a,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Zc(a,f),y!=null&&m.unshift(bu(a,y,S)),y=Zc(a,u),y!=null&&m.push(bu(a,y,S))),a.tag===3)return m;a=a.return}return[]}function uB(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function CC(a,u,f,m,y){for(var S=u._reactName,w=[];f!==null&&f!==m;){var T=f,R=T.alternate,X=T.stateNode;if(T=T.tag,R!==null&&R===m)break;T!==5&&T!==26&&T!==27||X===null||(R=X,y?(X=Zc(f,S),X!=null&&w.unshift(bu(f,X,R))):y||(X=Zc(f,S),X!=null&&w.push(bu(f,X,R)))),f=f.return}w.length!==0&&a.push({event:u,listeners:w})}var hB=/\r\n?/g,fB=/\u0000|\uFFFD/g;function AC(a){return(typeof a=="string"?a:""+a).replace(hB,`
|
|
49
|
+
`).replace(fB,"")}function MC(a,u){return u=AC(u),AC(a)===u}function ct(a,u,f,m,y,S){switch(f){case"children":typeof m=="string"?u==="body"||u==="textarea"&&m===""||ra(a,m):(typeof m=="number"||typeof m=="bigint")&&u!=="body"&&ra(a,""+m);break;case"className":Mf(a,"class",m);break;case"tabIndex":Mf(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Mf(a,f,m);break;case"style":Mk(a,m,S);break;case"data":if(u!=="object"){Mf(a,"data",m);break}case"src":case"href":if(m===""&&(u!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ef(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(u!=="input"&&ct(a,u,"name",y.name,y,null),ct(a,u,"formEncType",y.formEncType,y,null),ct(a,u,"formMethod",y.formMethod,y,null),ct(a,u,"formTarget",y.formTarget,y,null)):(ct(a,u,"encType",y.encType,y,null),ct(a,u,"method",y.method,y,null),ct(a,u,"target",y.target,y,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ef(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=Wr);break;case"onScroll":m!=null&&Ie("scroll",a);break;case"onScrollEnd":m!=null&&Ie("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(f=m.__html,f!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Ef(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":Ie("beforetoggle",a),Ie("toggle",a),Af(a,"popover",m);break;case"xlinkActuate":Ur(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Ur(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Ur(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Ur(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Ur(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Ur(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Ur(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Ur(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Ur(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Af(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=Z5.get(f)||f,Af(a,f,m))}}function ny(a,u,f,m,y,S){switch(f){case"style":Mk(a,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(i(61));if(f=m.__html,f!=null){if(y.children!=null)throw Error(i(60));a.innerHTML=f}}break;case"children":typeof m=="string"?ra(a,m):(typeof m=="number"||typeof m=="bigint")&&ra(a,""+m);break;case"onScroll":m!=null&&Ie("scroll",a);break;case"onScrollEnd":m!=null&&Ie("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Wr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bk.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(y=f.endsWith("Capture"),u=f.slice(2,y?f.length-7:void 0),S=a[Bn]||null,S=S!=null?S[f]:null,typeof S=="function"&&a.removeEventListener(u,S,y),typeof m=="function")){typeof S!="function"&&S!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(u,m,y);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):Af(a,f,m)}}}function hn(a,u,f){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",a),Ie("load",a);var m=!1,y=!1,S;for(S in f)if(f.hasOwnProperty(S)){var w=f[S];if(w!=null)switch(S){case"src":m=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,u));default:ct(a,u,S,w,f,null)}}y&&ct(a,u,"srcSet",f.srcSet,f,null),m&&ct(a,u,"src",f.src,f,null);return;case"input":Ie("invalid",a);var T=S=w=y=null,R=null,X=null;for(m in f)if(f.hasOwnProperty(m)){var U=f[m];if(U!=null)switch(m){case"name":y=U;break;case"type":w=U;break;case"checked":R=U;break;case"defaultChecked":X=U;break;case"value":S=U;break;case"defaultValue":T=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(i(137,u));break;default:ct(a,u,m,U,f,null)}}wk(a,S,T,R,X,w,y,!1);return;case"select":Ie("invalid",a),m=w=S=null;for(y in f)if(f.hasOwnProperty(y)&&(T=f[y],T!=null))switch(y){case"value":S=T;break;case"defaultValue":w=T;break;case"multiple":m=T;default:ct(a,u,y,T,f,null)}u=S,f=w,a.multiple=!!m,u!=null?ia(a,!!m,u,!1):f!=null&&ia(a,!!m,f,!0);return;case"textarea":Ie("invalid",a),S=y=m=null;for(w in f)if(f.hasOwnProperty(w)&&(T=f[w],T!=null))switch(w){case"value":m=T;break;case"defaultValue":y=T;break;case"children":S=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(i(91));break;default:ct(a,u,w,T,f,null)}Ck(a,m,y,S);return;case"option":for(R in f)if(f.hasOwnProperty(R)&&(m=f[R],m!=null))switch(R){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:ct(a,u,R,m,f,null)}return;case"dialog":Ie("beforetoggle",a),Ie("toggle",a),Ie("cancel",a),Ie("close",a);break;case"iframe":case"object":Ie("load",a);break;case"video":case"audio":for(m=0;m<yu.length;m++)Ie(yu[m],a);break;case"image":Ie("error",a),Ie("load",a);break;case"details":Ie("toggle",a);break;case"embed":case"source":case"link":Ie("error",a),Ie("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in f)if(f.hasOwnProperty(X)&&(m=f[X],m!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,u));default:ct(a,u,X,m,f,null)}return;default:if(gO(u)){for(U in f)f.hasOwnProperty(U)&&(m=f[U],m!==void 0&&ny(a,u,U,m,f,void 0));return}}for(T in f)f.hasOwnProperty(T)&&(m=f[T],m!=null&&ct(a,u,T,m,f,null))}function dB(a,u,f,m){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,w=null,T=null,R=null,X=null,U=null;for(V in f){var ee=f[V];if(f.hasOwnProperty(V)&&ee!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":R=ee;default:m.hasOwnProperty(V)||ct(a,u,V,null,m,ee)}}for(var I in m){var V=m[I];if(ee=f[I],m.hasOwnProperty(I)&&(V!=null||ee!=null))switch(I){case"type":S=V;break;case"name":y=V;break;case"checked":X=V;break;case"defaultChecked":U=V;break;case"value":w=V;break;case"defaultValue":T=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(i(137,u));break;default:V!==ee&&ct(a,u,I,V,m,ee)}}pO(a,w,T,R,X,U,S,y);return;case"select":V=w=T=I=null;for(S in f)if(R=f[S],f.hasOwnProperty(S)&&R!=null)switch(S){case"value":break;case"multiple":V=R;default:m.hasOwnProperty(S)||ct(a,u,S,null,m,R)}for(y in m)if(S=m[y],R=f[y],m.hasOwnProperty(y)&&(S!=null||R!=null))switch(y){case"value":I=S;break;case"defaultValue":T=S;break;case"multiple":w=S;default:S!==R&&ct(a,u,y,S,m,R)}u=T,f=w,m=V,I!=null?ia(a,!!f,I,!1):!!m!=!!f&&(u!=null?ia(a,!!f,u,!0):ia(a,!!f,f?[]:"",!1));return;case"textarea":V=I=null;for(T in f)if(y=f[T],f.hasOwnProperty(T)&&y!=null&&!m.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ct(a,u,T,null,m,y)}for(w in m)if(y=m[w],S=f[w],m.hasOwnProperty(w)&&(y!=null||S!=null))switch(w){case"value":I=y;break;case"defaultValue":V=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(i(91));break;default:y!==S&&ct(a,u,w,y,m,S)}Tk(a,I,V);return;case"option":for(var be in f)if(I=f[be],f.hasOwnProperty(be)&&I!=null&&!m.hasOwnProperty(be))switch(be){case"selected":a.selected=!1;break;default:ct(a,u,be,null,m,I)}for(R in m)if(I=m[R],V=f[R],m.hasOwnProperty(R)&&I!==V&&(I!=null||V!=null))switch(R){case"selected":a.selected=I&&typeof I!="function"&&typeof I!="symbol";break;default:ct(a,u,R,I,m,V)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Qe in f)I=f[Qe],f.hasOwnProperty(Qe)&&I!=null&&!m.hasOwnProperty(Qe)&&ct(a,u,Qe,null,m,I);for(X in m)if(I=m[X],V=f[X],m.hasOwnProperty(X)&&I!==V&&(I!=null||V!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(I!=null)throw Error(i(137,u));break;default:ct(a,u,X,I,m,V)}return;default:if(gO(u)){for(var ut in f)I=f[ut],f.hasOwnProperty(ut)&&I!==void 0&&!m.hasOwnProperty(ut)&&ny(a,u,ut,void 0,m,I);for(U in m)I=m[U],V=f[U],!m.hasOwnProperty(U)||I===V||I===void 0&&V===void 0||ny(a,u,U,I,m,V);return}}for(var L in f)I=f[L],f.hasOwnProperty(L)&&I!=null&&!m.hasOwnProperty(L)&&ct(a,u,L,null,m,I);for(ee in m)I=m[ee],V=f[ee],!m.hasOwnProperty(ee)||I===V||I==null&&V==null||ct(a,u,ee,I,m,V)}function QC(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pB(){if(typeof performance.getEntriesByType=="function"){for(var a=0,u=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var y=f[m],S=y.transferSize,w=y.initiatorType,T=y.duration;if(S&&T&&QC(w)){for(w=0,T=y.responseEnd,m+=1;m<f.length;m++){var R=f[m],X=R.startTime;if(X>T)break;var U=R.transferSize,ee=R.initiatorType;U&&QC(ee)&&(R=R.responseEnd,w+=U*(R<T?1:(T-X)/(R-X)))}if(--m,u+=8*(S+w)/(y.duration/1e3),a++,10<a)break}}if(0<a)return u/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var iy=null,ry=null;function Td(a){return a.nodeType===9?a:a.ownerDocument}function EC(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $C(a,u){if(a===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&u==="foreignObject"?0:a}function sy(a,u){return a==="textarea"||a==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var ly=null;function mB(){var a=window.event;return a&&a.type==="popstate"?a===ly?!1:(ly=a,!0):(ly=null,!1)}var RC=typeof setTimeout=="function"?setTimeout:void 0,gB=typeof clearTimeout=="function"?clearTimeout:void 0,PC=typeof Promise=="function"?Promise:void 0,OB=typeof queueMicrotask=="function"?queueMicrotask:typeof PC<"u"?function(a){return PC.resolve(null).then(a).catch(yB)}:RC;function yB(a){setTimeout(function(){throw a})}function rl(a){return a==="head"}function DC(a,u){var f=u,m=0;do{var y=f.nextSibling;if(a.removeChild(f),y&&y.nodeType===8)if(f=y.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(y),Na(u);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")Su(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,Su(f);for(var S=f.firstChild;S;){var w=S.nextSibling,T=S.nodeName;S[_c]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=w}}else f==="body"&&Su(a.ownerDocument.body);f=y}while(f);Na(u)}function NC(a,u){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?u?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(u?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function oy(a){var u=a.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var f=u;switch(u=u.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":oy(f),fO(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function bB(a,u,f,m){for(;a.nodeType===1;){var y=f;if(a.nodeName.toLowerCase()!==u.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[_c])switch(u){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(u==="input"&&a.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=Pi(a.nextSibling),a===null)break}return null}function SB(a,u,f){if(u==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=Pi(a.nextSibling),a===null))return null;return a}function zC(a,u){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Pi(a.nextSibling),a===null))return null;return a}function ay(a){return a.data==="$?"||a.data==="$~"}function cy(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function vB(a,u){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=u;else if(a.data!=="$?"||f.readyState!=="loading")u();else{var m=function(){u(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function Pi(a){for(;a!=null;a=a.nextSibling){var u=a.nodeType;if(u===1||u===3)break;if(u===8){if(u=a.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return a}var uy=null;function LC(a){a=a.nextSibling;for(var u=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(u===0)return Pi(a.nextSibling);u--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||u++}a=a.nextSibling}return null}function _C(a){a=a.previousSibling;for(var u=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(u===0)return a;u--}else f!=="/$"&&f!=="/&"||u++}a=a.previousSibling}return null}function BC(a,u,f){switch(u=Td(f),a){case"html":if(a=u.documentElement,!a)throw Error(i(452));return a;case"head":if(a=u.head,!a)throw Error(i(453));return a;case"body":if(a=u.body,!a)throw Error(i(454));return a;default:throw Error(i(451))}}function Su(a){for(var u=a.attributes;u.length;)a.removeAttributeNode(u[0]);fO(a)}var Di=new Map,ZC=new Set;function Cd(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var fs=K.d;K.d={f:xB,r:kB,D:wB,C:TB,L:CB,m:AB,X:QB,S:MB,M:EB};function xB(){var a=fs.f(),u=Od();return a||u}function kB(a){var u=ea(a);u!==null&&u.tag===5&&u.type==="form"?iT(u):fs.r(a)}var Ra=typeof document>"u"?null:document;function jC(a,u,f){var m=Ra;if(m&&typeof u=="string"&&u){var y=Ci(u);y='link[rel="'+a+'"][href="'+y+'"]',typeof f=="string"&&(y+='[crossorigin="'+f+'"]'),ZC.has(y)||(ZC.add(y),a={rel:a,crossOrigin:f,href:u},m.querySelector(y)===null&&(u=m.createElement("link"),hn(u,"link",a),Jt(u),m.head.appendChild(u)))}}function wB(a){fs.D(a),jC("dns-prefetch",a,null)}function TB(a,u){fs.C(a,u),jC("preconnect",a,u)}function CB(a,u,f){fs.L(a,u,f);var m=Ra;if(m&&a&&u){var y='link[rel="preload"][as="'+Ci(u)+'"]';u==="image"&&f&&f.imageSrcSet?(y+='[imagesrcset="'+Ci(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(y+='[imagesizes="'+Ci(f.imageSizes)+'"]')):y+='[href="'+Ci(a)+'"]';var S=y;switch(u){case"style":S=Pa(a);break;case"script":S=Da(a)}Di.has(S)||(a=p({rel:"preload",href:u==="image"&&f&&f.imageSrcSet?void 0:a,as:u},f),Di.set(S,a),m.querySelector(y)!==null||u==="style"&&m.querySelector(vu(S))||u==="script"&&m.querySelector(xu(S))||(u=m.createElement("link"),hn(u,"link",a),Jt(u),m.head.appendChild(u)))}}function AB(a,u){fs.m(a,u);var f=Ra;if(f&&a){var m=u&&typeof u.as=="string"?u.as:"script",y='link[rel="modulepreload"][as="'+Ci(m)+'"][href="'+Ci(a)+'"]',S=y;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Da(a)}if(!Di.has(S)&&(a=p({rel:"modulepreload",href:a},u),Di.set(S,a),f.querySelector(y)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(xu(S)))return}m=f.createElement("link"),hn(m,"link",a),Jt(m),f.head.appendChild(m)}}}function MB(a,u,f){fs.S(a,u,f);var m=Ra;if(m&&a){var y=ta(m).hoistableStyles,S=Pa(a);u=u||"default";var w=y.get(S);if(!w){var T={loading:0,preload:null};if(w=m.querySelector(vu(S)))T.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":u},f),(f=Di.get(S))&&hy(a,f);var R=w=m.createElement("link");Jt(R),hn(R,"link",a),R._p=new Promise(function(X,U){R.onload=X,R.onerror=U}),R.addEventListener("load",function(){T.loading|=1}),R.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Ad(w,u,m)}w={type:"stylesheet",instance:w,count:1,state:T},y.set(S,w)}}}function QB(a,u){fs.X(a,u);var f=Ra;if(f&&a){var m=ta(f).hoistableScripts,y=Da(a),S=m.get(y);S||(S=f.querySelector(xu(y)),S||(a=p({src:a,async:!0},u),(u=Di.get(y))&&fy(a,u),S=f.createElement("script"),Jt(S),hn(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(y,S))}}function EB(a,u){fs.M(a,u);var f=Ra;if(f&&a){var m=ta(f).hoistableScripts,y=Da(a),S=m.get(y);S||(S=f.querySelector(xu(y)),S||(a=p({src:a,async:!0,type:"module"},u),(u=Di.get(y))&&fy(a,u),S=f.createElement("script"),Jt(S),hn(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(y,S))}}function XC(a,u,f,m){var y=(y=Re.current)?Cd(y):null;if(!y)throw Error(i(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(u=Pa(f.href),f=ta(y).hoistableStyles,m=f.get(u),m||(m={type:"style",instance:null,count:0,state:null},f.set(u,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=Pa(f.href);var S=ta(y).hoistableStyles,w=S.get(a);if(w||(y=y.ownerDocument||y,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,w),(S=y.querySelector(vu(a)))&&!S._p&&(w.instance=S,w.state.loading=5),Di.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Di.set(a,f),S||$B(y,a,f,w.state))),u&&m===null)throw Error(i(528,""));return w}if(u&&m!==null)throw Error(i(529,""));return null;case"script":return u=f.async,f=f.src,typeof f=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=Da(f),f=ta(y).hoistableScripts,m=f.get(u),m||(m={type:"script",instance:null,count:0,state:null},f.set(u,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,a))}}function Pa(a){return'href="'+Ci(a)+'"'}function vu(a){return'link[rel="stylesheet"]['+a+"]"}function IC(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function $B(a,u,f,m){a.querySelector('link[rel="preload"][as="style"]['+u+"]")?m.loading=1:(u=a.createElement("link"),m.preload=u,u.addEventListener("load",function(){return m.loading|=1}),u.addEventListener("error",function(){return m.loading|=2}),hn(u,"link",f),Jt(u),a.head.appendChild(u))}function Da(a){return'[src="'+Ci(a)+'"]'}function xu(a){return"script[async]"+a}function VC(a,u,f){if(u.count++,u.instance===null)switch(u.type){case"style":var m=a.querySelector('style[data-href~="'+Ci(f.href)+'"]');if(m)return u.instance=m,Jt(m),m;var y=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Jt(m),hn(m,"style",y),Ad(m,f.precedence,a),u.instance=m;case"stylesheet":y=Pa(f.href);var S=a.querySelector(vu(y));if(S)return u.state.loading|=4,u.instance=S,Jt(S),S;m=IC(f),(y=Di.get(y))&&hy(m,y),S=(a.ownerDocument||a).createElement("link"),Jt(S);var w=S;return w._p=new Promise(function(T,R){w.onload=T,w.onerror=R}),hn(S,"link",m),u.state.loading|=4,Ad(S,f.precedence,a),u.instance=S;case"script":return S=Da(f.src),(y=a.querySelector(xu(S)))?(u.instance=y,Jt(y),y):(m=f,(y=Di.get(S))&&(m=p({},f),fy(m,y)),a=a.ownerDocument||a,y=a.createElement("script"),Jt(y),hn(y,"link",m),a.head.appendChild(y),u.instance=y);case"void":return null;default:throw Error(i(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(m=u.instance,u.state.loading|=4,Ad(m,f.precedence,a));return u.instance}function Ad(a,u,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=m.length?m[m.length-1]:null,S=y,w=0;w<m.length;w++){var T=m[w];if(T.dataset.precedence===u)S=T;else if(S!==y)break}S?S.parentNode.insertBefore(a,S.nextSibling):(u=f.nodeType===9?f.head:f,u.insertBefore(a,u.firstChild))}function hy(a,u){a.crossOrigin==null&&(a.crossOrigin=u.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=u.referrerPolicy),a.title==null&&(a.title=u.title)}function fy(a,u){a.crossOrigin==null&&(a.crossOrigin=u.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=u.referrerPolicy),a.integrity==null&&(a.integrity=u.integrity)}var Md=null;function qC(a,u,f){if(Md===null){var m=new Map,y=Md=new Map;y.set(f,m)}else y=Md,m=y.get(f),m||(m=new Map,y.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),y=0;y<f.length;y++){var S=f[y];if(!(S[_c]||S[on]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var w=S.getAttribute(u)||"";w=a+w;var T=m.get(w);T?T.push(S):m.set(w,[S])}}return m}function HC(a,u,f){a=a.ownerDocument||a,a.head.insertBefore(f,u==="title"?a.querySelector("head > title"):null)}function RB(a,u,f){if(f===1||u.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return a=u.disabled,typeof u.precedence=="string"&&a==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function YC(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function PB(a,u,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var y=Pa(m.href),S=u.querySelector(vu(y));if(S){u=S._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(a.count++,a=Qd.bind(a),u.then(a,a)),f.state.loading|=4,f.instance=S,Jt(S);return}S=u.ownerDocument||u,m=IC(m),(y=Di.get(y))&&hy(m,y),S=S.createElement("link"),Jt(S);var w=S;w._p=new Promise(function(T,R){w.onload=T,w.onerror=R}),hn(S,"link",m),f.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,u),(u=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Qd.bind(a),u.addEventListener("load",f),u.addEventListener("error",f))}}var dy=0;function DB(a,u){return a.stylesheets&&a.count===0&&$d(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&$d(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+u);0<a.imgBytes&&dy===0&&(dy=62500*pB());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&$d(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>dy?50:800)+u);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(y)}}:null}function Qd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$d(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Ed=null;function $d(a,u){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Ed=new Map,u.forEach(NB,a),Ed=null,Qd.call(a))}function NB(a,u){if(!(u.state.loading&4)){var f=Ed.get(a);if(f)var m=f.get(null);else{f=new Map,Ed.set(a,f);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var w=y[S];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(f.set(w.dataset.precedence,w),m=w)}m&&f.set(null,m)}y=u.instance,w=y.getAttribute("data-precedence"),S=f.get(w)||m,S===m&&f.set(null,y),f.set(w,y),this.count++,m=Qd.bind(this),y.addEventListener("load",m),y.addEventListener("error",m),S?S.parentNode.insertBefore(y,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),u.state.loading|=4}}var ku={$$typeof:A,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function zB(a,u,f,m,y,S,w,T,R){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=aO(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aO(0),this.hiddenUpdates=aO(null),this.identifierPrefix=m,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function UC(a,u,f,m,y,S,w,T,R,X,U,ee){return a=new zB(a,u,f,w,R,X,U,ee,T),u=1,S===!0&&(u|=24),S=li(3,null,null,u),a.current=S,S.stateNode=a,u=HO(),u.refCount++,a.pooledCache=u,u.refCount++,S.memoizedState={element:m,isDehydrated:f,cache:u},GO(S),a}function WC(a){return a?(a=ha,a):ha}function GC(a,u,f,m,y,S){y=WC(y),m.context===null?m.context=y:m.pendingContext=y,m=Ys(u),m.payload={element:f},S=S===void 0?null:S,S!==null&&(m.callback=S),f=Us(a,m,u),f!==null&&(qn(f,a,u),tu(f,a,u))}function FC(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<u?f:u}}function py(a,u){FC(a,u),(a=a.alternate)&&FC(a,u)}function KC(a){if(a.tag===13||a.tag===31){var u=Wl(a,67108864);u!==null&&qn(u,a,67108864),py(a,67108864)}}function JC(a){if(a.tag===13||a.tag===31){var u=hi();u=cO(u);var f=Wl(a,u);f!==null&&qn(f,a,u),py(a,u)}}var Rd=!0;function LB(a,u,f,m){var y=B.T;B.T=null;var S=K.p;try{K.p=2,my(a,u,f,m)}finally{K.p=S,B.T=y}}function _B(a,u,f,m){var y=B.T;B.T=null;var S=K.p;try{K.p=8,my(a,u,f,m)}finally{K.p=S,B.T=y}}function my(a,u,f,m){if(Rd){var y=gy(m);if(y===null)ty(a,u,m,Pd,f),tA(a,m);else if(ZB(y,a,u,f,m))m.stopPropagation();else if(tA(a,m),u&4&&-1<BB.indexOf(a)){for(;y!==null;){var S=ea(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var w=Sn(S.pendingLanes);if(w!==0){var T=S;for(T.pendingLanes|=2,T.entangledLanes|=2;w;){var R=1<<31-ve(w);T.entanglements[1]|=R,w&=~R}Or(S),(Je&6)===0&&(md=En()+500,Ou(0))}}break;case 31:case 13:T=Wl(S,2),T!==null&&qn(T,S,2),Od(),py(S,2)}if(S=gy(m),S===null&&ty(a,u,m,Pd,f),S===y)break;y=S}y!==null&&m.stopPropagation()}else ty(a,u,m,null,f)}}function gy(a){return a=yO(a),Oy(a)}var Pd=null;function Oy(a){if(Pd=null,a=Jo(a),a!==null){var u=s(a);if(u===null)a=null;else{var f=u.tag;if(f===13){if(a=l(u),a!==null)return a;a=null}else if(f===31){if(a=o(u),a!==null)return a;a=null}else if(f===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;a=null}else u!==a&&(a=null)}}return Pd=a,null}function eA(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(sO()){case Tf:return 2;case Cf:return 8;case Go:case lO:return 32;case ni:return 268435456;default:return 32}default:return 32}}var yy=!1,sl=null,ll=null,ol=null,wu=new Map,Tu=new Map,al=[],BB="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function tA(a,u){switch(a){case"focusin":case"focusout":sl=null;break;case"dragenter":case"dragleave":ll=null;break;case"mouseover":case"mouseout":ol=null;break;case"pointerover":case"pointerout":wu.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tu.delete(u.pointerId)}}function Cu(a,u,f,m,y,S){return a===null||a.nativeEvent!==S?(a={blockedOn:u,domEventName:f,eventSystemFlags:m,nativeEvent:S,targetContainers:[y]},u!==null&&(u=ea(u),u!==null&&KC(u)),a):(a.eventSystemFlags|=m,u=a.targetContainers,y!==null&&u.indexOf(y)===-1&&u.push(y),a)}function ZB(a,u,f,m,y){switch(u){case"focusin":return sl=Cu(sl,a,u,f,m,y),!0;case"dragenter":return ll=Cu(ll,a,u,f,m,y),!0;case"mouseover":return ol=Cu(ol,a,u,f,m,y),!0;case"pointerover":var S=y.pointerId;return wu.set(S,Cu(wu.get(S)||null,a,u,f,m,y)),!0;case"gotpointercapture":return S=y.pointerId,Tu.set(S,Cu(Tu.get(S)||null,a,u,f,m,y)),!0}return!1}function nA(a){var u=Jo(a.target);if(u!==null){var f=s(u);if(f!==null){if(u=f.tag,u===13){if(u=l(f),u!==null){a.blockedOn=u,gk(a.priority,function(){JC(f)});return}}else if(u===31){if(u=o(f),u!==null){a.blockedOn=u,gk(a.priority,function(){JC(f)});return}}else if(u===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Dd(a){if(a.blockedOn!==null)return!1;for(var u=a.targetContainers;0<u.length;){var f=gy(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);OO=m,f.target.dispatchEvent(m),OO=null}else return u=ea(f),u!==null&&KC(u),a.blockedOn=f,!1;u.shift()}return!0}function iA(a,u,f){Dd(a)&&f.delete(u)}function jB(){yy=!1,sl!==null&&Dd(sl)&&(sl=null),ll!==null&&Dd(ll)&&(ll=null),ol!==null&&Dd(ol)&&(ol=null),wu.forEach(iA),Tu.forEach(iA)}function Nd(a,u){a.blockedOn===u&&(a.blockedOn=null,yy||(yy=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,jB)))}var zd=null;function rA(a){zd!==a&&(zd=a,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){zd===a&&(zd=null);for(var u=0;u<a.length;u+=3){var f=a[u],m=a[u+1],y=a[u+2];if(typeof m!="function"){if(Oy(m||f)===null)continue;break}var S=ea(f);S!==null&&(a.splice(u,3),u-=3,g0(S,{pending:!0,data:y,method:f.method,action:m},m,y))}}))}function Na(a){function u(R){return Nd(R,a)}sl!==null&&Nd(sl,a),ll!==null&&Nd(ll,a),ol!==null&&Nd(ol,a),wu.forEach(u),Tu.forEach(u);for(var f=0;f<al.length;f++){var m=al[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<al.length&&(f=al[0],f.blockedOn===null);)nA(f),f.blockedOn===null&&al.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var y=f[m],S=f[m+1],w=y[Bn]||null;if(typeof S=="function")w||rA(f);else if(w){var T=null;if(S&&S.hasAttribute("formAction")){if(y=S,w=S[Bn]||null)T=w.formAction;else if(Oy(y)!==null)continue}else T=w.action;typeof T=="function"?f[m+1]=T:(f.splice(m,3),m-=3),rA(f)}}}function sA(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(w){return y=w})},focusReset:"manual",scroll:"manual"})}function u(){y!==null&&(y(),y=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),y!==null&&(y(),y=null)}}}function by(a){this._internalRoot=a}Ld.prototype.render=by.prototype.render=function(a){var u=this._internalRoot;if(u===null)throw Error(i(409));var f=u.current,m=hi();GC(f,m,a,u,null,null)},Ld.prototype.unmount=by.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var u=a.containerInfo;GC(a.current,2,null,a,null,null),Od(),u[Ko]=null}};function Ld(a){this._internalRoot=a}Ld.prototype.unstable_scheduleHydration=function(a){if(a){var u=mk();a={blockedOn:null,target:a,priority:u};for(var f=0;f<al.length&&u!==0&&u<al[f].priority;f++);al.splice(f,0,a),f===0&&nA(a)}};var lA=e.version;if(lA!=="19.2.6")throw Error(i(527,lA,"19.2.6"));K.findDOMNode=function(a){var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(i(188)):(a=Object.keys(a).join(","),Error(i(268,a)));return a=h(u),a=a!==null?d(a):null,a=a===null?null:a.stateNode,a};var XB={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_d.isDisabled&&_d.supportsFiber)try{q=_d.inject(XB),ie=_d}catch{}}return Mu.createRoot=function(a,u){if(!r(a))throw Error(i(299));var f=!1,m="",y=dT,S=pT,w=mT;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(y=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(w=u.onRecoverableError)),u=UC(a,1,!1,null,null,f,m,null,y,S,w,sA),a[Ko]=u.current,ey(a),new by(u)},Mu.hydrateRoot=function(a,u,f){if(!r(a))throw Error(i(299));var m=!1,y="",S=dT,w=pT,T=mT,R=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(y=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(w=f.onCaughtError),f.onRecoverableError!==void 0&&(T=f.onRecoverableError),f.formState!==void 0&&(R=f.formState)),u=UC(a,1,!0,u,f??null,m,y,R,S,w,T,sA),u.context=WC(null),f=u.current,m=hi(),m=cO(m),y=Ys(m),y.callback=null,Us(f,y,m),f=m,u.current.lanes=f,Lc(u,f),Or(u),a[Ko]=u.current,ey(a),new Ld(u)},Mu.version="19.2.6",Mu}var gA;function JB(){if(gA)return xy.exports;gA=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),xy.exports=KB(),xy.exports}var eZ=JB(),KS=OR();const tZ=gR(KS);var Cy={exports:{}},Ay={};/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var OA;function nZ(){if(OA)return Ay;OA=1;var n=of();function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,r=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function o(p,g){var O=g(),b=i({inst:{value:O,getSnapshot:g}}),v=b[0].inst,x=b[1];return s(function(){v.value=O,v.getSnapshot=g,c(v)&&x({inst:v})},[p,O,g]),r(function(){return c(v)&&x({inst:v}),p(function(){c(v)&&x({inst:v})})},[p]),l(O),O}function c(p){var g=p.getSnapshot;p=p.value;try{var O=g();return!t(p,O)}catch{return!0}}function h(p,g){return g()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:o;return Ay.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:d,Ay}var yA;function yR(){return yA||(yA=1,Cy.exports=nZ()),Cy.exports}var bR=yR();function fn(n){this.content=n}fn.prototype={constructor:fn,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var i=t&&t!=n?this.remove(t):this,r=i.find(n),s=i.content.slice();return r==-1?s.push(t||n,e):(s[r+1]=e,t&&(s[r]=t)),new fn(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new fn(t)},addToStart:function(n,e){return new fn([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new fn(t)},addBefore:function(n,e,t){var i=this.remove(e),r=i.content.slice(),s=i.find(n);return r.splice(s==-1?r.length:s,0,e,t),new fn(r)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=fn.from(n),n.size?new fn(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=fn.from(n),n.size?new fn(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=fn.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};fn.from=function(n){if(n instanceof fn)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new fn(e)};function SR(n,e,t){for(let i=0;;i++){if(i==n.childCount||i==e.childCount)return n.childCount==e.childCount?null:t;let r=n.child(i),s=e.child(i);if(r==s){t+=r.nodeSize;continue}if(!r.sameMarkup(s))return t;if(r.isText&&r.text!=s.text){for(let l=0;r.text[l]==s.text[l];l++)t++;return t}if(r.content.size||s.content.size){let l=SR(r.content,s.content,t+1);if(l!=null)return l}t+=r.nodeSize}}function vR(n,e,t,i){for(let r=n.childCount,s=e.childCount;;){if(r==0||s==0)return r==s?null:{a:t,b:i};let l=n.child(--r),o=e.child(--s),c=l.nodeSize;if(l==o){t-=c,i-=c;continue}if(!l.sameMarkup(o))return{a:t,b:i};if(l.isText&&l.text!=o.text){let h=0,d=Math.min(l.text.length,o.text.length);for(;h<d&&l.text[l.text.length-h-1]==o.text[o.text.length-h-1];)h++,t--,i--;return{a:t,b:i}}if(l.content.size||o.content.size){let h=vR(l.content,o.content,t-1,i-1);if(h)return h}t-=c,i-=c}}class ne{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let i=0;i<e.length;i++)this.size+=e[i].nodeSize}nodesBetween(e,t,i,r=0,s){for(let l=0,o=0;o<t;l++){let c=this.content[l],h=o+c.nodeSize;if(h>e&&i(c,r+o,s||null,l)!==!1&&c.content.size){let d=o+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,t-d),i,r+d)}o=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,i,r){let s="",l=!0;return this.nodesBetween(e,t,(o,c)=>{let h=o.isText?o.text.slice(Math.max(e,c)-c,t-c):o.isLeaf?r?typeof r=="function"?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):"":"";o.isBlock&&(o.isLeaf&&h||o.isTextblock)&&i&&(l?l=!1:s+=i),s+=h},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,i=e.firstChild,r=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(i)&&(r[r.length-1]=t.withText(t.text+i.text),s=1);s<e.content.length;s++)r.push(e.content[s]);return new ne(r,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let i=[],r=0;if(t>e)for(let s=0,l=0;l<t;s++){let o=this.content[s],c=l+o.nodeSize;c>e&&((l<e||c>t)&&(o.isText?o=o.cut(Math.max(0,e-l),Math.min(o.text.length,t-l)):o=o.cut(Math.max(0,e-l-1),Math.min(o.content.size,t-l-1))),i.push(o),r+=o.nodeSize),l=c}return new ne(i,r)}cutByIndex(e,t){return e==t?ne.empty:e==0&&t==this.content.length?this:new ne(this.content.slice(e,t))}replaceChild(e,t){let i=this.content[e];if(i==t)return this;let r=this.content.slice(),s=this.size+t.nodeSize-i.nodeSize;return r[e]=t,new ne(r,s)}addToStart(e){return new ne([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ne(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,i=0;t<this.content.length;t++){let r=this.content[t];e(r,i,t),i+=r.nodeSize}}findDiffStart(e,t=0){return SR(this,e,t)}findDiffEnd(e,t=this.size,i=e.size){return vR(this,e,t,i)}findIndex(e){if(e==0)return Bd(0,e);if(e==this.size)return Bd(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,i=0;;t++){let r=this.child(t),s=i+r.nodeSize;if(s>=e)return s==e?Bd(t+1,s):Bd(t,i);i=s}}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 ne.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ne(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ne.empty;let t,i=0;for(let r=0;r<e.length;r++){let s=e[r];i+=s.nodeSize,r&&s.isText&&e[r-1].sameMarkup(s)?(t||(t=e.slice(0,r)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new ne(t||e,i)}static from(e){if(!e)return ne.empty;if(e instanceof ne)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ne([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ne.empty=new ne([],0);const My={index:0,offset:0};function Bd(n,e){return My.index=n,My.offset=e,My}function Up(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!Up(n[i],e[i]))return!1}else{for(let i in n)if(!(i in e)||!Up(n[i],e[i]))return!1;for(let i in e)if(!(i in n))return!1}return!0}let mt=class r1{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,i=!1;for(let r=0;r<e.length;r++){let s=e[r];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,r));else{if(s.type.excludes(this.type))return e;!i&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),i=!0),t&&t.push(s)}}return t||(t=e.slice()),i||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Up(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let i=e.marks[t.type];if(!i)throw new RangeError(`There is no mark type ${t.type} in this schema`);let r=i.create(t.attrs);return i.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!e[i].eq(t[i]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return r1.none;if(e instanceof r1)return[e];let t=e.slice();return t.sort((i,r)=>i.type.rank-r.type.rank),t}};mt.none=[];class Wp extends Error{}class pe{constructor(e,t,i){this.content=e,this.openStart=t,this.openEnd=i}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let i=kR(this.content,e+this.openStart,t);return i&&new pe(i,this.openStart,this.openEnd)}removeBetween(e,t){return new pe(xR(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 pe.empty;let i=t.openStart||0,r=t.openEnd||0;if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new pe(ne.fromJSON(e,t.content),i,r)}static maxOpen(e,t=!0){let i=0,r=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)i++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)r++;return new pe(e,i,r)}}pe.empty=new pe(ne.empty,0,0);function xR(n,e,t){let{index:i,offset:r}=n.findIndex(e),s=n.maybeChild(i),{index:l,offset:o}=n.findIndex(t);if(r==e||s.isText){if(o!=t&&!n.child(l).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(i!=l)throw new RangeError("Removing non-flat range");return n.replaceChild(i,s.copy(xR(s.content,e-r-1,t-r-1)))}function kR(n,e,t,i){let{index:r,offset:s}=n.findIndex(e),l=n.maybeChild(r);if(s==e||l.isText)return i&&!i.canReplace(r,r,t)?null:n.cut(0,e).append(t).append(n.cut(e));let o=kR(l.content,e-s-1,t,l);return o&&n.replaceChild(r,l.copy(o))}function iZ(n,e,t){if(t.openStart>n.depth)throw new Wp("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Wp("Inconsistent open depths");return wR(n,e,t,0)}function wR(n,e,t,i){let r=n.index(i),s=n.node(i);if(r==e.index(i)&&i<n.depth-t.openStart){let l=wR(n,e,t,i+1);return s.copy(s.content.replaceChild(r,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==i&&e.depth==i){let l=n.parent,o=l.content;return To(l,o.cut(0,n.parentOffset).append(t.content).append(o.cut(e.parentOffset)))}else{let{start:l,end:o}=rZ(t,n);return To(s,CR(n,l,o,e,i))}else return To(s,Gp(n,e,i))}function TR(n,e){if(!e.type.compatibleContent(n.type))throw new Wp("Cannot join "+e.type.name+" onto "+n.type.name)}function s1(n,e,t){let i=n.node(t);return TR(i,e.node(t)),i}function wo(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function nh(n,e,t,i){let r=(e||n).node(t),s=0,l=e?e.index(t):r.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(wo(n.nodeAfter,i),s++));for(let o=s;o<l;o++)wo(r.child(o),i);e&&e.depth==t&&e.textOffset&&wo(e.nodeBefore,i)}function To(n,e){return n.type.checkContent(e),n.copy(e)}function CR(n,e,t,i,r){let s=n.depth>r&&s1(n,e,r+1),l=i.depth>r&&s1(t,i,r+1),o=[];return nh(null,n,r,o),s&&l&&e.index(r)==t.index(r)?(TR(s,l),wo(To(s,CR(n,e,t,i,r+1)),o)):(s&&wo(To(s,Gp(n,e,r+1)),o),nh(e,t,r,o),l&&wo(To(l,Gp(t,i,r+1)),o)),nh(i,null,r,o),new ne(o)}function Gp(n,e,t){let i=[];if(nh(null,n,t,i),n.depth>t){let r=s1(n,e,t+1);wo(To(r,Gp(n,e,t+1)),i)}return nh(e,null,t,i),new ne(i)}function rZ(n,e){let t=e.depth-n.openStart,r=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)r=e.node(s).copy(ne.from(r));return{start:r.resolveNoCache(n.openStart+t),end:r.resolveNoCache(r.content.size-n.openEnd-t)}}class kh{constructor(e,t,i){this.pos=e,this.path=t,this.parentOffset=i,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 i=this.pos-this.path[this.path.length-1],r=e.child(t);return i?e.child(t).cut(i):r}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 i=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)r+=i.child(s).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return mt.none;if(this.textOffset)return e.child(t).marks;let i=e.maybeChild(t-1),r=e.maybeChild(t);if(!i){let o=i;i=r,r=o}let s=i.marks;for(var l=0;l<s.length;l++)s[l].type.spec.inclusive===!1&&(!r||!s[l].isInSet(r.marks))&&(s=s[l--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let i=t.marks,r=e.parent.maybeChild(e.index());for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let i=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);i>=0;i--)if(e.pos<=this.end(i)&&(!t||t(this.node(i))))return new Fp(this,e,i);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<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let i=[],r=0,s=t;for(let l=e;;){let{index:o,offset:c}=l.content.findIndex(s),h=s-c;if(i.push(l,o,r+c),!h||(l=l.child(o),l.isText))break;s=h-1,r+=c+1}return new kh(t,i,s)}static resolveCached(e,t){let i=bA.get(e);if(i)for(let s=0;s<i.elts.length;s++){let l=i.elts[s];if(l.pos==t)return l}else bA.set(e,i=new sZ);let r=i.elts[i.i]=kh.resolve(e,t);return i.i=(i.i+1)%lZ,r}}class sZ{constructor(){this.elts=[],this.i=0}}const lZ=12,bA=new WeakMap;class Fp{constructor(e,t,i){this.$from=e,this.$to=t,this.depth=i}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)}}const oZ=Object.create(null);let Cl=class l1{constructor(e,t,i,r=mt.none){this.type=e,this.attrs=t,this.marks=r,this.content=i||ne.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,i,r=0){this.content.nodesBetween(e,t,i,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,i,r){return this.content.textBetween(e,t,i,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,i){return this.type==e&&Up(this.attrs,t||e.defaultAttrs||oZ)&&mt.sameSet(this.marks,i||mt.none)}copy(e=null){return e==this.content?this:new l1(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new l1(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,i=!1){if(e==t)return pe.empty;let r=this.resolve(e),s=this.resolve(t),l=i?0:r.sharedDepth(t),o=r.start(l),h=r.node(l).content.cut(r.pos-o,s.pos-o);return new pe(h,r.depth-l,s.depth-l)}replace(e,t,i){return iZ(this.resolve(e),this.resolve(t),i)}nodeAt(e){for(let t=this;;){let{index:i,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(i),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:i}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:i}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:i}=this.content.findIndex(e);if(i<e)return{node:this.content.child(t),index:t,offset:i};let r=this.content.child(t-1);return{node:r,index:t-1,offset:i-r.nodeSize}}resolve(e){return kh.resolveCached(this,e)}resolveNoCache(e){return kh.resolve(this,e)}rangeHasMark(e,t,i){let r=!1;return t>e&&this.nodesBetween(e,t,s=>(i.isInSet(s.marks)&&(r=!0),!r)),r}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()+")"),AR(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,i=ne.empty,r=0,s=i.childCount){let l=this.contentMatchAt(e).matchFragment(i,r,s),o=l&&l.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let c=r;c<s;c++)if(!this.type.allowsMarks(i.child(c).marks))return!1;return!0}canReplaceWith(e,t,i,r){if(r&&!this.type.allowsMarks(r))return!1;let s=this.contentMatchAt(e).matchType(i),l=s&&s.matchFragment(this.content,t);return l?l.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=mt.none;for(let t=0;t<this.marks.length;t++){let i=this.marks[t];i.type.checkAttrs(i.attrs),e=i.addToSet(e)}if(!mt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.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 i;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");i=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,i)}let r=ne.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,r,i);return s.type.checkAttrs(s.attrs),s}};Cl.prototype.text=void 0;let aZ=class o1 extends Cl{constructor(e,t,i,r){if(super(e,t,null,r),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):AR(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 o1(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new o1(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 AR(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class $o{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let i=new cZ(e,t);if(i.next==null)return $o.empty;let r=MR(i);i.next&&i.err("Unexpected trailing text");let s=gZ(mZ(r));return OZ(s,i),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,i=e.childCount){let r=this;for(let s=t;r&&s<i;s++)r=r.matchType(e.child(s).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let i=0;i<e.next.length;i++)if(this.next[t].type==e.next[i].type)return!0;return!1}fillBefore(e,t=!1,i=0){let r=[this];function s(l,o){let c=l.matchFragment(e,i);if(c&&(!t||c.validEnd))return ne.from(o.map(h=>h.createAndFill()));for(let h=0;h<l.next.length;h++){let{type:d,next:p}=l.next[h];if(!(d.isText||d.hasRequiredAttrs())&&r.indexOf(p)==-1){r.push(p);let g=s(p,o.concat(d));if(g)return g}}return null}return s(this,[])}findWrapping(e){for(let i=0;i<this.wrapCache.length;i+=2)if(this.wrapCache[i]==e)return this.wrapCache[i+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),i=[{match:this,type:null,via:null}];for(;i.length;){let r=i.shift(),s=r.match;if(s.matchType(e)){let l=[];for(let o=r;o.type;o=o.via)l.push(o.type);return l.reverse()}for(let l=0;l<s.next.length;l++){let{type:o,next:c}=s.next[l];!o.isLeaf&&!o.hasRequiredAttrs()&&!(o.name in t)&&(!r.type||c.validEnd)&&(i.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=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(i){e.push(i);for(let r=0;r<i.next.length;r++)e.indexOf(i.next[r].next)==-1&&t(i.next[r].next)}return t(this),e.map((i,r)=>{let s=r+(i.validEnd?"*":" ")+" ";for(let l=0;l<i.next.length;l++)s+=(l?", ":"")+i.next[l].type.name+"->"+e.indexOf(i.next[l].next);return s}).join(`
|
|
58
|
+
`)}}$o.empty=new $o(!0);class cZ{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 MR(n){let e=[];do e.push(uZ(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function uZ(n){let e=[];do e.push(hZ(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function hZ(n){let e=pZ(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=fZ(n,e);else break;return e}function SA(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function fZ(n,e){let t=SA(n),i=t;return n.eat(",")&&(n.next!="}"?i=SA(n):i=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:i,expr:e}}function dZ(n,e){let t=n.nodeTypes,i=t[e];if(i)return[i];let r=[];for(let s in t){let l=t[s];l.isInGroup(e)&&r.push(l)}return r.length==0&&n.err("No node type or group '"+e+"' found"),r}function pZ(n){if(n.eat("(")){let e=MR(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=dZ(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function mZ(n){let e=[[]];return r(s(n,0),t()),e;function t(){return e.push([])-1}function i(l,o,c){let h={term:c,to:o};return e[l].push(h),h}function r(l,o){l.forEach(c=>c.to=o)}function s(l,o){if(l.type=="choice")return l.exprs.reduce((c,h)=>c.concat(s(h,o)),[]);if(l.type=="seq")for(let c=0;;c++){let h=s(l.exprs[c],o);if(c==l.exprs.length-1)return h;r(h,o=t())}else if(l.type=="star"){let c=t();return i(o,c),r(s(l.expr,c),c),[i(c)]}else if(l.type=="plus"){let c=t();return r(s(l.expr,o),c),r(s(l.expr,c),c),[i(c)]}else{if(l.type=="opt")return[i(o)].concat(s(l.expr,o));if(l.type=="range"){let c=o;for(let h=0;h<l.min;h++){let d=t();r(s(l.expr,c),d),c=d}if(l.max==-1)r(s(l.expr,c),c);else for(let h=l.min;h<l.max;h++){let d=t();i(c,d),r(s(l.expr,c),d),c=d}return[i(c)]}else{if(l.type=="name")return[i(o,void 0,l.value)];throw new Error("Unknown expr type")}}}}function QR(n,e){return e-n}function vA(n,e){let t=[];return i(e),t.sort(QR);function i(r){let s=n[r];if(s.length==1&&!s[0].term)return i(s[0].to);t.push(r);for(let l=0;l<s.length;l++){let{term:o,to:c}=s[l];!o&&t.indexOf(c)==-1&&i(c)}}}function gZ(n){let e=Object.create(null);return t(vA(n,0));function t(i){let r=[];i.forEach(l=>{n[l].forEach(({term:o,to:c})=>{if(!o)return;let h;for(let d=0;d<r.length;d++)r[d][0]==o&&(h=r[d][1]);vA(n,c).forEach(d=>{h||r.push([o,h=[]]),h.indexOf(d)==-1&&h.push(d)})})});let s=e[i.join(",")]=new $o(i.indexOf(n.length-1)>-1);for(let l=0;l<r.length;l++){let o=r[l][1].sort(QR);s.next.push({type:r[l][0],next:e[o.join(",")]||t(o)})}return s}}function OZ(n,e){for(let t=0,i=[n];t<i.length;t++){let r=i[t],s=!r.validEnd,l=[];for(let o=0;o<r.next.length;o++){let{type:c,next:h}=r.next[o];l.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),i.indexOf(h)==-1&&i.push(h)}s&&e.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ER(n){let e=Object.create(null);for(let t in n){let i=n[t];if(!i.hasDefault)return null;e[t]=i.default}return e}function $R(n,e){let t=Object.create(null);for(let i in n){let r=e&&e[i];if(r===void 0){let s=n[i];if(s.hasDefault)r=s.default;else throw new RangeError("No value supplied for attribute "+i)}t[i]=r}return t}function RR(n,e,t,i){for(let r in e)if(!(r in n))throw new RangeError(`Unsupported attribute ${r} for ${t} of type ${r}`);for(let r in n){let s=n[r];s.validate&&s.validate(e[r])}}function PR(n,e){let t=Object.create(null);if(e)for(let i in e)t[i]=new bZ(n,i,e[i]);return t}let xA=class DR{constructor(e,t,i){this.name=e,this.schema=t,this.spec=i,this.markSet=null,this.groups=i.group?i.group.split(" "):[],this.attrs=PR(e,i.attrs),this.defaultAttrs=ER(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(i.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==$o.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:$R(this.attrs,e)}create(e=null,t,i){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Cl(this,this.computeAttrs(e),ne.from(t),mt.setFrom(i))}createChecked(e=null,t,i){return t=ne.from(t),this.checkContent(t),new Cl(this,this.computeAttrs(e),t,mt.setFrom(i))}createAndFill(e=null,t,i){if(e=this.computeAttrs(e),t=ne.from(t),t.size){let l=this.contentMatch.fillBefore(t);if(!l)return null;t=l.append(t)}let r=this.contentMatch.matchFragment(t),s=r&&r.fillBefore(ne.empty,!0);return s?new Cl(this,e,t.append(s),mt.setFrom(i)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let i=0;i<e.childCount;i++)if(!this.allowsMarks(e.child(i).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){RR(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let i=0;i<e.length;i++)this.allowsMarkType(e[i].type)?t&&t.push(e[i]):t||(t=e.slice(0,i));return t?t.length?t:mt.none:e}static compile(e,t){let i=Object.create(null);e.forEach((s,l)=>i[s]=new DR(s,t,l));let r=t.spec.topNode||"doc";if(!i[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!i.text)throw new RangeError("Every schema needs a 'text' type");for(let s in i.text.attrs)throw new RangeError("The text node type should not have attributes");return i}};function yZ(n,e,t){let i=t.split("|");return r=>{let s=r===null?"null":typeof r;if(i.indexOf(s)<0)throw new RangeError(`Expected value of type ${i} for attribute ${e} on type ${n}, got ${s}`)}}let bZ=class{constructor(e,t,i){this.hasDefault=Object.prototype.hasOwnProperty.call(i,"default"),this.default=i.default,this.validate=typeof i.validate=="string"?yZ(e,t,i.validate):i.validate}get isRequired(){return!this.hasDefault}};class xg{constructor(e,t,i,r){this.name=e,this.rank=t,this.schema=i,this.spec=r,this.attrs=PR(e,r.attrs),this.excluded=null;let s=ER(this.attrs);this.instance=s?new mt(this,s):null}create(e=null){return!e&&this.instance?this.instance:new mt(this,$R(this.attrs,e))}static compile(e,t){let i=Object.create(null),r=0;return e.forEach((s,l)=>i[s]=new xg(s,r++,t,l)),i}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){RR(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}let NR=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=fn.from(e.nodes),t.marks=fn.from(e.marks||{}),this.nodes=xA.compile(this.spec.nodes,this),this.marks=xg.compile(this.spec.marks,this);let i=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let s=this.nodes[r],l=s.spec.content||"",o=s.spec.marks;if(s.contentMatch=i[l]||(i[l]=$o.parse(l,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=o=="_"?null:o?kA(this,o.split(" ")):o==""||!s.inlineContent?[]:null}for(let r in this.marks){let s=this.marks[r],l=s.spec.excludes;s.excluded=l==null?[s]:l==""?[]:kA(this,l.split(" "))}this.nodeFromJSON=r=>Cl.fromJSON(this,r),this.markFromJSON=r=>mt.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,i,r){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof xA){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,i,r)}text(e,t){let i=this.nodes.text;return new aZ(i,i.defaultAttrs,e,mt.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}};function kA(n,e){let t=[];for(let i=0;i<e.length;i++){let r=e[i],s=n.marks[r],l=s;if(s)t.push(s);else for(let o in n.marks){let c=n.marks[o];(r=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(r)>-1)&&t.push(l=c)}if(!l)throw new SyntaxError("Unknown mark type: '"+e[i]+"'")}return t}function SZ(n){return n.tag!=null}function vZ(n){return n.style!=null}class Al{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let i=this.matchedStyles=[];t.forEach(r=>{if(SZ(r))this.tags.push(r);else if(vZ(r)){let s=/[^=]*/.exec(r.style)[0];i.indexOf(s)<0&&i.push(s),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let s=e.nodes[r.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let i=new TA(this,t,!1);return i.addAll(e,mt.none,t.from,t.to),i.finish()}parseSlice(e,t={}){let i=new TA(this,t,!0);return i.addAll(e,mt.none,t.from,t.to),pe.maxOpen(i.finish())}matchTag(e,t,i){for(let r=i?this.tags.indexOf(i)+1:0;r<this.tags.length;r++){let s=this.tags[r];if(wZ(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let l=s.getAttrs(e);if(l===!1)continue;s.attrs=l||void 0}return s}}}matchStyle(e,t,i,r){for(let s=r?this.styles.indexOf(r)+1:0;s<this.styles.length;s++){let l=this.styles[s],o=l.style;if(!(o.indexOf(e)!=0||l.context&&!i.matchesContext(l.context)||o.length>e.length&&(o.charCodeAt(e.length)!=61||o.slice(e.length+1)!=t))){if(l.getAttrs){let c=l.getAttrs(t);if(c===!1)continue;l.attrs=c||void 0}return l}}}static schemaRules(e){let t=[];function i(r){let s=r.priority==null?50:r.priority,l=0;for(;l<t.length;l++){let o=t[l];if((o.priority==null?50:o.priority)<s)break}t.splice(l,0,r)}for(let r in e.marks){let s=e.marks[r].spec.parseDOM;s&&s.forEach(l=>{i(l=CA(l)),l.mark||l.ignore||l.clearMark||(l.mark=r)})}for(let r in e.nodes){let s=e.nodes[r].spec.parseDOM;s&&s.forEach(l=>{i(l=CA(l)),l.node||l.ignore||l.mark||(l.node=r)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Al(e,Al.schemaRules(e)))}}const zR={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},xZ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},LR={ol:!0,ul:!0},wh=1,a1=2,ih=4;function wA(n,e,t){return e!=null?(e?wh:0)|(e==="full"?a1:0):n&&n.whitespace=="pre"?wh|a1:t&~ih}class Zd{constructor(e,t,i,r,s,l){this.type=e,this.attrs=t,this.marks=i,this.solid=r,this.options=l,this.content=[],this.activeMarks=mt.none,this.match=s||(l&ih?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ne.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let i=this.type.contentMatch,r;return(r=i.findWrapping(e.type))?(this.match=i,r):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&wh)){let i=this.content[this.content.length-1],r;if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-r[0].length))}}let t=ne.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ne.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!zR.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}let TA=class{constructor(e,t,i){this.parser=e,this.options=t,this.isOpen=i,this.open=0,this.localPreserveWS=!1;let r=t.topNode,s,l=wA(null,t.preserveWhitespace,0)|(i?ih:0);r?s=new Zd(r.type,r.attrs,mt.none,!0,t.topMatch||r.type.contentMatch,l):i?s=new Zd(null,null,mt.none,!0,null,l):s=new Zd(e.schema.topNodeType,null,mt.none,!0,null,l),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let i=e.nodeValue,r=this.top,s=r.options&a1?"full":this.localPreserveWS||(r.options&wh)>0,{schema:l}=this.parser;if(s==="full"||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(i)){if(s)if(s==="full")i=i.replace(/\r\n?/g,`
|
|
59
|
+
`);else if(l.linebreakReplacement&&/[\r\n]/.test(i)&&this.top.findWrapping(l.linebreakReplacement.create())){let o=i.split(/\r?\n|\r/);for(let c=0;c<o.length;c++)c&&this.insertNode(l.linebreakReplacement.create(),t,!0),o[c]&&this.insertNode(l.text(o[c]),t,!/\S/.test(o[c]));i=""}else i=i.replace(/\r?\n|\r/g," ");else if(i=i.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(i)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],c=e.previousSibling;(!o||c&&c.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(i=i.slice(1))}i&&this.insertNode(l.text(i),t,!/\S/.test(i)),this.findInText(e)}else this.findInside(e)}addElement(e,t,i){let r=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let l=e.nodeName.toLowerCase(),o;LR.hasOwnProperty(l)&&this.parser.normalizeLists&&kZ(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,i));e:if(c?c.ignore:xZ.hasOwnProperty(l))this.findInside(e),this.ignoreFallback(e,t);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let h,d=this.needsBlock;if(zR.hasOwnProperty(l))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),h=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let p=c&&c.skip?t:this.readStyles(e,t);p&&this.addAll(e,p),h&&this.sync(s),this.needsBlock=d}else{let h=this.readStyles(e,t);h&&this.addElementByRule(e,c,h,c.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
60
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let i=e.style;if(i&&i.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let s=this.parser.matchedStyles[r],l=i.getPropertyValue(s);if(l)for(let o=void 0;;){let c=this.parser.matchStyle(s,l,this,o);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(h=>!c.clearMark(h)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)o=c;else break}}return t}addElementByRule(e,t,i,r){let s,l;if(t.node)if(l=this.parser.schema.nodes[t.node],l.isLeaf)this.insertNode(l.create(t.attrs),i,e.nodeName=="BR")||this.leafFallback(e,i);else{let c=this.enter(l,t.attrs||null,i,t.preserveWhitespace);c&&(s=!0,i=c)}else{let c=this.parser.schema.marks[t.mark];i=i.concat(c.create(t.attrs))}let o=this.top;if(l&&l.isLeaf)this.findInside(e);else if(r)this.addElement(e,i,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,i,!1));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,i),this.findAround(e,c,!1)}s&&this.sync(o)&&this.open--}addAll(e,t,i,r){let s=i||0;for(let l=i?e.childNodes[i]:e.firstChild,o=r==null?null:e.childNodes[r];l!=o;l=l.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(l,t);this.findAtPoint(e,s)}findPlace(e,t,i){let r,s;for(let l=this.open,o=0;l>=0;l--){let c=this.nodes[l],h=c.findWrapping(e);if(h&&(!r||r.length>h.length+o)&&(r=h,s=c,!h.length))break;if(c.solid){if(i)break;o+=2}}if(!r)return null;this.sync(s);for(let l=0;l<r.length;l++)t=this.enterInner(r[l],null,t,!1);return t}insertNode(e,t,i){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let r=this.findPlace(e,t,i);if(r){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let l=mt.none;for(let o of r.concat(e.marks))(s.type?s.type.allowsMarkType(o.type):AA(o.type,e.type))&&(l=o.addToSet(l));return s.content.push(e.mark(l)),!0}return!1}enter(e,t,i,r){let s=this.findPlace(e.create(t),i,!1);return s&&(s=this.enterInner(e,t,i,!0,r)),s}enterInner(e,t,i,r=!1,s){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(e);let o=wA(e,s,l.options);l.options&ih&&l.content.length==0&&(o|=ih);let c=mt.none;return i=i.filter(h=>(l.type?l.type.allowsMarkType(h.type):AA(h.type,e))?(c=h.addToSet(c),!1):!0),this.nodes.push(new Zd(e,t,c,r,null,o)),this.open++,i}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.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;this.localPreserveWS&&(this.nodes[t].options|=wh)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let i=this.nodes[t].content;for(let r=i.length-1;r>=0;r--)e+=i[r].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let i=0;i<this.find.length;i++)this.find[i].node==e&&this.find[i].offset==t&&(this.find[i].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,i){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(i?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),i=this.options.context,r=!this.isOpen&&(!i||i.parent.type==this.nodes[0].type),s=-(i?i.depth+1:0)+(r?0:1),l=(o,c)=>{for(;o>=0;o--){let h=t[o];if(h==""){if(o==t.length-1||o==0)continue;for(;c>=s;c--)if(l(o-1,c))return!0;return!1}else{let d=c>0||c==0&&r?this.nodes[c].type:i&&c>=s?i.node(c-s).type:null;if(!d||d.name!=h&&!d.isInGroup(h))return!1;c--}}return!0};return l(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(i&&i.isTextblock&&i.defaultAttrs)return i}for(let t in this.parser.schema.nodes){let i=this.parser.schema.nodes[t];if(i.isTextblock&&i.defaultAttrs)return i}}};function kZ(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let i=e.nodeType==1?e.nodeName.toLowerCase():null;i&&LR.hasOwnProperty(i)&&t?(t.appendChild(e),e=t):i=="li"?t=e:i&&(t=null)}}function wZ(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function CA(n){let e={};for(let t in n)e[t]=n[t];return e}function AA(n,e){let t=e.schema.nodes;for(let i in t){let r=t[i];if(!r.allowsMarkType(n))continue;let s=[],l=o=>{s.push(o);for(let c=0;c<o.edgeCount;c++){let{type:h,next:d}=o.edge(c);if(h==e||s.indexOf(d)<0&&l(d))return!0}};if(l(r.contentMatch))return!0}}class Io{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},i){i||(i=Qy(t).createDocumentFragment());let r=i,s=[];return e.forEach(l=>{if(s.length||l.marks.length){let o=0,c=0;for(;o<s.length&&c<l.marks.length;){let h=l.marks[c];if(!this.marks[h.type.name]){c++;continue}if(!h.eq(s[o][0])||h.type.spec.spanning===!1)break;o++,c++}for(;o<s.length;)r=s.pop()[1];for(;c<l.marks.length;){let h=l.marks[c++],d=this.serializeMark(h,l.isInline,t);d&&(s.push([h,r]),r.appendChild(d.dom),r=d.contentDOM||d.dom)}}r.appendChild(this.serializeNodeInner(l,t))}),i}serializeNodeInner(e,t){let{dom:i,contentDOM:r}=Mp(Qy(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return i}serializeNode(e,t={}){let i=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let s=this.serializeMark(e.marks[r],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(i),i=s.dom)}return i}serializeMark(e,t,i={}){let r=this.marks[e.type.name];return r&&Mp(Qy(i),r(e,t),null,e.attrs)}static renderSpec(e,t,i=null,r){return Mp(e,t,i,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Io(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=MA(e.nodes);return t.text||(t.text=i=>i.text),t}static marksFromSchema(e){return MA(e.marks)}}function MA(n){let e={};for(let t in n){let i=n[t].spec.toDOM;i&&(e[t]=i)}return e}function Qy(n){return n.document||window.document}const QA=new WeakMap;function TZ(n){let e=QA.get(n);return e===void 0&&QA.set(n,e=CZ(n)),e}function CZ(n){let e=null;function t(i){if(i&&typeof i=="object")if(Array.isArray(i))if(typeof i[0]=="string")e||(e=[]),e.push(i);else for(let r=0;r<i.length;r++)t(i[r]);else for(let r in i)t(i[r])}return t(n),e}function Mp(n,e,t,i){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let r=e[0],s;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(i&&(s=TZ(i))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let l=r.indexOf(" ");l>0&&(t=r.slice(0,l),r=r.slice(l+1));let o,c=t?n.createElementNS(t,r):n.createElement(r),h=e[1],d=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){d=2;for(let p in h)if(h[p]!=null){let g=p.indexOf(" ");g>0?c.setAttributeNS(p.slice(0,g),p.slice(g+1),h[p]):p=="style"&&c.style?c.style.cssText=h[p]:c.setAttribute(p,h[p])}}for(let p=d;p<e.length;p++){let g=e[p];if(g===0){if(p<e.length-1||p>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:O,contentDOM:b}=Mp(n,g,t,i);if(c.appendChild(O),b){if(o)throw new RangeError("Multiple content holes");o=b}}}return{dom:c,contentDOM:o}}const _R=65535,BR=Math.pow(2,16);function AZ(n,e){return n+e*BR}function EA(n){return n&_R}function MZ(n){return(n-(n&_R))/BR}const ZR=1,jR=2,Qp=4,XR=8;class c1{constructor(e,t,i){this.pos=e,this.delInfo=t,this.recover=i}get deleted(){return(this.delInfo&XR)>0}get deletedBefore(){return(this.delInfo&(ZR|Qp))>0}get deletedAfter(){return(this.delInfo&(jR|Qp))>0}get deletedAcross(){return(this.delInfo&Qp)>0}}class yi{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&yi.empty)return yi.empty}recover(e){let t=0,i=EA(e);if(!this.inverted)for(let r=0;r<i;r++)t+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[i*3]+t+MZ(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,i){let r=0,s=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?r:0);if(c>e)break;let h=this.ranges[o+s],d=this.ranges[o+l],p=c+h;if(e<=p){let g=h?e==c?-1:e==p?1:t:t,O=c+r+(g<0?0:d);if(i)return O;let b=e==(t<0?c:p)?null:AZ(o/3,e-c),v=e==c?jR:e==p?ZR:Qp;return(t<0?e!=c:e!=p)&&(v|=XR),new c1(O,v,b)}r+=d-h}return i?e+r:new c1(e+r,0,null)}touches(e,t){let i=0,r=EA(t),s=this.inverted?2:1,l=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let c=this.ranges[o]-(this.inverted?i:0);if(c>e)break;let h=this.ranges[o+s],d=c+h;if(e<=d&&o==r*3)return!0;i+=this.ranges[o+l]-h}return!1}forEach(e){let t=this.inverted?2:1,i=this.inverted?1:2;for(let r=0,s=0;r<this.ranges.length;r+=3){let l=this.ranges[r],o=l-(this.inverted?s:0),c=l+(this.inverted?0:s),h=this.ranges[r+t],d=this.ranges[r+i];e(o,o+h,c,c+d),s+=d-h}}invert(){return new yi(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?yi.empty:new yi(e<0?[0,-e,0]:[0,0,e])}}yi.empty=new yi([]);class Th{constructor(e,t,i=0,r=e?e.length:0){this.mirror=t,this.from=i,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Th(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,i=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?i+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,i=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?i-r-1:void 0)}}invert(){let e=new Th;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let i=this.from;i<this.to;i++)e=this._maps[i].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,i){let r=0;for(let s=this.from;s<this.to;s++){let l=this._maps[s],o=l.mapResult(e,t);if(o.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this._maps[c].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return i?e:new c1(e,r,null)}}const Ey=Object.create(null);class An{getMap(){return yi.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let i=Ey[t.stepType];if(!i)throw new RangeError(`No step type ${t.stepType} defined`);return i.fromJSON(e,t)}static jsonID(e,t){if(e in Ey)throw new RangeError("Duplicate use of step JSON ID "+e);return Ey[e]=t,t.prototype.jsonID=e,t}}class Ht{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ht(e,null)}static fail(e){return new Ht(null,e)}static fromReplace(e,t,i,r){try{return Ht.ok(e.replace(t,i,r))}catch(s){if(s instanceof Wp)return Ht.fail(s.message);throw s}}}function JS(n,e,t){let i=[];for(let r=0;r<n.childCount;r++){let s=n.child(r);s.content.size&&(s=s.copy(JS(s.content,e,s))),s.isInline&&(s=e(s,t,r)),i.push(s)}return ne.fromArray(i)}class xl extends An{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=e.resolve(this.from),r=i.node(i.sharedDepth(this.to)),s=new pe(JS(t.content,(l,o)=>!l.isAtom||!o.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),r),t.openStart,t.openEnd);return Ht.fromReplace(e,this.from,this.to,s)}invert(){return new nr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new xl(t.pos,i.pos,this.mark)}merge(e){return e instanceof xl&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xl(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 xl(t.from,t.to,e.markFromJSON(t.mark))}}An.jsonID("addMark",xl);class nr extends An{constructor(e,t,i){super(),this.from=e,this.to=t,this.mark=i}apply(e){let t=e.slice(this.from,this.to),i=new pe(JS(t.content,r=>r.mark(this.mark.removeFromSet(r.marks)),e),t.openStart,t.openEnd);return Ht.fromReplace(e,this.from,this.to,i)}invert(){return new xl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return t.deleted&&i.deleted||t.pos>=i.pos?null:new nr(t.pos,i.pos,this.mark)}merge(e){return e instanceof nr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nr(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 nr(t.from,t.to,e.markFromJSON(t.mark))}}An.jsonID("removeMark",nr);class kl extends An{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ht.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new pe(ne.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let i=this.mark.addToSet(t.marks);if(i.length==t.marks.length){for(let r=0;r<t.marks.length;r++)if(!t.marks[r].isInSet(i))return new kl(this.pos,t.marks[r]);return new kl(this.pos,this.mark)}}return new Ro(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new kl(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new kl(t.pos,e.markFromJSON(t.mark))}}An.jsonID("addNodeMark",kl);class Ro extends An{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ht.fail("No node at mark step's position");let i=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new pe(ne.from(i),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new kl(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ro(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ro(t.pos,e.markFromJSON(t.mark))}}An.jsonID("removeNodeMark",Ro);class qt extends An{constructor(e,t,i,r=!1){super(),this.from=e,this.to=t,this.slice=i,this.structure=r}apply(e){return this.structure&&u1(e,this.from,this.to)?Ht.fail("Structure replace would overwrite content"):Ht.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new yi([this.from,this.to-this.from,this.slice.size])}invert(e){return new qt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),i=this.from==this.to&&qt.MAP_BIAS<0?t:e.mapResult(this.from,1);return i.deletedAcross&&t.deletedAcross?null:new qt(i.pos,Math.max(i.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof qt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?pe.empty:new pe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new qt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?pe.empty:new pe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new qt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};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")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new qt(t.from,t.to,pe.fromJSON(e,t.slice),!!t.structure)}}qt.MAP_BIAS=1;An.jsonID("replace",qt);class rn extends An{constructor(e,t,i,r,s,l,o=!1){super(),this.from=e,this.to=t,this.gapFrom=i,this.gapTo=r,this.slice=s,this.insert=l,this.structure=o}apply(e){if(this.structure&&(u1(e,this.from,this.gapFrom)||u1(e,this.gapTo,this.to)))return Ht.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ht.fail("Gap is not a flat range");let i=this.slice.insertAt(this.insert,t.content);return i?Ht.fromReplace(e,this.from,this.to,i):Ht.fail("Content does not fit in gap")}getMap(){return new yi([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new rn(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?i.pos:e.map(this.gapTo,1);return t.deletedAcross&&i.deletedAcross||r<t.pos||s>i.pos?null:new rn(t.pos,i.pos,r,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 rn(t.from,t.to,t.gapFrom,t.gapTo,pe.fromJSON(e,t.slice),t.insert,!!t.structure)}}An.jsonID("replaceAround",rn);function u1(n,e,t){let i=n.resolve(e),r=t-e,s=i.depth;for(;r>0&&s>0&&i.indexAfter(s)==i.node(s).childCount;)s--,r--;if(r>0){let l=i.node(s).maybeChild(i.indexAfter(s));for(;r>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,r--}}return!1}function QZ(n,e,t,i){let r=[],s=[],l,o;n.doc.nodesBetween(e,t,(c,h,d)=>{if(!c.isInline)return;let p=c.marks;if(!i.isInSet(p)&&d.type.allowsMarkType(i.type)){let g=Math.max(h,e),O=Math.min(h+c.nodeSize,t),b=i.addToSet(p);for(let v=0;v<p.length;v++)p[v].isInSet(b)||(l&&l.to==g&&l.mark.eq(p[v])?l.to=O:r.push(l=new nr(g,O,p[v])));o&&o.to==g?o.to=O:s.push(o=new xl(g,O,i))}}),r.forEach(c=>n.step(c)),s.forEach(c=>n.step(c))}function EZ(n,e,t,i){let r=[],s=0;n.doc.nodesBetween(e,t,(l,o)=>{if(!l.isInline)return;s++;let c=null;if(i instanceof xg){let h=l.marks,d;for(;d=i.isInSet(h);)(c||(c=[])).push(d),h=d.removeFromSet(h)}else i?i.isInSet(l.marks)&&(c=[i]):c=l.marks;if(c&&c.length){let h=Math.min(o+l.nodeSize,t);for(let d=0;d<c.length;d++){let p=c[d],g;for(let O=0;O<r.length;O++){let b=r[O];b.step==s-1&&p.eq(r[O].style)&&(g=b)}g?(g.to=h,g.step=s):r.push({style:p,from:Math.max(o,e),to:h,step:s})}}}),r.forEach(l=>n.step(new nr(l.from,l.to,l.style)))}function ev(n,e,t,i=t.contentMatch,r=!0){let s=n.doc.nodeAt(e),l=[],o=e+1;for(let c=0;c<s.childCount;c++){let h=s.child(c),d=o+h.nodeSize,p=i.matchType(h.type);if(!p)l.push(new qt(o,d,pe.empty));else{i=p;for(let g=0;g<h.marks.length;g++)t.allowsMarkType(h.marks[g].type)||n.step(new nr(o,d,h.marks[g]));if(r&&h.isText&&t.whitespace!="pre"){let g,O=/\r?\n|\r/g,b;for(;g=O.exec(h.text);)b||(b=new pe(ne.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),l.push(new qt(o+g.index,o+g.index+g[0].length,b))}}o=d}if(!i.validEnd){let c=i.fillBefore(ne.empty,!0);n.replace(o,o,new pe(c,0,0))}for(let c=l.length-1;c>=0;c--)n.step(l[c])}function $Z(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Tc(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let i=n.depth,r=0,s=0;;--i){let l=n.$from.node(i),o=n.$from.index(i)+r,c=n.$to.indexAfter(i)-s;if(i<n.depth&&l.canReplace(o,c,t))return i;if(i==0||l.type.spec.isolating||!$Z(l,o,c))break;o&&(r=1),c<l.childCount&&(s=1)}return null}function RZ(n,e,t){let{$from:i,$to:r,depth:s}=e,l=i.before(s+1),o=r.after(s+1),c=l,h=o,d=ne.empty,p=0;for(let b=s,v=!1;b>t;b--)v||i.index(b)>0?(v=!0,d=ne.from(i.node(b).copy(d)),p++):c--;let g=ne.empty,O=0;for(let b=s,v=!1;b>t;b--)v||r.after(b+1)<r.end(b)?(v=!0,g=ne.from(r.node(b).copy(g)),O++):h++;n.step(new rn(c,h,l,o,new pe(d.append(g),p,O),d.size-p,!0))}function tv(n,e,t=null,i=n){let r=PZ(n,e),s=r&&DZ(i,e);return s?r.map($A).concat({type:e,attrs:t}).concat(s.map($A)):null}function $A(n){return{type:n,attrs:null}}function PZ(n,e){let{parent:t,startIndex:i,endIndex:r}=n,s=t.contentMatchAt(i).findWrapping(e);if(!s)return null;let l=s.length?s[0]:e;return t.canReplaceWith(i,r,l)?s:null}function DZ(n,e){let{parent:t,startIndex:i,endIndex:r}=n,s=t.child(i),l=e.contentMatch.findWrapping(s.type);if(!l)return null;let c=(l.length?l[l.length-1]:e).contentMatch;for(let h=i;c&&h<r;h++)c=c.matchType(t.child(h).type);return!c||!c.validEnd?null:l}function NZ(n,e,t){let i=ne.empty;for(let l=t.length-1;l>=0;l--){if(i.size){let o=t[l].type.contentMatch.matchFragment(i);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}i=ne.from(t[l].type.create(t[l].attrs,i))}let r=e.start,s=e.end;n.step(new rn(r,s,r,s,new pe(i,0,0),t.length,!0))}function zZ(n,e,t,i,r){if(!i.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(l,o)=>{let c=typeof r=="function"?r(l):r;if(l.isTextblock&&!l.hasMarkup(i,c)&&LZ(n.doc,n.mapping.slice(s).map(o),i)){let h=null;if(i.schema.linebreakReplacement){let O=i.whitespace=="pre",b=!!i.contentMatch.matchType(i.schema.linebreakReplacement);O&&!b?h=!1:!O&&b&&(h=!0)}h===!1&&VR(n,l,o,s),ev(n,n.mapping.slice(s).map(o,1),i,void 0,h===null);let d=n.mapping.slice(s),p=d.map(o,1),g=d.map(o+l.nodeSize,1);return n.step(new rn(p,g,p+1,g-1,new pe(ne.from(i.create(c,null,l.marks)),0,0),1,!0)),h===!0&&IR(n,l,o,s),!1}})}function IR(n,e,t,i){e.forEach((r,s)=>{if(r.isText){let l,o=/\r?\n|\r/g;for(;l=o.exec(r.text);){let c=n.mapping.slice(i).map(t+1+s+l.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function VR(n,e,t,i){e.forEach((r,s)=>{if(r.type==r.type.schema.linebreakReplacement){let l=n.mapping.slice(i).map(t+1+s);n.replaceWith(l,l+1,e.type.schema.text(`
|
|
61
|
+
`))}})}function LZ(n,e,t){let i=n.resolve(e),r=i.index();return i.parent.canReplaceWith(r,r+1,t)}function _Z(n,e,t,i,r){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let l=t.create(i,null,r||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,l);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new rn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new pe(ne.from(l),0,0),1,!0))}function Cs(n,e,t=1,i){let r=n.resolve(e),s=r.depth-t,l=i&&i[i.length-1]||r.parent;if(s<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!l.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let h=r.depth-1,d=t-2;h>s;h--,d--){let p=r.node(h),g=r.index(h);if(p.type.spec.isolating)return!1;let O=p.content.cutByIndex(g,p.childCount),b=i&&i[d+1];b&&(O=O.replaceChild(0,b.type.create(b.attrs)));let v=i&&i[d]||p;if(!p.canReplace(g+1,p.childCount)||!v.type.validContent(O))return!1}let o=r.indexAfter(s),c=i&&i[0];return r.node(s).canReplaceWith(o,o,c?c.type:r.node(s+1).type)}function BZ(n,e,t=1,i){let r=n.doc.resolve(e),s=ne.empty,l=ne.empty;for(let o=r.depth,c=r.depth-t,h=t-1;o>c;o--,h--){s=ne.from(r.node(o).copy(s));let d=i&&i[h];l=ne.from(d?d.type.create(d.attrs,l):r.node(o).copy(l))}n.step(new qt(e,e,new pe(s.append(l),t,t),!0))}function Zl(n,e){let t=n.resolve(e),i=t.index();return qR(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(i,i+1)}function ZZ(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:i}=n.type.schema;for(let r=0;r<e.childCount;r++){let s=e.child(r),l=s.type==i?n.type.schema.nodes.text:s.type;if(t=t.matchType(l),!t||!n.type.allowsMarks(s.marks))return!1}return t.validEnd}function qR(n,e){return!!(n&&e&&!n.isLeaf&&ZZ(n,e))}function kg(n,e,t=-1){let i=n.resolve(e);for(let r=i.depth;;r--){let s,l,o=i.index(r);if(r==i.depth?(s=i.nodeBefore,l=i.nodeAfter):t>0?(s=i.node(r+1),o++,l=i.node(r).maybeChild(o)):(s=i.node(r).maybeChild(o-1),l=i.node(r+1)),s&&!s.isTextblock&&qR(s,l)&&i.node(r).canReplace(o,o+1))return e;if(r==0)break;e=t<0?i.before(r):i.after(r)}}function jZ(n,e,t){let i=null,{linebreakReplacement:r}=n.doc.type.schema,s=n.doc.resolve(e-t),l=s.node().type;if(r&&l.inlineContent){let d=l.whitespace=="pre",p=!!l.contentMatch.matchType(r);d&&!p?i=!1:!d&&p&&(i=!0)}let o=n.steps.length;if(i===!1){let d=n.doc.resolve(e+t);VR(n,d.node(),d.before(),o)}l.inlineContent&&ev(n,e+t-1,l,s.node().contentMatchAt(s.index()),i==null);let c=n.mapping.slice(o),h=c.map(e-t);if(n.step(new qt(h,c.map(e+t,-1),pe.empty,!0)),i===!0){let d=n.doc.resolve(h);IR(n,d.node(),d.before(),n.steps.length)}return n}function XZ(n,e,t){let i=n.resolve(e);if(i.parent.canReplaceWith(i.index(),i.index(),t))return e;if(i.parentOffset==0)for(let r=i.depth-1;r>=0;r--){let s=i.index(r);if(i.node(r).canReplaceWith(s,s,t))return i.before(r+1);if(s>0)return null}if(i.parentOffset==i.parent.content.size)for(let r=i.depth-1;r>=0;r--){let s=i.indexAfter(r);if(i.node(r).canReplaceWith(s,s,t))return i.after(r+1);if(s<i.node(r).childCount)return null}return null}function HR(n,e,t){let i=n.resolve(e);if(!t.content.size)return e;let r=t.content;for(let s=0;s<t.openStart;s++)r=r.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let l=i.depth;l>=0;l--){let o=l==i.depth?0:i.pos<=(i.start(l+1)+i.end(l+1))/2?-1:1,c=i.index(l)+(o>0?1:0),h=i.node(l),d=!1;if(s==1)d=h.canReplace(c,c,r);else{let p=h.contentMatchAt(c).findWrapping(r.firstChild.type);d=p&&h.canReplaceWith(c,c,p[0])}if(d)return o==0?i.pos:o<0?i.before(l+1):i.after(l+1)}return null}function wg(n,e,t=e,i=pe.empty){if(e==t&&!i.size)return null;let r=n.resolve(e),s=n.resolve(t);return YR(r,s,i)?new qt(e,t,i):new IZ(r,s,i).fit()}function YR(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class IZ{constructor(e,t,i){this.$from=e,this.$to=t,this.unplaced=i,this.frontier=[],this.placed=ne.empty;for(let r=0;r<=e.depth;r++){let s=e.node(r);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=ne.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,i=this.$from,r=this.close(e<0?this.$to:i.doc.resolve(e));if(!r)return null;let s=this.placed,l=i.depth,o=r.depth;for(;l&&o&&s.childCount==1;)s=s.firstChild.content,l--,o--;let c=new pe(s,l,o);return e>-1?new rn(i.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||i.pos!=this.$to.pos?new qt(i.pos,r.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,i=0,r=this.unplaced.openEnd;i<e;i++){let s=t.firstChild;if(t.childCount>1&&(r=0),s.type.spec.isolating&&r<=i){e=i;break}t=s.content}for(let t=1;t<=2;t++)for(let i=t==1?e:this.unplaced.openStart;i>=0;i--){let r,s=null;i?(s=$y(this.unplaced.content,i-1).firstChild,r=s.content):r=this.unplaced.content;let l=r.firstChild;for(let o=this.depth;o>=0;o--){let{type:c,match:h}=this.frontier[o],d,p=null;if(t==1&&(l?h.matchType(l.type)||(p=h.fillBefore(ne.from(l),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:i,frontierDepth:o,parent:s,inject:p};if(t==2&&l&&(d=h.findWrapping(l.type)))return{sliceDepth:i,frontierDepth:o,parent:s,wrap:d};if(s&&h.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:i}=this.unplaced,r=$y(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new pe(e,t+1,Math.max(i,r.size+t>=e.size-i?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:i}=this.unplaced,r=$y(e,t);if(r.childCount<=1&&t>0){let s=e.size-t<=t+r.size;this.unplaced=new pe(Vu(e,t-1,1),t-1,s?t-1:i)}else this.unplaced=new pe(Vu(e,t,1),t,i)}placeNodes({sliceDepth:e,frontierDepth:t,parent:i,inject:r,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let v=0;v<s.length;v++)this.openFrontierNode(s[v]);let l=this.unplaced,o=i?i.content:l.content,c=l.openStart-e,h=0,d=[],{match:p,type:g}=this.frontier[t];if(r){for(let v=0;v<r.childCount;v++)d.push(r.child(v));p=p.matchFragment(r)}let O=o.size+e-(l.content.size-l.openEnd);for(;h<o.childCount;){let v=o.child(h),x=p.matchType(v.type);if(!x)break;h++,(h>1||c==0||v.content.size)&&(p=x,d.push(UR(v.mark(g.allowedMarks(v.marks)),h==1?c:0,h==o.childCount?O:-1)))}let b=h==o.childCount;b||(O=-1),this.placed=qu(this.placed,t,ne.from(d)),this.frontier[t].match=p,b&&O<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,x=o;v<O;v++){let k=x.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),x=k.content}this.unplaced=b?e==0?pe.empty:new pe(Vu(l.content,e-1,1),e-1,O<0?l.openEnd:e-1):new pe(Vu(l.content,e,h),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Ry(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:i}=this.$to,r=this.$to.after(i);for(;i>1&&r==this.$to.end(--i);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:i,type:r}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),l=Ry(e,t,r,i,s);if(l){for(let o=t-1;o>=0;o--){let{match:c,type:h}=this.frontier[o],d=Ry(e,o,h,c,!0);if(!d||d.childCount)continue e}return{depth:t,fit:l,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=qu(this.placed,t.depth,t.fit)),e=t.move;for(let i=t.depth+1;i<=e.depth;i++){let r=e.node(i),s=r.type.contentMatch.fillBefore(r.content,!0,e.index(i));this.openFrontierNode(r.type,r.attrs,s)}return e}openFrontierNode(e,t=null,i){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=qu(this.placed,this.depth,ne.from(e.create(t,i))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ne.empty,!0);t.childCount&&(this.placed=qu(this.placed,this.frontier.length,t))}}function Vu(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Vu(n.firstChild.content,e-1,t)))}function qu(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(qu(n.lastChild.content,e-1,t)))}function $y(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function UR(n,e,t){if(e<=0)return n;let i=n.content;return e>1&&(i=i.replaceChild(0,UR(i.firstChild,e-1,i.childCount==1?t-1:0))),e>0&&(i=n.type.contentMatch.fillBefore(i).append(i),t<=0&&(i=i.append(n.type.contentMatch.matchFragment(i).fillBefore(ne.empty,!0)))),n.copy(i)}function Ry(n,e,t,i,r){let s=n.node(e),l=r?n.indexAfter(e):n.index(e);if(l==s.childCount&&!t.compatibleContent(s.type))return null;let o=i.fillBefore(s.content,!0,l);return o&&!VZ(t,s.content,l)?o:null}function VZ(n,e,t){for(let i=t;i<e.childCount;i++)if(!n.allowsMarks(e.child(i).marks))return!0;return!1}function qZ(n){return n.spec.defining||n.spec.definingForContent}function HZ(n,e,t,i){if(!i.size)return n.deleteRange(e,t);let r=n.doc.resolve(e),s=n.doc.resolve(t);if(YR(r,s,i))return n.step(new qt(e,t,i));let l=GR(r,s);l[l.length-1]==0&&l.pop();let o=-(r.depth+1);l.unshift(o);for(let g=r.depth,O=r.pos-1;g>0;g--,O--){let b=r.node(g).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;l.indexOf(g)>-1?o=g:r.before(g)==O&&l.splice(1,0,-g)}let c=l.indexOf(o),h=[],d=i.openStart;for(let g=i.content,O=0;;O++){let b=g.firstChild;if(h.push(b),O==i.openStart)break;g=b.content}for(let g=d-1;g>=0;g--){let O=h[g],b=qZ(O.type);if(b&&!O.sameMarkup(r.node(Math.abs(o)-1)))d=g;else if(b||!O.type.isTextblock)break}for(let g=i.openStart;g>=0;g--){let O=(g+d+1)%(i.openStart+1),b=h[O];if(b)for(let v=0;v<l.length;v++){let x=l[(v+c)%l.length],k=!0;x<0&&(k=!1,x=-x);let C=r.node(x-1),A=r.index(x-1);if(C.canReplaceWith(A,A,b.type,b.marks))return n.replace(r.before(x),k?s.after(x):t,new pe(WR(i.content,0,i.openStart,O),O,i.openEnd))}}let p=n.steps.length;for(let g=l.length-1;g>=0&&(n.replace(e,t,i),!(n.steps.length>p));g--){let O=l[g];O<0||(e=r.before(O),t=s.after(O))}}function WR(n,e,t,i,r){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(WR(s.content,e+1,t,i,s)))}if(e>i){let s=r.contentMatchAt(0),l=s.fillBefore(n).append(n);n=l.append(s.matchFragment(l).fillBefore(ne.empty,!0))}return n}function YZ(n,e,t,i){if(!i.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let r=XZ(n.doc,e,i.type);r!=null&&(e=t=r)}n.replaceRange(e,t,new pe(ne.from(i),0,0))}function UZ(n,e,t){let i=n.doc.resolve(e),r=n.doc.resolve(t);if(i.parent.isTextblock&&r.parent.isTextblock&&i.start()!=r.start()&&i.parentOffset==0&&r.parentOffset==0){let l=i.sharedDepth(t),o=!1;for(let c=i.depth;c>l;c--)i.node(c).type.spec.isolating&&(o=!0);for(let c=r.depth;c>l;c--)r.node(c).type.spec.isolating&&(o=!0);if(!o){for(let c=i.depth;c>0&&e==i.start(c);c--)e=i.before(c);for(let c=r.depth;c>0&&t==r.start(c);c--)t=r.before(c);i=n.doc.resolve(e),r=n.doc.resolve(t)}}let s=GR(i,r);for(let l=0;l<s.length;l++){let o=s[l],c=l==s.length-1;if(c&&o==0||i.node(o).type.contentMatch.validEnd)return n.delete(i.start(o),r.end(o));if(o>0&&(c||i.node(o-1).canReplace(i.index(o-1),r.indexAfter(o-1))))return n.delete(i.before(o),r.after(o))}for(let l=1;l<=i.depth&&l<=r.depth;l++)if(e-i.start(l)==i.depth-l&&t>i.end(l)&&r.end(l)-t!=r.depth-l&&i.start(l-1)==r.start(l-1)&&i.node(l-1).canReplace(i.index(l-1),r.index(l-1)))return n.delete(i.before(l),t);n.delete(e,t)}function GR(n,e){let t=[],i=Math.min(n.depth,e.depth);for(let r=i;r>=0;r--){let s=n.start(r);if(s<n.pos-(n.depth-r)||e.end(r)>e.pos+(e.depth-r)||n.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(s==e.start(r)||r==n.depth&&r==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==s-1)&&t.push(r)}return t}class Ya extends An{constructor(e,t,i){super(),this.pos=e,this.attr=t,this.value=i}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ht.fail("No node at attribute step's position");let i=Object.create(null);for(let s in t.attrs)i[s]=t.attrs[s];i[this.attr]=this.value;let r=t.type.create(i,null,t.marks);return Ht.fromReplace(e,this.pos,this.pos+1,new pe(ne.from(r),0,t.isLeaf?0:1))}getMap(){return yi.empty}invert(e){return new Ya(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 Ya(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 Ya(t.pos,t.attr,t.value)}}An.jsonID("attr",Ya);class Ch extends An{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let i=e.type.create(t,e.content,e.marks);return Ht.ok(i)}getMap(){return yi.empty}invert(e){return new Ch(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ch(t.attr,t.value)}}An.jsonID("docAttr",Ch);let rc=class extends Error{};rc=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};rc.prototype=Object.create(Error.prototype);rc.prototype.constructor=rc;rc.prototype.name="TransformError";class nv{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Th}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new rc(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}changedRange(){let e=1e9,t=-1e9;for(let i=0;i<this.mapping.maps.length;i++){let r=this.mapping.maps[i];i&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((s,l,o,c)=>{e=Math.min(e,o),t=Math.max(t,c)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,i=pe.empty){let r=wg(this.doc,e,t,i);return r&&this.step(r),this}replaceWith(e,t,i){return this.replace(e,t,new pe(ne.from(i),0,0))}delete(e,t){return this.replace(e,t,pe.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,i){return HZ(this,e,t,i),this}replaceRangeWith(e,t,i){return YZ(this,e,t,i),this}deleteRange(e,t){return UZ(this,e,t),this}lift(e,t){return RZ(this,e,t),this}join(e,t=1){return jZ(this,e,t),this}wrap(e,t){return NZ(this,e,t),this}setBlockType(e,t=e,i,r=null){return zZ(this,e,t,i,r),this}setNodeMarkup(e,t,i=null,r){return _Z(this,e,t,i,r),this}setNodeAttribute(e,t,i){return this.step(new Ya(e,t,i)),this}setDocAttribute(e,t){return this.step(new Ch(e,t)),this}addNodeMark(e,t){return this.step(new kl(e,t)),this}removeNodeMark(e,t){let i=this.doc.nodeAt(e);if(!i)throw new RangeError("No node at position "+e);if(t instanceof mt)t.isInSet(i.marks)&&this.step(new Ro(e,t));else{let r=i.marks,s,l=[];for(;s=t.isInSet(r);)l.push(new Ro(e,s)),r=s.removeFromSet(r);for(let o=l.length-1;o>=0;o--)this.step(l[o])}return this}split(e,t=1,i){return BZ(this,e,t,i),this}addMark(e,t,i){return QZ(this,e,t,i),this}removeMark(e,t,i){return EZ(this,e,t,i),this}clearIncompatible(e,t,i){return ev(this,e,t,i),this}}const Py=Object.create(null);class Pe{constructor(e,t,i){this.$anchor=e,this.$head=t,this.ranges=i||[new FR(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<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=pe.empty){let i=t.content.lastChild,r=null;for(let o=0;o<t.openEnd;o++)r=i,i=i.lastChild;let s=e.steps.length,l=this.ranges;for(let o=0;o<l.length;o++){let{$from:c,$to:h}=l[o],d=e.mapping.slice(s);e.replaceRange(d.map(c.pos),d.map(h.pos),o?pe.empty:t),o==0&&DA(e,s,(i?i.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let i=e.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){let{$from:l,$to:o}=r[s],c=e.mapping.slice(i),h=c.map(l.pos),d=c.map(o.pos);s?e.deleteRange(h,d):(e.replaceRangeWith(h,d,t),DA(e,i,t.isInline?-1:1))}}static findFrom(e,t,i=!1){let r=e.parent.inlineContent?new Ae(e):_a(e.node(0),e.parent,e.pos,e.index(),t,i);if(r)return r;for(let s=e.depth-1;s>=0;s--){let l=t<0?_a(e.node(0),e.node(s),e.before(s+1),e.index(s),t,i):_a(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,i);if(l)return l}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new vi(e.node(0))}static atStart(e){return _a(e,e,0,0,1)||new vi(e)}static atEnd(e){return _a(e,e,e.content.size,e.childCount,-1)||new vi(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let i=Py[t.type];if(!i)throw new RangeError(`No selection type ${t.type} defined`);return i.fromJSON(e,t)}static jsonID(e,t){if(e in Py)throw new RangeError("Duplicate use of selection JSON ID "+e);return Py[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Ae.between(this.$anchor,this.$head).getBookmark()}}Pe.prototype.visible=!0;let FR=class{constructor(e,t){this.$from=e,this.$to=t}},RA=!1;function PA(n){!RA&&!n.parent.inlineContent&&(RA=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Ae extends Pe{constructor(e,t=e){PA(e),PA(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let i=e.resolve(t.map(this.head));if(!i.parent.inlineContent)return Pe.near(i);let r=e.resolve(t.map(this.anchor));return new Ae(r.parent.inlineContent?r:i,i)}replace(e,t=pe.empty){if(super.replace(e,t),t==pe.empty){let i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}eq(e){return e instanceof Ae&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Tg(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 Ae(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,i=t){let r=e.resolve(t);return new this(r,i==t?r:e.resolve(i))}static between(e,t,i){let r=e.pos-t.pos;if((!i||r)&&(i=r>=0?1:-1),!t.parent.inlineContent){let s=Pe.findFrom(t,i,!0)||Pe.findFrom(t,-i,!0);if(s)t=s.$head;else return Pe.near(t,i)}return e.parent.inlineContent||(r==0?e=t:(e=(Pe.findFrom(e,-i,!0)||Pe.findFrom(e,i,!0)).$anchor,e.pos<t.pos!=r<0&&(e=t))),new Ae(e,t)}}Pe.jsonID("text",Ae);class Tg{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Tg(e.map(this.anchor),e.map(this.head))}resolve(e){return Ae.between(e.resolve(this.anchor),e.resolve(this.head))}}class Te extends Pe{constructor(e){let t=e.nodeAfter,i=e.node(0).resolve(e.pos+t.nodeSize);super(e,i),this.node=t}map(e,t){let{deleted:i,pos:r}=t.mapResult(this.anchor),s=e.resolve(r);return i?Pe.near(s):new Te(s)}content(){return new pe(ne.from(this.node),0,0)}eq(e){return e instanceof Te&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new iv(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Te(e.resolve(t.anchor))}static create(e,t){return new Te(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Te.prototype.visible=!1;Pe.jsonID("node",Te);class iv{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:i}=e.mapResult(this.anchor);return t?new Tg(i,i):new iv(i)}resolve(e){let t=e.resolve(this.anchor),i=t.nodeAfter;return i&&Te.isSelectable(i)?new Te(t):Pe.near(t)}}class vi extends Pe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=pe.empty){if(t==pe.empty){e.delete(0,e.doc.content.size);let i=Pe.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new vi(e)}map(e){return new vi(e)}eq(e){return e instanceof vi}getBookmark(){return WZ}}Pe.jsonID("all",vi);const WZ={map(){return this},resolve(n){return new vi(n)}};function _a(n,e,t,i,r,s=!1){if(e.inlineContent)return Ae.create(n,t);for(let l=i-(r>0?0:1);r>0?l<e.childCount:l>=0;l+=r){let o=e.child(l);if(o.isAtom){if(!s&&Te.isSelectable(o))return Te.create(n,t-(r<0?o.nodeSize:0))}else{let c=_a(n,o,t+r,r<0?o.childCount:0,r,s);if(c)return c}t+=o.nodeSize*r}return null}function DA(n,e,t){let i=n.steps.length-1;if(i<e)return;let r=n.steps[i];if(!(r instanceof qt||r instanceof rn))return;let s=n.mapping.maps[i],l;s.forEach((o,c,h,d)=>{l==null&&(l=d)}),n.setSelection(Pe.near(n.doc.resolve(l),t))}const NA=1,jd=2,zA=4;let GZ=class extends nv{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.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|NA)&~jd,this.storedMarks=null,this}get selectionSet(){return(this.updated&NA)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=jd,this}ensureMarks(e){return mt.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&jd)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~jd,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let i=this.selection;return t&&(e=e.mark(this.storedMarks||(i.empty?i.$from.marks():i.$from.marksAcross(i.$to)||mt.none))),i.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,i){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(i==null&&(i=t),!e)return this.deleteRange(t,i);let s=this.storedMarks;if(!s){let l=this.doc.resolve(t);s=i==t?l.marks():l.marksAcross(this.doc.resolve(i))}return this.replaceRangeWith(t,i,r.text(e,s)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(Pe.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|=zA,this}get scrolledIntoView(){return(this.updated&zA)>0}};function LA(n,e){return!e||!n?n:n.bind(e)}class Hu{constructor(e,t,i){this.name=e,this.init=LA(t.init,i),this.apply=LA(t.apply,i)}}const FZ=[new Hu("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Hu("selection",{init(n,e){return n.selection||Pe.atStart(e.doc)},apply(n){return n.selection}}),new Hu("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,i){return i.selection.$cursor?n.storedMarks:null}}),new Hu("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];let Dy=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=FZ.slice(),t&&t.forEach(i=>{if(this.pluginsByKey[i.key])throw new RangeError("Adding different instances of a keyed plugin ("+i.key+")");this.plugins.push(i),this.pluginsByKey[i.key]=i,i.spec.state&&this.fields.push(new Hu(i.key,i.spec.state,i))})}},KZ=class Yu{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 i=0;i<this.config.plugins.length;i++)if(i!=t){let r=this.config.plugins[i];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],i=this.applyInner(e),r=null;for(;;){let s=!1;for(let l=0;l<this.config.plugins.length;l++){let o=this.config.plugins[l];if(o.spec.appendTransaction){let c=r?r[l].n:0,h=r?r[l].state:this,d=c<t.length&&o.spec.appendTransaction.call(o,c?t.slice(c):t,h,i);if(d&&i.filterTransaction(d,l)){if(d.setMeta("appendedTransaction",e),!r){r=[];for(let p=0;p<this.config.plugins.length;p++)r.push(p<l?{state:i,n:t.length}:{state:this,n:0})}t.push(d),i=i.applyInner(d),s=!0}r&&(r[l]={state:i,n:t.length})}}if(!s)return{state:i,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Yu(this.config),i=this.config.fields;for(let r=0;r<i.length;r++){let s=i[r];t[s.name]=s.apply(e,this[s.name],this,t)}return t}get tr(){return new GZ(this)}static create(e){let t=new Dy(e.doc?e.doc.type.schema:e.schema,e.plugins),i=new Yu(t);for(let r=0;r<t.fields.length;r++)i[t.fields[r].name]=t.fields[r].init(e,i);return i}reconfigure(e){let t=new Dy(this.schema,e.plugins),i=t.fields,r=new Yu(t);for(let s=0;s<i.length;s++){let l=i[s].name;r[l]=this.hasOwnProperty(l)?this[l]:i[s].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(i=>i.toJSON())),e&&typeof e=="object")for(let i in e){if(i=="doc"||i=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[i],s=r.spec.state;s&&s.toJSON&&(t[i]=s.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,i){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new Dy(e.schema,e.plugins),s=new Yu(r);return r.fields.forEach(l=>{if(l.name=="doc")s.doc=Cl.fromJSON(e.schema,t.doc);else if(l.name=="selection")s.selection=Pe.fromJSON(s.doc,t.selection);else if(l.name=="storedMarks")t.storedMarks&&(s.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(i)for(let o in i){let c=i[o],h=c.spec.state;if(c.key==l.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(t,o)){s[l.name]=h.fromJSON.call(c,e,t[o],s);return}}s[l.name]=l.init(e,s)}}),s}};function KR(n,e,t){for(let i in n){let r=n[i];r instanceof Function?r=r.bind(e):i=="handleDOMEvents"&&(r=KR(r,e,{})),t[i]=r}return t}class bt{constructor(e){this.spec=e,this.props={},e.props&&KR(e.props,this,this.props),this.key=e.key?e.key.key:JR("plugin")}getState(e){return e[this.key]}}const Ny=Object.create(null);function JR(n){return n in Ny?n+"$"+ ++Ny[n]:(Ny[n]=0,n+"$")}class At{constructor(e="key"){this.key=JR(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const rv=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function e2(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const t2=(n,e,t)=>{let i=e2(n,t);if(!i)return!1;let r=sv(i);if(!r){let l=i.blockRange(),o=l&&Tc(l);return o==null?!1:(e&&e(n.tr.lift(l,o).scrollIntoView()),!0)}let s=r.nodeBefore;if(u2(n,r,e,-1))return!0;if(i.parent.content.size==0&&(sc(s,"end")||Te.isSelectable(s)))for(let l=i.depth;;l--){let o=wg(n.doc,i.before(l),i.after(l),pe.empty);if(o&&o.slice.size<o.to-o.from){if(e){let c=n.tr.step(o);c.setSelection(sc(s,"end")?Pe.findFrom(c.doc.resolve(c.mapping.map(r.pos,-1)),-1):Te.create(c.doc,r.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(l==1||i.node(l-1).childCount>1)break}return s.isAtom&&r.depth==i.depth-1?(e&&e(n.tr.delete(r.pos-s.nodeSize,r.pos).scrollIntoView()),!0):!1},JZ=(n,e,t)=>{let i=e2(n,t);if(!i)return!1;let r=sv(i);return r?n2(n,r,e):!1},ej=(n,e,t)=>{let i=r2(n,t);if(!i)return!1;let r=lv(i);return r?n2(n,r,e):!1};function n2(n,e,t){let i=e.nodeBefore,r=i,s=e.pos-1;for(;!r.isTextblock;s--){if(r.type.spec.isolating)return!1;let d=r.lastChild;if(!d)return!1;r=d}let l=e.nodeAfter,o=l,c=e.pos+1;for(;!o.isTextblock;c++){if(o.type.spec.isolating)return!1;let d=o.firstChild;if(!d)return!1;o=d}let h=wg(n.doc,s,c,pe.empty);if(!h||h.from!=s||h instanceof qt&&h.slice.size>=c-s)return!1;if(t){let d=n.tr.step(h);d.setSelection(Ae.create(d.doc,s)),t(d.scrollIntoView())}return!0}function sc(n,e,t=!1){for(let i=n;i;i=e=="start"?i.firstChild:i.lastChild){if(i.isTextblock)return!0;if(t&&i.childCount!=1)return!1}return!1}const i2=(n,e,t)=>{let{$head:i,empty:r}=n.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):i.parentOffset>0)return!1;s=sv(i)}let l=s&&s.nodeBefore;return!l||!Te.isSelectable(l)?!1:(e&&e(n.tr.setSelection(Te.create(n.doc,s.pos-l.nodeSize)).scrollIntoView()),!0)};function sv(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function r2(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const s2=(n,e,t)=>{let i=r2(n,t);if(!i)return!1;let r=lv(i);if(!r)return!1;let s=r.nodeAfter;if(u2(n,r,e,1))return!0;if(i.parent.content.size==0&&(sc(s,"start")||Te.isSelectable(s))){let l=wg(n.doc,i.before(),i.after(),pe.empty);if(l&&l.slice.size<l.to-l.from){if(e){let o=n.tr.step(l);o.setSelection(sc(s,"start")?Pe.findFrom(o.doc.resolve(o.mapping.map(r.pos)),1):Te.create(o.doc,o.mapping.map(r.pos))),e(o.scrollIntoView())}return!0}}return s.isAtom&&r.depth==i.depth-1?(e&&e(n.tr.delete(r.pos,r.pos+s.nodeSize).scrollIntoView()),!0):!1},l2=(n,e,t)=>{let{$head:i,empty:r}=n.selection,s=i;if(!r)return!1;if(i.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):i.parentOffset<i.parent.content.size)return!1;s=lv(i)}let l=s&&s.nodeAfter;return!l||!Te.isSelectable(l)?!1:(e&&e(n.tr.setSelection(Te.create(n.doc,s.pos)).scrollIntoView()),!0)};function lv(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const tj=(n,e)=>{let t=n.selection,i=t instanceof Te,r;if(i){if(t.node.isTextblock||!Zl(n.doc,t.from))return!1;r=t.from}else if(r=kg(n.doc,t.from,-1),r==null)return!1;if(e){let s=n.tr.join(r);i&&s.setSelection(Te.create(s.doc,r-n.doc.resolve(r).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},nj=(n,e)=>{let t=n.selection,i;if(t instanceof Te){if(t.node.isTextblock||!Zl(n.doc,t.to))return!1;i=t.to}else if(i=kg(n.doc,t.to,1),i==null)return!1;return e&&e(n.tr.join(i).scrollIntoView()),!0},ij=(n,e)=>{let{$from:t,$to:i}=n.selection,r=t.blockRange(i),s=r&&Tc(r);return s==null?!1:(e&&e(n.tr.lift(r,s).scrollIntoView()),!0)},o2=(n,e)=>{let{$head:t,$anchor:i}=n.selection;return!t.parent.type.spec.code||!t.sameParent(i)?!1:(e&&e(n.tr.insertText(`
|
|
62
|
+
`).scrollIntoView()),!0)};function ov(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const rj=(n,e)=>{let{$head:t,$anchor:i}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(i))return!1;let r=t.node(-1),s=t.indexAfter(-1),l=ov(r.contentMatchAt(s));if(!l||!r.canReplaceWith(s,s,l))return!1;if(e){let o=t.after(),c=n.tr.replaceWith(o,o,l.createAndFill());c.setSelection(Pe.near(c.doc.resolve(o),1)),e(c.scrollIntoView())}return!0},a2=(n,e)=>{let t=n.selection,{$from:i,$to:r}=t;if(t instanceof vi||i.parent.inlineContent||r.parent.inlineContent)return!1;let s=ov(r.parent.contentMatchAt(r.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let l=(!i.parentOffset&&r.index()<r.parent.childCount?i:r).pos,o=n.tr.insert(l,s.createAndFill());o.setSelection(Ae.create(o.doc,l+1)),e(o.scrollIntoView())}return!0},c2=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Cs(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let i=t.blockRange(),r=i&&Tc(i);return r==null?!1:(e&&e(n.tr.lift(i,r).scrollIntoView()),!0)};function sj(n){return(e,t)=>{let{$from:i,$to:r}=e.selection;if(e.selection instanceof Te&&e.selection.node.isBlock)return!i.parentOffset||!Cs(e.doc,i.pos)?!1:(t&&t(e.tr.split(i.pos).scrollIntoView()),!0);if(!i.depth)return!1;let s=[],l,o,c=!1,h=!1;for(let O=i.depth;;O--)if(i.node(O).isBlock){c=i.end(O)==i.pos+(i.depth-O),h=i.start(O)==i.pos-(i.depth-O),o=ov(i.node(O-1).contentMatchAt(i.indexAfter(O-1))),s.unshift(c&&o?{type:o}:null),l=O;break}else{if(O==1)return!1;s.unshift(null)}let d=e.tr;(e.selection instanceof Ae||e.selection instanceof vi)&&d.deleteSelection();let p=d.mapping.map(i.pos),g=Cs(d.doc,p,s.length,s);if(g||(s[0]=o?{type:o}:null,g=Cs(d.doc,p,s.length,s)),!g)return!1;if(d.split(p,s.length,s),!c&&h&&i.node(l).type!=o){let O=d.mapping.map(i.before(l)),b=d.doc.resolve(O);o&&i.node(l-1).canReplaceWith(b.index(),b.index()+1,o)&&d.setNodeMarkup(d.mapping.map(i.before(l)),o)}return t&&t(d.scrollIntoView()),!0}}const lj=sj(),oj=(n,e)=>{let{$from:t,to:i}=n.selection,r,s=t.sharedDepth(i);return s==0?!1:(r=t.before(s),e&&e(n.tr.setSelection(Te.create(n.doc,r))),!0)};function aj(n,e,t){let i=e.nodeBefore,r=e.nodeAfter,s=e.index();return!i||!r||!i.type.compatibleContent(r.type)?!1:!i.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-i.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(r.isTextblock||Zl(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function u2(n,e,t,i){let r=e.nodeBefore,s=e.nodeAfter,l,o,c=r.type.spec.isolating||s.type.spec.isolating;if(!c&&aj(n,e,t))return!0;let h=!c&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(l=(o=r.contentMatchAt(r.childCount)).findWrapping(s.type))&&o.matchType(l[0]||s.type).validEnd){if(t){let O=e.pos+s.nodeSize,b=ne.empty;for(let k=l.length-1;k>=0;k--)b=ne.from(l[k].create(null,b));b=ne.from(r.copy(b));let v=n.tr.step(new rn(e.pos-1,O,e.pos,O,new pe(b,1,0),l.length,!0)),x=v.doc.resolve(O+2*l.length);x.nodeAfter&&x.nodeAfter.type==r.type&&Zl(v.doc,x.pos)&&v.join(x.pos),t(v.scrollIntoView())}return!0}let d=s.type.spec.isolating||i>0&&c?null:Pe.findFrom(e,1),p=d&&d.$from.blockRange(d.$to),g=p&&Tc(p);if(g!=null&&g>=e.depth)return t&&t(n.tr.lift(p,g).scrollIntoView()),!0;if(h&&sc(s,"start",!0)&&sc(r,"end")){let O=r,b=[];for(;b.push(O),!O.isTextblock;)O=O.lastChild;let v=s,x=1;for(;!v.isTextblock;v=v.firstChild)x++;if(O.canReplace(O.childCount,O.childCount,v.content)){if(t){let k=ne.empty;for(let A=b.length-1;A>=0;A--)k=ne.from(b[A].copy(k));let C=n.tr.step(new rn(e.pos-b.length,e.pos+s.nodeSize,e.pos+x,e.pos+s.nodeSize-x,new pe(k,b.length,0),0,!0));t(C.scrollIntoView())}return!0}}return!1}function h2(n){return function(e,t){let i=e.selection,r=n<0?i.$from:i.$to,s=r.depth;for(;r.node(s).isInline;){if(!s)return!1;s--}return r.node(s).isTextblock?(t&&t(e.tr.setSelection(Ae.create(e.doc,n<0?r.start(s):r.end(s)))),!0):!1}}const cj=h2(-1),uj=h2(1);function hj(n,e=null){return function(t,i){let{$from:r,$to:s}=t.selection,l=r.blockRange(s),o=l&&tv(l,n,e);return o?(i&&i(t.tr.wrap(l,o).scrollIntoView()),!0):!1}}function _A(n,e=null){return function(t,i){let r=!1;for(let s=0;s<t.selection.ranges.length&&!r;s++){let{$from:{pos:l},$to:{pos:o}}=t.selection.ranges[s];t.doc.nodesBetween(l,o,(c,h)=>{if(r)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)r=!0;else{let d=t.doc.resolve(h),p=d.index();r=d.parent.canReplaceWith(p,p+1,n)}})}if(!r)return!1;if(i){let s=t.tr;for(let l=0;l<t.selection.ranges.length;l++){let{$from:{pos:o},$to:{pos:c}}=t.selection.ranges[l];s.setBlockType(o,c,n,e)}i(s.scrollIntoView())}return!0}}function av(...n){return function(e,t,i){for(let r=0;r<n.length;r++)if(n[r](e,t,i))return!0;return!1}}av(rv,t2,i2);av(rv,s2,l2);av(o2,a2,c2,lj);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function fj(n,e=null){return function(t,i){let{$from:r,$to:s}=t.selection,l=r.blockRange(s);if(!l)return!1;let o=i?t.tr:null;return dj(o,l,n,e)?(i&&i(o.scrollIntoView()),!0):!1}}function dj(n,e,t,i=null){let r=!1,s=e,l=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=l.resolve(e.start-2);s=new Fp(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Fp(e.$from,l.resolve(e.$to.end(e.depth)),e.depth)),r=!0}let o=tv(s,t,i,e);return o?(n&&pj(n,e,o,r,t),!0):!1}function pj(n,e,t,i,r){let s=ne.empty;for(let d=t.length-1;d>=0;d--)s=ne.from(t[d].type.create(t[d].attrs,s));n.step(new rn(e.start-(i?2:0),e.end,e.start,e.end,new pe(s,0,0),t.length,!0));let l=0;for(let d=0;d<t.length;d++)t[d].type==r&&(l=d+1);let o=t.length-l,c=e.start+t.length-(i?2:0),h=e.parent;for(let d=e.startIndex,p=e.endIndex,g=!0;d<p;d++,g=!1)!g&&Cs(n.doc,c,o)&&(n.split(c,o),c+=2*o),c+=h.child(d).nodeSize;return n}function mj(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,l=>l.childCount>0&&l.firstChild.type==n);return s?t?i.node(s.depth-1).type==n?gj(e,t,n,s):Oj(e,t,s):!0:!1}}function gj(n,e,t,i){let r=n.tr,s=i.end,l=i.$to.end(i.depth);s<l&&(r.step(new rn(s-1,l,s,l,new pe(ne.from(t.create(null,i.parent.copy())),1,0),1,!0)),i=new Fp(r.doc.resolve(i.$from.pos),r.doc.resolve(l),i.depth));const o=Tc(i);if(o==null)return!1;r.lift(i,o);let c=r.doc.resolve(r.mapping.map(s,-1)-1);return Zl(r.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&r.join(c.pos),e(r.scrollIntoView()),!0}function Oj(n,e,t){let i=n.tr,r=t.parent;for(let O=t.end,b=t.endIndex-1,v=t.startIndex;b>v;b--)O-=r.child(b).nodeSize,i.delete(O-1,O+1);let s=i.doc.resolve(t.start),l=s.nodeAfter;if(i.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let o=t.startIndex==0,c=t.endIndex==r.childCount,h=s.node(-1),d=s.index(-1);if(!h.canReplace(d+(o?0:1),d+1,l.content.append(c?ne.empty:ne.from(r))))return!1;let p=s.pos,g=p+l.nodeSize;return i.step(new rn(p-(o?1:0),g+(c?1:0),p+1,g-1,new pe((o?ne.empty:ne.from(r.copy(ne.empty))).append(c?ne.empty:ne.from(r.copy(ne.empty))),o?0:1,c?0:1),o?0:1)),e(i.scrollIntoView()),!0}function yj(n){return function(e,t){let{$from:i,$to:r}=e.selection,s=i.blockRange(r,h=>h.childCount>0&&h.firstChild.type==n);if(!s)return!1;let l=s.startIndex;if(l==0)return!1;let o=s.parent,c=o.child(l-1);if(c.type!=n)return!1;if(t){let h=c.lastChild&&c.lastChild.type==o.type,d=ne.from(h?n.create():null),p=new pe(ne.from(n.create(null,ne.from(o.type.create(null,d)))),h?3:1,0),g=s.start,O=s.end;t(e.tr.step(new rn(g-(h?3:1),O,g,O,p,1,!0)).scrollIntoView())}return!0}}const pn=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},lc=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let h1=null;const bs=function(n,e,t){let i=h1||(h1=document.createRange());return i.setEnd(n,t??n.nodeValue.length),i.setStart(n,e||0),i},bj=function(){h1=null},Po=function(n,e,t,i){return t&&(BA(n,e,t,i,-1)||BA(n,e,t,i,1))},Sj=/^(img|br|input|textarea|hr)$/i;function BA(n,e,t,i,r){for(var s;;){if(n==t&&e==i)return!0;if(e==(r<0?0:_i(n))){let l=n.parentNode;if(!l||l.nodeType!=1||af(n)||Sj.test(n.nodeName)||n.contentEditable=="false")return!1;e=pn(n)+(r<0?0:1),n=l}else if(n.nodeType==1){let l=n.childNodes[e+(r<0?-1:0)];if(l.nodeType==1&&l.contentEditable=="false")if(!((s=l.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)e+=r;else return!1;else n=l,e=r<0?_i(n):0}else return!1}}function _i(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function vj(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=_i(n)}else if(n.parentNode&&!af(n))e=pn(n),n=n.parentNode;else return null}}function xj(n,e){for(;;){if(n.nodeType==3&&e<n.nodeValue.length)return n;if(n.nodeType==1&&e<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[e],e=0}else if(n.parentNode&&!af(n))e=pn(n)+1,n=n.parentNode;else return null}}function kj(n,e,t){for(let i=e==0,r=e==_i(n);i||r;){if(n==t)return!0;let s=pn(n);if(n=n.parentNode,!n)return!1;i=i&&s==0,r=r&&s==_i(n)}}function af(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Cg=function(n){return n.focusNode&&Po(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function fo(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function wj(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Tj(n,e,t){if(n.caretPositionFromPoint)try{let i=n.caretPositionFromPoint(e,t);if(i)return{node:i.offsetNode,offset:Math.min(_i(i.offsetNode),i.offset)}}catch{}if(n.caretRangeFromPoint){let i=n.caretRangeFromPoint(e,t);if(i)return{node:i.startContainer,offset:Math.min(_i(i.startContainer),i.startOffset)}}}const _r=typeof navigator<"u"?navigator:null,ZA=typeof document<"u"?document:null,jl=_r&&_r.userAgent||"",f1=/Edge\/(\d+)/.exec(jl),f2=/MSIE \d/.exec(jl),d1=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jl),ei=!!(f2||d1||f1),Ml=f2?document.documentMode:d1?+d1[1]:f1?+f1[1]:0,Vi=!ei&&/gecko\/(\d+)/i.test(jl);Vi&&+(/Firefox\/(\d+)/.exec(jl)||[0,0])[1];const p1=!ei&&/Chrome\/(\d+)/.exec(jl),On=!!p1,d2=p1?+p1[1]:0,Tn=!ei&&!!_r&&/Apple Computer/.test(_r.vendor),oc=Tn&&(/Mobile\/\w+/.test(jl)||!!_r&&_r.maxTouchPoints>2),Li=oc||(_r?/Mac/.test(_r.platform):!1),p2=_r?/Win/.test(_r.platform):!1,xs=/Android \d/.test(jl),cf=!!ZA&&"webkitFontSmoothing"in ZA.documentElement.style,Cj=cf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Aj(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function ds(n,e){return typeof n=="number"?n:n[e]}function Mj(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,i=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*i}}function jA(n,e,t){let i=n.someProp("scrollThreshold")||0,r=n.someProp("scrollMargin")||5,s=n.dom.ownerDocument;for(let l=t||n.dom;l;){if(l.nodeType!=1){l=lc(l);continue}let o=l,c=o==s.body,h=c?Aj(s):Mj(o),d=0,p=0;if(e.top<h.top+ds(i,"top")?p=-(h.top-e.top+ds(r,"top")):e.bottom>h.bottom-ds(i,"bottom")&&(p=e.bottom-e.top>h.bottom-h.top?e.top+ds(r,"top")-h.top:e.bottom-h.bottom+ds(r,"bottom")),e.left<h.left+ds(i,"left")?d=-(h.left-e.left+ds(r,"left")):e.right>h.right-ds(i,"right")&&(d=e.right-h.right+ds(r,"right")),d||p)if(c)s.defaultView.scrollBy(d,p);else{let O=o.scrollLeft,b=o.scrollTop;p&&(o.scrollTop+=p),d&&(o.scrollLeft+=d);let v=o.scrollLeft-O,x=o.scrollTop-b;e={left:e.left-v,top:e.top-x,right:e.right-v,bottom:e.bottom-x}}let g=c?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(g))break;l=g=="absolute"?l.offsetParent:lc(l)}}function Qj(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),i,r;for(let s=(e.left+e.right)/2,l=t+1;l<Math.min(innerHeight,e.bottom);l+=5){let o=n.root.elementFromPoint(s,l);if(!o||o==n.dom||!n.dom.contains(o))continue;let c=o.getBoundingClientRect();if(c.top>=t-20){i=o,r=c.top;break}}return{refDOM:i,refTop:r,stack:m2(n.dom)}}function m2(n){let e=[],t=n.ownerDocument;for(let i=n;i&&(e.push({dom:i,top:i.scrollTop,left:i.scrollLeft}),n!=t);i=lc(i));return e}function Ej({refDOM:n,refTop:e,stack:t}){let i=n?n.getBoundingClientRect().top:0;g2(t,i==0?0:i-e)}function g2(n,e){for(let t=0;t<n.length;t++){let{dom:i,top:r,left:s}=n[t];i.scrollTop!=r+e&&(i.scrollTop=r+e),i.scrollLeft!=s&&(i.scrollLeft=s)}}let za=null;function $j(n){if(n.setActive)return n.setActive();if(za)return n.focus(za);let e=m2(n);n.focus(za==null?{get preventScroll(){return za={preventScroll:!0},!0}}:void 0),za||(za=!1,g2(e,0))}function O2(n,e){let t,i=2e8,r,s=0,l=e.top,o=e.top,c,h;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let g;if(d.nodeType==1)g=d.getClientRects();else if(d.nodeType==3)g=bs(d).getClientRects();else continue;for(let O=0;O<g.length;O++){let b=g[O];if(b.top<=l&&b.bottom>=o){l=Math.max(b.bottom,l),o=Math.min(b.top,o);let v=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(v<i){t=d,i=v,r=v&&t.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,d.nodeType==1&&v&&(s=p+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!c&&b.left<=e.left&&b.right>=e.left&&(c=d,h={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!t&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(s=p+1)}}return!t&&c&&(t=c,r=h,i=0),t&&t.nodeType==3?Rj(t,r):!t||i&&t.nodeType==1?{node:n,offset:s}:O2(t,r)}function Rj(n,e){let t=n.nodeValue.length,i=document.createRange(),r;for(let s=0;s<t;s++){i.setEnd(n,s+1),i.setStart(n,s);let l=fl(i,1);if(l.top!=l.bottom&&cv(e,l)){r={node:n,offset:s+(e.left>=(l.left+l.right)/2?1:0)};break}}return i.detach(),r||{node:n,offset:0}}function cv(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function Pj(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function Dj(n,e,t){let{node:i,offset:r}=O2(e,t),s=-1;if(i.nodeType==1&&!i.firstChild){let l=i.getBoundingClientRect();s=l.left!=l.right&&t.left>(l.left+l.right)/2?1:-1}return n.docView.posFromDOM(i,r,s)}function Nj(n,e,t,i){let r=-1;for(let s=e,l=!1;s!=n.dom;){let o=n.docView.nearestDesc(s,!0),c;if(!o)return null;if(o.dom.nodeType==1&&(o.node.isBlock&&o.parent||!o.contentDOM)&&((c=o.dom.getBoundingClientRect()).width||c.height)&&(o.node.isBlock&&o.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(o.dom.nodeName)&&(!l&&c.left>i.left||c.top>i.top?r=o.posBefore:(!l&&c.right<i.left||c.bottom<i.top)&&(r=o.posAfter),l=!0),!o.contentDOM&&r<0&&!o.node.isText))return(o.node.isBlock?i.top<(c.top+c.bottom)/2:i.left<(c.left+c.right)/2)?o.posBefore:o.posAfter;s=o.dom.parentNode}return r>-1?r:n.docView.posFromDOM(e,t,-1)}function y2(n,e,t){let i=n.childNodes.length;if(i&&t.top<t.bottom)for(let r=Math.max(0,Math.min(i-1,Math.floor(i*(e.top-t.top)/(t.bottom-t.top))-2)),s=r;;){let l=n.childNodes[s];if(l.nodeType==1){let o=l.getClientRects();for(let c=0;c<o.length;c++){let h=o[c];if(cv(e,h))return y2(l,e,h)}}if((s=(s+1)%i)==r)break}return n}function zj(n,e){let t=n.dom.ownerDocument,i,r=0,s=Tj(t,e.left,e.top);s&&({node:i,offset:r}=s);let l=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),o;if(!l||!n.dom.contains(l.nodeType!=1?l.parentNode:l)){let h=n.dom.getBoundingClientRect();if(!cv(e,h)||(l=y2(n.dom,e,h),!l))return null}if(Tn)for(let h=l;i&&h;h=lc(h))h.draggable&&(i=void 0);if(l=Pj(l,e),i){if(Vi&&i.nodeType==1&&(r=Math.min(r,i.childNodes.length),r<i.childNodes.length)){let d=i.childNodes[r],p;d.nodeName=="IMG"&&(p=d.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&r++}let h;cf&&r&&i.nodeType==1&&(h=i.childNodes[r-1]).nodeType==1&&h.contentEditable=="false"&&h.getBoundingClientRect().top>=e.top&&r--,i==n.dom&&r==i.childNodes.length-1&&i.lastChild.nodeType==1&&e.top>i.lastChild.getBoundingClientRect().bottom?o=n.state.doc.content.size:(r==0||i.nodeType!=1||i.childNodes[r-1].nodeName!="BR")&&(o=Nj(n,i,r,e))}o==null&&(o=Dj(n,l,e));let c=n.docView.nearestDesc(l,!0);return{pos:o,inside:c?c.posAtStart-c.border:-1}}function XA(n){return n.top<n.bottom||n.left<n.right}function fl(n,e){let t=n.getClientRects();if(t.length){let i=t[e<0?0:t.length-1];if(XA(i))return i}return Array.prototype.find.call(t,XA)||n.getBoundingClientRect()}const Lj=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function b2(n,e,t){let{node:i,offset:r,atom:s}=n.docView.domFromPos(e,t<0?-1:1),l=cf||Vi;if(i.nodeType==3)if(l&&(Lj.test(i.nodeValue)||(t<0?!r:r==i.nodeValue.length))){let c=fl(bs(i,r,r),t);if(Vi&&r&&/\s/.test(i.nodeValue[r-1])&&r<i.nodeValue.length){let h=fl(bs(i,r-1,r-1),-1);if(h.top==c.top){let d=fl(bs(i,r,r+1),-1);if(d.top!=c.top)return Qu(d,d.left<h.left)}}return c}else{let c=r,h=r,d=t<0?1:-1;return t<0&&!r?(h++,d=-1):t>=0&&r==i.nodeValue.length?(c--,d=1):t<0?c--:h++,Qu(fl(bs(i,c,h),d),d<0)}if(!n.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&r&&(t<0||r==_i(i))){let c=i.childNodes[r-1];if(c.nodeType==1)return zy(c.getBoundingClientRect(),!1)}if(s==null&&r<_i(i)){let c=i.childNodes[r];if(c.nodeType==1)return zy(c.getBoundingClientRect(),!0)}return zy(i.getBoundingClientRect(),t>=0)}if(s==null&&r&&(t<0||r==_i(i))){let c=i.childNodes[r-1],h=c.nodeType==3?bs(c,_i(c)-(l?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(h)return Qu(fl(h,1),!1)}if(s==null&&r<_i(i)){let c=i.childNodes[r];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let h=c?c.nodeType==3?bs(c,0,l?0:1):c.nodeType==1?c:null:null;if(h)return Qu(fl(h,-1),!0)}return Qu(fl(i.nodeType==3?bs(i):i,-t),t>=0)}function Qu(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function zy(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function S2(n,e,t){let i=n.state,r=n.root.activeElement;i!=e&&n.updateState(e),r!=n.dom&&n.focus();try{return t()}finally{i!=e&&n.updateState(i),r!=n.dom&&r&&r.focus()}}function _j(n,e,t){let i=e.selection,r=t=="up"?i.$from:i.$to;return S2(n,e,()=>{let{node:s}=n.docView.domFromPos(r.pos,t=="up"?-1:1);for(;;){let o=n.docView.nearestDesc(s,!0);if(!o)break;if(o.node.isBlock){s=o.contentDOM||o.dom;break}s=o.dom.parentNode}let l=b2(n,r.pos,1);for(let o=s.firstChild;o;o=o.nextSibling){let c;if(o.nodeType==1)c=o.getClientRects();else if(o.nodeType==3)c=bs(o,0,o.nodeValue.length).getClientRects();else continue;for(let h=0;h<c.length;h++){let d=c[h];if(d.bottom>d.top+1&&(t=="up"?l.top-d.top>(d.bottom-l.top)*2:d.bottom-l.bottom>(l.bottom-d.top)*2))return!1}}return!0})}const Bj=/[\u0590-\u08ac]/;function Zj(n,e,t){let{$head:i}=e.selection;if(!i.parent.isTextblock)return!1;let r=i.parentOffset,s=!r,l=r==i.parent.content.size,o=n.domSelection();return o?!Bj.test(i.parent.textContent)||!o.modify?t=="left"||t=="backward"?s:l:S2(n,e,()=>{let{focusNode:c,focusOffset:h,anchorNode:d,anchorOffset:p}=n.domSelectionRange(),g=o.caretBidiLevel;o.modify("move",t,"character");let O=i.depth?n.docView.domAfterPos(i.before()):n.dom,{focusNode:b,focusOffset:v}=n.domSelectionRange(),x=b&&!O.contains(b.nodeType==1?b:b.parentNode)||c==b&&h==v;try{o.collapse(d,p),c&&(c!=d||h!=p)&&o.extend&&o.extend(c,h)}catch{}return g!=null&&(o.caretBidiLevel=g),x}):i.pos==i.start()||i.pos==i.end()}let IA=null,VA=null,qA=!1;function jj(n,e,t){return IA==e&&VA==t?qA:(IA=e,VA=t,qA=t=="up"||t=="down"?_j(n,e,t):Zj(n,e,t))}const qi=0,HA=1,Oo=2,Br=3;class uf{constructor(e,t,i,r){this.parent=e,this.children=t,this.dom=i,this.contentDOM=r,this.dirty=qi,i.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,i){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,i=this.posAtStart;;t++){let r=this.children[t];if(r==e)return i;i+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,i){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(i<0){let s,l;if(e==this.contentDOM)s=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((l=s.pmViewDesc)&&l.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(l)+l.size:this.posAtStart}else{let s,l;if(e==this.contentDOM)s=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((l=s.pmViewDesc)&&l.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(l):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>pn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let s=e;;s=s.parentNode){if(s==this.dom){r=!1;break}if(s.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){r=!0;break}if(s.nextSibling)break}}return r??i>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let i=!0,r=e;r;r=r.parentNode){let s=this.getDesc(r),l;if(s&&(!t||s.node))if(i&&(l=s.nodeDOM)&&!(l.nodeType==1?l.contains(e.nodeType==1?e:e.parentNode):l==e))i=!1;else return s}}getDesc(e){let t=e.pmViewDesc;for(let i=t;i;i=i.parent)if(i==this)return t}posFromDOM(e,t,i){for(let r=e;r;r=r.parentNode){let s=this.getDesc(r);if(s)return s.localPosFromDOM(e,t,i)}return-1}descAt(e){for(let t=0,i=0;t<this.children.length;t++){let r=this.children[t],s=i+r.size;if(i==e&&s!=i){for(;!r.border&&r.children.length;)for(let l=0;l<r.children.length;l++){let o=r.children[l];if(o.size){r=o;break}}return r}if(e<s)return r.descAt(e-i-r.border);i=s}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let i=0,r=0;for(let s=0;i<this.children.length;i++){let l=this.children[i],o=s+l.size;if(o>e||l instanceof x2){r=e-s;break}s=o}if(r)return this.children[i].domFromPos(r-this.children[i].border,t);for(let s;i&&!(s=this.children[i-1]).size&&s instanceof v2&&s.side>=0;i--);if(t<=0){let s,l=!0;for(;s=i?this.children[i-1]:null,!(!s||s.dom.parentNode==this.contentDOM);i--,l=!1);return s&&t&&l&&!s.border&&!s.domAtom?s.domFromPos(s.size,t):{node:this.contentDOM,offset:s?pn(s.dom)+1:0}}else{let s,l=!0;for(;s=i<this.children.length?this.children[i]:null,!(!s||s.dom.parentNode==this.contentDOM);i++,l=!1);return s&&l&&!s.border&&!s.domAtom?s.domFromPos(0,t):{node:this.contentDOM,offset:s?pn(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,i=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,s=-1;for(let l=i,o=0;;o++){let c=this.children[o],h=l+c.size;if(r==-1&&e<=h){let d=l+c.border;if(e>=d&&t<=h-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,d);e=l;for(let p=o;p>0;p--){let g=this.children[p-1];if(g.size&&g.dom.parentNode==this.contentDOM&&!g.emptyChildAt(1)){r=pn(g.dom)+1;break}e-=g.size}r==-1&&(r=0)}if(r>-1&&(h>t||o==this.children.length-1)){t=h;for(let d=o+1;d<this.children.length;d++){let p=this.children[d];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=pn(p.dom);break}t+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}l=h}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:i}=this.domFromPos(e,0);if(t.nodeType!=1||i==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[i]}setSelection(e,t,i,r=!1){let s=Math.min(e,t),l=Math.max(e,t);for(let O=0,b=0;O<this.children.length;O++){let v=this.children[O],x=b+v.size;if(s>b&&l<x)return v.setSelection(e-b-v.border,t-b-v.border,i,r);b=x}let o=this.domFromPos(e,e?-1:1),c=t==e?o:this.domFromPos(t,t?-1:1),h=i.root.getSelection(),d=i.domSelectionRange(),p=!1;if((Vi||Tn)&&e==t){let{node:O,offset:b}=o;if(O.nodeType==3){if(p=!!(b&&O.nodeValue[b-1]==`
|
|
63
|
+
`),p&&b==O.nodeValue.length)for(let v=O,x;v;v=v.parentNode){if(x=v.nextSibling){x.nodeName=="BR"&&(o=c={node:x.parentNode,offset:pn(x)+1});break}let k=v.pmViewDesc;if(k&&k.node&&k.node.isBlock)break}}else{let v=O.childNodes[b-1];p=v&&(v.nodeName=="BR"||v.contentEditable=="false")}}if(Vi&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let O=d.focusNode.childNodes[d.focusOffset];O&&O.contentEditable=="false"&&(r=!0)}if(!(r||p&&Tn)&&Po(o.node,o.offset,d.anchorNode,d.anchorOffset)&&Po(c.node,c.offset,d.focusNode,d.focusOffset))return;let g=!1;if((h.extend||e==t)&&!(p&&Vi)){h.collapse(o.node,o.offset);try{e!=t&&h.extend(c.node,c.offset),g=!0}catch{}}if(!g){if(e>t){let b=o;o=c,c=b}let O=document.createRange();O.setEnd(c.node,c.offset),O.setStart(o.node,o.offset),h.removeAllRanges(),h.addRange(O)}}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 i=0,r=0;r<this.children.length;r++){let s=this.children[r],l=i+s.size;if(i==l?e<=l&&t>=i:e<l&&t>i){let o=i+s.border,c=l-s.border;if(e>=o&&t<=c){this.dirty=e==i||t==l?Oo:HA,e==o&&t==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Br:s.markDirty(e-o,t-o);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Oo:Br}i=l}this.dirty=Oo}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let i=e==1?Oo:HA;t.dirty<i&&(t.dirty=i)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class v2 extends uf{constructor(e,t,i,r){let s,l=t.type.toDOM;if(typeof l=="function"&&(l=l(i,()=>{if(!s)return r;if(s.parent)return s.parent.posBeforeChild(s)})),!t.type.spec.raw){if(l.nodeType!=1){let o=document.createElement("span");o.appendChild(l),l=o}l.contentEditable="false",l.classList.add("ProseMirror-widget")}super(e,[],l,null),this.widget=t,this.widget=t,s=this}matchesWidget(e){return this.dirty==qi&&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 ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Xj extends uf{constructor(e,t,i,r){super(e,[],t,null),this.textDOM=i,this.text=r}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 Do extends uf{constructor(e,t,i,r,s){super(e,[],i,r),this.mark=t,this.spec=s}static create(e,t,i,r){let s=r.nodeViews[t.type.name],l=s&&s(t,r,i);return(!l||!l.dom)&&(l=Io.renderSpec(document,t.type.spec.toDOM(t,i),null,t.attrs)),new Do(e,t,l.dom,l.contentDOM||l.dom,l)}parseRule(){return this.dirty&Br||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Br&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=qi){let i=this.parent;for(;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=qi}}slice(e,t,i){let r=Do.create(this.parent,this.mark,!0,i),s=this.children,l=this.size;t<l&&(s=g1(s,t,l,i)),e>0&&(s=g1(s,0,e,i));for(let o=0;o<s.length;o++)s[o].parent=r;return r.children=s,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Ql extends uf{constructor(e,t,i,r,s,l,o,c,h){super(e,[],s,l),this.node=t,this.outerDeco=i,this.innerDeco=r,this.nodeDOM=o}static create(e,t,i,r,s,l){let o=s.nodeViews[t.type.name],c,h=o&&o(t,s,()=>{if(!c)return l;if(c.parent)return c.parent.posBeforeChild(c)},i,r),d=h&&h.dom,p=h&&h.contentDOM;if(t.isText){if(!d)d=document.createTextNode(t.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:p}=Io.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!p&&!t.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),t.type.spec.draggable&&(d.draggable=!0));let g=d;return d=T2(d,i,t),h?c=new Ij(e,t,i,r,d,p||null,g,h,s,l+1):t.isText?new Ag(e,t,i,r,d,g,s):new Ql(e,t,i,r,d,p||null,g,s,l+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 i=this.children[t];if(this.dom.contains(i.dom.parentNode)){e.contentElement=i.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ne.empty)}return e}matchesNode(e,t,i){return this.dirty==qi&&e.eq(this.node)&&Kp(t,this.outerDeco)&&i.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let i=this.node.inlineContent,r=t,s=e.composing?this.localCompositionInfo(e,t):null,l=s&&s.pos>-1?s:null,o=s&&s.pos<0,c=new qj(this,l&&l.node,e);Uj(this.node,this.innerDeco,(h,d,p)=>{h.spec.marks?c.syncToMarks(h.spec.marks,i,e,d):h.type.side>=0&&!p&&c.syncToMarks(d==this.node.childCount?mt.none:this.node.child(d).marks,i,e,d),c.placeWidget(h,e,r)},(h,d,p,g)=>{c.syncToMarks(h.marks,i,e,g);let O;c.findNodeMatch(h,d,p,g)||o&&e.state.selection.from>r&&e.state.selection.to<r+h.nodeSize&&(O=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(h,d,p,O,e)||c.updateNextNode(h,d,p,e,g,r)||c.addNode(h,d,p,e,r),r+=h.nodeSize}),c.syncToMarks([],i,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Oo)&&(l&&this.protectLocalComposition(e,l),k2(this.contentDOM,this.children,e),oc&&Wj(this.dom))}localCompositionInfo(e,t){let{from:i,to:r}=e.state.selection;if(!(e.state.selection instanceof Ae)||i<t||r>t+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,o=Gj(this.node.content,l,i-t,r-t);return o<0?null:{node:s,pos:o,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:i,text:r}){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 l=new Xj(this,s,t,r);e.input.compositionNodes.push(l),this.children=g1(this.children,i,i+r.length,e,l)}update(e,t,i,r){return this.dirty==Br||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,i,r),!0)}updateInner(e,t,i,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=i,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=qi}updateOuterDeco(e){if(Kp(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,i=this.dom;this.dom=w2(this.dom,this.nodeDOM,m1(this.outerDeco,this.node,t),m1(e,this.node,t)),this.dom!=i&&(i.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.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function YA(n,e,t,i,r){T2(i,e,n);let s=new Ql(void 0,n,e,t,i,i,i,r,0);return s.contentDOM&&s.updateChildren(r,0),s}class Ag extends Ql{constructor(e,t,i,r,s,l,o){super(e,t,i,r,s,null,l,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,i,r){return this.dirty==Br||this.dirty!=qi&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=qi||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=qi,!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,i){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,i)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,i){let r=this.node.cut(e,t),s=document.createTextNode(r.text);return new Ag(this.parent,r,this.outerDeco,this.innerDeco,s,s,i)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Br)}get domAtom(){return!1}isText(e){return this.node.text==e}}class x2 extends uf{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==qi&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Ij extends Ql{constructor(e,t,i,r,s,l,o,c,h,d){super(e,t,i,r,s,l,o,h,d),this.spec=c}update(e,t,i,r){if(this.dirty==Br)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,t,i);return s&&this.updateInner(e,t,i,r),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,i,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,i,r){this.spec.setSelection?this.spec.setSelection(e,t,i.root):super.setSelection(e,t,i,r)}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 k2(n,e,t){let i=n.firstChild,r=!1;for(let s=0;s<e.length;s++){let l=e[s],o=l.dom;if(o.parentNode==n){for(;o!=i;)i=UA(i),r=!0;i=i.nextSibling}else r=!0,n.insertBefore(o,i);if(l instanceof Do){let c=i?i.previousSibling:n.lastChild;k2(l.contentDOM,l.children,t),i=c?c.nextSibling:n.firstChild}}for(;i;)i=UA(i),r=!0;r&&t.trackWrites==n&&(t.trackWrites=null)}const rh=function(n){n&&(this.nodeName=n)};rh.prototype=Object.create(null);const yo=[new rh];function m1(n,e,t){if(n.length==0)return yo;let i=t?yo[0]:new rh,r=[i];for(let s=0;s<n.length;s++){let l=n[s].type.attrs;if(l){l.nodeName&&r.push(i=new rh(l.nodeName));for(let o in l){let c=l[o];c!=null&&(t&&r.length==1&&r.push(i=new rh(e.isInline?"span":"div")),o=="class"?i.class=(i.class?i.class+" ":"")+c:o=="style"?i.style=(i.style?i.style+";":"")+c:o!="nodeName"&&(i[o]=c))}}}return r}function w2(n,e,t,i){if(t==yo&&i==yo)return e;let r=e;for(let s=0;s<i.length;s++){let l=i[s],o=t[s];if(s){let c;o&&o.nodeName==l.nodeName&&r!=n&&(c=r.parentNode)&&c.nodeName.toLowerCase()==l.nodeName||(c=document.createElement(l.nodeName),c.pmIsDeco=!0,c.appendChild(r),o=yo[0]),r=c}Vj(r,o||yo[0],l)}return r}function Vj(n,e,t){for(let i in e)i!="class"&&i!="style"&&i!="nodeName"&&!(i in t)&&n.removeAttribute(i);for(let i in t)i!="class"&&i!="style"&&i!="nodeName"&&t[i]!=e[i]&&n.setAttribute(i,t[i]);if(e.class!=t.class){let i=e.class?e.class.split(" ").filter(Boolean):[],r=t.class?t.class.split(" ").filter(Boolean):[];for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&n.classList.remove(i[s]);for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&n.classList.add(r[s]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=i.exec(e.style);)n.style.removeProperty(r[1])}t.style&&(n.style.cssText+=t.style)}}function T2(n,e,t){return w2(n,n,yo,m1(e,t,n.nodeType!=1))}function Kp(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function UA(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class qj{constructor(e,t,i){this.lock=t,this.view=i,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Hj(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let i=e;i<t;i++)this.top.children[i].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,i,r){let s=0,l=this.stack.length>>1,o=Math.min(l,e.length);for(;s<o&&(s==l-1?this.top:this.stack[s+1<<1]).matchesMark(e[s])&&e[s].type.spec.spanning!==!1;)s++;for(;s<l;)this.destroyRest(),this.top.dirty=qi,this.index=this.stack.pop(),this.top=this.stack.pop(),l--;for(;l<e.length;){this.stack.push(this.top,this.index+1);let c=-1,h=this.top.children.length;r<this.preMatch.index&&(h=Math.min(this.index+3,h));for(let d=this.index;d<h;d++){let p=this.top.children[d];if(p.matchesMark(e[l])&&!this.isLocked(p.dom)){c=d;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let d=Do.create(this.top,e[l],t,i);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,l++}}findNodeMatch(e,t,i,r){let s=-1,l;if(r>=this.preMatch.index&&(l=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&l.matchesNode(e,t,i))s=this.top.children.indexOf(l,this.index);else for(let o=this.index,c=Math.min(this.top.children.length,o+5);o<c;o++){let h=this.top.children[o];if(h.matchesNode(e,t,i)&&!this.preMatch.matched.has(h)){s=o;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,i,r,s){let l=this.top.children[r];return l.dirty==Br&&l.dom==l.contentDOM&&(l.dirty=Oo),l.update(e,t,i,s)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let i=e.pmViewDesc;if(i){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==i)return r}return-1}e=t}}updateNextNode(e,t,i,r,s,l){for(let o=this.index;o<this.top.children.length;o++){let c=this.top.children[o];if(c instanceof Ql){let h=this.preMatch.matched.get(c);if(h!=null&&h!=s)return!1;let d=c.dom,p,g=this.isLocked(d)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Br&&Kp(t,c.outerDeco));if(!g&&c.update(e,t,i,r))return this.destroyBetween(this.index,o),c.dom!=d&&(this.changed=!0),this.index++,!0;if(!g&&(p=this.recreateWrapper(c,e,t,i,r,l)))return this.destroyBetween(this.index,o),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Oo,p.updateChildren(r,l+1),p.dirty=qi),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,i,r,s,l){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Kp(i,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Ql.create(this.top,t,i,r,s,l);if(o.contentDOM){o.children=e.children,e.children=[];for(let c of o.children)c.parent=o}return e.destroy(),o}addNode(e,t,i,r,s){let l=Ql.create(this.top,e,t,i,r,s);l.contentDOM&&l.updateChildren(r,s+1),this.top.children.splice(this.index++,0,l),this.changed=!0}placeWidget(e,t,i){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let s=new v2(this.top,e,t,i);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Do;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Ag)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Tn||On)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let i=document.createElement(e);e=="IMG"&&(i.className="ProseMirror-separator",i.alt=""),e=="BR"&&(i.className="ProseMirror-trailingBreak");let r=new x2(this.top,[],i,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Hj(n,e){let t=e,i=t.children.length,r=n.childCount,s=new Map,l=[];e:for(;r>0;){let o;for(;;)if(i){let h=t.children[i-1];if(h instanceof Do)t=h,i=h.children.length;else{o=h,i--;break}}else{if(t==e)break e;i=t.parent.children.indexOf(t),t=t.parent}let c=o.node;if(c){if(c!=n.child(r-1))break;--r,s.set(o,r),l.push(o)}}return{index:r,matched:s,matches:l.reverse()}}function Yj(n,e){return n.type.side-e.type.side}function Uj(n,e,t,i){let r=e.locals(n),s=0;if(r.length==0){for(let h=0;h<n.childCount;h++){let d=n.child(h);i(d,r,e.forChild(s,d),h),s+=d.nodeSize}return}let l=0,o=[],c=null;for(let h=0;;){let d,p;for(;l<r.length&&r[l].to==s;){let x=r[l++];x.widget&&(d?(p||(p=[d])).push(x):d=x)}if(d)if(p){p.sort(Yj);for(let x=0;x<p.length;x++)t(p[x],h,!!c)}else t(d,h,!!c);let g,O;if(c)O=-1,g=c,c=null;else if(h<n.childCount)O=h,g=n.child(h++);else break;for(let x=0;x<o.length;x++)o[x].to<=s&&o.splice(x--,1);for(;l<r.length&&r[l].from<=s&&r[l].to>s;)o.push(r[l++]);let b=s+g.nodeSize;if(g.isText){let x=b;l<r.length&&r[l].from<x&&(x=r[l].from);for(let k=0;k<o.length;k++)o[k].to<x&&(x=o[k].to);x<b&&(c=g.cut(x-s),g=g.cut(0,x-s),b=x,O=-1)}else for(;l<r.length&&r[l].to<b;)l++;let v=g.isInline&&!g.isLeaf?o.filter(x=>!x.inline):o.slice();i(g,v,e.forChild(s,g),O),s=b}}function Wj(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Gj(n,e,t,i){for(let r=0,s=0;r<n.childCount&&s<=i;){let l=n.child(r++),o=s;if(s+=l.nodeSize,!l.isText)continue;let c=l.text;for(;r<n.childCount;){let h=n.child(r++);if(s+=h.nodeSize,!h.isText)break;c+=h.text}if(s>=t){if(s>=i&&c.slice(i-e.length-o,i-o)==e)return i-e.length;let h=o<i?c.lastIndexOf(e,i-o-1):-1;if(h>=0&&h+e.length+o>=t)return o+h;if(t==i&&c.length>=i+e.length-o&&c.slice(i-o,i-o+e.length)==e)return i}}return-1}function g1(n,e,t,i,r){let s=[];for(let l=0,o=0;l<n.length;l++){let c=n[l],h=o,d=o+=c.size;h>=t||d<=e?s.push(c):(h<e&&s.push(c.slice(0,e-h,i)),r&&(s.push(r),r=void 0),d>t&&s.push(c.slice(t-h,c.size,i)))}return s}function uv(n,e=null){let t=n.domSelectionRange(),i=n.state.doc;if(!t.focusNode)return null;let r=n.docView.nearestDesc(t.focusNode),s=r&&r.size==0,l=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(l<0)return null;let o=i.resolve(l),c,h;if(Cg(t)){for(c=l;r&&!r.node;)r=r.parent;let p=r.node;if(r&&p.isAtom&&Te.isSelectable(p)&&r.parent&&!(p.isInline&&kj(t.focusNode,t.focusOffset,r.dom))){let g=r.posBefore;h=new Te(l==g?o:i.resolve(g))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let p=l,g=l;for(let O=0;O<t.rangeCount;O++){let b=t.getRangeAt(O);p=Math.min(p,n.docView.posFromDOM(b.startContainer,b.startOffset,1)),g=Math.max(g,n.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(p<0)return null;[c,l]=g==n.state.selection.anchor?[g,p]:[p,g],o=i.resolve(l)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let d=i.resolve(c);if(!h){let p=e=="pointer"||n.state.selection.head<o.pos&&!s?1:-1;h=hv(n,d,o,p)}return h}function C2(n){return n.editable?n.hasFocus():M2(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function As(n,e=!1){let t=n.state.selection;if(A2(n,t),!!C2(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&On){let i=n.domSelectionRange(),r=n.domObserver.currentSelection;if(i.anchorNode&&r.anchorNode&&Po(i.anchorNode,i.anchorOffset,r.anchorNode,r.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Kj(n);else{let{anchor:i,head:r}=t,s,l;WA&&!(t instanceof Ae)&&(t.$from.parent.inlineContent||(s=GA(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(l=GA(n,t.to))),n.docView.setSelection(i,r,n,e),WA&&(s&&FA(s),l&&FA(l)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Fj(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const WA=Tn||On&&d2<63;function GA(n,e){let{node:t,offset:i}=n.docView.domFromPos(e,0),r=i<t.childNodes.length?t.childNodes[i]:null,s=i?t.childNodes[i-1]:null;if(Tn&&r&&r.contentEditable=="false")return Ly(r);if((!r||r.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(r)return Ly(r);if(s)return Ly(s)}}function Ly(n){return n.contentEditable="true",Tn&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function FA(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Fj(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),i=t.anchorNode,r=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=i||t.anchorOffset!=r)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!C2(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Kj(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,i=t.nodeName=="IMG";i?e.collapse(t.parentNode,pn(t)+1):e.collapse(t,0),!i&&!n.state.selection.visible&&ei&&Ml<=11&&(t.disabled=!0,t.disabled=!1)}function A2(n,e){if(e instanceof Te){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(KA(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else KA(n)}function KA(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function hv(n,e,t,i){return n.someProp("createSelectionBetween",r=>r(n,e,t))||Ae.between(e,t,i)}function JA(n){return n.editable&&!n.hasFocus()?!1:M2(n)}function M2(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Jj(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Po(e.node,e.offset,t.anchorNode,t.anchorOffset)}function O1(n,e){let{$anchor:t,$head:i}=n.selection,r=e>0?t.max(i):t.min(i),s=r.parent.inlineContent?r.depth?n.doc.resolve(e>0?r.after():r.before()):null:r;return s&&Pe.findFrom(s,e)}function dl(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function eM(n,e,t){let i=n.state.selection;if(i instanceof Ae)if(t.indexOf("s")>-1){let{$head:r}=i,s=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let l=n.state.doc.resolve(r.pos+s.nodeSize*(e<0?-1:1));return dl(n,new Ae(i.$anchor,l))}else if(i.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let r=O1(n.state,e);return r&&r instanceof Te?dl(n,r):!1}else if(!(Li&&t.indexOf("m")>-1)){let r=i.$head,s=r.textOffset?null:e<0?r.nodeBefore:r.nodeAfter,l;if(!s||s.isText)return!1;let o=e<0?r.pos-s.nodeSize:r.pos;return s.isAtom||(l=n.docView.descAt(o))&&!l.contentDOM?Te.isSelectable(s)?dl(n,new Te(e<0?n.state.doc.resolve(r.pos-s.nodeSize):r)):cf?dl(n,new Ae(n.state.doc.resolve(e<0?o:o+s.nodeSize))):!1:!1}}else return!1;else{if(i instanceof Te&&i.node.isInline)return dl(n,new Ae(e>0?i.$to:i.$from));{let r=O1(n.state,e);return r?dl(n,r):!1}}}function Jp(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function sh(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function La(n,e){return e<0?eX(n):tX(n)}function eX(n){let e=n.domSelectionRange(),t=e.focusNode,i=e.focusOffset;if(!t)return;let r,s,l=!1;for(Vi&&t.nodeType==1&&i<Jp(t)&&sh(t.childNodes[i],-1)&&(l=!0);;)if(i>0){if(t.nodeType!=1)break;{let o=t.childNodes[i-1];if(sh(o,-1))r=t,s=--i;else if(o.nodeType==3)t=o,i=t.nodeValue.length;else break}}else{if(Q2(t))break;{let o=t.previousSibling;for(;o&&sh(o,-1);)r=t.parentNode,s=pn(o),o=o.previousSibling;if(o)t=o,i=Jp(t);else{if(t=t.parentNode,t==n.dom)break;i=0}}}l?y1(n,t,i):r&&y1(n,r,s)}function tX(n){let e=n.domSelectionRange(),t=e.focusNode,i=e.focusOffset;if(!t)return;let r=Jp(t),s,l;for(;;)if(i<r){if(t.nodeType!=1)break;let o=t.childNodes[i];if(sh(o,1))s=t,l=++i;else break}else{if(Q2(t))break;{let o=t.nextSibling;for(;o&&sh(o,1);)s=o.parentNode,l=pn(o)+1,o=o.nextSibling;if(o)t=o,i=0,r=Jp(t);else{if(t=t.parentNode,t==n.dom)break;i=r=0}}}s&&y1(n,s,l)}function Q2(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function nX(n,e){for(;n&&e==n.childNodes.length&&!af(n);)e=pn(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function iX(n,e){for(;n&&!e&&!af(n);)e=pn(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function y1(n,e,t){if(e.nodeType!=3){let s,l;(l=nX(e,t))?(e=l,t=0):(s=iX(e,t))&&(e=s,t=s.nodeValue.length)}let i=n.domSelection();if(!i)return;if(Cg(i)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),i.removeAllRanges(),i.addRange(s)}else i.extend&&i.extend(e,t);n.domObserver.setCurSelection();let{state:r}=n;setTimeout(()=>{n.state==r&&As(n)},50)}function tM(n,e){let t=n.state.doc.resolve(e);if(!(On||p2)&&t.parent.inlineContent){let r=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),l=(s.top+s.bottom)/2;if(l>r.top&&l<r.bottom&&Math.abs(s.left-r.left)>1)return s.left<r.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),l=(s.top+s.bottom)/2;if(l>r.top&&l<r.bottom&&Math.abs(s.left-r.left)>1)return s.left>r.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function nM(n,e,t){let i=n.state.selection;if(i instanceof Ae&&!i.empty||t.indexOf("s")>-1||Li&&t.indexOf("m")>-1)return!1;let{$from:r,$to:s}=i;if(!r.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let l=O1(n.state,e);if(l&&l instanceof Te)return dl(n,l)}if(!r.parent.inlineContent){let l=e<0?r:s,o=i instanceof vi?Pe.near(l,e):Pe.findFrom(l,e);return o?dl(n,o):!1}return!1}function iM(n,e){if(!(n.state.selection instanceof Ae))return!0;let{$head:t,$anchor:i,empty:r}=n.state.selection;if(!t.sameParent(i))return!0;if(!r)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let l=n.state.tr;return e<0?l.delete(t.pos-s.nodeSize,t.pos):l.delete(t.pos,t.pos+s.nodeSize),n.dispatch(l),!0}return!1}function rM(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function rX(n){if(!Tn||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let i=e.firstChild;rM(n,i,"true"),setTimeout(()=>rM(n,i,"false"),20)}return!1}function sX(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function lX(n,e){let t=e.keyCode,i=sX(e);if(t==8||Li&&t==72&&i=="c")return iM(n,-1)||La(n,-1);if(t==46&&!e.shiftKey||Li&&t==68&&i=="c")return iM(n,1)||La(n,1);if(t==13||t==27)return!0;if(t==37||Li&&t==66&&i=="c"){let r=t==37?tM(n,n.state.selection.from)=="ltr"?-1:1:-1;return eM(n,r,i)||La(n,r)}else if(t==39||Li&&t==70&&i=="c"){let r=t==39?tM(n,n.state.selection.from)=="ltr"?1:-1:1;return eM(n,r,i)||La(n,r)}else{if(t==38||Li&&t==80&&i=="c")return nM(n,-1,i)||La(n,-1);if(t==40||Li&&t==78&&i=="c")return rX(n)||nM(n,1,i)||La(n,1);if(i==(Li?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function fv(n,e){n.someProp("transformCopied",O=>{e=O(e,n)});let t=[],{content:i,openStart:r,openEnd:s}=e;for(;r>1&&s>1&&i.childCount==1&&i.firstChild.childCount==1;){r--,s--;let O=i.firstChild;t.push(O.type.name,O.attrs!=O.type.defaultAttrs?O.attrs:null),i=O.content}let l=n.someProp("clipboardSerializer")||Io.fromSchema(n.state.schema),o=N2(),c=o.createElement("div");c.appendChild(l.serializeFragment(i,{document:o}));let h=c.firstChild,d,p=0;for(;h&&h.nodeType==1&&(d=D2[h.nodeName.toLowerCase()]);){for(let O=d.length-1;O>=0;O--){let b=o.createElement(d[O]);for(;c.firstChild;)b.appendChild(c.firstChild);c.appendChild(b),p++}h=c.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${r} ${s}${p?` -${p}`:""} ${JSON.stringify(t)}`);let g=n.someProp("clipboardTextSerializer",O=>O(e,n))||e.content.textBetween(0,e.content.size,`
|
|
64
|
+
|
|
65
|
+
`);return{dom:c,text:g,slice:e}}function E2(n,e,t,i,r){let s=r.parent.type.spec.code,l,o;if(!t&&!e)return null;let c=!!e&&(i||s||!t);if(c){if(n.someProp("transformPastedText",g=>{e=g(e,s||i,n)}),s)return o=new pe(ne.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
66
|
+
`))),0,0),n.someProp("transformPasted",g=>{o=g(o,n,!0)}),o;let p=n.someProp("clipboardTextParser",g=>g(e,r,i,n));if(p)o=p;else{let g=r.marks(),{schema:O}=n.state,b=Io.fromSchema(O);l=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let x=l.appendChild(document.createElement("p"));v&&x.appendChild(b.serializeNode(O.text(v,g)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),l=uX(t),cf&&hX(l);let h=l&&l.querySelector("[data-pm-slice]"),d=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let p=+d[3];p>0;p--){let g=l.firstChild;for(;g&&g.nodeType!=1;)g=g.nextSibling;if(!g)break;l=g}if(o||(o=(n.someProp("clipboardParser")||n.someProp("domParser")||Al.fromSchema(n.state.schema)).parseSlice(l,{preserveWhitespace:!!(c||d),context:r,ruleFromNode(g){return g.nodeName=="BR"&&!g.nextSibling&&g.parentNode&&!oX.test(g.parentNode.nodeName)?{ignore:!0}:null}})),d)o=fX(sM(o,+d[1],+d[2]),d[4]);else if(o=pe.maxOpen(aX(o.content,r),!0),o.openStart||o.openEnd){let p=0,g=0;for(let O=o.content.firstChild;p<o.openStart&&!O.type.spec.isolating;p++,O=O.firstChild);for(let O=o.content.lastChild;g<o.openEnd&&!O.type.spec.isolating;g++,O=O.lastChild);o=sM(o,p,g)}return n.someProp("transformPasted",p=>{o=p(o,n,c)}),o}const oX=/^(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 aX(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.index(t)),s,l=[];if(n.forEach(o=>{if(!l)return;let c=r.findWrapping(o.type),h;if(!c)return l=null;if(h=l.length&&s.length&&R2(c,s,o,l[l.length-1],0))l[l.length-1]=h;else{l.length&&(l[l.length-1]=P2(l[l.length-1],s.length));let d=$2(o,c);l.push(d),r=r.matchType(d.type),s=c}}),l)return ne.from(l)}return n}function $2(n,e,t=0){for(let i=e.length-1;i>=t;i--)n=e[i].create(null,ne.from(n));return n}function R2(n,e,t,i,r){if(r<n.length&&r<e.length&&n[r]==e[r]){let s=R2(n,e,t,i.lastChild,r+1);if(s)return i.copy(i.content.replaceChild(i.childCount-1,s));if(i.contentMatchAt(i.childCount).matchType(r==n.length-1?t.type:n[r+1]))return i.copy(i.content.append(ne.from($2(t,n,r+1))))}}function P2(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,P2(n.lastChild,e-1)),i=n.contentMatchAt(n.childCount).fillBefore(ne.empty,!0);return n.copy(t.append(i))}function b1(n,e,t,i,r,s){let l=e<0?n.firstChild:n.lastChild,o=l.content;return n.childCount>1&&(s=0),r<i-1&&(o=b1(o,e,t,i,r+1,s)),r>=t&&(o=e<0?l.contentMatchAt(0).fillBefore(o,s<=r).append(o):o.append(l.contentMatchAt(l.childCount).fillBefore(ne.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,l.copy(o))}function sM(n,e,t){return e<n.openStart&&(n=new pe(b1(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new pe(b1(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const D2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let lM=null;function N2(){return lM||(lM=document.implementation.createHTMLDocument("title"))}let _y=null;function cX(n){let e=window.trustedTypes;return e?(_y||(_y=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),_y.createHTML(n)):n}function uX(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=N2().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(n),r;if((r=i&&D2[i[1].toLowerCase()])&&(n=r.map(s=>"<"+s+">").join("")+n+r.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=cX(n),r)for(let s=0;s<r.length;s++)t=t.querySelector(r[s])||t;return t}function hX(n){let e=n.querySelectorAll(On?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let i=e[t];i.childNodes.length==1&&i.textContent==" "&&i.parentNode&&i.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),i)}}function fX(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,i;try{i=JSON.parse(e)}catch{return n}let{content:r,openStart:s,openEnd:l}=n;for(let o=i.length-2;o>=0;o-=2){let c=t.nodes[i[o]];if(!c||c.hasRequiredAttrs())break;r=ne.from(c.create(i[o+1],r)),s++,l++}return new pe(r,s,l)}const zn={},Ln={},dX={touchstart:!0,touchmove:!0};let pX=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function mX(n){for(let e in zn){let t=zn[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=i=>{OX(n,i)&&!dv(n,i)&&(n.editable||!(i.type in Ln))&&t(n,i)},dX[e]?{passive:!0}:void 0)}Tn&&n.dom.addEventListener("input",()=>null),S1(n)}function wl(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function gX(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function S1(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=i=>dv(n,i))})}function dv(n,e){return n.someProp("handleDOMEvents",t=>{let i=t[e.type];return i?i(n,e)||e.defaultPrevented:!1})}function OX(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function yX(n,e){!dv(n,e)&&zn[e.type]&&(n.editable||!(e.type in Ln))&&zn[e.type](n,e)}Ln.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!L2(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(xs&&On&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),oc&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let i=Date.now();n.input.lastIOSEnter=i,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==i&&(n.someProp("handleKeyDown",r=>r(n,fo(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",i=>i(n,t))||lX(n,t)?t.preventDefault():wl(n,"key")};Ln.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ln.keypress=(n,e)=>{let t=e;if(L2(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Li&&t.metaKey)return;if(n.someProp("handleKeyPress",r=>r(n,t))){t.preventDefault();return}let i=n.state.selection;if(!(i instanceof Ae)||!i.$from.sameParent(i.$to)){let r=String.fromCharCode(t.charCode),s=()=>n.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!n.someProp("handleTextInput",l=>l(n,i.$from.pos,i.$to.pos,r,s))&&n.dispatch(s()),t.preventDefault()}};function Mg(n){return{left:n.clientX,top:n.clientY}}function bX(n,e){let t=e.x-n.clientX,i=e.y-n.clientY;return t*t+i*i<100}function pv(n,e,t,i,r){if(i==-1)return!1;let s=n.state.doc.resolve(i);for(let l=s.depth+1;l>0;l--)if(n.someProp(e,o=>l>s.depth?o(n,t,s.nodeAfter,s.before(l),r,!0):o(n,t,s.node(l),s.before(l),r,!1)))return!0;return!1}function Ua(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let i=n.state.tr.setSelection(e);i.setMeta("pointer",!0),n.dispatch(i)}function SX(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),i=t.nodeAfter;return i&&i.isAtom&&Te.isSelectable(i)?(Ua(n,new Te(t)),!0):!1}function vX(n,e){if(e==-1)return!1;let t=n.state.selection,i,r;t instanceof Te&&(i=t.node);let s=n.state.doc.resolve(e);for(let l=s.depth+1;l>0;l--){let o=l>s.depth?s.nodeAfter:s.node(l);if(Te.isSelectable(o)){i&&t.$from.depth>0&&l>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?r=s.before(t.$from.depth):r=s.before(l);break}}return r!=null?(Ua(n,Te.create(n.state.doc,r)),!0):!1}function xX(n,e,t,i,r){return pv(n,"handleClickOn",e,t,i)||n.someProp("handleClick",s=>s(n,e,i))||(r?vX(n,t):SX(n,t))}function kX(n,e,t,i){return pv(n,"handleDoubleClickOn",e,t,i)||n.someProp("handleDoubleClick",r=>r(n,e,i))}function wX(n,e,t,i){return pv(n,"handleTripleClickOn",e,t,i)||n.someProp("handleTripleClick",r=>r(n,e,i))||TX(n,t,i)}function TX(n,e,t){if(t.button!=0)return!1;let i=n.state.doc;if(e==-1)return i.inlineContent?(Ua(n,Ae.create(i,0,i.content.size)),!0):!1;let r=i.resolve(e);for(let s=r.depth+1;s>0;s--){let l=s>r.depth?r.nodeAfter:r.node(s),o=r.before(s);if(l.inlineContent)Ua(n,Ae.create(i,o+1,o+1+l.content.size));else if(Te.isSelectable(l))Ua(n,Te.create(i,o));else continue;return!0}}function mv(n){return em(n)}const z2=Li?"metaKey":"ctrlKey";zn.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let i=mv(n),r=Date.now(),s="singleClick";r-n.input.lastClick.time<500&&bX(t,n.input.lastClick)&&!t[z2]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:r,x:t.clientX,y:t.clientY,type:s,button:t.button};let l=n.posAtCoords(Mg(t));l&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new CX(n,l,t,!!i)):(s=="doubleClick"?kX:wX)(n,l.pos,l.inside,t)?t.preventDefault():wl(n,"pointer"))};class CX{constructor(e,t,i,r){this.view=e,this.pos=t,this.event=i,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!i[z2],this.allowDefault=i.shiftKey;let s,l;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),l=t.inside;else{let d=e.state.doc.resolve(t.pos);s=d.parent,l=d.depth?d.before():0}const o=r?null:i.target,c=o?e.docView.nearestDesc(o,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:h}=e.state;i.button==0&&(s.type.spec.draggable&&s.type.spec.selectable!==!1||h instanceof Te&&h.from<=l&&h.to>l)&&(this.mightDrag={node:s,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Vi&&!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)),wl(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(()=>As(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(Mg(e))),this.updateAllowDefault(e),this.allowDefault||!t?wl(this.view,"pointer"):xX(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Tn&&this.mightDrag&&!this.mightDrag.node.isAtom||On&&!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)?(Ua(this.view,Pe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):wl(this.view,"pointer")}move(e){this.updateAllowDefault(e),wl(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)}}zn.touchstart=n=>{n.input.lastTouch=Date.now(),mv(n),wl(n,"pointer")};zn.touchmove=n=>{n.input.lastTouch=Date.now(),wl(n,"pointer")};zn.contextmenu=n=>mv(n);function L2(n,e){return n.composing?!0:Tn&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const AX=xs?5e3:-1;Ln.compositionstart=Ln.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof Ae&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(i=>i.type.spec.inclusive===!1)||On&&p2&&MX(n)))n.markCursor=n.state.storedMarks||t.marks(),em(n,!0),n.markCursor=null;else if(em(n,!e.selection.empty),Vi&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let i=n.domSelectionRange();for(let r=i.focusNode,s=i.focusOffset;r&&r.nodeType==1&&s!=0;){let l=s<0?r.lastChild:r.childNodes[s-1];if(!l)break;if(l.nodeType==3){let o=n.domSelection();o&&o.collapse(l,l.nodeValue.length);break}else r=l,s=-1}}n.input.composing=!0}_2(n,AX)};function MX(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let i=e.childNodes[t];return i.nodeType==1&&i.contentEditable=="false"}Ln.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,_2(n,20))};function _2(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>em(n),e))}function B2(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=EX());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function QX(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=vj(e.focusNode,e.focusOffset),i=xj(e.focusNode,e.focusOffset);if(t&&i&&t!=i){let r=i.pmViewDesc,s=n.domObserver.lastChangedTextNode;if(t==s||i==s)return s;if(!r||!r.isText(i.nodeValue))return i;if(n.input.compositionNode==i){let l=t.pmViewDesc;if(!(!l||!l.isText(t.nodeValue)))return i}}return t||i}function EX(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function em(n,e=!1){if(!(xs&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),B2(n),e||n.docView&&n.docView.dirty){let t=uv(n),i=n.state.selection;return t&&!t.eq(i)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!i.$from.node(i.$from.sharedDepth(i.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function $X(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let i=getSelection(),r=document.createRange();r.selectNodeContents(e),n.dom.blur(),i.removeAllRanges(),i.addRange(r),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Ah=ei&&Ml<15||oc&&Cj<604;zn.copy=Ln.cut=(n,e)=>{let t=e,i=n.state.selection,r=t.type=="cut";if(i.empty)return;let s=Ah?null:t.clipboardData,l=i.content(),{dom:o,text:c}=fv(n,l);s?(t.preventDefault(),s.clearData(),s.setData("text/html",o.innerHTML),s.setData("text/plain",c)):$X(n,o),r&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function RX(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function PX(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,i=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus();let r=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),i.parentNode&&i.parentNode.removeChild(i),t?Mh(n,i.value,null,r,e):Mh(n,i.textContent,i.innerHTML,r,e)},50)}function Mh(n,e,t,i,r){let s=E2(n,e,t,i,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,r,s||pe.empty)))return!0;if(!s)return!1;let l=RX(s),o=l?n.state.tr.replaceSelectionWith(l,i):n.state.tr.replaceSelection(s);return n.dispatch(o.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Z2(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ln.paste=(n,e)=>{let t=e;if(n.composing&&!xs)return;let i=Ah?null:t.clipboardData,r=n.input.shiftKey&&n.input.lastKeyCode!=45;i&&Mh(n,Z2(i),i.getData("text/html"),r,t)?t.preventDefault():PX(n,t)};class j2{constructor(e,t,i){this.slice=e,this.move=t,this.node=i}}const DX=Li?"altKey":"ctrlKey";function X2(n,e){let t;return n.someProp("dragCopies",i=>{t=t||i(e)}),t!=null?!t:!e[DX]}zn.dragstart=(n,e)=>{let t=e,i=n.input.mouseDown;if(i&&i.done(),!t.dataTransfer)return;let r=n.state.selection,s=r.empty?null:n.posAtCoords(Mg(t)),l;if(!(s&&s.pos>=r.from&&s.pos<=(r instanceof Te?r.to-1:r.to))){if(i&&i.mightDrag)l=Te.create(n.state.doc,i.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let p=n.docView.nearestDesc(t.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(l=Te.create(n.state.doc,p.posBefore))}}let o=(l||n.state.selection).content(),{dom:c,text:h,slice:d}=fv(n,o);(!t.dataTransfer.files.length||!On||d2>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ah?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ah||t.dataTransfer.setData("text/plain",h),n.dragging=new j2(d,X2(n,t),l)};zn.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ln.dragover=Ln.dragenter=(n,e)=>e.preventDefault();Ln.drop=(n,e)=>{try{NX(n,e,n.dragging)}finally{n.dragging=null}};function NX(n,e,t){if(!e.dataTransfer)return;let i=n.posAtCoords(Mg(e));if(!i)return;let r=n.state.doc.resolve(i.pos),s=t&&t.slice;s?n.someProp("transformPasted",O=>{s=O(s,n,!1)}):s=E2(n,Z2(e.dataTransfer),Ah?null:e.dataTransfer.getData("text/html"),!1,r);let l=!!(t&&X2(n,e));if(n.someProp("handleDrop",O=>O(n,e,s||pe.empty,l))){e.preventDefault();return}if(!s)return;e.preventDefault();let o=s?HR(n.state.doc,r.pos,s):r.pos;o==null&&(o=r.pos);let c=n.state.tr;if(l){let{node:O}=t;O?O.replace(c):c.deleteSelection()}let h=c.mapping.map(o),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(d?c.replaceRangeWith(h,h,s.content.firstChild):c.replaceRange(h,h,s),c.doc.eq(p))return;let g=c.doc.resolve(h);if(d&&Te.isSelectable(s.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Te(g));else{let O=c.mapping.map(o);c.mapping.maps[c.mapping.maps.length-1].forEach((b,v,x,k)=>O=k),c.setSelection(hv(n,g,c.doc.resolve(O)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))}zn.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&As(n)},20))};zn.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};zn.beforeinput=(n,e)=>{if(On&&xs&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:i}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=i||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,fo(8,"Backspace")))))return;let{$cursor:r}=n.state.selection;r&&r.pos>0&&n.dispatch(n.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let n in Ln)zn[n]=Ln[n];function Qh(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}let oM=class I2{constructor(e,t){this.toDOM=e,this.spec=t||Co,this.side=this.spec.side||0}map(e,t,i,r){let{pos:s,deleted:l}=e.mapResult(t.from+r,this.side<0?-1:1);return l?null:new ki(s-i,s-i,this)}valid(){return!0}eq(e){return this==e||e instanceof I2&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Qh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}};class El{constructor(e,t){this.attrs=e,this.spec=t||Co}map(e,t,i,r){let s=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-i,l=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-i;return s>=l?null:new ki(s,l,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof El&&Qh(this.attrs,e.attrs)&&Qh(this.spec,e.spec)}static is(e){return e.type instanceof El}destroy(){}}let zX=class V2{constructor(e,t){this.attrs=e,this.spec=t||Co}map(e,t,i,r){let s=e.mapResult(t.from+r,1);if(s.deleted)return null;let l=e.mapResult(t.to+r,-1);return l.deleted||l.pos<=s.pos?null:new ki(s.pos-i,l.pos-i,this)}valid(e,t){let{index:i,offset:r}=e.content.findIndex(t.from),s;return r==t.from&&!(s=e.child(i)).isText&&r+s.nodeSize==t.to}eq(e){return this==e||e instanceof V2&&Qh(this.attrs,e.attrs)&&Qh(this.spec,e.spec)}destroy(){}},ki=class Uu{constructor(e,t,i){this.from=e,this.to=t,this.type=i}copy(e,t){return new Uu(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,i){return this.type.map(e,this,t,i)}static widget(e,t,i){return new Uu(e,e,new oM(t,i))}static inline(e,t,i,r){return new Uu(e,t,new El(i,r))}static node(e,t,i,r){return new Uu(e,t,new zX(i,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof El}get widget(){return this.type instanceof oM}};const Ba=[],Co={};class vt{constructor(e,t){this.local=e.length?e:Ba,this.children=t.length?t:Ba}static create(e,t){return t.length?tm(t,e,0,Co):xn}find(e,t,i){let r=[];return this.findInner(e??0,t??1e9,r,0,i),r}findInner(e,t,i,r,s){for(let l=0;l<this.local.length;l++){let o=this.local[l];o.from<=t&&o.to>=e&&(!s||s(o.spec))&&i.push(o.copy(o.from+r,o.to+r))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<t&&this.children[l+1]>e){let o=this.children[l]+1;this.children[l+2].findInner(e-o,t-o,i,r+o,s)}}map(e,t,i){return this==xn||e.maps.length==0?this:this.mapInner(e,t,0,0,i||Co)}mapInner(e,t,i,r,s){let l;for(let o=0;o<this.local.length;o++){let c=this.local[o].map(e,i,r);c&&c.type.valid(t,c)?(l||(l=[])).push(c):s.onRemove&&s.onRemove(this.local[o].spec)}return this.children.length?LX(this.children,l||[],e,t,i,r,s):l?new vt(l.sort(Ao),Ba):xn}add(e,t){return t.length?this==xn?vt.create(e,t):this.addInner(e,t,0):this}addInner(e,t,i){let r,s=0;e.forEach((o,c)=>{let h=c+i,d;if(d=H2(t,o,h)){for(r||(r=this.children.slice());s<r.length&&r[s]<c;)s+=3;r[s]==c?r[s+2]=r[s+2].addInner(o,d,h+1):r.splice(s,0,c,c+o.nodeSize,tm(d,o,h+1,Co)),s+=3}});let l=q2(s?Y2(t):t,-i);for(let o=0;o<l.length;o++)l[o].type.valid(e,l[o])||l.splice(o--,1);return new vt(l.length?this.local.concat(l).sort(Ao):this.local,r||this.children)}remove(e){return e.length==0||this==xn?this:this.removeInner(e,0)}removeInner(e,t){let i=this.children,r=this.local;for(let s=0;s<i.length;s+=3){let l,o=i[s]+t,c=i[s+1]+t;for(let d=0,p;d<e.length;d++)(p=e[d])&&p.from>o&&p.to<c&&(e[d]=null,(l||(l=[])).push(p));if(!l)continue;i==this.children&&(i=this.children.slice());let h=i[s+2].removeInner(l,o+1);h!=xn?i[s+2]=h:(i.splice(s,3),s-=3)}if(r.length){for(let s=0,l;s<e.length;s++)if(l=e[s])for(let o=0;o<r.length;o++)r[o].eq(l,t)&&(r==this.local&&(r=this.local.slice()),r.splice(o--,1))}return i==this.children&&r==this.local?this:r.length||i.length?new vt(r,i):xn}forChild(e,t){if(this==xn)return this;if(t.isLeaf)return vt.empty;let i,r;for(let o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(i=this.children[o+2]);break}let s=e+1,l=s+t.content.size;for(let o=0;o<this.local.length;o++){let c=this.local[o];if(c.from<l&&c.to>s&&c.type instanceof El){let h=Math.max(s,c.from)-s,d=Math.min(l,c.to)-s;h<d&&(r||(r=[])).push(c.copy(h,d))}}if(r){let o=new vt(r.sort(Ao),Ba);return i?new yl([o,i]):o}return i||xn}eq(e){if(this==e)return!0;if(!(e instanceof vt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return gv(this.localsInner(e))}localsInner(e){if(this==xn)return Ba;if(e.inlineContent||!this.local.some(El.is))return this.local;let t=[];for(let i=0;i<this.local.length;i++)this.local[i].type instanceof El||t.push(this.local[i]);return t}forEachSet(e){e(this)}}vt.empty=new vt([],[]);vt.removeOverlap=gv;const xn=vt.empty;class yl{constructor(e){this.members=e}map(e,t){const i=this.members.map(r=>r.map(e,t,Co));return yl.from(i)}forChild(e,t){if(t.isLeaf)return vt.empty;let i=[];for(let r=0;r<this.members.length;r++){let s=this.members[r].forChild(e,t);s!=xn&&(s instanceof yl?i=i.concat(s.members):i.push(s))}return yl.from(i)}eq(e){if(!(e instanceof yl)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,i=!0;for(let r=0;r<this.members.length;r++){let s=this.members[r].localsInner(e);if(s.length)if(!t)t=s;else{i&&(t=t.slice(),i=!1);for(let l=0;l<s.length;l++)t.push(s[l])}}return t?gv(i?t:t.sort(Ao)):Ba}static from(e){switch(e.length){case 0:return xn;case 1:return e[0];default:return new yl(e.every(t=>t instanceof vt)?e:e.reduce((t,i)=>t.concat(i instanceof vt?i:i.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function LX(n,e,t,i,r,s,l){let o=n.slice();for(let h=0,d=s;h<t.maps.length;h++){let p=0;t.maps[h].forEach((g,O,b,v)=>{let x=v-b-(O-g);for(let k=0;k<o.length;k+=3){let C=o[k+1];if(C<0||g>C+d-p)continue;let A=o[k]+d-p;O>=A?o[k+1]=g<=A?-2:-1:g>=d&&x&&(o[k]+=x,o[k+1]+=x)}p+=x}),d=t.maps[h].map(d,-1)}let c=!1;for(let h=0;h<o.length;h+=3)if(o[h+1]<0){if(o[h+1]==-2){c=!0,o[h+1]=-1;continue}let d=t.map(n[h]+s),p=d-r;if(p<0||p>=i.content.size){c=!0;continue}let g=t.map(n[h+1]+s,-1),O=g-r,{index:b,offset:v}=i.content.findIndex(p),x=i.maybeChild(b);if(x&&v==p&&v+x.nodeSize==O){let k=o[h+2].mapInner(t,x,d+1,n[h]+s+1,l);k!=xn?(o[h]=p,o[h+1]=O,o[h+2]=k):(o[h+1]=-2,c=!0)}else c=!0}if(c){let h=_X(o,n,e,t,r,s,l),d=tm(h,i,0,l);e=d.local;for(let p=0;p<o.length;p+=3)o[p+1]<0&&(o.splice(p,3),p-=3);for(let p=0,g=0;p<d.children.length;p+=3){let O=d.children[p];for(;g<o.length&&o[g]<O;)g+=3;o.splice(g,0,d.children[p],d.children[p+1],d.children[p+2])}}return new vt(e.sort(Ao),o)}function q2(n,e){if(!e||!n.length)return n;let t=[];for(let i=0;i<n.length;i++){let r=n[i];t.push(new ki(r.from+e,r.to+e,r.type))}return t}function _X(n,e,t,i,r,s,l){function o(c,h){for(let d=0;d<c.local.length;d++){let p=c.local[d].map(i,r,h);p?t.push(p):l.onRemove&&l.onRemove(c.local[d].spec)}for(let d=0;d<c.children.length;d+=3)o(c.children[d+2],c.children[d]+h+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&o(n[c+2],e[c]+s+1);return t}function H2(n,e,t){if(e.isLeaf)return null;let i=t+e.nodeSize,r=null;for(let s=0,l;s<n.length;s++)(l=n[s])&&l.from>t&&l.to<i&&((r||(r=[])).push(l),n[s]=null);return r}function Y2(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function tm(n,e,t,i){let r=[],s=!1;e.forEach((o,c)=>{let h=H2(n,o,c+t);if(h){s=!0;let d=tm(h,o,t+c+1,i);d!=xn&&r.push(c,c+o.nodeSize,d)}});let l=q2(s?Y2(n):n,-t).sort(Ao);for(let o=0;o<l.length;o++)l[o].type.valid(e,l[o])||(i.onRemove&&i.onRemove(l[o].spec),l.splice(o--,1));return l.length||r.length?new vt(l,r):xn}function Ao(n,e){return n.from-e.from||n.to-e.to}function gv(n){let e=n;for(let t=0;t<e.length-1;t++){let i=e[t];if(i.from!=i.to)for(let r=t+1;r<e.length;r++){let s=e[r];if(s.from==i.from){s.to!=i.to&&(e==n&&(e=n.slice()),e[r]=s.copy(s.from,i.to),aM(e,r+1,s.copy(i.to,s.to)));continue}else{s.from<i.to&&(e==n&&(e=n.slice()),e[t]=i.copy(i.from,s.from),aM(e,r,i.copy(s.from,i.to)));break}}}return e}function aM(n,e,t){for(;e<n.length&&Ao(t,n[e])>0;)e++;n.splice(e,0,t)}function By(n){let e=[];return n.someProp("decorations",t=>{let i=t(n.state);i&&i!=xn&&e.push(i)}),n.cursorWrapper&&e.push(vt.create(n.state.doc,[n.cursorWrapper.deco])),yl.from(e)}const BX={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ZX=ei&&Ml<=11;class jX{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}}let XX=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new jX,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(i=>{for(let r=0;r<i.length;r++)this.queue.push(i[r]);ei&&Ml<=11&&i.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():Tn&&e.composing&&i.some(r=>r.type=="childList"&&r.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ZX&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.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,BX)),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;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.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(JA(this.view)){if(this.suppressingSelectionUpdates)return As(this.view);if(ei&&Ml<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Po(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,i;for(let s=e.focusNode;s;s=lc(s))t.add(s);for(let s=e.anchorNode;s;s=lc(s))if(t.has(s)){i=s;break}let r=i&&this.view.docView.nearestDesc(i);if(r&&r.ignoreMutation({type:"selection",target:i.nodeType==3?i.parentNode:i}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let i=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(i)&&JA(e)&&!this.ignoreSelectionChange(i),s=-1,l=-1,o=!1,c=[];if(e.editable)for(let d=0;d<t.length;d++){let p=this.registerMutation(t[d],c);p&&(s=s<0?p.from:Math.min(p.from,s),l=l<0?p.to:Math.max(p.to,l),p.typeOver&&(o=!0))}if(c.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of c)if(d.nodeName=="BR"&&d.parentNode){let p=d.nextSibling;for(;p&&p.nodeType==1;){if(p.contentEditable=="false"){d.parentNode.removeChild(d);break}p=p.firstChild}}}else if(Vi&&c.length){let d=c.filter(p=>p.nodeName=="BR");if(d.length==2){let[p,g]=d;p.parentNode&&p.parentNode.parentNode==g.parentNode?g.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let g of d){let O=g.parentNode;O&&O.nodeName=="LI"&&(!p||qX(e,p)!=O)&&g.remove()}}}let h=null;s<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Cg(i)&&(h=uv(e))&&h.eq(Pe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,As(e),this.currentSelection.set(i),e.scrollToSelection()):(s>-1||r)&&(s>-1&&(e.docView.markDirty(s,l),IX(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,HX(e,c)),this.handleDOMChange(s,l,o,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(i)||As(e),this.currentSelection.set(i))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let i=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(i==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!i||i.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let p=e.addedNodes[d];t.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}if(i.contentDOM&&i.contentDOM!=i.dom&&!i.contentDOM.contains(e.target))return{from:i.posBefore,to:i.posAfter};let r=e.previousSibling,s=e.nextSibling;if(ei&&Ml<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:p,nextSibling:g}=e.addedNodes[d];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(r=p),(!g||Array.prototype.indexOf.call(e.addedNodes,g)<0)&&(s=g)}let l=r&&r.parentNode==e.target?pn(r)+1:0,o=i.localPosFromDOM(e.target,l,-1),c=s&&s.parentNode==e.target?pn(s):e.target.childNodes.length,h=i.localPosFromDOM(e.target,c,1);return{from:o,to:h}}else return e.type=="attributes"?{from:i.posAtStart-i.border,to:i.posAtEnd+i.border}:(this.lastChangedTextNode=e.target,{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},cM=new WeakMap,uM=!1;function IX(n){if(!cM.has(n)&&(cM.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=Vi,uM)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),uM=!0}}function hM(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,l=n.domAtPos(n.state.selection.anchor);return Po(l.node,l.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function VX(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return hM(n,r)}let t;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",i,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",i,!0),t?hM(n,t):null}function qX(n,e){for(let t=e.parentNode;t&&t!=n.dom;t=t.parentNode){let i=n.docView.nearestDesc(t,!0);if(i&&i.node.isBlock)return t}return null}function HX(n,e){var t;let{focusNode:i,focusOffset:r}=n.domSelectionRange();for(let s of e)if(((t=s.parentNode)===null||t===void 0?void 0:t.nodeName)=="TR"){let l=s.nextSibling;for(;l&&l.nodeName!="TD"&&l.nodeName!="TH";)l=l.nextSibling;if(l){let o=l;for(;;){let c=o.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;o=c}o.insertBefore(s,o.firstChild),i==s&&n.domSelection().collapse(s,r)}else s.parentNode.removeChild(s)}}function YX(n,e,t){let{node:i,fromOffset:r,toOffset:s,from:l,to:o}=n.docView.parseRange(e,t),c=n.domSelectionRange(),h,d=c.anchorNode;if(d&&n.dom.contains(d.nodeType==1?d:d.parentNode)&&(h=[{node:d,offset:c.anchorOffset}],Cg(c)||h.push({node:c.focusNode,offset:c.focusOffset})),On&&n.input.lastKeyCode===8)for(let x=s;x>r;x--){let k=i.childNodes[x-1],C=k.pmViewDesc;if(k.nodeName=="BR"&&!C){s=x;break}if(!C||C.size)break}let p=n.state.doc,g=n.someProp("domParser")||Al.fromSchema(n.state.schema),O=p.resolve(l),b=null,v=g.parse(i,{topNode:O.parent,topMatch:O.parent.contentMatchAt(O.index()),topOpen:!0,from:r,to:s,preserveWhitespace:O.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:UX,context:O});if(h&&h[0].pos!=null){let x=h[0].pos,k=h[1]&&h[1].pos;k==null&&(k=x),b={anchor:x+l,head:k+l}}return{doc:v,sel:b,from:l,to:o}}function UX(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Tn&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Tn&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const WX=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function GX(n,e,t,i,r){let s=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let $=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,H=uv(n,$);if(H&&!n.state.selection.eq(H)){if(On&&xs&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",te=>te(n,fo(13,"Enter"))))return;let W=n.state.tr.setSelection(H);$=="pointer"?W.setMeta("pointer",!0):$=="key"&&W.scrollIntoView(),s&&W.setMeta("composition",s),n.dispatch(W)}return}let l=n.state.doc.resolve(e),o=l.sharedDepth(t);e=l.before(o+1),t=n.state.doc.resolve(t).after(o+1);let c=n.state.selection,h=YX(n,e,t),d=n.state.doc,p=d.slice(h.from,h.to),g,O;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(g=n.state.selection.to,O="end"):(g=n.state.selection.from,O="start"),n.input.lastKeyCode=null;let b=JX(p.content,h.doc.content,h.from,g,O);if(b&&n.input.domChangeCount++,(oc&&n.input.lastIOSEnter>Date.now()-225||xs)&&r.some($=>$.nodeType==1&&!WX.test($.nodeName))&&(!b||b.endA>=b.endB)&&n.someProp("handleKeyDown",$=>$(n,fo(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!b)if(i&&c instanceof Ae&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(h.sel&&h.sel.anchor!=h.sel.head))b={start:c.from,endA:c.to,endB:c.to};else{if(h.sel){let $=fM(n,n.state.doc,h.sel);if($&&!$.eq(n.state.selection)){let H=n.state.tr.setSelection($);s&&H.setMeta("composition",s),n.dispatch(H)}}return}n.state.selection.from<n.state.selection.to&&b.start==b.endB&&n.state.selection instanceof Ae&&(b.start>n.state.selection.from&&b.start<=n.state.selection.from+2&&n.state.selection.from>=h.from?b.start=n.state.selection.from:b.endA<n.state.selection.to&&b.endA>=n.state.selection.to-2&&n.state.selection.to<=h.to&&(b.endB+=n.state.selection.to-b.endA,b.endA=n.state.selection.to)),ei&&Ml<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>h.from&&h.doc.textBetween(b.start-h.from-1,b.start-h.from+1)==" "&&(b.start--,b.endA--,b.endB--);let v=h.doc.resolveNoCache(b.start-h.from),x=h.doc.resolveNoCache(b.endB-h.from),k=d.resolve(b.start),C=v.sameParent(x)&&v.parent.inlineContent&&k.end()>=b.endA;if((oc&&n.input.lastIOSEnter>Date.now()-225&&(!C||r.some($=>$.nodeName=="DIV"||$.nodeName=="P"))||!C&&v.pos<h.doc.content.size&&(!v.sameParent(x)||!v.parent.inlineContent)&&v.pos<x.pos&&!/\S/.test(h.doc.textBetween(v.pos,x.pos,"","")))&&n.someProp("handleKeyDown",$=>$(n,fo(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>b.start&&KX(d,b.start,b.endA,v,x)&&n.someProp("handleKeyDown",$=>$(n,fo(8,"Backspace")))){xs&&On&&n.domObserver.suppressSelectionUpdates();return}On&&b.endB==b.start&&(n.input.lastChromeDelete=Date.now()),xs&&!C&&v.start()!=x.start()&&x.parentOffset==0&&v.depth==x.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==b.endA&&(b.endB-=2,x=h.doc.resolveNoCache(b.endB-h.from),setTimeout(()=>{n.someProp("handleKeyDown",function($){return $(n,fo(13,"Enter"))})},20));let A=b.start,P=b.endA,E=$=>{let H=$||n.state.tr.replace(A,P,h.doc.slice(b.start-h.from,b.endB-h.from));if(h.sel){let W=fM(n,H.doc,h.sel);W&&!(On&&n.composing&&W.empty&&(b.start!=b.endB||n.input.lastChromeDelete<Date.now()-100)&&(W.head==A||W.head==H.mapping.map(P)-1)||ei&&W.empty&&W.head==A)&&H.setSelection(W)}return s&&H.setMeta("composition",s),H.scrollIntoView()},D;if(C)if(v.pos==x.pos){ei&&Ml<=11&&v.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>As(n),20));let $=E(n.state.tr.delete(A,P)),H=d.resolve(b.start).marksAcross(d.resolve(b.endA));H&&$.ensureMarks(H),n.dispatch($)}else if(b.endA==b.endB&&(D=FX(v.parent.content.cut(v.parentOffset,x.parentOffset),k.parent.content.cut(k.parentOffset,b.endA-k.start())))){let $=E(n.state.tr);D.type=="add"?$.addMark(A,P,D.mark):$.removeMark(A,P,D.mark),n.dispatch($)}else if(v.parent.child(v.index()).isText&&v.index()==x.index()-(x.textOffset?0:1)){let $=v.parent.textBetween(v.parentOffset,x.parentOffset),H=()=>E(n.state.tr.insertText($,A,P));n.someProp("handleTextInput",W=>W(n,A,P,$,H))||n.dispatch(H())}else n.dispatch(E());else n.dispatch(E())}function fM(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:hv(n,e.resolve(t.anchor),e.resolve(t.head))}function FX(n,e){let t=n.firstChild.marks,i=e.firstChild.marks,r=t,s=i,l,o,c;for(let d=0;d<i.length;d++)r=i[d].removeFromSet(r);for(let d=0;d<t.length;d++)s=t[d].removeFromSet(s);if(r.length==1&&s.length==0)o=r[0],l="add",c=d=>d.mark(o.addToSet(d.marks));else if(r.length==0&&s.length==1)o=s[0],l="remove",c=d=>d.mark(o.removeFromSet(d.marks));else return null;let h=[];for(let d=0;d<e.childCount;d++)h.push(c(e.child(d)));if(ne.from(h).eq(n))return{mark:o,type:l}}function KX(n,e,t,i,r){if(t-e<=r.pos-i.pos||Zy(i,!0,!1)<r.pos)return!1;let s=n.resolve(e);if(!i.parent.isTextblock){let o=s.nodeAfter;return o!=null&&t==e+o.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let l=n.resolve(Zy(s,!0,!0));return!l.parent.isTextblock||l.pos>t||Zy(l,!0,!1)<t?!1:i.parent.content.cut(i.parentOffset).eq(l.parent.content)}function Zy(n,e,t){let i=n.depth,r=e?n.end():n.pos;for(;i>0&&(e||n.indexAfter(i)==n.node(i).childCount);)i--,r++,e=!1;if(t){let s=n.node(i).maybeChild(n.indexAfter(i));for(;s&&!s.isLeaf;)s=s.firstChild,r++}return r}function JX(n,e,t,i,r){let s=n.findDiffStart(e,t);if(s==null)return null;let{a:l,b:o}=n.findDiffEnd(e,t+n.size,t+e.size);if(r=="end"){let c=Math.max(0,s-Math.min(l,o));i-=l+c-s}if(l<s&&n.size<e.size){let c=i<=s&&i>=l?s-i:0;s-=c,s&&s<e.size&&dM(e.textBetween(s-1,s+1))&&(s+=c?1:-1),o=s+(o-l),l=s}else if(o<s){let c=i<=s&&i>=o?s-i:0;s-=c,s&&s<n.size&&dM(n.textBetween(s-1,s+1))&&(s+=c?1:-1),l=s+(l-o),o=s}return{start:s,endA:l,endB:o}}function dM(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}let U2=class{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 pX,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(yM),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=gM(this),mM(this),this.nodeViews=OM(this),this.docView=YA(this.state.doc,pM(this),By(this),this.dom,this),this.domObserver=new XX(this,(i,r,s,l)=>GX(this,i,r,s,l)),this.domObserver.start(),mX(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&&S1(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(yM),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let i in this._props)t[i]=this._props[i];t.state=this.state;for(let i in e)t[i]=e[i];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var i;let r=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(B2(this),l=!0),this.state=e;let o=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(o||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let O=OM(this);tI(O,this.nodeViews)&&(this.nodeViews=O,s=!0)}(o||t.handleDOMEvents!=this._props.handleDOMEvents)&&S1(this),this.editable=gM(this),mM(this);let c=By(this),h=pM(this),d=r.plugins!=e.plugins&&!r.doc.eq(e.doc)?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",p=s||!this.docView.matchesNode(e.doc,h,c);(p||!e.selection.eq(r.selection))&&(l=!0);let g=d=="preserve"&&l&&this.dom.style.overflowAnchor==null&&Qj(this);if(l){this.domObserver.stop();let O=p&&(ei||On)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&eI(r.selection,e.selection);if(p){let b=On?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=QX(this)),(s||!this.docView.update(e.doc,h,c,this))&&(this.docView.updateOuterDeco(h),this.docView.destroy(),this.docView=YA(e.doc,h,c,this.dom,this)),b&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(O=!0)}O||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Jj(this))?As(this,O):(A2(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((i=this.dragging)===null||i===void 0)&&i.node&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():g&&Ej(g)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){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&&jA(this,t.getBoundingClientRect(),e)}else jA(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;t<this.directPlugins.length;t++){let i=this.directPlugins[t];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let i=this.state.plugins[t];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let i=this.pluginViews[t];i.update&&i.update(this,e)}}updateDraggedNode(e,t){let i=e.node,r=-1;if(i.from<this.state.doc.content.size&&this.state.doc.nodeAt(i.from)==i.node)r=i.from;else{let s=i.from+(this.state.doc.content.size-t.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==i.node&&(r=s)}this.dragging=new j2(e.slice,e.move,r<0?void 0:Te.create(this.state.doc,r))}someProp(e,t){let i=this._props&&this._props[e],r;if(i!=null&&(r=t?t(i):i))return r;for(let l=0;l<this.directPlugins.length;l++){let o=this.directPlugins[l].props[e];if(o!=null&&(r=t?t(o):o))return r}let s=this.state.plugins;if(s)for(let l=0;l<s.length;l++){let o=s[l].props[e];if(o!=null&&(r=t?t(o):o))return r}}hasFocus(){if(ei){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&$j(this.dom),As(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return zj(this,e)}coordsAtPos(e,t=1){return b2(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,i=-1){let r=this.docView.posFromDOM(e,t,i);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return jj(this,t||this.state,e)}pasteHTML(e,t){return Mh(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Mh(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return fv(this,e)}destroy(){this.docView&&(gX(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],By(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,bj())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return yX(this,e)}domSelectionRange(){let e=this.domSelection();return e?Tn&&this.root.nodeType===11&&wj(this.dom.ownerDocument)==this.dom&&VX(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};U2.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function pM(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let i in t)i=="class"?e.class+=" "+t[i]:i=="style"?e.style=(e.style?e.style+";":"")+t[i]:!e[i]&&i!="contenteditable"&&i!="nodeName"&&(e[i]=String(t[i]))}),e.translate||(e.translate="no"),[ki.node(0,n.state.doc.content.size,e)]}function mM(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:ki.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function gM(n){return!n.someProp("editable",e=>e(n.state)===!1)}function eI(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function OM(n){let e=Object.create(null);function t(i){for(let r in i)Object.prototype.hasOwnProperty.call(e,r)||(e[r]=i[r])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function tI(n,e){let t=0,i=0;for(let r in n){if(n[r]!=e[r])return!0;t++}for(let r in e)i++;return t!=i}function yM(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Es={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:"'"},Eh={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nI=typeof navigator<"u"&&/Mac/.test(navigator.platform),iI=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var mn=0;mn<10;mn++)Es[48+mn]=Es[96+mn]=String(mn);for(var mn=1;mn<=24;mn++)Es[mn+111]="F"+mn;for(var mn=65;mn<=90;mn++)Es[mn]=String.fromCharCode(mn+32),Eh[mn]=String.fromCharCode(mn);for(var jy in Es)Eh.hasOwnProperty(jy)||(Eh[jy]=Es[jy]);function W2(n){var e=nI&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||iI&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Eh:Es)[n.keyCode]||n.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 rI=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),sI=typeof navigator<"u"&&/Win/.test(navigator.platform);function lI(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let i,r,s,l;for(let o=0;o<e.length-1;o++){let c=e[o];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))rI?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(t="Alt-"+t),r&&(t="Ctrl-"+t),l&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function oI(n){let e=Object.create(null);for(let t in n)e[lI(t)]=n[t];return e}function Xy(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function aI(n){return new bt({props:{handleKeyDown:Ov(n)}})}function Ov(n){let e=oI(n);return function(t,i){let r=W2(i),s,l=e[Xy(r,i)];if(l&&l(t.state,t.dispatch,t))return!0;if(r.length==1&&r!=" "){if(i.shiftKey){let o=e[Xy(r,i,!1)];if(o&&o(t.state,t.dispatch,t))return!0}if((i.altKey||i.metaKey||i.ctrlKey)&&!(sI&&i.ctrlKey&&i.altKey)&&(s=Es[i.keyCode])&&s!=r){let o=e[Xy(s,i)];if(o&&o(t.state,t.dispatch,t))return!0}}return!1}}var cI=Object.defineProperty,yv=(n,e)=>{for(var t in e)cI(n,t,{get:e[t],enumerable:!0})};function Qg(n){const{state:e,transaction:t}=n;let{selection:i}=t,{doc:r}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return i},get doc(){return r},get tr(){return i=t.selection,r=t.doc,s=t.storedMarks,t}}}var Eg=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:t}=this,{view:i}=e,{tr:r}=t,s=this.buildProps(r);return Object.fromEntries(Object.entries(n).map(([l,o])=>[l,(...h)=>{const d=o(...h)(s);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(r),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:t,editor:i,state:r}=this,{view:s}=i,l=[],o=!!n,c=n||r.tr,h=()=>(!o&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(t).map(([p,g])=>[p,(...b)=>{const v=this.buildProps(c,e),x=g(...b)(v);return l.push(x),d}])),run:h};return d}createCan(n){const{rawCommands:e,state:t}=this,i=!1,r=n||t.tr,s=this.buildProps(r,i);return{...Object.fromEntries(Object.entries(e).map(([o,c])=>[o,(...h)=>c(...h)({...s,dispatch:void 0})])),chain:()=>this.createChain(r,i)}}buildProps(n,e=!0){const{rawCommands:t,editor:i,state:r}=this,{view:s}=i,l={tr:n,editor:i,view:s,state:Qg({state:r,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([o,c])=>[o,(...h)=>c(...h)(l)]))}};return l}},G2={};yv(G2,{blur:()=>uI,clearContent:()=>hI,clearNodes:()=>fI,command:()=>dI,createParagraphNear:()=>pI,cut:()=>mI,deleteCurrentNode:()=>gI,deleteNode:()=>OI,deleteRange:()=>yI,deleteSelection:()=>bI,enter:()=>SI,exitCode:()=>vI,extendMarkRange:()=>xI,first:()=>kI,focus:()=>TI,forEach:()=>CI,insertContent:()=>AI,insertContentAt:()=>EI,joinBackward:()=>PI,joinDown:()=>RI,joinForward:()=>DI,joinItemBackward:()=>NI,joinItemForward:()=>zI,joinTextblockBackward:()=>LI,joinTextblockForward:()=>_I,joinUp:()=>$I,keyboardShortcut:()=>ZI,lift:()=>jI,liftEmptyBlock:()=>XI,liftListItem:()=>II,newlineInCode:()=>VI,resetAttributes:()=>qI,scrollIntoView:()=>HI,selectAll:()=>YI,selectNodeBackward:()=>UI,selectNodeForward:()=>WI,selectParentNode:()=>GI,selectTextblockEnd:()=>FI,selectTextblockStart:()=>KI,setContent:()=>JI,setMark:()=>y4,setMeta:()=>b4,setNode:()=>S4,setNodeSelection:()=>v4,setTextDirection:()=>x4,setTextSelection:()=>k4,sinkListItem:()=>w4,splitBlock:()=>T4,splitListItem:()=>C4,toggleList:()=>M4,toggleMark:()=>Q4,toggleNode:()=>E4,toggleWrap:()=>$4,undoInputRule:()=>R4,unsetAllMarks:()=>P4,unsetMark:()=>D4,unsetTextDirection:()=>N4,updateAttributes:()=>z4,wrapIn:()=>L4,wrapInList:()=>_4});var uI=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())==null||t.removeAllRanges())}),!0),hI=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),fI=()=>({state:n,tr:e,dispatch:t})=>{const{selection:i}=e,{ranges:r}=i;return t&&r.forEach(({$from:s,$to:l})=>{n.doc.nodesBetween(s.pos,l.pos,(o,c)=>{if(o.type.isText)return;const{doc:h,mapping:d}=e,p=h.resolve(d.map(c)),g=h.resolve(d.map(c+o.nodeSize)),O=p.blockRange(g);if(!O)return;const b=Tc(O);if(o.type.isTextblock){const{defaultType:v}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(O.start,v)}(b||b===0)&&e.lift(O,b)})}),!0},dI=n=>e=>n(e),pI=()=>({state:n,dispatch:e})=>a2(n,e),mI=(n,e)=>({editor:t,tr:i})=>{const{state:r}=t,s=r.doc.slice(n.from,n.to);i.deleteRange(n.from,n.to);const l=i.mapping.map(e);return i.insert(l,s.content),i.setSelection(new Ae(i.doc.resolve(Math.max(l-1,0)))),!0},gI=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,i=t.$anchor.node();if(i.content.size>0)return!1;const r=n.selection.$anchor;for(let s=r.depth;s>0;s-=1)if(r.node(s).type===i.type){if(e){const o=r.before(s),c=r.after(s);n.delete(o,c).scrollIntoView()}return!0}return!1};function Ut(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}var OI=n=>({tr:e,state:t,dispatch:i})=>{const r=Ut(n,t.schema),s=e.selection.$anchor;for(let l=s.depth;l>0;l-=1)if(s.node(l).type===r){if(i){const c=s.before(l),h=s.after(l);e.delete(c,h).scrollIntoView()}return!0}return!1},yI=n=>({tr:e,dispatch:t})=>{const{from:i,to:r}=n;return t&&e.delete(i,r),!0},bI=()=>({state:n,dispatch:e})=>rv(n,e),SI=()=>({commands:n})=>n.keyboardShortcut("Enter"),vI=()=>({state:n,dispatch:e})=>rj(n,e);function bv(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function nm(n,e,t={strict:!0}){const i=Object.keys(e);return i.length?i.every(r=>t.strict?e[r]===n[r]:bv(e[r])?e[r].test(n[r]):e[r]===n[r]):!0}function F2(n,e,t={}){return n.find(i=>i.type===e&&nm(Object.fromEntries(Object.keys(t).map(r=>[r,i.attrs[r]])),t))}function bM(n,e,t={}){return!!F2(n,e,t)}function Sv(n,e,t){if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(h=>h.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(h=>h.type===e))return;if(!t){const h=i.node.marks.find(d=>d.type===e);h&&(t=h.attrs)}if(!F2([...i.node.marks],e,t))return;let s=i.index,l=n.start()+i.offset,o=s+1,c=l+i.node.nodeSize;for(;s>0&&bM([...n.parent.child(s-1).marks],e,t);)s-=1,l-=n.parent.child(s).nodeSize;for(;o<n.parent.childCount&&bM([...n.parent.child(o).marks],e,t);)c+=n.parent.child(o).nodeSize,o+=1;return{from:l,to:c}}function Ds(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}var xI=(n,e)=>({tr:t,state:i,dispatch:r})=>{const s=Ds(n,i.schema),{doc:l,selection:o}=t,{$from:c,from:h,to:d}=o;if(r){const p=Sv(c,s,e);if(p&&p.from<=h&&p.to>=d){const g=Ae.create(l,p.from,p.to);t.setSelection(g)}}return!0},kI=n=>e=>{const t=typeof n=="function"?n(e):n;for(let i=0;i<t.length;i+=1)if(t[i](e))return!0;return!1};function vv(n){return n instanceof Ae}function ks(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function K2(n,e=null){if(!e)return null;const t=Pe.atStart(n),i=Pe.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return i;const r=t.from,s=i.to;return e==="all"?Ae.create(n,ks(0,r,s),ks(n.content.size,r,s)):Ae.create(n,ks(e,r,s),ks(e,r,s))}function SM(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function im(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function wI(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var TI=(n=null,e={})=>({editor:t,view:i,tr:r,dispatch:s})=>{e={scrollIntoView:!0,...e};const l=()=>{(im()||SM())&&i.dom.focus(),wI()&&!im()&&!SM()&&i.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(i.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};try{if(i.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(s&&n===null&&!vv(t.state.selection))return l(),!0;const o=K2(r.doc,n)||t.state.selection,c=t.state.selection.eq(o);return s&&(c||r.setSelection(o),c&&r.storedMarks&&r.setStoredMarks(r.storedMarks),l()),!0},CI=(n,e)=>t=>n.every((i,r)=>e(i,{...t,index:r})),AI=(n,e)=>({tr:t,commands:i})=>i.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),J2=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const i=e[t];i.nodeType===3&&i.nodeValue&&/^(\n\s\s|\n)$/.test(i.nodeValue)?n.removeChild(i):i.nodeType===1&&J2(i)}return n};function Xd(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return J2(t)}function $h(n,e,t){if(n instanceof Cl||n instanceof ne)return n;t={slice:!0,parseOptions:{},...t};const i=typeof n=="object"&&n!==null,r=typeof n=="string";if(i)try{if(Array.isArray(n)&&n.length>0)return ne.fromArray(n.map(o=>e.nodeFromJSON(o)));const l=e.nodeFromJSON(n);return t.errorOnInvalidContent&&l.check(),l}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),$h("",e,t)}if(r){if(t.errorOnInvalidContent){let l=!1,o="";const c=new NR({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(l=!0,o=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?Al.fromSchema(c).parseSlice(Xd(n),t.parseOptions):Al.fromSchema(c).parse(Xd(n),t.parseOptions),t.errorOnInvalidContent&&l)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${o}`)})}const s=Al.fromSchema(e);return t.slice?s.parseSlice(Xd(n),t.parseOptions).content:s.parse(Xd(n),t.parseOptions)}return $h("",e,t)}function MI(n,e,t){const i=n.steps.length-1;if(i<e)return;const r=n.steps[i];if(!(r instanceof qt||r instanceof rn))return;const s=n.mapping.maps[i];let l=0;s.forEach((o,c,h,d)=>{l===0&&(l=d)}),n.setSelection(Pe.near(n.doc.resolve(l),t))}var QI=n=>!("type"in n),EI=(n,e,t)=>({tr:i,dispatch:r,editor:s})=>{var l;if(r){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let o;const c=x=>{s.emit("contentError",{editor:s,error:x,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},h={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{$h(e,s.schema,{parseOptions:h,errorOnInvalidContent:!0})}catch(x){c(x)}try{o=$h(e,s.schema,{parseOptions:h,errorOnInvalidContent:(l=t.errorOnInvalidContent)!=null?l:s.options.enableContentCheck})}catch(x){return c(x),!1}let{from:d,to:p}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},g=!0,O=!0;if((QI(o)?o:[o]).forEach(x=>{x.check(),g=g?x.isText&&x.marks.length===0:!1,O=O?x.isBlock:!1}),d===p&&O){const{parent:x}=i.doc.resolve(d);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(d-=1,p+=1)}let v;if(g){if(Array.isArray(e))v=e.map(x=>x.text||"").join("");else if(e instanceof ne){let x="";e.forEach(k=>{k.text&&(x+=k.text)}),v=x}else typeof e=="object"&&e&&e.text?v=e.text:v=e;i.insertText(v,d,p)}else{v=o;const x=i.doc.resolve(d),k=x.node(),C=x.parentOffset===0,A=k.isText||k.isTextblock,P=k.content.size>0;C&&A&&P&&O&&(d=Math.max(0,d-1)),i.replaceWith(d,p,v)}t.updateSelection&&MI(i,i.steps.length-1,-1),t.applyInputRules&&i.setMeta("applyInputRules",{from:d,text:v}),t.applyPasteRules&&i.setMeta("applyPasteRules",{from:d,text:v})}return!0},$I=()=>({state:n,dispatch:e})=>tj(n,e),RI=()=>({state:n,dispatch:e})=>nj(n,e),PI=()=>({state:n,dispatch:e})=>t2(n,e),DI=()=>({state:n,dispatch:e})=>s2(n,e),NI=()=>({state:n,dispatch:e,tr:t})=>{try{const i=kg(n.doc,n.selection.$from.pos,-1);return i==null?!1:(t.join(i,2),e&&e(t),!0)}catch{return!1}},zI=()=>({state:n,dispatch:e,tr:t})=>{try{const i=kg(n.doc,n.selection.$from.pos,1);return i==null?!1:(t.join(i,2),e&&e(t),!0)}catch{return!1}},LI=()=>({state:n,dispatch:e})=>JZ(n,e),_I=()=>({state:n,dispatch:e})=>ej(n,e);function eP(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function BI(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let i,r,s,l;for(let o=0;o<e.length-1;o+=1){const c=e[o];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))r=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))im()||eP()?l=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return i&&(t=`Alt-${t}`),r&&(t=`Ctrl-${t}`),l&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}var ZI=n=>({editor:e,view:t,tr:i,dispatch:r})=>{const s=BI(n).split(/-(?!$)/),l=s.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),o=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,o))});return c==null||c.steps.forEach(h=>{const d=h.map(i.mapping);d&&r&&i.maybeStep(d)}),!0};function Rl(n,e,t={}){const{from:i,to:r,empty:s}=n.selection,l=e?Ut(e,n.schema):null,o=[];n.doc.nodesBetween(i,r,(p,g)=>{if(p.isText)return;const O=Math.max(i,g),b=Math.min(r,g+p.nodeSize);o.push({node:p,from:O,to:b})});const c=r-i,h=o.filter(p=>l?l.name===p.node.type.name:!0).filter(p=>nm(p.node.attrs,t,{strict:!1}));return s?!!h.length:h.reduce((p,g)=>p+g.to-g.from,0)>=c}var jI=(n,e={})=>({state:t,dispatch:i})=>{const r=Ut(n,t.schema);return Rl(t,r,e)?ij(t,i):!1},XI=()=>({state:n,dispatch:e})=>c2(n,e),II=n=>({state:e,dispatch:t})=>{const i=Ut(n,e.schema);return mj(i)(e,t)},VI=()=>({state:n,dispatch:e})=>o2(n,e);function $g(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function vM(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((i,r)=>(t.includes(r)||(i[r]=n[r]),i),{})}var qI=(n,e)=>({tr:t,state:i,dispatch:r})=>{let s=null,l=null;const o=$g(typeof n=="string"?n:n.name,i.schema);if(!o)return!1;o==="node"&&(s=Ut(n,i.schema)),o==="mark"&&(l=Ds(n,i.schema));let c=!1;return t.selection.ranges.forEach(h=>{i.doc.nodesBetween(h.$from.pos,h.$to.pos,(d,p)=>{s&&s===d.type&&(c=!0,r&&t.setNodeMarkup(p,void 0,vM(d.attrs,e))),l&&d.marks.length&&d.marks.forEach(g=>{l===g.type&&(c=!0,r&&t.addMark(p,p+d.nodeSize,l.create(vM(g.attrs,e))))})})}),c},HI=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),YI=()=>({tr:n,dispatch:e})=>{if(e){const t=new vi(n.doc);n.setSelection(t)}return!0},UI=()=>({state:n,dispatch:e})=>i2(n,e),WI=()=>({state:n,dispatch:e})=>l2(n,e),GI=()=>({state:n,dispatch:e})=>oj(n,e),FI=()=>({state:n,dispatch:e})=>uj(n,e),KI=()=>({state:n,dispatch:e})=>cj(n,e);function v1(n,e,t={},i={}){return $h(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:i.errorOnInvalidContent})}var JI=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:i={}}={})=>({editor:r,tr:s,dispatch:l,commands:o})=>{const{doc:c}=s;if(i.preserveWhitespace!=="full"){const h=v1(n,r.schema,i,{errorOnInvalidContent:e??r.options.enableContentCheck});return l&&s.replaceWith(0,c.content.size,h).setMeta("preventUpdate",!t),!0}return l&&s.setMeta("preventUpdate",!t),o.insertContentAt({from:0,to:c.content.size},n,{parseOptions:i,errorOnInvalidContent:e??r.options.enableContentCheck})};function tP(n,e){const t=Ds(e,n.schema),{from:i,to:r,empty:s}=n.selection,l=[];s?(n.storedMarks&&l.push(...n.storedMarks),l.push(...n.selection.$head.marks())):n.doc.nodesBetween(i,r,c=>{l.push(...c.marks)});const o=l.find(c=>c.type.name===t.name);return o?{...o.attrs}:{}}function nP(n,e){const t=new nv(n);return e.forEach(i=>{i.steps.forEach(r=>{t.step(r)})}),t}function e4(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function t4(n,e,t){const i=[];return n.nodesBetween(e.from,e.to,(r,s)=>{t(r)&&i.push({node:r,pos:s})}),i}function iP(n,e){for(let t=n.depth;t>0;t-=1){const i=n.node(t);if(e(i))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:i}}}function Rg(n){return e=>iP(e.$from,n)}function ke(n,e,t){return n.config[e]===void 0&&n.parent?ke(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?ke(n.parent,e,t):null}):n.config[e]}function xv(n){return n.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},i=ke(e,"addExtensions",t);return i?[e,...xv(i())]:e}).flat(10)}function kv(n,e){const t=Io.fromSchema(e).serializeFragment(n),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(t),r.innerHTML}function rP(n){return typeof n=="function"}function tt(n,e=void 0,...t){return rP(n)?e?n.bind(e)(...t):n(...t):n}function n4(n={}){return Object.keys(n).length===0&&n.constructor===Object}function ac(n){const e=n.filter(r=>r.type==="extension"),t=n.filter(r=>r.type==="node"),i=n.filter(r=>r.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:i}}function sP(n){const e=[],{nodeExtensions:t,markExtensions:i}=ac(n),r=[...t,...i],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},l=t.filter(h=>h.name!=="text").map(h=>h.name),o=i.map(h=>h.name),c=[...l,...o];return n.forEach(h=>{const d={name:h.name,options:h.options,storage:h.storage,extensions:r},p=ke(h,"addGlobalAttributes",d);if(!p)return;p().forEach(O=>{let b;Array.isArray(O.types)?b=O.types:O.types==="*"?b=c:O.types==="nodes"?b=l:O.types==="marks"?b=o:b=[],b.forEach(v=>{Object.entries(O.attributes).forEach(([x,k])=>{e.push({type:v,name:x,attribute:{...s,...k}})})})})}),r.forEach(h=>{const d={name:h.name,options:h.options,storage:h.storage},p=ke(h,"addAttributes",d);if(!p)return;const g=p();Object.entries(g).forEach(([O,b])=>{const v={...s,...b};typeof(v==null?void 0:v.default)=="function"&&(v.default=v.default()),v!=null&&v.isRequired&&(v==null?void 0:v.default)===void 0&&delete v.default,e.push({type:h.name,name:O,attribute:v})})}),e}function i4(n){const e=[];let t="",i=!1,r=!1,s=0;const l=n.length;for(let o=0;o<l;o+=1){const c=n[o];if(c==="'"&&!r){i=!i,t+=c;continue}if(c==='"'&&!i){r=!r,t+=c;continue}if(!i&&!r){if(c==="("){s+=1,t+=c;continue}if(c===")"&&s>0){s-=1,t+=c;continue}if(c===";"&&s===0){e.push(t),t="";continue}}t+=c}return t&&e.push(t),e}function xM(n){const e=[],t=i4(n||""),i=t.length;for(let r=0;r<i;r+=1){const s=t[r],l=s.indexOf(":");if(l===-1)continue;const o=s.slice(0,l).trim(),c=s.slice(l+1).trim();o&&c&&e.push([o,c])}return e}function Ct(...n){return n.filter(e=>!!e).reduce((e,t)=>{const i={...e};return Object.entries(t).forEach(([r,s])=>{if(!i[r]){i[r]=s;return}if(r==="class"){const o=s?String(s).split(" "):[],c=i[r]?i[r].split(" "):[],h=o.filter(d=>!c.includes(d));i[r]=[...c,...h].join(" ")}else if(r==="style"){const o=new Map([...xM(i[r]),...xM(s)]);i[r]=Array.from(o.entries()).map(([c,h])=>`${c}: ${h}`).join("; ")}else i[r]=s}),i},{})}function Rh(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,i)=>Ct(t,i),{})}function r4(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function kM(n,e){return"style"in n?n:{...n,getAttrs:t=>{const i=n.getAttrs?n.getAttrs(t):n.attrs;if(i===!1)return!1;const r=e.reduce((s,l)=>{const o=l.attribute.parseHTML?l.attribute.parseHTML(t):r4(t.getAttribute(l.name));return o==null?s:{...s,[l.name]:o}},{});return{...i,...r}}}}function wM(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&n4(t)?!1:t!=null))}function TM(n){var e,t;const i={};return!((e=n==null?void 0:n.attribute)!=null&&e.isRequired)&&"default"in((n==null?void 0:n.attribute)||{})&&(i.default=n.attribute.default),((t=n==null?void 0:n.attribute)==null?void 0:t.validate)!==void 0&&(i.validate=n.attribute.validate),[n.name,i]}function s4(n,e){var t;const i=sP(n),{nodeExtensions:r,markExtensions:s}=ac(n),l=(t=r.find(h=>ke(h,"topNode")))==null?void 0:t.name,o=Object.fromEntries(r.map(h=>{const d=i.filter(k=>k.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((k,C)=>{const A=ke(C,"extendNodeSchema",p);return{...k,...A?A(h):{}}},{}),O=wM({...g,content:tt(ke(h,"content",p)),marks:tt(ke(h,"marks",p)),group:tt(ke(h,"group",p)),inline:tt(ke(h,"inline",p)),atom:tt(ke(h,"atom",p)),selectable:tt(ke(h,"selectable",p)),draggable:tt(ke(h,"draggable",p)),code:tt(ke(h,"code",p)),whitespace:tt(ke(h,"whitespace",p)),linebreakReplacement:tt(ke(h,"linebreakReplacement",p)),defining:tt(ke(h,"defining",p)),isolating:tt(ke(h,"isolating",p)),attrs:Object.fromEntries(d.map(TM))}),b=tt(ke(h,"parseHTML",p));b&&(O.parseDOM=b.map(k=>kM(k,d)));const v=ke(h,"renderHTML",p);v&&(O.toDOM=k=>v({node:k,HTMLAttributes:Rh(k,d)}));const x=ke(h,"renderText",p);return x&&(O.toText=x),[h.name,O]})),c=Object.fromEntries(s.map(h=>{const d=i.filter(x=>x.type===h.name),p={name:h.name,options:h.options,storage:h.storage,editor:e},g=n.reduce((x,k)=>{const C=ke(k,"extendMarkSchema",p);return{...x,...C?C(h):{}}},{}),O=wM({...g,inclusive:tt(ke(h,"inclusive",p)),excludes:tt(ke(h,"excludes",p)),group:tt(ke(h,"group",p)),spanning:tt(ke(h,"spanning",p)),code:tt(ke(h,"code",p)),attrs:Object.fromEntries(d.map(TM))}),b=tt(ke(h,"parseHTML",p));b&&(O.parseDOM=b.map(x=>kM(x,d)));const v=ke(h,"renderHTML",p);return v&&(O.toDOM=x=>v({mark:x,HTMLAttributes:Rh(x,d)})),[h.name,O]}));return new NR({topNode:l,nodes:o,marks:c})}function l4(n){const e=n.filter((t,i)=>n.indexOf(t)!==i);return Array.from(new Set(e))}function lh(n){return n.sort((t,i)=>{const r=ke(t,"priority")||100,s=ke(i,"priority")||100;return r>s?-1:r<s?1:0})}function lP(n){const e=lh(xv(n)),t=l4(e.map(i=>i.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),e}function oP(n,e,t){const{from:i,to:r}=e,{blockSeparator:s=`
|
|
67
|
+
|
|
68
|
+
`,textSerializers:l={}}=t||{};let o="";return n.nodesBetween(i,r,(c,h,d,p)=>{var g;c.isBlock&&h>i&&(o+=s);const O=l==null?void 0:l[c.type.name];if(O)return d&&(o+=O({node:c,pos:h,parent:d,index:p,range:e})),!1;c.isText&&(o+=(g=c==null?void 0:c.text)==null?void 0:g.slice(Math.max(i,h)-h,r-h))}),o}function aP(n,e){const t={from:0,to:n.content.size};return oP(n,t,e)}function wv(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function o4(n,e){const t=Ut(e,n.schema),{from:i,to:r}=n.selection,s=[];n.doc.nodesBetween(i,r,o=>{s.push(o)});const l=s.reverse().find(o=>o.type.name===t.name);return l?{...l.attrs}:{}}function cP(n,e){const t=$g(typeof e=="string"?e:e.name,n.schema);return t==="node"?o4(n,e):t==="mark"?tP(n,e):{}}function a4(n,e=JSON.stringify){const t={};return n.filter(i=>{const r=e(i);return Object.prototype.hasOwnProperty.call(t,r)?!1:t[r]=!0})}function c4(n){const e=a4(n);return e.length===1?e:e.filter((t,i)=>!e.filter((s,l)=>l!==i).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function uP(n){const{mapping:e,steps:t}=n,i=[];return e.maps.forEach((r,s)=>{const l=[];if(r.ranges.length)r.forEach((o,c)=>{l.push({from:o,to:c})});else{const{from:o,to:c}=t[s];if(o===void 0||c===void 0)return;l.push({from:o,to:c})}l.forEach(({from:o,to:c})=>{const h=e.slice(s).map(o,-1),d=e.slice(s).map(c),p=e.invert().map(h,-1),g=e.invert().map(d);i.push({oldRange:{from:p,to:g},newRange:{from:h,to:d}})})}),c4(i)}function Tv(n,e,t){const i=[];return n===e?t.resolve(n).marks().forEach(r=>{const s=t.resolve(n),l=Sv(s,r.type);l&&i.push({mark:r,...l})}):t.nodesBetween(n,e,(r,s)=>{!r||(r==null?void 0:r.nodeSize)===void 0||i.push(...r.marks.map(l=>({from:s,to:s+r.nodeSize,mark:l})))}),i}var u4=(n,e,t,i=20)=>{const r=n.doc.resolve(t);let s=i,l=null;for(;s>0&&l===null;){const o=r.node(s);(o==null?void 0:o.type.name)===e?l=o:s-=1}return[l,s]};function Eu(n,e){return e.nodes[n]||e.marks[n]||null}function Ep(n,e,t){return Object.fromEntries(Object.entries(t).filter(([i])=>{const r=n.find(s=>s.type===e&&s.name===i);return r?r.attribute.keepOnSplit:!1}))}var h4=(n,e=500)=>{let t="";const i=n.parentOffset;return n.parent.nodesBetween(Math.max(0,i-e),i,(r,s,l,o)=>{var c,h;const d=((h=(c=r.type.spec).toText)==null?void 0:h.call(c,{node:r,pos:s,parent:l,index:o}))||r.textContent||"%leaf%";t+=r.isAtom&&!r.isText?d:d.slice(0,Math.max(0,i-s))}),t};function x1(n,e,t={}){const{empty:i,ranges:r}=n.selection,s=e?Ds(e,n.schema):null;if(i)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>nm(p.attrs,t,{strict:!1}));let l=0;const o=[];if(r.forEach(({$from:p,$to:g})=>{const O=p.pos,b=g.pos;n.doc.nodesBetween(O,b,(v,x)=>{if(s&&v.inlineContent&&!v.type.allowsMarkType(s))return!1;if(!v.isText&&!v.marks.length)return;const k=Math.max(O,x),C=Math.min(b,x+v.nodeSize),A=C-k;l+=A,o.push(...v.marks.map(P=>({mark:P,from:k,to:C})))})}),l===0)return!1;const c=o.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>nm(p.mark.attrs,t,{strict:!1})).reduce((p,g)=>p+g.to-g.from,0),h=o.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,g)=>p+g.to-g.from,0);return(c>0?c+h:c)>=l}function f4(n,e,t={}){if(!e)return Rl(n,null,t)||x1(n,null,t);const i=$g(e,n.schema);return i==="node"?Rl(n,e,t):i==="mark"?x1(n,e,t):!1}var d4=(n,e)=>{const{$from:t,$to:i,$anchor:r}=n.selection;if(e){const s=Rg(o=>o.type.name===e)(n.selection);if(!s)return!1;const l=n.doc.resolve(s.pos+1);return r.pos+1===l.end()}return!(i.parentOffset<i.parent.nodeSize-2||t.pos!==i.pos)},p4=n=>{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function CM(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Iy(n,e){const{nodeExtensions:t}=ac(e),i=t.find(l=>l.name===n);if(!i)return!1;const r={name:i.name,options:i.options,storage:i.storage},s=tt(ke(i,"group",r));return typeof s!="string"?!1:s.split(" ").includes("list")}function Pg(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var i;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return!/\S/.test((i=n.text)!=null?i:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let r=!0;return n.content.forEach(s=>{r!==!1&&(Pg(s,{ignoreWhitespace:t,checkChildren:e})||(r=!1))}),r}return!1}function hP(n){return n instanceof Te}var fP=class dP{constructor(e){this.position=e}static fromJSON(e){return new dP(e.position)}toJSON(){return{position:this.position}}};function m4(n,e){const t=e.mapping.mapResult(n.position);return{position:new fP(t.pos),mapResult:t}}function g4(n){return new fP(n)}function pP(n,e,t){const r=n.state.doc.content.size,s=ks(e,0,r),l=ks(t,0,r),o=n.coordsAtPos(s),c=n.coordsAtPos(l,-1),h=Math.min(o.top,c.top),d=Math.max(o.bottom,c.bottom),p=Math.min(o.left,c.left),g=Math.max(o.right,c.right),O=g-p,b=d-h,k={top:h,bottom:d,left:p,right:g,width:O,height:b,x:p,y:h};return{...k,toJSON:()=>k}}function O4(n,e,t){var i;const{selection:r}=e;let s=null;if(vv(r)&&(s=r.$cursor),s){const o=(i=n.storedMarks)!=null?i:s.marks();return s.parent.type.allowsMarkType(t)&&(!!t.isInSet(o)||!o.some(h=>h.type.excludes(t)))}const{ranges:l}=r;return l.some(({$from:o,$to:c})=>{let h=o.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(o.pos,c.pos,(d,p,g)=>{if(h)return!1;if(d.isInline){const O=!g||g.type.allowsMarkType(t),b=!!t.isInSet(d.marks)||!d.marks.some(v=>v.type.excludes(t));h=O&&b}return!h}),h})}var y4=(n,e={})=>({tr:t,state:i,dispatch:r})=>{const{selection:s}=t,{empty:l,ranges:o}=s,c=Ds(n,i.schema);if(r)if(l){const h=tP(i,c);t.addStoredMark(c.create({...h,...e}))}else o.forEach(h=>{const d=h.$from.pos,p=h.$to.pos;i.doc.nodesBetween(d,p,(g,O)=>{const b=Math.max(O,d),v=Math.min(O+g.nodeSize,p);g.marks.find(k=>k.type===c)?g.marks.forEach(k=>{c===k.type&&t.addMark(b,v,c.create({...k.attrs,...e}))}):t.addMark(b,v,c.create(e))})});return O4(i,t,c)},b4=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),S4=(n,e={})=>({state:t,dispatch:i,chain:r})=>{const s=Ut(n,t.schema);let l;return t.selection.$anchor.sameParent(t.selection.$head)&&(l=t.selection.$anchor.parent.attrs),s.isTextblock?r().command(({commands:o})=>_A(s,{...l,...e})(t)?!0:o.clearNodes()).command(({state:o})=>_A(s,{...l,...e})(o,i)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},v4=n=>({tr:e,dispatch:t})=>{if(t){const{doc:i}=e,r=ks(n,0,i.content.size),s=Te.create(i,r);e.setSelection(s)}return!0},x4=(n,e)=>({tr:t,state:i,dispatch:r})=>{const{selection:s}=i;let l,o;return typeof e=="number"?(l=e,o=e):e&&"from"in e&&"to"in e?(l=e.from,o=e.to):(l=s.from,o=s.to),r&&t.doc.nodesBetween(l,o,(c,h)=>{c.isText||t.setNodeMarkup(h,void 0,{...c.attrs,dir:n})}),!0},k4=n=>({tr:e,dispatch:t})=>{if(t){const{doc:i}=e,{from:r,to:s}=typeof n=="number"?{from:n,to:n}:n,l=Ae.atStart(i).from,o=Ae.atEnd(i).to,c=ks(r,l,o),h=ks(s,l,o),d=Ae.create(i,c,h);e.setSelection(d)}return!0},w4=n=>({state:e,dispatch:t})=>{const i=Ut(n,e.schema);return yj(i)(e,t)};function AM(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const i=t.filter(r=>e==null?void 0:e.includes(r.type.name));n.tr.ensureMarks(i)}}var T4=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:i,editor:r})=>{const{selection:s,doc:l}=e,{$from:o,$to:c}=s,h=r.extensionManager.attributes,d=Ep(h,o.node().type.name,o.node().attrs);if(s instanceof Te&&s.node.isBlock)return!o.parentOffset||!Cs(l,o.pos)?!1:(i&&(n&&AM(t,r.extensionManager.splittableMarks),e.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,g=o.depth===0?void 0:e4(o.node(-1).contentMatchAt(o.indexAfter(-1)));let O=p&&g?[{type:g,attrs:d}]:void 0,b=Cs(e.doc,e.mapping.map(o.pos),1,O);if(!O&&!b&&Cs(e.doc,e.mapping.map(o.pos),1,g?[{type:g}]:void 0)&&(b=!0,O=g?[{type:g,attrs:d}]:void 0),i){if(b&&(s instanceof Ae&&e.deleteSelection(),e.split(e.mapping.map(o.pos),1,O),g&&!p&&!o.parentOffset&&o.parent.type!==g)){const v=e.mapping.map(o.before()),x=e.doc.resolve(v);o.node(-1).canReplaceWith(x.index(),x.index()+1,g)&&e.setNodeMarkup(e.mapping.map(o.before()),g)}n&&AM(t,r.extensionManager.splittableMarks),e.scrollIntoView()}return b},C4=(n,e={})=>({tr:t,state:i,dispatch:r,editor:s})=>{var l;const o=Ut(n,i.schema),{$from:c,$to:h}=i.selection,d=i.selection.node;if(d&&d.isBlock||c.depth<2||!c.sameParent(h))return!1;const p=c.node(-1);if(p.type!==o)return!1;const g=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==o||c.index(-2)!==c.node(-2).childCount-1)return!1;if(r){let k=ne.empty;const C=c.index(-1)?1:c.index(-2)?2:3;for(let H=c.depth-C;H>=c.depth-3;H-=1)k=ne.from(c.node(H).copy(k));const A=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,P={...Ep(g,c.node().type.name,c.node().attrs),...e},E=((l=o.contentMatch.defaultType)==null?void 0:l.createAndFill(P))||void 0;k=k.append(ne.from(o.createAndFill(null,E)||void 0));const D=c.before(c.depth-(C-1));t.replace(D,c.after(-A),new pe(k,4-C,0));let $=-1;t.doc.nodesBetween(D,t.doc.content.size,(H,W)=>{if($>-1)return!1;H.isTextblock&&H.content.size===0&&($=W+1)}),$>-1&&t.setSelection(Ae.near(t.doc.resolve($))),t.scrollIntoView()}return!0}const O=h.pos===c.end()?p.contentMatchAt(0).defaultType:null,b={...Ep(g,p.type.name,p.attrs),...e},v={...Ep(g,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,h.pos);const x=O?[{type:o,attrs:b},{type:O,attrs:v}]:[{type:o,attrs:b}];if(!Cs(t.doc,c.pos,2))return!1;if(r){const{selection:k,storedMarks:C}=i,{splittableMarks:A}=s.extensionManager,P=C||k.$to.parentOffset&&k.$from.marks();if(t.split(c.pos,2,x).scrollIntoView(),!P||!r)return!0;const E=P.filter(D=>A.includes(D.type.name));t.ensureMarks(E)}return!0},Vy=(n,e)=>{const t=Rg(l=>l.type===e)(n.selection);if(!t)return!0;const i=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(i===void 0)return!0;const r=n.doc.nodeAt(i);return t.node.type===(r==null?void 0:r.type)&&Zl(n.doc,t.pos)&&n.join(t.pos),!0},qy=(n,e)=>{const t=Rg(l=>l.type===e)(n.selection);if(!t)return!0;const i=n.doc.resolve(t.start).after(t.depth);if(i===void 0)return!0;const r=n.doc.nodeAt(i);return t.node.type===(r==null?void 0:r.type)&&Zl(n.doc,i)&&n.join(i),!0};function A4(n){const e=n.doc,t=e.firstChild;if(!t)return null;const i=e.resolve(1),r=e.resolve(t.nodeSize-1);return Ae.between(i,r)}var M4=(n,e,t,i={})=>({editor:r,tr:s,state:l,dispatch:o,chain:c,commands:h,can:d})=>{const{extensions:p,splittableMarks:g}=r.extensionManager,O=Ut(n,l.schema),b=Ut(e,l.schema),{selection:v,storedMarks:x}=l,{$from:k,$to:C}=v,A=k.blockRange(C),P=x||v.$to.parentOffset&&v.$from.marks();if(!A)return!1;const E=Rg(ce=>Iy(ce.type.name,p))(v),D=v.from===0&&v.to===l.doc.content.size,$=l.doc.content.content,H=$.length===1?$[0]:null,W=D&&H&&Iy(H.type.name,p)?{node:H,pos:0}:null,te=E??W,ae=!!E&&A.depth>=1&&A.depth-E.depth<=1,re=!!W;if((ae||re)&&te){if(te.node.type===O)return D&&re?c().command(({tr:ce,dispatch:se})=>{const z=A4(ce);return z?(ce.setSelection(z),se&&se(ce),!0):!1}).liftListItem(b).run():h.liftListItem(b);if(Iy(te.node.type.name,p)&&O.validContent(te.node.content))return c().command(()=>(s.setNodeMarkup(te.pos,O),!0)).command(()=>Vy(s,O)).command(()=>qy(s,O)).run()}return!t||!P||!o?c().command(()=>d().wrapInList(O,i)?!0:h.clearNodes()).wrapInList(O,i).command(()=>Vy(s,O)).command(()=>qy(s,O)).run():c().command(()=>{const ce=d().wrapInList(O,i),se=P.filter(z=>g.includes(z.type.name));return s.ensureMarks(se),ce?!0:h.clearNodes()}).wrapInList(O,i).command(()=>Vy(s,O)).command(()=>qy(s,O)).run()},Q4=(n,e={},t={})=>({state:i,commands:r})=>{const{extendEmptyMarkRange:s=!1}=t,l=Ds(n,i.schema);return x1(i,l,e)?r.unsetMark(l,{extendEmptyMarkRange:s}):r.setMark(l,e)},E4=(n,e,t={})=>({state:i,commands:r})=>{const s=Ut(n,i.schema),l=Ut(e,i.schema),o=Rl(i,s,t);let c;return i.selection.$anchor.sameParent(i.selection.$head)&&(c=i.selection.$anchor.parent.attrs),o?r.setNode(l,c):r.setNode(s,{...c,...t})},$4=(n,e={})=>({state:t,commands:i})=>{const r=Ut(n,t.schema);return Rl(t,r,e)?i.lift(r):i.wrapIn(r,e)},R4=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let i=0;i<t.length;i+=1){const r=t[i];let s;if(r.spec.isInputRules&&(s=r.getState(n))){if(e){const l=n.tr,o=s.transform;for(let c=o.steps.length-1;c>=0;c-=1)l.step(o.steps[c].invert(o.docs[c]));if(s.text){const c=l.doc.resolve(s.from).marks();l.replaceWith(s.from,s.to,n.schema.text(s.text,c))}else l.delete(s.from,s.to)}return!0}}return!1},P4=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:i,ranges:r}=t;return i||e&&r.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},D4=(n,e={})=>({tr:t,state:i,dispatch:r})=>{var s;const{extendEmptyMarkRange:l=!1}=e,{selection:o}=t,c=Ds(n,i.schema),{$from:h,empty:d,ranges:p}=o;if(!r)return!0;if(d&&l){let{from:g,to:O}=o;const b=(s=h.marks().find(x=>x.type===c))==null?void 0:s.attrs,v=Sv(h,c,b);v&&(g=v.from,O=v.to),t.removeMark(g,O,c)}else p.forEach(g=>{t.removeMark(g.$from.pos,g.$to.pos,c)});return t.removeStoredMark(c),!0},N4=n=>({tr:e,state:t,dispatch:i})=>{const{selection:r}=t;let s,l;return typeof n=="number"?(s=n,l=n):n&&"from"in n&&"to"in n?(s=n.from,l=n.to):(s=r.from,l=r.to),i&&e.doc.nodesBetween(s,l,(o,c)=>{if(o.isText)return;const h={...o.attrs};delete h.dir,e.setNodeMarkup(c,void 0,h)}),!0},z4=(n,e={})=>({tr:t,state:i,dispatch:r})=>{let s=null,l=null;const o=$g(typeof n=="string"?n:n.name,i.schema);if(!o)return!1;o==="node"&&(s=Ut(n,i.schema)),o==="mark"&&(l=Ds(n,i.schema));let c=!1;return t.selection.ranges.forEach(h=>{const d=h.$from.pos,p=h.$to.pos;let g,O,b,v;t.selection.empty?i.doc.nodesBetween(d,p,(x,k)=>{s&&s===x.type&&(c=!0,b=Math.max(k,d),v=Math.min(k+x.nodeSize,p),g=k,O=x)}):i.doc.nodesBetween(d,p,(x,k)=>{k<d&&s&&s===x.type&&(c=!0,b=Math.max(k,d),v=Math.min(k+x.nodeSize,p),g=k,O=x),k>=d&&k<=p&&(s&&s===x.type&&(c=!0,r&&t.setNodeMarkup(k,void 0,{...x.attrs,...e})),l&&x.marks.length&&x.marks.forEach(C=>{if(l===C.type&&(c=!0,r)){const A=Math.max(k,d),P=Math.min(k+x.nodeSize,p);t.addMark(A,P,l.create({...C.attrs,...e}))}}))}),O&&(g!==void 0&&r&&t.setNodeMarkup(g,void 0,{...O.attrs,...e}),l&&O.marks.length&&O.marks.forEach(x=>{l===x.type&&r&&t.addMark(b,v,l.create({...x.attrs,...e}))}))}),c},L4=(n,e={})=>({state:t,dispatch:i})=>{const r=Ut(n,t.schema);return hj(r,e)(t,i)},_4=(n,e={})=>({state:t,dispatch:i})=>{const r=Ut(n,t.schema);return fj(r,e)(t,i)},B4=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(i=>i.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(i=>i!==e):delete this.callbacks[n]),this}once(n,e){const t=(...i)=>{this.off(n,t),e.apply(this,i)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}},Dg=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!=null?e:!0}},Z4=(n,e)=>{if(bv(e))return e.exec(n);const t=e(n);if(!t)return null;const i=[t.text];return i.index=t.index,i.input=n,i.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),i.push(t.replaceWith)),i};function Id(n){var e;const{editor:t,from:i,to:r,text:s,rules:l,plugin:o}=n,{view:c}=t;if(c.composing)return!1;const h=c.state.doc.resolve(i);if(h.parent.type.spec.code||(e=h.nodeBefore||h.nodeAfter)!=null&&e.marks.find(g=>g.type.spec.code))return!1;let d=!1;const p=h4(h)+s;return l.forEach(g=>{if(d)return;const O=Z4(p,g.find);if(!O)return;const b=c.state.tr,v=Qg({state:c.state,transaction:b}),x={from:i-(O[0].length-s.length),to:r},{commands:k,chain:C,can:A}=new Eg({editor:t,state:v});g.handler({state:v,range:x,match:O,commands:k,chain:C,can:A})===null||!b.steps.length||(g.undoable&&b.setMeta(o,{transform:b,from:i,to:r,text:s}),c.dispatch(b),d=!0)}),d}function j4(n){const{editor:e,rules:t}=n,i=new bt({state:{init(){return null},apply(r,s,l){const o=r.getMeta(i);if(o)return o;const c=r.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=kv(ne.from(d),l.schema);const{from:p}=c,g=p+d.length;Id({editor:e,from:p,to:g,text:d,rules:t,plugin:i})}),r.selectionSet||r.docChanged?null:s}},props:{handleTextInput(r,s,l,o){return Id({editor:e,from:s,to:l,text:o,rules:t,plugin:i})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:s}=r.state.selection;s&&Id({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:i})}),!1)},handleKeyDown(r,s){if(s.key!=="Enter")return!1;const{$cursor:l}=r.state.selection;return l?Id({editor:e,from:l.pos,to:l.pos,text:`
|
|
69
|
+
`,rules:t,plugin:i}):!1}},isInputRules:!0});return i}function X4(n){return Object.prototype.toString.call(n).slice(8,-1)}function Vd(n){return X4(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function mP(n,e){const t={...n};return Vd(n)&&Vd(e)&&Object.keys(e).forEach(i=>{Vd(e[i])&&Vd(n[i])?t[i]=mP(n[i],e[i]):t[i]=e[i]}),t}var Cv=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...tt(ke(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...tt(ke(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>mP(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},Vo=class gP extends Cv{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new gP(t)}static handleExit({editor:e,mark:t}){const{tr:i}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){const l=r.marks();if(!!!l.find(h=>(h==null?void 0:h.type.name)===t.name))return!1;const c=l.find(h=>(h==null?void 0:h.type.name)===t.name);return c&&i.removeStoredMark(c),i.insertText(" ",r.pos),e.view.dispatch(i),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function I4(n){return typeof n=="number"}var V4=class{constructor(n){this.find=n.find,this.handler=n.handler}},q4=(n,e,t)=>{if(bv(e))return[...n.matchAll(e)];const i=e(n,t);return i?i.map(r=>{const s=[r.text];return s.index=r.index,s.input=n,s.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(r.replaceWith)),s}):[]};function H4(n){const{editor:e,state:t,from:i,to:r,rule:s,pasteEvent:l,dropEvent:o}=n,{commands:c,chain:h,can:d}=new Eg({editor:e,state:t}),p=[];return t.doc.nodesBetween(i,r,(O,b)=>{var v,x,k,C,A;if((x=(v=O.type)==null?void 0:v.spec)!=null&&x.code||!(O.isText||O.isTextblock||O.isInline))return;const P=(A=(C=(k=O.content)==null?void 0:k.size)!=null?C:O.nodeSize)!=null?A:0,E=Math.max(i,b),D=Math.min(r,b+P);if(E>=D)return;const $=O.isText?O.text||"":O.textBetween(E-b,D-b,void 0,"");q4($,s.find,l).forEach(W=>{if(W.index===void 0)return;const te=E+W.index+1,ae=te+W[0].length,re={from:t.tr.mapping.map(te),to:t.tr.mapping.map(ae)},ce=s.handler({state:t,range:re,match:W,commands:c,chain:h,can:d,pasteEvent:l,dropEvent:o});p.push(ce)})}),p.every(O=>O!==null)}var qd=null,Y4=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function U4(n){const{editor:e,rules:t}=n;let i=null,r=!1,s=!1,l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,o;try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}const c=({state:d,from:p,to:g,rule:O,pasteEvt:b})=>{const v=d.tr,x=Qg({state:d,transaction:v});if(!(!H4({editor:e,state:x,from:Math.max(p-1,0),to:g.b-1,rule:O,pasteEvent:b,dropEvent:o})||!v.steps.length)){try{o=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{o=null}return l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,v}};return t.map(d=>new bt({view(p){const g=b=>{var v;i=(v=p.dom.parentElement)!=null&&v.contains(b.target)?p.dom.parentElement:null,i&&(qd=e)},O=()=>{qd&&(qd=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",O),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",O)}}},props:{handleDOMEvents:{drop:(p,g)=>{if(s=i===p.dom.parentElement,o=g,!s){const O=qd;O!=null&&O.isEditable&&setTimeout(()=>{const b=O.state.selection;b&&O.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(p,g)=>{var O;const b=(O=g.clipboardData)==null?void 0:O.getData("text/html");return l=g,r=!!(b!=null&&b.includes("data-pm-slice")),!1}}},appendTransaction:(p,g,O)=>{const b=p[0],v=b.getMeta("uiEvent")==="paste"&&!r,x=b.getMeta("uiEvent")==="drop"&&!s,k=b.getMeta("applyPasteRules"),C=!!k;if(!v&&!x&&!C)return;if(C){let{text:E}=k;typeof E=="string"?E=E:E=kv(ne.from(E),O.schema);const{from:D}=k,$=D+E.length,H=Y4(E);return c({rule:d,state:O,from:D,to:{b:$},pasteEvt:H})}const A=g.doc.content.findDiffStart(O.doc.content),P=g.doc.content.findDiffEnd(O.doc.content);if(!(!I4(A)||!P||A===P.b))return c({rule:d,state:O,from:A,to:P,pasteEvt:l})}}))}var Ng=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=n,this.extensions=lP(n),this.schema=s4(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Eu(e.name,this.schema)},i=ke(e,"addCommands",t);return i?{...n,...i()}:n},{})}get plugins(){const{editor:n}=this;return lh([...this.extensions].reverse()).flatMap(i=>{const r={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:n,type:Eu(i.name,this.schema)},s=[],l=ke(i,"addKeyboardShortcuts",r);let o={};if(i.type==="mark"&&ke(i,"exitable",r)&&(o.ArrowRight=()=>Vo.handleExit({editor:n,mark:i})),l){const g=Object.fromEntries(Object.entries(l()).map(([O,b])=>[O,()=>b({editor:n})]));o={...o,...g}}const c=aI(o);s.push(c);const h=ke(i,"addInputRules",r);if(CM(i,n.options.enableInputRules)&&h){const g=h();if(g&&g.length){const O=j4({editor:n,rules:g}),b=Array.isArray(O)?O:[O];s.push(...b)}}const d=ke(i,"addPasteRules",r);if(CM(i,n.options.enablePasteRules)&&d){const g=d();if(g&&g.length){const O=U4({editor:n,rules:g});s.push(...O)}}const p=ke(i,"addProseMirrorPlugins",r);if(p){const g=p();s.push(...g)}return s})}get attributes(){return sP(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=ac(this.extensions);return Object.fromEntries(e.filter(t=>!!ke(t,"addNodeView")).map(t=>{const i=this.attributes.filter(c=>c.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Ut(t.name,this.schema)},s=ke(t,"addNodeView",r);if(!s)return[];const l=s();if(!l)return[];const o=(c,h,d,p,g)=>{const O=Rh(c,i);return l({node:c,view:h,getPos:d,decorations:p,innerDecorations:g,editor:n,extension:t,HTMLAttributes:O})};return[t.name,o]}))}dispatchTransaction(n){const{editor:e}=this;return lh([...this.extensions].reverse()).reduceRight((i,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Eu(r.name,this.schema)},l=ke(r,"dispatchTransaction",s);return l?o=>{l.call(s,{transaction:o,next:i})}:i},n)}transformPastedHTML(n){const{editor:e}=this;return lh([...this.extensions]).reduce((i,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:Eu(r.name,this.schema)},l=ke(r,"transformPastedHTML",s);return l?(o,c)=>{const h=i(o,c);return l.call(s,h)}:i},n||(i=>i))}get markViews(){const{editor:n}=this,{markExtensions:e}=ac(this.extensions);return Object.fromEntries(e.filter(t=>!!ke(t,"addMarkView")).map(t=>{const i=this.attributes.filter(o=>o.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:Ds(t.name,this.schema)},s=ke(t,"addMarkView",r);if(!s)return[];const l=(o,c,h)=>{const d=Rh(o,i);return s()({mark:o,view:c,inline:h,editor:n,extension:t,HTMLAttributes:d,updateAttributes:p=>{cV(o,n,p)}})};return[t.name,l]}))}destroy(){this.extensions.forEach(n=>{let e=n;for(;e.parent;){const t=e.parent;t.child===e&&(t.child=null),e=t}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;const i={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Eu(e.name,this.schema)};e.type==="mark"&&((t=tt(ke(e,"keepOnSplit",i)))==null||t)&&this.splittableMarks.push(e.name);const r=ke(e,"onBeforeCreate",i),s=ke(e,"onCreate",i),l=ke(e,"onUpdate",i),o=ke(e,"onSelectionUpdate",i),c=ke(e,"onTransaction",i),h=ke(e,"onFocus",i),d=ke(e,"onBlur",i),p=ke(e,"onDestroy",i);r&&this.editor.on("beforeCreate",r),s&&this.editor.on("create",s),l&&this.editor.on("update",l),o&&this.editor.on("selectionUpdate",o),c&&this.editor.on("transaction",c),h&&this.editor.on("focus",h),d&&this.editor.on("blur",d),p&&this.editor.on("destroy",p)})}};Ng.resolve=lP;Ng.sort=lh;Ng.flatten=xv;var W4={};yv(W4,{ClipboardTextSerializer:()=>yP,Commands:()=>bP,Delete:()=>SP,Drop:()=>vP,Editable:()=>xP,FocusEvents:()=>wP,Keymap:()=>TP,Paste:()=>CP,Tabindex:()=>AP,TextDirection:()=>MP,focusEventsPluginKey:()=>kP});var Et=class OP extends Cv{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new OP(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},yP=Et.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new bt({key:new At("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:i,selection:r}=e,{ranges:s}=r,l=Math.min(...s.map(d=>d.$from.pos)),o=Math.max(...s.map(d=>d.$to.pos)),c=wv(t);return oP(i,{from:l,to:o},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),bP=Et.create({name:"commands",addCommands(){return{...G2}}}),SP=Et.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,i,r;const s=()=>{var l,o,c,h;if((h=(c=(o=(l=this.editor.options.coreExtensionOptions)==null?void 0:l.delete)==null?void 0:o.filterTransaction)==null?void 0:c.call(o,n))!=null?h:n.getMeta("y-sync$"))return;const d=nP(n.before,[n,...e]);uP(d).forEach(O=>{d.mapping.mapResult(O.oldRange.from).deletedAfter&&d.mapping.mapResult(O.oldRange.to).deletedBefore&&d.before.nodesBetween(O.oldRange.from,O.oldRange.to,(b,v)=>{const x=v+b.nodeSize-2,k=O.oldRange.from<=v&&x<=O.oldRange.to;this.editor.emit("delete",{type:"node",node:b,from:v,to:x,newFrom:d.mapping.map(v),newTo:d.mapping.map(x),deletedRange:O.oldRange,newRange:O.newRange,partial:!k,editor:this.editor,transaction:n,combinedTransform:d})})});const g=d.mapping;d.steps.forEach((O,b)=>{var v,x;if(O instanceof nr){const k=g.slice(b).map(O.from,-1),C=g.slice(b).map(O.to),A=g.invert().map(k,-1),P=g.invert().map(C),E=k>0?(v=d.doc.nodeAt(k-1))==null?void 0:v.marks.some($=>$.eq(O.mark)):!1,D=(x=d.doc.nodeAt(C))==null?void 0:x.marks.some($=>$.eq(O.mark));this.editor.emit("delete",{type:"mark",mark:O.mark,from:O.from,to:O.to,deletedRange:{from:A,to:P},newRange:{from:k,to:C},partial:!!(D||E),editor:this.editor,transaction:n,combinedTransform:d})}})};(r=(i=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:i.async)==null||r?setTimeout(s,0):s()}}),vP=Et.create({name:"drop",addProseMirrorPlugins(){return[new bt({key:new At("tiptapDrop"),props:{handleDrop:(n,e,t,i)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:i})}}})]}}),xP=Et.create({name:"editable",addProseMirrorPlugins(){return[new bt({key:new At("editable"),props:{editable:()=>this.editor.options.editable}})]}}),kP=new At("focusEvents"),wP=Et.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new bt({key:kP,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const i=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(i),!1},blur:(e,t)=>{n.isFocused=!1;const i=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(i),!1}}}})]}}),TP=Et.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.command(({tr:o})=>{const{selection:c,doc:h}=o,{empty:d,$anchor:p}=c,{pos:g,parent:O}=p,b=p.parent.isTextblock&&g>0?o.doc.resolve(g-1):p,v=b.parent.type.spec.isolating,x=p.pos-p.parentOffset,k=v&&b.parent.childCount===1?x===p.pos:Pe.atStart(h).from===g;return!d||!O.type.isTextblock||O.textContent.length||!k||k&&p.parent.type.name==="paragraph"?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),i={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},r={...i},s={...i,"Ctrl-h":n,"Alt-Backspace":n,"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 im()||eP()?s:r},addProseMirrorPlugins(){return[new bt({key:new At("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(v=>v.getMeta("composition")))return;const i=n.some(v=>v.docChanged)&&!e.doc.eq(t.doc),r=n.some(v=>v.getMeta("preventClearDocument"));if(!i||r)return;const{empty:s,from:l,to:o}=e.selection,c=Pe.atStart(e.doc).from,h=Pe.atEnd(e.doc).to;if(s||!(l===c&&o===h)||!Pg(t.doc))return;const g=t.tr,O=Qg({state:t,transaction:g}),{commands:b}=new Eg({editor:this.editor,state:O});if(b.clearNodes(),!!g.steps.length)return g}})]}}),CP=Et.create({name:"paste",addProseMirrorPlugins(){return[new bt({key:new At("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),AP=Et.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new bt({key:new At("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!=null?n:"0"}}}})]}}),MP=Et.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=ac(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new bt({key:new At("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),G4=class Wu{constructor(e,t,i=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=i,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,i=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,i=this.to-1}this.editor.commands.insertContentAt({from:t,to:i},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new Wu(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Wu(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Wu(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,i)=>{const r=t.isBlock&&!t.isTextblock,s=t.isAtom&&!t.isText,l=t.isInline,o=this.pos+i+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(o);if(!r&&!l&&c.depth<=this.depth)return;const h=new Wu(c,this.editor,r,r||l?t:null);r&&(h.actualDepth=this.depth+1),e.push(h)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let i=null,r=this.parent;for(;r&&!i;){if(r.node.type.name===e)if(Object.keys(t).length>0){const s=r.node.attrs,l=Object.keys(t);for(let o=0;o<l.length;o+=1){const c=l[o];if(s[c]!==t[c])break}}else i=r;r=r.parent}return i}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},i=!1){let r=[];if(!this.children||this.children.length===0)return r;const s=Object.keys(t);return this.children.forEach(l=>{i&&r.length>0||(l.node.type.name===e&&s.every(c=>t[c]===l.node.attrs[c])&&r.push(l),!(i&&r.length>0)&&(r=r.concat(l.querySelectorAll(e,t,i))))}),r}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},F4=`.ProseMirror {
|
|
70
|
+
position: relative;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.ProseMirror {
|
|
74
|
+
word-wrap: break-word;
|
|
75
|
+
white-space: pre-wrap;
|
|
76
|
+
white-space: break-spaces;
|
|
77
|
+
-webkit-font-variant-ligatures: none;
|
|
78
|
+
font-variant-ligatures: none;
|
|
79
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ProseMirror [contenteditable="false"] {
|
|
83
|
+
white-space: normal;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
87
|
+
white-space: pre-wrap;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ProseMirror pre {
|
|
91
|
+
white-space: pre-wrap;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
img.ProseMirror-separator {
|
|
95
|
+
display: inline !important;
|
|
96
|
+
border: none !important;
|
|
97
|
+
margin: 0 !important;
|
|
98
|
+
width: 0 !important;
|
|
99
|
+
height: 0 !important;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.ProseMirror-gapcursor {
|
|
103
|
+
display: none;
|
|
104
|
+
pointer-events: none;
|
|
105
|
+
position: absolute;
|
|
106
|
+
margin: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ProseMirror-gapcursor:after {
|
|
110
|
+
content: "";
|
|
111
|
+
display: block;
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: -2px;
|
|
114
|
+
width: 20px;
|
|
115
|
+
border-top: 1px solid black;
|
|
116
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@keyframes ProseMirror-cursor-blink {
|
|
120
|
+
to {
|
|
121
|
+
visibility: hidden;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.ProseMirror-hideselection *::selection {
|
|
126
|
+
background: transparent;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
130
|
+
background: transparent;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.ProseMirror-hideselection * {
|
|
134
|
+
caret-color: transparent;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
138
|
+
display: block;
|
|
139
|
+
}`;function K4(n,e,t){const i=document.querySelector("style[data-tiptap-style]");if(i!==null)return i;const r=document.createElement("style");return e&&r.setAttribute("nonce",e),r.setAttribute("data-tiptap-style",""),r.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(r),r}var J4=class extends B4{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:i})=>{throw i},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:m4,createMappablePosition:g4},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),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),this.on("drop",({event:i,slice:r,moved:s})=>this.options.onDrop(i,r,s)),this.on("paste",({event:i,slice:r})=>this.options.onPaste(i,r)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=K2(e,this.options.autofocus);this.editorState=KZ.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n!=null&&n.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}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&&typeof document<"u"&&(this.css=K4(F4,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=rP(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],i=this.state.reconfigure({plugins:t});return this.view.updateState(i),i}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(r=>{const s=typeof r=="string"?`${r}$`:r.key;t=t.filter(l=>!l.key.startsWith(s))}),e.length===t.length)return;const i=this.state.reconfigure({plugins:t});return this.view.updateState(i),i}createExtensionManager(){var n,e,t,i;const s=[...this.options.enableCoreExtensions?[xP,yP.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),bP,wP,TP,AP.configure({value:(i=(t=this.options.coreExtensionOptions)==null?void 0:t.tabindex)==null?void 0:i.value}),vP,CP,SP,MP.configure({direction:this.options.textDirection})].filter(l=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[l.name]!==!1:!0):[],...this.options.extensions].filter(l=>["extension","node","mark"].includes(l==null?void 0:l.type));this.extensionManager=new Ng(s,this)}createCommandManager(){this.commandManager=new Eg({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=v1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=v1(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,i=e.dispatchTransaction||this.dispatchTransaction.bind(this),r=t?this.extensionManager.dispatchTransaction(i):i,s=e.transformPastedHTML,l=this.extensionManager.transformPastedHTML(s);this.editorView=new U2(n,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:r,transformPastedHTML:l,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(h=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(h)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),i=!this.state.selection.eq(e.selection),r=t.includes(n),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!r)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),i&&this.emit("selectionUpdate",{editor:this,transaction:n});const l=t.findLast(h=>h.getMeta("focus")||h.getMeta("blur")),o=l==null?void 0:l.getMeta("focus"),c=l==null?void 0:l.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:l}),c&&this.emit("blur",{editor:this,event:c.event,transaction:l}),!(n.getMeta("preventUpdate")||!t.some(h=>h.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return cP(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,i=typeof n=="string"?e:n;return f4(this.state,t,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return kv(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=`
|
|
140
|
+
|
|
141
|
+
`,textSerializers:t={}}=n||{};return aP(this.state.doc,{blockSeparator:e,textSerializers:{...wv(this.schema),...t}})}get isEmpty(){return Pg(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n);return new G4(e,this)}get $doc(){return this.$pos(0)}};function cc(n){return new Dg({find:n.find,handler:({state:e,range:t,match:i})=>{const r=tt(n.getAttributes,void 0,i);if(r===!1||r===null)return null;const{tr:s}=e,l=i[i.length-1],o=i[0];if(l){const c=o.search(/\S/),h=t.from+o.indexOf(l),d=h+l.length;if(Tv(t.from,t.to,e.doc).filter(O=>O.mark.type.excluded.find(v=>v===n.type&&v!==O.mark.type)).filter(O=>O.to>h).length)return null;d<t.to&&s.delete(d,t.to),h>t.from&&s.delete(t.from+c,h);const g=t.from+c+l.length;s.addMark(t.from+c,g,n.type.create(r||{})),s.removeStoredMark(n.type)}},undoable:n.undoable})}function QP(n){return new Dg({find:n.find,handler:({state:e,range:t,match:i})=>{const r=tt(n.getAttributes,void 0,i)||{},{tr:s}=e,l=t.from;let o=t.to;const c=n.type.create(r);if(i[1]){const h=i[0].lastIndexOf(i[1]);let d=l+h;d>o?d=o:o=d+i[1].length;const p=i[0][i[0].length-1];s.insertText(p,l+i[0].length-1),s.replaceWith(d,o,c)}else if(i[0]){const h=n.type.isInline?l:l-1;s.insert(h,n.type.create(r)).delete(s.mapping.map(l),s.mapping.map(o))}s.scrollIntoView()},undoable:n.undoable})}function k1(n){return new Dg({find:n.find,handler:({state:e,range:t,match:i})=>{const r=e.doc.resolve(t.from),s=tt(n.getAttributes,void 0,i)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)},undoable:n.undoable})}function uc(n){return new Dg({find:n.find,handler:({state:e,range:t,match:i,chain:r})=>{const s=tt(n.getAttributes,void 0,i)||{},l=e.tr.delete(t.from,t.to),c=l.doc.resolve(t.from).blockRange(),h=c&&tv(c,n.type,s);if(!h)return null;if(l.wrap(c,h),n.keepMarks&&n.editor){const{selection:p,storedMarks:g}=e,{splittableMarks:O}=n.editor.extensionManager,b=g||p.$to.parentOffset&&p.$from.marks();if(b){const v=b.filter(x=>O.includes(x.type.name));l.ensureMarks(v)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(p,s).run()}const d=l.doc.resolve(t.from-1).nodeBefore;d&&d.type===n.type&&Zl(l.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(i,d))&&l.join(t.from-1)},undoable:n.undoable})}var eV=n=>"touches"in n,tV=class{constructor(n){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.clientX-this.startX,h=o.clientY-this.startY;this.handleResize(c,h)},this.handleTouchMove=o=>{if(!this.isResizing||!this.activeHandle)return;const c=o.touches[0];if(!c)return;const h=c.clientX-this.startX,d=c.clientY-this.startY;this.handleResize(h,d)},this.handleMouseUp=()=>{if(!this.isResizing)return;const o=this.element.offsetWidth,c=this.element.offsetHeight;this.onCommit(o,c),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=o=>{o.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,t,i,r,s,l;this.node=n.node,this.editor=n.editor,this.element=n.element,this.contentElement=n.contentElement,this.getPos=n.getPos,this.onResize=n.onResize,this.onCommit=n.onCommit,this.onUpdate=n.onUpdate,(e=n.options)!=null&&e.min&&(this.minSize={...this.minSize,...n.options.min}),(t=n.options)!=null&&t.max&&(this.maxSize=n.options.max),(i=n==null?void 0:n.options)!=null&&i.directions&&(this.directions=n.options.directions),(r=n.options)!=null&&r.preserveAspectRatio&&(this.preserveAspectRatio=n.options.preserveAspectRatio),(s=n.options)!=null&&s.className&&(this.classNames={container:n.options.className.container||"",wrapper:n.options.className.wrapper||"",handle:n.options.className.handle||"",resizing:n.options.className.resizing||""}),(l=n.options)!=null&&l.createCustomHandle&&(this.createCustomHandle=n.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var n;return(n=this.contentElement)!=null?n:null}handleEditorUpdate(){const n=this.editor.isEditable;n!==this.lastEditableState&&(this.lastEditableState=n,n?n&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(n,e,t){return n.type!==this.node.type?!1:(this.node=n,this.onUpdate?this.onUpdate(n,e,t):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const n=document.createElement("div");return n.dataset.resizeContainer="",n.dataset.node=this.node.type.name,n.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(n.className=this.classNames.container),n.appendChild(this.wrapper),n}createWrapper(){const n=document.createElement("div");return n.style.position="relative",n.style.display="block",n.dataset.resizeWrapper="",this.classNames.wrapper&&(n.className=this.classNames.wrapper),n.appendChild(this.element),n}createHandle(n){const e=document.createElement("div");return e.dataset.resizeHandle=n,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(n,e){const t=e.includes("top"),i=e.includes("bottom"),r=e.includes("left"),s=e.includes("right");t&&(n.style.top="0"),i&&(n.style.bottom="0"),r&&(n.style.left="0"),s&&(n.style.right="0"),(e==="top"||e==="bottom")&&(n.style.left="0",n.style.right="0"),(e==="left"||e==="right")&&(n.style.top="0",n.style.bottom="0")}attachHandles(){this.directions.forEach(n=>{let e;this.createCustomHandle?e=this.createCustomHandle(n):e=this.createHandle(n),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${n}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(n)),this.createCustomHandle||this.positionHandle(e,n),e.addEventListener("mousedown",t=>this.handleResizeStart(t,n)),e.addEventListener("touchstart",t=>this.handleResizeStart(t,n)),this.handleMap.set(n,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(n=>n.remove()),this.handleMap.clear()}applyInitialSize(){const n=this.node.attrs.width,e=this.node.attrs.height;n?(this.element.style.width=`${n}px`,this.initialWidth=n):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(n,e){n.preventDefault(),n.stopPropagation(),this.isResizing=!0,this.activeHandle=e,eV(n)?(this.startX=n.touches[0].clientX,this.startY=n.touches[0].clientY):(this.startX=n.clientX,this.startY=n.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(n,e){if(!this.activeHandle)return;const t=this.preserveAspectRatio||this.isShiftKeyPressed,{width:i,height:r}=this.calculateNewDimensions(this.activeHandle,n,e),s=this.applyConstraints(i,r,t);this.element.style.width=`${s.width}px`,this.element.style.height=`${s.height}px`,this.onResize&&this.onResize(s.width,s.height)}calculateNewDimensions(n,e,t){let i=this.startWidth,r=this.startHeight;const s=n.includes("right"),l=n.includes("left"),o=n.includes("bottom"),c=n.includes("top");return s?i=this.startWidth+e:l&&(i=this.startWidth-e),o?r=this.startHeight+t:c&&(r=this.startHeight-t),(n==="right"||n==="left")&&(i=this.startWidth+(s?e:-e)),(n==="top"||n==="bottom")&&(r=this.startHeight+(o?t:-t)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(i,r,n):{width:i,height:r}}applyConstraints(n,e,t){var i,r,s,l;if(!t){let h=Math.max(this.minSize.width,n),d=Math.max(this.minSize.height,e);return(i=this.maxSize)!=null&&i.width&&(h=Math.min(this.maxSize.width,h)),(r=this.maxSize)!=null&&r.height&&(d=Math.min(this.maxSize.height,d)),{width:h,height:d}}let o=n,c=e;return o<this.minSize.width&&(o=this.minSize.width,c=o/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,o=c*this.aspectRatio),(s=this.maxSize)!=null&&s.width&&o>this.maxSize.width&&(o=this.maxSize.width,c=o/this.aspectRatio),(l=this.maxSize)!=null&&l.height&&c>this.maxSize.height&&(c=this.maxSize.height,o=c*this.aspectRatio),{width:o,height:c}}applyAspectRatio(n,e,t){const i=t==="left"||t==="right",r=t==="top"||t==="bottom";return i?{width:n,height:n/this.aspectRatio}:r?{width:e*this.aspectRatio,height:e}:{width:n,height:n/this.aspectRatio}}};function nV(n,e){const{selection:t}=n,{$from:i}=t;if(t instanceof Te){const s=i.index();return i.parent.canReplaceWith(s,s+1,e)}let r=i.depth;for(;r>=0;){const s=i.index(r);if(i.node(r).contentMatchAt(s).matchType(e))return!0;r-=1}return!1}var iV={};yv(iV,{createAtomBlockMarkdownSpec:()=>rV,createBlockMarkdownSpec:()=>sV,createInlineMarkdownSpec:()=>aV,parseAttributes:()=>Av,parseIndentedBlocks:()=>w1,renderNestedMarkdownContent:()=>Qv,serializeAttributes:()=>Mv});function Av(n){if(!(n!=null&&n.trim()))return{};const e={},t=[],i=n.replace(/["']([^"']*)["']/g,h=>(t.push(h),`__QUOTED_${t.length-1}__`)),r=i.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(r){const h=r.map(d=>d.trim().slice(1));e.class=h.join(" ")}const s=i.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]);const l=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(i.matchAll(l)).forEach(([,h,d])=>{var p;const g=parseInt(((p=d.match(/__QUOTED_(\d+)__/))==null?void 0:p[1])||"0",10),O=t[g];O&&(e[h]=O.slice(1,-1))});const c=i.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(d=>{d.match(/^[a-zA-Z][\w-]*$/)&&(e[d]=!0)}),e}function Mv(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(i=>e.push(`.${i}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,i])=>{t==="class"||t==="id"||(i===!0?e.push(t):i!==!1&&i!=null&&e.push(`${t}="${String(i)}"`))}),e.join(" ")}function rV(n){const{nodeName:e,name:t,parseAttributes:i=Av,serializeAttributes:r=Mv,defaultAttributes:s={},requiredAttributes:l=[],allowedAttributes:o}=n,c=t||e,h=d=>{if(!o)return d;const p={};return o.forEach(g=>{g in d&&(p[g]=d[g])}),p};return{parseMarkdown:(d,p)=>{const g={...s,...d.attributes};return p.createNode(e,g,[])},markdownTokenizer:{name:e,level:"block",start(d){var p;const g=new RegExp(`^:::${c}(?:\\s|$)`,"m"),O=(p=d.match(g))==null?void 0:p.index;return O!==void 0?O:-1},tokenize(d,p,g){const O=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),b=d.match(O);if(!b)return;const v=b[1]||"",x=i(v);if(!l.find(C=>!(C in x)))return{type:e,raw:b[0],attributes:x}}},renderMarkdown:d=>{const p=h(d.attrs||{}),g=r(p),O=g?` {${g}}`:"";return`:::${c}${O} :::`}}}function sV(n){const{nodeName:e,name:t,getContent:i,parseAttributes:r=Av,serializeAttributes:s=Mv,defaultAttributes:l={},content:o="block",allowedAttributes:c}=n,h=t||e,d=p=>{if(!c)return p;const g={};return c.forEach(O=>{O in p&&(g[O]=p[O])}),g};return{parseMarkdown:(p,g)=>{let O;if(i){const v=i(p);O=typeof v=="string"?[{type:"text",text:v}]:v}else o==="block"?O=g.parseChildren(p.tokens||[]):O=g.parseInline(p.tokens||[]);const b={...l,...p.attributes};return g.createNode(e,b,O)},markdownTokenizer:{name:e,level:"block",start(p){var g;const O=new RegExp(`^:::${h}`,"m"),b=(g=p.match(O))==null?void 0:g.index;return b!==void 0?b:-1},tokenize(p,g,O){var b;const v=new RegExp(`^:::${h}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),x=p.match(v);if(!x)return;const[k,C=""]=x,A=r(C);let P=1;const E=k.length;let D="";const $=/^:::([\w-]*)(\s.*)?/gm,H=p.slice(E);for($.lastIndex=0;;){const W=$.exec(H);if(W===null)break;const te=W.index,ae=W[1];if(!((b=W[2])!=null&&b.endsWith(":::"))){if(ae)P+=1;else if(P-=1,P===0){const re=H.slice(0,te);D=re.trim();const ce=p.slice(0,E+te+W[0].length);let se=[];if(D)if(o==="block")for(se=O.blockTokens(re),se.forEach(z=>{z.text&&(!z.tokens||z.tokens.length===0)&&(z.tokens=O.inlineTokens(z.text))});se.length>0;){const z=se[se.length-1];if(z.type==="paragraph"&&(!z.text||z.text.trim()===""))se.pop();else break}else se=O.inlineTokens(D);return{type:e,raw:ce,attributes:A,content:D,tokens:se}}}}}},renderMarkdown:(p,g)=>{const O=d(p.attrs||{}),b=s(O),v=b?` {${b}}`:"",x=g.renderChildren(p.content||[],`
|
|
142
|
+
|
|
143
|
+
`);return`:::${h}${v}
|
|
144
|
+
|
|
145
|
+
${x}
|
|
146
|
+
|
|
147
|
+
:::`}}}function lV(n){if(!n.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let i=t.exec(n);for(;i!==null;){const[,r,s,l]=i;e[r]=s||l,i=t.exec(n)}return e}function oV(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function aV(n){const{nodeName:e,name:t,getContent:i,parseAttributes:r=lV,serializeAttributes:s=oV,defaultAttributes:l={},selfClosing:o=!1,allowedAttributes:c}=n,h=t||e,d=g=>{if(!c)return g;const O={};return c.forEach(b=>{const v=typeof b=="string"?b:b.name,x=typeof b=="string"?void 0:b.skipIfDefault;if(v in g){const k=g[v];if(x!==void 0&&k===x)return;O[v]=k}}),O},p=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(g,O)=>{const b={...l,...g.attributes};if(o)return O.createNode(e,b);const v=i?i(g):g.content||"";return v?O.createNode(e,b,[O.createTextNode(v)]):O.createNode(e,b,[])},markdownTokenizer:{name:e,level:"inline",start(g){const O=o?new RegExp(`\\[${p}\\s*[^\\]]*\\]`):new RegExp(`\\[${p}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${p}\\]`),b=g.match(O),v=b==null?void 0:b.index;return v!==void 0?v:-1},tokenize(g,O,b){const v=o?new RegExp(`^\\[${p}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${p}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${p}\\]`),x=g.match(v);if(!x)return;let k="",C="";if(o){const[,P]=x;C=P}else{const[,P,E]=x;C=P,k=E||""}const A=r(C.trim());return{type:e,raw:x[0],content:k.trim(),attributes:A}}},renderMarkdown:g=>{let O="";i?O=i(g):g.content&&g.content.length>0&&(O=g.content.filter(k=>k.type==="text").map(k=>k.text).join(""));const b=d(g.attrs||{}),v=s(b),x=v?` ${v}`:"";return o?`[${h}${x}]`:`[${h}${x}]${O}[/${h}]`}}}function w1(n,e,t){var i,r,s,l;const o=n.split(`
|
|
148
|
+
`),c=[];let h="",d=0;const p=e.baseIndentSize||2;for(;d<o.length;){const g=o[d],O=g.match(e.itemPattern);if(!O){if(c.length>0)break;if(g.trim()===""){d+=1,h=`${h}${g}
|
|
149
|
+
`;continue}else return}const b=e.extractItemData(O),{indentLevel:v,mainContent:x}=b;h=`${h}${g}
|
|
150
|
+
`;const k=[x];for(d+=1;d<o.length;){const E=o[d];if(E.trim()===""){const $=o.slice(d+1).findIndex(te=>te.trim()!=="");if($===-1)break;if((((r=(i=o[d+1+$].match(/^(\s*)/))==null?void 0:i[1])==null?void 0:r.length)||0)>v){k.push(E),h=`${h}${E}
|
|
151
|
+
`,d+=1;continue}else break}if((((l=(s=E.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:l.length)||0)>v)k.push(E),h=`${h}${E}
|
|
152
|
+
`,d+=1;else break}let C;const A=k.slice(1);if(A.length>0){const E=A.map(D=>D.slice(v+p)).join(`
|
|
153
|
+
`);E.trim()&&(e.customNestedParser?C=e.customNestedParser(E):C=t.blockTokens(E))}const P=e.createToken(b,C);c.push(P)}if(c.length!==0)return{items:c,raw:h}}function Qv(n,e,t,i){if(!n||!Array.isArray(n.content))return"";const r=typeof t=="function"?t(i):t,[s,...l]=n.content,o=e.renderChildren([s]);let c=`${r}${o}`;return l&&l.length>0&&l.forEach((h,d)=>{var p,g;const O=(g=(p=e.renderChild)==null?void 0:p.call(e,h,d+1))!=null?g:e.renderChildren([h]);if(O!=null){const b=O.split(`
|
|
154
|
+
`).map(v=>v?e.indent(v):e.indent("")).join(`
|
|
155
|
+
`);c+=h.type==="paragraph"?`
|
|
156
|
+
|
|
157
|
+
${b}`:`
|
|
158
|
+
${b}`}}),c}function cV(n,e,t={}){const{state:i}=e,{doc:r,tr:s}=i,l=n;r.descendants((o,c)=>{const h=s.mapping.map(c),d=s.mapping.map(c)+o.nodeSize;let p=null;if(o.marks.forEach(O=>{if(O!==l)return!1;p=O}),!p)return;let g=!1;if(Object.keys(t).forEach(O=>{t[O]!==p.attrs[O]&&(g=!0)}),g){const O=n.type.create({...n.attrs,...t});s.removeMark(h,d,n.type),s.addMark(h,d,O)}}),s.docChanged&&e.view.dispatch(s)}var ln=class EP extends Cv{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new EP(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function No(n){return new V4({find:n.find,handler:({state:e,range:t,match:i,pasteEvent:r})=>{const s=tt(n.getAttributes,void 0,i,r);if(s===!1||s===null)return null;const{tr:l}=e,o=i[i.length-1],c=i[0];let h=t.to;if(o){const d=c.search(/\S/),p=t.from+c.indexOf(o),g=p+o.length;if(Tv(t.from,t.to,e.doc).filter(v=>v.mark.type.excluded.find(k=>k===n.type&&k!==v.mark.type)).filter(v=>v.to>p).length)return null;g<t.to&&l.delete(g,t.to),p>t.from&&l.delete(t.from+d,p),h=t.from+d+o.length,l.addMark(t.from+d,h,n.type.create(s||{})),i.index!==void 0&&i.input!==void 0&&i.index+i[0].length>=i.input.length||l.removeStoredMark(n.type)}}})}const{getOwnPropertyNames:uV,getOwnPropertySymbols:hV}=Object,{hasOwnProperty:fV}=Object.prototype;function Hy(n,e){return function(i,r,s){return n(i,r,s)&&e(i,r,s)}}function Hd(n){return function(t,i,r){if(!t||!i||typeof t!="object"||typeof i!="object")return n(t,i,r);const{cache:s}=r,l=s.get(t),o=s.get(i);if(l&&o)return l===i&&o===t;s.set(t,i),s.set(i,t);const c=n(t,i,r);return s.delete(t),s.delete(i),c}}function dV(n){return n!=null?n[Symbol.toStringTag]:void 0}function MM(n){return uV(n).concat(hV(n))}const pV=Object.hasOwn||((n,e)=>fV.call(n,e));function qo(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const mV="__v",gV="__o",OV="_owner",{getOwnPropertyDescriptor:QM,keys:EM}=Object;function yV(n,e){return n.byteLength===e.byteLength&&rm(new Uint8Array(n),new Uint8Array(e))}function bV(n,e,t){let i=n.length;if(e.length!==i)return!1;for(;i-- >0;)if(!t.equals(n[i],e[i],i,i,n,e,t))return!1;return!0}function SV(n,e){return n.byteLength===e.byteLength&&rm(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function vV(n,e){return qo(n.getTime(),e.getTime())}function xV(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function kV(n,e){return n===e}function $M(n,e,t){const i=n.size;if(i!==e.size)return!1;if(!i)return!0;const r=new Array(i),s=n.entries();let l,o,c=0;for(;(l=s.next())&&!l.done;){const h=e.entries();let d=!1,p=0;for(;(o=h.next())&&!o.done;){if(r[p]){p++;continue}const g=l.value,O=o.value;if(t.equals(g[0],O[0],c,p,n,e,t)&&t.equals(g[1],O[1],g[0],O[0],n,e,t)){d=r[p]=!0;break}p++}if(!d)return!1;c++}return!0}const wV=qo;function TV(n,e,t){const i=EM(n);let r=i.length;if(EM(e).length!==r)return!1;for(;r-- >0;)if(!$P(n,e,t,i[r]))return!1;return!0}function $u(n,e,t){const i=MM(n);let r=i.length;if(MM(e).length!==r)return!1;let s,l,o;for(;r-- >0;)if(s=i[r],!$P(n,e,t,s)||(l=QM(n,s),o=QM(e,s),(l||o)&&(!l||!o||l.configurable!==o.configurable||l.enumerable!==o.enumerable||l.writable!==o.writable)))return!1;return!0}function CV(n,e){return qo(n.valueOf(),e.valueOf())}function AV(n,e){return n.source===e.source&&n.flags===e.flags}function RM(n,e,t){const i=n.size;if(i!==e.size)return!1;if(!i)return!0;const r=new Array(i),s=n.values();let l,o;for(;(l=s.next())&&!l.done;){const c=e.values();let h=!1,d=0;for(;(o=c.next())&&!o.done;){if(!r[d]&&t.equals(l.value,o.value,l.value,o.value,n,e,t)){h=r[d]=!0;break}d++}if(!h)return!1}return!0}function rm(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function MV(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function $P(n,e,t,i){return(i===OV||i===gV||i===mV)&&(n.$$typeof||e.$$typeof)?!0:pV(e,i)&&t.equals(n[i],e[i],i,i,n,e,t)}const QV="[object ArrayBuffer]",EV="[object Arguments]",$V="[object Boolean]",RV="[object DataView]",PV="[object Date]",DV="[object Error]",NV="[object Map]",zV="[object Number]",LV="[object Object]",_V="[object RegExp]",BV="[object Set]",ZV="[object String]",jV={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},XV="[object URL]",IV=Object.prototype.toString;function VV({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:i,areErrorsEqual:r,areFunctionsEqual:s,areMapsEqual:l,areNumbersEqual:o,areObjectsEqual:c,arePrimitiveWrappersEqual:h,areRegExpsEqual:d,areSetsEqual:p,areTypedArraysEqual:g,areUrlsEqual:O,unknownTagComparators:b}){return function(x,k,C){if(x===k)return!0;if(x==null||k==null)return!1;const A=typeof x;if(A!==typeof k)return!1;if(A!=="object")return A==="number"?o(x,k,C):A==="function"?s(x,k,C):!1;const P=x.constructor;if(P!==k.constructor)return!1;if(P===Object)return c(x,k,C);if(Array.isArray(x))return e(x,k,C);if(P===Date)return i(x,k,C);if(P===RegExp)return d(x,k,C);if(P===Map)return l(x,k,C);if(P===Set)return p(x,k,C);const E=IV.call(x);if(E===PV)return i(x,k,C);if(E===_V)return d(x,k,C);if(E===NV)return l(x,k,C);if(E===BV)return p(x,k,C);if(E===LV)return typeof x.then!="function"&&typeof k.then!="function"&&c(x,k,C);if(E===XV)return O(x,k,C);if(E===DV)return r(x,k,C);if(E===EV)return c(x,k,C);if(jV[E])return g(x,k,C);if(E===QV)return n(x,k,C);if(E===RV)return t(x,k,C);if(E===$V||E===zV||E===ZV)return h(x,k,C);if(b){let D=b[E];if(!D){const $=dV(x);$&&(D=b[$])}if(D)return D(x,k,C)}return!1}}function qV({circular:n,createCustomConfig:e,strict:t}){let i={areArrayBuffersEqual:yV,areArraysEqual:t?$u:bV,areDataViewsEqual:SV,areDatesEqual:vV,areErrorsEqual:xV,areFunctionsEqual:kV,areMapsEqual:t?Hy($M,$u):$M,areNumbersEqual:wV,areObjectsEqual:t?$u:TV,arePrimitiveWrappersEqual:CV,areRegExpsEqual:AV,areSetsEqual:t?Hy(RM,$u):RM,areTypedArraysEqual:t?Hy(rm,$u):rm,areUrlsEqual:MV,unknownTagComparators:void 0};if(e&&(i=Object.assign({},i,e(i))),n){const r=Hd(i.areArraysEqual),s=Hd(i.areMapsEqual),l=Hd(i.areObjectsEqual),o=Hd(i.areSetsEqual);i=Object.assign({},i,{areArraysEqual:r,areMapsEqual:s,areObjectsEqual:l,areSetsEqual:o})}return i}function HV(n){return function(e,t,i,r,s,l,o){return n(e,t,o)}}function YV({circular:n,comparator:e,createState:t,equals:i,strict:r}){if(t)return function(o,c){const{cache:h=n?new WeakMap:void 0,meta:d}=t();return e(o,c,{cache:h,equals:i,meta:d,strict:r})};if(n)return function(o,c){return e(o,c,{cache:new WeakMap,equals:i,meta:void 0,strict:r})};const s={cache:void 0,equals:i,meta:void 0,strict:r};return function(o,c){return e(o,c,s)}}const UV=Xl();Xl({strict:!0});Xl({circular:!0});Xl({circular:!0,strict:!0});Xl({createInternalComparator:()=>qo});Xl({strict:!0,createInternalComparator:()=>qo});Xl({circular:!0,createInternalComparator:()=>qo});Xl({circular:!0,createInternalComparator:()=>qo,strict:!0});function Xl(n={}){const{circular:e=!1,createInternalComparator:t,createState:i,strict:r=!1}=n,s=qV(n),l=VV(s),o=t?t(l):HV(l);return YV({circular:e,comparator:l,createState:i,equals:o,strict:r})}var Yy={exports:{}},Uy={};/**
|
|
159
|
+
* @license React
|
|
160
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
161
|
+
*
|
|
162
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the MIT license found in the
|
|
165
|
+
* LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/var PM;function WV(){if(PM)return Uy;PM=1;var n=of(),e=yR();function t(h,d){return h===d&&(h!==0||1/h===1/d)||h!==h&&d!==d}var i=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=n.useRef,l=n.useEffect,o=n.useMemo,c=n.useDebugValue;return Uy.useSyncExternalStoreWithSelector=function(h,d,p,g,O){var b=s(null);if(b.current===null){var v={hasValue:!1,value:null};b.current=v}else v=b.current;b=o(function(){function k(D){if(!C){if(C=!0,A=D,D=g(D),O!==void 0&&v.hasValue){var $=v.value;if(O($,D))return P=$}return P=D}if($=P,i(A,D))return $;var H=g(D);return O!==void 0&&O($,H)?(A=D,$):(A=D,P=H)}var C=!1,A,P,E=p===void 0?null:p;return[function(){return k(d())},E===null?void 0:function(){return k(E())}]},[d,p,g,O]);var x=r(h,b[0],b[1]);return l(function(){v.hasValue=!0,v.value=x},[x]),c(x),x},Uy}var DM;function GV(){return DM||(DM=1,Yy.exports=WV()),Yy.exports}var FV=GV(),KV=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},JV=({contentComponent:n})=>{const e=bR.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return _.jsx(_.Fragment,{children:Object.values(e)})};function eq(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,i){e={...e,[t]:tZ.createPortal(i.reactElement,i.element,t)},n.forEach(r=>r())},removeRenderer(t){const i={...e};delete i[t],e=i,n.forEach(r=>r())}}}var tq=class extends $e.Component{constructor(n){super(n),this.editorContentRef=$e.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var n;const e=this.props.editor;if(e&&!e.isDestroyed&&((n=e.view.dom)!=null&&n.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=eq(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var n;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((n=e.view.dom)!=null&&n.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return _.jsxs(_.Fragment,{children:[_.jsx("div",{ref:KV(e,this.editorContentRef),...t}),(n==null?void 0:n.contentComponent)&&_.jsx(JV,{contentComponent:n.contentComponent})]})}},nq=Ee.forwardRef((n,e)=>{const t=$e.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return $e.createElement(tq,{key:t,innerRef:e,...n})}),RP=$e.memo(nq),iq=typeof window<"u"?Ee.useLayoutEffect:Ee.useEffect,rq=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function sq(n){var e;const[t]=Ee.useState(()=>new rq(n.editor)),i=FV.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!=null?e:UV);return iq(()=>t.watch(n.editor),[n.editor,t]),Ee.useDebugValue(i),i}var lq=!1,T1=typeof window>"u",oq=T1||!!(typeof window<"u"&&window.next),aq=class PP{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?T1||oq?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...i)=>{var r,s;return(s=(r=this.options.current).onBeforeCreate)==null?void 0:s.call(r,...i)},onBlur:(...i)=>{var r,s;return(s=(r=this.options.current).onBlur)==null?void 0:s.call(r,...i)},onCreate:(...i)=>{var r,s;return(s=(r=this.options.current).onCreate)==null?void 0:s.call(r,...i)},onDestroy:(...i)=>{var r,s;return(s=(r=this.options.current).onDestroy)==null?void 0:s.call(r,...i)},onFocus:(...i)=>{var r,s;return(s=(r=this.options.current).onFocus)==null?void 0:s.call(r,...i)},onSelectionUpdate:(...i)=>{var r,s;return(s=(r=this.options.current).onSelectionUpdate)==null?void 0:s.call(r,...i)},onTransaction:(...i)=>{var r,s;return(s=(r=this.options.current).onTransaction)==null?void 0:s.call(r,...i)},onUpdate:(...i)=>{var r,s;return(s=(r=this.options.current).onUpdate)==null?void 0:s.call(r,...i)},onContentError:(...i)=>{var r,s;return(s=(r=this.options.current).onContentError)==null?void 0:s.call(r,...i)},onDrop:(...i)=>{var r,s;return(s=(r=this.options.current).onDrop)==null?void 0:s.call(r,...i)},onPaste:(...i)=>{var r,s;return(s=(r=this.options.current).onPaste)==null?void 0:s.call(r,...i)},onDelete:(...i)=>{var r,s;return(s=(r=this.options.current).onDelete)==null?void 0:s.call(r,...i)}};return new J4(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(i=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(i)?!0:i==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((r,s)=>{var l;return r===((l=t.extensions)==null?void 0:l[s])}):e[i]===t[i])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?PP.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((i,r)=>i===e[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function cq(n={},e=[]){const t=Ee.useRef(n);t.current=n;const[i]=Ee.useState(()=>new aq(t)),r=bR.useSyncExternalStore(i.subscribe,i.getEditor,i.getServerSnapshot);return Ee.useDebugValue(r),Ee.useEffect(i.onRender(e)),sq({editor:r,selector:({transactionNumber:s})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&s===0?0:s+1}),r}var Ev=Ee.createContext({editor:null});Ev.Consumer;var DP=()=>Ee.useContext(Ev),uq=Ee.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),hq=()=>Ee.useContext(uq);$e.forwardRef((n,e)=>{const{onDragStart:t}=hq(),i=n.as||"div";return _.jsx(i,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});$e.createContext({markViewContentRef:()=>{}});var $v=Ee.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});$v.displayName="TiptapContext";var fq=()=>Ee.useContext($v);function NP({editor:n,instance:e,children:t}){const i=n??e;if(!i)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const r=Ee.useMemo(()=>({editor:i}),[i]),s=Ee.useMemo(()=>({editor:i}),[i]);return _.jsx(Ev.Provider,{value:s,children:_.jsx($v.Provider,{value:r,children:t})})}NP.displayName="Tiptap";function zP({...n}){const{editor:e}=fq();return _.jsx(RP,{editor:e,...n})}zP.displayName="Tiptap.Content";Object.assign(NP,{Content:zP});const LP=["top","right","bottom","left"],NM=["start","end"],zM=LP.reduce((n,e)=>n.concat(e,e+"-"+NM[0],e+"-"+NM[1]),[]),Zr=Math.min,Pn=Math.max,sm=Math.round,Nr=n=>({x:n,y:n}),dq={left:"right",right:"left",bottom:"top",top:"bottom"};function C1(n,e,t){return Pn(n,Zr(e,t))}function Ns(n,e){return typeof n=="function"?n(e):n}function Hi(n){return n.split("-")[0]}function rr(n){return n.split("-")[1]}function _P(n){return n==="x"?"y":"x"}function Rv(n){return n==="y"?"height":"width"}function Er(n){const e=n[0];return e==="t"||e==="b"?"y":"x"}function Pv(n){return _P(Er(n))}function BP(n,e,t){t===void 0&&(t=!1);const i=rr(n),r=Pv(n),s=Rv(r);let l=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(l=om(l)),[l,om(l)]}function pq(n){const e=om(n);return[lm(n),e,lm(e)]}function lm(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const LM=["left","right"],_M=["right","left"],mq=["top","bottom"],gq=["bottom","top"];function Oq(n,e,t){switch(n){case"top":case"bottom":return t?e?_M:LM:e?LM:_M;case"left":case"right":return e?mq:gq;default:return[]}}function yq(n,e,t,i){const r=rr(n);let s=Oq(Hi(n),t==="start",i);return r&&(s=s.map(l=>l+"-"+r),e&&(s=s.concat(s.map(lm)))),s}function om(n){const e=Hi(n);return dq[e]+n.slice(e.length)}function bq(n){return{top:0,right:0,bottom:0,left:0,...n}}function Dv(n){return typeof n!="number"?bq(n):{top:n,right:n,bottom:n,left:n}}function hc(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function BM(n,e,t){let{reference:i,floating:r}=n;const s=Er(e),l=Pv(e),o=Rv(l),c=Hi(e),h=s==="y",d=i.x+i.width/2-r.width/2,p=i.y+i.height/2-r.height/2,g=i[o]/2-r[o]/2;let O;switch(c){case"top":O={x:d,y:i.y-r.height};break;case"bottom":O={x:d,y:i.y+i.height};break;case"right":O={x:i.x+i.width,y:p};break;case"left":O={x:i.x-r.width,y:p};break;default:O={x:i.x,y:i.y}}switch(rr(e)){case"start":O[l]-=g*(t&&h?-1:1);break;case"end":O[l]+=g*(t&&h?-1:1);break}return O}async function Sq(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:s,rects:l,elements:o,strategy:c}=n,{boundary:h="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:g=!1,padding:O=0}=Ns(e,n),b=Dv(O),x=o[g?p==="floating"?"reference":"floating":p],k=hc(await s.getClippingRect({element:(t=await(s.isElement==null?void 0:s.isElement(x)))==null||t?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(o.floating)),boundary:h,rootBoundary:d,strategy:c})),C=p==="floating"?{x:i,y:r,width:l.floating.width,height:l.floating.height}:l.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(o.floating)),P=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},E=hc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:C,offsetParent:A,strategy:c}):C);return{top:(k.top-E.top+b.top)/P.y,bottom:(E.bottom-k.bottom+b.bottom)/P.y,left:(k.left-E.left+b.left)/P.x,right:(E.right-k.right+b.right)/P.x}}const vq=50,xq=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:s=[],platform:l}=t,o=l.detectOverflow?l:{...l,detectOverflow:Sq},c=await(l.isRTL==null?void 0:l.isRTL(e));let h=await l.getElementRects({reference:n,floating:e,strategy:r}),{x:d,y:p}=BM(h,i,c),g=i,O=0;const b={};for(let v=0;v<s.length;v++){const x=s[v];if(!x)continue;const{name:k,fn:C}=x,{x:A,y:P,data:E,reset:D}=await C({x:d,y:p,initialPlacement:i,placement:g,strategy:r,middlewareData:b,rects:h,platform:o,elements:{reference:n,floating:e}});d=A??d,p=P??p,b[k]={...b[k],...E},D&&O<vq&&(O++,typeof D=="object"&&(D.placement&&(g=D.placement),D.rects&&(h=D.rects===!0?await l.getElementRects({reference:n,floating:e,strategy:r}):D.rects),{x:d,y:p}=BM(h,g,c)),v=-1)}return{x:d,y:p,placement:g,strategy:r,middlewareData:b}},kq=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:i,placement:r,rects:s,platform:l,elements:o,middlewareData:c}=e,{element:h,padding:d=0}=Ns(n,e)||{};if(h==null)return{};const p=Dv(d),g={x:t,y:i},O=Pv(r),b=Rv(O),v=await l.getDimensions(h),x=O==="y",k=x?"top":"left",C=x?"bottom":"right",A=x?"clientHeight":"clientWidth",P=s.reference[b]+s.reference[O]-g[O]-s.floating[b],E=g[O]-s.reference[O],D=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let $=D?D[A]:0;(!$||!await(l.isElement==null?void 0:l.isElement(D)))&&($=o.floating[A]||s.floating[b]);const H=P/2-E/2,W=$/2-v[b]/2-1,te=Zr(p[k],W),ae=Zr(p[C],W),re=te,ce=$-v[b]-ae,se=$/2-v[b]/2+H,z=C1(re,se,ce),B=!c.arrow&&rr(r)!=null&&se!==z&&s.reference[b]/2-(se<re?te:ae)-v[b]/2<0,K=B?se<re?se-re:se-ce:0;return{[O]:g[O]+K,data:{[O]:z,centerOffset:se-z-K,...B&&{alignmentOffset:K}},reset:B}}});function wq(n,e,t){return(n?[...t.filter(r=>rr(r)===n),...t.filter(r=>rr(r)!==n)]:t.filter(r=>Hi(r)===r)).filter(r=>n?rr(r)===n||(e?lm(r)!==r:!1):!0)}const Tq=function(n){return n===void 0&&(n={}),{name:"autoPlacement",options:n,async fn(e){var t,i,r;const{rects:s,middlewareData:l,placement:o,platform:c,elements:h}=e,{crossAxis:d=!1,alignment:p,allowedPlacements:g=zM,autoAlignment:O=!0,...b}=Ns(n,e),v=p!==void 0||g===zM?wq(p||null,O,g):g,x=await c.detectOverflow(e,b),k=((t=l.autoPlacement)==null?void 0:t.index)||0,C=v[k];if(C==null)return{};const A=BP(C,s,await(c.isRTL==null?void 0:c.isRTL(h.floating)));if(o!==C)return{reset:{placement:v[0]}};const P=[x[Hi(C)],x[A[0]],x[A[1]]],E=[...((i=l.autoPlacement)==null?void 0:i.overflows)||[],{placement:C,overflows:P}],D=v[k+1];if(D)return{data:{index:k+1,overflows:E},reset:{placement:D}};const $=E.map(te=>{const ae=rr(te.placement);return[te.placement,ae&&d?te.overflows.slice(0,2).reduce((re,ce)=>re+ce,0):te.overflows[0],te.overflows]}).sort((te,ae)=>te[1]-ae[1]),W=((r=$.filter(te=>te[2].slice(0,rr(te[0])?2:3).every(ae=>ae<=0))[0])==null?void 0:r[0])||$[0][0];return W!==o?{data:{index:k+1,overflows:E},reset:{placement:W}}:{}}}},Cq=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:s,rects:l,initialPlacement:o,platform:c,elements:h}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:O="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:v=!0,...x}=Ns(n,e);if((t=s.arrow)!=null&&t.alignmentOffset)return{};const k=Hi(r),C=Er(o),A=Hi(o)===o,P=await(c.isRTL==null?void 0:c.isRTL(h.floating)),E=g||(A||!v?[om(o)]:pq(o)),D=b!=="none";!g&&D&&E.push(...yq(o,v,b,P));const $=[o,...E],H=await c.detectOverflow(e,x),W=[];let te=((i=s.flip)==null?void 0:i.overflows)||[];if(d&&W.push(H[k]),p){const se=BP(r,l,P);W.push(H[se[0]],H[se[1]])}if(te=[...te,{placement:r,overflows:W}],!W.every(se=>se<=0)){var ae,re;const se=(((ae=s.flip)==null?void 0:ae.index)||0)+1,z=$[se];if(z&&(!(p==="alignment"?C!==Er(z):!1)||te.every(he=>Er(he.placement)===C?he.overflows[0]>0:!0)))return{data:{index:se,overflows:te},reset:{placement:z}};let B=(re=te.filter(K=>K.overflows[0]<=0).sort((K,he)=>K.overflows[1]-he.overflows[1])[0])==null?void 0:re.placement;if(!B)switch(O){case"bestFit":{var ce;const K=(ce=te.filter(he=>{if(D){const ge=Er(he.placement);return ge===C||ge==="y"}return!0}).map(he=>[he.placement,he.overflows.filter(ge=>ge>0).reduce((ge,J)=>ge+J,0)]).sort((he,ge)=>he[1]-ge[1])[0])==null?void 0:ce[0];K&&(B=K);break}case"initialPlacement":B=o;break}if(r!==B)return{reset:{placement:B}}}return{}}}};function ZM(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function jM(n){return LP.some(e=>n[e]>=0)}const Aq=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:i}=e,{strategy:r="referenceHidden",...s}=Ns(n,e);switch(r){case"referenceHidden":{const l=await i.detectOverflow(e,{...s,elementContext:"reference"}),o=ZM(l,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:jM(o)}}}case"escaped":{const l=await i.detectOverflow(e,{...s,altBoundary:!0}),o=ZM(l,t.floating);return{data:{escapedOffsets:o,escaped:jM(o)}}}default:return{}}}}};function ZP(n){const e=Zr(...n.map(s=>s.left)),t=Zr(...n.map(s=>s.top)),i=Pn(...n.map(s=>s.right)),r=Pn(...n.map(s=>s.bottom));return{x:e,y:t,width:i-e,height:r-t}}function Mq(n){const e=n.slice().sort((r,s)=>r.y-s.y),t=[];let i=null;for(let r=0;r<e.length;r++){const s=e[r];!i||s.y-i.y>i.height/2?t.push([s]):t[t.length-1].push(s),i=s}return t.map(r=>hc(ZP(r)))}const Qq=function(n){return n===void 0&&(n={}),{name:"inline",options:n,async fn(e){const{placement:t,elements:i,rects:r,platform:s,strategy:l}=e,{padding:o=2,x:c,y:h}=Ns(n,e),d=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(i.reference))||[]),p=Mq(d),g=hc(ZP(d)),O=Dv(o);function b(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&h!=null)return p.find(x=>c>x.left-O.left&&c<x.right+O.right&&h>x.top-O.top&&h<x.bottom+O.bottom)||g;if(p.length>=2){if(Er(t)==="y"){const te=p[0],ae=p[p.length-1],re=Hi(t)==="top",ce=te.top,se=ae.bottom,z=re?te.left:ae.left,B=re?te.right:ae.right,K=B-z,he=se-ce;return{top:ce,bottom:se,left:z,right:B,width:K,height:he,x:z,y:ce}}const x=Hi(t)==="left",k=Pn(...p.map(te=>te.right)),C=Zr(...p.map(te=>te.left)),A=p.filter(te=>x?te.left===C:te.right===k),P=A[0].top,E=A[A.length-1].bottom,D=C,$=k,H=$-D,W=E-P;return{top:P,bottom:E,left:D,right:$,width:H,height:W,x:D,y:P}}return g}const v=await s.getElementRects({reference:{getBoundingClientRect:b},floating:i.floating,strategy:l});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}},Eq=new Set(["left","top"]);async function $q(n,e){const{placement:t,platform:i,elements:r}=n,s=await(i.isRTL==null?void 0:i.isRTL(r.floating)),l=Hi(t),o=rr(t),c=Er(t)==="y",h=Eq.has(l)?-1:1,d=s&&c?-1:1,p=Ns(e,n);let{mainAxis:g,crossAxis:O,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return o&&typeof b=="number"&&(O=o==="end"?b*-1:b),c?{x:O*d,y:g*h}:{x:g*h,y:O*d}}const Rq=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:s,placement:l,middlewareData:o}=e,c=await $q(e,n);return l===((t=o.offset)==null?void 0:t.placement)&&(i=o.arrow)!=null&&i.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:l}}}}},Pq=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r,platform:s}=e,{mainAxis:l=!0,crossAxis:o=!1,limiter:c={fn:k=>{let{x:C,y:A}=k;return{x:C,y:A}}},...h}=Ns(n,e),d={x:t,y:i},p=await s.detectOverflow(e,h),g=Er(Hi(r)),O=_P(g);let b=d[O],v=d[g];if(l){const k=O==="y"?"top":"left",C=O==="y"?"bottom":"right",A=b+p[k],P=b-p[C];b=C1(A,b,P)}if(o){const k=g==="y"?"top":"left",C=g==="y"?"bottom":"right",A=v+p[k],P=v-p[C];v=C1(A,v,P)}const x=c.fn({...e,[O]:b,[g]:v});return{...x,data:{x:x.x-t,y:x.y-i,enabled:{[O]:l,[g]:o}}}}}},Dq=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:s,platform:l,elements:o}=e,{apply:c=()=>{},...h}=Ns(n,e),d=await l.detectOverflow(e,h),p=Hi(r),g=rr(r),O=Er(r)==="y",{width:b,height:v}=s.floating;let x,k;p==="top"||p==="bottom"?(x=p,k=g===(await(l.isRTL==null?void 0:l.isRTL(o.floating))?"start":"end")?"left":"right"):(k=p,x=g==="end"?"top":"bottom");const C=v-d.top-d.bottom,A=b-d.left-d.right,P=Zr(v-d[x],C),E=Zr(b-d[k],A),D=!e.middlewareData.shift;let $=P,H=E;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(H=A),(i=e.middlewareData.shift)!=null&&i.enabled.y&&($=C),D&&!g){const te=Pn(d.left,0),ae=Pn(d.right,0),re=Pn(d.top,0),ce=Pn(d.bottom,0);O?H=b-2*(te!==0||ae!==0?te+ae:Pn(d.left,d.right)):$=v-2*(re!==0||ce!==0?re+ce:Pn(d.top,d.bottom))}await c({...e,availableWidth:H,availableHeight:$});const W=await l.getDimensions(o.floating);return b!==W.width||v!==W.height?{reset:{rects:!0}}:{}}}};function zg(){return typeof window<"u"}function Cc(n){return jP(n)?(n.nodeName||"").toLowerCase():"#document"}function xi(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function zs(n){var e;return(e=(jP(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function jP(n){return zg()?n instanceof Node||n instanceof xi(n).Node:!1}function sr(n){return zg()?n instanceof Element||n instanceof xi(n).Element:!1}function Ls(n){return zg()?n instanceof HTMLElement||n instanceof xi(n).HTMLElement:!1}function XM(n){return!zg()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof xi(n).ShadowRoot}function hf(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=lr(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&r!=="inline"&&r!=="contents"}function Nq(n){return/^(table|td|th)$/.test(Cc(n))}function Lg(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const zq=/transform|translate|scale|rotate|perspective|filter/,Lq=/paint|layout|strict|content/,ao=n=>!!n&&n!=="none";let Wy;function Nv(n){const e=sr(n)?lr(n):n;return ao(e.transform)||ao(e.translate)||ao(e.scale)||ao(e.rotate)||ao(e.perspective)||!zv()&&(ao(e.backdropFilter)||ao(e.filter))||zq.test(e.willChange||"")||Lq.test(e.contain||"")}function _q(n){let e=Pl(n);for(;Ls(e)&&!fc(e);){if(Nv(e))return e;if(Lg(e))return null;e=Pl(e)}return null}function zv(){return Wy==null&&(Wy=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Wy}function fc(n){return/^(html|body|#document)$/.test(Cc(n))}function lr(n){return xi(n).getComputedStyle(n)}function _g(n){return sr(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Pl(n){if(Cc(n)==="html")return n;const e=n.assignedSlot||n.parentNode||XM(n)&&n.host||zs(n);return XM(e)?e.host:e}function XP(n){const e=Pl(n);return fc(e)?n.ownerDocument?n.ownerDocument.body:n.body:Ls(e)&&hf(e)?e:XP(e)}function IP(n,e,t){var i;e===void 0&&(e=[]);const r=XP(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),l=xi(r);return s?(A1(l),e.concat(l,l.visualViewport||[],hf(r)?r:[],[])):e.concat(r,IP(r,[]))}function A1(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function VP(n){const e=lr(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Ls(n),s=r?n.offsetWidth:t,l=r?n.offsetHeight:i,o=sm(t)!==s||sm(i)!==l;return o&&(t=s,i=l),{width:t,height:i,$:o}}function qP(n){return sr(n)?n:n.contextElement}function Wa(n){const e=qP(n);if(!Ls(e))return Nr(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=VP(e);let l=(s?sm(t.width):t.width)/i,o=(s?sm(t.height):t.height)/r;return(!l||!Number.isFinite(l))&&(l=1),(!o||!Number.isFinite(o))&&(o=1),{x:l,y:o}}const Bq=Nr(0);function HP(n){const e=xi(n);return!zv()||!e.visualViewport?Bq:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Zq(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==xi(n)?!1:e}function Ph(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),s=qP(n);let l=Nr(1);e&&(i?sr(i)&&(l=Wa(i)):l=Wa(n));const o=Zq(s,t,i)?HP(s):Nr(0);let c=(r.left+o.x)/l.x,h=(r.top+o.y)/l.y,d=r.width/l.x,p=r.height/l.y;if(s){const g=xi(s),O=i&&sr(i)?xi(i):i;let b=g,v=A1(b);for(;v&&i&&O!==b;){const x=Wa(v),k=v.getBoundingClientRect(),C=lr(v),A=k.left+(v.clientLeft+parseFloat(C.paddingLeft))*x.x,P=k.top+(v.clientTop+parseFloat(C.paddingTop))*x.y;c*=x.x,h*=x.y,d*=x.x,p*=x.y,c+=A,h+=P,b=xi(v),v=A1(b)}}return hc({width:d,height:p,x:c,y:h})}function Bg(n,e){const t=_g(n).scrollLeft;return e?e.left+t:Ph(zs(n)).left+t}function YP(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-Bg(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function jq(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const s=r==="fixed",l=zs(i),o=e?Lg(e.floating):!1;if(i===l||o&&s)return t;let c={scrollLeft:0,scrollTop:0},h=Nr(1);const d=Nr(0),p=Ls(i);if((p||!p&&!s)&&((Cc(i)!=="body"||hf(l))&&(c=_g(i)),p)){const O=Ph(i);h=Wa(i),d.x=O.x+i.clientLeft,d.y=O.y+i.clientTop}const g=l&&!p&&!s?YP(l,c):Nr(0);return{width:t.width*h.x,height:t.height*h.y,x:t.x*h.x-c.scrollLeft*h.x+d.x+g.x,y:t.y*h.y-c.scrollTop*h.y+d.y+g.y}}function Xq(n){return Array.from(n.getClientRects())}function Iq(n){const e=zs(n),t=_g(n),i=n.ownerDocument.body,r=Pn(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),s=Pn(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-t.scrollLeft+Bg(n);const o=-t.scrollTop;return lr(i).direction==="rtl"&&(l+=Pn(e.clientWidth,i.clientWidth)-r),{width:r,height:s,x:l,y:o}}const IM=25;function Vq(n,e){const t=xi(n),i=zs(n),r=t.visualViewport;let s=i.clientWidth,l=i.clientHeight,o=0,c=0;if(r){s=r.width,l=r.height;const d=zv();(!d||d&&e==="fixed")&&(o=r.offsetLeft,c=r.offsetTop)}const h=Bg(i);if(h<=0){const d=i.ownerDocument,p=d.body,g=getComputedStyle(p),O=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(i.clientWidth-p.clientWidth-O);b<=IM&&(s-=b)}else h<=IM&&(s+=h);return{width:s,height:l,x:o,y:c}}function qq(n,e){const t=Ph(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,s=Ls(n)?Wa(n):Nr(1),l=n.clientWidth*s.x,o=n.clientHeight*s.y,c=r*s.x,h=i*s.y;return{width:l,height:o,x:c,y:h}}function VM(n,e,t){let i;if(e==="viewport")i=Vq(n,t);else if(e==="document")i=Iq(zs(n));else if(sr(e))i=qq(e,t);else{const r=HP(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return hc(i)}function UP(n,e){const t=Pl(n);return t===e||!sr(t)||fc(t)?!1:lr(t).position==="fixed"||UP(t,e)}function Hq(n,e){const t=e.get(n);if(t)return t;let i=IP(n,[]).filter(o=>sr(o)&&Cc(o)!=="body"),r=null;const s=lr(n).position==="fixed";let l=s?Pl(n):n;for(;sr(l)&&!fc(l);){const o=lr(l),c=Nv(l);!c&&o.position==="fixed"&&(r=null),(s?!c&&!r:!c&&o.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||hf(l)&&!c&&UP(n,l))?i=i.filter(d=>d!==l):r=o,l=Pl(l)}return e.set(n,i),i}function Yq(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const l=[...t==="clippingAncestors"?Lg(e)?[]:Hq(e,this._c):[].concat(t),i],o=VM(e,l[0],r);let c=o.top,h=o.right,d=o.bottom,p=o.left;for(let g=1;g<l.length;g++){const O=VM(e,l[g],r);c=Pn(O.top,c),h=Zr(O.right,h),d=Zr(O.bottom,d),p=Pn(O.left,p)}return{width:h-p,height:d-c,x:p,y:c}}function Uq(n){const{width:e,height:t}=VP(n);return{width:e,height:t}}function Wq(n,e,t){const i=Ls(e),r=zs(e),s=t==="fixed",l=Ph(n,!0,s,e);let o={scrollLeft:0,scrollTop:0};const c=Nr(0);function h(){c.x=Bg(r)}if(i||!i&&!s)if((Cc(e)!=="body"||hf(r))&&(o=_g(e)),i){const O=Ph(e,!0,s,e);c.x=O.x+e.clientLeft,c.y=O.y+e.clientTop}else r&&h();s&&!i&&r&&h();const d=r&&!i&&!s?YP(r,o):Nr(0),p=l.left+o.scrollLeft-c.x-d.x,g=l.top+o.scrollTop-c.y-d.y;return{x:p,y:g,width:l.width,height:l.height}}function Gy(n){return lr(n).position==="static"}function qM(n,e){if(!Ls(n)||lr(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return zs(n)===t&&(t=t.ownerDocument.body),t}function WP(n,e){const t=xi(n);if(Lg(n))return t;if(!Ls(n)){let r=Pl(n);for(;r&&!fc(r);){if(sr(r)&&!Gy(r))return r;r=Pl(r)}return t}let i=qM(n,e);for(;i&&Nq(i)&&Gy(i);)i=qM(i,e);return i&&fc(i)&&Gy(i)&&!Nv(i)?t:i||_q(n)||t}const Gq=async function(n){const e=this.getOffsetParent||WP,t=this.getDimensions,i=await t(n.floating);return{reference:Wq(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Fq(n){return lr(n).direction==="rtl"}const Kq={convertOffsetParentRelativeRectToViewportRelativeRect:jq,getDocumentElement:zs,getClippingRect:Yq,getOffsetParent:WP,getElementRects:Gq,getClientRects:Xq,getDimensions:Uq,getScale:Wa,isElement:sr,isRTL:Fq},GP=Rq,FP=Tq,KP=Pq,JP=Cq,eD=Dq,tD=Aq,nD=kq,iD=Qq,rD=(n,e,t)=>{const i=new Map,r={platform:Kq,...t},s={...r.platform,_c:i};return xq(n,e,{...r,platform:s})};let M1,Q1;if(typeof WeakMap<"u"){let n=new WeakMap;M1=e=>n.get(e),Q1=(e,t)=>(n.set(e,t),t)}else{const n=[];let t=0;M1=i=>{for(let r=0;r<n.length;r+=2)if(n[r]==i)return n[r+1]},Q1=(i,r)=>(t==10&&(t=0),n[t++]=i,n[t++]=r)}var Nt=class{constructor(n,e,t,i){this.width=n,this.height=e,this.map=t,this.problems=i}findCell(n){for(let e=0;e<this.map.length;e++){const t=this.map[e];if(t!=n)continue;const i=e%this.width,r=e/this.width|0;let s=i+1,l=r+1;for(let o=1;s<this.width&&this.map[e+o]==t;o++)s++;for(let o=1;l<this.height&&this.map[e+this.width*o]==t;o++)l++;return{left:i,top:r,right:s,bottom:l}}throw new RangeError(`No cell with offset ${n} found`)}colCount(n){for(let e=0;e<this.map.length;e++)if(this.map[e]==n)return e%this.width;throw new RangeError(`No cell with offset ${n} found`)}nextCell(n,e,t){const{left:i,right:r,top:s,bottom:l}=this.findCell(n);return e=="horiz"?(t<0?i==0:r==this.width)?null:this.map[s*this.width+(t<0?i-1:r)]:(t<0?s==0:l==this.height)?null:this.map[i+this.width*(t<0?s-1:l)]}rectBetween(n,e){const{left:t,right:i,top:r,bottom:s}=this.findCell(n),{left:l,right:o,top:c,bottom:h}=this.findCell(e);return{left:Math.min(t,l),top:Math.min(r,c),right:Math.max(i,o),bottom:Math.max(s,h)}}cellsInRect(n){const e=[],t={};for(let i=n.top;i<n.bottom;i++)for(let r=n.left;r<n.right;r++){const s=i*this.width+r,l=this.map[s];t[l]||(t[l]=!0,!(r==n.left&&r&&this.map[s-1]==l||i==n.top&&i&&this.map[s-this.width]==l)&&e.push(l))}return e}positionAt(n,e,t){for(let i=0,r=0;;i++){const s=r+t.child(i).nodeSize;if(i==n){let l=e+n*this.width;const o=(n+1)*this.width;for(;l<o&&this.map[l]<r;)l++;return l==o?s-1:this.map[l]}r=s}}static get(n){return M1(n)||Q1(n,Jq(n))}};function Jq(n){if(n.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+n.type.name);const e=eH(n),t=n.childCount,i=[];let r=0,s=null;const l=[];for(let h=0,d=e*t;h<d;h++)i[h]=0;for(let h=0,d=0;h<t;h++){const p=n.child(h);d++;for(let b=0;;b++){for(;r<i.length&&i[r]!=0;)r++;if(b==p.childCount)break;const v=p.child(b),{colspan:x,rowspan:k,colwidth:C}=v.attrs;for(let A=0;A<k;A++){if(A+h>=t){(s||(s=[])).push({type:"overlong_rowspan",pos:d,n:k-A});break}const P=r+A*e;for(let E=0;E<x;E++){i[P+E]==0?i[P+E]=d:(s||(s=[])).push({type:"collision",row:h,pos:d,n:x-E});const D=C&&C[E];if(D){const $=(P+E)%e*2,H=l[$];H==null||H!=D&&l[$+1]==1?(l[$]=D,l[$+1]=1):H==D&&l[$+1]++}}}r+=x,d+=v.nodeSize}const g=(h+1)*e;let O=0;for(;r<g;)i[r++]==0&&O++;O&&(s||(s=[])).push({type:"missing",row:h,n:O}),d++}(e===0||t===0)&&(s||(s=[])).push({type:"zero_sized"});const o=new Nt(e,t,i,s);let c=!1;for(let h=0;!c&&h<l.length;h+=2)l[h]!=null&&l[h+1]<t&&(c=!0);return c&&tH(o,l,n),o}function eH(n){let e=-1,t=!1;for(let i=0;i<n.childCount;i++){const r=n.child(i);let s=0;if(t)for(let l=0;l<i;l++){const o=n.child(l);for(let c=0;c<o.childCount;c++){const h=o.child(c);l+h.attrs.rowspan>i&&(s+=h.attrs.colspan)}}for(let l=0;l<r.childCount;l++){const o=r.child(l);s+=o.attrs.colspan,o.attrs.rowspan>1&&(t=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function tH(n,e,t){n.problems||(n.problems=[]);const i={};for(let r=0;r<n.map.length;r++){const s=n.map[r];if(i[s])continue;i[s]=!0;const l=t.nodeAt(s);if(!l)throw new RangeError(`No cell with offset ${s} found`);let o=null;const c=l.attrs;for(let h=0;h<c.colspan;h++){const d=e[(r+h)%n.width*2];d!=null&&(!c.colwidth||c.colwidth[h]!=d)&&((o||(o=nH(c)))[h]=d)}o&&n.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:o})}}function nH(n){if(n.colwidth)return n.colwidth.slice();const e=[];for(let t=0;t<n.colspan;t++)e.push(0);return e}function Cn(n){let e=n.cached.tableNodeTypes;if(!e){e=n.cached.tableNodeTypes={};for(const t in n.nodes){const i=n.nodes[t],r=i.spec.tableRole;r&&(e[r]=i)}}return e}const bl=new At("selectingCells");function zo(n){for(let e=n.depth-1;e>0;e--)if(n.node(e).type.spec.tableRole=="row")return n.node(0).resolve(n.before(e+1));return null}function iH(n){for(let e=n.depth;e>0;e--){const t=n.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return n.node(e)}return null}function cr(n){const e=n.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function Zg(n){const e=n.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=zo(e.$head)||rH(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function rH(n){for(let e=n.nodeAfter,t=n.pos;e;e=e.firstChild,t++){const i=e.type.spec.tableRole;if(i=="cell"||i=="header_cell")return n.doc.resolve(t)}for(let e=n.nodeBefore,t=n.pos;e;e=e.lastChild,t--){const i=e.type.spec.tableRole;if(i=="cell"||i=="header_cell")return n.doc.resolve(t-e.nodeSize)}}function E1(n){return n.parent.type.spec.tableRole=="row"&&!!n.nodeAfter}function sH(n){return n.node(0).resolve(n.pos+n.nodeAfter.nodeSize)}function Lv(n,e){return n.depth==e.depth&&n.pos>=e.start(-1)&&n.pos<=e.end(-1)}function sD(n,e,t){const i=n.node(-1),r=Nt.get(i),s=n.start(-1),l=r.nextCell(n.pos-s,e,t);return l==null?null:n.node(0).resolve(s+l)}function Lo(n,e,t=1){const i={...n,colspan:n.colspan-t};return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(e,t),i.colwidth.some(r=>r>0)||(i.colwidth=null)),i}function lD(n,e,t=1){const i={...n,colspan:n.colspan+t};if(i.colwidth){i.colwidth=i.colwidth.slice();for(let r=0;r<t;r++)i.colwidth.splice(e,0,0)}return i}function lH(n,e,t){const i=Cn(e.type.schema).header_cell;for(let r=0;r<n.height;r++)if(e.nodeAt(n.map[t+r*n.width]).type!=i)return!1;return!0}var Ot=class Os extends Pe{constructor(e,t=e){const i=e.node(-1),r=Nt.get(i),s=e.start(-1),l=r.rectBetween(e.pos-s,t.pos-s),o=e.node(0),c=r.cellsInRect(l).filter(d=>d!=t.pos-s);c.unshift(t.pos-s);const h=c.map(d=>{const p=i.nodeAt(d);if(!p)throw new RangeError(`No cell with offset ${d} found`);const g=s+d+1;return new FR(o.resolve(g),o.resolve(g+p.content.size))});super(h[0].$from,h[0].$to,h),this.$anchorCell=e,this.$headCell=t}map(e,t){const i=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(E1(i)&&E1(r)&&Lv(i,r)){const s=this.$anchorCell.node(-1)!=i.node(-1);return s&&this.isRowSelection()?Os.rowSelection(i,r):s&&this.isColSelection()?Os.colSelection(i,r):new Os(i,r)}return Ae.between(i,r)}content(){const e=this.$anchorCell.node(-1),t=Nt.get(e),i=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),s={},l=[];for(let c=r.top;c<r.bottom;c++){const h=[];for(let d=c*t.width+r.left,p=r.left;p<r.right;p++,d++){const g=t.map[d];if(s[g])continue;s[g]=!0;const O=t.findCell(g);let b=e.nodeAt(g);if(!b)throw new RangeError(`No cell with offset ${g} found`);const v=r.left-O.left,x=O.right-r.right;if(v>0||x>0){let k=b.attrs;if(v>0&&(k=Lo(k,0,v)),x>0&&(k=Lo(k,k.colspan-x,x)),O.left<r.left){if(b=b.type.createAndFill(k),!b)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(k)}`)}else b=b.type.create(k,b.content)}if(O.top<r.top||O.bottom>r.bottom){const k={...b.attrs,rowspan:Math.min(O.bottom,r.bottom)-Math.max(O.top,r.top)};O.top<r.top?b=b.type.createAndFill(k):b=b.type.create(k,b.content)}h.push(b)}l.push(e.child(c).copy(ne.from(h)))}const o=this.isColSelection()&&this.isRowSelection()?e:l;return new pe(ne.from(o),1,1)}replace(e,t=pe.empty){const i=e.steps.length,r=this.ranges;for(let l=0;l<r.length;l++){const{$from:o,$to:c}=r[l],h=e.mapping.slice(i);e.replace(h.map(o.pos),h.map(c.pos),l?pe.empty:t)}const s=Pe.findFrom(e.doc.resolve(e.mapping.slice(i).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,t){this.replace(e,new pe(ne.from(t),0,0))}forEachCell(e){const t=this.$anchorCell.node(-1),i=Nt.get(t),r=this.$anchorCell.start(-1),s=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let l=0;l<s.length;l++)e(t.nodeAt(s[l]),r+s[l])}isColSelection(){const e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;const i=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(i,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const i=e.node(-1),r=Nt.get(i),s=e.start(-1),l=r.findCell(e.pos-s),o=r.findCell(t.pos-s),c=e.node(0);return l.top<=o.top?(l.top>0&&(e=c.resolve(s+r.map[l.left])),o.bottom<r.height&&(t=c.resolve(s+r.map[r.width*(r.height-1)+o.right-1]))):(o.top>0&&(t=c.resolve(s+r.map[o.left])),l.bottom<r.height&&(e=c.resolve(s+r.map[r.width*(r.height-1)+l.right-1]))),new Os(e,t)}isRowSelection(){const e=this.$anchorCell.node(-1),t=Nt.get(e),i=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-i),s=t.colCount(this.$headCell.pos-i);if(Math.min(r,s)>0)return!1;const l=r+this.$anchorCell.nodeAfter.attrs.colspan,o=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(l,o)==t.width}eq(e){return e instanceof Os&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const i=e.node(-1),r=Nt.get(i),s=e.start(-1),l=r.findCell(e.pos-s),o=r.findCell(t.pos-s),c=e.node(0);return l.left<=o.left?(l.left>0&&(e=c.resolve(s+r.map[l.top*r.width])),o.right<r.width&&(t=c.resolve(s+r.map[r.width*(o.top+1)-1]))):(o.left>0&&(t=c.resolve(s+r.map[o.top*r.width])),l.right<r.width&&(e=c.resolve(s+r.map[r.width*(l.top+1)-1]))),new Os(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new Os(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,i=t){return new Os(e.resolve(t),e.resolve(i))}getBookmark(){return new oH(this.$anchorCell.pos,this.$headCell.pos)}};Ot.prototype.visible=!1;Pe.jsonID("cell",Ot);var oH=class oD{constructor(e,t){this.anchor=e,this.head=t}map(e){return new oD(e.map(this.anchor),e.map(this.head))}resolve(e){const t=e.resolve(this.anchor),i=e.resolve(this.head);return t.parent.type.spec.tableRole=="row"&&i.parent.type.spec.tableRole=="row"&&t.index()<t.parent.childCount&&i.index()<i.parent.childCount&&Lv(t,i)?new Ot(t,i):Pe.near(i,1)}};function aH(n){if(!(n.selection instanceof Ot))return null;const e=[];return n.selection.forEachCell((t,i)=>{e.push(ki.node(i,i+t.nodeSize,{class:"selectedCell"}))}),vt.create(n.doc,e)}function cH({$from:n,$to:e}){if(n.pos==e.pos||n.pos<e.pos-6)return!1;let t=n.pos,i=e.pos,r=n.depth;for(;r>=0&&!(n.after(r+1)<n.end(r));r--,t++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,i--);return t==i&&/row|table/.test(n.node(r).type.spec.tableRole)}function uH({$from:n,$to:e}){let t,i;for(let r=n.depth;r>0;r--){const s=n.node(r);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){t=s;break}}for(let r=e.depth;r>0;r--){const s=e.node(r);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){i=s;break}}return t!==i&&e.parentOffset===0}function hH(n,e,t){const i=(e||n).selection,r=(e||n).doc;let s,l;if(i instanceof Te&&(l=i.node.type.spec.tableRole)){if(l=="cell"||l=="header_cell")s=Ot.create(r,i.from);else if(l=="row"){const o=r.resolve(i.from+1);s=Ot.rowSelection(o,o)}else if(!t){const o=Nt.get(i.node),c=i.from+1,h=c+o.map[o.width*o.height-1];s=Ot.create(r,c+1,h)}}else i instanceof Ae&&cH(i)?s=Ae.create(r,i.from):i instanceof Ae&&uH(i)&&(s=Ae.create(r,i.$from.start(),i.$from.end()));return s&&(e||(e=n.tr)).setSelection(s),e}const fH=new At("fix-tables");function aD(n,e,t,i){const r=n.childCount,s=e.childCount;e:for(let l=0,o=0;l<s;l++){const c=e.child(l);for(let h=o,d=Math.min(r,l+3);h<d;h++)if(n.child(h)==c){o=h+1,t+=c.nodeSize;continue e}i(c,t),o<r&&n.child(o).sameMarkup(c)?aD(n.child(o),c,t+1,i):c.nodesBetween(0,c.content.size,i,t+1),t+=c.nodeSize}}function cD(n,e){let t;const i=(r,s)=>{r.type.spec.tableRole=="table"&&(t=dH(n,r,s,t))};return e?e.doc!=n.doc&&aD(e.doc,n.doc,0,i):n.doc.descendants(i),t}function dH(n,e,t,i){const r=Nt.get(e);if(!r.problems)return i;i||(i=n.tr);const s=[];for(let c=0;c<r.height;c++)s.push(0);for(let c=0;c<r.problems.length;c++){const h=r.problems[c];if(h.type=="collision"){const d=e.nodeAt(h.pos);if(!d)continue;const p=d.attrs;for(let g=0;g<p.rowspan;g++)s[h.row+g]+=h.n;i.setNodeMarkup(i.mapping.map(t+1+h.pos),null,Lo(p,p.colspan-h.n,h.n))}else if(h.type=="missing")s[h.row]+=h.n;else if(h.type=="overlong_rowspan"){const d=e.nodeAt(h.pos);if(!d)continue;i.setNodeMarkup(i.mapping.map(t+1+h.pos),null,{...d.attrs,rowspan:d.attrs.rowspan-h.n})}else if(h.type=="colwidth mismatch"){const d=e.nodeAt(h.pos);if(!d)continue;i.setNodeMarkup(i.mapping.map(t+1+h.pos),null,{...d.attrs,colwidth:h.colwidth})}else if(h.type=="zero_sized"){const d=i.mapping.map(t);i.delete(d,d+e.nodeSize)}}let l,o;for(let c=0;c<s.length;c++)s[c]&&(l==null&&(l=c),o=c);for(let c=0,h=t+1;c<r.height;c++){const d=e.child(c),p=h+d.nodeSize,g=s[c];if(g>0){let O="cell";d.firstChild&&(O=d.firstChild.type.spec.tableRole);const b=[];for(let x=0;x<g;x++){const k=Cn(n.schema)[O].createAndFill();k&&b.push(k)}const v=(c==0||l==c-1)&&o==c?h+1:p-1;i.insert(i.mapping.map(v),b)}h=p}return i.setMeta(fH,{fixTables:!0})}function jr(n){const e=n.selection,t=Zg(n),i=t.node(-1),r=t.start(-1),s=Nt.get(i);return{...e instanceof Ot?s.rectBetween(e.$anchorCell.pos-r,e.$headCell.pos-r):s.findCell(t.pos-r),tableStart:r,map:s,table:i}}function uD(n,{map:e,tableStart:t,table:i},r){let s=r>0?-1:0;lH(e,i,r+s)&&(s=r==0||r==e.width?null:0);for(let l=0;l<e.height;l++){const o=l*e.width+r;if(r>0&&r<e.width&&e.map[o-1]==e.map[o]){const c=e.map[o],h=i.nodeAt(c);n.setNodeMarkup(n.mapping.map(t+c),null,lD(h.attrs,r-e.colCount(c))),l+=h.attrs.rowspan-1}else{const c=s==null?Cn(i.type.schema).cell:i.nodeAt(e.map[o+s]).type,h=e.positionAt(l,r,i);n.insert(n.mapping.map(t+h),c.createAndFill())}}return n}function pH(n,e){if(!cr(n))return!1;if(e){const t=jr(n);e(uD(n.tr,t,t.left))}return!0}function mH(n,e){if(!cr(n))return!1;if(e){const t=jr(n);e(uD(n.tr,t,t.right))}return!0}function gH(n,{map:e,table:t,tableStart:i},r){const s=n.mapping.maps.length;for(let l=0;l<e.height;){const o=l*e.width+r,c=e.map[o],h=t.nodeAt(c),d=h.attrs;if(r>0&&e.map[o-1]==c||r<e.width-1&&e.map[o+1]==c)n.setNodeMarkup(n.mapping.slice(s).map(i+c),null,Lo(d,r-e.colCount(c)));else{const p=n.mapping.slice(s).map(i+c);n.delete(p,p+h.nodeSize)}l+=d.rowspan}}function OH(n,e){if(!cr(n))return!1;if(e){const t=jr(n),i=n.tr;if(t.left==0&&t.right==t.map.width)return!1;for(let r=t.right-1;gH(i,t,r),r!=t.left;r--){const s=t.tableStart?i.doc.nodeAt(t.tableStart-1):i.doc;if(!s)throw new RangeError("No table found");t.table=s,t.map=Nt.get(s)}e(i)}return!0}function yH(n,e,t){var i;const r=Cn(e.type.schema).header_cell;for(let s=0;s<n.width;s++)if(((i=e.nodeAt(n.map[s+t*n.width]))===null||i===void 0?void 0:i.type)!=r)return!1;return!0}function hD(n,{map:e,tableStart:t,table:i},r){let s=t;for(let h=0;h<r;h++)s+=i.child(h).nodeSize;const l=[];let o=r>0?-1:0;yH(e,i,r+o)&&(o=r==0||r==e.height?null:0);for(let h=0,d=e.width*r;h<e.width;h++,d++)if(r>0&&r<e.height&&e.map[d]==e.map[d-e.width]){const p=e.map[d],g=i.nodeAt(p).attrs;n.setNodeMarkup(t+p,null,{...g,rowspan:g.rowspan+1}),h+=g.colspan-1}else{var c;const p=o==null?Cn(i.type.schema).cell:(c=i.nodeAt(e.map[d+o*e.width]))===null||c===void 0?void 0:c.type,g=p==null?void 0:p.createAndFill();g&&l.push(g)}return n.insert(s,Cn(i.type.schema).row.create(null,l)),n}function bH(n,e){if(!cr(n))return!1;if(e){const t=jr(n);e(hD(n.tr,t,t.top))}return!0}function SH(n,e){if(!cr(n))return!1;if(e){const t=jr(n);e(hD(n.tr,t,t.bottom))}return!0}function vH(n,{map:e,table:t,tableStart:i},r){let s=0;for(let h=0;h<r;h++)s+=t.child(h).nodeSize;const l=s+t.child(r).nodeSize,o=n.mapping.maps.length;n.delete(s+i,l+i);const c=new Set;for(let h=0,d=r*e.width;h<e.width;h++,d++){const p=e.map[d];if(!c.has(p)){if(c.add(p),r>0&&p==e.map[d-e.width]){const g=t.nodeAt(p).attrs;n.setNodeMarkup(n.mapping.slice(o).map(p+i),null,{...g,rowspan:g.rowspan-1}),h+=g.colspan-1}else if(r<e.height&&p==e.map[d+e.width]){const g=t.nodeAt(p),O=g.attrs,b=g.type.create({...O,rowspan:g.attrs.rowspan-1},g.content),v=e.positionAt(r+1,h,t);n.insert(n.mapping.slice(o).map(i+v),b),h+=O.colspan-1}}}}function xH(n,e){if(!cr(n))return!1;if(e){const t=jr(n),i=n.tr;if(t.top==0&&t.bottom==t.map.height)return!1;for(let r=t.bottom-1;vH(i,t,r),r!=t.top;r--){const s=t.tableStart?i.doc.nodeAt(t.tableStart-1):i.doc;if(!s)throw new RangeError("No table found");t.table=s,t.map=Nt.get(t.table)}e(i)}return!0}function HM(n){const e=n.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function kH({width:n,height:e,map:t},i){let r=i.top*n+i.left,s=r,l=(i.bottom-1)*n+i.left,o=r+(i.right-i.left-1);for(let c=i.top;c<i.bottom;c++){if(i.left>0&&t[s]==t[s-1]||i.right<n&&t[o]==t[o+1])return!0;s+=n,o+=n}for(let c=i.left;c<i.right;c++){if(i.top>0&&t[r]==t[r-n]||i.bottom<e&&t[l]==t[l+n])return!0;r++,l++}return!1}function YM(n,e){const t=n.selection;if(!(t instanceof Ot)||t.$anchorCell.pos==t.$headCell.pos)return!1;const i=jr(n),{map:r}=i;if(kH(r,i))return!1;if(e){const s=n.tr,l={};let o=ne.empty,c,h;for(let d=i.top;d<i.bottom;d++)for(let p=i.left;p<i.right;p++){const g=r.map[d*r.width+p],O=i.table.nodeAt(g);if(!(l[g]||!O))if(l[g]=!0,c==null)c=g,h=O;else{HM(O)||(o=o.append(O.content));const b=s.mapping.map(g+i.tableStart);s.delete(b,b+O.nodeSize)}}if(c==null||h==null)return!0;if(s.setNodeMarkup(c+i.tableStart,null,{...lD(h.attrs,h.attrs.colspan,i.right-i.left-h.attrs.colspan),rowspan:i.bottom-i.top}),o.size>0){const d=c+1+h.content.size,p=HM(h)?c+1:d;s.replaceWith(p+i.tableStart,d+i.tableStart,o)}s.setSelection(new Ot(s.doc.resolve(c+i.tableStart))),e(s)}return!0}function UM(n,e){const t=Cn(n.schema);return wH(({node:i})=>t[i.type.spec.tableRole])(n,e)}function wH(n){return(e,t)=>{const i=e.selection;let r,s;if(i instanceof Ot){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{var l;if(r=iH(i.$from),!r)return!1;s=(l=zo(i.$from))===null||l===void 0?void 0:l.pos}if(r==null||s==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(t){let o=r.attrs;const c=[],h=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});const d=jr(e),p=e.tr;for(let O=0;O<d.right-d.left;O++)c.push(h?{...o,colwidth:h&&h[O]?[h[O]]:null}:o);let g;for(let O=d.top;O<d.bottom;O++){let b=d.map.positionAt(O,d.left,d.table);O==d.top&&(b+=r.nodeSize);for(let v=d.left,x=0;v<d.right;v++,x++)v==d.left&&O==d.top||p.insert(g=p.mapping.map(b+d.tableStart,1),n({node:r,row:O,col:v}).createAndFill(c[x]))}p.setNodeMarkup(s,n({node:r,row:d.top,col:d.left}),c[0]),i instanceof Ot&&p.setSelection(new Ot(p.doc.resolve(i.$anchorCell.pos),g?p.doc.resolve(g):void 0)),t(p)}return!0}}function TH(n,e){return function(t,i){if(!cr(t))return!1;const r=Zg(t);if(r.nodeAfter.attrs[n]===e)return!1;if(i){const s=t.tr;t.selection instanceof Ot?t.selection.forEachCell((l,o)=>{l.attrs[n]!==e&&s.setNodeMarkup(o,null,{...l.attrs,[n]:e})}):s.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[n]:e}),i(s)}return!0}}function CH(n){return function(e,t){if(!cr(e))return!1;if(t){const i=Cn(e.schema),r=jr(e),s=e.tr,l=r.map.cellsInRect(n=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:n=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),o=l.map(c=>r.table.nodeAt(c));for(let c=0;c<l.length;c++)o[c].type==i.header_cell&&s.setNodeMarkup(r.tableStart+l[c],i.cell,o[c].attrs);if(s.steps.length===0)for(let c=0;c<l.length;c++)s.setNodeMarkup(r.tableStart+l[c],i.header_cell,o[c].attrs);t(s)}return!0}}function WM(n,e,t){const i=e.map.cellsInRect({left:0,top:0,right:n=="row"?e.map.width:1,bottom:n=="column"?e.map.height:1});for(let r=0;r<i.length;r++){const s=e.table.nodeAt(i[r]);if(s&&s.type!==t.header_cell)return!1}return!0}function Dh(n,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?CH(n):function(t,i){if(!cr(t))return!1;if(i){const r=Cn(t.schema),s=jr(t),l=t.tr,o=WM("row",s,r),c=WM("column",s,r),h=(n==="column"?o:n==="row"&&c)?1:0,d=n=="column"?{left:0,top:h,right:1,bottom:s.map.height}:n=="row"?{left:h,top:0,right:s.map.width,bottom:1}:s,p=n=="column"?c?r.cell:r.header_cell:n=="row"?o?r.cell:r.header_cell:r.cell;s.map.cellsInRect(d).forEach(g=>{const O=g+s.tableStart,b=l.doc.nodeAt(O);b&&l.setNodeMarkup(O,p,b.attrs)}),i(l)}return!0}}Dh("row",{useDeprecatedLogic:!0});Dh("column",{useDeprecatedLogic:!0});const AH=Dh("cell",{useDeprecatedLogic:!0});function MH(n,e){if(e<0){const t=n.nodeBefore;if(t)return n.pos-t.nodeSize;for(let i=n.index(-1)-1,r=n.before();i>=0;i--){const s=n.node(-1).child(i),l=s.lastChild;if(l)return r-1-l.nodeSize;r-=s.nodeSize}}else{if(n.index()<n.parent.childCount-1)return n.pos+n.nodeAfter.nodeSize;const t=n.node(-1);for(let i=n.indexAfter(-1),r=n.after();i<t.childCount;i++){const s=t.child(i);if(s.childCount)return r+1;r+=s.nodeSize}}return null}function GM(n){return function(e,t){if(!cr(e))return!1;const i=MH(Zg(e),n);if(i==null)return!1;if(t){const r=e.doc.resolve(i);t(e.tr.setSelection(Ae.between(r,sH(r))).scrollIntoView())}return!0}}function QH(n,e){const t=n.selection.$anchor;for(let i=t.depth;i>0;i--)if(t.node(i).type.spec.tableRole=="table")return e&&e(n.tr.delete(t.before(i),t.after(i)).scrollIntoView()),!0;return!1}function Yd(n,e){const t=n.selection;if(!(t instanceof Ot))return!1;if(e){const i=n.tr,r=Cn(n.schema).cell.createAndFill().content;t.forEachCell((s,l)=>{s.content.eq(r)||i.replace(i.mapping.map(l+1),i.mapping.map(l+s.nodeSize-1),new pe(r,0,0))}),i.docChanged&&e(i)}return!0}function EH(n){if(n.size===0)return null;let{content:e,openStart:t,openEnd:i}=n;for(;e.childCount==1&&(t>0&&i>0||e.child(0).type.spec.tableRole=="table");)t--,i--,e=e.child(0).content;const r=e.child(0),s=r.type.spec.tableRole,l=r.type.schema,o=[];if(s=="row")for(let c=0;c<e.childCount;c++){let h=e.child(c).content;const d=c?0:Math.max(0,t-1),p=c<e.childCount-1?0:Math.max(0,i-1);(d||p)&&(h=$1(Cn(l).row,new pe(h,d,p)).content),o.push(h)}else if(s=="cell"||s=="header_cell")o.push(t||i?$1(Cn(l).row,new pe(e,t,i)).content:e);else return null;return $H(l,o)}function $H(n,e){const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(let l=s.childCount-1;l>=0;l--){const{rowspan:o,colspan:c}=s.child(l).attrs;for(let h=r;h<r+o;h++)t[h]=(t[h]||0)+c}}let i=0;for(let r=0;r<t.length;r++)i=Math.max(i,t[r]);for(let r=0;r<t.length;r++)if(r>=e.length&&e.push(ne.empty),t[r]<i){const s=Cn(n).cell.createAndFill(),l=[];for(let o=t[r];o<i;o++)l.push(s);e[r]=e[r].append(ne.from(l))}return{height:e.length,width:i,rows:e}}function $1(n,e){const t=n.createAndFill();return new nv(t).replace(0,t.content.size,e).doc}function RH({width:n,height:e,rows:t},i,r){if(n!=i){const s=[],l=[];for(let o=0;o<t.length;o++){const c=t[o],h=[];for(let d=s[o]||0,p=0;d<i;p++){let g=c.child(p%c.childCount);d+g.attrs.colspan>i&&(g=g.type.createChecked(Lo(g.attrs,g.attrs.colspan,d+g.attrs.colspan-i),g.content)),h.push(g),d+=g.attrs.colspan;for(let O=1;O<g.attrs.rowspan;O++)s[o+O]=(s[o+O]||0)+g.attrs.colspan}l.push(ne.from(h))}t=l,n=i}if(e!=r){const s=[];for(let l=0,o=0;l<r;l++,o++){const c=[],h=t[o%e];for(let d=0;d<h.childCount;d++){let p=h.child(d);l+p.attrs.rowspan>r&&(p=p.type.create({...p.attrs,rowspan:Math.max(1,r-p.attrs.rowspan)},p.content)),c.push(p)}s.push(ne.from(c))}t=s,e=r}return{width:n,height:e,rows:t}}function PH(n,e,t,i,r,s,l){const o=n.doc.type.schema,c=Cn(o);let h,d;if(r>e.width)for(let p=0,g=0;p<e.height;p++){const O=t.child(p);g+=O.nodeSize;const b=[];let v;O.lastChild==null||O.lastChild.type==c.cell?v=h||(h=c.cell.createAndFill()):v=d||(d=c.header_cell.createAndFill());for(let x=e.width;x<r;x++)b.push(v);n.insert(n.mapping.slice(l).map(g-1+i),b)}if(s>e.height){const p=[];for(let b=0,v=(e.height-1)*e.width;b<Math.max(e.width,r);b++){const x=b>=e.width?!1:t.nodeAt(e.map[v+b]).type==c.header_cell;p.push(x?d||(d=c.header_cell.createAndFill()):h||(h=c.cell.createAndFill()))}const g=c.row.create(null,ne.from(p)),O=[];for(let b=e.height;b<s;b++)O.push(g);n.insert(n.mapping.slice(l).map(i+t.nodeSize-2),O)}return!!(h||d)}function FM(n,e,t,i,r,s,l,o){if(l==0||l==e.height)return!1;let c=!1;for(let h=r;h<s;h++){const d=l*e.width+h,p=e.map[d];if(e.map[d-e.width]==p){c=!0;const g=t.nodeAt(p),{top:O,left:b}=e.findCell(p);n.setNodeMarkup(n.mapping.slice(o).map(p+i),null,{...g.attrs,rowspan:l-O}),n.insert(n.mapping.slice(o).map(e.positionAt(l,b,t)),g.type.createAndFill({...g.attrs,rowspan:O+g.attrs.rowspan-l})),h+=g.attrs.colspan-1}}return c}function KM(n,e,t,i,r,s,l,o){if(l==0||l==e.width)return!1;let c=!1;for(let h=r;h<s;h++){const d=h*e.width+l,p=e.map[d];if(e.map[d-1]==p){c=!0;const g=t.nodeAt(p),O=e.colCount(p),b=n.mapping.slice(o).map(p+i);n.setNodeMarkup(b,null,Lo(g.attrs,l-O,g.attrs.colspan-(l-O))),n.insert(b+g.nodeSize,g.type.createAndFill(Lo(g.attrs,0,l-O))),h+=g.attrs.rowspan-1}}return c}function JM(n,e,t,i,r){let s=t?n.doc.nodeAt(t-1):n.doc;if(!s)throw new Error("No table found");let l=Nt.get(s);const{top:o,left:c}=i,h=c+r.width,d=o+r.height,p=n.tr;let g=0;function O(){if(s=t?p.doc.nodeAt(t-1):p.doc,!s)throw new Error("No table found");l=Nt.get(s),g=p.mapping.maps.length}PH(p,l,s,t,h,d,g)&&O(),FM(p,l,s,t,c,h,o,g)&&O(),FM(p,l,s,t,c,h,d,g)&&O(),KM(p,l,s,t,o,d,c,g)&&O(),KM(p,l,s,t,o,d,h,g)&&O();for(let b=o;b<d;b++){const v=l.positionAt(b,c,s),x=l.positionAt(b,h,s);p.replace(p.mapping.slice(g).map(v+t),p.mapping.slice(g).map(x+t),new pe(r.rows[b-o],0,0))}O(),p.setSelection(new Ot(p.doc.resolve(t+l.positionAt(o,c,s)),p.doc.resolve(t+l.positionAt(d-1,h-1,s)))),e(p)}const DH=Ov({ArrowLeft:Ud("horiz",-1),ArrowRight:Ud("horiz",1),ArrowUp:Ud("vert",-1),ArrowDown:Ud("vert",1),"Shift-ArrowLeft":Wd("horiz",-1),"Shift-ArrowRight":Wd("horiz",1),"Shift-ArrowUp":Wd("vert",-1),"Shift-ArrowDown":Wd("vert",1),Backspace:Yd,"Mod-Backspace":Yd,Delete:Yd,"Mod-Delete":Yd});function $p(n,e,t){return t.eq(n.selection)?!1:(e&&e(n.tr.setSelection(t).scrollIntoView()),!0)}function Ud(n,e){return(t,i,r)=>{if(!r)return!1;const s=t.selection;if(s instanceof Ot)return $p(t,i,Pe.near(s.$headCell,e));if(n!="horiz"&&!s.empty)return!1;const l=fD(r,n,e);if(l==null)return!1;if(n=="horiz")return $p(t,i,Pe.near(t.doc.resolve(s.head+e),e));{const o=t.doc.resolve(l),c=sD(o,n,e);let h;return c?h=Pe.near(c,1):e<0?h=Pe.near(t.doc.resolve(o.before(-1)),-1):h=Pe.near(t.doc.resolve(o.after(-1)),1),$p(t,i,h)}}}function Wd(n,e){return(t,i,r)=>{if(!r)return!1;const s=t.selection;let l;if(s instanceof Ot)l=s;else{const c=fD(r,n,e);if(c==null)return!1;l=new Ot(t.doc.resolve(c))}const o=sD(l.$headCell,n,e);return o?$p(t,i,new Ot(l.$anchorCell,o)):!1}}function NH(n,e){const t=n.state.doc,i=zo(t.resolve(e));return i?(n.dispatch(n.state.tr.setSelection(new Ot(i))),!0):!1}function zH(n,e,t){if(!cr(n.state))return!1;let i=EH(t);const r=n.state.selection;if(r instanceof Ot){i||(i={width:1,height:1,rows:[ne.from($1(Cn(n.state.schema).cell,t))]});const s=r.$anchorCell.node(-1),l=r.$anchorCell.start(-1),o=Nt.get(s).rectBetween(r.$anchorCell.pos-l,r.$headCell.pos-l);return i=RH(i,o.right-o.left,o.bottom-o.top),JM(n.state,n.dispatch,l,o,i),!0}else if(i){const s=Zg(n.state),l=s.start(-1);return JM(n.state,n.dispatch,l,Nt.get(s.node(-1)).findCell(s.pos-l),i),!0}else return!1}function LH(n,e){var t;if(e.button!=0||e.ctrlKey||e.metaKey)return;const i=eQ(n,e.target);let r;if(e.shiftKey&&n.state.selection instanceof Ot)s(n.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&i&&(r=zo(n.state.selection.$anchor))!=null&&((t=Fy(n,e))===null||t===void 0?void 0:t.pos)!=r.pos)s(r,e),e.preventDefault();else if(!i)return;function s(c,h){let d=Fy(n,h);const p=bl.getState(n.state)==null;if(!d||!Lv(c,d))if(p)d=c;else return;const g=new Ot(c,d);if(p||!n.state.selection.eq(g)){const O=n.state.tr.setSelection(g);p&&O.setMeta(bl,c.pos),n.dispatch(O)}}function l(){n.root.removeEventListener("mouseup",l),n.root.removeEventListener("dragstart",l),n.root.removeEventListener("mousemove",o),bl.getState(n.state)!=null&&n.dispatch(n.state.tr.setMeta(bl,-1))}function o(c){const h=c,d=bl.getState(n.state);let p;if(d!=null)p=n.state.doc.resolve(d);else if(eQ(n,h.target)!=i&&(p=Fy(n,e),!p))return l();p&&s(p,h)}n.root.addEventListener("mouseup",l),n.root.addEventListener("dragstart",l),n.root.addEventListener("mousemove",o)}function fD(n,e,t){if(!(n.state.selection instanceof Ae))return null;const{$head:i}=n.state.selection;for(let r=i.depth-1;r>=0;r--){const s=i.node(r);if((t<0?i.index(r):i.indexAfter(r))!=(t<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=i.before(r),o=e=="vert"?t>0?"down":"up":t>0?"right":"left";return n.endOfTextblock(o)?l:null}}return null}function eQ(n,e){for(;e&&e!=n.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Fy(n,e){const t=n.posAtCoords({left:e.clientX,top:e.clientY});if(!t)return null;let{inside:i,pos:r}=t;return i>=0&&zo(n.state.doc.resolve(i))||zo(n.state.doc.resolve(r))}var _H=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),R1(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,R1(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function R1(n,e,t,i,r,s){let l=0,o=!0,c=e.firstChild;const h=n.firstChild;if(h){for(let p=0,g=0;p<h.childCount;p++){const{colspan:O,colwidth:b}=h.child(p).attrs;for(let v=0;v<O;v++,g++){const x=r==g?s:b&&b[v],k=x?x+"px":"";if(l+=x||i,x||(o=!1),c)c.style.width!=k&&(c.style.width=k),c=c.nextSibling;else{const C=document.createElement("col");C.style.width=k,e.appendChild(C)}}}for(;c;){var d;const p=c.nextSibling;(d=c.parentNode)===null||d===void 0||d.removeChild(c),c=p}o?(t.style.width=l+"px",t.style.minWidth=""):(t.style.width="",t.style.minWidth=l+"px")}}const bi=new At("tableColumnResizing");function BH({handleWidth:n=5,cellMinWidth:e=25,defaultCellMinWidth:t=100,View:i=_H,lastColumnResizable:r=!0}={}){const s=new bt({key:bi,state:{init(l,o){var c;const h=(c=s.spec)===null||c===void 0||(c=c.props)===null||c===void 0?void 0:c.nodeViews,d=Cn(o.schema).table.name;return i&&h&&(h[d]=(p,g)=>new i(p,t,g)),new ZH(-1,!1)},apply(l,o){return o.apply(l)}},props:{attributes:l=>{const o=bi.getState(l);return o&&o.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(l,o)=>{jH(l,o,n,r)},mouseleave:l=>{XH(l)},mousedown:(l,o)=>{IH(l,o,e,t)}},decorations:l=>{const o=bi.getState(l);if(o&&o.activeHandle>-1)return UH(l,o.activeHandle)},nodeViews:{}}});return s}var ZH=class Rp{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,i=e.getMeta(bi);if(i&&i.setHandle!=null)return new Rp(i.setHandle,!1);if(i&&i.setDragging!==void 0)return new Rp(t.activeHandle,i.setDragging);if(t.activeHandle>-1&&e.docChanged){let r=e.mapping.map(t.activeHandle,-1);return E1(e.doc.resolve(r))||(r=-1),new Rp(r,t.dragging)}return t}};function jH(n,e,t,i){if(!n.editable)return;const r=bi.getState(n.state);if(r&&!r.dragging){const s=qH(e.target);let l=-1;if(s){const{left:o,right:c}=s.getBoundingClientRect();e.clientX-o<=t?l=tQ(n,e,"left",t):c-e.clientX<=t&&(l=tQ(n,e,"right",t))}if(l!=r.activeHandle){if(!i&&l!==-1){const o=n.state.doc.resolve(l),c=o.node(-1),h=Nt.get(c),d=o.start(-1);if(h.colCount(o.pos-d)+o.nodeAfter.attrs.colspan-1==h.width-1)return}dD(n,l)}}}function XH(n){if(!n.editable)return;const e=bi.getState(n.state);e&&e.activeHandle>-1&&!e.dragging&&dD(n,-1)}function IH(n,e,t,i){var r;if(!n.editable)return!1;const s=(r=n.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,l=bi.getState(n.state);if(!l||l.activeHandle==-1||l.dragging)return!1;const o=n.state.doc.nodeAt(l.activeHandle),c=VH(n,l.activeHandle,o.attrs);n.dispatch(n.state.tr.setMeta(bi,{setDragging:{startX:e.clientX,startWidth:c}}));function h(p){s.removeEventListener("mouseup",h),s.removeEventListener("mousemove",d);const g=bi.getState(n.state);g!=null&&g.dragging&&(HH(n,g.activeHandle,nQ(g.dragging,p,t)),n.dispatch(n.state.tr.setMeta(bi,{setDragging:null})))}function d(p){if(!p.which)return h(p);const g=bi.getState(n.state);if(g&&g.dragging){const O=nQ(g.dragging,p,t);iQ(n,g.activeHandle,O,i)}}return iQ(n,l.activeHandle,c,i),s.addEventListener("mouseup",h),s.addEventListener("mousemove",d),e.preventDefault(),!0}function VH(n,e,{colspan:t,colwidth:i}){const r=i&&i[i.length-1];if(r)return r;const s=n.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,o=t;if(i)for(let c=0;c<t;c++)i[c]&&(l-=i[c],o--);return l/o}function qH(n){for(;n&&n.nodeName!="TD"&&n.nodeName!="TH";)n=n.classList&&n.classList.contains("ProseMirror")?null:n.parentNode;return n}function tQ(n,e,t,i){const r=t=="right"?-i:i,s=n.posAtCoords({left:e.clientX+r,top:e.clientY});if(!s)return-1;const{pos:l}=s,o=zo(n.state.doc.resolve(l));if(!o)return-1;if(t=="right")return o.pos;const c=Nt.get(o.node(-1)),h=o.start(-1),d=c.map.indexOf(o.pos-h);return d%c.width==0?-1:h+c.map[d-1]}function nQ(n,e,t){const i=e.clientX-n.startX;return Math.max(t,n.startWidth+i)}function dD(n,e){n.dispatch(n.state.tr.setMeta(bi,{setHandle:e}))}function HH(n,e,t){const i=n.state.doc.resolve(e),r=i.node(-1),s=Nt.get(r),l=i.start(-1),o=s.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1,c=n.state.tr;for(let h=0;h<s.height;h++){const d=h*s.width+o;if(h&&s.map[d]==s.map[d-s.width])continue;const p=s.map[d],g=r.nodeAt(p).attrs,O=g.colspan==1?0:o-s.colCount(p);if(g.colwidth&&g.colwidth[O]==t)continue;const b=g.colwidth?g.colwidth.slice():YH(g.colspan);b[O]=t,c.setNodeMarkup(l+p,null,{...g,colwidth:b})}c.docChanged&&n.dispatch(c)}function iQ(n,e,t,i){const r=n.state.doc.resolve(e),s=r.node(-1),l=r.start(-1),o=Nt.get(s).colCount(r.pos-l)+r.nodeAfter.attrs.colspan-1;let c=n.domAtPos(r.start(-1)).node;for(;c&&c.nodeName!="TABLE";)c=c.parentNode;c&&R1(s,c.firstChild,c,i,o,t)}function YH(n){return Array(n).fill(0)}function UH(n,e){const t=[],i=n.doc.resolve(e),r=i.node(-1);if(!r)return vt.empty;const s=Nt.get(r),l=i.start(-1),o=s.colCount(i.pos-l)+i.nodeAfter.attrs.colspan-1;for(let h=0;h<s.height;h++){const d=o+h*s.width;if((o==s.width-1||s.map[d]!=s.map[d+1])&&(h==0||s.map[d]!=s.map[d-s.width])){var c;const p=s.map[d],g=l+p+r.nodeAt(p).nodeSize-1,O=document.createElement("div");O.className="column-resize-handle",!((c=bi.getState(n))===null||c===void 0)&&c.dragging&&t.push(ki.node(l+p,l+p+r.nodeAt(p).nodeSize,{class:"column-resize-dragging"})),t.push(ki.widget(g,O))}}return vt.create(n.doc,t)}function WH({allowTableNodeSelection:n=!1}={}){return new bt({key:bl,state:{init(){return null},apply(e,t){const i=e.getMeta(bl);if(i!=null)return i==-1?null:i;if(t==null||!e.docChanged)return t;const{deleted:r,pos:s}=e.mapping.mapResult(t);return r?null:s}},props:{decorations:aH,handleDOMEvents:{mousedown:LH},createSelectionBetween(e){return bl.getState(e.state)!=null?e.state.selection:null},handleTripleClick:NH,handleKeyDown:DH,handlePaste:zH},appendTransaction(e,t,i){return hH(i,cD(i,t),n)}})}function GH(n,e){const t=Math.min(n.top,e.top),i=Math.max(n.bottom,e.bottom),r=Math.min(n.left,e.left),l=Math.max(n.right,e.right)-r,o=i-t,c=r,h=t;return new DOMRect(c,h,l,o)}var FH=class{constructor({editor:n,element:e,view:t,pluginKey:i="bubbleMenu",updateDelay:r=250,resizeDelay:s=60,shouldShow:l,appendTo:o,getReferencedVirtualElement:c,options:h}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:"absolute",placement:"top",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:p,state:g,from:O,to:b})=>{const{doc:v,selection:x}=g,{empty:k}=x,C=!v.textBetween(O,b).length&&vv(g.selection),A=this.element.contains(document.activeElement);return!(!(p.hasFocus()||A)||k||C||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:p})=>{var g;if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}p!=null&&p.relatedTarget&&((g=this.element.parentNode)!=null&&g.contains(p.relatedTarget))||(p==null?void 0:p.relatedTarget)!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(p,g)=>{const O=!(g!=null&&g.selection.eq(p.state.selection)),b=!(g!=null&&g.doc.eq(p.state.doc));!O&&!b||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(p,O,b,g)},this.updateDelay))},this.updateHandler=(p,g,O,b)=>{const{composing:v}=p;if(v||!g&&!O)return;if(!this.getShouldShow(b)){this.hide();return}this.show(),this.updatePosition()},this.transactionHandler=({transaction:p})=>{const g=p.getMeta(this.pluginKey);g==="updatePosition"?this.updatePosition():g&&typeof g=="object"&&g.type==="updateOptions"?this.updateOptions(g.options):g==="hide"?this.hide():g==="show"&&(this.updatePosition(),this.show())};var d;this.editor=n,this.element=e,this.view=t,this.pluginKey=i,this.updateDelay=r,this.resizeDelay=s,this.appendTo=o,this.scrollTarget=(d=h==null?void 0:h.scrollTarget)!=null?d:window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...h},this.element.tabIndex=0,l&&(this.shouldShow=l),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){const n=[];return this.floatingUIOptions.flip&&n.push(JP(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&n.push(KP(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&n.push(GP(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&n.push(nD(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&n.push(eD(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&n.push(FP(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&n.push(tD(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&n.push(iD(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),n}get virtualElement(){var n,e,t;const{selection:i}=this.editor.state,r=(n=this.getReferencedVirtualElement)==null?void 0:n.call(this);if(r)return r;if(!((t=(e=this.view)==null?void 0:e.dom)!=null&&t.parentNode))return;const s=pP(this.view,i.from,i.to);let l={getBoundingClientRect:()=>s,getClientRects:()=>[s]};if(i instanceof Te){let o=this.view.nodeDOM(i.from);const c=o.dataset.nodeViewWrapper?o:o.querySelector("[data-node-view-wrapper]");c&&(o=c),o&&(l={getBoundingClientRect:()=>o.getBoundingClientRect(),getClientRects:()=>[o.getBoundingClientRect()]})}if(i instanceof Ot){const{$anchorCell:o,$headCell:c}=i,h=o?o.pos:c.pos,d=c?c.pos:o.pos,p=this.view.nodeDOM(h),g=this.view.nodeDOM(d);if(!p||!g)return;const O=p===g?p.getBoundingClientRect():GH(p.getBoundingClientRect(),g.getBoundingClientRect());l={getBoundingClientRect:()=>O,getClientRects:()=>[O]}}return l}updatePosition(){if(!this.isVisible)return;const n=this.virtualElement;n&&rD(n,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:i,middlewareData:r})=>{var s,l;if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if((s=r.hide)!=null&&s.referenceHidden||(l=r.hide)!=null&&l.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=i,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(n,e){const{state:t}=n,i=t.selection.from!==t.selection.to;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(n,e);return}const r=!(e!=null&&e.selection.eq(n.state.selection)),s=!(e!=null&&e.doc.eq(n.state.doc));this.updateHandler(n,r,s,e)}getShouldShow(n){var e;const{state:t}=this.view,{selection:i}=t,{ranges:r}=i,s=Math.min(...r.map(c=>c.$from.pos)),l=Math.max(...r.map(c=>c.$to.pos));return((e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:n,from:s,to:l}))||!1}show(){var n;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(n=e??this.view.dom.parentElement)==null||n.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(n){var e;if(n.updateDelay!==void 0&&(this.updateDelay=n.updateDelay),n.resizeDelay!==void 0&&(this.resizeDelay=n.resizeDelay),n.appendTo!==void 0&&(this.appendTo=n.appendTo),n.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=n.getReferencedVirtualElement),n.shouldShow!==void 0&&n.shouldShow&&(this.shouldShow=n.shouldShow),n.options!==void 0){const t=(e=n.options.scrollTarget)!=null?e:window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...n.options}}}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},pD=n=>new bt({key:typeof n.pluginKey=="string"?new At(n.pluginKey):n.pluginKey,view:e=>new FH({view:e,...n})});Et.create({name:"bubbleMenu",addOptions(){return{element:null,pluginKey:"bubbleMenu",updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[pD({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var KH=class{constructor({editor:n,element:e,view:t,pluginKey:i="floatingMenu",updateDelay:r=250,resizeDelay:s=60,options:l,appendTo:o,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:d,state:p})=>{const{selection:g}=p,{$anchor:O,empty:b}=g,v=O.depth===1,x=O.parent.isTextblock&&!O.parent.type.spec.code&&!O.parent.textContent&&O.parent.childCount===0&&!this.getTextContent(O.parent);return!(!d.hasFocus()||!b||!v||!x||!this.editor.isEditable)},this.floatingUIOptions={strategy:"absolute",placement:"right",offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(d,p,g,O)=>{const{composing:b}=d;if(b||!p&&!g)return;if(!this.getShouldShow(O)){this.hide();return}this.updatePosition(),this.show()},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:d})=>{var p;if(this.preventHide){this.preventHide=!1;return}d!=null&&d.relatedTarget&&((p=this.element.parentNode)!=null&&p.contains(d.relatedTarget))||(d==null?void 0:d.relatedTarget)!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:d})=>{const p=d.getMeta(this.pluginKey);p==="updatePosition"?this.updatePosition():p&&typeof p=="object"&&p.type==="updateOptions"?this.updateOptions(p.options):p==="hide"?this.hide():p==="show"&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)};var h;this.editor=n,this.element=e,this.view=t,this.pluginKey=i,this.updateDelay=r,this.resizeDelay=s,this.appendTo=o,this.scrollTarget=(h=l==null?void 0:l.scrollTarget)!=null?h:window,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.editor.on("transaction",this.transactionHandler),window.addEventListener("resize",this.resizeHandler),this.scrollTarget.addEventListener("scroll",this.resizeHandler),this.update(t,t.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(n){return aP(n,{textSerializers:wv(this.editor.schema)})}get middlewares(){const n=[];return this.floatingUIOptions.flip&&n.push(JP(typeof this.floatingUIOptions.flip!="boolean"?this.floatingUIOptions.flip:void 0)),this.floatingUIOptions.shift&&n.push(KP(typeof this.floatingUIOptions.shift!="boolean"?this.floatingUIOptions.shift:void 0)),this.floatingUIOptions.offset&&n.push(GP(typeof this.floatingUIOptions.offset!="boolean"?this.floatingUIOptions.offset:void 0)),this.floatingUIOptions.arrow&&n.push(nD(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&n.push(eD(typeof this.floatingUIOptions.size!="boolean"?this.floatingUIOptions.size:void 0)),this.floatingUIOptions.autoPlacement&&n.push(FP(typeof this.floatingUIOptions.autoPlacement!="boolean"?this.floatingUIOptions.autoPlacement:void 0)),this.floatingUIOptions.hide&&n.push(tD(typeof this.floatingUIOptions.hide!="boolean"?this.floatingUIOptions.hide:void 0)),this.floatingUIOptions.inline&&n.push(iD(typeof this.floatingUIOptions.inline!="boolean"?this.floatingUIOptions.inline:void 0)),n}getShouldShow(n){var e;const{state:t}=this.view,{selection:i}=t,{ranges:r}=i,s=Math.min(...r.map(c=>c.$from.pos)),l=Math.max(...r.map(c=>c.$to.pos));return(e=this.shouldShow)==null?void 0:e.call(this,{editor:this.editor,view:this.view,state:t,oldState:n,from:s,to:l})}updateOptions(n){var e;if(n.updateDelay!==void 0&&(this.updateDelay=n.updateDelay),n.resizeDelay!==void 0&&(this.resizeDelay=n.resizeDelay),n.appendTo!==void 0&&(this.appendTo=n.appendTo),n.shouldShow!==void 0&&n.shouldShow&&(this.shouldShow=n.shouldShow),n.options!==void 0){const t=(e=n.options.scrollTarget)!=null?e:window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener("scroll",this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...n.options}}}updatePosition(){var n,e;if(!((e=(n=this.view)==null?void 0:n.dom)!=null&&e.parentNode))return;const{selection:t}=this.editor.state,i=pP(this.view,t.from,t.to);rD({getBoundingClientRect:()=>i,getClientRects:()=>[i]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:s,y:l,strategy:o,middlewareData:c})=>{var h,d;if((h=c.hide)!=null&&h.referenceHidden||(d=c.hide)!=null&&d.escaped){this.element.style.visibility="hidden";return}this.element.style.visibility="visible",this.element.style.width="max-content",this.element.style.position=o,this.element.style.left=`${s}px`,this.element.style.top=`${l}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(n,e){const t=!(e!=null&&e.selection.eq(n.state.selection)),i=!(e!=null&&e.doc.eq(n.state.doc));this.updateHandler(n,t,i,e)}show(){var n;if(this.isVisible)return;this.element.style.visibility="visible",this.element.style.opacity="1";const e=typeof this.appendTo=="function"?this.appendTo():this.appendTo;(n=e??this.view.dom.parentElement)==null||n.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0}hide(){this.isVisible&&(this.element.style.visibility="hidden",this.element.style.opacity="0",this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),window.removeEventListener("resize",this.resizeHandler),this.scrollTarget.removeEventListener("scroll",this.resizeHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.editor.off("transaction",this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},mD=n=>new bt({key:typeof n.pluginKey=="string"?new At(n.pluginKey):n.pluginKey,view:e=>new KH({view:e,...n})});Et.create({name:"floatingMenu",addOptions(){return{element:null,options:{},pluginKey:"floatingMenu",updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:n,dispatch:e})=>(e&&n.setMeta(this.options.pluginKey,"updatePosition"),!0)}},addProseMirrorPlugins(){return this.options.element?[mD({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function gD(n,e){return n??new At(e)}var JH=typeof window<"u"?Ee.useLayoutEffect:Ee.useEffect,OD=new Set(["left","opacity","position","top","visibility","width"]),eY=new Set(["animationIterationCount","aspectRatio","borderImageOutset","borderImageSlice","borderImageWidth","columnCount","columns","fillOpacity","flex","flexGrow","flexShrink","fontWeight","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","lineClamp","lineHeight","opacity","order","orphans","scale","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","tabSize","widows","zIndex","zoom"]),tY=new Set(["children","className","style"]),nY=new Set(["tabIndex"]),iY=new Set(["accessKey","autoCapitalize","contentEditable","contextMenu","dir","draggable","enterKeyHint","hidden","id","lang","nonce","role","slot","spellCheck","tabIndex","title","translate"]),rY={Blur:"focusout",DoubleClick:"dblclick",Focus:"focusin",MouseEnter:"mouseenter",MouseLeave:"mouseleave"};function P1(n,e){return/^on[A-Z]/.test(n)&&typeof e=="function"}function sY(n){return n.startsWith("aria-")||n.startsWith("data-"),n}function lY(n){return n.startsWith("aria-")||n.startsWith("data-")||iY.has(n)}function yD(n){return n.startsWith("--")?n:n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function oY(n){var e;const t=n.endsWith("Capture"),r=(t?n.slice(0,-7):n).slice(2);return{eventName:(e=rY[r])!=null?e:r.toLowerCase(),options:t?{capture:!0}:void 0}}function aY(n,e){let t=e.defaultPrevented,i=!1;const r=Object.create(e);return Object.defineProperties(r,{nativeEvent:{value:e},currentTarget:{value:n},target:{value:e.target},persist:{value:()=>{}},isDefaultPrevented:{value:()=>t},isPropagationStopped:{value:()=>i},preventDefault:{value:()=>{t=!0,e.preventDefault()}},stopPropagation:{value:()=>{i=!0,e.stopPropagation()}}}),r}function Ky(n){return nY.has(n)}function rQ(n,e,t){if(e==="tabIndex"){n.tabIndex=Number(t);return}n[e]=t}function cY(n,e){if(e==="tabIndex"){n.removeAttribute("tabindex");return}const t=n[e];if(typeof t=="boolean"){n[e]=!1;return}if(typeof t=="number"){n[e]=0;return}n[e]=""}function uY(n,e){return typeof e!="number"||e===0||n.startsWith("--")||eY.has(n)?String(e):`${e}px`}function hY(n,e){OD.has(e)||n.style.removeProperty(yD(e))}function fY(n,e,t){OD.has(e)||n.style.setProperty(yD(e),uY(e,t))}function dY(n,e,t){new Set([...Object.keys(e),...Object.keys(t)]).forEach(r=>{if(tY.has(r)||!lY(r)||P1(r,e[r])||P1(r,t[r]))return;const s=e[r],l=t[r];if(s===l)return;const o=sY(r);if(l==null||l===!1){Ky(r)&&cY(n,r),n.removeAttribute(o);return}if(l===!0){Ky(r)&&rQ(n,r,!0),n.setAttribute(o,"");return}if(Ky(r)){rQ(n,r,l);return}n.setAttribute(o,String(l))})}function pY(n,e,t){if(e!==t){if(t){n.className=t;return}n.removeAttribute("class")}}function mY(n,e,t){const i=e??{},r=t??{};new Set([...Object.keys(i),...Object.keys(r)]).forEach(l=>{const o=i[l],c=r[l];if(o!==c){if(c==null){hY(n,l);return}fY(n,l,c)}})}function gY(n,e,t){e.forEach(({eventName:r,listener:s,options:l})=>{n.removeEventListener(r,s,l)});const i=[];return Object.entries(t).forEach(([r,s])=>{if(!P1(r,s))return;const{eventName:l,options:o}=oY(r),c=h=>{s(aY(n,h))};n.addEventListener(l,c,o),i.push({eventName:l,listener:c,options:o})}),i}function bD(n,e){const t=Ee.useRef({}),i=Ee.useRef([]);JH(()=>{const r=t.current;return pY(n,r.className,e.className),mY(n,r.style,e.style),dY(n,r,e),i.current=gY(n,i.current,e),t.current=e,()=>{i.current.forEach(({eventName:s,listener:l,options:o})=>{n.removeEventListener(s,l,o)}),i.current=[]}},[n,e])}var OY=$e.forwardRef(({pluginKey:n,editor:e,updateDelay:t,resizeDelay:i,appendTo:r,shouldShow:s=null,getReferencedVirtualElement:l,options:o,children:c,...h},d)=>{const p=Ee.useRef(document.createElement("div")),g=Ee.useRef(gD(n,"bubbleMenu")).current;bD(p.current,h),typeof d=="function"?d(p.current):d&&(d.current=p.current);const{editor:O}=DP(),b=e||O,v={updateDelay:t,resizeDelay:i,appendTo:r,pluginKey:g,shouldShow:s,getReferencedVirtualElement:l,options:o},x=Ee.useRef(v);x.current=v;const[k,C]=Ee.useState(!1),A=Ee.useRef(!0);return Ee.useEffect(()=>{if(b!=null&&b.isDestroyed)return;if(!b){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const P=p.current;P.style.visibility="hidden",P.style.position="absolute";const E=pD({...x.current,editor:b,element:P});b.registerPlugin(E);const D=x.current.pluginKey;return A.current=!0,C(!0),()=>{C(!1),b.unregisterPlugin(D),window.requestAnimationFrame(()=>{P.parentNode&&P.parentNode.removeChild(P)})}},[b]),Ee.useEffect(()=>{if(!(!k||!b||b.isDestroyed)){if(A.current){A.current=!1;return}b.view.dispatch(b.state.tr.setMeta(g,{type:"updateOptions",options:x.current}))}},[k,b,t,i,s,o,r,l,g]),KS.createPortal(c,p.current)}),yY=$e.forwardRef(({pluginKey:n,editor:e,updateDelay:t,resizeDelay:i,appendTo:r,shouldShow:s=null,options:l,children:o,...c},h)=>{const d=Ee.useRef(document.createElement("div")),p=Ee.useRef(gD(n,"floatingMenu")).current;bD(d.current,c),typeof h=="function"?h(d.current):h&&(h.current=d.current);const{editor:g}=DP(),O=e||g,b={updateDelay:t,resizeDelay:i,appendTo:r,pluginKey:p,shouldShow:s,options:l},v=Ee.useRef(b);v.current=b;const[x,k]=Ee.useState(!1),C=Ee.useRef(!0);return Ee.useEffect(()=>{if(O!=null&&O.isDestroyed)return;if(!O){console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");return}const A=d.current;A.style.visibility="hidden",A.style.position="absolute";const P=mD({...v.current,editor:O,element:A});O.registerPlugin(P);const E=v.current.pluginKey;return C.current=!0,k(!0),()=>{k(!1),O.unregisterPlugin(E),window.requestAnimationFrame(()=>{A.parentNode&&A.parentNode.removeChild(A)})}},[O]),Ee.useEffect(()=>{if(!(!x||!O||O.isDestroyed)){if(C.current){C.current=!1;return}O.view.dispatch(O.state.tr.setMeta(p,{type:"updateOptions",options:v.current}))}},[x,O,t,i,s,l,r,p]),KS.createPortal(o,d.current)}),am=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...i}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,i,t]},bY=/^\s*>\s$/,SY=ln.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return am("blockquote",{...Ct(this.options.HTMLAttributes,n),children:am("slot",{})})},parseMarkdown:(n,e)=>{var t;const i=(t=e.parseBlockChildren)!=null?t:e.parseChildren;return e.createNode("blockquote",void 0,i(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",i=[];return n.content.forEach((r,s)=>{var l,o;const d=((o=(l=e.renderChild)==null?void 0:l.call(e,r,s))!=null?o:e.renderChildren([r])).split(`
|
|
167
|
+
`).map(p=>p.trim()===""?t:`${t} ${p}`);i.push(d.join(`
|
|
168
|
+
`))}),i.join(`
|
|
169
|
+
${t}
|
|
170
|
+
`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[uc({find:bY,type:this.type})]}}),vY=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,xY=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,kY=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,wY=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,TY=Vo.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return am("strong",{...Ct(this.options.HTMLAttributes,n),children:am("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[cc({find:vY,type:this.type}),cc({find:kY,type:this.type})]},addPasteRules(){return[No({find:xY,type:this.type}),No({find:wY,type:this.type})]}}),CY=/(^|[^`])`([^`]+)`(?!`)$/,AY=/(^|[^`])`([^`]+)`(?!`)/g,MY=Vo.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Ct(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e)=>n.content?`\`${e.renderChildren(n.content)}\``:"",addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[cc({find:CY,type:this.type})]},addPasteRules(){return[No({find:AY,type:this.type})]}}),Jy=4,QY=/^```([a-z]+)?[\s\n]$/,EY=/^~~~([a-z]+)?[\s\n]$/,$Y=ln.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Jy,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const s=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(l=>l.startsWith(t)).map(l=>l.replace(t,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Ct(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,i;return((t=n.raw)==null?void 0:t.startsWith("```"))===!1&&((i=n.raw)==null?void 0:i.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let i="";const r=((t=n.attrs)==null?void 0:t.language)||"";return n.content?i=[`\`\`\`${r}`,e.renderChildren(n.content),"```"].join(`
|
|
171
|
+
`):i=`\`\`\`${r}
|
|
172
|
+
|
|
173
|
+
\`\`\``,i},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:Jy,{state:i}=n,{selection:r}=i,{$from:s,empty:l}=r;if(s.parent.type!==this.type)return!1;const o=" ".repeat(t);return l?n.commands.insertContent(o):n.commands.command(({tr:c})=>{const{from:h,to:d}=r,O=i.doc.textBetween(h,d,`
|
|
174
|
+
`,`
|
|
175
|
+
`).split(`
|
|
176
|
+
`).map(b=>o+b).join(`
|
|
177
|
+
`);return c.replaceWith(h,d,i.schema.text(O)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:Jy,{state:i}=n,{selection:r}=i,{$from:s,empty:l}=r;return s.parent.type!==this.type?!1:l?n.commands.command(({tr:o})=>{var c;const{pos:h}=s,d=s.start(),p=s.end(),O=i.doc.textBetween(d,p,`
|
|
178
|
+
`,`
|
|
179
|
+
`).split(`
|
|
180
|
+
`);let b=0,v=0;const x=h-d;for(let D=0;D<O.length;D+=1){if(v+O[D].length>=x){b=D;break}v+=O[D].length+1}const C=((c=O[b].match(/^ */))==null?void 0:c[0])||"",A=Math.min(C.length,t);if(A===0)return!0;let P=d;for(let D=0;D<b;D+=1)P+=O[D].length+1;return o.delete(P,P+A),h-P<=A&&o.setSelection(Ae.create(o.doc,P)),!0}):n.commands.command(({tr:o})=>{const{from:c,to:h}=r,g=i.doc.textBetween(c,h,`
|
|
181
|
+
`,`
|
|
182
|
+
`).split(`
|
|
183
|
+
`).map(O=>{var b;const v=((b=O.match(/^ */))==null?void 0:b[0])||"",x=Math.min(v.length,t);return O.slice(x)}).join(`
|
|
184
|
+
`);return o.replaceWith(c,h,i.schema.text(g)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:i,empty:r}=t;if(!r||i.parent.type!==this.type)return!1;const s=i.parentOffset===i.parent.nodeSize-2,l=i.parent.textContent.endsWith(`
|
|
185
|
+
|
|
186
|
+
`);return!s||!l?!1:n.chain().command(({tr:o})=>(o.delete(i.pos-2,i.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:i}=e,{$from:r,empty:s}=t;if(!s||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const o=r.after();return o===void 0?!1:i.nodeAt(o)?n.commands.command(({tr:h})=>(h.setSelection(Pe.near(i.resolve(o))),!0)):n.commands.exitCode()}}},addInputRules(){return[k1({find:QY,type:this.type,getAttributes:n=>({language:n[1]})}),k1({find:EY,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new bt({key:new At("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),i=e.clipboardData.getData("vscode-editor-data"),r=i?JSON.parse(i):void 0,s=r==null?void 0:r.mode;if(!t||!s)return!1;const{tr:l,schema:o}=n.state,c=o.text(t.replace(/\r\n?/g,`
|
|
187
|
+
`));return l.replaceSelectionWith(this.type.create({language:s},c)),l.selection.$from.parent.type!==this.type&&l.setSelection(Ae.near(l.doc.resolve(Math.max(0,l.selection.from-2)))),l.setMeta("paste",!0),n.dispatch(l),!0}}})]}}),RY=ln.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
188
|
+
|
|
189
|
+
`):""}),PY=ln.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Ct(this.options.HTMLAttributes,n)]},renderText(){return`
|
|
190
|
+
`},renderMarkdown:()=>`
|
|
191
|
+
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:i})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:r,storedMarks:s}=t;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:l}=this.options,{splittableMarks:o}=i.extensionManager,c=s||r.$to.parentOffset&&r.$from.marks();return e().insertContent({type:this.name}).command(({tr:h,dispatch:d})=>{if(d&&c&&l){const p=c.filter(g=>o.includes(g.type.name));h.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),DY=ln.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(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ct(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const i=(t=n.attrs)!=null&&t.level?parseInt(n.attrs.level,10):1,r="#".repeat(i);return n.content?`${r} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>k1({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),NY=ln.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Ct(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!nV(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:i}=t,r=n();return hP(t)?r.insertContentAt(i.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({state:s,tr:l,dispatch:o})=>{if(o){const{$to:c}=l.selection,h=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?l.setSelection(Ae.create(l.doc,c.pos+1)):c.nodeAfter.isBlock?l.setSelection(Te.create(l.doc,c.pos)):l.setSelection(Ae.create(l.doc,c.pos));else{const d=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=d==null?void 0:d.create();p&&(l.insert(h,p),l.setSelection(Ae.create(l.doc,h+1)))}l.scrollIntoView()}return!0}).run()}}},addInputRules(){return[QP({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),zY=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,LY=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,_Y=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,BY=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,ZY=Vo.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Ct(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[cc({find:zY,type:this.type}),cc({find:_Y,type:this.type})]},addPasteRules(){return[No({find:LY,type:this.type}),No({find:BY,type:this.type})]}});const jY="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",XY="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",D1="numeric",N1="ascii",z1="alpha",oh="asciinumeric",Gu="alphanumeric",L1="domain",SD="emoji",IY="scheme",VY="slashscheme",eb="whitespace";function qY(n,e){return n in e||(e[n]=[]),e[n]}function bo(n,e,t){e[D1]&&(e[oh]=!0,e[Gu]=!0),e[N1]&&(e[oh]=!0,e[z1]=!0),e[oh]&&(e[Gu]=!0),e[z1]&&(e[Gu]=!0),e[Gu]&&(e[L1]=!0),e[SD]&&(e[L1]=!0);for(const i in e){const r=qY(i,t);r.indexOf(n)<0&&r.push(n)}}function HY(n,e){const t={};for(const i in e)e[i].indexOf(n)>=0&&(t[i]=!0);return t}function Un(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Un.groups={};Un.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let i=0;i<e.jr.length;i++){const r=e.jr[i][0],s=e.jr[i][1];if(s&&r.test(n))return s}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,i){for(let r=0;r<n.length;r++)this.tt(n[r],e,t,i)},tr(n,e,t,i){i=i||Un.groups;let r;return e&&e.j?r=e:(r=new Un(e),t&&i&&bo(e,t,i)),this.jr.push([n,r]),r},ts(n,e,t,i){let r=this;const s=n.length;if(!s)return r;for(let l=0;l<s-1;l++)r=r.tt(n[l]);return r.tt(n[s-1],e,t,i)},tt(n,e,t,i){i=i||Un.groups;const r=this;if(e&&e.j)return r.j[n]=e,e;const s=e;let l,o=r.go(n);if(o?(l=new Un,Object.assign(l.j,o.j),l.jr.push.apply(l.jr,o.jr),l.jd=o.jd,l.t=o.t):l=new Un,s){if(i)if(l.t&&typeof l.t=="string"){const c=Object.assign(HY(l.t,i),t);bo(s,c,i)}else t&&bo(s,t,i);l.t=s}return r.j[n]=l,l}};const je=(n,e,t,i,r)=>n.ta(e,t,i,r),Pt=(n,e,t,i,r)=>n.tr(e,t,i,r),sQ=(n,e,t,i,r)=>n.ts(e,t,i,r),le=(n,e,t,i,r)=>n.tt(e,t,i,r),ys="WORD",_1="UWORD",vD="ASCIINUMERICAL",xD="ALPHANUMERICAL",Nh="LOCALHOST",B1="TLD",Z1="UTLD",Pp="SCHEME",Za="SLASH_SCHEME",_v="NUM",j1="WS",Bv="NL",ah="OPENBRACE",ch="CLOSEBRACE",cm="OPENBRACKET",um="CLOSEBRACKET",hm="OPENPAREN",fm="CLOSEPAREN",dm="OPENANGLEBRACKET",pm="CLOSEANGLEBRACKET",mm="FULLWIDTHLEFTPAREN",gm="FULLWIDTHRIGHTPAREN",Om="LEFTCORNERBRACKET",ym="RIGHTCORNERBRACKET",bm="LEFTWHITECORNERBRACKET",Sm="RIGHTWHITECORNERBRACKET",vm="FULLWIDTHLESSTHAN",xm="FULLWIDTHGREATERTHAN",km="AMPERSAND",wm="APOSTROPHE",Tm="ASTERISK",pl="AT",Cm="BACKSLASH",Am="BACKTICK",Mm="CARET",Sl="COLON",Zv="COMMA",Qm="DOLLAR",wr="DOT",Em="EQUALS",jv="EXCLAMATION",zi="HYPHEN",uh="PERCENT",$m="PIPE",Rm="PLUS",Pm="POUND",hh="QUERY",Xv="QUOTE",kD="FULLWIDTHMIDDLEDOT",Iv="SEMI",Tr="SLASH",fh="TILDE",Dm="UNDERSCORE",wD="EMOJI",Nm="SYM";var TD=Object.freeze({__proto__:null,ALPHANUMERICAL:xD,AMPERSAND:km,APOSTROPHE:wm,ASCIINUMERICAL:vD,ASTERISK:Tm,AT:pl,BACKSLASH:Cm,BACKTICK:Am,CARET:Mm,CLOSEANGLEBRACKET:pm,CLOSEBRACE:ch,CLOSEBRACKET:um,CLOSEPAREN:fm,COLON:Sl,COMMA:Zv,DOLLAR:Qm,DOT:wr,EMOJI:wD,EQUALS:Em,EXCLAMATION:jv,FULLWIDTHGREATERTHAN:xm,FULLWIDTHLEFTPAREN:mm,FULLWIDTHLESSTHAN:vm,FULLWIDTHMIDDLEDOT:kD,FULLWIDTHRIGHTPAREN:gm,HYPHEN:zi,LEFTCORNERBRACKET:Om,LEFTWHITECORNERBRACKET:bm,LOCALHOST:Nh,NL:Bv,NUM:_v,OPENANGLEBRACKET:dm,OPENBRACE:ah,OPENBRACKET:cm,OPENPAREN:hm,PERCENT:uh,PIPE:$m,PLUS:Rm,POUND:Pm,QUERY:hh,QUOTE:Xv,RIGHTCORNERBRACKET:ym,RIGHTWHITECORNERBRACKET:Sm,SCHEME:Pp,SEMI:Iv,SLASH:Tr,SLASH_SCHEME:Za,SYM:Nm,TILDE:fh,TLD:B1,UNDERSCORE:Dm,UTLD:Z1,UWORD:_1,WORD:ys,WS:j1});const ps=/[a-z]/,Ru=new RegExp("\\p{L}","u"),tb=new RegExp("\\p{Emoji}","u"),ms=/\d/,nb=/\s/,lQ="\r",ib=`
|
|
192
|
+
`,YY="️",UY="",rb="";let Gd=null,Fd=null;function WY(n=[]){const e={};Un.groups=e;const t=new Un;Gd==null&&(Gd=oQ(jY)),Fd==null&&(Fd=oQ(XY)),le(t,"'",wm),le(t,"{",ah),le(t,"}",ch),le(t,"[",cm),le(t,"]",um),le(t,"(",hm),le(t,")",fm),le(t,"<",dm),le(t,">",pm),le(t,"(",mm),le(t,")",gm),le(t,"「",Om),le(t,"」",ym),le(t,"『",bm),le(t,"』",Sm),le(t,"<",vm),le(t,">",xm),le(t,"&",km),le(t,"*",Tm),le(t,"@",pl),le(t,"`",Am),le(t,"^",Mm),le(t,":",Sl),le(t,",",Zv),le(t,"$",Qm),le(t,".",wr),le(t,"=",Em),le(t,"!",jv),le(t,"-",zi),le(t,"%",uh),le(t,"|",$m),le(t,"+",Rm),le(t,"#",Pm),le(t,"?",hh),le(t,'"',Xv),le(t,"/",Tr),le(t,";",Iv),le(t,"~",fh),le(t,"_",Dm),le(t,"\\",Cm),le(t,"・",kD);const i=Pt(t,ms,_v,{[D1]:!0});Pt(i,ms,i);const r=Pt(i,ps,vD,{[oh]:!0}),s=Pt(i,Ru,xD,{[Gu]:!0}),l=Pt(t,ps,ys,{[N1]:!0});Pt(l,ms,r),Pt(l,ps,l),Pt(r,ms,r),Pt(r,ps,r);const o=Pt(t,Ru,_1,{[z1]:!0});Pt(o,ps),Pt(o,ms,s),Pt(o,Ru,o),Pt(s,ms,s),Pt(s,ps),Pt(s,Ru,s);const c=le(t,ib,Bv,{[eb]:!0}),h=le(t,lQ,j1,{[eb]:!0}),d=Pt(t,nb,j1,{[eb]:!0});le(t,rb,d),le(h,ib,c),le(h,rb,d),Pt(h,nb,d),le(d,lQ),le(d,ib),Pt(d,nb,d),le(d,rb,d);const p=Pt(t,tb,wD,{[SD]:!0});le(p,"#"),Pt(p,tb,p),le(p,YY,p);const g=le(p,UY);le(g,"#"),Pt(g,tb,p);const O=[[ps,l],[ms,r]],b=[[ps,null],[Ru,o],[ms,s]];for(let v=0;v<Gd.length;v++)ul(t,Gd[v],B1,ys,O);for(let v=0;v<Fd.length;v++)ul(t,Fd[v],Z1,_1,b);bo(B1,{tld:!0,ascii:!0},e),bo(Z1,{utld:!0,alpha:!0},e),ul(t,"file",Pp,ys,O),ul(t,"mailto",Pp,ys,O),ul(t,"http",Za,ys,O),ul(t,"https",Za,ys,O),ul(t,"ftp",Za,ys,O),ul(t,"ftps",Za,ys,O),bo(Pp,{scheme:!0,ascii:!0},e),bo(Za,{slashscheme:!0,ascii:!0},e),n=n.sort((v,x)=>v[0]>x[0]?1:-1);for(let v=0;v<n.length;v++){const x=n[v][0],C=n[v][1]?{[IY]:!0}:{[VY]:!0};x.indexOf("-")>=0?C[L1]=!0:ps.test(x)?ms.test(x)?C[oh]=!0:C[N1]=!0:C[D1]=!0,sQ(t,x,x,C)}return sQ(t,"localhost",Nh,{ascii:!0}),t.jd=new Un(Nm),{start:t,tokens:Object.assign({groups:e},TD)}}function CD(n,e){const t=GY(e.replace(/[A-Z]/g,o=>o.toLowerCase())),i=t.length,r=[];let s=0,l=0;for(;l<i;){let o=n,c=null,h=0,d=null,p=-1,g=-1;for(;l<i&&(c=o.go(t[l]));)o=c,o.accepts()?(p=0,g=0,d=o):p>=0&&(p+=t[l].length,g++),h+=t[l].length,s+=t[l].length,l++;s-=p,l-=g,h-=p,r.push({t:d.t,v:e.slice(s-h,s),s:s-h,e:s})}return r}function GY(n){const e=[],t=n.length;let i=0;for(;i<t;){let r=n.charCodeAt(i),s,l=r<55296||r>56319||i+1===t||(s=n.charCodeAt(i+1))<56320||s>57343?n[i]:n.slice(i,i+2);e.push(l),i+=l.length}return e}function ul(n,e,t,i,r){let s;const l=e.length;for(let o=0;o<l-1;o++){const c=e[o];n.j[c]?s=n.j[c]:(s=new Un(i),s.jr=r.slice(),n.j[c]=s),n=s}return s=new Un(t),s.jr=r.slice(),n.j[e[l-1]]=s,s}function oQ(n){const e=[],t=[];let i=0,r="0123456789";for(;i<n.length;){let s=0;for(;r.indexOf(n[i+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let l=parseInt(n.substring(i,i+s),10);l>0;l--)t.pop();i+=s}else t.push(n[i]),i++}return e}const zh={defaultProtocol:"http",events:null,format:aQ,formatHref:aQ,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Vv(n,e=null){let t=Object.assign({},zh);n&&(t=Object.assign(t,n instanceof Vv?n.o:n));const i=t.ignoreTags,r=[];for(let s=0;s<i.length;s++)r.push(i[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=r}Vv.prototype={o:zh,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const i=e!=null;let r=this.o[n];return r&&(typeof r=="object"?(r=t.t in r?r[t.t]:zh[n],typeof r=="function"&&i&&(r=r(e,t))):typeof r=="function"&&i&&(r=r(e,t.t,t)),r)},getObj(n,e,t){let i=this.o[n];return typeof i=="function"&&e!=null&&(i=i(e,t.t,t)),i},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function aQ(n){return n}function AD(n,e){this.t="token",this.v=n,this.tk=e}AD.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),i=n.get("format",e,this);return t&&i.length>t?i.substring(0,t)+"…":i},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=zh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),i=n.get("formatHref",t,this),r=n.get("tagName",t,e),s=this.toFormattedString(n),l={},o=n.get("className",t,e),c=n.get("target",t,e),h=n.get("rel",t,e),d=n.getObj("attributes",t,e),p=n.getObj("events",t,e);return l.href=i,o&&(l.class=o),c&&(l.target=c),h&&(l.rel=h),d&&Object.assign(l,d),{tagName:r,attributes:l,content:s,eventListeners:p}}};function jg(n,e){class t extends AD{constructor(r,s){super(r,s),this.t=n}}for(const i in e)t.prototype[i]=e[i];return t.t=n,t}const cQ=jg("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),uQ=jg("text"),FY=jg("nl"),Kd=jg("url",{isLink:!0,toHref(n=zh.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Nh&&n[1].t===Sl}}),Ni=n=>new Un(n);function KY({groups:n}){const e=n.domain.concat([km,Tm,pl,Cm,Am,Mm,Qm,Em,zi,_v,uh,$m,Rm,Pm,Tr,Nm,fh,Dm]),t=[wm,Sl,Zv,wr,jv,uh,hh,Xv,Iv,dm,pm,ah,ch,um,cm,hm,fm,mm,gm,Om,ym,bm,Sm,vm,xm],i=[km,wm,Tm,Cm,Am,Mm,Qm,Em,zi,ah,ch,uh,$m,Rm,Pm,hh,Tr,Nm,fh,Dm],r=Ni(),s=le(r,fh);je(s,i,s),je(s,n.domain,s);const l=Ni(),o=Ni(),c=Ni();je(r,n.domain,l),je(r,n.scheme,o),je(r,n.slashscheme,c),je(l,i,s),je(l,n.domain,l);const h=le(l,pl);le(s,pl,h),le(o,pl,h),le(c,pl,h);const d=le(s,wr);je(d,i,s),je(d,n.domain,s);const p=Ni();je(h,n.domain,p),je(p,n.domain,p);const g=le(p,wr);je(g,n.domain,p);const O=Ni(cQ);je(g,n.tld,O),je(g,n.utld,O),le(h,Nh,O);const b=le(p,zi);le(b,zi,b),je(b,n.domain,p),je(O,n.domain,p),le(O,wr,g),le(O,zi,b);const v=le(O,Sl);je(v,n.numeric,cQ);const x=le(l,zi),k=le(l,wr);le(x,zi,x),je(x,n.domain,l),je(k,i,s),je(k,n.domain,l);const C=Ni(Kd);je(k,n.tld,C),je(k,n.utld,C),je(C,n.domain,l),je(C,i,s),le(C,wr,k),le(C,zi,x),le(C,pl,h);const A=le(C,Sl),P=Ni(Kd);je(A,n.numeric,P);const E=Ni(Kd),D=Ni();je(E,e,E),je(E,t,D),je(D,e,E),je(D,t,D),le(C,Tr,E),le(P,Tr,E);const $=le(o,Sl),H=le(c,Sl),W=le(H,Tr),te=le(W,Tr);je(o,n.domain,l),le(o,wr,k),le(o,zi,x),je(c,n.domain,l),le(c,wr,k),le(c,zi,x),je($,n.domain,E),le($,Tr,E),le($,hh,E),je(te,n.domain,E),je(te,e,E),le(te,Tr,E);const ae=[[ah,ch],[cm,um],[hm,fm],[dm,pm],[mm,gm],[Om,ym],[bm,Sm],[vm,xm]];for(let re=0;re<ae.length;re++){const[ce,se]=ae[re],z=le(E,ce);le(D,ce,z),le(z,se,E);const B=Ni(Kd);je(z,e,B);const K=Ni();je(z,t),je(B,e,B),je(B,t,K),je(K,e,B),je(K,t,K),le(B,se,E),le(K,se,E)}return le(r,Nh,C),le(r,Bv,FY),{start:r,tokens:TD}}function JY(n,e,t){let i=t.length,r=0,s=[],l=[];for(;r<i;){let o=n,c=null,h=null,d=0,p=null,g=-1;for(;r<i&&!(c=o.go(t[r].t));)l.push(t[r++]);for(;r<i&&(h=c||o.go(t[r].t));)c=null,o=h,o.accepts()?(g=0,p=o):g>=0&&g++,r++,d++;if(g<0)r-=d,r<i&&(l.push(t[r]),r++);else{l.length>0&&(s.push(sb(uQ,e,l)),l=[]),r-=g,d-=g;const O=p.t,b=t.slice(r-d,r);s.push(sb(O,e,b))}}return l.length>0&&s.push(sb(uQ,e,l)),s}function sb(n,e,t){const i=t[0].s,r=t[t.length-1].e,s=e.slice(i,r);return new n(s,t)}const eU=typeof console<"u"&&console&&console.warn||(()=>{}),tU="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Tt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function nU(){return Un.groups={},Tt.scanner=null,Tt.parser=null,Tt.tokenQueue=[],Tt.pluginQueue=[],Tt.customSchemes=[],Tt.initialized=!1,Tt}function hQ(n,e=!1){if(Tt.initialized&&eU(`linkifyjs: already initialized - will not register custom scheme "${n}" ${tU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
193
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
194
|
+
2. Cannot start or end with "-"
|
|
195
|
+
3. "-" cannot repeat`);Tt.customSchemes.push([n,e])}function iU(){Tt.scanner=WY(Tt.customSchemes);for(let n=0;n<Tt.tokenQueue.length;n++)Tt.tokenQueue[n][1]({scanner:Tt.scanner});Tt.parser=KY(Tt.scanner.tokens);for(let n=0;n<Tt.pluginQueue.length;n++)Tt.pluginQueue[n][1]({scanner:Tt.scanner,parser:Tt.parser});return Tt.initialized=!0,Tt}function qv(n){return Tt.initialized||iU(),JY(Tt.parser.start,n,CD(Tt.scanner.start,n))}qv.scan=CD;function MD(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const i=new Vv(t),r=qv(n),s=[];for(let l=0;l<r.length;l++){const o=r[l];o.isLink&&(!e||o.t===e)&&i.check(o)&&s.push(o.toFormattedObject(i))}return s}var Hv="[\0- -\u2029 ]",rU=new RegExp(Hv),sU=new RegExp(`${Hv}$`),lU=new RegExp(Hv,"g");function oU(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function aU(n){return new bt({key:new At("autolink"),appendTransaction:(e,t,i)=>{const r=e.some(h=>h.docChanged)&&!t.doc.eq(i.doc),s=e.some(h=>h.getMeta("preventAutolink"));if(!r||s)return;const{tr:l}=i,o=nP(t.doc,[...e]);if(uP(o).forEach(({newRange:h})=>{const d=t4(i.doc,h,O=>O.isTextblock);let p,g;if(d.length>1)p=d[0],g=i.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(d.length){const O=i.doc.textBetween(h.from,h.to," "," ");if(!sU.test(O))return;p=d[0],g=i.doc.textBetween(p.pos,h.to,void 0," ")}if(p&&g){const O=g.split(rU).filter(Boolean);if(O.length<=0)return!1;const b=O[O.length-1],v=p.pos+g.lastIndexOf(b);if(!b)return!1;const x=qv(b).map(k=>k.toObject(n.defaultProtocol));if(!oU(x))return!1;x.filter(k=>k.isLink).map(k=>({...k,from:v+k.start+1,to:v+k.end+1})).filter(k=>i.schema.marks.code?!i.doc.rangeHasMark(k.from,k.to,i.schema.marks.code):!0).filter(k=>n.validate(k.value)).filter(k=>n.shouldAutoLink(k.value)).forEach(k=>{Tv(k.from,k.to,i.doc).some(C=>C.mark.type===n.type)||l.addMark(k.from,k.to,n.type.create({href:k.href}))})}}),!!l.steps.length)return l}})}function cU(n){return new bt({key:new At("handleClickLink"),props:{handleClick:(e,t,i)=>{var r,s;if(i.button!==0||!e.editable)return!1;let l=null;if(i.target instanceof HTMLAnchorElement)l=i.target;else{const c=i.target;if(!c)return!1;const h=n.editor.view.dom;l=c.closest("a"),l&&!h.contains(l)&&(l=null)}if(!l)return!1;let o=!1;if(n.enableClickSelection&&(o=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){const c=cP(e.state,n.type.name),h=(r=l.href)!=null?r:c.href,d=(s=l.target)!=null?s:c.target;h&&(window.open(h,d),o=!0)}return o}}})}function uU(n){return new bt({key:new At("handlePasteLink"),props:{handlePaste:(e,t,i)=>{const{shouldAutoLink:r}=n,{state:s}=e,{selection:l}=s,{empty:o}=l;if(o)return!1;let c="";i.content.forEach(d=>{c+=d.textContent});const h=MD(c,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===c);return!c||!h||r!==void 0&&!r(h.value)?!1:n.editor.commands.setMark(n.type,{href:h.href})}}})}function co(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(i=>{const r=typeof i=="string"?i:i.scheme;r&&t.push(r)}),!n||n.replace(lU,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var QD=Vo.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){hQ(n);return}hQ(n.scheme,n.optionalSlashes)})},onDestroy(){nU()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!co(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const r=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!co(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!co(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Ct(this.options.HTMLAttributes,n),0]:["a",Ct(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,i,r,s;const l=(i=(t=n.attrs)==null?void 0:t.href)!=null?i:"",o=(s=(r=n.attrs)==null?void 0:r.title)!=null?s:"",c=e.renderChildren(n);return o?`[${c}](${l} "${o}")`:`[${c}](${l})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:i=>!!co(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:i=>!!co(i,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[No({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:i}=this.options,r=MD(n).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:l=>!!co(l,t),protocols:t,defaultProtocol:i}));r.length&&r.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(aU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:r=>!!co(r,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(cU({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(uU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),hU=Object.defineProperty,fU=(n,e)=>{for(var t in e)hU(n,t,{get:e[t],enumerable:!0})},dU="listItem",fQ="textStyle",dQ=/^\s*([-+*])\s$/,ED=ln.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:n}){return["ul",Ct(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
196
|
+
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dU,this.editor.getAttributes(fQ)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=uc({find:dQ,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=uc({find:dQ,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fQ),editor:this.editor})),[n]}});function pU(n){var e,t;const i=(e=n.tokens)==null?void 0:e[0];return!!(n.text&&((t=n.tokens)==null?void 0:t.length)===1&&(i==null?void 0:i.type)==="list"&&i.ordered&&i.raw===n.text)}function mU(n,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(n)):e.parseInline([{type:"text",raw:n,text:n}])}var $D=ln.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ct(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,e)=>{var t;if(n.type!=="list_item")return[];const i=(t=e.parseBlockChildren)!=null?t:e.parseChildren;let r=[];if(n.tokens&&n.tokens.length>0){if(pU(n))return{type:"listItem",content:[{type:"paragraph",content:mU(n.text||"",e)}]};if(n.tokens.some(l=>l.type==="paragraph"))r=i(n.tokens);else{const l=n.tokens[0];if(l&&l.type==="text"&&l.tokens&&l.tokens.length>0){if(r=[{type:"paragraph",content:e.parseInline(l.tokens)}],n.tokens.length>1){const c=n.tokens.slice(1),h=i(c);r.push(...h)}}else r=i(n.tokens)}}return r.length===0&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:r}},renderMarkdown:(n,e,t)=>Qv(n,e,i=>{var r,s;return i.parentType==="bulletList"?"- ":i.parentType==="orderedList"?`${(((s=(r=i.meta)==null?void 0:r.parentAttrs)==null?void 0:s.start)||1)+i.index}. `:"- "},t),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),gU={};fU(gU,{findListItemPos:()=>ff,getNextListDepth:()=>Yv,handleBackspace:()=>X1,handleDelete:()=>I1,hasListBefore:()=>RD,hasListItemAfter:()=>OU,hasListItemBefore:()=>PD,listItemHasSubList:()=>DD,nextListIsDeeper:()=>ND,nextListIsHigher:()=>zD});var ff=(n,e)=>{const{$from:t}=e.selection,i=Ut(n,e.schema);let r=null,s=t.depth,l=t.pos,o=null;for(;s>0&&o===null;)r=t.node(s),r.type===i?o=s:(s-=1,l-=1);return o===null?null:{$pos:e.doc.resolve(l),depth:o}},Yv=(n,e)=>{const t=ff(n,e);if(!t)return!1;const[,i]=u4(e,n,t.$pos.pos+4);return i},RD=(n,e,t)=>{const{$anchor:i}=n.selection,r=Math.max(0,i.pos-2),s=n.doc.resolve(r).node();return!(!s||!t.includes(s.type.name))},PD=(n,e)=>{var t;const{$anchor:i}=e.selection,r=e.doc.resolve(i.pos-2);return!(r.index()===0||((t=r.nodeBefore)==null?void 0:t.type.name)!==n)},DD=(n,e,t)=>{if(!t)return!1;const i=Ut(n,e.schema);let r=!1;return t.descendants(s=>{s.type===i&&(r=!0)}),r},X1=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!Rl(n.state,e)&&RD(n.state,e,t)){const{$anchor:o}=n.state.selection,c=n.state.doc.resolve(o.before()-1),h=[];c.node().descendants((g,O)=>{g.type.name===e&&h.push({node:g,pos:O})});const d=h.at(-1);if(!d)return!1;const p=n.state.doc.resolve(c.start()+d.pos+1);return n.chain().cut({from:o.start()-1,to:o.end()+1},p.end()).joinForward().run()}if(!Rl(n.state,e)||!p4(n.state))return!1;const i=ff(e,n.state);if(!i)return!1;const s=n.state.doc.resolve(i.$pos.pos-2).node(i.depth),l=DD(e,n.state,s);return PD(e,n.state)&&!l?n.commands.joinItemBackward():n.chain().liftListItem(e).run()},ND=(n,e)=>{const t=Yv(n,e),i=ff(n,e);return!i||!t?!1:t>i.depth},zD=(n,e)=>{const t=Yv(n,e),i=ff(n,e);return!i||!t?!1:t<i.depth},I1=(n,e)=>{if(!Rl(n.state,e)||!d4(n.state,e))return!1;const{selection:t}=n.state,{$from:i,$to:r}=t;return!t.empty&&i.sameParent(r)?!1:ND(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():zD(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},OU=(n,e)=>{var t;const{$anchor:i}=e.selection,r=e.doc.resolve(i.pos-i.parentOffset-2);return!(r.index()===r.parent.childCount-1||((t=r.nodeAfter)==null?void 0:t.type.name)!==n)},LD=Et.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&I1(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&I1(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:i})=>{n.state.schema.nodes[t]!==void 0&&X1(n,t,i)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:i})=>{n.state.schema.nodes[t]!==void 0&&X1(n,t,i)&&(e=!0)}),e}}}}),pQ=/^(\s*)(\d+)\.\s+(.*)$/,yU=/^\s/;function bU(n){const e=n.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function SU(n){const e=[],t=[];let i=!1;return n.forEach(r=>{if(i){t.push(r);return}if(r.trim()===""){i=!0,t.push(r);return}if(e.length>0&&bU(r)){i=!0,t.push(r);return}e.push(r)}),{paragraphLines:e,blockLines:t}}function vU(n){const e=[];let t=0,i=0;for(;t<n.length;){const r=n[t],s=r.match(pQ);if(!s)break;const[,l,o,c]=s,h=l.length,d=[c];let p=t+1;const g=[r];let O=!1;for(;p<n.length;){const b=n[p];if(b.match(pQ))break;if(b.trim()==="")g.push(b),d.push(""),O=!0,p+=1;else if(b.match(yU))g.push(b),d.push(b.slice(h+2)),p+=1;else{if(O)break;g.push(b),d.push(b),p+=1}}e.push({indent:h,number:parseInt(o,10),content:d.join(`
|
|
197
|
+
`).trim(),contentLines:d,raw:g.join(`
|
|
198
|
+
`)}),i=p,t=p}return[e,i]}function _D(n,e,t){const i=[];let r=0;for(;r<n.length;){const s=n[r];if(s.indent===e){const{paragraphLines:l,blockLines:o}=SU(s.contentLines),c=l.join(`
|
|
199
|
+
`).trim(),h=[];c&&h.push({type:"paragraph",raw:c,tokens:t.inlineTokens(c)});const d=o.join(`
|
|
200
|
+
`).trim();if(d){const O=t.blockTokens(d);h.push(...O)}let p=r+1;const g=[];for(;p<n.length&&n[p].indent>e;)g.push(n[p]),p+=1;if(g.length>0){const O=Math.min(...g.map(v=>v.indent)),b=_D(g,O,t);h.push({type:"list",ordered:!0,start:g[0].number,items:b,raw:g.map(v=>v.raw).join(`
|
|
201
|
+
`)})}i.push({type:"list_item",raw:s.raw,tokens:h}),r=p}else r+=1}return i}function xU(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const i=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(r=>{if(r.type==="paragraph"||r.type==="list"||r.type==="blockquote"||r.type==="code")i.push(...e.parseChildren([r]));else if(r.type==="text"&&r.tokens){const s=e.parseChildren([r]);i.push({type:"paragraph",content:s})}else{const s=e.parseChildren([r]);s.length>0&&i.push(...s)}}),{type:"listItem",content:i}})}var kU="listItem",mQ="textStyle",gQ=/^(\d+)\.\s$/,BD=ln.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:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Ct(this.options.HTMLAttributes,t),0]:["ol",Ct(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,i=n.items?xU(n.items,e):[];return t!==1?{type:"orderedList",attrs:{start:t},content:i}:{type:"orderedList",content:i}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
202
|
+
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:n=>{const e=n.match(/^(\s*)(\d+)\.\s+/),t=e==null?void 0:e.index;return t!==void 0?t:-1},tokenize:(n,e,t)=>{var i;const r=n.split(`
|
|
203
|
+
`),[s,l]=vU(r);if(s.length===0)return;const o=_D(s,0,t);return o.length===0?void 0:{type:"list",ordered:!0,start:((i=s[0])==null?void 0:i.number)||1,items:o,raw:r.slice(0,l).join(`
|
|
204
|
+
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(kU,this.editor.getAttributes(mQ)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=uc({find:gQ,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)&&(n=uc({find:gQ,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(mQ)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),wU=/^\s*(\[([( |x])?\])\s$/,ZD=ln.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",Ct(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const i=e.parseChildren(n.nestedTokens);t.push(...i)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const r=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return Qv(n,e,r)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:i})=>{const r=document.createElement("li"),s=document.createElement("label"),l=document.createElement("span"),o=document.createElement("input"),c=document.createElement("div"),h=p=>{var g,O;o.ariaLabel=((O=(g=this.options.a11y)==null?void 0:g.checkboxLabel)==null?void 0:O.call(g,p,o.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};h(n),s.contentEditable="false",o.type="checkbox",o.addEventListener("mousedown",p=>p.preventDefault()),o.addEventListener("change",p=>{if(!i.isEditable&&!this.options.onReadOnlyChecked){o.checked=!o.checked;return}const{checked:g}=p.target;i.isEditable&&typeof t=="function"&&i.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:O})=>{const b=t();if(typeof b!="number")return!1;const v=O.doc.nodeAt(b);return O.setNodeMarkup(b,void 0,{...v==null?void 0:v.attrs,checked:g}),!0}).run(),!i.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,g)||(o.checked=!o.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,g])=>{r.setAttribute(p,g)}),r.dataset.checked=n.attrs.checked,o.checked=n.attrs.checked,s.append(o,l),r.append(s,c),Object.entries(e).forEach(([p,g])=>{r.setAttribute(p,g)});let d=new Set(Object.keys(e));return{dom:r,contentDOM:c,update:p=>{if(p.type!==this.type)return!1;r.dataset.checked=p.attrs.checked,o.checked=p.attrs.checked,h(p);const g=i.extensionManager.attributes,O=Rh(p,g),b=new Set(Object.keys(O)),v=this.options.HTMLAttributes;return d.forEach(x=>{b.has(x)||(x in v?r.setAttribute(x,v[x]):r.removeAttribute(x))}),Object.entries(O).forEach(([x,k])=>{k==null?x in v?r.setAttribute(x,v[x]):r.removeAttribute(x):r.setAttribute(x,k)}),d=b,!0}}}},addInputRules(){return[uc({find:wU,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),jD=ln.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",Ct(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,`
|
|
205
|
+
`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const i=s=>{const l=w1(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:o=>({indentLevel:o[1].length,mainContent:o[4],checked:o[3].toLowerCase()==="x"}),createToken:(o,c)=>({type:"taskItem",raw:"",mainContent:o.mainContent,indentLevel:o.indentLevel,checked:o.checked,text:o.mainContent,tokens:t.inlineTokens(o.mainContent),nestedTokens:c}),customNestedParser:i},t);return l?[{type:"taskList",raw:l.raw,items:l.items}]:t.blockTokens(s)},r=w1(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,l)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:t.inlineTokens(s.mainContent),nestedTokens:l}),customNestedParser:i},t);if(r)return{type:"taskList",raw:r.raw,items:r.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Et.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(ED.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push($D.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(LD.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(BD.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(ZD.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(jD.configure(this.options.taskList)),n}});var Jd=" ",lb=" ",TU=ln.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ct(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const i=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Jd||t[0].text===Jd||t[0].raw===lb||t[0].text===lb)&&i.length===1&&i[0].type==="text"&&(i[0].text===Jd||i[0].text===lb)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,i)},renderMarkdown:(n,e,t)=>{var i,r;if(!n)return"";const s=Array.isArray(n.content)?n.content:[];if(s.length===0){const l=Array.isArray((i=t==null?void 0:t.previousNode)==null?void 0:i.content)?t.previousNode.content:[];return((r=t==null?void 0:t.previousNode)==null?void 0:r.type)==="paragraph"&&l.length===0?Jd:""}return e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),CU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,AU=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,MU=Vo.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Ct(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[cc({find:CU,type:this.type})]},addPasteRules(){return[No({find:AU,type:this.type})]}}),QU=ln.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),EU=Vo.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",Ct(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!r)return;const s=r[2].trim();return{type:"underline",raw:r[0],text:s,tokens:t.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function $U(n={}){return new bt({view(e){return new RU(e,n)}})}class RU{constructor(e,t){var i;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(i=t.width)!==null&&i!==void 0?i:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let s=l=>{this[r](l)};return e.dom.addEventListener(r,s),{name:r,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,i,r=this.editorView.dom,s=r.getBoundingClientRect(),l=s.width/r.offsetWidth,o=s.height/r.offsetHeight;if(t){let p=e.nodeBefore,g=e.nodeAfter;if(p||g){let O=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(O){let b=O.getBoundingClientRect(),v=p?b.bottom:b.top;p&&g&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let x=this.width/2*o;i={left:b.left,right:b.right,top:v-x,bottom:v+x}}}}if(!i){let p=this.editorView.coordsAtPos(this.cursorPos),g=this.width/2*l;i={left:p.left-g,right:p.left+g,top:p.top,bottom:p.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.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 h,d;if(!c||c==document.body&&getComputedStyle(c).position=="static")h=-pageXOffset,d=-pageYOffset;else{let p=c.getBoundingClientRect(),g=p.width/c.offsetWidth,O=p.height/c.offsetHeight;h=p.left-c.scrollLeft*g,d=p.top-c.scrollTop*O}this.element.style.left=(i.left-h)/l+"px",this.element.style.top=(i.top-d)/o+"px",this.element.style.width=(i.right-i.left)/l+"px",this.element.style.height=(i.bottom-i.top)/o+"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}),i=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=i&&i.type.spec.disableDropCursor,s=typeof r=="function"?r(this.editorView,t,e):r;if(t&&!s){let l=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let o=HR(this.editorView.state.doc,l,this.editorView.dragging.slice);o!=null&&(l=o)}this.setCursor(l),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Dt extends Pe{constructor(e){super(e,e)}map(e,t){let i=e.resolve(t.map(this.head));return Dt.valid(i)?new Dt(i):Pe.near(i)}content(){return pe.empty}eq(e){return e instanceof Dt&&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 Dt(e.resolve(t.pos))}getBookmark(){return new Uv(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!PU(e)||!DU(e))return!1;let i=t.type.spec.allowGapCursor;if(i!=null)return i;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,i=!1){e:for(;;){if(!i&&Dt.valid(e))return e;let r=e.pos,s=null;for(let l=e.depth;;l--){let o=e.node(l);if(t>0?e.indexAfter(l)<o.childCount:e.index(l)>0){s=o.child(t>0?e.indexAfter(l):e.index(l)-1);break}else if(l==0)return null;r+=t;let c=e.doc.resolve(r);if(Dt.valid(c))return c}for(;;){let l=t>0?s.firstChild:s.lastChild;if(!l){if(s.isAtom&&!s.isText&&!Te.isSelectable(s)){e=e.doc.resolve(r+s.nodeSize*t),i=!1;continue e}break}s=l,r+=t;let o=e.doc.resolve(r);if(Dt.valid(o))return o}return null}}}Dt.prototype.visible=!1;Dt.findFrom=Dt.findGapCursorFrom;Pe.jsonID("gapcursor",Dt);class Uv{constructor(e){this.pos=e}map(e){return new Uv(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Dt.valid(t)?new Dt(t):Pe.near(t)}}function XD(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function PU(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),i=n.node(e);if(t==0){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(t-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||XD(r.type))return!0;if(r.inlineContent)return!1}}return!0}function DU(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),i=n.node(e);if(t==i.childCount){if(i.type.spec.isolating)return!0;continue}for(let r=i.child(t);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||XD(r.type))return!0;if(r.inlineContent)return!1}}return!0}function NU(){return new bt({props:{decorations:BU,createSelectionBetween(n,e,t){return e.pos==t.pos&&Dt.valid(t)?new Dt(t):null},handleClick:LU,handleKeyDown:zU,handleDOMEvents:{beforeinput:_U}}})}const zU=Ov({ArrowLeft:ep("horiz",-1),ArrowRight:ep("horiz",1),ArrowUp:ep("vert",-1),ArrowDown:ep("vert",1)});function ep(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(i,r,s){let l=i.selection,o=e>0?l.$to:l.$from,c=l.empty;if(l instanceof Ae){if(!s.endOfTextblock(t)||o.depth==0)return!1;c=!1,o=i.doc.resolve(e>0?o.after():o.before())}let h=Dt.findGapCursorFrom(o,e,c);return h?(r&&r(i.tr.setSelection(new Dt(h))),!0):!1}}function LU(n,e,t){if(!n||!n.editable)return!1;let i=n.state.doc.resolve(e);if(!Dt.valid(i))return!1;let r=n.posAtCoords({left:t.clientX,top:t.clientY});return r&&r.inside>-1&&Te.isSelectable(n.state.doc.nodeAt(r.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Dt(i))),!0)}function _U(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Dt))return!1;let{$from:t}=n.state.selection,i=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!i)return!1;let r=ne.empty;for(let l=i.length-1;l>=0;l--)r=ne.from(i[l].createAndFill(null,r));let s=n.state.tr.replace(t.pos,t.pos,new pe(r,0,0));return s.setSelection(Ae.near(s.doc.resolve(t.pos+1))),n.dispatch(s),!1}function BU(n){if(!(n.selection instanceof Dt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",vt.create(n.doc,[ki.widget(n.selection.head,e,{key:"gapcursor"})])}var zm=200,sn=function(){};sn.prototype.append=function(e){return e.length?(e=sn.from(e),!this.length&&e||e.length<zm&&this.leafAppend(e)||this.length<zm&&e.leafPrepend(this)||this.appendInner(e)):this};sn.prototype.prepend=function(e){return e.length?sn.from(e).append(this):this};sn.prototype.appendInner=function(e){return new ZU(this,e)};sn.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?sn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};sn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};sn.prototype.forEach=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length),t<=i?this.forEachInner(e,t,i,0):this.forEachInvertedInner(e,t,i,0)};sn.prototype.map=function(e,t,i){t===void 0&&(t=0),i===void 0&&(i=this.length);var r=[];return this.forEach(function(s,l){return r.push(e(s,l))},t,i),r};sn.from=function(e){return e instanceof sn?e:e&&e.length?new ID(e):sn.empty};var ID=(function(n){function e(i){n.call(this),this.values=i}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.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(r,s){return r==0&&s==this.length?this:new e(this.values.slice(r,s))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,s,l,o){for(var c=s;c<l;c++)if(r(this.values[c],o+c)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,l,o){for(var c=s-1;c>=l;c--)if(r(this.values[c],o+c)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=zm)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=zm)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e})(sn);sn.empty=new ID([]);var ZU=(function(n){function e(t,i){n.call(this),this.left=t,this.right=i,this.length=t.length+i.length,this.depth=Math.max(t.depth,i.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(i){return i<this.left.length?this.left.get(i):this.right.get(i-this.left.length)},e.prototype.forEachInner=function(i,r,s,l){var o=this.left.length;if(r<o&&this.left.forEachInner(i,r,Math.min(s,o),l)===!1||s>o&&this.right.forEachInner(i,Math.max(r-o,0),Math.min(this.length,s)-o,l+o)===!1)return!1},e.prototype.forEachInvertedInner=function(i,r,s,l){var o=this.left.length;if(r>o&&this.right.forEachInvertedInner(i,r-o,Math.max(s,o)-o,l+o)===!1||s<o&&this.left.forEachInvertedInner(i,Math.min(r,o),s,l)===!1)return!1},e.prototype.sliceInner=function(i,r){if(i==0&&r==this.length)return this;var s=this.left.length;return r<=s?this.left.slice(i,r):i>=s?this.right.slice(i-s,r-s):this.left.slice(i,s).append(this.right.slice(0,r-s))},e.prototype.leafAppend=function(i){var r=this.right.leafAppend(i);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(i){var r=this.left.leafPrepend(i);if(r)return new e(r,this.right)},e.prototype.appendInner=function(i){return this.left.depth>=Math.max(this.right.depth,i.depth)+1?new e(this.left,new e(this.right,i)):new e(this,i)},e})(sn);const jU=500;class er{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}let r,s;t&&(r=this.remapping(i,this.items.length),s=r.maps.length);let l=e.tr,o,c,h=[],d=[];return this.items.forEach((p,g)=>{if(!p.step){r||(r=this.remapping(i,g+1),s=r.maps.length),s--,d.push(p);return}if(r){d.push(new Cr(p.map));let O=p.step.map(r.slice(s)),b;O&&l.maybeStep(O).doc&&(b=l.mapping.maps[l.mapping.maps.length-1],h.push(new Cr(b,void 0,void 0,h.length+d.length))),s--,b&&r.appendMap(b,s)}else l.maybeStep(p.step);if(p.selection)return o=r?p.selection.map(r.slice(s)):p.selection,c=new er(this.items.slice(0,i).append(d.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:l,selection:o}}addTransform(e,t,i,r){let s=[],l=this.eventCount,o=this.items,c=!r&&o.length?o.get(o.length-1):null;for(let d=0;d<e.steps.length;d++){let p=e.steps[d].invert(e.docs[d]),g=new Cr(e.mapping.maps[d],p,t),O;(O=c&&c.merge(g))&&(g=O,d?s.pop():o=o.slice(0,o.length-1)),s.push(g),t&&(l++,t=void 0),r||(c=g)}let h=l-i.depth;return h>IU&&(o=XU(o,h),l-=h),new er(o.append(s),l)}remapping(e,t){let i=new Th;return this.items.forEach((r,s)=>{let l=r.mirrorOffset!=null&&s-r.mirrorOffset>=e?i.maps.length-r.mirrorOffset:void 0;i.appendMap(r.map,l)},e,t),i}addMaps(e){return this.eventCount==0?this:new er(this.items.append(e.map(t=>new Cr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let i=[],r=Math.max(0,this.items.length-t),s=e.mapping,l=e.steps.length,o=this.eventCount;this.items.forEach(g=>{g.selection&&o--},r);let c=t;this.items.forEach(g=>{let O=s.getMirror(--c);if(O==null)return;l=Math.min(l,O);let b=s.maps[O];if(g.step){let v=e.steps[O].invert(e.docs[O]),x=g.selection&&g.selection.map(s.slice(c+1,O));x&&o++,i.push(new Cr(b,v,x))}else i.push(new Cr(b))},r);let h=[];for(let g=t;g<l;g++)h.push(new Cr(s.maps[g]));let d=this.items.slice(0,r).append(h).append(i),p=new er(d,o);return p.emptyItemCount()>jU&&(p=p.compress(this.items.length-i.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),i=t.maps.length,r=[],s=0;return this.items.forEach((l,o)=>{if(o>=e)r.push(l),l.selection&&s++;else if(l.step){let c=l.step.map(t.slice(i)),h=c&&c.getMap();if(i--,h&&t.appendMap(h,i),c){let d=l.selection&&l.selection.map(t.slice(i));d&&s++;let p=new Cr(h.invert(),c,d),g,O=r.length-1;(g=r.length&&r[O].merge(p))?r[O]=g:r.push(p)}}else l.map&&i--},this.items.length,0),new er(sn.from(r.reverse()),s)}}er.empty=new er(sn.empty,0);function XU(n,e){let t;return n.forEach((i,r)=>{if(i.selection&&e--==0)return t=r,!1}),n.slice(t)}class Cr{constructor(e,t,i,r){this.map=e,this.step=t,this.selection=i,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Cr(t.getMap().invert(),t,this.selection)}}}let ml=class{constructor(e,t,i,r,s){this.done=e,this.undone=t,this.prevRanges=i,this.prevTime=r,this.prevComposition=s}};const IU=20;function VU(n,e,t,i){let r=t.getMeta(Mo),s;if(r)return r.historyState;t.getMeta(YU)&&(n=new ml(n.done,n.undone,null,0,-1));let l=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(l&&l.getMeta(Mo))return l.getMeta(Mo).redo?new ml(n.done.addTransform(t,void 0,i,Dp(e)),n.undone,OQ(t.mapping.maps),n.prevTime,n.prevComposition):new ml(n.done,n.undone.addTransform(t,void 0,i,Dp(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let o=t.getMeta("composition"),c=n.prevTime==0||!l&&n.prevComposition!=o&&(n.prevTime<(t.time||0)-i.newGroupDelay||!qU(t,n.prevRanges)),h=l?ob(n.prevRanges,t.mapping):OQ(t.mapping.maps);return new ml(n.done.addTransform(t,c?e.selection.getBookmark():void 0,i,Dp(e)),er.empty,h,t.time,o??n.prevComposition)}else return(s=t.getMeta("rebased"))?new ml(n.done.rebased(t,s),n.undone.rebased(t,s),ob(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new ml(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),ob(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function qU(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((i,r)=>{for(let s=0;s<e.length;s+=2)i<=e[s+1]&&r>=e[s]&&(t=!0)}),t}function OQ(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((i,r,s,l)=>e.push(s,l));return e}function ob(n,e){if(!n)return null;let t=[];for(let i=0;i<n.length;i+=2){let r=e.map(n[i],1),s=e.map(n[i+1],-1);r<=s&&t.push(r,s)}return t}function HU(n,e,t){let i=Dp(e),r=Mo.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,i);if(!s)return null;let l=s.selection.resolve(s.transform.doc),o=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),r,i),c=new ml(t?o:s.remaining,t?s.remaining:o,null,0,-1);return s.transform.setSelection(l).setMeta(Mo,{redo:t,historyState:c})}let ab=!1,yQ=null;function Dp(n){let e=n.plugins;if(yQ!=e){ab=!1,yQ=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){ab=!0;break}}return ab}const Mo=new At("history"),YU=new At("closeHistory");function UU(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new bt({key:Mo,state:{init(){return new ml(er.empty,er.empty,null,0,-1)},apply(e,t,i){return VU(t,i,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let i=t.inputType,r=i=="historyUndo"?qD:i=="historyRedo"?HD:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function VD(n,e){return(t,i)=>{let r=Mo.getState(t);if(!r||(n?r.undone:r.done).eventCount==0)return!1;if(i){let s=HU(r,t,n);s&&i(e?s.scrollIntoView():s)}return!0}}const qD=VD(!1,!0),HD=VD(!0,!0);Et.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const i=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(i)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new bt({key:new At("characterCount"),appendTransaction:(e,t,i)=>{if(n)return;const r=this.options.limit;if(r==null||r===0){n=!0;return}const s=this.storage.characters({node:i.doc});if(s>r){const l=s-r,o=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const h=i.tr.deleteRange(o,c);return n=!0,h}n=!0},filterTransaction:(e,t)=>{const i=this.options.limit;if(!e.docChanged||i===0||i===null||i===void 0)return!0;const r=this.storage.characters({node:t.doc}),s=this.storage.characters({node:e.doc});if(s<=i||r>i&&s>i&&s<=r)return!0;if(r>i&&s>i&&s>r||!e.getMeta("paste"))return!1;const o=e.selection.$head.pos,c=s-i,h=o-c,d=o;return e.deleteRange(h,d),!(this.storage.characters({node:e.doc})>i)}})]}});var WU=Et.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[$U(this.options)]}});Et.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new bt({key:new At("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:i}=this.editor,{anchor:r}=e,s=[];if(!t||!i)return vt.create(n,[]);let l=0;this.options.mode==="deepest"&&n.descendants((c,h)=>{if(c.isText)return;if(!(r>=h&&r<=h+c.nodeSize-1))return!1;l+=1});let o=0;return n.descendants((c,h)=>{if(c.isText||!(r>=h&&r<=h+c.nodeSize-1))return!1;if(o+=1,this.options.mode==="deepest"&&l-o>0||this.options.mode==="shallowest"&&o>1)return this.options.mode==="deepest";s.push(ki.node(h,h+c.nodeSize,{class:this.options.className}))}),vt.create(n,s)}}})]}});var GU=Et.create({name:"gapCursor",addProseMirrorPlugins(){return[NU()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=tt(ke(n,"allowGapCursor",t)))!=null?e:null}}}),bQ="placeholder";function FU(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var KU=Et.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:bQ,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const n=this.options.dataAttribute?`data-${FU(this.options.dataAttribute)}`:`data-${bQ}`;return[new bt({key:new At("placeholder"),props:{decorations:({doc:e,selection:t})=>{const i=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,s=[];if(!i)return null;const l=this.editor.isEmpty;return e.descendants((o,c)=>{const h=r>=c&&r<=c+o.nodeSize,d=!o.isLeaf&&Pg(o);if(!o.type.isTextblock)return this.options.includeChildren;if((h||!this.options.showOnlyCurrent)&&d){const p=[this.options.emptyNodeClass];l&&p.push(this.options.emptyEditorClass);const g=ki.node(c,c+o.nodeSize,{class:p.join(" "),[n]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:c,hasAnchor:h}):this.options.placeholder});s.push(g)}return this.options.includeChildren}),vt.create(e,s)}}})]}});Et.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return[new bt({key:new At("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||hP(t.selection)||n.view.dragging?null:vt.create(t.doc,[ki.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});var JU="skipTrailingNode";function SQ({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var e6=Et.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new At(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",i=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(t).includes(r.name));return[new bt({key:e,appendTransaction:(r,s,l)=>{const{doc:o,tr:c,schema:h}=l,d=e.getState(l),p=o.content.size,g=h.nodes[t];if(!r.some(O=>O.getMeta(JU))&&d)return c.insert(p,g.create())},state:{init:(r,s)=>{const l=s.tr.doc.lastChild;return!SQ({node:l,types:i})},apply:(r,s)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return s;const l=r.doc.lastChild;return!SQ({node:l,types:i})}}})]}}),t6=Et.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>qD(n,e),redo:()=>({state:n,dispatch:e})=>HD(n,e)}},addProseMirrorPlugins(){return[UU(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),n6=Et.create({name:"starterKit",addExtensions(){var n,e,t,i;const r=[];return this.options.bold!==!1&&r.push(TY.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(SY.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(ED.configure(this.options.bulletList)),this.options.code!==!1&&r.push(MY.configure(this.options.code)),this.options.codeBlock!==!1&&r.push($Y.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(RY.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(WU.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(GU.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(PY.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(DY.configure(this.options.heading)),this.options.undoRedo!==!1&&r.push(t6.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&r.push(NY.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(ZY.configure(this.options.italic)),this.options.listItem!==!1&&r.push($D.configure(this.options.listItem)),this.options.listKeymap!==!1&&r.push(LD.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&r.push(QD.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&r.push(BD.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(TU.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(MU.configure(this.options.strike)),this.options.text!==!1&&r.push(QU.configure(this.options.text)),this.options.underline!==!1&&r.push(EU.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&r.push(e6.configure((i=this.options)==null?void 0:i.trailingNode)),r}}),i6=n6,r6=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,s6=ln.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",Ct(this.options.HTMLAttributes,n)]},parseMarkdown:(n,e)=>e.createNode("image",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var e,t,i,r,s,l;const o=(t=(e=n.attrs)==null?void 0:e.src)!=null?t:"",c=(r=(i=n.attrs)==null?void 0:i.alt)!=null?r:"",h=(l=(s=n.attrs)==null?void 0:s.title)!=null?l:"";return h?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:n,minWidth:e,minHeight:t,alwaysPreserveAspectRatio:i}=this.options.resize;return({node:r,getPos:s,HTMLAttributes:l,editor:o})=>{const c=document.createElement("img");Object.entries(l).forEach(([p,g])=>{if(g!=null)switch(p){case"width":case"height":break;default:c.setAttribute(p,g);break}}),c.src=l.src;const h=new tV({element:c,editor:o,node:r,getPos:s,onResize:(p,g)=>{c.style.width=`${p}px`,c.style.height=`${g}px`},onCommit:(p,g)=>{const O=s();O!==void 0&&this.editor.chain().setNodeSelection(O).updateAttributes(this.name,{width:p,height:g}).run()},onUpdate:(p,g,O)=>p.type===r.type,options:{directions:n,min:{width:e,height:t},preserveAspectRatio:i===!0}}),d=h.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",c.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},h}},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[QP({find:r6,type:this.type,getAttributes:n=>{const[,,e,t,i]=n;return{src:t,alt:e,title:i}}})]}});function Lm(n){return n==="left"||n==="right"||n==="center"?n:null}function l6(n){const e=(n.style.textAlign||"").trim().toLowerCase(),t=(n.getAttribute("align")||"").trim().toLowerCase();return Lm(e||t)}function o6(n){return Lm(n==null?void 0:n.align)}function YD(){return{default:null,parseHTML:n=>l6(n),renderHTML:n=>n.align?{style:`text-align: ${n.align}`}:{}}}var UD=ln.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{var e,t;const i=n.getAttribute("colwidth"),r=i?i.split(",").map(s=>parseInt(s,10)):null;if(!r){const s=(e=n.closest("table"))==null?void 0:e.querySelectorAll("colgroup > col"),l=Array.from(((t=n.parentElement)==null?void 0:t.children)||[]).indexOf(n);if(l&&l>-1&&s&&s[l]){const o=s[l].getAttribute("width");return o?[parseInt(o,10)]:null}}return r}},align:YD()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:n}){return["td",Ct(this.options.HTMLAttributes,n),0]}}),WD=ln.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:n=>{const e=n.getAttribute("colwidth");return e?e.split(",").map(i=>parseInt(i,10)):null}},align:YD()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:n}){return["th",Ct(this.options.HTMLAttributes,n),0]}}),GD=ln.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:n}){return["tr",Ct(this.options.HTMLAttributes,n),0]}});function V1(n,e){return e?["width",`${Math.max(e,n)}px`]:["min-width",`${n}px`]}function vQ(n,e,t,i,r,s){var l;let o=0,c=!0,h=e.firstChild;const d=n.firstChild;if(d!==null)for(let g=0,O=0;g<d.childCount;g+=1){const{colspan:b,colwidth:v}=d.child(g).attrs;for(let x=0;x<b;x+=1,O+=1){const k=r===O?s:v&&v[x],C=k?`${k}px`:"";if(o+=k||i,k||(c=!1),h){if(h.style.width!==C){const[A,P]=V1(i,k);h.style.setProperty(A,P)}h=h.nextSibling}else{const A=document.createElement("col"),[P,E]=V1(i,k);A.style.setProperty(P,E),e.appendChild(A)}}}for(;h;){const g=h.nextSibling;(l=h.parentNode)==null||l.removeChild(h),h=g}const p=n.attrs.style&&typeof n.attrs.style=="string"&&/\bwidth\s*:/i.test(n.attrs.style);c&&!p?(t.style.width=`${o}px`,t.style.minWidth=""):(t.style.width="",t.style.minWidth=`${o}px`)}var a6=class{constructor(n,e){this.node=n,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),n.attrs.style&&(this.table.style.cssText=n.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),vQ(n,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(n){return n.type!==this.node.type?!1:(this.node=n,vQ(n,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(n){const e=n.target,t=this.dom.contains(e),i=this.contentDOM.contains(e);return!!(t&&!i&&(n.type==="attributes"||n.type==="childList"||n.type==="characterData"))}};function c6(n,e,t,i){let r=0,s=!0;const l=[],o=n.firstChild;if(!o)return{};for(let p=0,g=0;p<o.childCount;p+=1){const{colspan:O,colwidth:b}=o.child(p).attrs;for(let v=0;v<O;v+=1,g+=1){const x=t===g?i:b&&b[v];r+=x||e,x||(s=!1);const[k,C]=V1(e,x);l.push(["col",{style:`${k}: ${C}`}])}}const c=s?`${r}px`:"",h=s?"":`${r}px`;return{colgroup:["colgroup",{},...l],tableWidth:c,tableMinWidth:h}}function xQ(n,e){return n.createAndFill()}function u6(n){if(n.cached.tableNodeTypes)return n.cached.tableNodeTypes;const e={};return Object.keys(n.nodes).forEach(t=>{const i=n.nodes[t];i.spec.tableRole&&(e[i.spec.tableRole]=i)}),n.cached.tableNodeTypes=e,e}function h6(n,e,t,i,r){const s=u6(n),l=[],o=[];for(let h=0;h<t;h+=1){const d=xQ(s.cell);if(d&&o.push(d),i){const p=xQ(s.header_cell);p&&l.push(p)}}const c=[];for(let h=0;h<e;h+=1)c.push(s.row.createChecked(null,i&&h===0?l:o));return s.table.createChecked(null,c)}function f6(n){return n instanceof Ot}var tp=({editor:n})=>{const{selection:e}=n.state;if(!f6(e))return!1;let t=0;const i=iP(e.ranges[0].$from,s=>s.type.name==="table");return i==null||i.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(t+=1)}),t===e.ranges.length?(n.commands.deleteTable(),!0):!1},d6="";function p6(n){return(n||"").replace(/\s+/g," ").trim()}function m6(n,e,t={}){var i;const r=(i=t.cellLineSeparator)!=null?i:d6;if(!n||!n.content||n.content.length===0)return"";const s=[];n.content.forEach(v=>{const x=[];v.content&&v.content.forEach(k=>{let C="";k.content&&Array.isArray(k.content)&&k.content.length>1?C=k.content.map($=>e.renderChildren($)).join(r):C=k.content?e.renderChildren(k.content):"";const A=p6(C),P=k.type==="tableHeader",E=o6(k.attrs);x.push({text:A,isHeader:P,align:E})}),s.push(x)});const l=s.reduce((v,x)=>Math.max(v,x.length),0);if(l===0)return"";const o=new Array(l).fill(0);s.forEach(v=>{var x;for(let k=0;k<l;k+=1){const A=(((x=v[k])==null?void 0:x.text)||"").length;A>o[k]&&(o[k]=A),o[k]<3&&(o[k]=3)}});const c=(v,x)=>v+" ".repeat(Math.max(0,x-v.length)),h=s[0],d=h.some(v=>v.isHeader),p=new Array(l).fill(null);s.forEach(v=>{var x;for(let k=0;k<l;k+=1)!p[k]&&((x=v[k])!=null&&x.align)&&(p[k]=v[k].align)});let g=`
|
|
206
|
+
`;const O=new Array(l).fill(0).map((v,x)=>d&&h[x]&&h[x].text||"");return g+=`| ${O.map((v,x)=>c(v,o[x])).join(" | ")} |
|
|
207
|
+
`,g+=`| ${o.map((v,x)=>{const k=Math.max(3,v),C=p[x];return C==="left"?`:${"-".repeat(k)}`:C==="right"?`${"-".repeat(k)}:`:C==="center"?`:${"-".repeat(k)}:`:"-".repeat(k)}).join(" | ")} |
|
|
208
|
+
`,(d?s.slice(1):s).forEach(v=>{g+=`| ${new Array(l).fill(0).map((x,k)=>c(v[k]&&v[k].text||"",o[k])).join(" | ")} |
|
|
209
|
+
`}),g}var g6=m6,FD=ln.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:a6,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:n,HTMLAttributes:e}){const{colgroup:t,tableWidth:i,tableMinWidth:r}=c6(n,this.options.cellMinWidth),s=e.style;function l(){return s||(i?`width: ${i}`:`min-width: ${r}`)}const o=["table",Ct(this.options.HTMLAttributes,e,{style:l()}),t,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},o]:o},parseMarkdown:(n,e)=>{const t=[],i=Array.isArray(n.align)?n.align:[];if(n.header){const r=[];n.header.forEach((s,l)=>{var o;const c=Lm((o=i[l])!=null?o:s.align),h=c?{align:c}:{};r.push(e.createNode("tableHeader",h,[{type:"paragraph",content:e.parseInline(s.tokens)}]))}),t.push(e.createNode("tableRow",{},r))}return n.rows&&n.rows.forEach(r=>{const s=[];r.forEach((l,o)=>{var c;const h=Lm((c=i[o])!=null?c:l.align),d=h?{align:h}:{};s.push(e.createNode("tableCell",d,[{type:"paragraph",content:e.parseInline(l.tokens)}]))}),t.push(e.createNode("tableRow",{},s))}),e.createNode("table",void 0,t)},renderMarkdown:(n,e)=>g6(n,e),addCommands(){return{insertTable:({rows:n=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:i,dispatch:r,editor:s})=>{const l=h6(s.schema,n,e,t);if(r){const o=i.selection.from+1;i.replaceSelectionWith(l).scrollIntoView().setSelection(Ae.near(i.doc.resolve(o)))}return!0},addColumnBefore:()=>({state:n,dispatch:e})=>pH(n,e),addColumnAfter:()=>({state:n,dispatch:e})=>mH(n,e),deleteColumn:()=>({state:n,dispatch:e})=>OH(n,e),addRowBefore:()=>({state:n,dispatch:e})=>bH(n,e),addRowAfter:()=>({state:n,dispatch:e})=>SH(n,e),deleteRow:()=>({state:n,dispatch:e})=>xH(n,e),deleteTable:()=>({state:n,dispatch:e})=>QH(n,e),mergeCells:()=>({state:n,dispatch:e})=>YM(n,e),splitCell:()=>({state:n,dispatch:e})=>UM(n,e),toggleHeaderColumn:()=>({state:n,dispatch:e})=>Dh("column")(n,e),toggleHeaderRow:()=>({state:n,dispatch:e})=>Dh("row")(n,e),toggleHeaderCell:()=>({state:n,dispatch:e})=>AH(n,e),mergeOrSplit:()=>({state:n,dispatch:e})=>YM(n,e)?!0:UM(n,e),setCellAttribute:(n,e)=>({state:t,dispatch:i})=>TH(n,e)(t,i),goToNextCell:()=>({state:n,dispatch:e})=>GM(1)(n,e),goToPreviousCell:()=>({state:n,dispatch:e})=>GM(-1)(n,e),fixTables:()=>({state:n,dispatch:e})=>(e&&cD(n),!0),setCellSelection:n=>({tr:e,dispatch:t})=>{if(t){const i=Ot.create(e.doc,n.anchorCell,n.headCell);e.setSelection(i)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:tp,"Mod-Backspace":tp,Delete:tp,"Mod-Delete":tp}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[BH({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],WH({allowTableNodeSelection:this.options.allowTableNodeSelection})]},addNodeView(){const n=this.options.resizable&&this.editor.isEditable,e=this.options.View;return n||!e?null:({node:t,view:i})=>new e(t,this.options.cellMinWidth,i)},extendNodeSchema(n){const e={name:n.name,options:n.options,storage:n.storage};return{tableRole:tt(ke(n,"tableRole",e))}}});Et.create({name:"tableKit",addExtensions(){const n=[];return this.options.table!==!1&&n.push(FD.configure(this.options.table)),this.options.tableCell!==!1&&n.push(UD.configure(this.options.tableCell)),this.options.tableHeader!==!1&&n.push(WD.configure(this.options.tableHeader)),this.options.tableRow!==!1&&n.push(GD.configure(this.options.tableRow)),n}});function q1(){return q1=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},q1.apply(null,arguments)}function O6(n,e){if(n==null)return{};var t={};for(var i in n)if({}.hasOwnProperty.call(n,i)){if(e.indexOf(i)!==-1)continue;t[i]=n[i]}return t}let H1=[],KD=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?KD:H1).push(t=t+n[e])})();function y6(n){if(n<768)return!1;for(let e=0,t=H1.length;;){let i=e+t>>1;if(n<H1[i])t=i;else if(n>=KD[i])e=i+1;else return!0;if(e==t)return!1}}function kQ(n){return n>=127462&&n<=127487}const wQ=8205;function b6(n,e,t=!0,i=!0){return(t?JD:S6)(n,e,i)}function JD(n,e,t){if(e==n.length)return e;e&&eN(n.charCodeAt(e))&&tN(n.charCodeAt(e-1))&&e--;let i=cb(n,e);for(e+=TQ(i);e<n.length;){let r=cb(n,e);if(i==wQ||r==wQ||t&&y6(r))e+=TQ(r),i=r;else if(kQ(r)){let s=0,l=e-2;for(;l>=0&&kQ(cb(n,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function S6(n,e,t){for(;e>0;){let i=JD(n,e-2,t);if(i<e)return i;e--}return 0}function cb(n,e){let t=n.charCodeAt(e);if(!tN(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return eN(i)?(t-55296<<10)+(i-56320)+65536:t}function eN(n){return n>=56320&&n<57344}function tN(n){return n>=55296&&n<56320}function TQ(n){return n<65536?1:2}class Ge{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=dc(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Ar.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=dc(this,e,t);let i=[];return this.decompose(e,t,i,0),Ar.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new dh(this),s=new dh(e);for(let l=t,o=t;;){if(r.next(l),s.next(l),l=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new dh(this,e)}iterRange(e,t=this.length){return new nN(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new iN(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Ge.empty:e.length<=32?new Zt(e):Ar.from(Zt.split(e,[]))}}class Zt extends Ge{constructor(e,t=v6(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.text[s],o=r+l.length;if((t?i:o)>=e)return new x6(r,o,i,l);r=o+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new Zt(CQ(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let l=i.pop(),o=Np(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new Zt(o,l.length+s.length));else{let c=o.length>>1;i.push(new Zt(o.slice(0,c)),new Zt(o.slice(c)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof Zt))return super.replace(e,t,i);[e,t]=dc(this,e,t);let r=Np(this.text,Np(i.text,CQ(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new Zt(r,s):Ar.from(Zt.split(r,[]),s)}sliceString(e,t=this.length,i=`
|
|
210
|
+
`){[e,t]=dc(this,e,t);let r="";for(let s=0,l=0;s<=t&&l<this.text.length;l++){let o=this.text[l],c=s+o.length;s>e&&l&&(r+=i),e<c&&t>s&&(r+=o.slice(Math.max(0,e-s),t-s)),s=c+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new Zt(i,r)),i=[],r=-1);return r>-1&&t.push(new Zt(i,r)),t}}class Ar extends Ge{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.children[s],o=r+l.length,c=i+l.lines-1;if((t?c:o)>=e)return l.lineInner(e,t,i,r);r=o+1,i=c+1}}decompose(e,t,i,r){for(let s=0,l=0;l<=t&&s<this.children.length;s++){let o=this.children[s],c=l+o.length;if(e<=c&&t>=l){let h=r&((l<=e?1:0)|(c>=t?2:0));l>=e&&c<=t&&!h?i.push(o):o.decompose(e-l,t-l,i,h)}l=c+1}}replace(e,t,i){if([e,t]=dc(this,e,t),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let l=this.children[r],o=s+l.length;if(e>=s&&t<=o){let c=l.replace(e-s,t-s,i),h=this.lines-l.lines+c.lines;if(c.lines<h>>4&&c.lines>h>>6){let d=this.children.slice();return d[r]=c,new Ar(d,this.length-(t-e)+i.length)}return super.replace(s,o,c)}s=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
211
|
+
`){[e,t]=dc(this,e,t);let r="";for(let s=0,l=0;s<this.children.length&&l<=t;s++){let o=this.children[s],c=l+o.length;l>e&&s&&(r+=i),e<c&&t>l&&(r+=o.sliceString(e-l,t-l,i)),l=c+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ar))return 0;let i=0,[r,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==l||s==o)return i;let c=this.children[r],h=e.children[s];if(c!=h)return i+c.scanIdentical(h,t);i+=c.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let O of e)i+=O.lines;if(i<32){let O=[];for(let b of e)b.flatten(O);return new Zt(O,t)}let r=Math.max(32,i>>5),s=r<<1,l=r>>1,o=[],c=0,h=-1,d=[];function p(O){let b;if(O.lines>s&&O instanceof Ar)for(let v of O.children)p(v);else O.lines>l&&(c>l||!c)?(g(),o.push(O)):O instanceof Zt&&c&&(b=d[d.length-1])instanceof Zt&&O.lines+b.lines<=32?(c+=O.lines,h+=O.length+1,d[d.length-1]=new Zt(b.text.concat(O.text),b.length+1+O.length)):(c+O.lines>r&&g(),c+=O.lines,h+=O.length+1,d.push(O))}function g(){c!=0&&(o.push(d.length==1?d[0]:Ar.from(d,h)),h=-1,c=d.length=0)}for(let O of e)p(O);return g(),o.length==1?o[0]:new Ar(o,t)}}Ge.empty=new Zt([""],0);function v6(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Np(n,e,t=0,i=1e9){for(let r=0,s=0,l=!0;s<n.length&&r<=i;s++){let o=n[s],c=r+o.length;c>=t&&(c>i&&(o=o.slice(0,i-r)),r<t&&(o=o.slice(t-r)),l?(e[e.length-1]+=o,l=!1):e.push(o)),r=c+1}return e}function CQ(n,e,t){return Np(n,[""],e,t)}class dh{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Zt?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],l=s>>1,o=r instanceof Zt?r.text.length:r.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
212
|
+
`,this;e--}else if(r instanceof Zt){let c=r.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,c.length>Math.max(0,e))return this.value=e==0?c:t>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=r.children[l+(t<0?-1:0)];e>c.length?(e-=c.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(t>0?1:(c instanceof Zt?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class nN{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new dh(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class iN{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ge.prototype[Symbol.iterator]=function(){return this.iter()},dh.prototype[Symbol.iterator]=nN.prototype[Symbol.iterator]=iN.prototype[Symbol.iterator]=function(){return this});let x6=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function dc(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function nn(n,e,t=!0,i=!0){return b6(n,e,t,i)}function k6(n){return n>=56320&&n<57344}function w6(n){return n>=55296&&n<56320}function Wn(n,e){let t=n.charCodeAt(e);if(!w6(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return k6(i)?(t-55296<<10)+(i-56320)+65536:t}function Wv(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Mr(n){return n<65536?1:2}const Y1=/\r\n?|\n/;var gn=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(gn||(gn={}));class zr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let s=this.sections[t++],l=this.sections[t++];l<0?(e(i,r,s),r+=s):r+=l,i+=s}}iterChangedRanges(e,t=!1){U1(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new zr(e)}composeDesc(e){return this.empty?e:e.empty?this:rN(this,e)}mapDesc(e,t=!1){return e.empty?this:W1(this,e,t)}mapPos(e,t=-1,i=gn.Simple){let r=0,s=0;for(let l=0;l<this.sections.length;){let o=this.sections[l++],c=this.sections[l++],h=r+o;if(c<0){if(h>e)return s+(e-r);s+=o}else{if(i!=gn.Simple&&h>=e&&(i==gn.TrackDel&&r<e&&h>e||i==gn.TrackBefore&&r<e||i==gn.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!o)return e==r||t<0?s:s+c;s+=c}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let s=this.sections[i++],l=this.sections[i++],o=r+s;if(l>=0&&r<=t&&o>=e)return r<e&&o>t?"cover":!0;r=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new zr(e)}static create(e){return new zr(e)}}class Ft extends zr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return U1(this,(t,i,r,s,l)=>e=e.replace(r,r+(i-t),l),!1),e}mapDesc(e,t=!1){return W1(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r<t.length;r+=2){let l=t[r],o=t[r+1];if(o>=0){t[r]=o,t[r+1]=l;let c=r>>1;for(;i.length<c;)i.push(Ge.empty);i.push(l?e.slice(s,s+l):Ge.empty)}s+=l}return new Ft(t,i)}compose(e){return this.empty?e:e.empty?this:rN(this,e,!0)}map(e,t=!1){return e.empty?this:W1(this,e,t,!0)}iterChanges(e,t=!1){U1(this,e,t)}get desc(){return zr.create(this.sections)}filter(e){let t=[],i=[],r=[],s=new Lh(this);e:for(let l=0,o=0;;){let c=l==e.length?1e9:e[l++];for(;o<c||o==c&&s.len==0;){if(s.done)break e;let d=Math.min(s.len,c-o);kn(r,d,-1);let p=s.ins==-1?-1:s.off==0?s.ins:0;kn(t,d,p),p>0&&Tl(i,t,s.text),s.forward(d),o+=d}let h=e[l++];for(;o<h;){if(s.done)break e;let d=Math.min(s.len,h-o);kn(t,d,-1),kn(r,d,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(d),o+=d}}return{changes:new Ft(t,i),filtered:zr.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],l=0,o=null;function c(d=!1){if(!d&&!r.length)return;l<t&&kn(r,t-l,-1);let p=new Ft(r,s);o=o?o.compose(p.map(o)):p,r=[],s=[],l=0}function h(d){if(Array.isArray(d))for(let p of d)h(p);else if(d instanceof Ft){if(d.length!=t)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${t})`);c(),o=o?o.compose(d.map(o)):d}else{let{from:p,to:g=p,insert:O}=d;if(p>g||p<0||g>t)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${t})`);let b=O?typeof O=="string"?Ge.of(O.split(i||Y1)):O:Ge.empty,v=b.length;if(p==g&&v==0)return;p<l&&c(),p>l&&kn(r,p-l,-1),kn(r,g-p,v),Tl(s,r,b),l=g}}return h(e),c(!o),o}static empty(e){return new Ft(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((l,o)=>o&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<r;)i.push(Ge.empty);i[r]=Ge.of(s.slice(1)),t.push(s[0],i[r].length)}}}return new Ft(t,i)}static createSet(e,t){return new Ft(e,t)}}function kn(n,e,t,i=!1){if(e==0&&t<=0)return;let r=n.length-2;r>=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function Tl(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(Ge.empty);n.push(t)}}function U1(n,e,t){let i=n.inserted;for(let r=0,s=0,l=0;l<n.sections.length;){let o=n.sections[l++],c=n.sections[l++];if(c<0)r+=o,s+=o;else{let h=r,d=s,p=Ge.empty;for(;h+=o,d+=c,c&&i&&(p=p.append(i[l-2>>1])),!(t||l==n.sections.length||n.sections[l+1]<0);)o=n.sections[l++],c=n.sections[l++];e(r,h,s,d,p),r=h,s=d}}}function W1(n,e,t,i=!1){let r=[],s=i?[]:null,l=new Lh(n),o=new Lh(e);for(let c=-1;;){if(l.done&&o.len||o.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);kn(r,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||c==l.i||l.off==0&&(o.len<l.len||o.len==l.len&&!t))){let h=o.len;for(kn(r,o.ins,-1);h;){let d=Math.min(l.len,h);l.ins>=0&&c<l.i&&l.len<=d&&(kn(r,0,l.ins),s&&Tl(s,r,l.text),c=l.i),l.forward(d),h-=d}o.next()}else if(l.ins>=0){let h=0,d=l.len;for(;d;)if(o.ins==-1){let p=Math.min(d,o.len);h+=p,d-=p,o.forward(p)}else if(o.ins==0&&o.len<d)d-=o.len,o.next();else break;kn(r,h,c<l.i?l.ins:0),s&&c<l.i&&Tl(s,r,l.text),c=l.i,l.forward(l.len-d)}else{if(l.done&&o.done)return s?Ft.createSet(r,s):zr.create(r);throw new Error("Mismatched change set lengths")}}}function rN(n,e,t=!1){let i=[],r=t?[]:null,s=new Lh(n),l=new Lh(e);for(let o=!1;;){if(s.done&&l.done)return r?Ft.createSet(i,r):zr.create(i);if(s.ins==0)kn(i,s.len,0,o),s.next();else if(l.len==0&&!l.done)kn(i,0,l.ins,o),r&&Tl(r,i,l.text),l.next();else{if(s.done||l.done)throw new Error("Mismatched change set lengths");{let c=Math.min(s.len2,l.len),h=i.length;if(s.ins==-1){let d=l.ins==-1?-1:l.off?0:l.ins;kn(i,c,d,o),r&&d&&Tl(r,i,l.text)}else l.ins==-1?(kn(i,s.off?0:s.len,c,o),r&&Tl(r,i,s.textBit(c))):(kn(i,s.off?0:s.len,l.off?0:l.ins,o),r&&!l.off&&Tl(r,i,l.text));o=(s.ins>c||l.ins>=0&&l.len>c)&&(o||i.length>h),s.forward2(c),l.forward(c)}}}}class Lh{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Ge.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Ge.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class So{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new So(i,r,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return Y.range(e,t,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Y.range(this.anchor,r,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Y.range(e.anchor,e.head)}static create(e,t,i){return new So(e,t,i)}}class Y{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Y.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Y([this.main],0)}addRange(e,t=!0){return Y.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,Y.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Y(e.ranges.map(t=>So.fromJSON(t)),e.main)}static single(e,t=e){return new Y([Y.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return Y.normalized(e.slice(),t);i=s.to}return new Y(e,t)}static cursor(e,t=0,i,r){return So.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,t,i,r,s){let l=(i??16777215)<<6|(r==null?7:Math.min(6,r));return!s&&e!=t&&(s=t<e?1:-1),t<e?So.create(t,e,48|l):So.create(e,t,(s?s<0?8:16:0)|l)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],l=e[r-1];if(s.empty?s.from<=l.to:s.from<l.to){let o=l.from,c=Math.max(s.to,l.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?Y.range(c,o):Y.range(o,c))}}return new Y(e,t)}}function sN(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Gv=0;class me{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=Gv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new me(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Fv),!!e.static,e.enables)}of(e){return new zp([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new zp(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new zp(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Fv(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class zp{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=Gv++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,c=!1,h=!1,d=[];for(let p of this.dependencies)p=="doc"?c=!0:p=="selection"?h=!0:(((t=e[p.id])!==null&&t!==void 0?t:1)&1)==0&&d.push(e[p.id]);return{create(p){return p.values[l]=i(p),1},update(p,g){if(c&&g.docChanged||h&&(g.docChanged||g.selection)||G1(p,d)){let O=i(p);if(o?!AQ(O,p.values[l],r):!r(O,p.values[l]))return p.values[l]=O,1}return 0},reconfigure:(p,g)=>{let O,b=g.config.address[s];if(b!=null){let v=Bm(g,b);if(this.dependencies.every(x=>x instanceof me?g.facet(x)===p.facet(x):x instanceof bn?g.field(x,!1)==p.field(x,!1):!0)||(o?AQ(O=i(p),v,r):r(O=i(p),v)))return p.values[l]=v,0}else O=i(p);return p.values[l]=O,1}}}}function AQ(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function G1(n,e){let t=!1;for(let i of e)ph(n,i)&1&&(t=!0);return t}function T6(n,e,t){let i=t.map(c=>n[c.id]),r=t.map(c=>c.type),s=i.filter(c=>!(c&1)),l=n[e.id]>>1;function o(c){let h=[];for(let d=0;d<i.length;d++){let p=Bm(c,i[d]);if(r[d]==2)for(let g of p)h.push(g);else h.push(p)}return e.combine(h)}return{create(c){for(let h of i)ph(c,h);return c.values[l]=o(c),1},update(c,h){if(!G1(c,s))return 0;let d=o(c);return e.compare(d,c.values[l])?0:(c.values[l]=d,1)},reconfigure(c,h){let d=G1(c,i),p=h.config.facets[e.id],g=h.facet(e);if(p&&!d&&Fv(t,p))return c.values[l]=g,0;let O=o(c);return e.compare(O,g)?(c.values[l]=g,0):(c.values[l]=O,1)}}}const np=me.define({static:!0});class bn{constructor(e,t,i,r,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new bn(Gv++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(np).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],l=this.updateF(s,r);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,r)=>{let s=i.facet(np),l=r.facet(np),o;return(o=s.find(c=>c.field==this))&&o!=l.find(c=>c.field==this)?(i.values[t]=o.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,np.of({field:this,create:e})]}get extension(){return this}}const po={lowest:4,low:3,default:2,high:1,highest:0};function Pu(n){return e=>new lN(e,n)}const _s={highest:Pu(po.highest),high:Pu(po.high),default:Pu(po.default),low:Pu(po.low),lowest:Pu(po.lowest)};class lN{constructor(e,t){this.inner=e,this.prec=t}}class Xg{of(e){return new F1(this,e)}reconfigure(e){return Xg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class F1{constructor(e,t){this.compartment=e,this.inner=t}}class _m{constructor(e,t,i,r,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],s=Object.create(null),l=new Map;for(let g of C6(e,t,l))g instanceof bn?r.push(g):(s[g.facet.id]||(s[g.facet.id]=[])).push(g);let o=Object.create(null),c=[],h=[];for(let g of r)o[g.id]=h.length<<1,h.push(O=>g.slot(O));let d=i==null?void 0:i.config.facets;for(let g in s){let O=s[g],b=O[0].facet,v=d&&d[g]||[];if(O.every(x=>x.type==0))if(o[b.id]=c.length<<1|1,Fv(v,O))c.push(i.facet(b));else{let x=b.combine(O.map(k=>k.value));c.push(i&&b.compare(x,i.facet(b))?i.facet(b):x)}else{for(let x of O)x.type==0?(o[x.id]=c.length<<1|1,c.push(x.value)):(o[x.id]=h.length<<1,h.push(k=>x.dynamicSlot(k)));o[b.id]=h.length<<1,h.push(x=>T6(x,b,O))}}let p=h.map(g=>g(o));return new _m(e,l,p,o,c,s)}}function C6(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(l,o){let c=r.get(l);if(c!=null){if(c<=o)return;let h=i[c].indexOf(l);h>-1&&i[c].splice(h,1),l instanceof F1&&t.delete(l.compartment)}if(r.set(l,o),Array.isArray(l))for(let h of l)s(h,o);else if(l instanceof F1){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),s(h,o)}else if(l instanceof lN)s(l.inner,l.prec);else if(l instanceof bn)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof zp)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,po.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,o)}}return s(n,po.default),i.reduce((l,o)=>l.concat(o))}function ph(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Bm(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const oN=me.define(),K1=me.define({combine:n=>n.some(e=>e),static:!0}),aN=me.define({combine:n=>n.length?n[0]:void 0,static:!0}),cN=me.define(),uN=me.define(),hN=me.define(),fN=me.define({combine:n=>n.length?n[0]:!1});class Xr{constructor(e,t){this.type=e,this.value=t}static define(){return new A6}}class A6{of(e){return new Xr(this,e)}}class M6{constructor(e){this.map=e}of(e){return new De(this,e)}}class De{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new De(this.type,t)}is(e){return this.type==e}static define(e={}){return new M6(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}De.reconfigure=De.define();De.appendConfig=De.define();class Yt{constructor(e,t,i,r,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&sN(i,t.newLength),s.some(o=>o.type==Yt.time)||(this.annotations=s.concat(Yt.time.of(Date.now())))}static create(e,t,i,r,s,l){return new Yt(e,t,i,r,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Yt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Yt.time=Xr.define();Yt.userEvent=Xr.define();Yt.addToHistory=Xr.define();Yt.remote=Xr.define();function Q6(n,e){let t=[];for(let i=0,r=0;;){let s,l;if(i<n.length&&(r==e.length||e[r]>=n[i]))s=n[i++],l=n[i++];else if(r<e.length)s=e[r++],l=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,l):t[t.length-1]<l&&(t[t.length-1]=l)}}function dN(n,e,t){var i;let r,s,l;return t?(r=e.changes,s=Ft.empty(e.changes.length),l=n.changes.compose(e.changes)):(r=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),l=n.changes.compose(r)),{changes:l,selection:e.selection?e.selection.map(s):(i=n.selection)===null||i===void 0?void 0:i.map(r),effects:De.mapEffects(n.effects,r).concat(De.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function J1(n,e,t){let i=e.selection,r=Ga(e.annotations);return e.userEvent&&(r=r.concat(Yt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ft?e.changes:Ft.of(e.changes||[],t,n.facet(aN)),selection:i&&(i instanceof Y?i:Y.single(i.anchor,i.head)),effects:Ga(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function pN(n,e,t){let i=J1(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let l=!!e[s].sequential;i=dN(i,J1(n,e[s],l?i.changes.newLength:n.doc.length),l)}let r=Yt.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return $6(t?E6(r):r)}function E6(n){let e=n.startState,t=!0;for(let r of e.facet(cN)){let s=r(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:Q6(t,s))}if(t!==!0){let r,s;if(t===!1)s=n.changes.invertedDesc,r=Ft.empty(e.doc.length);else{let l=n.changes.filter(t);r=l.changes,s=l.filtered.mapDesc(l.changes).invertedDesc}n=Yt.create(e,r,n.selection&&n.selection.map(s),De.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let i=e.facet(uN);for(let r=i.length-1;r>=0;r--){let s=i[r](n);s instanceof Yt?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Yt?n=s[0]:n=pN(e,Ga(s),!1)}return n}function $6(n){let e=n.startState,t=e.facet(hN),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=dN(i,J1(e,s,n.changes.newLength),!0))}return i==n?n:Yt.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const R6=[];function Ga(n){return n==null?R6:Array.isArray(n)?n:[n]}var Qt=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Qt||(Qt={}));const P6=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let eS;try{eS=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function D6(n){if(eS)return eS.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||P6.test(t)))return!0}return!1}function N6(n){return e=>{if(!/\S/.test(e))return Qt.Space;if(D6(e))return Qt.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Qt.Word;return Qt.Other}}class Ye{constructor(e,t,i,r,s,l){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)ph(this,o<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return ph(this,i),Bm(this,i)}update(...e){return pN(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let o of e.effects)o.is(Xg.reconfigure)?(t&&(r=new Map,t.compartments.forEach((c,h)=>r.set(h,c)),t=null),r.set(o.value.compartment,o.value.extension)):o.is(De.reconfigure)?(t=null,i=o.value):o.is(De.appendConfig)&&(t=null,i=Ga(i).concat(o.value));let s;t?s=e.startState.values.slice():(t=_m.resolve(i,r,this),s=new Ye(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(c,h)=>h.reconfigure(c,this),null).values);let l=e.startState.facet(K1)?e.newSelection:e.newSelection.asSingle();new Ye(t,e.newDoc,l,s,(o,c)=>c.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Y.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],l=Ga(i.effects);for(let o=1;o<t.ranges.length;o++){let c=e(t.ranges[o]),h=this.changes(c.changes),d=h.map(r);for(let g=0;g<o;g++)s[g]=s[g].map(d);let p=r.mapDesc(h,!0);s.push(c.range.map(p)),r=r.compose(d),l=De.mapEffects(l,d).concat(De.mapEffects(Ga(c.effects),p))}return{changes:r,selection:Y.create(s,t.mainIndex),effects:l}}changes(e=[]){return e instanceof Ft?e:Ft.of(e,this.doc.length,this.facet(Ye.lineSeparator))}toText(e){return Ge.of(e.split(this.facet(Ye.lineSeparator)||Y1))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(ph(this,t),Bm(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof bn&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let l=i[s],o=e[s];r.push(l.init(c=>l.spec.fromJSON(o,c)))}}return Ye.create({doc:e.doc,selection:Y.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=_m.resolve(e.extensions||[],new Map),i=e.doc instanceof Ge?e.doc:Ge.of((e.doc||"").split(t.staticFacet(Ye.lineSeparator)||Y1)),r=e.selection?e.selection instanceof Y?e.selection:Y.single(e.selection.anchor,e.selection.head):Y.single(0);return sN(r,i.length),t.staticFacet(K1)||(r=r.asSingle()),new Ye(t,i,r,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(Ye.tabSize)}get lineBreak(){return this.facet(Ye.lineSeparator)||`
|
|
213
|
+
`}get readOnly(){return this.facet(fN)}phrase(e,...t){for(let i of this.facet(Ye.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(oN))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&r.push(l[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return N6(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,o=e-i;for(;l>0;){let c=nn(t,l,!1);if(s(t.slice(c,l))!=Qt.Word)break;l=c}for(;o<r;){let c=nn(t,o);if(s(t.slice(o,c))!=Qt.Word)break;o=c}return l==o?null:Y.range(l+i,o+i)}}Ye.allowMultipleSelections=K1;Ye.tabSize=me.define({combine:n=>n.length?n[0]:4});Ye.lineSeparator=aN;Ye.readOnly=fN;Ye.phrases=me.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});Ye.languageData=oN;Ye.changeFilter=cN;Ye.transactionFilter=uN;Ye.transactionExtender=hN;Xg.reconfigure=De.define();function Ir(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let l=r[s],o=i[s];if(o===void 0)i[s]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](o,l);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Dl{eq(e){return this==e}range(e,t=e){return tS.create(e,t,this)}}Dl.prototype.startSide=Dl.prototype.endSide=0;Dl.prototype.point=!1;Dl.prototype.mapMode=gn.TrackDel;function Kv(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let tS=class mN{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new mN(e,t,i)}};function nS(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Jv{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let l=r,o=s.length;;){if(l==o)return l;let c=l+o>>1,h=s[c]-e||(i?this.value[c].endSide:this.value[c].startSide)-t;if(c==l)return h>=0?l:o;h>=0?o=c:l=c+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);s<l;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let i=[],r=[],s=[],l=-1,o=-1;for(let c=0;c<this.value.length;c++){let h=this.value[c],d=this.from[c]+e,p=this.to[c]+e,g,O;if(d==p){let b=t.mapPos(d,h.startSide,h.mapMode);if(b==null||(g=O=b,h.startSide!=h.endSide&&(O=t.mapPos(d,h.endSide),O<g)))continue}else if(g=t.mapPos(d,h.startSide),O=t.mapPos(p,h.endSide),g>O||g==O&&h.startSide>0&&h.endSide<=0)continue;(O-g||h.endSide-h.startSide)<0||(l<0&&(l=g),h.point&&(o=Math.max(o,O-g)),i.push(h),r.push(g-l),s.push(O-l))}return{mapped:i.length?new Jv(r,s,i,o):null,pos:l}}}class Ve{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new Ve(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(nS)),this.isEmpty)return t.length?Ve.of(t):this;let o=new gN(this,null,-1).goto(0),c=0,h=[],d=new $s;for(;o.value||c<t.length;)if(c<t.length&&(o.from-t[c].from||o.startSide-t[c].value.startSide)>=0){let p=t[c++];d.addInner(p.from,p.to,p.value)||h.push(p)}else o.rangeIndex==1&&o.chunkIndex<this.chunk.length&&(c==t.length||this.chunkEnd(o.chunkIndex)<t[c].from)&&(!l||r>this.chunkEnd(o.chunkIndex)||s<this.chunkPos[o.chunkIndex])&&d.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!l||r>o.to||s<o.from||l(o.from,o.to,o.value))&&(d.addInner(o.from,o.to,o.value)||h.push(tS.create(o.from,o.to,o.value))),o.next());return d.finishInner(this.nextLayer.isEmpty&&!h.length?Ve.empty:this.nextLayer.update({add:h,filter:l,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],r=-1;for(let l=0;l<this.chunk.length;l++){let o=this.chunkPos[l],c=this.chunk[l],h=e.touchesRange(o,o+c.length);if(h===!1)r=Math.max(r,c.maxPoint),t.push(c),i.push(e.mapPos(o));else if(h===!0){let{mapped:d,pos:p}=c.map(o,e);d&&(r=Math.max(r,d.maxPoint),t.push(d),i.push(p))}}let s=this.nextLayer.map(e);return t.length==0?s:new Ve(i,t,s||Ve.empty,r)}between(e,t,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],l=this.chunk[r];if(t>=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return _h.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return _h.from(e).goto(t)}static compare(e,t,i,r,s=-1){let l=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),o=t.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=s),c=MQ(l,o,i),h=new Du(l,c,s),d=new Du(o,c,s);i.iterGaps((p,g,O)=>QQ(h,p,d,g,O,r)),i.empty&&i.length==0&&QQ(h,0,d,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(d=>!d.isEmpty&&t.indexOf(d)<0),l=t.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let o=MQ(s,l),c=new Du(s,o,0).goto(i),h=new Du(l,o,0).goto(i);for(;;){if(c.to!=h.to||!iS(c.active,h.active)||c.point&&(!h.point||!Kv(c.point,h.point)))return!1;if(c.to>r)return!0;c.next(),h.next()}}static spans(e,t,i,r,s=-1){let l=new Du(e,null,s).goto(t),o=t,c=l.openStart;for(;;){let h=Math.min(l.to,i);if(l.point){let d=l.activeForPoint(l.to),p=l.pointFrom<t?d.length+1:l.point.startSide<0?d.length:Math.min(d.length,c);r.point(o,h,l.point,d,p,l.pointRank),c=Math.min(l.openEnd(h),d.length)}else h>o&&(r.span(o,h,l.active,c),c=l.openEnd(h));if(l.to>i)return c+(l.point&&l.to>i?1:0);o=l.to,l.next()}}static of(e,t=!1){let i=new $s;for(let r of e instanceof tS?[e]:t?z6(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return Ve.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=Ve.empty;r=r.nextLayer)t=new Ve(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}Ve.empty=new Ve([],[],null,-1);function z6(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(nS(e,i)>0)return n.slice().sort(nS);e=i}return n}Ve.empty.nextLayer=Ve.empty;class $s{finishChunk(e){this.chunks.push(new Jv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new $s)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Ve.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Ve.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function MQ(n,e,t){let i=new Map;for(let s of n)for(let l=0;l<s.chunk.length;l++)s.chunk[l].maxPoint<=0&&i.set(s.chunk[l],s.chunkPos[l]);let r=new Set;for(let s of e)for(let l=0;l<s.chunk.length;l++){let o=i.get(s.chunk[l]);o!=null&&(t?t.mapPos(o):o)==s.chunkPos[l]&&!(t!=null&&t.touchesRange(o,o+s.chunk[l].length))&&r.add(s.chunk[l])}return r}class gN{constructor(e,t,i,r=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class _h{constructor(e){this.heap=e}static from(e,t=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let l=e[s];!l.isEmpty;l=l.nextLayer)l.maxPoint>=i&&r.push(new gN(l,t,i,s));return r.length==1?r[0]:new _h(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)ub(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)ub(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),ub(this.heap,0)}}}function ub(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1<n.length&&r.compare(n[i+1])>=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class Du{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=_h.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){ip(this.active,e),ip(this.activeTo,e),ip(this.activeRank,e),this.minActive=EQ(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||r-this.activeTo[t])>0;)t++;rp(this.active,t,i),rp(this.activeTo,t,r),rp(this.activeRank,t,s),e&&rp(e,t,this.cursor.from),this.minActive=EQ(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&ip(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function QQ(n,e,t,i,r,s){n.goto(e),t.goto(i);let l=i+r,o=i,c=i-e,h=!!s.boundChange;for(let d=!1;;){let p=n.to+c-t.to,g=p||n.endSide-t.endSide,O=g<0?n.to+c:t.to,b=Math.min(O,l);if(n.point||t.point?(n.point&&t.point&&Kv(n.point,t.point)&&iS(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(o,b,n.point,t.point),d=!1):(d&&s.boundChange(o),b>o&&!iS(n.active,t.active)&&s.compareRange(o,b,n.active,t.active),h&&b<l&&(p||n.openEnd(O)!=t.openEnd(O))&&(d=!0)),O>l)break;o=O,g<=0&&n.next(),g>=0&&t.next()}}function iS(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Kv(n[t],e[t]))return!1;return!0}function ip(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function rp(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function EQ(n,e){let t=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||n[r].endSide-n[t].endSide)<0&&(t=r,i=e[r]);return t}function or(n,e,t=n.length){let i=0;for(let r=0;r<t&&r<n.length;)n.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=nn(n,r));return i}function rS(n,e,t,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=nn(n,r)}return i===!0?-1:n.length}const sS="ͼ",$Q=typeof Symbol>"u"?"__"+sS:Symbol.for(sS),lS=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),RQ=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Nl{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,o,c,h){let d=[],p=/^@(\w+)\b/.exec(l[0]),g=p&&p[1]=="keyframes";if(p&&o==null)return c.push(l[0]+";");for(let O in o){let b=o[O];if(/&/.test(O))s(O.split(/,\s*/).map(v=>l.map(x=>v.replace(/&/,x))).reduce((v,x)=>v.concat(x)),b,c);else if(b&&typeof b=="object"){if(!p)throw new RangeError("The value of a property ("+O+") should be a primitive value.");s(r(O),b,d,g)}else b!=null&&d.push(O.replace(/_.*/,"").replace(/[A-Z]/g,v=>"-"+v.toLowerCase())+": "+b+";")}(d.length||g)&&c.push((i&&!p&&!h?l.map(i):l).join(", ")+" {"+d.join(" ")+"}")}for(let l in e)s(r(l),e[l],this.rules)}getRules(){return this.rules.join(`
|
|
214
|
+
`)}static newName(){let e=RQ[$Q]||1;return RQ[$Q]=e+1,sS+e.toString(36)}static mount(e,t,i){let r=e[lS],s=i&&i.nonce;r?s&&r.setNonce(s):r=new L6(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let PQ=new Map;class L6{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=PQ.get(i);if(s)return e[lS]=s;this.sheet=new r.CSSStyleSheet,PQ.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[lS]=this}mount(e,t){let i=this.sheet,r=0,s=0;for(let l=0;l<e.length;l++){let o=e[l],c=this.modules.indexOf(o);if(c<s&&c>-1&&(this.modules.splice(c,1),s--,c=-1),c==-1){if(this.modules.splice(s++,0,o),i)for(let h=0;h<o.rules.length;h++)i.insertRule(o.rules[h],r++)}else{for(;s<c;)r+=this.modules[s++].rules.length;r+=o.rules.length,s++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let l="";for(let c=0;c<this.modules.length;c++)l+=this.modules[c].getRules()+`
|
|
215
|
+
`;this.styleTag.textContent=l;let o=t.head||t;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}function ht(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?n.setAttribute(i,r):r!=null&&(n[i]=r)}e++}for(;e<arguments.length;e++)ON(n,arguments[e]);return n}function ON(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)ON(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let Rn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},oS=typeof document<"u"?document:{documentElement:{style:{}}};const aS=/Edge\/(\d+)/.exec(Rn.userAgent),yN=/MSIE \d/.test(Rn.userAgent),cS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Rn.userAgent),Ig=!!(yN||cS||aS),DQ=!Ig&&/gecko\/(\d+)/i.test(Rn.userAgent),hb=!Ig&&/Chrome\/(\d+)/.exec(Rn.userAgent),NQ="webkitFontSmoothing"in oS.documentElement.style,uS=!Ig&&/Apple Computer/.test(Rn.vendor),zQ=uS&&(/Mobile\/\w+/.test(Rn.userAgent)||Rn.maxTouchPoints>2);var Oe={mac:zQ||/Mac/.test(Rn.platform),windows:/Win/.test(Rn.platform),linux:/Linux|X11/.test(Rn.platform),ie:Ig,ie_version:yN?oS.documentMode||6:cS?+cS[1]:aS?+aS[1]:0,gecko:DQ,gecko_version:DQ?+(/Firefox\/(\d+)/.exec(Rn.userAgent)||[0,0])[1]:0,chrome:!!hb,chrome_version:hb?+hb[1]:0,ios:zQ,android:/Android\b/.test(Rn.userAgent),webkit:NQ,webkit_version:NQ?+(/\bAppleWebKit\/(\d+)/.exec(Rn.userAgent)||[0,0])[1]:0,safari:uS,safari_version:uS?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Rn.userAgent)||[0,0])[1]:0,tabSize:oS.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function ex(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Zm=Object.create(null);function tx(n,e,t){if(n==e)return!0;n||(n=Zm),e||(e=Zm);let i=Object.keys(n),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function _6(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function LQ(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function B6(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class ur{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var yn=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(yn||(yn={}));class we extends Dl{constructor(e,t,i,r){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new df(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new _o(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:l}=bN(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(l?t?2e8:1:-6e8)+1}return new _o(e,i,r,t,e.widget||null,!0)}static line(e){return new pf(e)}static set(e,t=!1){return Ve.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}we.none=Ve.empty;class df extends we{constructor(e){let{start:t,end:i}=bN(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?ex(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Zm}eq(e){return this==e||e instanceof df&&this.tagName==e.tagName&&tx(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}df.prototype.point=!1;class pf extends we{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof pf&&this.spec.class==e.spec.class&&tx(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}pf.prototype.mapMode=gn.TrackBefore;pf.prototype.point=!0;class _o extends we{constructor(e,t,i,r,s,l){super(t,i,s,e),this.block=r,this.isReplace=l,this.mapMode=r?t<=0?gn.TrackBefore:gn.TrackAfter:gn.TrackDel}get type(){return this.startSide!=this.endSide?yn.WidgetRange:this.startSide<=0?yn.WidgetBefore:yn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof _o&&Z6(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}_o.prototype.point=!0;function bN(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Z6(n,e){return n==e||!!(n&&e&&n.compare(e))}function Fa(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class Bh extends Dl{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof Bh&&this.tagName==e.tagName&&tx(this.attributes,e.attributes)}static create(e){return new Bh(e.tagName,e.attributes||Zm,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return Ve.of(e,t)}}Bh.prototype.startSide=Bh.prototype.endSide=-1;function Zh(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function hS(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function mh(n,e){if(!e.anchorNode)return!1;try{return hS(n,e.anchorNode)}catch{return!1}}function gh(n){return n.nodeType==3?Xh(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Oh(n,e,t,i){return t?_Q(n,e,t,i,-1)||_Q(n,e,t,i,1):!1}function zl(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function jm(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function _Q(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:Rs(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=zl(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?Rs(n):0}else return!1}}function Rs(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function jh(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function j6(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function SN(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function X6(n,e,t,i,r,s,l,o){let c=n.ownerDocument,h=c.defaultView||window;for(let d=n,p=!1;d&&!p;)if(d.nodeType==1){let g,O=d==c.body,b=1,v=1;if(O)g=j6(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(p=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let C=d.getBoundingClientRect();({scaleX:b,scaleY:v}=SN(d,C)),g={left:C.left,right:C.left+d.clientWidth*b,top:C.top,bottom:C.top+d.clientHeight*v}}let x=0,k=0;if(r=="nearest")e.top<g.top+l?(k=e.top-(g.top+l),t>0&&e.bottom>g.bottom+k&&(k=e.bottom-g.bottom+l)):e.bottom>g.bottom-l&&(k=e.bottom-g.bottom+l,t<0&&e.top-k<g.top&&(k=e.top-(g.top+l)));else{let C=e.bottom-e.top,A=g.bottom-g.top;k=(r=="center"&&C<=A?e.top+C/2-A/2:r=="start"||r=="center"&&t<0?e.top-l:e.bottom-A+l)-g.top}if(i=="nearest"?e.left<g.left+s?(x=e.left-(g.left+s),t>0&&e.right>g.right+x&&(x=e.right-g.right+s)):e.right>g.right-s&&(x=e.right-g.right+s,t<0&&e.left<g.left+x&&(x=e.left-(g.left+s))):x=(i=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:i=="start"==o?e.left-s:e.right-(g.right-g.left)+s)-g.left,x||k)if(O)h.scrollBy(x,k);else{let C=0,A=0;if(k){let P=d.scrollTop;d.scrollTop+=k/v,A=(d.scrollTop-P)*v}if(x){let P=d.scrollLeft;d.scrollLeft+=x/b,C=(d.scrollLeft-P)*b}e={left:e.left-C,top:e.top-A,right:e.right-C,bottom:e.bottom-A},C&&Math.abs(C-x)<1&&(i="nearest"),A&&Math.abs(A-k)<1&&(r="nearest")}if(O)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function vN(n,e=!0){let t=n.ownerDocument,i=null,r=null;for(let s=n.parentNode;s&&!(s==t.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class I6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?Rs(t):0),i,Math.min(e.focusOffset,i?Rs(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let ho=null;Oe.safari&&Oe.safari_version>=26&&(ho=!1);function xN(n){if(n.setActive)return n.setActive();if(ho)return n.focus(ho);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(ho==null?{get preventScroll(){return ho={preventScroll:!0},!0}}:void 0),!ho){ho=!1;for(let t=0;t<e.length;){let i=e[t++],r=e[t++],s=e[t++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}let BQ;function Xh(n,e,t=e){let i=BQ||(BQ=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Ka(n,e,t,i){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,n.dispatchEvent(s);let l=new KeyboardEvent("keyup",r);return l.synthetic=!0,n.dispatchEvent(l),s.defaultPrevented||l.defaultPrevented}function V6(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function q6(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,Rs(t));;)if(i){if(t.nodeType!=1)return!1;let r=t.childNodes[i-1];r.contentEditable=="false"?i--:(t=r,i=Rs(t))}else{if(t==n)return!0;i=zl(t),t=t.parentNode}}function kN(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function wN(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=Rs(t)}else if(t.parentNode&&!jm(t))i=zl(t),t=t.parentNode;else return null}}function TN(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!jm(t))i=zl(t)+1,t=t.parentNode;else return null}}class ir{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new ir(e.parentNode,zl(e),t)}static after(e,t){return new ir(e.parentNode,zl(e)+1,t)}}var gt=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(gt||(gt={}));const Bo=gt.LTR,nx=gt.RTL;function CN(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const H6=CN("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Y6=CN("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),fS=Object.create(null),yr=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);fS[e]=t,fS[t]=-e}function AN(n){return n<=247?H6[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?Y6[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const U6=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class $r{get dir(){return this.level%2?nx:Bo}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,r){let s=-1;for(let l=0;l<e.length;l++){let o=e[l];if(o.from<=t&&o.to>=t){if(o.level==i)return l;(s<0||(r!=0?r<0?o.from<t:o.to>t:e[s].level>o.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function MN(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],r=e[t];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!MN(i.inner,r.inner))return!1}return!0}const pt=[];function W6(n,e,t,i,r){for(let s=0;s<=i.length;s++){let l=s?i[s-1].to:e,o=s<i.length?i[s].from:t,c=s?256:r;for(let h=l,d=c,p=c;h<o;h++){let g=AN(n.charCodeAt(h));g==512?g=d:g==8&&p==4&&(g=16),pt[h]=g==4?2:g,g&7&&(p=g),d=g}for(let h=l,d=c,p=c;h<o;h++){let g=pt[h];if(g==128)h<o-1&&d==pt[h+1]&&d&24?g=pt[h]=d:pt[h]=256;else if(g==64){let O=h+1;for(;O<o&&pt[O]==64;)O++;let b=h&&d==8||O<t&&pt[O]==8?p==1?1:8:256;for(let v=h;v<O;v++)pt[v]=b;h=O-1}else g==8&&p==1&&(pt[h]=1);d=g,g&7&&(p=g)}}}function G6(n,e,t,i,r){let s=r==1?2:1;for(let l=0,o=0,c=0;l<=i.length;l++){let h=l?i[l-1].to:e,d=l<i.length?i[l].from:t;for(let p=h,g,O,b;p<d;p++)if(O=fS[g=n.charCodeAt(p)])if(O<0){for(let v=o-3;v>=0;v-=3)if(yr[v+1]==-O){let x=yr[v+2],k=x&2?r:x&4?x&1?s:r:0;k&&(pt[p]=pt[yr[v]]=k),o=v;break}}else{if(yr.length==189)break;yr[o++]=p,yr[o++]=g,yr[o++]=c}else if((b=pt[p])==2||b==1){let v=b==r;c=v?0:1;for(let x=o-3;x>=0;x-=3){let k=yr[x+2];if(k&2)break;if(v)yr[x+2]|=2;else{if(k&4)break;yr[x+2]|=4}}}}}function F6(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let l=r?t[r-1].to:n,o=r<t.length?t[r].from:e;for(let c=l;c<o;){let h=pt[c];if(h==256){let d=c+1;for(;;)if(d==o){if(r==t.length)break;d=t[r++].to,o=r<t.length?t[r].from:e}else if(pt[d]==256)d++;else break;let p=s==1,g=(d<e?pt[d]:i)==1,O=p==g?p?1:2:i;for(let b=d,v=r,x=v?t[v-1].to:n;b>c;)b==x&&(b=t[--v].from,x=v?t[v-1].to:n),pt[--b]=O;c=d}else s=h,c++}}}function dS(n,e,t,i,r,s,l){let o=i%2?2:1;if(i%2==r%2)for(let c=e,h=0;c<t;){let d=!0,p=!1;if(h==s.length||c<s[h].from){let v=pt[c];v!=o&&(d=!1,p=v==16)}let g=!d&&o==1?[]:null,O=d?i:i+1,b=c;e:for(;;)if(h<s.length&&b==s[h].from){if(p)break e;let v=s[h];if(!d)for(let x=v.to,k=h+1;;){if(x==t)break e;if(k<s.length&&s[k].from==x)x=s[k++].to;else{if(pt[x]==o)break e;break}}if(h++,g)g.push(v);else{v.from>c&&l.push(new $r(c,v.from,O));let x=v.direction==Bo!=!(O%2);pS(n,x?i+1:i,r,v.inner,v.from,v.to,l),c=v.to}b=v.to}else{if(b==t||(d?pt[b]!=o:pt[b]==o))break;b++}g?dS(n,c,b,i+1,r,g,l):c<b&&l.push(new $r(c,b,O)),c=b}else for(let c=t,h=s.length;c>e;){let d=!0,p=!1;if(!h||c>s[h-1].to){let v=pt[c-1];v!=o&&(d=!1,p=v==16)}let g=!d&&o==1?[]:null,O=d?i:i+1,b=c;e:for(;;)if(h&&b==s[h-1].to){if(p)break e;let v=s[--h];if(!d)for(let x=v.from,k=h;;){if(x==e)break e;if(k&&s[k-1].to==x)x=s[--k].from;else{if(pt[x-1]==o)break e;break}}if(g)g.push(v);else{v.to<c&&l.push(new $r(v.to,c,O));let x=v.direction==Bo!=!(O%2);pS(n,x?i+1:i,r,v.inner,v.from,v.to,l),c=v.from}b=v.from}else{if(b==e||(d?pt[b-1]!=o:pt[b-1]==o))break;b--}g?dS(n,b,c,i+1,r,g,l):b<c&&l.push(new $r(b,c,O)),c=b}}function pS(n,e,t,i,r,s,l){let o=e%2?2:1;W6(n,r,s,i,o),G6(n,r,s,i,o),F6(r,s,i,o),dS(n,r,s,e,t,i,l)}function K6(n,e,t){if(!n)return[new $r(0,0,e==nx?1:0)];if(e==Bo&&!t.length&&!U6.test(n))return QN(n.length);if(t.length)for(;n.length>pt.length;)pt[pt.length]=256;let i=[],r=e==Bo?0:1;return pS(n,r,r,t,0,n.length,i),i}function QN(n){return[new $r(0,n,0)]}let EN="";function J6(n,e,t,i,r){var s;let l=i.head-n.from,o=$r.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),c=e[o],h=c.side(r,t);if(l==h){let g=o+=r?1:-1;if(g<0||g>=e.length)return null;c=e[o=g],l=c.side(!r,t),h=c.side(r,t)}let d=nn(n.text,l,c.forward(r,t));(d<c.from||d>c.to)&&(d=h),EN=n.text.slice(Math.min(l,d),Math.max(l,d));let p=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return p&&d==h&&p.level+(r?0:1)<c.level?Y.cursor(p.side(!r,t)+n.from,p.forward(r,t)?1:-1,p.level):Y.cursor(d+n.from,c.forward(r,t)?-1:1,c.level)}function eW(n,e,t){for(let i=e;i<t;i++){let r=AN(n.charCodeAt(i));if(r==1)return Bo;if(r==2||r==4)return nx}return Bo}const $N=me.define(),RN=me.define(),PN=me.define(),DN=me.define(),mS=me.define(),NN=me.define(),zN=me.define(),ix=me.define(),rx=me.define(),LN=me.define({combine:n=>n.some(e=>e)}),_N=me.define({combine:n=>n.some(e=>e)}),BN=me.define();class Ja{constructor(e,t,i,r,s,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Ja(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Ja(Y.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const sp=De.define({map:(n,e)=>n.map(e)}),ZN=De.define();function Kn(n,e,t){let i=n.facet(DN);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const vs=me.define({combine:n=>n.length?n[0]:!0});let tW=0;const Va=me.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}});class Lt{constructor(e,t,i,r,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Va.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Va.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:s,decorations:l}=t||{};return new Lt(tW++,e,i,r,o=>{let c=[];return l&&c.push(Vg.of(h=>{let d=h.plugin(o);return d?l(d):we.none})),s&&c.push(s(o)),c})}static fromClass(e,t){return Lt.define((i,r)=>new e(i,r),t)}}class fb{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Kn(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Kn(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Kn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const jN=me.define(),sx=me.define(),Vg=me.define(),XN=me.define(),lx=me.define(),mf=me.define(),IN=me.define();function ZQ(n,e){let t=n.state.facet(IN);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(n):s),r=[];return Ve.spans(i,e.from,e.to,{point(){},span(s,l,o,c){let h=s-e.from,d=l-e.from,p=r;for(let g=o.length-1;g>=0;g--,c--){let O=o[g].spec.bidiIsolate,b;if(O==null&&(O=eW(e.text,h,d)),c>0&&p.length&&(b=p[p.length-1]).to==h&&b.direction==O)b.to=d,p=b.inner;else{let v={from:h,to:d,direction:O,inner:[]};p.push(v),p=v.inner}}}}),r}const VN=me.define();function ox(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(VN)){let l=s(n);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(r=Math.max(r,l.bottom)))}return{left:e,right:t,top:i,bottom:r}}const Fu=me.define();class Bi{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Bi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let r=0,s=0,l=0;;){let o=r<e.length?e[r].fromB:1e9,c=s<t.length?t[s]:1e9,h=Math.min(o,c);if(h==1e9)break;let d=h+l,p=h,g=d;for(;;)if(s<t.length&&t[s]<=p){let O=t[s+1];s+=2,p=Math.max(p,O);for(let b=r;b<e.length&&e[b].fromB<=p;b++)l=e[b].toA-e[b].toB;g=Math.max(g,O+l)}else if(r<e.length&&e[r].fromB<=p){let O=e[r++];p=Math.max(p,O.toB),g=Math.max(g,O.toA),l=O.toA-O.toB}else break;i.push(new Bi(d,g,h,p))}return i}}class Xm{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Ft.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,l,o,c)=>r.push(new Bi(s,l,o,c))),this.changedRanges=r}static create(e,t,i){return new Xm(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const nW=[];class zt{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return nW}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&_6(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=zl(this.dom),r=this.length?e>0:t>0;return new ir(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Hg)return e;return null}static get(e){return e.cmTile}}class qg extends zt{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,r,s=(e==null?void 0:e.node)==t?e:null,l=0;for(let o of this.children){if(o.sync(e),l+=o.length+o.breakAfter,r=i?i.nextSibling:t.firstChild,s&&r!=o.dom&&(s.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=jQ(r);else t.insertBefore(o.dom,r);i=o.dom}for(r=i?i.nextSibling:t.firstChild,s&&r&&(s.written=!0);r;)r=jQ(r);this.length=l}}function jQ(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Hg extends qg{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=zt.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&s++,r=t.pop()}else{let l=i.children[r++];if(l instanceof Ms)t.push(r),i=l,r=0;else{let o=s+l.length,c=e(l,s);if(c!==void 0)return c;s=o+l.breakAfter}}}resolveBlock(e,t){let i,r=-1,s,l=-1;if(this.blockTiles((o,c)=>{let h=c+o.length;if(e>=c&&e<=h){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(i=void 0)}(c<e||e==h&&(t<-1?o.length:o.covers(1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,r=e-c),(h>e||e==c&&(t>1?o.length:o.covers(-1)))&&(!s||!o.isWidget()&&s.isWidget())&&(s=o,l=e-c)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&t<0||!s?{tile:i,offset:r}:{tile:s,offset:l}}}class Ms extends qg{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new Ms(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class pc extends qg{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let r=new pc(t||document.createElement("div"),e);return(!t||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,i){let r=null,s=-1,l=null,o=-1;function c(d,p){for(let g=0,O=0;g<d.children.length&&O<=p;g++){let b=d.children[g],v=O+b.length;v>=p&&(b.isComposite()?c(b,p-O):(!l||l.isHidden&&(t>0||i&&rW(l,b)))&&(v>p||b.flags&32)?(l=b,o=p-O):(O<p||b.flags&16&&!b.isHidden)&&(r=b,s=p-O)),O=v}}c(this,e);let h=(t<0?r:l)||r||l;return h?{tile:h,offset:h==r?s:o}:null}coordsIn(e,t){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t):iW(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new ir(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:t);let l=i.tile.parent,o=!1;for(let c of l.children){if(o)return new ir(c.dom,0);c==i.tile&&(o=!0)}}return new ir(this.dom,0)}}function iW(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=gh(e);return t[t.length-1]||null}function rW(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}class Fn extends qg{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new Fn(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class vo extends zt{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let i=this.dom.nodeValue.length;e>i&&(e=i);let r=e,s=e,l=0;e==0&&t<0||e==i&&t>=0?Oe.chrome||Oe.gecko||(e?(r--,l=1):s<i&&(s++,l=-1)):t<0?r--:s<i&&s++;let o=Xh(this.dom,r,s).getClientRects();if(!o.length)return null;let c=o[(l?l<0:t>=0)?0:o.length-1];return Oe.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(o,h=>h.width)||c),l?jh(c,l<0):c||null}static of(e,t){let i=new vo(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class Zo extends zt{constructor(e,t,i,r){super(e,t,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(i)return jh(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),l=null;if(!s.length)return null;let o=this.flags&16?!0:this.flags&32?!1:e>0;for(let c=o?s.length-1:0;l=s[c],!(e>0?c==0:c==s.length-1||l.top<l.bottom);c+=o?-1:1);return jh(l,!o)}}get overrideDOMText(){if(!this.length)return Ge.empty;let{root:e}=this;if(!e)return Ge.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,r,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new Zo(s,i,e,r)}}class Im extends zt{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Ge.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class sW{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:r,index:s,beforeBreak:l,parents:o}=this;for(;e||t>0;)if(r.isComposite())if(l){if(!e)break;i&&i.break(),e--,l=!1}else if(s==r.children.length){if(!e&&!o.length)break;i&&i.leave(r),l=!!r.breakAfter,{tile:r,index:s}=o.pop(),s++}else{let c=r.children[s],h=c.breakAfter;(t>0?c.length<=e:c.length<e)&&(!i||i.skip(c,0,c.length)!==!1||!c.isComposite)?(l=!!h,s++,e-=c.length):(o.push({tile:r,index:s}),r=c,s=0,i&&c.isComposite()&&i.enter(c))}else if(s==r.length)l=!!r.breakAfter,{tile:r,index:s}=o.pop(),s++;else if(e){let c=Math.min(e,r.length-s);i&&i.skip(r,s,s+c),e-=c,s+=c}else break;return this.tile=r,this.index=s,this.beforeBreak=l,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class lW{constructor(e,t,i,r){this.from=e,this.to=t,this.wrapper=i,this.rank=r}}class oW{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,r){var s;this.flushBuffer();let l=this.ensureMarks(t,i),o=l.lastChild;if(o&&o.isText()&&!(o.flags&8)&&o.length+e.length<512){this.cache.reused.set(o,2);let c=l.children[l.children.length-1]=new vo(o.dom,o.text+e);c.parent=l}else l.append(r||vo.of(e,(s=this.cache.find(vo))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?db(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=i;for(let o=t.marks.length-1;o>=0;o--){let c=t.marks[o],h=r.lastChild;if(h instanceof Fn&&h.mark.eq(c.mark))h.dom!=c.dom&&h.setDOM(db(c.dom)),r=h;else{if(this.cache.reused.get(c)){let p=zt.get(c.dom);p&&p.setDOM(db(c.dom))}let d=Fn.of(c.mark,c.dom);r.append(d),r=d}this.cache.reused.set(c,2)}let s=zt.get(e.text);s&&this.cache.reused.set(s,2);let l=new vo(e.text,e.text.nodeValue);l.flags|=8,this.pos=e.range.toB,r.append(l)}addInlineWidget(e,t,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(t,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=qN);let r=pc.start(e,t||((i=this.cache.find(pc))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let l=e[s],o;if(t>0&&(o=r.lastChild)&&o instanceof Fn&&o.mark.eq(l))r=o,t--;else{let c=Fn.of(l,(i=this.cache.find(Fn,h=>h.mark.eq(l)))===null||i===void 0?void 0:i.dom);r.append(c),r=c,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!XQ(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Oe.ios&&XQ(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(pb,0,32)||new Zo(pb.toDOM(),0,pb,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,i=new lW(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let r=t.lastChild;if(i.from<this.pos&&r instanceof Ms&&r.wrapper.eq(i.wrapper))t=r;else{let s=Ms.of(i.wrapper,(e=this.cache.find(Ms,l=>l.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(Im,void 0,1);return i&&(i.flags=t),i||new Im(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class aW{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:l}=this.cursor.next(this.skipCount);if(this.skipCount=0,l)throw new Error("Ran out of text content when drawing inline views");this.text=r;let o=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,o)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const Vm=[Zo,pc,vo,Fn,Im,Ms,Hg];for(let n=0;n<Vm.length;n++)Vm[n].bucket=n;class cW{constructor(e){this.view=e,this.buckets=Vm.map(()=>[]),this.index=Vm.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let r=e.bucket,s=this.buckets[r],l=this.index[r];for(let o=s.length-1;o>=0;o--){let c=(o+l)%s.length,h=s[c];if((!t||t(h))&&!this.reused.has(h))return s.splice(c,1),c<l&&this.index[r]--,this.reused.set(h,i),h}return null}findWidget(e,t,i){let r=this.buckets[0];if(r.length)for(let s=0,l=0;;s++){if(s==r.length){if(l)return null;l=1,s=0}let o=r[s];if(!this.reused.has(o)&&(l==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==i?(this.reused.set(o,1),o):(this.reused.set(o,2),new Zo(o.dom,t,e,o.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class uW{constructor(e,t,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new cW(e),this.text=new aW(e.state.doc),this.builder=new oW(this.cache,new Hg(e,e.contentDOM),Ve.iter(i)),this.cache.reused.set(t,2),this.old=new sW(t),this.reuseWalker={skip:(l,o,c)=>{if(this.cache.add(l),l.isComposite())return!1},enter:l=>this.cache.add(l),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let r=0,s=0,l=0;;){let o=l<e.length?e[l++]:null,c=o?o.fromA:this.old.root.length;if(c>r){let h=c-r;this.preserve(h,!l,!o),r=c,s+=h}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(s,o.toB)),s=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let r=dW(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(l,o,c)=>{if(l.isWidget())if(this.openWidget)this.builder.continueWidget(c-o);else{let h=c>0||o<l.length?Zo.of(l.widget,this.view,c-o,l.flags&496,this.cache.maybeReuse(l)):this.cache.reuse(l);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,r,s),s=r.length)}else if(l.isText())this.builder.ensureLine(null),!o&&c==l.length&&!this.cache.reused.has(l)?this.builder.addText(l.text,r,s,this.cache.reuse(l)):(this.cache.add(l),this.builder.addText(l.text.slice(o,c),r,s)),s=r.length;else if(l.isLine())l.flags&=-2,this.cache.reused.set(l,1),this.builder.addLine(l);else if(l instanceof Im)this.cache.add(l);else if(l instanceof Fn)this.builder.ensureLine(null),this.builder.addMark(l,r,s),this.cache.reused.set(l,1),s=r.length;else return!1;this.openWidget=!1},enter:l=>{l.isLine()?this.builder.addLineStart(l.attrs,this.cache.maybeReuse(l)):(this.cache.add(l),l instanceof Fn&&r.unshift(l.mark)),this.openWidget=!1},leave:l=>{l.isLine()?r.length&&(r.length=s=0):l instanceof Fn&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,r=this.builder,s=0,l=Ve.spans(this.decorations,e,t,{point:(o,c,h,d,p,g)=>{if(h instanceof _o){if(this.disallowBlockEffectsFor[g]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(o).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=d.length,p>d.length)r.continueWidget(c-o);else{let O=h.widget||(h.block?mc.block:mc.inline),b=hW(h),v=this.cache.findWidget(O,c-o,b)||Zo.of(O,this.view,c-o,b);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(v)):(r.ensureLine(i),r.addInlineWidget(v,d,p))}i=null}else i=fW(i,h);c>o&&this.text.skip(c-o)},span:(o,c,h,d)=>{for(let p=o;p<c;){let g=this.text.next(Math.min(512,c-p));g==null?(r.addLineStartIfNotCovered(i),r.addBreak(),p++):(r.ensureLine(i),r.addText(g,h,p==o?d:h.length),p+=g.length),i=null}}});r.addLineStartIfNotCovered(i),this.openWidget=l>s,this.openMarks=l}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=zt.get(r);if(r==this.view.contentDOM)break;s instanceof Fn?t.push(s):s!=null&&s.isLine()?i=s:s instanceof Ms||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new pc(r,qN):i||t.push(Fn.of(new df({tagName:r.nodeName.toLowerCase(),attributes:B6(r)}),r)))}return{line:i,marks:t}}}function XQ(n,e){let t=i=>{for(let r of i.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(n)}function hW(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const qN={class:"cm-line"};function fW(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:"cm-line"}),t&&ex(t,n),i&&(n.class+=" "+i)),n}function dW(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof Fn&&e.push(i.mark)}return e}function db(n){let e=zt.get(n);return e&&e.setDOM(n.cloneNode()),n}class mc extends ur{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}mc.inline=new mc("span");mc.block=new mc("div");const pb=new class extends ur{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class IQ{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=we.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Hg(e,e.contentDOM),this.updateInner([new Bi(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:d,toA:p})=>p<this.minWidthFrom||d>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!xW(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?mW(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;i=new Bi(d,p,e.changes.mapPos(d,-1),e.changes.mapPos(p,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Oe.ie||Oe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.blockWrappers;this.updateDeco();let c=yW(l,this.decorations,e.changes);c.length&&(i=Bi.extendWithRanges(i,c));let h=SW(o,this.blockWrappers,e.changes);return h.length&&(i=Bi.extendWithRanges(i,h)),s&&!i.some(d=>d.fromA<=s.range.fromA&&d.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let l=this.tile,o=new uW(this.view,l,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&zt.get(t.text)&&o.cache.reused.set(zt.get(t.text),2),this.tile=o.run(e,t),gS(l,o.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Oe.chrome||Oe.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof mb&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(ZN)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,l=!s&&!(this.view.state.facet(vs)||i.tabIndex>-1)&&mh(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||t||l))return;let o=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,h,d;if(c.empty?d=h=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),h=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),Oe.gecko&&c.empty&&!this.hasComposition&&pW(h)){let g=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(g,h.node.childNodes[h.offset]||null)),h=d=new ir(g,0),o=!0}let p=this.view.observer.selectionRange;(o||!p.focusNode||(!Oh(h.node,h.offset,p.anchorNode,p.anchorOffset)||!Oh(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{Oe.android&&Oe.chrome&&i.contains(p.focusNode)&&vW(p.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let g=Zh(this.view.root);if(g)if(c.empty){if(Oe.gecko){let O=gW(h.node,h.offset);if(O&&O!=3){let b=(O==1?wN:TN)(h.node,h.offset);b&&(h=new ir(b.node,b.offset))}}g.collapse(h.node,h.offset),c.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=c.bidiLevel)}else if(g.extend){g.collapse(h.node,h.offset);try{g.extend(d.node,d.offset)}catch{}}else{let O=document.createRange();c.anchor>c.head&&([h,d]=[d,h]),O.setEnd(d.node,d.offset),O.setStart(h.node,h.offset),g.removeAllRanges(),g.addRange(O)}l&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,d)),this.impreciseAnchor=h.precise?null:new ir(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new ir(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Oh(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Zh(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=this.lineAt(t.head,t.assoc);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let c=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!c||!h||c.bottom>h.top)return;let d=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(d.node,d.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=t.from&&i.collapse(r,s)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[t];else{let l=Rs(e)==0?0:t==0?-1:1;for(;;){let o=e.parentNode;if(o==i.dom)break;l==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?l=-1:l=1),e=o}l<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!zt.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let l=0,o=r;;l++){let c=i.children[l];if(c.dom==s)return o;o+=c.length+c.breakAfter}}else return i.isText()?e==i.dom?r+t:r+(t?i.length:0):r}domAtPos(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(r,t)}inlineDOMNearPos(e,t){let i,r=-1,s=!1,l,o=-1,c=!1;return this.tile.blockTiles((h,d)=>{if(h.isWidget()){if(h.flags&32&&d>=e)return!0;h.flags&16&&(s=!0)}else{let p=d+h.length;if(d<=e&&(i=h,r=e-d,s=p<e),p>=e&&!l&&(l=h,o=e-d,c=d>e),d>e&&l)return!0}}),!i&&!l?this.domAtPos(e,t):(s&&l?i=null:c&&i&&(l=null),i&&t<0||!l?i.domIn(r,t):l.domIn(o,t))}coordsAt(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof mb?null:i.coordsInWidget(r,t,!0):i.coordsIn(r,t)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(s,l){if(s.isComposite())for(let o of s.children){if(o.length>=l){let c=r(o,l);if(c)return c}if(l-=o.length,l<0)break}else if(s.isText()&&l<s.length){let o=nn(s.text,l);if(o==l)return null;let c=Xh(s.dom,l,o).getClientRects();for(let h=0;h<c.length;h++){let d=c[h];if(h==c.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return r(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,l=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,c=this.view.textDirection==gt.LTR,h=0,d=(p,g,O)=>{for(let b=0;b<p.children.length&&!(g>r);b++){let v=p.children[b],x=g+v.length,k=v.dom.getBoundingClientRect(),{height:C}=k;if(O&&!b&&(h+=k.top-O.top),v instanceof Ms)x>i&&d(v,g,k);else if(g>=i&&(h>0&&t.push(-h),t.push(C+h),h=0,l)){let A=v.dom.lastChild,P=A?gh(A):[];if(P.length){let E=P[P.length-1],D=c?E.right-k.left:k.right-E.left;D>o&&(o=D,this.minWidth=s,this.minWidthFrom=g,this.minWidthTo=x)}}O&&b==p.children.length-1&&(h+=O.bottom-k.bottom),g=x+v.breakAfter}};return d(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?gt.RTL:gt.LTR}measureTextSize(){let e=this.tile.blockTiles(l=>{if(l.isLine()&&l.children.length&&l.length<=20){let o=0,c;for(let h of l.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let d=gh(h.dom);if(d.length!=1)return;o+=d[0].width,c=d[0].height}if(o)return{lineHeight:l.dom.getBoundingClientRect().height,charWidth:o/l.length,textHeight:c}}});if(e)return e;let t=document.createElement("div"),i,r,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let l=gh(t.firstChild)[0];i=t.getBoundingClientRect().height,r=l&&l.width?l.width/27:7,s=l&&l.height?l.height:i,t.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],l=s?s.from-1:this.view.state.doc.length;if(l>i){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(we.replace({widget:new mb(o),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return we.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Vg).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(lx).map((s,l)=>{let o=typeof s=="function";return o&&(i=!0),o?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(Ve.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(XN).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var t;if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(BN))try{if(d(this.view,e.range,e))return!0}catch(p){Kn(this.view.state,p,"scroll handler")}let{range:i}=e,r=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),s;if(!r)return;!i.empty&&(s=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let l=ox(this.view),o={left:r.left-l.left,top:r.top-l.top,right:r.right+l.right,bottom:r.bottom+l.bottom},{offsetWidth:c,offsetHeight:h}=this.view.scrollDOM;if(X6(this.view.scrollDOM,o,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,c),-c),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==gt.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let d=this.view.docView.lineAt(i.head,1);d&&d.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){gS(this.tile)}}function gS(n,e){let t=e==null?void 0:e.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)gS(i,e)}}function pW(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function HN(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=wN(t.focusNode,t.focusOffset),r=TN(t.focusNode,t.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let o=zt.get(r.node);if(!o||o.isText()&&o.text!=r.node.nodeValue)s=r;else if(n.docView.lastCompositionAfterCursor){let c=zt.get(i.node);!c||c.isText()&&c.text!=i.node.nodeValue||(s=r)}}if(n.docView.lastCompositionAfterCursor=s!=i,!s)return null;let l=e-s.offset;return{from:l,to:l+s.node.nodeValue.length,node:s.node}}function mW(n,e,t){let i=HN(n,t);if(!i)return null;let{node:r,from:s,to:l}=i,o=r.nodeValue;if(/[\n\r]/.test(o)||n.state.doc.sliceString(i.from,i.to)!=o)return null;let c=e.invertedDesc;return{range:new Bi(c.mapPos(s),c.mapPos(l),s,l),text:r}}function gW(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let OW=class{constructor(){this.changes=[]}compareRange(e,t){Fa(e,t,this.changes)}comparePoint(e,t){Fa(e,t,this.changes)}boundChange(e){Fa(e,e,this.changes)}};function yW(n,e,t){let i=new OW;return Ve.compare(n,e,t,i),i.changes}class bW{constructor(){this.changes=[]}compareRange(e,t){Fa(e,t,this.changes)}comparePoint(){}boundChange(e){Fa(e,e,this.changes)}}function SW(n,e,t){let i=new bW;return Ve.compare(n,e,t,i),i.changes}function vW(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function xW(n,e){let t=!1;return e&&n.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(t=!0)}),t}class mb extends ur{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function kW(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return Y.cursor(e);s==0?t=1:s==r.length&&(t=-1);let l=s,o=s;t<0?l=nn(r.text,s,!1):o=nn(r.text,s);let c=i(r.text.slice(l,o));for(;l>0;){let h=nn(r.text,l,!1);if(i(r.text.slice(h,l))!=c)break;l=h}for(;o<r.length;){let h=nn(r.text,o);if(i(r.text.slice(o,h))!=c)break;o=h}return Y.range(l+r.from,o+r.from)}function wW(n,e,t,i,r){let s=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let o=n.viewState.heightOracle.textHeight,c=Math.floor((r-t.top-(n.defaultLineHeight-o)*.5)/o);s+=c*n.viewState.heightOracle.lineLength}let l=n.state.sliceDoc(t.from,t.to);return t.from+rS(l,s,n.state.tabSize)}function OS(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==yn.Text&&(r.type!=s.type||(t<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function TW(n,e,t,i){let r=OS(n,e.head,e.assoc||-1),s=!i||r.type!=yn.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let l=n.dom.getBoundingClientRect(),o=n.textDirectionAt(r.from),c=n.posAtCoords({x:t==(o==gt.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(c!=null)return Y.cursor(c,t?-1:1)}return Y.cursor(t?r.to:r.from,t?-1:1)}function VQ(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),l=n.textDirectionAt(r.from);for(let o=e,c=null;;){let h=J6(r,s,l,o,t),d=EN;if(!h){if(r.number==(t?n.state.doc.lines:1))return o;d=`
|
|
216
|
+
`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),h=n.visualLineSide(r,!t)}if(c){if(!c(d))return o}else{if(!i)return h;c=i(d)}o=h}}function CW(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let l=i(s);return r==Qt.Space&&(r=l),r==l}}function AW(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return Y.cursor(r,e.assoc);let l=e.goalColumn,o,c=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),d=n.documentTop;if(h)l==null&&(l=h.left-c.left),o=s<0?h.top:h.bottom;else{let b=n.viewState.lineBlockAt(r);l==null&&(l=Math.min(c.right-c.left,n.defaultCharacterWidth*(r-b.from))),o=(s<0?b.top:b.bottom)+d}let p=c.left+l,g=n.viewState.heightOracle.textHeight>>1,O=i??g;for(let b=0;;b+=g){let v=o+(O+b)*s,x=yS(n,{x:p,y:v},!1,s);if(t?v>c.bottom:v<c.top)return Y.cursor(x.pos,x.assoc);let k=n.coordsAtPos(x.pos,x.assoc),C=k?(k.top+k.bottom)/2:0;if(!k||(t?C>o:C<o))return Y.cursor(x.pos,x.assoc,void 0,l)}}function yh(n,e,t){for(;;){let i=0;for(let r of n)r.between(e-1,e+1,(s,l,o)=>{if(e>s&&e<l){let c=i||t||(e-s<l-e?-1:1);e=c<0?s:l,i=c}});if(!i)return e}}function YN(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let l=yh(n,r.from,0);l!=r.from&&(s=Y.cursor(l,-1))}else{let l=yh(n,r.from,-1),o=yh(n,r.to,1);(l!=r.from||o!=r.to)&&(s=Y.range(r.from==r.anchor?l:o,r.from==r.head?l:o))}s&&(t||(t=e.ranges.slice()),t[i]=s)}return t?Y.create(t,e.mainIndex):e}function gb(n,e,t){let i=yh(n.state.facet(mf).map(r=>r(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:Y.cursor(i,i<t.from?1:-1)}class Qr{constructor(e,t){this.pos=e,this.assoc=t}}function yS(n,e,t,i){let r=n.contentDOM.getBoundingClientRect(),s=r.top+n.viewState.paddingTop,{x:l,y:o}=e,c=o-s,h;for(;;){if(c<0)return new Qr(0,1);if(c>n.viewState.docHeight)return new Qr(n.state.doc.length,-1);if(h=n.elementAtHeight(c),i==null)break;if(h.type==yn.Text){if(i<0?h.to<n.viewport.from:h.from>n.viewport.to)break;let g=n.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(g&&(i<0?g.top<=c+s:g.bottom>=c+s))break}let p=n.viewState.heightOracle.textHeight/2;c=i>0?h.bottom+p:h.top-p}if(n.viewport.from>=h.to||n.viewport.to<=h.from){if(t)return null;if(h.type==yn.Text){let p=wW(n,r,h,l,o);return new Qr(p,p==h.from?1:-1)}}if(h.type!=yn.Text)return c<(h.top+h.bottom)/2?new Qr(h.from,1):new Qr(h.to,-1);let d=n.docView.lineAt(h.from,2);return(!d||d.length!=h.length)&&(d=n.docView.lineAt(h.from,-2)),new MW(n,l,o,n.textDirectionAt(h.from)).scanTile(d,h.from)}class MW{constructor(e,t,i,r){this.view=e,this.x=t,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[$r.find(r,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[$r.find(r,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<t)}scan(e,t,i=!1){let r=0,s=e.length-1,l=new Set,o=this.bidiIn(e[0],e[s]),c,h,d=-1,p=1e9,g;e:for(;r<s;){let b=s-r,v=r+s>>1;t:if(l.has(v)){let k=r+Math.floor(Math.random()*b);for(let C=0;C<b;C++){if(!l.has(k)){v=k;break t}k++,k==s&&(k=r)}break e}l.add(v);let x=t(v);if(x)for(let k=0;k<x.length;k++){let C=x[k],A=0;if(!(C.width==0&&x.length>1)){if(C.bottom<this.y)(!c||c.bottom<C.bottom)&&(c=C),A=1;else if(C.top>this.y)(!h||h.top>C.top)&&(h=C),A=-1;else{let P=C.left>this.x?this.x-C.left:C.right<this.x?this.x-C.right:0,E=Math.abs(P);E<p&&(d=v,p=E,g=C),P&&(A=P<0==(this.baseDir==gt.LTR)?-1:1)}A==-1&&(!o||this.baseDirAt(e[v],1))?s=v:A==1&&(!o||this.baseDirAt(e[v+1],-1))&&(r=v+1)}}}if(!g){let b=c&&(!h||this.y-c.bottom<h.top-this.y)?c:h;return this.y=(b.top+b.bottom)/2,this.scan(e,t,!0)}if(p&&!i){let{top:b,bottom:v}=g;if(c&&c.bottom>(b+b+v)/3)return this.y=c.bottom-1,this.scan(e,t,!0);if(h&&h.top<(b+v+v)/3)return this.y=h.top+1,this.scan(e,t,!0)}let O=(o?this.dirAt(e[d],1):this.baseDir)==gt.LTR;return{i:d,after:this.x>(g.left+g.right)/2==O}}scanText(e,t){let i=[];for(let s=0;s<e.length;s=nn(e.text,s))i.push(t+s);i.push(t+e.length);let r=this.scan(i,s=>{let l=i[s]-t,o=i[s+1]-t;return Xh(e.dom,l,o).getClientRects()});return r.after?new Qr(i[r.i+1],-1):new Qr(i[r.i],1)}scanTile(e,t){if(!e.length)return new Qr(t,1);if(e.children.length==1){let o=e.children[0];if(o.isText())return this.scanText(o,t);if(o.isComposite())return this.scanTile(o,t)}let i=[t];for(let o=0,c=t;o<e.children.length;o++)i.push(c+=e.children[o].length);let r=this.scan(i,o=>{let c=e.children[o];return c.flags&48?null:(c.dom.nodeType==1?c.dom:Xh(c.dom,0,c.length)).getClientRects()}),s=e.children[r.i],l=i[r.i];return s.isText()?this.scanText(s,l):s.isComposite()?this.scanTile(s,l):r.after?new Qr(i[r.i+1],-1):new Qr(l,1)}}const ja="";class QW{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Ye.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=ja}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let l=zt.get(r),o=r.nextSibling;if(o==t){l!=null&&l.breakAfter&&!o&&i!=this.view.contentDOM&&this.lineBreak();break}let c=zt.get(o);(l&&c?l.breakAfter:(l?l.breakAfter:jm(r))||jm(o)&&(r.nodeName!="BR"||l!=null&&l.isWidget())&&this.text.length>s)&&!$W(o,t)&&this.lineBreak(),r=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,o;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(o=r.exec(t))&&(s=o.index,l=o[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=l-1);i=s+l}}readNode(e){let t=zt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(EW(e,i.node,i.offset)?t:0))}}function EW(n,e,t){for(;;){if(!e||t<Rs(e))return!1;if(e==n)return!0;t=zl(e)+1,e=e.parentNode}}function $W(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=zt.get(n);if(!(i!=null&&i.isWidget()))return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class qQ{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class RW{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:l}=e.docView,o=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=UN(e.docView.tile,t,i,0))){let c=s||l?[]:DW(e),h=new QW(c,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=NW(c,this.bounds.from)}else{let c=e.observer.selectionRange,h=s&&s.node==c.focusNode&&s.offset==c.focusOffset||!hS(e.contentDOM,c.focusNode)?o.main.head:e.docView.posFromDOM(c.focusNode,c.focusOffset),d=l&&l.node==c.anchorNode&&l.offset==c.anchorOffset||!hS(e.contentDOM,c.anchorNode)?o.main.anchor:e.docView.posFromDOM(c.anchorNode,c.anchorOffset),p=e.viewport;if((Oe.ios||Oe.chrome)&&o.main.empty&&h!=d&&(p.from>0||p.to<e.state.doc.length)){let g=Math.min(h,d),O=Math.max(h,d),b=p.from-g,v=p.to-O;(b==0||b==1||g==0)&&(v==0||v==-1||O==e.state.doc.length)&&(h=0,d=e.state.doc.length)}if(e.inputState.composing>-1&&o.ranges.length>1)this.newSel=o.replaceRange(Y.range(d,h));else if(e.lineWrapping&&d==h&&!(o.main.empty&&o.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let g=e.coordsAtPos(h,-1),O=0;g&&(O=e.inputState.lastTouchY<=g.bottom?-1:1),this.newSel=Y.create([Y.cursor(h,O)])}else this.newSel=Y.single(d,h)}}}function UN(n,e,t,i){if(n.isComposite()){let r=-1,s=-1,l=-1,o=-1;for(let c=0,h=i,d=i;c<n.children.length;c++){let p=n.children[c],g=h+p.length;if(h<e&&g>t)return UN(p,e,t,h);if(g>=e&&r==-1&&(r=c,s=h),h>t&&p.dom.parentNode==n.dom){l=c,o=d;break}d=g,h=g+p.breakAfter}return{from:s,to:o<0?i+n.length:o,startDOM:(r?n.children[r-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:l<n.children.length&&l>=0?n.children[l].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function WN(n,e){let t,{newSel:i}=e,{state:r}=n,s=r.selection.main,l=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:c}=e.bounds,h=s.from,d=null;(l===8||Oe.android&&e.text.length<c-o)&&(h=s.to,d="end");let p=r.doc.sliceString(o,c,ja),g,O;!s.empty&&s.from>=o&&s.to<=c&&(e.typeOver||p!=e.text)&&p.slice(0,s.from-o)==e.text.slice(0,s.from-o)&&p.slice(s.to-o)==e.text.slice(g=e.text.length-(p.length-(s.to-o)))?t={from:s.from,to:s.to,insert:Ge.of(e.text.slice(s.from-o,g).split(ja))}:(O=GN(p,e.text,h-o,d))&&(Oe.chrome&&l==13&&O.toB==O.from+2&&e.text.slice(O.from,O.toB)==ja+ja&&O.toB--,t={from:o+O.from,to:o+O.toA,insert:Ge.of(e.text.slice(O.from,O.toB).split(ja))})}else i&&(!n.hasFocus&&r.facet(vs)||qm(i,s))&&(i=null);if(!t&&!i)return!1;if((Oe.mac||Oe.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=Y.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:Ge.of([t.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&n.docView.lineHasWidget(s.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:r.toText(n.inputState.insertingText)}:Oe.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
|
|
217
|
+
`&&n.lineWrapping&&(i&&(i=Y.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Ge.of([" "])}),t)return ax(n,t,i,l);if(i&&!qm(i,s)){let o=!1,c="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),c=n.inputState.lastSelectionOrigin,c=="select.pointer"&&(i=YN(r.facet(mf).map(h=>h(n)),i))),n.dispatch({selection:i,scrollIntoView:o,userEvent:c}),!0}else return!1}function ax(n,e,t,i=-1){if(Oe.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if(Oe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ka(n.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Ka(n.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Ka(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let l,o=()=>l||(l=PW(n,e,t));return n.state.facet(NN).some(c=>c(n,e.from,e.to,s,o))||n.dispatch(o()),!0}function PW(n,e,t){let i,r=n.state,s=r.selection.main,l=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let c=e.from<s.from?-1:1,h=c<0?s.from:s.to,d=yh(r.facet(mf).map(p=>p(n)),h,c);e.from==d&&(l=d)}if(l>-1)i={changes:e,selection:Y.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let c=s.from<e.from?r.sliceDoc(s.from,e.from):"",h=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(n.state.toText(c+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let c=r.changes(e),h=t&&t.main.to<=c.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let d=n.state.sliceDoc(e.from,e.to),p,g=t&&HN(n,t.main.head);if(g){let b=e.insert.length-(e.to-e.from);p={from:g.from,to:g.to-b}}else p=n.state.doc.lineAt(s.head);let O=s.to-e.to;i=r.changeByRange(b=>{if(b.from==s.from&&b.to==s.to)return{changes:c,range:h||b.map(c)};let v=b.to-O,x=v-d.length;if(n.state.sliceDoc(x,v)!=d||v>=p.from&&x<=p.to)return{range:b};let k=r.changes({from:x,to:v,insert:e.insert}),C=b.to-s.to;return{changes:k,range:h?Y.range(Math.max(0,h.anchor+C),Math.max(0,h.head+C)):b.map(k)}})}else i={changes:c,selection:h&&r.selection.replaceRange(h)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:o,scrollIntoView:!0})}function GN(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s<r&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&n.length==e.length)return null;let l=n.length,o=e.length;for(;l>0&&o>0&&n.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(i=="end"){let c=Math.max(0,s-Math.min(l,o));t-=l+c-s}if(l<s&&n.length<e.length){let c=t<=s&&t>=l?s-t:0;s-=c,o=s+(o-l),l=s}else if(o<s){let c=t<=s&&t>=o?s-t:0;s-=c,l=s+(l-o),o=s}return{from:s,toA:l,toB:o}}function DW(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new qQ(t,i)),(r!=t||s!=i)&&e.push(new qQ(r,s))),e}function NW(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?Y.single(t+e,i+e):null}function qm(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class zW{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Oe.safari&&e.contentDOM.addEventListener("input",()=>null),Oe.gecko&&FW(e.contentDOM.ownerDocument)}handleEvent(e){!VW(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=LW(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,o=i[s];o&&l!=!o.handlers.length&&(r.removeEventListener(s,this.handleEvent),o=null),o||r.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&KN.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Oe.android&&Oe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Oe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=FN.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||_W.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Ka(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Oe.safari&&!Oe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function HQ(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){Kn(t.state,r)}}}function LW(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec,s=r&&r.plugin.domEventHandlers,l=r&&r.plugin.domEventObservers;if(s)for(let o in s){let c=s[o];c&&t(o).handlers.push(HQ(i.value,c))}if(l)for(let o in l){let c=l[o];c&&t(o).observers.push(HQ(i.value,c))}}for(let i in ar)t(i).handlers.push(ar[i]);for(let i in ti)t(i).observers.push(ti[i]);return e}const FN=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],_W="dthko",KN=[16,17,18,20,91,92,224,225],lp=6;function op(n){return Math.max(0,n)*.7+8}function BW(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class ZW{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=vN(e.contentDOM),this.atoms=e.state.facet(mf).map(l=>l(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Ye.allowMultipleSelections)&&jW(e,t),this.dragging=IW(e,t)&&tz(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&BW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,s=0,l=this.view.win.innerWidth,o=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:l}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:o}=this.scrollParents.y.getBoundingClientRect());let c=ox(this.view);e.clientX-c.left<=r+lp?t=-op(r-e.clientX):e.clientX+c.right>=l-lp&&(t=op(e.clientX-l)),e.clientY-c.top<=s+lp?i=-op(s-e.clientY):e.clientY+c.bottom>=o-lp&&(i=op(e.clientY-o)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=YN(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function jW(n,e){let t=n.state.facet($N);return t.length?t[0](e):Oe.mac?e.metaKey:e.ctrlKey}function XW(n,e){let t=n.state.facet(RN);return t.length?t[0](e):Oe.mac?!e.altKey:!e.ctrlKey}function IW(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Zh(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let l=r[s];if(l.left<=e.clientX&&l.right>=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function VW(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=zt.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const ar=Object.create(null),ti=Object.create(null),JN=Oe.ie&&Oe.ie_version<15||Oe.ios&&Oe.webkit_version<604;function qW(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),ez(n,t.value)},50)}function Yg(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function ez(n,e){e=Yg(n.state,ix,e);let{state:t}=n,i,r=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if(bS!=null&&t.selection.ranges.every(c=>c.empty)&&bS==s.toString()){let c=-1;i=t.changeByRange(h=>{let d=t.doc.lineAt(h.from);if(d.from==c)return{range:h};c=d.from;let p=t.toText((l?s.line(r++).text:e)+t.lineBreak);return{changes:{from:d.from,insert:p},range:Y.cursor(h.from+p.length)}})}else l?i=t.changeByRange(c=>{let h=s.line(r++);return{changes:{from:c.from,to:c.to,insert:h.text},range:Y.cursor(c.from+h.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ti.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};ti.wheel=ti.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};ar.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ti.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};ti.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};ar.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(PN))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=YW(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new ZW(n,e,t,i)),i&&n.observer.ignore(()=>{xN(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function YQ(n,e,t,i){if(i==1)return Y.cursor(e,t);if(i==2)return kW(n.state,e,t);{let r=n.docView.lineAt(e,t),s=n.state.doc.lineAt(r?r.posAtEnd:e),l=r?r.posAtStart:s.from,o=r?r.posAtEnd:s.to;return o<n.state.doc.length&&o==s.to&&o++,Y.range(l,o)}}const HW=Oe.ie&&Oe.ie_version<=11;let UQ=null,WQ=0,GQ=0;function tz(n){if(!HW)return n.detail;let e=UQ,t=GQ;return UQ=n,GQ=Date.now(),WQ=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(WQ+1)%3:1}function YW(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=tz(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,l,o){let c=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,d=YQ(n,c.pos,c.assoc,i);if(t.pos!=c.pos&&!l){let p=YQ(n,t.pos,t.assoc,i),g=Math.min(p.from,d.from),O=Math.max(p.to,d.to);d=g<d.from?Y.range(g,O,d.assoc):Y.range(O,g,d.assoc)}return l?r.replaceRange(r.main.extend(d.from,d.to,d.assoc)):o&&i==1&&r.ranges.length>1&&(h=UW(r,c.pos))?h:o?r.addRange(d):Y.create([d])}}}function UW(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:r}=n.ranges[t];if(i<=e&&r>=e)return Y.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}ar.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,l=s+r.length;(s>=t.to||l<=t.from)&&(t=Y.range(s,l))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Yg(n.state,rx,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ar.dragend=n=>(n.inputState.draggedContent=null,!1);function FQ(n,e,t,i){if(t=Yg(n.state,ix,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,l=i&&s&&XW(n,e)?{from:s.from,to:s.to}:null,o={from:r,insert:t},c=n.state.changes(l?[l,o]:o);n.focus(),n.dispatch({changes:c,selection:{anchor:c.mapPos(r,-1),head:c.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),n.inputState.draggedContent=null}ar.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&FQ(n,e,i.filter(l=>l!=null).join(n.state.lineBreak),!1)};for(let l=0;l<t.length;l++){let o=new FileReader;o.onerror=s,o.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(i[l]=o.result),s()},o.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return FQ(n,e,i,!0),!0}return!1};ar.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=JN?null:e.clipboardData;return t?(ez(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(qW(n),!1)};function WW(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function GW(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let l=n.doc.lineAt(s);l.number>r&&(e.push(l.text),t.push({from:l.from,to:Math.min(n.doc.length,l.to+1)})),r=l.number}i=!0}return{text:Yg(n,rx,e.join(n.lineBreak)),ranges:t,linewise:i}}let bS=null;ar.copy=ar.cut=(n,e)=>{if(!mh(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:r}=GW(n.state);if(!t&&!r)return!1;bS=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=JN?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(WW(n,t),!1)};const nz=Xr.define();function iz(n,e){let t=[];for(let i of n.facet(zN)){let r=i(n,e);r&&t.push(r)}return t.length?n.update({effects:t,annotations:nz.of(!0)}):null}function rz(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=iz(n.state,e);t?n.dispatch(t):n.update([])}},10)}ti.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),rz(n)};ti.blur=n=>{n.observer.clearSelectionRange(),rz(n)};ti.compositionstart=ti.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ti.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Oe.chrome&&Oe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ti.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};ar.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),l=e.getTargetRanges();if(s&&l.length){let o=l[0],c=n.posAtDOM(o.startContainer,o.startOffset),h=n.posAtDOM(o.endContainer,o.endOffset);return ax(n,{from:c,to:h,insert:n.state.toText(s)},null),!0}}let r;if(Oe.chrome&&Oe.android&&(r=FN.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var l;(((l=window.visualViewport)===null||l===void 0?void 0:l.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Oe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Oe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ti.compositionend(n,e),20),!1};const KQ=new Set;function FW(n){KQ.has(n)||(KQ.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const JQ=["pre-wrap","normal","pre-line","break-spaces"];let gc=!1;function eE(){gc=!1}class KW{constructor(e){this.lineWrapping=e,this.doc=Ge.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return JQ.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,i,r,s,l){let o=JQ.indexOf(e)>-1,c=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,c){this.heightSamples={};for(let h=0;h<l.length;h++){let d=l[h];d<0?h++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class JW{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class tr{constructor(e,t,i,r,s){this.from=e,this.length=t,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?yn.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof _o?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new tr(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var St=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(St||(St={}));const Lp=.001;class Nn{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Lp&&(gc=!0),this.height=e)}replace(e,t,i){return Nn.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,l=i.doc;for(let o=r.length-1;o>=0;o--){let{fromA:c,toA:h,fromB:d,toB:p}=r[o],g=s.lineAt(c,St.ByPosNoHeight,i.setDoc(t),0,0),O=g.to>=h?g:s.lineAt(h,St.ByPosNoHeight,i,0,0);for(p+=O.to-h,h=O.to;o>0&&g.from<=r[o-1].toA;)c=r[o-1].fromA,d=r[o-1].fromB,o--,c<g.from&&(g=s.lineAt(c,St.ByPosNoHeight,i,0,0));d+=g.from-c,c=g.from;let b=cx.build(i.setDoc(l),e,d,p);s=Hm(s,s.replace(c,h,b))}return s.updateHeight(i,0)}static empty(){return new mi(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,r=0,s=0;for(;;)if(t==i)if(r>s*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),i+=1+o.break,r-=o.size}else if(s>r*2){let o=e[i];o.break?e.splice(i,1,o.left,null,o.right):e.splice(i,1,o.left,o.right),i+=2+o.break,s-=o.size}else break;else if(r<s){let o=e[t++];o&&(r+=o.size)}else{let o=e[--i];o&&(s+=o.size)}let l=0;return e[t-1]==null?(l=1,t--):e[t]==null&&(l=1,i++),new t7(Nn.of(e.slice(0,t)),l,Nn.of(e.slice(i)))}}function Hm(n,e){return n==e?n:(n.constructor!=e.constructor&&(gc=!0),e)}Nn.prototype.size=1;const e7=we.replace({});class sz extends Nn{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new tr(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new tr(r,0,i,this.spaceAbove,e7):this.mainBlock(i,r)}lineAt(e,t,i,r,s){let l=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(l):l}forEachLine(e,t,i,r,s,l){e<=s+this.length&&t>=s&&l(this.lineAt(0,St.ByPos,i,r,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class mi extends sz{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new tr(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof mi||r instanceof dn&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof dn?r=new mi(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):Nn.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class dn extends Nn{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,l,o=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*s);l=c/s,this.length>s+1&&(o=(this.height-c)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:r,perLine:l,perChar:o}}blockAt(e,t,i,r){let{firstLine:s,lastLine:l,perLine:o,perChar:c}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),d=t.doc.lineAt(h),p=o+d.length*c,g=Math.max(i,e-p/2);return new tr(d.from,d.length,g,p,0)}else{let h=Math.max(0,Math.min(l-s,Math.floor((e-i)/o))),{from:d,length:p}=t.doc.line(s+h);return new tr(d,p,i+o*h,o,0)}}lineAt(e,t,i,r,s){if(t==St.ByHeight)return this.blockAt(e,i,r,s);if(t==St.ByPosNoHeight){let{from:O,to:b}=i.doc.lineAt(e);return new tr(O,b-O,0,0,0)}let{firstLine:l,perLine:o,perChar:c}=this.heightMetrics(i,s),h=i.doc.lineAt(e),d=o+h.length*c,p=h.number-l,g=r+o*p+c*(h.from-s-p);return new tr(h.from,h.length,Math.max(r,Math.min(g,r+this.height-d)),d,0)}forEachLine(e,t,i,r,s,l){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:o,perLine:c,perChar:h}=this.heightMetrics(i,s);for(let d=e,p=r;d<=t;){let g=i.doc.lineAt(d);if(d==e){let b=g.number-o;p+=c*b+h*(e-s-b)}let O=c+h*g.length;l(new tr(g.from,g.length,p,O,0)),p+=O,d=g.to+1}}replace(e,t,i){let r=this.length-t;if(r>0){let s=i[i.length-1];s instanceof dn?i[i.length-1]=new dn(s.length+r):i.push(null,new dn(r-1))}if(e>0){let s=i[0];s instanceof dn?i[0]=new dn(e+s.length):i.unshift(new dn(e-1),null)}return Nn.of(i)}decomposeLeft(e,t){t.push(new dn(e-1),null)}decomposeRight(e,t){t.push(null,new dn(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let l=[],o=Math.max(t,r.from),c=-1;for(r.from>t&&l.push(new dn(r.from-t-1).updateHeight(e,t));o<=s&&r.more;){let d=e.doc.lineAt(o).length;l.length&&l.push(null);let p=r.heights[r.index++],g=0;p<0&&(g=-p,p=r.heights[r.index++]),c==-1?c=p:Math.abs(p-c)>=Lp&&(c=-2);let O=new mi(d,p,g);O.outdated=!1,l.push(O),o+=d+1}o<=s&&l.push(null,new dn(s-o).updateHeight(e,o));let h=Nn.of(l);return(c<0||Math.abs(h.height-this.height)>=Lp||Math.abs(c-this.heightMetrics(e,t).perLine)>=Lp)&&(gc=!0),Hm(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class t7 extends Nn{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,t,i,r):this.right.blockAt(e,t,s,r+this.left.length+this.break)}lineAt(e,t,i,r,s){let l=r+this.left.height,o=s+this.left.length+this.break,c=t==St.ByHeight?e<l:e<o,h=c?this.left.lineAt(e,t,i,r,s):this.right.lineAt(e,t,i,l,o);if(this.break||(c?h.to<o:h.from>o))return h;let d=t==St.ByPosNoHeight?St.ByPosNoHeight:St.ByPos;return c?h.join(this.right.lineAt(o,d,i,l,o)):this.left.lineAt(o,d,i,r,s).join(h)}forEachLine(e,t,i,r,s,l){let o=r+this.left.height,c=s+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,t,i,r,s,l),t>=c&&this.right.forEachLine(e,t,i,o,c,l);else{let h=this.lineAt(c,St.ByPos,i,r,s);e<h.from&&this.left.forEachLine(e,h.from-1,i,r,s,l),h.to>=e&&h.from<=t&&l(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,o,c,l)}}replace(e,t,i){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let o of i)s.push(o);if(e>0&&tE(s,l-1),t<this.length){let o=s.length;this.decomposeRight(t,s),tE(s,o)}return Nn.of(s)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?Nn.of(this.break?[e,null,t]:[e,t]):(this.left=Hm(this.left,e),this.right=Hm(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:s,right:l}=this,o=t+s.length+this.break,c=null;return r&&r.from<=t+s.length&&r.more?c=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=o+l.length&&r.more?c=l=l.updateHeight(e,o,i,r):l.updateHeight(e,o,i),c?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function tE(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof dn&&(i=n[e+1])instanceof dn&&n.splice(e-1,3,new dn(t.length+1+i.length))}const n7=5;class cx{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof mi?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new mi(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let l=t-e;i.block?this.addBlock(new sz(l,r,i)):(l||s||r>=n7)&&this.addLineDeco(r,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new mi(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new dn(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof mi)return e;let t=new mi(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof mi)&&!this.isCovered?this.nodes.push(new mi(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof mi&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,t,i,r){let s=new cx(i,e);return Ve.spans(t,i,r,s,0),s.finish(i)}}function i7(n,e,t){let i=new r7;return Ve.compare(n,e,t,i,0),i.changes}class r7{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,r){(e<t||i&&i.heightRelevant||r&&r.heightRelevant)&&Fa(e,t,this.changes,5)}}function s7(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,r=i.defaultView||window,s=Math.max(0,t.left),l=Math.min(r.innerWidth,t.right),o=Math.max(0,t.top),c=Math.min(r.innerHeight,t.bottom);for(let h=n.parentNode;h&&h!=i.body;)if(h.nodeType==1){let d=h,p=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&p.overflow!="visible"){let g=d.getBoundingClientRect();s=Math.max(s,g.left),l=Math.min(l,g.right),o=Math.max(o,g.top),c=Math.min(h==n.parentNode?r.innerHeight:c,g.bottom)}h=p.position=="absolute"||p.position=="fixed"?d.offsetParent:d.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,c)-(t.top+e)}}function l7(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function o7(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Ob{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=t[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,t){return we.replace({widget:new a7(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class a7 extends ur{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class nE{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=iE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=gt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(sx).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new KW(i),this.stateDeco=rE(t),this.heightMap=Nn.empty().applyChanges(this.stateDeco,Ge.empty,this.heightOracle.setDoc(t.doc),[new Bi(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=we.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>r>=s&&r<=l)){let{from:s,to:l}=this.lineBlockAt(r);e.push(new ap(s,l))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?iE:new ux(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Ku(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=rE(this.state);let r=e.changedRanges,s=Bi.extendWithRanges(r,i7(i,this.stateDeco,e?e.changes:Ft.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);eE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=l||gc)&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=l);let c=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<c.from||t.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(_N)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?gt.RTL:gt.LTR;let l=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",o=t.getBoundingClientRect(),c=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let h=0,d=0;if(o.width&&o.height){let{scaleX:E,scaleY:D}=SN(t,o);(E>.005&&Math.abs(this.scaleX-E)>.005||D>.005&&Math.abs(this.scaleY-D)>.005)&&(this.scaleX=E,this.scaleY=D,h|=16,l=c=!0)}let p=(parseInt(i.paddingTop)||0)*this.scaleY,g=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let O=vN(this.view.contentDOM,!1).y;O!=this.scrollParent&&(this.scrollParent=O,this.scrollAnchorHeight=-1,this.scrollOffset=0);let b=this.getScrollOffset();this.scrollOffset!=b&&(this.scrollAnchorHeight=-1,this.scrollOffset=b),this.scrolledToBottom=kN(this.scrollParent||e.win);let v=(this.printing?o7:s7)(t,this.paddingTop),x=v.top-this.pixelViewport.top,k=v.bottom-this.pixelViewport.bottom;this.pixelViewport=v;let C=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(C!=this.inView&&(this.inView=C,C&&(c=!0)),!this.inView&&!this.scrollTarget&&!l7(e.dom))return 0;let A=o.width;if((this.contentDOMWidth!=A||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),c){let E=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(E)&&(l=!0),l||r.lineWrapping&&Math.abs(A-this.contentDOMWidth)>r.charWidth){let{lineHeight:D,charWidth:$,textHeight:H}=e.docView.measureTextSize();l=D>0&&r.refresh(s,D,$,H,Math.max(5,A/$),E),l&&(e.docView.minWidth=0,h|=16)}x>0&&k>0?d=Math.max(x,k):x<0&&k<0&&(d=Math.min(x,k)),eE();for(let D of this.viewports){let $=D.from==this.viewport.from?E:e.docView.measureVisibleLineHeights(D);this.heightMap=(l?Nn.empty().applyChanges(this.stateDeco,Ge.empty,this.heightOracle,[new Bi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,l,new JW(D.from,$))}gc&&(h|=2)}let P=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return P&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),h|=this.updateForViewport()),(h&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,c=new ap(r.lineAt(l-i*1e3,St.ByHeight,s,0,0).from,r.lineAt(o+(1-i)*1e3,St.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(h<c.from||h>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(h,St.ByPos,s,0,0),g;t.y=="center"?g=(p.top+p.bottom)/2-d/2:t.y=="start"||t.y=="nearest"&&h<c.from?g=p.top:g=p.bottom-d,c=new ap(r.lineAt(g-1e3/2,St.ByHeight,s,0,0).from,r.lineAt(g+d+1e3/2,St.ByHeight,s,0,0).to)}}return c}mapViewport(e,t){let i=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new ap(this.heightMap.lineAt(i,St.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,St.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,St.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,St.ByPos,this.heightOracle,0,0),{visibleTop:l,visibleBottom:o}=this;return(e==0||r<=l-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||s>=o+Math.max(10,Math.min(i,250)))&&r>l-2*1e3&&s<o+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let r of e)t.touchesRange(r.from,r.to)||i.push(new Ob(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,l=r<<1;if(this.defaultTextDirection!=gt.LTR&&!i)return[];let o=[],c=(d,p,g,O)=>{if(p-d<s)return;let b=this.state.selection.main,v=[b.from];b.empty||v.push(b.to);for(let k of v)if(k>d&&k<p){c(d,k-10,g,O),c(k+10,p,g,O);return}let x=u7(e,k=>k.from>=g.from&&k.to<=g.to&&Math.abs(k.from-d)<s&&Math.abs(k.to-p)<s&&!v.some(C=>k.from<C&&k.to>C));if(!x){if(p<g.to&&t&&i&&t.visibleRanges.some(A=>A.from<=p&&A.to>=p)){let A=t.moveToLineBoundary(Y.cursor(p),!1,!0).head;A>d&&(p=A)}let k=this.gapSize(g,d,p,O),C=i||k<2e6?k:2e6;x=new Ob(d,p,k,C)}o.push(x)},h=d=>{if(d.length<l||d.type!=yn.Text)return;let p=c7(d.from,d.to,this.stateDeco);if(p.total<l)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,O,b;if(i){let v=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,x,k;if(g!=null){let C=up(p,g),A=((this.visibleBottom-this.visibleTop)/2+v)/d.height;x=C-A,k=C+A}else x=(this.visibleTop-d.top-v)/d.height,k=(this.visibleBottom-d.top+v)/d.height;O=cp(p,x),b=cp(p,k)}else{let v=p.total*this.heightOracle.charWidth,x=r*this.heightOracle.charWidth,k=0;if(v>2e6)for(let D of e)D.from>=d.from&&D.from<d.to&&D.size!=D.displaySize&&D.from*this.heightOracle.charWidth+k<this.pixelViewport.left&&(k=D.size-D.displaySize);let C=this.pixelViewport.left+k,A=this.pixelViewport.right+k,P,E;if(g!=null){let D=up(p,g),$=((A-C)/2+x)/v;P=D-$,E=D+$}else P=(C-x)/v,E=(A+x)/v;O=cp(p,P),b=cp(p,E)}O>d.from&&c(d.from,O,d,p),b<d.to&&c(b,d.to,d,p)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(h):h(d);return o}gapSize(e,t,i,r){let s=up(r,i)-up(r,t);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Ob.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=we.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];Ve.spans(t,this.viewport.from,this.viewport.to,{span(s,l){i.push({from:s,to:l})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let l=this.visibleRanges[s],o=i[s];(l.from!=o.from||l.to!=o.to)&&(r|=4,e&&e.mapPos(l.from,-1)==o.from&&e.mapPos(l.to,1)==o.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ku(this.heightMap.lineAt(e,St.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Ku(this.heightMap.lineAt(this.scaler.fromDOM(e),St.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Ku(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ap{constructor(e,t){this.from=e,this.to=t}}function c7(n,e,t){let i=[],r=n,s=0;return Ve.spans(t,n,e,{span(){},point(l,o){l>r&&(i.push({from:r,to:l}),s+=l-r),r=o}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function cp({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:l}=e[r],o=l-s;if(i<=o)return s+i;i-=o}}function up(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function u7(n,e){for(let t of n)if(e(t))return t}const iE={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function rE(n){let e=n.facet(Vg).filter(i=>typeof i!="function"),t=n.facet(lx).filter(i=>typeof i!="function");return t.length&&e.push(Ve.join(t)),e}class ux{constructor(e,t,i){let r=0,s=0,l=0;this.viewports=i.map(({from:o,to:c})=>{let h=t.lineAt(o,St.ByPos,e,0,0).top,d=t.lineAt(c,St.ByPos,e,0,0).bottom;return r+=d-h,{from:o,to:c,top:h,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let o of this.viewports)o.domTop=l+(o.top-s)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let t=0,i=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof ux?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function Ku(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new tr(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>Ku(r,e)):n._content)}const hp=me.define({combine:n=>n.join(" ")}),SS=me.define({combine:n=>n.indexOf(!0)>-1}),vS=Nl.newName(),lz=Nl.newName(),oz=Nl.newName(),az={"&light":"."+lz,"&dark":"."+oz};function xS(n,e,t){return new Nl(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const h7=xS("."+vS,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},az),f7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},yb=Oe.ie&&Oe.ie_version<=11;class d7{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new I6,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Oe.ie&&Oe.ie_version<=11||Oe.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Oe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Oe.chrome&&Oe.chrome_version<126)&&(this.editContext=new m7(e),e.state.facet(vs)&&(e.contentDOM.editContext=this.editContext.editContext)),yb&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(vs)?i.root.activeElement!=this.dom:!mh(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Oe.ie&&Oe.ie_version<=11||Oe.android&&Oe.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Oh(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Zh(e.root);if(!t)return!1;let i=Oe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&p7(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=mh(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&q6(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,f7),yb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),yb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Ka(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(r=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&mh(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new RW(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=WN(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!qm(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=sE(t,e.previousSibling||e.target.previousSibling,-1),r=sE(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(vs)!=e.state.facet(vs)&&(e.view.contentDOM.editContext=e.state.facet(vs)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function sE(n,e,t){for(;e;){let i=zt.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function lE(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,l=n.docView.domAtPos(n.state.selection.main.anchor,1);return Oh(l.node,l.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function p7(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return lE(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?lE(n,t):null}class m7{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:l}=r,o=this.toEditorPos(i.updateRangeStart),c=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:o,drifted:!1});let h=c-o>i.text.length;o==this.from&&s<this.from?o=s:c==this.to&&s>this.to&&(c=s);let d=GN(e.state.sliceDoc(o,c),i.text,(h?r.from:r.to)-o,h?"end":null);if(!d){let g=Y.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));qm(g,r)||e.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+o,to:d.toA+o,insert:Ge.of(i.text.slice(d.from,d.toB).split(`
|
|
218
|
+
`))};if((Oe.mac||Oe.android)&&p.from==l-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:o,to:c,insert:Ge.of([i.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);ax(e,p,Y.single(this.toEditorPos(i.selectionStart,g),this.toEditorPos(i.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let l=this.toEditorPos(i.rangeStart),o=this.toEditorPos(i.rangeEnd);l<o;l++){let c=e.coordsForChar(l);s=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let l=s.underlineStyle,o=s.underlineThickness;if(!/none/i.test(l)&&!/none/i.test(o)){let c=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(c<h){let d=`text-decoration: underline ${/^[a-z]/.test(l)?l+" ":l=="Dashed"?"dashed ":l=="Squiggle"?"wavy ":""}${/thin/i.test(o)?1:2}px`;r.push(we.mark({attributes:{style:d}}).range(c,h))}}}e.dispatch({effects:ZN.of(we.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=Zh(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,l,o,c,h)=>{if(i)return;let d=h.length-(l-s);if(r&&l>=r.to)if(r.from==s&&r.to==l&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=d,this.to+=d;return}else r=null,this.revertPending(e.state);if(s+=t,l+=t,l<=this.from)this.from+=d,this.to+=d;else if(s<this.to){if(s<this.from||l>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(l),h.toString()),this.to+=d}t+=d}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class fe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||V6(e.parent)||document,this.viewState=new nE(this,e.state||Ye.create(e)),e.scrollTo&&e.scrollTo.is(sp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Va).map(r=>new fb(r));for(let r of this.plugins)r.update(this);this.observer=new d7(this),this.inputState=new zW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new IQ(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Yt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,s=this.state;for(let g of e){if(g.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=g.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,o=0,c=null;e.some(g=>g.annotation(nz))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,c=iz(s,l),c||(o=1));let h=this.observer.delayedAndroidKey,d=null;if(h?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(d=null)):this.observer.clear(),s.facet(Ye.phrases)!=this.state.facet(Ye.phrases))return this.setState(s);r=Xm.create(this,s,e),r.flags|=o;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:O}=g.state.selection,{x:b,y:v}=this.state.facet(fe.cursorScrollMargin);p=new Ja(O.empty?O:Y.cursor(O.head,O.head>O.anchor?-1:1),"nearest","nearest",v,b)}for(let O of g.effects)O.is(sp)&&(p=O.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=Ym.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Fu)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(hp)!=r.state.facet(hp)&&(this.viewState.mustMeasureContent=!0),(t||i||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let g of this.state.facet(mS))try{g(r)}catch(O){Kn(this.state,O,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!WN(this,d)&&h.force&&Ka(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new nE(this,e),this.plugins=e.facet(Va).map(i=>new fb(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new IQ(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Va),i=e.state.facet(Va);if(t!=i){let r=[];for(let s of i){let l=t.indexOf(s);if(l<0)r.push(new fb(s));else{let o=this.plugins[l];o.mustUpdate=e,r.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){Kn(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(kN(i||this.win))s=-1,l=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(r);s=O.from,l=O.top}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];c&4||([this.measureRequests,h]=[h,this.measureRequests]);let d=h.map(O=>{try{return O.read(this)}catch(b){return Kn(this.state,b),oE}}),p=Xm.create(this,this.state,[]),g=!1;p.flags|=c,t?t.flags|=c:t=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let O=0;O<h.length;O++)if(d[O]!=oE)try{let b=h[O];b.write&&b.write(d[O],this)}catch(b){Kn(this.state,b)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,l=-1;continue}else{let b=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-l)/this.scaleY;if((b>1||b<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+b,i?i.scrollTop+=b:this.win.scrollBy(0,b),l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(mS))o(t)}get themeClasses(){return vS+" "+(this.state.facet(SS)?oz:lz)+" "+this.state.facet(hp)}updateAttrs(){let e=aE(this,jN,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(vs)?"true":"false",class:"cm-content",style:`${Oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),aE(this,sx,t);let i=this.observer.ignore(()=>{let r=LQ(this.contentDOM,this.contentAttrs,t),s=LQ(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(fe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Fu);let e=this.state.facet(fe.cspNonce);Nl.mount(this.root,this.styleModules.concat(h7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return gb(this,e,VQ(this,e,t,i))}moveByGroup(e,t){return gb(this,e,VQ(this,e,t,i=>CW(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return Y.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return TW(this,e,t,i)}moveVertically(e,t,i){return gb(this,e,AW(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=yS(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),yS(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),l=s[$r.find(s,e-r.from,-1,t)];return jh(i,l.dir==gt.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(LN)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>g7)return QN(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||MN(s.isolates,i=ZQ(this,e))))return s.order;i||(i=ZQ(this,e));let r=K6(e.text,t,i);return this.bidiCache.push(new Ym(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Oe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{xN(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,r,s,l;return sp.of(new Ja(typeof e=="number"?Y.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(r=t.x)!==null&&r!==void 0?r:"nearest",(s=t.yMargin)!==null&&s!==void 0?s:5,(l=t.xMargin)!==null&&l!==void 0?l:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return sp.of(new Ja(Y.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Lt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Lt.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Nl.newName(),r=[hp.of(i),Fu.of(xS(`.${i}`,e))];return t&&t.dark&&r.push(SS.of(!0)),r}static baseTheme(e){return _s.lowest(Fu.of(xS("."+vS,e,az)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&zt.get(i)||zt.get(e);return((t=r==null?void 0:r.root)===null||t===void 0?void 0:t.view)||null}}fe.styleModule=Fu;fe.inputHandler=NN;fe.clipboardInputFilter=ix;fe.clipboardOutputFilter=rx;fe.scrollHandler=BN;fe.focusChangeEffect=zN;fe.perLineTextDirection=LN;fe.exceptionSink=DN;fe.updateListener=mS;fe.editable=vs;fe.mouseSelectionStyle=PN;fe.dragMovesSelection=RN;fe.clickAddsSelectionRange=$N;fe.decorations=Vg;fe.blockWrappers=XN;fe.outerDecorations=lx;fe.atomicRanges=mf;fe.bidiIsolatedRanges=IN;fe.cursorScrollMargin=me.define({combine:n=>{let e=5,t=5;for(let i of n)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});fe.scrollMargins=VN;fe.darkTheme=SS;fe.cspNonce=me.define({combine:n=>n.length?n[0]:""});fe.contentAttributes=sx;fe.editorAttributes=jN;fe.lineWrapping=fe.contentAttributes.of({class:"cm-lineWrapping"});fe.announce=De.define();const g7=4096,oE={};class Ym{constructor(e,t,i,r,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:gt.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let l=e[s];l.dir==r&&!t.touchesRange(l.from,l.to)&&i.push(new Ym(t.mapPos(l.from,1),t.mapPos(l.to,-1),l.dir,l.isolates,!1,l.order))}return i}}function aE(n,e,t){for(let i=n.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],l=typeof s=="function"?s(n):s;l&&ex(l,t)}return t}const O7=Oe.mac?"mac":Oe.windows?"win":Oe.linux?"linux":"key";function y7(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,l,o;for(let c=0;c<t.length-1;++c){const h=t[c];if(/^(cmd|meta|m)$/i.test(h))o=!0;else if(/^a(lt)?$/i.test(h))r=!0;else if(/^(c|ctrl|control)$/i.test(h))s=!0;else if(/^s(hift)?$/i.test(h))l=!0;else if(/^mod$/i.test(h))e=="mac"?o=!0:s=!0;else throw new Error("Unrecognized modifier name: "+h)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),o&&(i="Meta-"+i),l&&(i="Shift-"+i),i}function fp(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const b7=_s.default(fe.domEventHandlers({keydown(n,e){return uz(cz(e.state),n,e,"editor")}})),Ac=me.define({enables:b7}),cE=new WeakMap;function cz(n){let e=n.facet(Ac),t=cE.get(e);return t||cE.set(e,t=x7(e.reduce((i,r)=>i.concat(r),[]))),t}function S7(n,e,t){return uz(cz(n.state),e,n,t)}let vl=null;const v7=4e3;function x7(n,e=O7){let t=Object.create(null),i=Object.create(null),r=(l,o)=>{let c=i[l];if(c==null)i[l]=o;else if(c!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,o,c,h,d)=>{var p,g;let O=t[l]||(t[l]=Object.create(null)),b=o.split(/ (?!$)/).map(k=>y7(k,e));for(let k=1;k<b.length;k++){let C=b.slice(0,k).join(" ");r(C,!0),O[C]||(O[C]={preventDefault:!0,stopPropagation:!1,run:[A=>{let P=vl={view:A,prefix:C,scope:l};return setTimeout(()=>{vl==P&&(vl=null)},v7),!0}]})}let v=b.join(" ");r(v,!1);let x=O[v]||(O[v]={preventDefault:!1,stopPropagation:!1,run:((g=(p=O._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});c&&x.run.push(c),h&&(x.preventDefault=!0),d&&(x.stopPropagation=!0)};for(let l of n){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let h of o){let d=t[h]||(t[h]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=l;for(let g in d)d[g].run.push(O=>p(O,kS))}let c=l[e]||l.key;if(c)for(let h of o)s(h,c,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(h,"Shift-"+c,l.shift,l.preventDefault,l.stopPropagation)}return t}let kS=null;function uz(n,e,t,i){kS=e;let r=W2(e),s=Wn(r,0),l=Mr(s)==r.length&&r!=" ",o="",c=!1,h=!1,d=!1;vl&&vl.view==t&&vl.scope==i&&(o=vl.prefix+" ",KN.indexOf(e.keyCode)<0&&(h=!0,vl=null));let p=new Set,g=x=>{if(x){for(let k of x.run)if(!p.has(k)&&(p.add(k),k(t)))return x.stopPropagation&&(d=!0),!0;x.preventDefault&&(x.stopPropagation&&(d=!0),h=!0)}return!1},O=n[i],b,v;return O&&(g(O[o+fp(r,e,!l)])?c=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Oe.windows&&e.ctrlKey&&e.altKey)&&!(Oe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(b=Es[e.keyCode])&&b!=r?(g(O[o+fp(b,e,!0)])||e.shiftKey&&(v=Eh[e.keyCode])!=r&&v!=b&&g(O[o+fp(v,e,!1)]))&&(c=!0):l&&e.shiftKey&&g(O[o+fp(r,e,!0)])&&(c=!0),!c&&g(O._any)&&(c=!0)),h&&(c=!0),c&&d&&e.stopPropagation(),kS=null,c}class Qo{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=hz(e);return[new Qo(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return k7(e,t,i)}}function hz(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==gt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function uE(n,e,t,i){let r=n.coordsAtPos(e,t*2);if(!r)return i;let s=n.dom.getBoundingClientRect(),l=(r.top+r.bottom)/2,o=n.posAtCoords({x:s.left+1,y:l}),c=n.posAtCoords({x:s.right-1,y:l});return o==null||c==null?i:{from:Math.max(i.from,Math.min(o,c)),to:Math.min(i.to,Math.max(o,c))}}function k7(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==gt.LTR,l=n.contentDOM,o=l.getBoundingClientRect(),c=hz(n),h=l.querySelector(".cm-line"),d=h&&window.getComputedStyle(h),p=o.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=o.right-(d?parseInt(d.paddingRight):0),O=OS(n,i,1),b=OS(n,r,-1),v=O.type==yn.Text?O:null,x=b.type==yn.Text?b:null;if(v&&(n.lineWrapping||O.widgetLineBreaks)&&(v=uE(n,i,1,v)),x&&(n.lineWrapping||b.widgetLineBreaks)&&(x=uE(n,r,-1,x)),v&&x&&v.from==x.from&&v.to==x.to)return C(A(t.from,t.to,v));{let E=v?A(t.from,null,v):P(O,!1),D=x?A(null,t.to,x):P(b,!0),$=[];return(v||O).to<(x||b).from-(v&&x?1:0)||O.widgetLineBreaks>1&&E.bottom+n.defaultLineHeight/2<D.top?$.push(k(p,E.bottom,g,D.top)):E.bottom<D.top&&n.elementAtHeight((E.bottom+D.top)/2).type==yn.Text&&(E.bottom=D.top=(E.bottom+D.top)/2),C(E).concat($).concat(C(D))}function k(E,D,$,H){return new Qo(e,E-c.left,D-c.top,Math.max(0,$-E),H-D)}function C({top:E,bottom:D,horizontal:$}){let H=[];for(let W=0;W<$.length;W+=2)H.push(k($[W],E,$[W+1],D));return H}function A(E,D,$){let H=1e9,W=-1e9,te=[];function ae(se,z,B,K,he){let ge=n.coordsAtPos(se,se==$.to?-2:2),J=n.coordsAtPos(B,B==$.from?2:-2);!ge||!J||(H=Math.min(ge.top,J.top,H),W=Math.max(ge.bottom,J.bottom,W),he==gt.LTR?te.push(s&&z?p:ge.left,s&&K?g:J.right):te.push(!s&&K?p:J.left,!s&&z?g:ge.right))}let re=E??$.from,ce=D??$.to;for(let se of n.visibleRanges)if(se.to>re&&se.from<ce)for(let z=Math.max(se.from,re),B=Math.min(se.to,ce);;){let K=n.state.doc.lineAt(z);for(let he of n.bidiSpans(K)){let ge=he.from+K.from,J=he.to+K.from;if(ge>=B)break;J>z&&ae(Math.max(ge,z),E==null&&ge<=re,Math.min(J,B),D==null&&J>=ce,he.dir)}if(z=K.to+1,z>=B)break}return te.length==0&&ae(re,E==null,ce,D==null,n.textDirection),{top:H,bottom:W,horizontal:te}}function P(E,D){let $=o.top+(D?E.top:E.bottom);return{top:$,bottom:$,horizontal:[]}}}function w7(n,e){return n.constructor==e.constructor&&n.eq(e)}class T7{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(_p)!=e.state.facet(_p)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(_p);for(;t<i.length&&i[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,i)=>!w7(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e,Oe.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const _p=me.define();function fz(n){return[Lt.define(e=>new T7(e,n)),_p.of(n)]}const Oc=me.define({combine(n){return Ir(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function C7(n={}){return[Oc.of(n),A7,M7,Q7,_N.of(!0)]}function dz(n){return n.startState.facet(Oc)!=n.state.facet(Oc)}const A7=fz({above:!0,markers(n){let{state:e}=n,t=e.facet(Oc),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||t.drawRangeCursor&&!(s&&Oe.ios&&t.iosSelectionHandles)){let l=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=r.empty?r:Y.cursor(r.head,r.assoc);for(let c of Qo.forRange(n,l,o))i.push(c)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=dz(n);return t&&hE(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){hE(e.state,n)},class:"cm-cursorLayer"});function hE(n,e){e.style.animationDuration=n.facet(Oc).cursorBlinkRate+"ms"}const M7=fz({above:!1,markers(n){let e=[],{main:t,ranges:i}=n.state.selection;for(let r of i)if(!r.empty)for(let s of Qo.forRange(n,"cm-selectionBackground",r))e.push(s);if(Oe.ios&&!t.empty&&n.state.facet(Oc).iosSelectionHandles){for(let r of Qo.forRange(n,"cm-selectionHandle cm-selectionHandle-start",Y.cursor(t.from,1)))e.push(r);for(let r of Qo.forRange(n,"cm-selectionHandle cm-selectionHandle-end",Y.cursor(t.to,1)))e.push(r)}return e},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||dz(n)},class:"cm-selectionLayer"}),Q7=_s.highest(fe.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),pz=De.define({map(n,e){return n==null?null:e.mapPos(n)}}),Ju=bn.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(pz)?i.value:t,n)}}),E7=Lt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Ju);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Ju)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Ju),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Ju)!=n&&this.view.dispatch({effects:pz.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function $7(){return[Ju,E7]}function fE(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),l=t,o;!s.next().done;l+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)r(l+o.index,o)}function R7(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class P7{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(o,c,h,d)=>r(d,h,h+o[0].length,o,c);else if(typeof i=="function")this.addMatch=(o,c,h,d)=>{let p=i(o,c,h);p&&d(h,h+o[0].length,p)};else if(i)this.addMatch=(o,c,h,d)=>d(h,h+o[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=l}createDeco(e){let t=new $s,i=t.add.bind(t);for(let{from:r,to:s}of R7(e,this.maxLength))fE(e.state.doc,this.regexp,r,s,(l,o)=>this.addMatch(o,e,l,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,l,o,c)=>{c>=e.view.viewport.from&&o<=e.view.viewport.to&&(i=Math.min(o,i),r=Math.max(c,r))}),e.viewportMoved||r-i>1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let l=Math.max(s.from,i),o=Math.min(s.to,r);if(o>=l){let c=e.state.doc.lineAt(l),h=c.to<o?e.state.doc.lineAt(o):c,d=Math.max(s.from,c.from),p=Math.min(s.to,h.to);if(this.boundary){for(;l>c.from;l--)if(this.boundary.test(c.text[l-1-c.from])){d=l;break}for(;o<h.to;o++)if(this.boundary.test(h.text[o-h.from])){p=o;break}}let g=[],O,b=(v,x,k)=>g.push(k.range(v,x));if(c==h)for(this.regexp.lastIndex=d-c.from;(O=this.regexp.exec(c.text))&&O.index<p-c.from;)this.addMatch(O,e,O.index+c.from,b);else fE(e.state.doc,this.regexp,d,p,(v,x)=>this.addMatch(x,e,v,b));t=t.update({filterFrom:d,filterTo:p,filter:(v,x)=>v<d||x>p,add:g})}}return t}}const wS=/x/.unicode!=null?"gu":"g",D7=new RegExp(`[\0-\b
|
|
219
|
+
--\u2028\u2029\uFEFF-]`,wS),N7={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let bb=null;function z7(){var n;if(bb==null&&typeof document<"u"&&document.body){let e=document.body.style;bb=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return bb||!1}const Bp=me.define({combine(n){let e=Ir(n,{render:null,specialChars:D7,addSpecialChars:null});return(e.replaceTabs=!z7())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,wS)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,wS)),e}});function L7(n={}){return[Bp.of(n),_7()]}let dE=null;function _7(){return dE||(dE=Lt.fromClass(class{constructor(n){this.view=n,this.decorations=we.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Bp)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new P7({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=Wn(e[0],0);if(s==9){let l=r.lineAt(i),o=t.state.tabSize,c=or(l.text,o,i-l.from);return we.replace({widget:new X7((o-c%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=we.replace({widget:new j7(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Bp);n.startState.facet(Bp)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const B7="•";function Z7(n){return n>=32?B7:n==10?"":String.fromCharCode(9216+n)}class j7 extends ur{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Z7(this.code),i=e.state.phrase("Control character")+" "+(N7[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class X7 extends ur{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function I7(){return q7}const V7=we.line({class:"cm-activeLine"}),q7=Lt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(V7.range(r.from)),e=r.from)}return we.set(t)}},{decorations:n=>n.decorations});class H7 extends ur{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?gh(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=jh(t[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function Y7(n){let e=Lt.fromClass(class{constructor(t){this.view=t,this.placeholder=n?we.set([we.widget({widget:new H7(n),side:1}).range(0)]):we.none}get decorations(){return this.view.state.doc.length?we.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,fe.contentAttributes.of({"aria-placeholder":n})]:e}const TS=2e3;function U7(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>TS||t.off>TS||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let c=i;c<=r;c++){let h=n.doc.line(c);h.length<=o&&s.push(Y.range(h.from+l,h.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let c=i;c<=r;c++){let h=n.doc.line(c),d=rS(h.text,l,n.tabSize,!0);if(d<0)s.push(Y.cursor(h.to));else{let p=rS(h.text,o,n.tabSize);s.push(Y.range(h.from+d,h.from+p))}}}return s}function W7(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function pE(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>TS?-1:r==i.length?W7(n,e.clientX):or(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function G7(n,e){let t=pE(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),l=r.state.doc.lineAt(s);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},i=i.map(r.changes)}},get(r,s,l){let o=pE(n,r);if(!o)return i;let c=U7(n.state,t,o);return c.length?l?Y.create(c.concat(i.ranges)):Y.create(c):i}}:null}function F7(n){let e=(t=>t.altKey&&t.button==0);return fe.mouseSelectionStyle.of((t,i)=>e(i)?G7(t,i):null)}const K7={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},J7={style:"cursor: crosshair"};function e8(n={}){let[e,t]=K7[n.key||"Alt"],i=Lt.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,fe.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?J7:null})]}const dp="-10000px";class mz{constructor(e,t,i,r){this.facet=t,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(t),this.tooltips=this.input.filter(l=>l);let s=null;this.tooltipViews=this.tooltips.map(l=>s=i(l,s))}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(c=>c);if(r===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let l=[],o=t?[]:null;for(let c=0;c<s.length;c++){let h=s[c],d=-1;if(h){for(let p=0;p<this.tooltips.length;p++){let g=this.tooltips[p];g&&g.create==h.create&&(d=p)}if(d<0)l[c]=this.createTooltipView(h,c?l[c-1]:null),o&&(o[c]=!!h.above);else{let p=l[c]=this.tooltipViews[d];o&&(o[c]=t[d]),p.update&&p.update(e)}}}for(let c of this.tooltipViews)l.indexOf(c)<0&&(this.removeTooltipView(c),(i=c.destroy)===null||i===void 0||i.call(c));return t&&(o.forEach((c,h)=>t[h]=c),t.length=o.length),this.input=r,this.tooltips=s,this.tooltipViews=l,!0}}function t8(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Sb=me.define({combine:n=>{var e,t,i;return{position:Oe.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||t8}}}),mE=new WeakMap,hx=Lt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Sb);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new mz(n,fx,(t,i)=>this.createTooltip(t,i),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(Sb);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),i=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",t.dom.appendChild(r)}return t.dom.style.position=this.position,t.dom.style.top=dp,t.dom.style.left="0px",this.container.insertBefore(t.dom,i),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(n=i.destroy)===null||n===void 0||n.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Oe.safari){let l=s.getBoundingClientRect();t=Math.abs(l.top+1e4)>1||Math.abs(l.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=ox(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,l)=>{let o=this.manager.tooltipViews[l];return o.getCoords?o.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Sb).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{visible:t,space:i,scaleX:r,scaleY:s}=n,l=[];for(let o=0;o<this.manager.tooltips.length;o++){let c=this.manager.tooltips[o],h=this.manager.tooltipViews[o],{dom:d}=h,p=n.pos[o],g=n.size[o];if(!p||c.clip!==!1&&(p.bottom<=Math.max(t.top,i.top)||p.top>=Math.min(t.bottom,i.bottom)||p.right<Math.max(t.left,i.left)-.1||p.left>Math.min(t.right,i.right)+.1)){d.style.top=dp;continue}let O=c.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,b=O?7:0,v=g.right-g.left,x=(e=mE.get(h))!==null&&e!==void 0?e:g.bottom-g.top,k=h.offset||i8,C=this.view.textDirection==gt.LTR,A=g.width>i.right-i.left?C?i.left:i.right-g.width:C?Math.max(i.left,Math.min(p.left-(O?14:0)+k.x,i.right-v)):Math.min(Math.max(i.left,p.left-v+(O?14:0)-k.x),i.right-v),P=this.above[o];!c.strictSide&&(P?p.top-x-b-k.y<i.top:p.bottom+x+b+k.y>i.bottom)&&P==i.bottom-p.bottom>p.top-i.top&&(P=this.above[o]=!P);let E=(P?p.top-i.top:i.bottom-p.bottom)-b;if(E<x&&h.resize!==!1){if(E<this.view.defaultLineHeight){d.style.top=dp;continue}mE.set(h,x),d.style.height=(x=E)/s+"px"}else d.style.height&&(d.style.height="");let D=P?p.top-x-b-k.y:p.bottom+b+k.y,$=A+v;if(h.overlap!==!0)for(let H of l)H.left<$&&H.right>A&&H.top<D+x&&H.bottom>D&&(D=P?H.top-x-2-b:H.bottom+b+2);if(this.position=="absolute"?(d.style.top=(D-n.parent.top)/s+"px",gE(d,(A-n.parent.left)/r)):(d.style.top=D/s+"px",gE(d,A/r)),O){let H=p.left+(C?k.x:-k.x)-(A+14-7);O.style.left=H/r+"px"}h.overlap!==!0&&l.push({left:A,top:D,right:$,bottom:D+x}),d.classList.toggle("cm-tooltip-above",P),d.classList.toggle("cm-tooltip-below",!P),h.positioned&&h.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=dp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function gE(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const n8=fe.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),i8={x:0,y:0},fx=me.define({enables:[hx,n8]}),Um=me.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class Ug{static create(e){return new Ug(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new mz(e,Um,(t,i)=>this.createHostedView(t,i),t=>t.dom.remove())}createHostedView(e,t){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const r8=fx.compute([Um],n=>{let e=n.facet(Um);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var i;return(i=t.end)!==null&&i!==void 0?i:t.pos})),create:Ug.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),gz=me.define();class s8{constructor(e,t,i,r,s,l){this.view=e,this.source=t,this.field=i,this.locked=r,this.setHover=s,this.hoverTime=l,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,i=e.docView.tile.nearest(t.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(t),r==null)return;let l=e.coordsAtPos(r);if(!l||t.y<l.top||t.y>l.bottom||t.x<l.left-e.defaultCharacterWidth||t.x>l.right+e.defaultCharacterWidth)return;let o=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),c=o&&o.dir==gt.RTL?-1:1;s=t.x<l.left?-c:c}this.activateHover(e,r,s)}activateHover(e,t,i,r){let s=this.source(e,t,i),l=o=>{if(o&&!(Array.isArray(o)&&!o.length)){let c=Array.isArray(o)?o:[o];r&&this.locked.set(c,r),e.dispatch({effects:this.setHover.of(c)})}};if(s&&"then"in s){let o=this.pending={pos:t};s.then(c=>{this.pending==o&&(this.pending=null,l(c))},c=>Kn(e.state,c,"hover tooltip"))}else l(s)}get tooltip(){let e=this.view.plugin(hx),t=e?e.manager.tooltips.findIndex(i=>i.create==Ug.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!l8(s.dom,e)||this.pending){let{pos:l}=r[0]||this.pending,o=(i=(t=r[0])===null||t===void 0?void 0:t.end)!==null&&i!==void 0?i:l;(l==o?this.view.posAtCoords(this.lastMove)!=l:!o8(this.view,l,o,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=i=>{e.removeEventListener("mouseleave",t);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const pp=4;function l8(n,e){let{left:t,right:i,top:r,bottom:s}=n.getBoundingClientRect(),l;if(l=n.querySelector(".cm-tooltip-arrow")){let o=l.getBoundingClientRect();r=Math.min(o.top,r),s=Math.max(o.bottom,s)}return e.clientX>=t-pp&&e.clientX<=i+pp&&e.clientY>=r-pp&&e.clientY<=s+pp}function o8(n,e,t,i,r,s){let l=n.scrollDOM.getBoundingClientRect(),o=n.documentTop+n.documentPadding.top+n.contentHeight;if(l.left>i||l.right<i||l.top>r||Math.min(l.bottom,o)<r)return!1;let c=n.posAtCoords({x:i,y:r},!1);return c>=e&&c<=t}function a8(n,e={}){let t=De.define(),i=new WeakMap,r=bn.define({create(){return[]},update(l,o){let c=i.get(l);if(l.length&&(e.hideOnChange&&(o.docChanged||o.selection)?l=[]:c&&c(o)?l=[]:e.hideOn&&(l=l.filter(h=>!e.hideOn(o,h)))),o.docChanged&&l.length){let h=[];for(let d of l){let p=o.changes.mapPos(d.pos,-1,gn.TrackDel);if(p!=null){let g=Object.assign(Object.create(null),d);g.pos=p,g.end!=null&&(g.end=o.changes.mapPos(g.end)),h.push(g)}}l=h}for(let h of o.effects)h.is(t)&&(l=h.value,c=void 0),(h.is(u8)&&!h.value||h.value==r)&&(l=[]);return l.length&&c&&i.set(l,c),l},provide:l=>Um.from(l)});const s=Lt.define(l=>new s8(l,n,r,i,t,e.hoverTime||300));return{active:r,extension:[r,s,gz.of(s),r8]}}function c8(n,e,t,i={}){var r;let s=n.state.facet(gz).map(l=>n.plugin(l)).filter(l=>!!l);if(i.tooltip&&i.tooltip.active){let l=s.find(o=>o.field==i.tooltip.active);l&&(s=[l])}for(let l of s)l.activateHover(n,e,t,(r=i.until)!==null&&r!==void 0?r:(()=>!1))}function Oz(n,e){let t=n.plugin(hx);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const u8=De.define(),OE=me.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function dx(n,e){let t=n.plugin(yz),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const yz=Lt.fromClass(class{constructor(n){this.input=n.state.facet(Ih),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(OE);this.top=new mp(n,!0,e.topContainer),this.bottom=new mp(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(OE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new mp(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new mp(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Ih);if(t!=this.input){let i=t.filter(c=>c),r=[],s=[],l=[],o=[];for(let c of i){let h=this.specs.indexOf(c),d;h<0?(d=c(n.view),o.push(d)):(d=this.panels[h],d.update&&d.update(n)),r.push(d),(d.top?s:l).push(d)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(l);for(let c of o)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>fe.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class mp{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=yE(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=yE(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function yE(n){let e=n.nextSibling;return n.remove(),e}const Ih=me.define({enables:yz});function h8(n,e){let t,i=new Promise(l=>t=l),r=l=>f8(l,e,t);n.state.field(vb,!1)?n.dispatch({effects:bz.of(r)}):n.dispatch({effects:De.appendConfig.of(vb.init(()=>[r]))});let s=Sz.of(r);return{close:s,result:i.then(l=>((n.win.queueMicrotask||(c=>n.win.setTimeout(c,10)))(()=>{n.state.field(vb).indexOf(r)>-1&&n.dispatch({effects:s})}),l))}}const vb=bn.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(bz)?n=[t.value].concat(n):t.is(Sz)&&(n=n.filter(i=>i!=t.value));return n},provide:n=>Ih.computeN([n],e=>e.field(n))}),bz=De.define(),Sz=De.define();function f8(n,e,t){let i=e.content?e.content(n,()=>l(null)):null;if(!i){if(i=ht("form"),e.input){let o=ht("input",e.input);/^(text|password|number|email|tel|url)$/.test(o.type)&&o.classList.add("cm-textfield"),o.name||(o.name="input"),i.appendChild(ht("label",(e.label||"")+": ",o))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(ht("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let o=0;o<r.length;o++){let c=r[o];c.addEventListener("keydown",h=>{h.keyCode==27?(h.preventDefault(),l(null)):h.keyCode==13&&(h.preventDefault(),l(c))}),c.addEventListener("submit",h=>{h.preventDefault(),l(c)})}let s=ht("div",i,ht("button",{onclick:()=>l(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function l(o){s.contains(s.ownerDocument.activeElement)&&n.focus(),t(o)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let o;typeof e.focus=="string"?o=i.querySelector(e.focus):o=i.querySelector("input")||i.querySelector("button"),o&&"select"in o?o.select():o&&"focus"in o&&o.focus()}}}}class Ps extends Dl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ps.prototype.elementClass="";Ps.prototype.toDOM=void 0;Ps.prototype.mapMode=gn.TrackBefore;Ps.prototype.startSide=Ps.prototype.endSide=-1;Ps.prototype.point=!0;const Zp=me.define(),d8=me.define(),p8={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ve.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},bh=me.define();function m8(n){return[vz(),bh.of({...p8,...n})]}const bE=me.define({combine:n=>n.some(e=>e)});function vz(n){return[g8]}const g8=Lt.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(bh).map(e=>new vE(n,e)),this.fixed=!n.state.facet(bE);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(bE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=Ve.iter(this.view.state.facet(Zp),this.view.viewport.from),i=[],r=this.gutters.map(s=>new O8(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let l=!0;for(let o of s.type)if(o.type==yn.Text&&l){CS(t,i,o.from);for(let c of r)c.line(this.view,o,i);l=!1}else if(o.widget)for(let c of r)c.widget(this.view,o)}else if(s.type==yn.Text){CS(t,i,s.from);for(let l of r)l.line(this.view,s,i)}else if(s.widget)for(let l of r)l.widget(this.view,s);for(let s of r)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(bh),t=n.state.facet(bh),i=n.docChanged||n.heightChanged||n.viewportChanged||!Ve.eq(n.startState.facet(Zp),n.state.facet(Zp),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let l=e.indexOf(s);l<0?r.push(new vE(this.view,s)):(this.gutters[l].update(n),r.push(this.gutters[l]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>fe.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==gt.LTR?{left:i,right:r}:{right:i,left:r}})});function SE(n){return Array.isArray(n)?n:[n]}function CS(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class O8{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=Ve.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==r.elements.length){let o=new xz(e,l,s,i);r.elements.push(o),r.dom.appendChild(o.dom)}else r.elements[this.i].update(e,l,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];CS(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let l=this.gutter;r.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let s of e.state.facet(d8)){let l=s(e,t.widget,t);l&&(r||(r=[])).push(l)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class vE{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,l;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let c=s.getBoundingClientRect();l=(c.top+c.bottom)/2}else l=r.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[i](e,o,r)&&r.preventDefault()});this.markers=SE(t.markers(e)),t.initialSpacer&&(this.spacer=new xz(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=SE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!Ve.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class xz{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),y8(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,l=0;;){let o=l,c=s<t.length?t[s++]:null,h=!1;if(c){let d=c.elementClass;d&&(i+=" "+d);for(let p=l;p<this.markers.length;p++)if(this.markers[p].compare(c)){o=p,h=!0;break}}else o=this.markers.length;for(;l<o;){let d=this.markers[l++];if(d.toDOM){d.destroy(r);let p=r.nextSibling;r.remove(),r=p}}if(!c)break;c.toDOM&&(h?r=r.nextSibling:this.dom.insertBefore(c.toDOM(e),r)),h&&l++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function y8(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const b8=me.define(),S8=me.define(),qa=me.define({combine(n){return Ir(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let r in t){let s=i[r],l=t[r];i[r]=s?(o,c,h)=>s(o,c,h)||l(o,c,h):l}return i}})}});class xb extends Ps{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function kb(n,e){return n.state.facet(qa).formatNumber(e,n.state)}const v8=bh.compute([qa],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(b8)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new xb(kb(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(S8)){let s=r(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(qa)!=e.state.facet(qa),initialSpacer(e){return new xb(kb(e,xE(e.state.doc.lines)))},updateSpacer(e,t){let i=kb(t.view,xE(t.view.state.doc.lines));return i==e.number?e:new xb(i)},domEventHandlers:n.facet(qa).domEventHandlers,side:"before"}));function x8(n={}){return[qa.of(n),vz(),v8]}function xE(n){let e=9;for(;e<n;)e=e*10+9;return e}const k8=new class extends Ps{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},w8=Zp.compute(["selection"],n=>{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(k8.range(r)))}return Ve.of(e)});function T8(){return w8}const kz=1024;let C8=0;class Zi{constructor(e,t){this.from=e,this.to=t}}class Ne{constructor(e={}){this.id=C8++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Kt.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}Ne.closedBy=new Ne({deserialize:n=>n.split(" ")});Ne.openedBy=new Ne({deserialize:n=>n.split(" ")});Ne.group=new Ne({deserialize:n=>n.split(" ")});Ne.isolate=new Ne({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});Ne.contextHash=new Ne({perNode:!0});Ne.lookAhead=new Ne({perNode:!0});Ne.mounted=new Ne({perNode:!0});class ec{constructor(e,t,i,r=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[Ne.mounted.id]}}const A8=Object.create(null);class Kt{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):A8,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Kt(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Ne.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(Ne.group),s=-1;s<(r?r.length:0);s++){let l=t[s<0?i.name:r[s]];if(l)return l}}}}Kt.none=new Kt("",Object.create(null),0,8);class gf{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let r=null;for(let s of e){let l=s(i);if(l){r||(r=Object.assign({},i.props));let o=l[1],c=l[0];c.combine&&c.id in r&&(o=c.combine(r[c.id],o)),r[c.id]=o}}t.push(r?new Kt(i.name,r,i.id,i.flags):i)}return new gf(t)}}const gp=new WeakMap,kE=new WeakMap;var nt;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(nt||(nt={}));class et{constructor(e,t,i,r,s){if(this.type=e,this.children=t,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[l,o]of s)this.props[typeof l=="number"?l:l.id]=o}}toString(){let e=ec.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let r=i.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Wm(this.topNode,e)}cursorAt(e,t=0,i=0){let r=gp.get(this)||this.topNode,s=new Wm(r);return s.moveTo(e,t),gp.set(this,s._tree),s}get topNode(){return new wn(this,0,0,null)}resolve(e,t=0){let i=Vh(gp.get(this)||this.topNode,e,t,!1);return gp.set(this,i),i}resolveInner(e,t=0){let i=Vh(kE.get(this)||this.topNode,e,t,!0);return kE.set(this,i),i}resolveStack(e,t=0){return E8(this,e,t)}iterate(e){let{enter:t,leave:i,from:r=0,to:s=this.length}=e,l=e.mode||0,o=(l&nt.IncludeAnonymous)>0;for(let c=this.cursor(l|nt.IncludeAnonymous);;){let h=!1;if(c.from<=s&&c.to>=r&&(!o&&c.type.isAnonymous||t(c)!==!1)){if(c.firstChild())continue;h=!0}for(;h&&i&&(o||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:gx(Kt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new et(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new et(Kt.none,t,i,r)))}static build(e){return $8(e)}}et.empty=new et(Kt.none,[],[],0);class px{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new px(this.buffer,this.index)}}class Ll{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Kt.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],r=this.set.types[t],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let l=[];for(;e<i;)l.push(this.childString(e)),e=this.buffer[e+3];return s+"("+l.join(",")+")"}findChild(e,t,i,r,s){let{buffer:l}=this,o=-1;for(let c=e;c!=t&&!(wz(s,r,l[c+1],l[c+2])&&(o=c,i>0));c=l[c+3]);return o}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,c=0;o<t;){s[c++]=r[o++],s[c++]=r[o++]-i;let h=s[c++]=r[o++]-i;s[c++]=r[o++]-e,l=Math.max(l,h)}return new Ll(s,l,this.set)}}function wz(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Vh(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let l=!i&&n instanceof wn&&n.index<0?null:n.parent;if(!l)return n;n=l}let s=i?0:nt.IgnoreOverlays;if(i)for(let l=n,o=l.parent;o;l=o,o=l.parent)l instanceof wn&&l.index<0&&((r=o.enter(e,t,s))===null||r===void 0?void 0:r.from)!=l.from&&(n=o);for(;;){let l=n.enter(e,t,s);if(!l)return n;n=l}}class Tz{cursor(e=0){return new Wm(this,e)}getChild(e,t=null,i=null){let r=wE(this,e,t,i);return r.length?r[0]:null}getChildren(e,t=null,i=null){return wE(this,e,t,i)}resolve(e,t=0){return Vh(this,e,t,!1)}resolveInner(e,t=0){return Vh(this,e,t,!0)}matchContext(e){return AS(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(i=t,t=r.prevSibling):t=r}return i}get node(){return this}get next(){return this.parent}}class wn extends Tz{constructor(e,t,i,r){super(),this._tree=e,this.from=t,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,r,s=0){for(let l=this;;){for(let{children:o,positions:c}=l._tree,h=t>0?o.length:-1;e!=h;e+=t){let d=o[e],p=c[e]+l.from,g;if(!(!(s&nt.EnterBracketed&&d instanceof et&&(g=ec.get(d))&&!g.overlay&&g.bracketed&&i>=p&&i<=p+d.length)&&!wz(r,i,p,p+d.length))){if(d instanceof Ll){if(s&nt.ExcludeBuffers)continue;let O=d.findChild(0,d.buffer.length,t,i-p,r);if(O>-1)return new Rr(new M8(l,d,e,p),null,O)}else if(s&nt.IncludeAnonymous||!d.type.isAnonymous||mx(d)){let O;if(!(s&nt.IgnoreMounts)&&(O=ec.get(d))&&!O.overlay)return new wn(O.tree,p,e,l);let b=new wn(d,p,e,l);return s&nt.IncludeAnonymous||!b.type.isAnonymous?b:b.nextChild(t<0?d.children.length-1:0,t,i,r,s)}}}if(s&nt.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let r;if(!(i&nt.IgnoreOverlays)&&(r=ec.get(this._tree))&&r.overlay){let s=e-this.from,l=i&nt.EnterBracketed&&r.bracketed;for(let{from:o,to:c}of r.overlay)if((t>0||l?o<=s:o<s)&&(t<0||l?c>=s:c>s))return new wn(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function wE(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let l=!1;!l;)if(l=r.type.is(t),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function AS(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class M8{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class Rr extends Tz{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new Rr(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&nt.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Rr(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Rr(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Rr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let l=i.buffer[this.index+1];e.push(i.slice(r,s,l)),t.push(0)}return new et(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Cz(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let l=n[s];(l.from>t.from||l.to<t.to)&&(t=l,e=s)}let i=t instanceof wn&&t.index<0?null:t.parent,r=n.slice();return i?r[e]=i:r.splice(e,1),new Q8(r,t)}class Q8{constructor(e,t){this.heads=e,this.node=t}get next(){return Cz(this.heads)}}function E8(n,e,t){let i=n.resolveInner(e,t),r=null;for(let s=i instanceof wn?i:i.context.parent;s;s=s.parent)if(s.index<0){let l=s.parent;(r||(r=[i])).push(l.resolve(e,t)),s=l}else{let l=ec.get(s.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let o=new wn(l.tree,l.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(Vh(o,e,t,!1))}}return r?Cz(r):i}class Wm{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~nt.EnterBracketed,e instanceof wn)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof wn?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&nt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&nt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&nt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:i}=r)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let o=i._tree.children[s];if(this.mode&nt.IncludeAnonymous||o instanceof Ll||!o.type.isAnonymous||mx(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let l=e;l;l=l._parent)if(l.index==r){if(r==this.index)return l;t=l,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)t=new Rr(this.buffer,t,this.stack[r]);return this.bufferNode=new Rr(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return AS(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return AS(this._tree,e,r);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[r]&&e[r]!=l.name)return!1;r--}}return!0}}function mx(n){return n.children.some(e=>e instanceof Ll||!e.type.isAnonymous||mx(e))}function $8(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=kz,reused:s=[],minRepeatType:l=i.types.length}=n,o=Array.isArray(t)?new px(t,t.length):t,c=i.types,h=0,d=0;function p(E,D,$,H,W,te){let{id:ae,start:re,end:ce,size:se}=o,z=d,B=h;if(se<0)if(o.next(),se==-1){let Q=s[ae];$.push(Q),H.push(re-E);return}else if(se==-3){h=ae;return}else if(se==-4){d=ae;return}else throw new RangeError(`Unrecognized record size: ${se}`);let K=c[ae],he,ge,J=re-E;if(ce-re<=r&&(ge=x(o.pos-D,W))){let Q=new Uint16Array(ge.size-ge.skip),Z=o.pos-ge.size,G=Q.length;for(;o.pos>Z;)G=k(ge.start,Q,G);he=new Ll(Q,ce-ge.start,i),J=ge.start-E}else{let Q=o.pos-se;o.next();let Z=[],G=[],oe=ae>=l?ae:-1,ye=0,Re=ce;for(;o.pos>Q;)oe>=0&&o.id==oe&&o.size>=0?(o.end<=Re-r&&(b(Z,G,re,ye,o.end,Re,oe,z,B),ye=Z.length,Re=o.end),o.next()):te>2500?g(re,Q,Z,G):p(re,Q,Z,G,oe,te+1);if(oe>=0&&ye>0&&ye<Z.length&&b(Z,G,re,ye,re,Re,oe,z,B),Z.reverse(),G.reverse(),oe>-1&&ye>0){let _e=O(K,B);he=gx(K,Z,G,0,Z.length,0,ce-re,_e,_e)}else he=v(K,Z,G,ce-re,z-ce,B)}$.push(he),H.push(J)}function g(E,D,$,H){let W=[],te=0,ae=-1;for(;o.pos>D;){let{id:re,start:ce,end:se,size:z}=o;if(z>4)o.next();else{if(ae>-1&&ce<ae)break;ae<0&&(ae=se-r),W.push(re,ce,se),te++,o.next()}}if(te){let re=new Uint16Array(te*4),ce=W[W.length-2];for(let se=W.length-3,z=0;se>=0;se-=3)re[z++]=W[se],re[z++]=W[se+1]-ce,re[z++]=W[se+2]-ce,re[z++]=z;$.push(new Ll(re,W[2]-ce,i)),H.push(ce-E)}}function O(E,D){return($,H,W)=>{let te=0,ae=$.length-1,re,ce;if(ae>=0&&(re=$[ae])instanceof et){if(!ae&&re.type==E&&re.length==W)return re;(ce=re.prop(Ne.lookAhead))&&(te=H[ae]+re.length+ce)}return v(E,$,H,W,te,D)}}function b(E,D,$,H,W,te,ae,re,ce){let se=[],z=[];for(;E.length>H;)se.push(E.pop()),z.push(D.pop()+$-W);E.push(v(i.types[ae],se,z,te-W,re-te,ce)),D.push(W-$)}function v(E,D,$,H,W,te,ae){if(te){let re=[Ne.contextHash,te];ae=ae?[re].concat(ae):[re]}if(W>25){let re=[Ne.lookAhead,W];ae=ae?[re].concat(ae):[re]}return new et(E,D,$,H,ae)}function x(E,D){let $=o.fork(),H=0,W=0,te=0,ae=$.end-r,re={size:0,start:0,skip:0};e:for(let ce=$.pos-E;$.pos>ce;){let se=$.size;if($.id==D&&se>=0){re.size=H,re.start=W,re.skip=te,te+=4,H+=4,$.next();continue}let z=$.pos-se;if(se<0||z<ce||$.start<ae)break;let B=$.id>=l?4:0,K=$.start;for($.next();$.pos>z;){if($.size<0)if($.size==-3||$.size==-4)B+=4;else break e;else $.id>=l&&(B+=4);$.next()}W=K,H+=se,te+=B}return(D<0||H==E)&&(re.size=H,re.start=W,re.skip=te),re.size>4?re:void 0}function k(E,D,$){let{id:H,start:W,end:te,size:ae}=o;if(o.next(),ae>=0&&H<l){let re=$;if(ae>4){let ce=o.pos-(ae-4);for(;o.pos>ce;)$=k(E,D,$)}D[--$]=re,D[--$]=te-E,D[--$]=W-E,D[--$]=H}else ae==-3?h=H:ae==-4&&(d=H);return $}let C=[],A=[];for(;o.pos>0;)p(n.start||0,n.bufferStart||0,C,A,-1,0);let P=(e=n.length)!==null&&e!==void 0?e:C.length?A[0]+C[0].length:0;return new et(c[n.topID],C.reverse(),A.reverse(),P)}const TE=new WeakMap;function jp(n,e){if(!n.isAnonymous||e instanceof Ll||e.type!=n)return 1;let t=TE.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof et)){t=1;break}t+=jp(n,i)}TE.set(e,t)}return t}function gx(n,e,t,i,r,s,l,o,c){let h=0;for(let b=i;b<r;b++)h+=jp(n,e[b]);let d=Math.ceil(h*1.5/8),p=[],g=[];function O(b,v,x,k,C){for(let A=x;A<k;){let P=A,E=v[A],D=jp(n,b[A]);for(A++;A<k;A++){let $=jp(n,b[A]);if(D+$>=d)break;D+=$}if(A==P+1){if(D>d){let $=b[P];O($.children,$.positions,0,$.children.length,v[P]+C);continue}p.push(b[P])}else{let $=v[A-1]+b[A-1].length-E;p.push(gx(n,b,v,P,A,E,$,null,c))}g.push(E+C-s)}}return O(e,t,i,r,0),(o||c)(p,g,l)}class Az{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Rr?this.setBuffer(e.context.buffer,e.index,t):e instanceof wn&&this.map.set(e.tree,t)}get(e){return e instanceof Rr?this.getBuffer(e.context.buffer,e.index):e instanceof wn?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Qs{constructor(e,t,i,r,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new Qs(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,l=e.length?e[0]:null;for(let o=0,c=0,h=0;;o++){let d=o<t.length?t[o]:null,p=d?d.fromA:1e9;if(p-c>=i)for(;l&&l.from<p;){let g=l;if(c>=g.from||p<=g.to||h){let O=Math.max(g.from,c)-h,b=Math.min(g.to,p)-h;g=O>=b?null:new Qs(O,b,g.tree,g.offset+h,o>0,!!d)}if(g&&r.push(g),l.to>p)break;l=s<e.length?e[s++]:null}if(!d)break;c=d.toA,h=d.toA-d.toB}return r}}class Ox{startParse(e,t,i){return typeof e=="string"&&(e=new R8(e)),i=i?i.length?i.map(r=>new Zi(r.from,r.to)):[new Zi(0,0)]:[new Zi(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class R8{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Mz(n){return(e,t,i,r)=>new D8(e,n,t,i,r)}class CE{constructor(e,t,i,r,s,l){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=r,this.target=s,this.from=l}}function AE(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class P8{constructor(e,t,i,r,s,l,o,c){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.bracketed=l,this.target=o,this.prev=c,this.depth=0,this.ranges=[]}}const MS=new Ne({perNode:!0});class D8{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new et(i.type,i.children,i.positions,i.length,i.propValues.concat([[MS,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[Ne.mounted.id]=new ec(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new L8(this.fragments),t=null,i=null,r=new Wm(new wn(this.baseTree,this.ranges[0].from,0,null),nt.IncludeAnonymous|nt.IgnoreMounts);e:for(let s,l;;){let o=!0,c;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(d=>d.frag.from<=r.from&&d.frag.to>=r.to&&d.mount.overlay);if(h)for(let d of h.mount.overlay){let p=d.from+h.pos,g=d.to+h.pos;p>=r.from&&g<=r.to&&!t.ranges.some(O=>O.from<g&&O.to>p)&&t.ranges.push({from:p,to:g})}}o=!1}else if(i&&(l=N8(i.ranges,r.from,r.to)))o=l!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||(z8(r),t&&t.depth++,i&&i.depth++);let h=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")t=new P8(s.parser,s.overlay,h,this.inner.length,r.from,!!s.bracketed,r.tree,t);else{let d=EE(this.ranges,s.overlay||(r.from<r.to?[new Zi(r.from,r.to)]:[]));d.length&&AE(d),(d.length||!s.overlay)&&this.inner.push(new CE(s.parser,d.length?s.parser.startParse(this.input,$E(h,d),d):s.parser.startParse(""),s.overlay?s.overlay.map(p=>new Zi(p.from-r.from,p.to-r.from)):null,!!s.bracketed,r.tree,d.length?d[0].from:r.from)),s.overlay?d.length&&(i={ranges:d,depth:0,prev:i}):o=!1}}else if(t&&(c=t.predicate(r))&&(c===!0&&(c=new Zi(r.from,r.to)),c.from<c.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==c.from?t.ranges[h]={from:t.ranges[h].from,to:c.to}:t.ranges.push(c)}if(o&&r.firstChild())t&&t.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=EE(this.ranges,t.ranges);h.length&&(AE(h),this.inner.splice(t.index,0,new CE(t.parser,t.parser.startParse(this.input,$E(t.mounts,h),h),t.ranges.map(d=>new Zi(d.from-t.start,d.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function N8(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function ME(n,e,t,i,r,s){if(e<t){let l=n.buffer[e+1];i.push(n.slice(e,t,l)),r.push(l-s)}}function z8(n){let{node:e}=n,t=[],i=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let r=n.tree,s=r.children.indexOf(i),l=r.children[s],o=l.buffer,c=[s];function h(d,p,g,O,b,v){let x=t[v],k=[],C=[];ME(l,d,x,k,C,O);let A=o[x+1],P=o[x+2];c.push(k.length);let E=v?h(x+4,o[x+3],l.set.types[o[x]],A,P-A,v-1):e.toTree();return k.push(E),C.push(A-O),ME(l,o[x+3],p,k,C,O),new et(g,k,C,b)}r.children[s]=h(0,o.length,Kt.none,0,l.length,t.length-1);for(let d of c){let p=n.tree.children[d],g=n.tree.positions[d];n.yield(new wn(p,g+n.from,d,n._tree))}}class QE{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(nt.IncludeAnonymous|nt.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from<i;)if(!(t.to>=e&&t.enter(i,1,nt.IgnoreOverlays|nt.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof et)t=t.children[0];else break}return!1}}let L8=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(MS))!==null&&t!==void 0?t:i.to,this.inner=new QE(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(MS))!==null&&e!==void 0?e:t.to,this.inner=new QE(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(i=s.tree)===null||i===void 0?void 0:i.prop(Ne.mounted);if(l&&l.parser==t)for(let o=this.fragI;o<this.fragments.length;o++){let c=this.fragments[o];if(c.from>=s.to)break;c.tree==this.curFrag.tree&&r.push({frag:c,pos:s.from-c.offset,mount:l})}}}return r}};function EE(n,e){let t=null,i=e;for(let r=1,s=0;r<n.length;r++){let l=n[r-1].to,o=n[r].from;for(;s<i.length;s++){let c=i[s];if(c.from>=o)break;c.to<=l||(t||(i=t=e.slice()),c.from<l?(t[s]=new Zi(c.from,l),c.to>o&&t.splice(s+1,0,new Zi(o,c.to))):c.to>o?t[s--]=new Zi(o,c.to):t.splice(s--,1))}}return i}function _8(n,e,t,i){let r=0,s=0,l=!1,o=!1,c=-1e9,h=[];for(;;){let d=r==n.length?1e9:l?n[r].to:n[r].from,p=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let g=Math.max(c,t),O=Math.min(d,p,i);g<O&&h.push(new Zi(g,O))}if(c=Math.min(d,p),c==1e9)break;d==c&&(l?(l=!1,r++):l=!0),p==c&&(o?(o=!1,s++):o=!0)}return h}function $E(n,e){let t=[];for(let{pos:i,mount:r,frag:s}of n){let l=i+(r.overlay?r.overlay[0].from:0),o=l+r.tree.length,c=Math.max(s.from,l),h=Math.min(s.to,o);if(r.overlay){let d=r.overlay.map(g=>new Zi(g.from+i,g.to+i)),p=_8(e,d,c,h);for(let g=0,O=c;;g++){let b=g==p.length,v=b?h:p[g].from;if(v>O&&t.push(new Qs(O,v,r.tree,-l,s.from>=O||s.openStart,s.to<=v||s.openEnd)),b)break;O=p[g].to}}else t.push(new Qs(c,h,r.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}let B8=0;class Oi{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=B8++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Oi&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Oi(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Gm(e);return i=>i.modified.indexOf(t)>-1?i:Gm.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let Z8=0;class Gm{constructor(e){this.name=e,this.instances=[],this.id=Z8++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(o=>o.base==e&&j8(t,o.modified));if(i)return i;let r=[],s=new Oi(e.name,r,e,t);for(let o of t)o.instances.push(s);let l=X8(t);for(let o of e.set)if(!o.modified.length)for(let c of l)r.push(Gm.get(o,c));return s}}function j8(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function X8(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function Mc(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],l=2,o=r;for(let p=0;;){if(o=="..."&&p>0&&p+3==r.length){l=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!g)throw new RangeError("Invalid path: "+r);if(s.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==r.length)break;let O=r[p++];if(p==r.length&&O=="!"){l=0;break}if(O!="/")throw new RangeError("Invalid path: "+r);o=r.slice(p)}let c=s.length-1,h=s[c];if(!h)throw new RangeError("Invalid path: "+r);let d=new qh(i,l,c>0?s.slice(0,c):null);e[h]=d.sort(e[h])}}return Qz.add(e)}const Qz=new Ne({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new qh(r.tags,r.mode,r.context);t?t.next=s:i=s,t=s}return i}});class qh{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}qh.empty=new qh([],2,null);function Ez(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let l of s.tag)t[l.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let l=r;for(let o of s)for(let c of o.set){let h=t[c.id];if(h){l=l?l+" "+h:h;break}}return l},scope:i}}function I8(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function V8(n,e,t,i=0,r=n.length){let s=new q8(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class q8{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:l,from:o,to:c}=e;if(o>=i||c<=t)return;l.isTop&&(s=this.highlighters.filter(O=>!O.scope||O.scope(l)));let h=r,d=H8(e)||qh.empty,p=I8(s,d.tags);if(p&&(h&&(h+=" "),h+=p,d.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(t,o),h),d.opaque)return;let g=e.tree&&e.tree.prop(Ne.mounted);if(g&&g.overlay){let O=e.node.enter(g.overlay[0].from+o,1),b=this.highlighters.filter(x=>!x.scope||x.scope(g.tree.type)),v=e.firstChild();for(let x=0,k=o;;x++){let C=x<g.overlay.length?g.overlay[x]:null,A=C?C.from+o:c,P=Math.max(t,k),E=Math.min(i,A);if(P<E&&v)for(;e.from<E&&(this.highlightRange(e,P,E,r,s),this.startSpan(Math.min(E,e.to),h),!(e.to>=A||!e.nextSibling())););if(!C||A>i)break;k=C.to+o,k>t&&(this.highlightRange(O.cursor(),Math.max(t,C.from+o),Math.min(i,k),"",b),this.startSpan(Math.min(i,k),h))}v&&e.parent()}else if(e.firstChild()){g&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function H8(n){let e=n.type.prop(Qz);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const de=Oi.define,Op=de(),gl=de(),RE=de(gl),PE=de(gl),Ol=de(),yp=de(Ol),wb=de(Ol),xr=de(),uo=de(xr),br=de(),Sr=de(),QS=de(),Nu=de(QS),bp=de(),M={comment:Op,lineComment:de(Op),blockComment:de(Op),docComment:de(Op),name:gl,variableName:de(gl),typeName:RE,tagName:de(RE),propertyName:PE,attributeName:de(PE),className:de(gl),labelName:de(gl),namespace:de(gl),macroName:de(gl),literal:Ol,string:yp,docString:de(yp),character:de(yp),attributeValue:de(yp),number:wb,integer:de(wb),float:de(wb),bool:de(Ol),regexp:de(Ol),escape:de(Ol),color:de(Ol),url:de(Ol),keyword:br,self:de(br),null:de(br),atom:de(br),unit:de(br),modifier:de(br),operatorKeyword:de(br),controlKeyword:de(br),definitionKeyword:de(br),moduleKeyword:de(br),operator:Sr,derefOperator:de(Sr),arithmeticOperator:de(Sr),logicOperator:de(Sr),bitwiseOperator:de(Sr),compareOperator:de(Sr),updateOperator:de(Sr),definitionOperator:de(Sr),typeOperator:de(Sr),controlOperator:de(Sr),punctuation:QS,separator:de(QS),bracket:Nu,angleBracket:de(Nu),squareBracket:de(Nu),paren:de(Nu),brace:de(Nu),content:xr,heading:uo,heading1:de(uo),heading2:de(uo),heading3:de(uo),heading4:de(uo),heading5:de(uo),heading6:de(uo),contentSeparator:de(xr),list:de(xr),quote:de(xr),emphasis:de(xr),strong:de(xr),link:de(xr),monospace:de(xr),strikethrough:de(xr),inserted:de(),deleted:de(),changed:de(),invalid:de(),meta:bp,documentMeta:de(bp),annotation:de(bp),processingInstruction:de(bp),definition:Oi.defineModifier("definition"),constant:Oi.defineModifier("constant"),function:Oi.defineModifier("function"),standard:Oi.defineModifier("standard"),local:Oi.defineModifier("local"),special:Oi.defineModifier("special")};for(let n in M){let e=M[n];e instanceof Oi&&(e.name=n)}Ez([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}]);var Tb;const xo=new Ne;function yx(n){return me.define({combine:n?e=>e.concat(n):void 0})}const bx=new Ne;class ji{constructor(e,t,i=[],r=""){this.data=e,this.name=r,Ye.prototype.hasOwnProperty("tree")||Object.defineProperty(Ye.prototype,"tree",{get(){return yt(this)}}),this.parser=t,this.extension=[_l.of(this),Ye.languageData.of((s,l,o)=>{let c=DE(s,l,o),h=c.type.prop(xo);if(!h)return[];let d=s.facet(h),p=c.type.prop(bx);if(p){let g=c.resolve(l-c.from,o);for(let O of p)if(O.test(g,s)){let b=s.facet(O.facet);return O.type=="replace"?b:b.concat(d)}}return d})].concat(i)}isActiveAt(e,t,i=-1){return DE(e,t,i).type.prop(xo)==this.data}findRegions(e){let t=e.facet(_l);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,l)=>{if(s.prop(xo)==this.data){i.push({from:l,to:l+s.length});return}let o=s.prop(Ne.mounted);if(o){if(o.tree.prop(xo)==this.data){if(o.overlay)for(let c of o.overlay)i.push({from:c.from+l,to:c.to+l});else i.push({from:l,to:l+s.length});return}else if(o.overlay){let c=i.length;if(r(o.tree,o.overlay[0].from+l),i.length>c)return}}for(let c=0;c<s.children.length;c++){let h=s.children[c];h instanceof et&&r(h,s.positions[c]+l)}};return r(yt(e),0),i}get allowsNesting(){return!0}}ji.setState=De.define();function DE(n,e,t){let i=n.facet(_l),r=yt(n).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,t,nt.ExcludeBuffers|nt.EnterBracketed))s.type.isTop&&(r=s);return r}class yc extends ji{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=yx(e.languageData);return new yc(t,e.parser.configure({props:[xo.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new yc(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function yt(n){let e=n.field(ji.state,!1);return e?e.tree:et.empty}class Y8{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let zu=null;class Hh{constructor(e,t,i=[],r,s,l,o,c){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Hh(e,t,[],et.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Y8(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=et.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(Qs.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Qs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=zu;zu=this;try{return e()}finally{zu=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=NE(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((h,d,p,g)=>c.push({fromA:h,toA:d,fromB:p,toB:g})),i=Qs.applyChanges(i,c),r=et.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let h of this.skipped){let d=e.mapPos(h.from,1),p=e.mapPos(h.to,-1);d<p&&o.push({from:d,to:p})}}}return new Hh(this.parser,t,i,r,s,l,o,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=NE(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ox{createParse(t,i,r){let s=r[0].from,l=r[r.length-1].to;return{parsedPos:s,advance(){let c=zu;if(c){for(let h of r)c.tempSkipped.push(h);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=l,new et(Kt.none,[],[],l-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return zu}}function NE(n,e,t){return Qs.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class bc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new bc(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Hh.create(e.facet(_l).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new bc(i)}}ji.state=bn.define({create:bc.init,update(n,e){for(let t of e.effects)if(t.is(ji.setState))return t.value;return e.startState.facet(_l)!=e.state.facet(_l)?bc.init(e.state):n.apply(e)}});let $z=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&($z=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Cb=typeof navigator<"u"&&(!((Tb=navigator.scheduling)===null||Tb===void 0)&&Tb.isInputPending)?()=>navigator.scheduling.isInputPending():null,U8=Lt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(ji.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(ji.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=$z(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(ji.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!Cb?Math.max(25,e.timeRemaining()-5):1e9),o=s.context.treeLen<r&&i.doc.length>r+1e3,c=s.context.work(()=>Cb&&Cb()||Date.now()>l,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(c||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ji.setState.of(new bc(s.context))})),this.chunkBudget>0&&!(c&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Kn(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),_l=me.define({combine(n){return n.length?n[0]:null},enables:n=>[ji.state,U8,fe.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Yh{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Fm{constructor(e,t,i,r,s,l=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=l,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new Fm(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let i=/\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(i)for(let r of e)for(let s of r.alias){let l=t.indexOf(s);if(l>-1&&(s.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+s.length])))return r}return null}}const W8=me.define(),Qc=me.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Km(n){let e=n.facet(Qc);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Uh(n,e){let t="",i=n.tabSize,r=n.facet(Qc)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s<e;s++)t+=r;return t}function Sx(n,e){n instanceof Ye&&(n=new Wg(n));for(let i of n.state.facet(W8)){let r=i(n,e);if(r!==void 0)return r}let t=yt(n.state);return t.length>=e?G8(n,t,e):null}class Wg{constructor(e,t={}){this.state=e,this.options=t,this.unit=Km(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,t);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.countColumn(i,e-r),l=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return l>-1&&(s+=l-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return or(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(r);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Of=new Ne;function G8(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let l=r;l&&!(l.from<i.node.from||l.to>i.node.to||l.from==i.node.from&&l.type==i.node.type);l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)i={node:s[l],next:i}}return Rz(i,n,t)}function Rz(n,e,t){for(let i=n;i;i=i.next){let r=K8(i.node);if(r)return r(vx.create(e,t,i))}return 0}function F8(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function K8(n){let e=n.type.prop(Of);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(Ne.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return l=>Pz(l,!0,1,void 0,s&&!F8(l)?r.from:void 0)}return n.parent==null?J8:null}function J8(){return 0}class vx extends Wg{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new vx(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(e9(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return Rz(this.context.next,this.base,this.pos)}}function e9(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function t9(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),l=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let o=t.to;;){let c=e.childAfter(o);if(!c||c==i)return null;if(!c.type.isSkipped){if(c.from>=l)return null;let h=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+h}}o=c.to}}function n9({closing:n,align:e=!0,units:t=1}){return i=>Pz(i,e,t,n)}function Pz(n,e,t,i,r){let s=n.textAfter,l=s.match(/^\s*/)[0].length,o=i&&s.slice(l,l+i.length)==i||r==n.pos+l,c=e?t9(n):null;return c?o?n.column(c.from):n.column(c.to):n.baseIndent+(o?0:n.unit*t)}const i9=n=>n.baseIndent;function Xp({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const r9=200;function s9(){return Ye.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+r9)return n;let s=t.sliceString(r.from,i);if(!e.some(h=>h.test(s)))return n;let{state:l}=n,o=-1,c=[];for(let{head:h}of l.selection.ranges){let d=l.doc.lineAt(h);if(d.from==o)continue;o=d.from;let p=Sx(l,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],O=Uh(l,p);g!=O&&c.push({from:d.from,to:d.from+g.length,insert:O})}return c.length?[n,{changes:c,sequential:!0}]:n})}const Dz=me.define(),Ec=new Ne;function Nz(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function l9(n,e,t){let i=yt(n);if(i.length<t)return null;let r=i.resolveStack(t,1),s=null;for(let l=r;l;l=l.next){let o=l.node;if(o.to<=t||o.from>t)continue;if(s&&o.from<e)break;let c=o.type.prop(Ec);if(c&&(o.to<i.length-50||i.length==n.doc.length||!o9(o))){let h=c(o,n);h&&h.from<=t&&h.from>=e&&h.to>t&&(s=h)}}return s}function o9(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Jm(n,e,t){for(let i of n.facet(Dz)){let r=i(n,e,t);if(r)return r}return l9(n,e,t)}function zz(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const Gg=De.define({map:zz}),yf=De.define({map:zz});function Lz(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const jo=bn.define({create(){return we.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=zE(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(Gg)&&!a9(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(Zz),r=i?we.replace({widget:new m9(i(e.state,t.value))}):LE;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(yf)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=zE(n,e.selection.main.head)),n},provide:n=>fe.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],r=n[t++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(LE.range(i,r))}return we.set(e,!0)}});function zE(n,e,t=e){let i=!1;return n.between(e,t,(r,s)=>{r<t&&s>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(r,s)=>r>=t||s<=e}):n}function eg(n,e,t){var i;let r=null;return(i=n.field(jo,!1))===null||i===void 0||i.between(e,t,(s,l)=>{(!r||r.from>s)&&(r={from:s,to:l})}),r}function a9(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function _z(n,e){return n.field(jo,!1)?e:e.concat(De.appendConfig.of(jz()))}const c9=n=>{for(let e of Lz(n)){let t=Jm(n.state,e.from,e.to);if(t)return n.dispatch({effects:_z(n.state,[Gg.of(t),Bz(n,t)])}),!0}return!1},u9=n=>{if(!n.state.field(jo,!1))return!1;let e=[];for(let t of Lz(n)){let i=eg(n.state,t.from,t.to);i&&e.push(yf.of(i),Bz(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Bz(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return fe.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const h9=n=>{let{state:e}=n,t=[];for(let i=0;i<e.doc.length;){let r=n.lineBlockAt(i),s=Jm(e,r.from,r.to);s&&t.push(Gg.of(s)),i=(s?n.lineBlockAt(s.to):r).to+1}return t.length&&n.dispatch({effects:_z(n.state,t)}),!!t.length},f9=n=>{let e=n.state.field(jo,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(yf.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},d9=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:c9},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:u9},{key:"Ctrl-Alt-[",run:h9},{key:"Ctrl-Alt-]",run:f9}],p9={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Zz=me.define({combine(n){return Ir(n,p9)}});function jz(n){return[jo,y9]}function Xz(n,e){let{state:t}=n,i=t.facet(Zz),r=l=>{let o=n.lineBlockAt(n.posAtDOM(l.target)),c=eg(n.state,o.from,o.to);c&&n.dispatch({effects:yf.of(c)}),l.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const LE=we.replace({widget:new class extends ur{toDOM(n){return Xz(n,null)}}});class m9 extends ur{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Xz(e,this.value)}}const g9={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Ab extends Ps{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function O9(n={}){let e={...g9,...n},t=new Ab(e,!0),i=new Ab(e,!1),r=Lt.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(_l)!=l.state.facet(_l)||l.startState.field(jo,!1)!=l.state.field(jo,!1)||yt(l.startState)!=yt(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new $s;for(let c of l.viewportLineBlocks){let h=eg(l.state,c.from,c.to)?i:Jm(l.state,c.from,c.to)?t:null;h&&o.add(c.from,c.from,h)}return o.finish()}}),{domEventHandlers:s}=e;return[r,m8({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(r))===null||o===void 0?void 0:o.markers)||Ve.empty},initialSpacer(){return new Ab(e,!1)},domEventHandlers:{...s,click:(l,o,c)=>{if(s.click&&s.click(l,o,c))return!0;let h=eg(l.state,o.from,o.to);if(h)return l.dispatch({effects:yf.of(h)}),!0;let d=Jm(l.state,o.from,o.to);return d?(l.dispatch({effects:Gg.of(d)}),!0):!1}}}),jz()]}const y9=fe.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class bf{constructor(e,t){this.specs=e;let i;function r(o){let c=Nl.newName();return(i||(i=Object.create(null)))["."+c]=o,c}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,l=t.scope;this.scope=l instanceof ji?o=>o.prop(xo)==l.data:l?o=>o==l:void 0,this.style=Ez(e.map(o=>({tag:o.tag,class:o.class||r(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=i?new Nl(i):null,this.themeType=t.themeType}static define(e,t){return new bf(e,t||{})}}const ES=me.define(),Iz=me.define({combine(n){return n.length?[n[0]]:null}});function Mb(n){let e=n.facet(ES);return e.length?e:n.facet(Iz)}function Vz(n,e){let t=[S9],i;return n instanceof bf&&(n.module&&t.push(fe.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Iz.of(n)):i?t.push(ES.computeN([fe.darkTheme],r=>r.facet(fe.darkTheme)==(i=="dark")?[n]:[])):t.push(ES.of(n)),t}class b9{constructor(e){this.markCache=Object.create(null),this.tree=yt(e.state),this.decorations=this.buildDeco(e,Mb(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=yt(e.state),i=Mb(e.state),r=i!=Mb(e.startState),{viewport:s}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!r&&t.type==this.tree.type&&l>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return we.none;let i=new $s;for(let{from:r,to:s}of e.visibleRanges)V8(this.tree,t,(l,o,c)=>{i.add(l,o,this.markCache[c]||(this.markCache[c]=we.mark({class:c})))},r,s);return i.finish()}}const S9=_s.high(Lt.fromClass(b9,{decorations:n=>n.decorations})),v9=bf.define([{tag:M.meta,color:"#404740"},{tag:M.link,textDecoration:"underline"},{tag:M.heading,textDecoration:"underline",fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strong,fontWeight:"bold"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.keyword,color:"#708"},{tag:[M.atom,M.bool,M.url,M.contentSeparator,M.labelName],color:"#219"},{tag:[M.literal,M.inserted],color:"#164"},{tag:[M.string,M.deleted],color:"#a11"},{tag:[M.regexp,M.escape,M.special(M.string)],color:"#e40"},{tag:M.definition(M.variableName),color:"#00f"},{tag:M.local(M.variableName),color:"#30a"},{tag:[M.typeName,M.namespace],color:"#085"},{tag:M.className,color:"#167"},{tag:[M.special(M.variableName),M.macroName],color:"#256"},{tag:M.definition(M.propertyName),color:"#00c"},{tag:M.comment,color:"#940"},{tag:M.invalid,color:"#f00"}]),x9=fe.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),qz=1e4,Hz="()[]{}",Yz=me.define({combine(n){return Ir(n,{afterCursor:!0,brackets:Hz,maxScanDistance:qz,renderMatch:T9})}}),k9=we.mark({class:"cm-matchingBracket"}),w9=we.mark({class:"cm-nonmatchingBracket"});function T9(n){let e=[],t=n.matched?k9:w9;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function _E(n){let e=[],t=n.facet(Yz);for(let i of n.selection.ranges){if(!i.empty)continue;let r=Pr(n,i.head,-1,t)||i.head>0&&Pr(n,i.head-1,1,t)||t.afterCursor&&(Pr(n,i.head,1,t)||i.head<n.doc.length&&Pr(n,i.head+1,-1,t));r&&(e=e.concat(t.renderMatch(r,n)))}return we.set(e,!0)}const C9=Lt.fromClass(class{constructor(n){this.paused=!1,this.decorations=_E(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=_E(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),A9=[C9,x9];function M9(n={}){return[Yz.of(n),A9]}const Uz=new Ne;function $S(n,e,t){let i=n.prop(e<0?Ne.openedBy:Ne.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function RS(n){let e=n.type.prop(Uz);return e?e(n.node):n}function Pr(n,e,t,i={}){let r=i.maxScanDistance||qz,s=i.brackets||Hz,l=yt(n),o=l.resolveInner(e,t);for(let c=o;c;c=c.parent){let h=$S(c.type,t,s);if(h&&c.from<c.to){let d=RS(c);if(d&&(t>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return Q9(n,e,t,c,d,h,s)}}return E9(n,e,t,l,o.type,r,s)}function Q9(n,e,t,i,r,s,l){let o=i.parent,c={from:r.from,to:r.to},h=0,d=o==null?void 0:o.cursor();if(d&&(t<0?d.childBefore(i.from):d.childAfter(i.to)))do if(t<0?d.to<=i.from:d.from>=i.to){if(h==0&&s.indexOf(d.type.name)>-1&&d.from<d.to){let p=RS(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if($S(d.type,t,l))h++;else if($S(d.type,-t,l)){if(h==0){let p=RS(d);return{start:c,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}h--}}while(t<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function E9(n,e,t,i,r,s,l){if(t<0?!e:e==n.doc.length)return null;let o=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),c=l.indexOf(o);if(c<0||c%2==0!=t>0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},d=n.doc.iterRange(e,t>0?n.doc.length:0),p=0;for(let g=0;!d.next().done&&g<=s;){let O=d.value;t<0&&(g+=O.length);let b=e+g*t;for(let v=t>0?0:O.length-1,x=t>0?O.length:-1;v!=x;v+=t){let k=l.indexOf(O[v]);if(!(k<0||i.resolveInner(b+v,1).type!=r))if(k%2==0==t>0)p++;else{if(p==1)return{start:h,end:{from:b+v,to:b+v+1},matched:k>>1==c>>1};p--}}t>0&&(g+=O.length)}return d.done?{start:h,matched:!1}:null}const $9=Object.create(null),BE=[Kt.none],ZE=[],jE=Object.create(null),R9=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])R9[n]=P9($9,e);function Qb(n,e){ZE.indexOf(n)>-1||(ZE.push(n),console.warn(e))}function P9(n,e){let t=[];for(let o of e.split(" ")){let c=[];for(let h of o.split(".")){let d=n[h]||M[h];d?typeof d=="function"?c.length?c=c.map(d):Qb(h,`Modifier ${h} used at start of tag`):c.length?Qb(h,`Tag ${h} used as modifier`):c=Array.isArray(d)?d:[d]:Qb(h,`Unknown highlighting tag ${h}`)}for(let h of c)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(o=>o.id),s=jE[r];if(s)return s.id;let l=jE[r]=Kt.define({id:BE.length,name:i,props:[Mc({[i]:t})]});return BE.push(l),l.id}gt.RTL,gt.LTR;const D9=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=kx(n.state,t.from);return i.line?N9(n):i.block?L9(n):!1};function xx(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const N9=xx(Z9,0),z9=xx(Wz,0),L9=xx((n,e)=>Wz(n,e,B9(e)),0);function kx(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Lu=50;function _9(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-Lu,i),l=n.sliceDoc(r,r+Lu),o=/\s*$/.exec(s)[0].length,c=/^\s*/.exec(l)[0].length,h=s.length-o;if(s.slice(h-e.length,h)==e&&l.slice(c,c+t.length)==t)return{open:{pos:i-o,margin:o&&1},close:{pos:r+c,margin:c&&1}};let d,p;r-i<=2*Lu?d=p=n.sliceDoc(i,r):(d=n.sliceDoc(i,i+Lu),p=n.sliceDoc(r-Lu,r));let g=/^\s*/.exec(d)[0].length,O=/\s*$/.exec(p)[0].length,b=p.length-O-t.length;return d.slice(g,g+e.length)==e&&p.slice(b,b+t.length)==t?{open:{pos:i+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:r-O-t.length,margin:/\s/.test(p.charAt(b-1))?1:0}}:null}function B9(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to);r.from>i.from&&r.from==t.to&&(r=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function Wz(n,e,t=e.selection.ranges){let i=t.map(s=>kx(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,l)=>_9(e,i[l],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,l)=>r[l]?[]:[{from:s.from,insert:i[l].open+" "},{from:s.to,insert:" "+i[l].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let l=0,o;l<r.length;l++)if(o=r[l]){let c=i[l],{open:h,close:d}=o;s.push({from:h.pos-c.open.length,to:h.pos+h.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:s}}return null}function Z9(n,e,t=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:l}of t){let o=i.length,c=1e9,h;for(let d=s;d<=l;){let p=e.doc.lineAt(d);if(h==null&&(h=kx(e,p.from).line,!h))continue e;if(p.from>r&&(s==l||l>p.from)){r=p.from;let g=/^\s*/.exec(p.text)[0].length,O=g==p.length,b=p.text.slice(g,g+h.length)==h?g:-1;g<p.text.length&&g<c&&(c=g),i.push({line:p,comment:b,token:h,indent:g,empty:O,single:!1})}d=p.to+1}if(c<1e9)for(let d=o;d<i.length;d++)i[d].indent<i[d].line.text.length&&(i[d].indent=c);i.length==o+1&&(i[o].single=!0)}if(n!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:c,indent:h,empty:d,single:p}of i)(p||!d)&&s.push({from:o.from+h,insert:c+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:o,token:c}of i)if(o>=0){let h=l.from+o,d=h+c.length;l.text[d-l.from]==" "&&d++,s.push({from:h,to:d})}return{changes:s}}return null}const PS=Xr.define(),j9=Xr.define(),X9=me.define(),Gz=me.define({combine(n){return Ir(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),Fz=bn.define({create(){return Dr.empty},update(n,e){let t=e.state.facet(Gz),i=e.annotation(PS);if(i){let c=Jn.fromTransaction(e,i.selection),h=i.side,d=h==0?n.undone:n.done;return c?d=tg(d,d.length,t.minDepth,c):d=eL(d,e.startState.selection),new Dr(h==0?i.rest:d,h==0?d:i.rest)}let r=e.annotation(j9);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(Yt.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=Jn.fromTransaction(e),l=e.annotation(Yt.time),o=e.annotation(Yt.userEvent);return s?n=n.addChanges(s,l,o,t,e):e.selection&&(n=n.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(r=="full"||r=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Dr(n.done.map(Jn.fromJSON),n.undone.map(Jn.fromJSON))}});function I9(n={}){return[Fz,Gz.of(n),fe.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Kz:e.inputType=="historyRedo"?DS:null;return i?(e.preventDefault(),i(t)):!1}})]}function Fg(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(Fz,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}const Kz=Fg(0,!1),DS=Fg(1,!1),V9=Fg(0,!0),q9=Fg(1,!0);class Jn{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new Jn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new Jn(e.changes&&Ft.fromJSON(e.changes),[],e.mapped&&zr.fromJSON(e.mapped),e.startSelection&&Y.fromJSON(e.startSelection),e.selectionsAfter.map(Y.fromJSON))}static fromTransaction(e,t){let i=Xi;for(let r of e.startState.facet(X9)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new Jn(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xi)}static selection(e){return new Jn(void 0,Xi,void 0,void 0,e)}}function tg(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function H9(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,l,o)=>{for(let c=0;c<t.length;){let h=t[c++],d=t[c++];o>=h&&l<=d&&(i=!0)}}),i}function Y9(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Jz(n,e){return n.length?e.length?n.concat(e):n:e}const Xi=[],U9=200;function eL(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-U9));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),tg(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Jn.selection([e])]}function W9(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Eb(n,e){if(!n.length)return n;let t=n.length,i=Xi;for(;t;){let r=G9(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[Jn.selection(i)]:Xi}function G9(n,e,t){let i=Jz(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):Xi,t);if(!n.changes)return Jn.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),l=n.mapped?n.mapped.composeDesc(s):s;return new Jn(r,De.mapEffects(n.effects,e),l,n.startSelection.map(s),i)}const F9=/^(input\.type|delete)($|\.)/;class Dr{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new Dr(this.done,this.undone):this}addChanges(e,t,i,r,s){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!i||F9.test(i))&&(!o.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,H9(o.changes,e.changes))||i=="input.type.compose")?l=tg(l,l.length-1,r.minDepth,new Jn(e.changes.compose(o.changes),Jz(De.mapEffects(e.effects,o.changes),o.effects),o.mapped,o.startSelection,Xi)):l=tg(l,l.length,r.minDepth,e),new Dr(l,Xi,t,i)}addSelection(e,t,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Xi;return s.length>0&&t-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&Y9(s[s.length-1],e)?this:new Dr(eL(this.done,e),this.undone,t,i)}addMapping(e){return new Dr(Eb(this.done,e),Eb(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],l=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(i&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:PS.of({side:e,rest:W9(r),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let o=r.length==1?Xi:r.slice(0,r.length-1);return s.mapped&&(o=Eb(o,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:PS.of({side:e,rest:o,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Dr.empty=new Dr(Xi,Xi);const K9=[{key:"Mod-z",run:Kz,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:DS,preventDefault:!0},{linux:"Ctrl-Shift-z",run:DS,preventDefault:!0},{key:"Mod-u",run:V9,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:q9,preventDefault:!0}];function $c(n,e){return Y.create(n.ranges.map(e),n.mainIndex)}function hr(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function fr({state:n,dispatch:e},t){let i=$c(n.selection,t);return i.eq(n.selection,!0)?!1:(e(hr(n,i)),!0)}function Kg(n,e){return Y.cursor(e?n.to:n.from)}function tL(n,e){return fr(n,t=>t.empty?n.moveByChar(t,e):Kg(t,e))}function Mn(n){return n.textDirectionAt(n.state.selection.main.head)==gt.LTR}const nL=n=>tL(n,!Mn(n)),iL=n=>tL(n,Mn(n));function rL(n,e){return fr(n,t=>t.empty?n.moveByGroup(t,e):Kg(t,e))}const J9=n=>rL(n,!Mn(n)),eG=n=>rL(n,Mn(n));function tG(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function Jg(n,e,t){let i=yt(n).resolveInner(e.head),r=t?Ne.closedBy:Ne.openedBy;for(let c=e.head;;){let h=t?i.childAfter(c):i.childBefore(c);if(!h)break;tG(n,h,r)?i=h:c=t?h.to:h.from}let s=i.type.prop(r),l,o;return s&&(l=t?Pr(n,i.from,1):Pr(n,i.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?i.to:i.from,Y.cursor(o,t?-1:1)}const nG=n=>fr(n,e=>Jg(n.state,e,!Mn(n))),iG=n=>fr(n,e=>Jg(n.state,e,Mn(n)));function sL(n,e){return fr(n,t=>{if(!t.empty)return Kg(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const lL=n=>sL(n,!1),oL=n=>sL(n,!0);function aL(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,r;if(e){for(let s of n.state.facet(fe.scrollMargins)){let l=s(n);l!=null&&l.top&&(t=Math.max(l==null?void 0:l.top,t)),l!=null&&l.bottom&&(i=Math.max(l==null?void 0:l.bottom,i))}r=n.scrollDOM.clientHeight-t-i}else r=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,r-5)}}function cL(n,e){let t=aL(n),{state:i}=n,r=$c(i.selection,l=>l.empty?n.moveVertically(l,e,t.height):Kg(l,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let l=n.coordsAtPos(i.selection.main.head),o=n.scrollDOM.getBoundingClientRect(),c=o.top+t.marginTop,h=o.bottom-t.marginBottom;l&&l.top>c&&l.bottom<h&&(s=fe.scrollIntoView(r.main.head,{y:"start",yMargin:l.top-c}))}return n.dispatch(hr(i,r),{effects:s}),!0}const XE=n=>cL(n,!1),NS=n=>cL(n,!0);function Il(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=Y.cursor(i.from+s))}return r}const rG=n=>fr(n,e=>Il(n,e,!0)),sG=n=>fr(n,e=>Il(n,e,!1)),lG=n=>fr(n,e=>Il(n,e,!Mn(n))),oG=n=>fr(n,e=>Il(n,e,Mn(n))),aG=n=>fr(n,e=>Y.cursor(n.lineBlockAt(e.head).from,1)),cG=n=>fr(n,e=>Y.cursor(n.lineBlockAt(e.head).to,-1));function uG(n,e,t){let i=!1,r=$c(n.selection,s=>{let l=Pr(n,s.head,-1)||Pr(n,s.head,1)||s.head>0&&Pr(n,s.head-1,1)||s.head<n.doc.length&&Pr(n,s.head+1,-1);if(!l||!l.end)return s;i=!0;let o=l.start.from==s.head?l.end.to:l.end.from;return Y.cursor(o)});return i?(e(hr(n,r)),!0):!1}const hG=({state:n,dispatch:e})=>uG(n,e);function Yi(n,e){let t=$c(n.state.selection,i=>{let r=e(i);return Y.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return t.eq(n.state.selection)?!1:(n.dispatch(hr(n.state,t)),!0)}function uL(n,e){return Yi(n,t=>n.moveByChar(t,e))}const hL=n=>uL(n,!Mn(n)),fL=n=>uL(n,Mn(n));function dL(n,e){return Yi(n,t=>n.moveByGroup(t,e))}const fG=n=>dL(n,!Mn(n)),dG=n=>dL(n,Mn(n)),pG=n=>Yi(n,e=>Jg(n.state,e,!Mn(n))),mG=n=>Yi(n,e=>Jg(n.state,e,Mn(n)));function pL(n,e){return Yi(n,t=>n.moveVertically(t,e))}const mL=n=>pL(n,!1),gL=n=>pL(n,!0);function OL(n,e){return Yi(n,t=>n.moveVertically(t,e,aL(n).height))}const IE=n=>OL(n,!1),VE=n=>OL(n,!0),gG=n=>Yi(n,e=>Il(n,e,!0)),OG=n=>Yi(n,e=>Il(n,e,!1)),yG=n=>Yi(n,e=>Il(n,e,!Mn(n))),bG=n=>Yi(n,e=>Il(n,e,Mn(n))),SG=n=>Yi(n,e=>Y.cursor(n.lineBlockAt(e.head).from)),vG=n=>Yi(n,e=>Y.cursor(n.lineBlockAt(e.head).to)),qE=({state:n,dispatch:e})=>(e(hr(n,{anchor:0})),!0),HE=({state:n,dispatch:e})=>(e(hr(n,{anchor:n.doc.length})),!0),YE=({state:n,dispatch:e})=>(e(hr(n,{anchor:n.selection.main.anchor,head:0})),!0),UE=({state:n,dispatch:e})=>(e(hr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),xG=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),kG=({state:n,dispatch:e})=>{let t=eO(n).map(({from:i,to:r})=>Y.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:Y.create(t),userEvent:"select"})),!0},wG=({state:n,dispatch:e})=>{let t=$c(n.selection,i=>{let r=yt(n),s=r.resolveStack(i.from,1);if(i.empty){let l=r.resolveStack(i.from,-1);l.node.from>=s.node.from&&l.node.to<=s.node.to&&(s=l)}for(let l=s;l;l=l.next){let{node:o}=l;if((o.from<i.from&&o.to>=i.to||o.to>i.to&&o.from<=i.from)&&l.next)return Y.range(o.to,o.from)}return i});return t.eq(n.selection)?!1:(e(hr(n,t)),!0)};function yL(n,e){let{state:t}=n,i=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let l=t.doc.lineAt(s.head);if(e?l.to<n.state.doc.length:l.from>0)for(let o=s;;){let c=n.moveVertically(o,e);if(c.head<l.from||c.head>l.to){r.some(h=>h.head==c.head)||r.push(c);break}else{if(c.head==o.head)break;o=c}}}return r.length==i.ranges.length?!1:(n.dispatch(hr(t,Y.create(r,r.length-1))),!0)}const TG=n=>yL(n,!1),CG=n=>yL(n,!0),AG=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=Y.create([t.main]):t.main.empty||(i=Y.create([Y.cursor(t.main.head)])),i?(e(hr(n,i)),!0):!1};function Sf(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(s=>{let{from:l,to:o}=s;if(l==o){let c=e(s);c<l?(t="delete.backward",c=Sp(n,c,!1)):c>l&&(t="delete.forward",c=Sp(n,c,!0)),l=Math.min(l,c),o=Math.max(o,c)}else l=Sp(n,l,!1),o=Sp(n,o,!0);return l==o?{range:s}:{changes:{from:l,to:o},range:Y.cursor(l,l<s.head?-1:1)}});return r.changes.empty?!1:(n.dispatch(i.update(r,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?fe.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Sp(n,e,t){if(n instanceof fe)for(let i of n.state.facet(fe.atomicRanges).map(r=>r(n)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=t?s:r)});return e}const bL=(n,e,t)=>Sf(n,i=>{let r=i.from,{state:s}=n,l=s.doc.lineAt(r),o,c;if(t&&!e&&r>l.from&&r<l.from+200&&!/[^ \t]/.test(o=l.text.slice(0,r-l.from))){if(o[o.length-1]==" ")return r-1;let h=or(o,s.tabSize),d=h%Km(s)||Km(s);for(let p=0;p<d&&o[o.length-1-p]==" ";p++)r--;c=r}else c=nn(l.text,r-l.from,e,e)+l.from,c==r&&l.number!=(e?s.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(c-l.from,r-l.from))&&(c=nn(l.text,c-l.from,!1,!1)+l.from);return c}),zS=n=>bL(n,!1,!0),SL=n=>bL(n,!0,!1),vL=(n,e)=>Sf(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let o=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let c=nn(s.text,i-s.from,e)+s.from,h=s.text.slice(Math.min(i,c)-s.from,Math.max(i,c)-s.from),d=l(h);if(o!=null&&d!=o)break;(h!=" "||i!=t.head)&&(o=d),i=c}return i}),xL=n=>vL(n,!1),MG=n=>vL(n,!0),QG=n=>Sf(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),EG=n=>Sf(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),$G=n=>Sf(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),RG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Ge.of(["",""])},range:Y.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},PG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),l=r==s.from?r-1:nn(s.text,r-s.from,!1)+s.from,o=r==s.to?r+1:nn(s.text,r-s.from,!0)+s.from;return{changes:{from:l,to:o,insert:n.doc.slice(r,o).append(n.doc.slice(l,r))},range:Y.cursor(o)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function eO(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function kL(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of eO(n)){if(t?s.to==n.doc.length:s.from==0)continue;let l=n.doc.lineAt(t?s.to+1:s.from-1),o=l.length+1;if(t){i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+n.lineBreak});for(let c of s.ranges)r.push(Y.range(Math.min(n.doc.length,c.anchor+o),Math.min(n.doc.length,c.head+o)))}else{i.push({from:l.from,to:s.from},{from:s.to,insert:n.lineBreak+l.text});for(let c of s.ranges)r.push(Y.range(c.anchor-o,c.head-o))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:Y.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const DG=({state:n,dispatch:e})=>kL(n,e,!1),NG=({state:n,dispatch:e})=>kL(n,e,!0);function wL(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of eO(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let r=n.changes(i);return e(n.update({changes:r,selection:n.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const zG=({state:n,dispatch:e})=>wL(n,e,!1),LG=({state:n,dispatch:e})=>wL(n,e,!0),_G=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(eO(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=$c(e.selection,r=>{let s;if(n.lineWrapping){let l=n.lineBlockAt(r.head),o=n.coordsAtPos(r.head,r.assoc||1);o&&(s=l.bottom+n.documentTop-o.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,s)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function BG(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=yt(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(Ne.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const WE=TL(!1),ZG=TL(!0);function TL(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:l}=r,o=e.doc.lineAt(s),c=!n&&s==l&&BG(e,s);n&&(s=l=(l<=o.to?o:e.doc.lineAt(l)).to);let h=new Wg(e,{simulateBreak:s,simulateDoubleBreak:!!c}),d=Sx(h,s);for(d==null&&(d=or(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));l<o.to&&/\s/.test(o.text[l-o.from]);)l++;c?{from:s,to:l}=c:s>o.from&&s<o.from+100&&!/\S/.test(o.text.slice(0,s))&&(s=o.from);let p=["",Uh(e,d)];return c&&p.push(Uh(e,h.lineIndent(o.from,-1))),{changes:{from:s,to:l,insert:Ge.of(p)},range:Y.cursor(s+1+p[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function wx(n,e){let t=-1;return n.changeByRange(i=>{let r=[];for(let l=i.from;l<=i.to;){let o=n.doc.lineAt(l);o.number>t&&(i.empty||i.to>o.from)&&(e(o,r,i),t=o.number),l=o.to+1}let s=n.changes(r);return{changes:r,range:Y.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const jG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Wg(n,{overrideIndentation:s=>{let l=t[s];return l??-1}}),r=wx(n,(s,l,o)=>{let c=Sx(i,s.from);if(c==null)return;/\S/.test(s.text)||(c=0);let h=/^\s*/.exec(s.text)[0],d=Uh(n,c);(h!=d||o.from<s.from+h.length)&&(t[s.from]=c,l.push({from:s.from,to:s.from+h.length,insert:d}))});return r.changes.empty||e(n.update(r,{userEvent:"indent"})),!0},CL=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(wx(n,(t,i)=>{i.push({from:t.from,insert:n.facet(Qc)})}),{userEvent:"input.indent"})),!0),AL=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(wx(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=or(r,n.tabSize),l=0,o=Uh(n,Math.max(0,s-Km(n)));for(;l<r.length&&l<o.length&&r.charCodeAt(l)==o.charCodeAt(l);)l++;i.push({from:t.from+l,to:t.from+r.length,insert:o.slice(l)})}),{userEvent:"delete.dedent"})),!0),XG=n=>(n.setTabFocusMode(),!0),IG=[{key:"Ctrl-b",run:nL,shift:hL,preventDefault:!0},{key:"Ctrl-f",run:iL,shift:fL},{key:"Ctrl-p",run:lL,shift:mL},{key:"Ctrl-n",run:oL,shift:gL},{key:"Ctrl-a",run:aG,shift:SG},{key:"Ctrl-e",run:cG,shift:vG},{key:"Ctrl-d",run:SL},{key:"Ctrl-h",run:zS},{key:"Ctrl-k",run:QG},{key:"Ctrl-Alt-h",run:xL},{key:"Ctrl-o",run:RG},{key:"Ctrl-t",run:PG},{key:"Ctrl-v",run:NS}],VG=[{key:"ArrowLeft",run:nL,shift:hL,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:J9,shift:fG,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:lG,shift:yG,preventDefault:!0},{key:"ArrowRight",run:iL,shift:fL,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:eG,shift:dG,preventDefault:!0},{mac:"Cmd-ArrowRight",run:oG,shift:bG,preventDefault:!0},{key:"ArrowUp",run:lL,shift:mL,preventDefault:!0},{mac:"Cmd-ArrowUp",run:qE,shift:YE},{mac:"Ctrl-ArrowUp",run:XE,shift:IE},{key:"ArrowDown",run:oL,shift:gL,preventDefault:!0},{mac:"Cmd-ArrowDown",run:HE,shift:UE},{mac:"Ctrl-ArrowDown",run:NS,shift:VE},{key:"PageUp",run:XE,shift:IE},{key:"PageDown",run:NS,shift:VE},{key:"Home",run:sG,shift:OG,preventDefault:!0},{key:"Mod-Home",run:qE,shift:YE},{key:"End",run:rG,shift:gG,preventDefault:!0},{key:"Mod-End",run:HE,shift:UE},{key:"Enter",run:WE,shift:WE},{key:"Mod-a",run:xG},{key:"Backspace",run:zS,shift:zS,preventDefault:!0},{key:"Delete",run:SL,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:xL,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:MG,preventDefault:!0},{mac:"Mod-Backspace",run:EG,preventDefault:!0},{mac:"Mod-Delete",run:$G,preventDefault:!0}].concat(IG.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),qG=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:nG,shift:pG},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:iG,shift:mG},{key:"Alt-ArrowUp",run:DG},{key:"Shift-Alt-ArrowUp",run:zG},{key:"Alt-ArrowDown",run:NG},{key:"Shift-Alt-ArrowDown",run:LG},{key:"Mod-Alt-ArrowUp",run:TG},{key:"Mod-Alt-ArrowDown",run:CG},{key:"Escape",run:AG},{key:"Mod-Enter",run:ZG},{key:"Alt-l",mac:"Ctrl-l",run:kG},{key:"Mod-i",run:wG,preventDefault:!0},{key:"Mod-[",run:AL},{key:"Mod-]",run:CL},{key:"Mod-Alt-\\",run:jG},{key:"Shift-Mod-k",run:_G},{key:"Shift-Mod-\\",run:hG},{key:"Mod-/",run:D9},{key:"Alt-A",run:z9},{key:"Ctrl-m",mac:"Shift-Alt-m",run:XG}].concat(VG),HG={key:"Tab",run:CL,shift:AL},GE=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Sc{constructor(e,t,i=0,r=e.length,s,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?o=>s(GE(o)):GE,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Wn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Wv(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Mr(e);let r=this.normalize(t);if(r.length)for(let s=0,l=i,o=!0;;s++){let c=r.charCodeAt(s),h=this.match(c,l,o,this.bufferPos+this.bufferStart,s==r.length-1);if(h)return this.value=h,this;if(s==r.length-1)break;o&&s<t.length&&t.charCodeAt(s)==c?l++:o=!1}}}match(e,t,i,r,s){let l=null;for(let o=0;o<this.matches.length;){let c=this.matches[o],h=!1;this.query.charCodeAt(c.index)==e&&(c.index==this.query.length-1?l={from:c.from,to:r,precise:s&&c.precise}:(c.index++,h=!0)),h?o++:this.matches.splice(o,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?l={from:t,to:r,precise:i&&s}:this.matches.push({from:t,index:1,precise:i})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(Sc.prototype[Symbol.iterator]=function(){return this});const ML={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Tx="gm"+(/x/.unicode==null?"":"u");class QL{constructor(e,t,i,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=ML,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new EL(e,t,i,r,s);this.re=new RegExp(t,Tx+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=e.iter();let l=e.lineAt(r);this.curLineStart=l.from,this.matchPos=ng(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,r=i+t[0].length;if(this.matchPos=ng(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<r||i>this.value.to)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const $b=new WeakMap;class tc{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let r=$b.get(e);if(!r||r.from>=i||r.to<=t){let o=new tc(t,e.sliceString(t,i));return $b.set(e,o),o}if(r.from==t&&r.to==i)return r;let{text:s,from:l}=r;return l>t&&(s=e.sliceString(t,l)+s,l=t),r.to<i&&(s+=e.sliceString(r.to,i)),$b.set(e,new tc(l,s)),new tc(t,s.slice(t-l,i-l))}}class EL{constructor(e,t,i,r,s){this.text=e,this.to=s,this.done=!1,this.value=ML,this.matchPos=ng(e,r),this.re=new RegExp(t,Tx+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=tc.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,r=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,precise:!0,match:t},this.matchPos=ng(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=tc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(QL.prototype[Symbol.iterator]=EL.prototype[Symbol.iterator]=function(){return this});function YG(n){try{return new RegExp(n,Tx),!0}catch{return!1}}function ng(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}const UG=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:i,result:r}=h8(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let l=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!l){n.dispatch({effects:i});return}let o=e.doc.lineAt(e.selection.main.head),[,c,h,d,p]=l,g=d?+d.slice(1):0,O=h?+h:o.number;if(h&&p){let x=O/100;c&&(x=x*(c=="-"?-1:1)+o.number/e.doc.lines),O=Math.round(e.doc.lines*x)}else h&&c&&(O=O*(c=="-"?-1:1)+o.number);let b=e.doc.line(Math.max(1,Math.min(e.doc.lines,O))),v=Y.cursor(b.from+Math.max(0,Math.min(g,b.length)));n.dispatch({effects:[i,fe.scrollIntoView(v.from,{y:"center"})],selection:v})}),!0},WG={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},GG=me.define({combine(n){return Ir(n,WG,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function FG(n){return[nF,tF]}const KG=we.mark({class:"cm-selectionMatch"}),JG=we.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function FE(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=Qt.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=Qt.Word)}function eF(n,e,t,i){return n(e.sliceDoc(t,t+1))==Qt.Word&&n(e.sliceDoc(i-1,i))==Qt.Word}const tF=Lt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(GG),{state:t}=n,i=t.selection;if(i.ranges.length>1)return we.none;let r=i.main,s,l=null;if(r.empty){if(!e.highlightWordAroundCursor)return we.none;let c=t.wordAt(r.head);if(!c)return we.none;l=t.charCategorizer(r.head),s=t.sliceDoc(c.from,c.to)}else{let c=r.to-r.from;if(c<e.minSelectionLength||c>200)return we.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),l=t.charCategorizer(r.head),!(FE(l,t,r.from,r.to)&&eF(l,t,r.from,r.to)))return we.none}else if(s=t.sliceDoc(r.from,r.to),!s)return we.none}let o=[];for(let c of n.visibleRanges){let h=new Sc(t.doc,s,c.from,c.to);for(;!h.next().done;){let{from:d,to:p}=h.value;if((!l||FE(l,t,d,p))&&(r.empty&&d<=r.from&&p>=r.to?o.push(JG.range(d,p)):(d>=r.to||p<=r.from)&&o.push(KG.range(d,p)),o.length>e.maxMatches))return we.none}}return we.set(o)}},{decorations:n=>n.decorations}),nF=fe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),iF=({state:n,dispatch:e})=>{let{selection:t}=n,i=Y.create(t.ranges.map(r=>n.wordAt(r.head)||Y.cursor(r.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function rF(n,e){let{main:t,ranges:i}=n.selection,r=n.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let l=!1,o=new Sc(n.doc,e,i[i.length-1].to);;)if(o.next(),o.done){if(l)return null;o=new Sc(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),l=!0}else{if(l&&i.some(c=>c.from==o.value.from))continue;if(s){let c=n.wordAt(o.value.from);if(!c||c.from!=o.value.from||c.to!=o.value.to)continue}return o.value}}const sF=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return iF({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=i))return!1;let r=rF(n,i);return r?(e(n.update({selection:n.selection.addRange(Y.range(r.from,r.to),!1),effects:fe.scrollIntoView(r.to)})),!0):!1},Rc=me.define({combine(n){return Ir(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new bF(e),scrollToMatch:e=>fe.scrollIntoView(e)})}});class $L{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||YG(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
|
|
220
|
+
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new hF(this):new aF(this)}getCursor(e,t=0,i){let r=e.doc?e:Ye.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?Ia(this,r,t,i):Xa(this,r,t,i)}}class RL{constructor(e){this.spec=e}}function lF(n,e,t){return(i,r,s,l)=>{if(t&&!t(i,r,s,l))return!1;let o=i>=l&&r<=l+s.length?s.slice(i-l,r-l):e.doc.sliceString(i,r);return n(o,e,i,r)}}function Xa(n,e,t,i){let r;return n.wholeWord&&(r=oF(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(r=lF(n.test,e,r)),new Sc(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),r)}function oF(n,e){return(t,i,r,s)=>((s>t||s+r.length<i)&&(s=Math.max(0,t-2),r=n.sliceString(s,Math.min(n.length,i+2))),(e(ig(r,t-s))!=Qt.Word||e(rg(r,t-s))!=Qt.Word)&&(e(rg(r,i-s))!=Qt.Word||e(ig(r,i-s))!=Qt.Word))}class aF extends RL{constructor(e){super(e)}nextMatch(e,t,i){let r=Xa(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);r=Xa(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==i?null:r.value}prevMatchInRange(e,t,i){for(let r=i;;){let s=Math.max(t,r-1e4-this.spec.unquoted.length),l=Xa(this.spec,e,s,r),o=null;for(;!l.nextOverlapping().done;)o=l.value;if(o)return o;if(s==t)return null;r-=1e4}}prevMatch(e,t,i){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=i)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=Xa(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=Xa(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function cF(n,e,t){return(i,r,s)=>(!t||t(i,r,s))&&n(s[0],e,i,r)}function Ia(n,e,t,i){let r;return n.wholeWord&&(r=uF(e.charCategorizer(e.selection.main.head))),n.test&&(r=cF(n.test,e,r)),new QL(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:r},t,i)}function ig(n,e){return n.slice(nn(n,e,!1),e)}function rg(n,e){return n.slice(e,nn(n,e))}function uF(n){return(e,t,i)=>!i[0].length||(n(ig(i.input,i.index))!=Qt.Word||n(rg(i.input,i.index))!=Qt.Word)&&(n(rg(i.input,i.index+i[0].length))!=Qt.Word||n(ig(i.input,i.index+i[0].length))!=Qt.Word)}class hF extends RL{nextMatch(e,t,i){let r=Ia(this.spec,e,i,e.doc.length).next();return r.done&&(r=Ia(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let s=Math.max(t,i-r*1e4),l=Ia(this.spec,e,s,i),o=null;for(;!l.next().done;)o=l.value;if(o&&(s==t||o.from>s+10))return o;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+i.slice(r)}return t})}matchAll(e,t){let i=Ia(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=Ia(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const Wh=De.define(),Cx=De.define(),$l=bn.define({create(n){return new Rb(LS(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Wh)?n=new Rb(t.value.create(),n.panel):t.is(Cx)&&(n=new Rb(n.query,t.value?Ax:null));return n},provide:n=>Ih.from(n,e=>e.panel)});class Rb{constructor(e,t){this.query=e,this.panel=t}}const fF=we.mark({class:"cm-searchMatch"}),dF=we.mark({class:"cm-searchMatch cm-searchMatch-selected"}),pF=Lt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field($l))}update(n){let e=n.state.field($l);(e!=n.startState.field($l)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return we.none;let{view:t}=this,i=new $s;for(let r=0,s=t.visibleRanges,l=s.length;r<l;r++){let{from:o,to:c}=s[r];for(;r<l-1&&c>s[r+1].from-500;)c=s[++r].to;n.highlight(t.state,o,c,(h,d)=>{let p=t.state.selection.ranges.some(g=>g.from==h&&g.to==d);i.add(h,d,p?dF:fF)})}return i.finish()}},{decorations:n=>n.decorations});function vf(n){return e=>{let t=e.state.field($l,!1);return t&&t.query.spec.valid?n(e,t):NL(e)}}const sg=vf((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let r=Y.single(i.from,i.to),s=n.state.facet(Rc);return n.dispatch({selection:r,effects:[Mx(n,i),s.scrollToMatch(r.main,n)],userEvent:"select.search"}),DL(n),!0}),lg=vf((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let s=Y.single(r.from,r.to),l=n.state.facet(Rc);return n.dispatch({selection:s,effects:[Mx(n,r),l.scrollToMatch(s.main,n)],userEvent:"select.search"}),DL(n),!0}),mF=vf((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:Y.create(t.map(i=>Y.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),gF=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:r}=t.main,s=[],l=0;for(let o=new Sc(n.doc,n.sliceDoc(i,r));!o.next().done;){if(s.length>1e3)return!1;o.value.from==i&&(l=s.length),s.push(Y.range(o.value.from,o.value.to))}return e(n.update({selection:Y.create(s,l),userEvent:"select.search.matches"})),!0},KE=vf((n,{query:e})=>{let{state:t}=n,{from:i,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let l=s,o=[],c,h,d=[];l.precise?l.from==i&&l.to==r&&(h=t.toText(e.getReplacement(l)),o.push({from:l.from,to:l.to,insert:h}),d.push(fe.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):l=e.nextMatch(t,l.from,l.to);let p=n.state.changes(o);return l&&(c=Y.single(l.from,l.to).map(p),d.push(Mx(n,l)),d.push(t.facet(Rc).scrollToMatch(c.main,n))),n.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),OF=vf((n,{query:e})=>{if(n.state.readOnly)return!1;let t=[];for(let r of e.matchAll(n.state,1e9)){let{from:s,to:l,precise:o}=r;o&&t.push({from:s,to:l,insert:e.getReplacement(r)})}if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:fe.announce.of(i),userEvent:"input.replace.all"}),!0});function Ax(n){return n.state.facet(Rc).createPanel(n)}function LS(n,e){var t,i,r,s,l;let o=n.selection.main,c=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!c)return e;let h=n.facet(Rc);return new $L({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:h.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:h.wholeWord})}function PL(n){let e=dx(n,Ax);return e&&e.dom.querySelector("[main-field]")}function DL(n){let e=PL(n);e&&e==n.root.activeElement&&e.select()}const NL=n=>{let e=n.state.field($l,!1);if(e&&e.panel){let t=PL(n);if(t&&t!=n.root.activeElement){let i=LS(n.state,e.query.spec);i.valid&&n.dispatch({effects:Wh.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Cx.of(!0),e?Wh.of(LS(n.state,e.query.spec)):De.appendConfig.of(vF)]});return!0},zL=n=>{let e=n.state.field($l,!1);if(!e||!e.panel)return!1;let t=dx(n,Ax);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Cx.of(!1)}),!0},yF=[{key:"Mod-f",run:NL,scope:"editor search-panel"},{key:"F3",run:sg,shift:lg,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:sg,shift:lg,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:zL,scope:"editor search-panel"},{key:"Mod-Shift-l",run:gF},{key:"Mod-Alt-g",run:UG},{key:"Mod-d",run:sF,preventDefault:!0}];class bF{constructor(e){this.view=e;let t=this.query=e.state.field($l).query.spec;this.commit=this.commit.bind(this),this.searchField=ht("input",{value:t.search,placeholder:fi(e,"Find"),"aria-label":fi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=ht("input",{value:t.replace,placeholder:fi(e,"Replace"),"aria-label":fi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=ht("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=ht("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=ht("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(r,s,l){return ht("button",{class:"cm-button",name:r,onclick:s,type:"button"},l)}this.dom=ht("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>sg(e),[fi(e,"next")]),i("prev",()=>lg(e),[fi(e,"previous")]),i("select",()=>mF(e),[fi(e,"all")]),ht("label",null,[this.caseField,fi(e,"match case")]),ht("label",null,[this.reField,fi(e,"regexp")]),ht("label",null,[this.wordField,fi(e,"by word")]),...e.state.readOnly?[]:[ht("br"),this.replaceField,i("replace",()=>KE(e),[fi(e,"replace")]),i("replaceAll",()=>OF(e),[fi(e,"replace all")])],ht("button",{name:"close",onclick:()=>zL(e),"aria-label":fi(e,"close"),type:"button"},["×"])])}commit(){let e=new $L({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Wh.of(e)}))}keydown(e){S7(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?lg:sg)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),KE(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Wh)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Rc).top}}function fi(n,e){return n.state.phrase(e)}const vp=30,xp=/[\s\.,:;?!]/;function Mx(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),r=n.state.doc.lineAt(t).to,s=Math.max(i.from,e-vp),l=Math.min(r,t+vp),o=n.state.sliceDoc(s,l);if(s!=i.from){for(let c=0;c<vp;c++)if(!xp.test(o[c+1])&&xp.test(o[c])){o=o.slice(c);break}}if(l!=r){for(let c=o.length-1;c>o.length-vp;c--)if(!xp.test(o[c-1])&&xp.test(o[c])){o=o.slice(0,c);break}}return fe.announce.of(`${n.state.phrase("current match")}. ${o} ${n.state.phrase("on line")} ${i.number}.`)}const SF=fe.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),vF=[$l,_s.low(pF),SF];class Qx{constructor(e,t,i,r){this.state=e,this.pos=t,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=yt(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(_L(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function JE(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function xF(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;s<r.length;s++)t[r[s]]=!0}let i=JE(e)+JE(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function LL(n){let e=n.map(r=>typeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:xF(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function kF(n,e){return t=>{for(let i=yt(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class e${constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}}function Eo(n){return n.selection.main.from}function _L(n,e){var t;let{source:i}=n,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?n:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Ex=Xr.define();function wF(n,e,t,i){let{main:r}=n.selection,s=t-r.from,l=i-r.from;return{...n.changeByRange(o=>{if(o!=r&&t!=i&&n.sliceDoc(o.from+s,o.from+l)!=n.sliceDoc(t,i))return{range:o};let c=n.toText(e);return{changes:{from:o.from+s,to:i==r.from?o.to:o.from+l,insert:c},range:Y.cursor(o.from+s+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const t$=new WeakMap;function TF(n){if(!Array.isArray(n))return n;let e=t$.get(n);return e||t$.set(n,e=LL(n)),e}const og=De.define(),Gh=De.define();class CF{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let i=Wn(e,t),r=Mr(i);this.chars.push(i);let s=e.slice(t,t+r),l=s.toUpperCase();this.folded.push(Wn(l==s?s.toLowerCase():l,0)),t+=r}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:i,any:r,precise:s,byWord:l}=this;if(t.length==1){let C=Wn(e,0),A=Mr(C),P=A==e.length?0:-100;if(C!=t[0])if(C==i[0])P+=-200;else return null;return this.ret(P,[0,A])}let o=e.indexOf(this.pattern);if(o==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=t.length,h=0;if(o<0){for(let C=0,A=Math.min(e.length,200);C<A&&h<c;){let P=Wn(e,C);(P==t[h]||P==i[h])&&(r[h++]=C),C+=Mr(P)}if(h<c)return null}let d=0,p=0,g=!1,O=0,b=-1,v=-1,x=/[a-z]/.test(e),k=!0;for(let C=0,A=Math.min(e.length,200),P=0;C<A&&p<c;){let E=Wn(e,C);o<0&&(d<c&&E==t[d]&&(s[d++]=C),O<c&&(E==t[O]||E==i[O]?(O==0&&(b=C),v=C+1,O++):O=0));let D,$=E<255?E>=48&&E<=57||E>=97&&E<=122?2:E>=65&&E<=90?1:0:(D=Wv(E))!=D.toLowerCase()?1:D!=D.toUpperCase()?2:0;(!C||$==1&&x||P==0&&$!=0)&&(t[p]==E||i[p]==E&&(g=!0)?l[p++]=C:l.length&&(k=!1)),P=$,C+=Mr(E)}return p==c&&l[0]==0&&k?this.result(-100+(g?-200:0),l,e):O==c&&b==0?this.ret(-200-e.length+(v==e.length?0:-100),[0,v]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):O==c?this.ret(-900-e.length,[b,v]):p==c?this.result(-100+(g?-200:0)+-700+(k?0:-1100),l,e):t.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let l of t){let o=l+(this.astral?Mr(Wn(i,l)):1);s&&r[s-1]==l?r[s-1]=o:(r[s++]=l,r[s++]=o)}return this.ret(e-i.length,r)}}class AF{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),i=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,t.length],this.score=i+(e.length==this.pattern.length?0:-100),this)}}const tn=me.define({combine(n){return Ir(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:MF,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>n$(e(i),t(i)),optionClass:(e,t)=>i=>n$(e(i),t(i)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function n$(n,e){return n?e?n+" "+e:n:e}function MF(n,e,t,i,r,s){let l=n.textDirection==gt.RTL,o=l,c=!1,h="top",d,p,g=e.left-r.left,O=r.right-e.right,b=i.right-i.left,v=i.bottom-i.top;if(o&&g<Math.min(b,O)?o=!1:!o&&O<Math.min(b,g)&&(o=!0),b<=(o?g:O))d=Math.max(r.top,Math.min(t.top,r.bottom-v))-e.top,p=Math.min(400,o?g:O);else{c=!0,p=Math.min(400,(l?e.right:r.right-e.left)-30);let C=r.bottom-e.bottom;C>=v||C>e.top?d=t.bottom-e.top:(h="bottom",d=e.bottom-t.top)}let x=(e.bottom-e.top)/s.offsetHeight,k=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${d/x}px; max-width: ${p/k}px`,class:"cm-completionInfo-"+(c?l?"left-narrow":"right-narrow":o?"left":"right")}}const $x=De.define();function QF(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,r,s){let l=document.createElement("span");l.className="cm-completionLabel";let o=t.displayLabel||t.label,c=0;for(let h=0;h<s.length;){let d=s[h++],p=s[h++];d>c&&l.appendChild(document.createTextNode(o.slice(c,d)));let g=l.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(o.slice(d,p))),g.className="cm-completionMatchedText",c=p}return c<o.length&&l.appendChild(document.createTextNode(o.slice(c))),l},position:50},{render(t){if(!t.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=t.detail,i},position:80}),e.sort((t,i)=>t.position-i.position).map(t=>t.render)}function Pb(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.ceil((n-e)/t);return{from:n-i*t,to:n-(i-1)*t}}class EF{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:l}=r.open,o=e.state.facet(tn);this.optionContent=QF(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=Pb(s.length,l,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:h}=e.state.field(t).open;for(let d=c.target,p;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(p=/-(\d+)$/.exec(d.id))&&+p[1]<h.length){this.applyCompletion(e,h[+p[1]]),c.preventDefault();return}if(c.target==this.list){let d=this.list.classList.contains("cm-completionListIncompleteTop")&&c.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&c.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;d!=null&&(e.dispatch({effects:$x.of(d)}),c.preventDefault())}}),this.dom.addEventListener("focusout",c=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(tn).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:Gh.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:l,disabled:o}=i.open;(!r.open||r.open.options!=s)&&(this.range=Pb(s.length,l,e.state.facet(tn).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=Pb(t.options.length,t.selected,this.view.state.facet(tn).maxRenderedOptions),this.showOptions(t.options,e.id));let i=this.updateSelectedOption(t.selected);if(i){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:s}=r;if(!s)return;let l=typeof s=="string"?document.createTextNode(s):s(r);if(!l)return;"then"in l?l.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,r)}).catch(o=>Kn(this.view.state,o,"completion info")):(this.addInfoPane(l,r),i.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",i.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&(i.removeAttribute("aria-selected"),i.removeAttribute("aria-describedby"));return t&&RF(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let l=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:l.clientWidth,bottom:l.clientHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(tn).positionInfo(this.view,t,r,i,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,i){const r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions")),r.addEventListener("mousedown",l=>{l.target==r&&l.preventDefault()});let s=null;for(let l=i.from;l<i.to;l++){let{completion:o,match:c}=e[l],{section:h}=o;if(h){let g=typeof h=="string"?h:h.name;if(g!=s&&(l>i.from||i.from==0))if(s=g,typeof h!="string"&&h.header)r.appendChild(h.header(h));else{let O=r.appendChild(document.createElement("completion-section"));O.textContent=g}}const d=r.appendChild(document.createElement("li"));d.id=t+"-"+l,d.setAttribute("role","option");let p=this.optionClass(o);p&&(d.className=p);for(let g of this.optionContent){let O=g(o,this.view.state,this.view,c);O&&d.appendChild(O)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function $F(n,e){return t=>new EF(t,n,e)}function RF(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.top<t.top?n.scrollTop-=(t.top-i.top)/r:i.bottom>t.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function i$(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function PF(n,e){let t=[],i=null,r=null,s=d=>{t.push(d);let{section:p}=d.completion;if(p){i||(i=[]);let g=typeof p=="string"?p:p.name;i.some(O=>O.name==g)||i.push(typeof p=="string"?{name:g}:p)}},l=e.facet(tn);for(let d of n)if(d.hasResult()){let p=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)s(new e$(g,d.source,p?p(g):[],1e9-t.length));else{let g=e.sliceDoc(d.from,d.to),O,b=l.filterStrict?new AF(g):new CF(g);for(let v of d.result.options)if(O=b.match(v.label)){let x=v.displayLabel?p?p(v,O.matched):[]:O.matched,k=O.score+(v.boost||0);if(s(new e$(v,d.source,x,k)),typeof v.section=="object"&&v.section.rank==="dynamic"){let{name:C}=v.section;r||(r=Object.create(null)),r[C]=Math.max(k,r[C]||-1e9)}}}}if(i){let d=Object.create(null),p=0,g=(O,b)=>(O.rank==="dynamic"&&b.rank==="dynamic"?r[b.name]-r[O.name]:0)||(typeof O.rank=="number"?O.rank:1e9)-(typeof b.rank=="number"?b.rank:1e9)||(O.name<b.name?-1:1);for(let O of i.sort(g))p-=1e5,d[O.name]=p;for(let O of t){let{section:b}=O.completion;b&&(O.score+=d[typeof b=="string"?b:b.name])}}let o=[],c=null,h=l.compareCompletions;for(let d of t.sort((p,g)=>g.score-p.score||h(p.completion,g.completion))){let p=d.completion;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?o.push(d):i$(d.completion)>i$(c)&&(o[o.length-1]=d),c=d.completion}return o}class Ha{constructor(e,t,i,r,s,l){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Ha(this.options,r$(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s,l){if(r&&!l&&e.some(h=>h.isPending))return r.setDisabled();let o=PF(e,t);if(!o.length)return r&&e.some(h=>h.isPending)?r.setDisabled():null;let c=t.facet(tn).selectOnOpen?0:-1;if(r&&r.selected!=c&&r.selected!=-1){let h=r.options[r.selected].completion;for(let d=0;d<o.length;d++)if(o[d].completion==h){c=d;break}}return new Ha(o,r$(i,c),{pos:e.reduce((h,d)=>d.hasResult()?Math.min(h,d.from):h,1e8),create:BF,above:s.aboveCursor},r?r.timestamp:Date.now(),c,!1)}map(e){return new Ha(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ha(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class ag{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new ag(LF,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(tn),s=(i.override||t.languageDataAt("autocomplete",Eo(t)).map(TF)).map(c=>(this.active.find(d=>d.source==c)||new Ii(c,this.active.some(d=>d.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((c,h)=>c==this.active[h])&&(s=this.active);let l=this.open,o=e.effects.some(c=>c.is(Rx));l&&e.docChanged&&(l=l.map(e.changes)),e.selection||s.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!DF(s,this.active)||o?l=Ha.build(s,t,this.id,l,i,o):l&&l.disabled&&!s.some(c=>c.isPending)&&(l=null),!l&&s.every(c=>!c.isPending)&&s.some(c=>c.hasResult())&&(s=s.map(c=>c.hasResult()?new Ii(c.source,0):c));for(let c of e.effects)c.is($x)&&(l=l&&l.setSelected(c.value,this.id));return s==this.active&&l==this.open?this:new ag(s,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?NF:zF}}function DF(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;i<e.length&&!e[i].hasResult();)i++;let r=t==n.length,s=i==e.length;if(r||s)return r==s;if(n[t++].result!=e[i++].result)return!1}}const NF={"aria-autocomplete":"list"},zF={};function r$(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const LF=[];function BL(n,e){if(n.isUserEvent("input.complete")){let i=n.annotation(Ex);if(i&&e.activateOnCompletion(i))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ii{constructor(e,t,i=!1){this.source=e,this.state=t,this.explicit=i}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let i=BL(e,t),r=this;(i&8||i&16&&this.touches(e))&&(r=new Ii(r.source,0)),i&4&&r.state==0&&(r=new Ii(this.source,1)),r=r.updateFor(e,i);for(let s of e.effects)if(s.is(og))r=new Ii(r.source,1,s.value);else if(s.is(Gh))r=new Ii(r.source,0);else if(s.is(Rx))for(let l of s.value)l.source==r.source&&(r=l);return r}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Eo(e.state))}}class nc extends Ii{constructor(e,t,i,r,s,l){super(e,3,t),this.limit=i,this.result=r,this.from=s,this.to=l}hasResult(){return!0}updateFor(e,t){var i;if(!(t&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),o=Eo(e.state);if(o>l||!r||t&2&&(Eo(e.startState)==this.from||o<this.limit))return new Ii(this.source,t&4?1:0);let c=e.changes.mapPos(this.limit);return _F(r.validFor,e.state,s,l)?new nc(this.source,this.explicit,c,r,s,l):r.update&&(r=r.update(r,s,l,new Qx(e.state,o,!1)))?new nc(this.source,this.explicit,c,r,r.from,(i=r.to)!==null&&i!==void 0?i:Eo(e.state)):new Ii(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new nc(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ii(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function _F(n,e,t,i){if(!n)return!1;let r=e.sliceDoc(t,i);return typeof n=="function"?n(r,t,i,e):_L(n,!0).test(r)}const Rx=De.define({map(n,e){return n.map(t=>t.map(e))}}),Gn=bn.define({create(){return ag.start()},update(n,e){return n.update(e)},provide:n=>[fx.from(n,e=>e.tooltip),fe.contentAttributes.from(n,e=>e.attrs)]});function Px(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Gn).active.find(r=>r.source==e.source);return i instanceof nc?(typeof t=="string"?n.dispatch({...wF(n.state,t,i.from,i.to),annotations:Ex.of(e.completion)}):t(n,e.completion,i.from,i.to),!0):!1}const BF=$F(Gn,Px);function kp(n,e="option"){return t=>{let i=t.state.field(Gn,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<t.state.facet(tn).interactionDelay)return!1;let r=1,s;e=="page"&&(s=Oz(t,i.open.tooltip))&&(r=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:l}=i.open.options,o=i.open.selected>-1?i.open.selected+r*(n?1:-1):n?0:l-1;return o<0?o=e=="page"?0:l-1:o>=l&&(o=e=="page"?l-1:0),t.dispatch({effects:$x.of(o)}),!0}}const ZF=n=>{let e=n.state.field(Gn,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(tn).interactionDelay?!1:Px(n,e.open.options[e.open.selected])},Db=n=>n.state.field(Gn,!1)?(n.dispatch({effects:og.of(!0)}),!0):!1,jF=n=>{let e=n.state.field(Gn,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Gh.of(null)}),!0)};class XF{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const IF=50,VF=1e3,qF=Lt.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Gn).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Gn),t=n.state.facet(tn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Gn)==e)return;let i=n.transactions.some(s=>{let l=BL(s,t);return l&8||(s.selection||s.docChanged)&&!(l&3)});for(let s=0;s<this.running.length;s++){let l=this.running[s];if(i||l.context.abortOnDocChange&&n.docChanged||l.updates.length+n.transactions.length>IF&&Date.now()-l.time>VF){for(let o of l.context.abortListeners)try{o()}catch(c){Kn(this.view.state,c)}l.context.abortListeners=null,this.running.splice(s--,1)}else l.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(l=>l.is(og)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(l=>l.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Gn);for(let t of e.active)t.isPending&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(tn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Eo(e),i=new Qx(e,t,n.explicit,this.view),r=new XF(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Gh.of(null)}),Kn(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(tn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(tn),i=this.view.state.field(Gn);for(let r=0;r<this.running.length;r++){let s=this.running[r];if(s.done===void 0)continue;if(this.running.splice(r--,1),s.done){let o=Eo(s.updates.length?s.updates[0].startState:this.view.state),c=Math.min(o,s.done.from+(s.active.explicit?0:1)),h=new nc(s.active.source,s.active.explicit,c,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:o);for(let d of s.updates)h=h.update(d,t);if(h.hasResult()){e.push(h);continue}}let l=i.active.find(o=>o.source==s.active.source);if(l&&l.isPending)if(s.done==null){let o=new Ii(s.active.source,0);for(let c of s.updates)o=o.update(c,t);o.isPending||e.push(o)}else this.startQuery(l)}(e.length||i.open&&i.open.disabled)&&this.view.dispatch({effects:Rx.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Gn,!1);if(e&&e.tooltip&&this.view.state.facet(tn).closeOnBlur){let t=e.open&&Oz(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Gh.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:og.of(!1)}),20),this.composing=0}}}),HF=typeof navigator=="object"&&/Win/.test(navigator.platform),YF=_s.highest(fe.domEventHandlers({keydown(n,e){let t=e.state.field(Gn,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(HF&&n.altKey)||n.metaKey)return!1;let i=t.open.options[t.open.selected],r=t.active.find(l=>l.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&Px(e,i),!1}})),ZL=fe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class UF{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}}class Dx{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,gn.TrackDel),i=e.mapPos(this.to,1,gn.TrackDel);return t==null||i==null?null:new Dx(this.field,t,i)}}class Nx{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let c of this.lines){if(i.length){let h=l,d=/^\t*/.exec(c)[0].length;for(let p=0;p<d;p++)h+=e.facet(Qc);r.push(t+h.length-d),c=h+c.slice(d)}i.push(c),t+=c.length+1}let o=this.fieldPositions.map(c=>new Dx(c.field,r[c.line]+c.from,r[c.line]+c.to));return{text:i,ranges:o}}static parse(e){let t=[],i=[],r=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let o=s[1]?+s[1]:null,c=s[2]||s[3]||"",h=-1,d=c.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<t.length;p++)(o!=null?t[p].seq==o:d&&t[p].name==d)&&(h=p);if(h<0){let p=0;for(;p<t.length&&(o==null||t[p].seq!=null&&t[p].seq<o);)p++;t.splice(p,0,{seq:o,name:d}),h=p;for(let g of r)g.field>=h&&g.field++}for(let p of r)if(p.line==i.length&&p.from>s.index){let g=s[2]?3+(s[1]||"").length:2;p.from-=g,p.to-=g}r.push(new UF(h,i.length,s.index,s.index+d.length)),l=l.slice(0,s.index)+c+l.slice(s.index+s[0].length)}l=l.replace(/\\([{}])/g,(o,c,h)=>{for(let d of r)d.line==i.length&&d.from>h&&(d.from--,d.to--);return c}),i.push(l)}return new Nx(i,r)}}let WF=we.widget({widget:new class extends ur{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),GF=we.mark({class:"cm-snippetField"});class Pc{constructor(e,t){this.ranges=e,this.active=t,this.deco=we.set(e.map(i=>(i.from==i.to?WF:GF).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new Pc(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const xf=De.define({map(n,e){return n&&n.map(e)}}),FF=De.define(),Fh=bn.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(xf))return t.value;if(t.is(FF)&&n)return new Pc(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>fe.decorations.from(n,e=>e?e.deco:we.none)});function zx(n,e){return Y.create(n.filter(t=>t.field==e).map(t=>Y.range(t.from,t.to)))}function KF(n){let e=Nx.parse(n);return(t,i,r,s)=>{let{text:l,ranges:o}=e.instantiate(t.state,r),{main:c}=t.state.selection,h={changes:{from:r,to:s==c.from?c.to:s,insert:Ge.of(l)},scrollIntoView:!0,annotations:i?[Ex.of(i),Yt.userEvent.of("input.complete")]:void 0};if(o.length&&(h.selection=zx(o,0)),o.some(d=>d.field>0)){let d=new Pc(o,0),p=h.effects=[xf.of(d)];t.state.field(Fh,!1)===void 0&&p.push(De.appendConfig.of([Fh,iK,rK,ZL]))}t.dispatch(t.state.update(h))}}function jL(n){return({state:e,dispatch:t})=>{let i=e.field(Fh,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(l=>l.field==r+n);return t(e.update({selection:zx(i.ranges,r),effects:xf.of(s?null:new Pc(i.ranges,r)),scrollIntoView:!0})),!0}}const JF=({state:n,dispatch:e})=>n.field(Fh,!1)?(e(n.update({effects:xf.of(null)})),!0):!1,eK=jL(1),tK=jL(-1),nK=[{key:"Tab",run:eK,shift:tK},{key:"Escape",run:JF}],s$=me.define({combine(n){return n.length?n[0]:nK}}),iK=_s.highest(Ac.compute([s$],n=>n.facet(s$)));function Hn(n,e){return{...e,apply:KF(n)}}const rK=fe.domEventHandlers({mousedown(n,e){let t=e.state.field(Fh,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:zx(t.ranges,r.field),effects:xf.of(t.ranges.some(s=>s.field>r.field)?new Pc(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),Kh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ko=De.define({map(n,e){let t=e.mapPos(n,-1,gn.TrackAfter);return t??void 0}}),Lx=new class extends Dl{};Lx.startSide=1;Lx.endSide=-1;const XL=bn.define({create(){return Ve.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}for(let t of e.effects)t.is(ko)&&(n=n.update({add:[Lx.range(t.value,t.value+1)]}));return n}});function sK(){return[oK,XL]}const Nb="()[]{}<>«»»«[]{}";function IL(n){for(let e=0;e<Nb.length;e+=2)if(Nb.charCodeAt(e)==n)return Nb.charAt(e+1);return Wv(n<128?n:n+1)}function VL(n,e){return n.languageDataAt("closeBrackets",e)[0]||Kh}const lK=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),oK=fe.inputHandler.of((n,e,t,i)=>{if((lK?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let r=n.state.selection.main;if(i.length>2||i.length==2&&Mr(Wn(i,0))==1||e!=r.from||t!=r.to)return!1;let s=uK(n.state,i);return s?(n.dispatch(s),!0):!1}),aK=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=VL(n,n.selection.main.head).brackets||Kh.brackets,r=null,s=n.changeByRange(l=>{if(l.empty){let o=hK(n.doc,l.head);for(let c of i)if(c==o&&tO(n.doc,l.head)==IL(Wn(c,0)))return{changes:{from:l.head-c.length,to:l.head+c.length},range:Y.cursor(l.head-c.length)}}return{range:r=l}});return r||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},cK=[{key:"Backspace",run:aK}];function uK(n,e){let t=VL(n,n.selection.main.head),i=t.brackets||Kh.brackets;for(let r of i){let s=IL(Wn(r,0));if(e==r)return s==r?pK(n,r,i.indexOf(r+r+r)>-1,t):fK(n,r,s,t.before||Kh.before);if(e==s&&qL(n,n.selection.main.from))return dK(n,r,s)}return null}function qL(n,e){let t=!1;return n.field(XL).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function tO(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Mr(Wn(t,0)))}function hK(n,e){let t=n.sliceString(e-2,e);return Mr(Wn(t,0))==t.length?t:t.slice(1)}function fK(n,e,t,i){let r=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:ko.of(l.to+e.length),range:Y.range(l.anchor+e.length,l.head+e.length)};let o=tO(n.doc,l.head);return!o||/\s/.test(o)||i.indexOf(o)>-1?{changes:{insert:e+t,from:l.head},effects:ko.of(l.head+e.length),range:Y.cursor(l.head+e.length)}:{range:r=l}});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function dK(n,e,t){let i=null,r=n.changeByRange(s=>s.empty&&tO(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:Y.cursor(s.head+t.length)}:i={range:s});return i?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function pK(n,e,t,i){let r=i.stringPrefixes||Kh.stringPrefixes,s=null,l=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:ko.of(o.to+e.length),range:Y.range(o.anchor+e.length,o.head+e.length)};let c=o.head,h=tO(n.doc,c),d;if(h==e){if(l$(n,c))return{changes:{insert:e+e,from:c},effects:ko.of(c+e.length),range:Y.cursor(c+e.length)};if(qL(n,c)){let g=t&&n.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:Y.cursor(c+g.length)}}}else{if(t&&n.sliceDoc(c-2*e.length,c)==e+e&&(d=o$(n,c-2*e.length,r))>-1&&l$(n,d))return{changes:{insert:e+e+e+e,from:c},effects:ko.of(c+e.length),range:Y.cursor(c+e.length)};if(n.charCategorizer(c)(h)!=Qt.Word&&o$(n,c,r)>-1&&!mK(n,c,e,r))return{changes:{insert:e+e,from:c},effects:ko.of(c+e.length),range:Y.cursor(c+e.length)}}return{range:s=o}});return s?null:n.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function l$(n,e){let t=yt(n).resolveInner(e+1);return t.parent&&t.from==e}function mK(n,e,t,i){let r=yt(n).resolveInner(e,-1),s=i.reduce((l,o)=>Math.max(l,o.length),0);for(let l=0;l<5;l++){let o=n.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),c=o.indexOf(t);if(!c||c>-1&&i.indexOf(o.slice(0,c))>-1){let d=r.firstChild;for(;d&&d.from==r.from&&d.to-d.from>t.length+c;){if(n.sliceDoc(d.to-t.length,d.to)==t)return!1;d=d.firstChild}return!0}let h=r.to==e&&r.parent;if(!h)break;r=h}return!1}function o$(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Qt.Word)return e;for(let r of t){let s=e-r.length;if(n.sliceDoc(s,e)==r&&i(n.sliceDoc(s-1,s))!=Qt.Word)return s}return-1}function gK(n={}){return[YF,Gn,tn.of(n),qF,OK,ZL]}const HL=[{key:"Ctrl-Space",run:Db},{mac:"Alt-`",run:Db},{mac:"Alt-i",run:Db},{key:"Escape",run:jF},{key:"ArrowDown",run:kp(!0)},{key:"ArrowUp",run:kp(!1)},{key:"PageDown",run:kp(!0,"page")},{key:"PageUp",run:kp(!1,"page")},{key:"Enter",run:ZF}],OK=_s.highest(Ac.computeN([tn],n=>n.facet(tn).defaultKeymap?[HL]:[]));class a${constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class mo{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=i.facet(Jh).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((O,b)=>O.from-b.from||O.to-b.to),l=new $s,o=[],c=0,h=i.doc.iter(),d=0,p=i.doc.length;for(let O=0;;){let b=O==s.length?null:s[O];if(!b&&!o.length)break;let v,x;if(o.length)v=c,x=o.reduce((A,P)=>Math.min(A,P.to),b&&b.from>v?b.from:1e8);else{if(v=b.from,v>p)break;x=b.to,o.push(b),O++}for(;O<s.length;){let A=s[O];if(A.from==v&&(A.to>A.from||A.to==v))o.push(A),O++,x=Math.min(A.to,x);else{x=Math.min(A.from,x);break}}x=Math.min(x,p);let k=!1;if(o.some(A=>A.from==v&&(A.to==x||x==p))&&(k=v==x,!k&&x-v<10)){let A=v-(d+h.value.length);A>0&&(h.next(A),d=v);for(let P=v;;){if(P>=x){k=!0;break}if(!h.lineBreak&&d+h.value.length>P)break;P=d+h.value.length,d+=h.value.length,h.next()}}let C=EK(o);if(k)l.add(v,v,we.widget({widget:new CK(C),diagnostics:o.slice()}));else{let A=o.reduce((P,E)=>E.markClass?P+" "+E.markClass:P,"");l.add(v,x,we.mark({class:"cm-lintRange cm-lintRange-"+C+A,diagnostics:o.slice(),inclusiveEnd:o.some(P=>P.to>x)}))}if(c=x,c==p)break;for(let A=0;A<o.length;A++)o[A].to<=c&&o.splice(A--,1)}let g=l.finish();return new mo(g,t,Bl(g))}}function Bl(n,e=null,t=0){let i=null;return n.between(t,1e9,(r,s,{spec:l})=>{if(!(e&&l.diagnostics.indexOf(e)<0))if(!i)i=new a$(r,s,e||l.diagnostics[0]);else{if(l.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new a$(i.from,s,i.diagnostic)}}),i}function yK(n,e){let t=e.pos,i=e.end||t,r=n.state.facet(Jh).hideOn(n,t,i);if(r!=null)return r;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(l=>l.is(YL))||n.changes.touchesRange(s.from,Math.max(s.to,i)))}function bK(n,e){return n.field(Si,!1)?e:e.concat(De.appendConfig.of($K))}const YL=De.define(),_x=De.define(),UL=De.define(),Si=bn.define({create(){return new mo(we.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),i=null,r=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);i=Bl(t,n.selected.diagnostic,s)||Bl(t,null,s)}!t.size&&r&&e.state.facet(Jh).autoPanel&&(r=null),n=new mo(t,r,i)}for(let t of e.effects)if(t.is(YL)){let i=e.state.facet(Jh).autoPanel?t.value.length?ef.open:null:n.panel;n=mo.init(t.value,i,e.state)}else t.is(_x)?n=new mo(n.diagnostics,t.value?ef.open:null,n.selected):t.is(UL)&&(n=new mo(n.diagnostics,n.panel,t.value));return n},provide:n=>[Ih.from(n,e=>e.panel),fe.decorations.from(n,e=>e.diagnostics)]}),SK=we.mark({class:"cm-lintRange cm-lintRange-active"});function vK(n,e,t){let{diagnostics:i}=n.state.field(Si),r,s=-1,l=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(c,h,{spec:d})=>{if(e>=c&&e<=h&&(c==h||(e>c||t>0)&&(e<h||t<0)))return r=d.diagnostics,s=c,l=h,!1});let o=n.state.facet(Jh).tooltipFilter;return r&&o&&(r=o(r,n.state)),r?{pos:s,end:l,above:n.state.doc.lineAt(s).to<l,create(){return{dom:xK(n,r)}}}:null}function xK(n,e){return ht("ul",{class:"cm-tooltip-lint"},e.map(t=>GL(n,t,!1)))}const kK=n=>{let e=n.state.field(Si,!1);(!e||!e.panel)&&n.dispatch({effects:bK(n.state,[_x.of(!0)])});let t=dx(n,ef.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},c$=n=>{let e=n.state.field(Si,!1);return!e||!e.panel?!1:(n.dispatch({effects:_x.of(!1)}),!0)},wK=n=>{let e=n.state.field(Si,!1);if(!e)return!1;let t=n.state.selection.main,i=Bl(e.diagnostics,null,t.to+1);return!i&&(i=Bl(e.diagnostics,null,0),!i||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),c8(n,i.from,1,{tooltip:FL,until:r=>r.docChanged||r.newSelection.main.head<i.from||r.newSelection.main.head>i.to}),!0)},TK=[{key:"Mod-Shift-m",run:kK,preventDefault:!0},{key:"F8",run:wK}],Jh=me.define({combine(n){return{sources:n.map(e=>e.source).filter(e=>e!=null),...Ir(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:u$,tooltipFilter:u$,needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t,hideOn:(e,t)=>e?t?(i,r,s)=>e(i,r,s)||t(i,r,s):e:t,autoPanel:(e,t)=>e||t})}}});function u$(n,e){return n?e?(t,i)=>e(n(t,i),i):n:e}function WL(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;i<t.length;i++){let r=t[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function GL(n,e,t){var i;let r=t?WL(e.actions):[];return ht("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},ht("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,l)=>{let o=!1,c=O=>{if(O.preventDefault(),o)return;o=!0;let b=Bl(n.state.field(Si).diagnostics,e);b&&s.apply(n,b.from,b.to)},{name:h}=s,d=r[l]?h.indexOf(r[l]):-1,p=d<0?h:[h.slice(0,d),ht("u",h.slice(d,d+1)),h.slice(d+1)],g=s.markClass?" "+s.markClass:"";return ht("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${h}${d<0?"":` (access key "${r[l]})"`}.`},p)}),e.source&&ht("div",{class:"cm-diagnosticSource"},e.source))}class CK extends ur{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return ht("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class h${constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=GL(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ef{constructor(e){this.view=e,this.items=[];let t=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)c$(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],l=WL(s.actions);for(let o=0;o<l.length;o++)if(l[o].toUpperCase().charCodeAt(0)==r.keyCode){let c=Bl(this.view.state.field(Si).diagnostics,s);c&&s.actions[o].apply(e,c.from,c.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=ht("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:i}),this.dom=ht("div",{class:"cm-panel-lint"},this.list,ht("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>c$(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Si).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Si),i=0,r=!1,s=null,l=new Set;for(e.between(0,this.view.state.doc.length,(o,c,{spec:h})=>{for(let d of h.diagnostics){if(l.has(d))continue;l.add(d);let p=-1,g;for(let O=i;O<this.items.length;O++)if(this.items[O].diagnostic==d){p=O;break}p<0?(g=new h$(this.view,d),this.items.splice(i,0,g),r=!0):(g=this.items[p],p>i&&(this.items.splice(i,p-i),r=!0)),t&&g.diagnostic==t.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),s=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new h$(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:c})=>{let h=c.height/this.list.offsetHeight;o.top<c.top?this.list.scrollTop-=(c.top-o.top)/h:o.bottom>c.bottom&&(this.list.scrollTop+=(o.bottom-c.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Si),i=Bl(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:UL.of(i)})}static open(e){return new ef(e)}}function AK(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function wp(n){return AK(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const MK=fe.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:wp("#f11")},".cm-lintRange-warning":{backgroundImage:wp("orange")},".cm-lintRange-info":{backgroundImage:wp("#999")},".cm-lintRange-hint":{backgroundImage:wp("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function QK(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function EK(n){let e="hint",t=1;for(let i of n){let r=QK(i.severity);r>t&&(t=r,e=i.severity)}return e}const FL=a8(vK,{hideOn:yK}),$K=[Si,fe.decorations.compute([Si],n=>{let{selected:e,panel:t}=n.field(Si);return!e||!t||e.from==e.to?we.none:we.set([SK.range(e.from,e.to)])}),FL,MK];var f$=function(e){e===void 0&&(e={});var{crosshairCursor:t=!1}=e,i=[];e.closeBracketsKeymap!==!1&&(i=i.concat(cK)),e.defaultKeymap!==!1&&(i=i.concat(qG)),e.searchKeymap!==!1&&(i=i.concat(yF)),e.historyKeymap!==!1&&(i=i.concat(K9)),e.foldKeymap!==!1&&(i=i.concat(d9)),e.completionKeymap!==!1&&(i=i.concat(HL)),e.lintKeymap!==!1&&(i=i.concat(TK));var r=[];return e.lineNumbers!==!1&&r.push(x8()),e.highlightActiveLineGutter!==!1&&r.push(T8()),e.highlightSpecialChars!==!1&&r.push(L7()),e.history!==!1&&r.push(I9()),e.foldGutter!==!1&&r.push(O9()),e.drawSelection!==!1&&r.push(C7()),e.dropCursor!==!1&&r.push($7()),e.allowMultipleSelections!==!1&&r.push(Ye.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&r.push(s9()),e.syntaxHighlighting!==!1&&r.push(Vz(v9,{fallback:!0})),e.bracketMatching!==!1&&r.push(M9()),e.closeBrackets!==!1&&r.push(sK()),e.autocompletion!==!1&&r.push(gK()),e.rectangularSelection!==!1&&r.push(F7()),t!==!1&&r.push(e8()),e.highlightActiveLine!==!1&&r.push(I7()),e.highlightSelectionMatches!==!1&&r.push(FG()),e.tabSize&&typeof e.tabSize=="number"&&r.push(Qc.of(" ".repeat(e.tabSize))),r.concat([Ac.of(i.flat())]).filter(Boolean)};const RK="#e5c07b",d$="#e06c75",PK="#56b6c2",DK="#ffffff",Ip="#abb2bf",_S="#7d8799",NK="#61afef",zK="#98c379",p$="#d19a66",LK="#c678dd",_K="#21252b",m$="#2c313a",g$="#282c34",zb="#353a42",BK="#3E4451",O$="#528bff",ZK=fe.theme({"&":{color:Ip,backgroundColor:g$},".cm-content":{caretColor:O$},".cm-cursor, .cm-dropCursor":{borderLeftColor:O$},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:BK},".cm-panels":{backgroundColor:_K,color:Ip},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:g$,color:_S,border:"none"},".cm-activeLineGutter":{backgroundColor:m$},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:zb},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:zb,borderBottomColor:zb},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:m$,color:Ip}}},{dark:!0}),jK=bf.define([{tag:M.keyword,color:LK},{tag:[M.name,M.deleted,M.character,M.propertyName,M.macroName],color:d$},{tag:[M.function(M.variableName),M.labelName],color:NK},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:p$},{tag:[M.definition(M.name),M.separator],color:Ip},{tag:[M.typeName,M.className,M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:RK},{tag:[M.operator,M.operatorKeyword,M.url,M.escape,M.regexp,M.link,M.special(M.string)],color:PK},{tag:[M.meta,M.comment],color:_S},{tag:M.strong,fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.link,color:_S,textDecoration:"underline"},{tag:M.heading,fontWeight:"bold",color:d$},{tag:[M.atom,M.bool,M.special(M.variableName)],color:p$},{tag:[M.processingInstruction,M.string,M.inserted],color:zK},{tag:M.invalid,color:DK}]),XK=[ZK,Vz(jK)];var IK=fe.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),VK=function(e){e===void 0&&(e={});var{indentWithTab:t=!0,editable:i=!0,readOnly:r=!1,theme:s="light",placeholder:l="",basicSetup:o=!0}=e,c=[];switch(t&&c.unshift(Ac.of([HG])),o&&(typeof o=="boolean"?c.unshift(f$()):c.unshift(f$(o))),l&&c.unshift(Y7(l)),s){case"light":c.push(IK);break;case"dark":c.push(XK);break;case"none":break;default:c.push(s);break}return i===!1&&c.push(fe.editable.of(!1)),r&&c.push(Ye.readOnly.of(!0)),[...c]},qK=n=>({line:n.state.doc.lineAt(n.state.selection.main.from),lineCount:n.state.doc.lines,lineBreak:n.state.lineBreak,length:n.state.doc.length,readOnly:n.state.readOnly,tabSize:n.state.tabSize,selection:n.state.selection,selectionAsSingle:n.state.selection.asSingle().main,ranges:n.state.selection.ranges,selectionCode:n.state.sliceDoc(n.state.selection.main.from,n.state.selection.main.to),selections:n.state.selection.ranges.map(e=>n.state.sliceDoc(e.from,e.to)),selectedText:n.state.selection.ranges.some(e=>!e.empty)});class HK{constructor(e,t){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=t,this.timeoutMS=t,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(t=>{try{t()}catch(i){console.error("TimeoutLatch callback error:",i)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class y${constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Lb=null,YK=()=>typeof window>"u"?new y$:(Lb||(Lb=new y$),Lb),b$=Xr.define(),UK=200,WK=[];function GK(n){var{value:e,selection:t,onChange:i,onStatistics:r,onCreateEditor:s,onUpdate:l,extensions:o=WK,autoFocus:c,theme:h="light",height:d=null,minHeight:p=null,maxHeight:g=null,width:O=null,minWidth:b=null,maxWidth:v=null,placeholder:x="",editable:k=!0,readOnly:C=!1,indentWithTab:A=!0,basicSetup:P=!0,root:E,initialState:D}=n,[$,H]=Ee.useState(),[W,te]=Ee.useState(),[ae,re]=Ee.useState(),ce=Ee.useState(()=>({current:null}))[0],se=Ee.useState(()=>({current:null}))[0],z=fe.theme({"&":{height:d,minHeight:p,maxHeight:g,width:O,minWidth:b,maxWidth:v},"& .cm-scroller":{height:"100% !important"}}),B=fe.updateListener.of(ge=>{if(ge.docChanged&&typeof i=="function"&&!ge.transactions.some(Z=>Z.annotation(b$))){ce.current?ce.current.reset():(ce.current=new HK(()=>{if(se.current){var Z=se.current;se.current=null,Z()}ce.current=null},UK),YK().add(ce.current));var J=ge.state.doc,Q=J.toString();i(Q,ge)}r&&r(qK(ge))}),K=VK({theme:h,editable:k,readOnly:C,placeholder:x,indentWithTab:A,basicSetup:P}),he=[B,z,...K];return l&&typeof l=="function"&&he.push(fe.updateListener.of(l)),he=he.concat(o),Ee.useLayoutEffect(()=>{if($&&!ae){var ge={doc:e,selection:t,extensions:he},J=D?Ye.fromJSON(D.json,ge,D.fields):Ye.create(ge);if(re(J),!W){var Q=new fe({state:J,parent:$,root:E});te(Q),s&&s(Q,J)}}return()=>{W&&(re(void 0),te(void 0))}},[$,ae]),Ee.useEffect(()=>{n.container&&H(n.container)},[n.container]),Ee.useEffect(()=>()=>{W&&(W.destroy(),te(void 0)),ce.current&&(ce.current.cancel(),ce.current=null)},[W]),Ee.useEffect(()=>{c&&W&&W.focus()},[c,W]),Ee.useEffect(()=>{W&&W.dispatch({effects:De.reconfigure.of(he)})},[h,o,d,p,g,O,b,v,x,k,C,A,P,i,l]),Ee.useEffect(()=>{if(e!==void 0){var ge=W?W.state.doc.toString():"";if(W&&e!==ge){var J=ce.current&&!ce.current.isDone,Q=()=>{W&&e!==W.state.doc.toString()&&W.dispatch({changes:{from:0,to:W.state.doc.toString().length,insert:e||""},annotations:[b$.of(!0)]})};J?se.current=Q:Q()}}},[e,W]),{state:ae,setState:re,view:W,setView:te,container:$,setContainer:H}}var FK=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],KL=Ee.forwardRef((n,e)=>{var{className:t,value:i="",selection:r,extensions:s=[],onChange:l,onStatistics:o,onCreateEditor:c,onUpdate:h,autoFocus:d,theme:p="light",height:g,minHeight:O,maxHeight:b,width:v,minWidth:x,maxWidth:k,basicSetup:C,placeholder:A,indentWithTab:P,editable:E,readOnly:D,root:$,initialState:H}=n,W=O6(n,FK),te=Ee.useRef(null),{state:ae,view:re,container:ce,setContainer:se}=GK({root:$,value:i,autoFocus:d,theme:p,height:g,minHeight:O,maxHeight:b,width:v,minWidth:x,maxWidth:k,basicSetup:C,placeholder:A,indentWithTab:P,editable:E,readOnly:D,selection:r,onChange:l,onStatistics:o,onCreateEditor:c,onUpdate:h,extensions:s,initialState:H});Ee.useImperativeHandle(e,()=>({editor:te.current,state:ae,view:re}),[te,ce,ae,re]);var z=Ee.useCallback(K=>{te.current=K,se(K)},[se]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var B=typeof p=="string"?"cm-theme-"+p:"cm-theme";return _.jsx("div",q1({ref:z,className:""+B+(t?" "+t:"")},W))});KL.displayName="CodeMirror";class cg{static create(e,t,i,r,s){let l=r+(r<<8)+e+(t<<4)|0;return new cg(e,t,i,l,s,[],[])}constructor(e,t,i,r,s,l,o){this.type=e,this.value=t,this.from=i,this.hash=r,this.end=s,this.children=l,this.positions=o,this.hashProp=[[Ne.contextHash,r]]}addChild(e,t){e.prop(Ne.contextHash)!=this.hash&&(e=new et(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let i=this.children.length-1;return i>=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new et(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,l)=>new et(Kt.none,r,s,l,this.hashProp)})}}var ue;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(ue||(ue={}));class KK{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class JK{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Sh(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,i=0){for(let r=t;r<e;r++)i+=this.text.charCodeAt(r)==9?4-i%4:1;return i}findColumn(e){let t=0;for(let i=0;t<this.text.length&&i<e;t++)i+=this.text.charCodeAt(t)==9?4-i%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function S$(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let i=(n.type==ue.OrderedList?jx:Zx)(t,e,!1);return i>0&&(n.type!=ue.BulletList||Bx(t,e,!1)<0)&&t.text.charCodeAt(t.pos+i-1)==n.value}const JL={[ue.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(We(ue.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(Ui(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[ue.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[ue.OrderedList]:S$,[ue.BulletList]:S$,[ue.Document](){return!0}};function Ui(n){return n==32||n==9||n==10||n==13}function Sh(n,e=0){for(;e<n.length&&Ui(n.charCodeAt(e));)e++;return e}function v$(n,e,t){for(;e>t&&Ui(n.charCodeAt(e-1));)e--;return e}function e3(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function t3(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function Bx(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let i=1;for(let r=n.pos+1;r<n.text.length;r++){let s=n.text.charCodeAt(r);if(s==n.next)i++;else if(!Ui(s))return-1}return t&&n.next==45&&r3(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(a3.SetextHeading)>-1||i<3?-1:1}function n3(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function Zx(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||Ui(n.text.charCodeAt(n.pos+1)))&&(!t||n3(e,ue.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function jx(n,e,t){let i=n.pos,r=n.next;for(;r>=48&&r<=57;){i++;if(i==n.text.length)return-1;r=n.text.charCodeAt(i)}return i==n.pos||i>n.pos+9||r!=46&&r!=41||i<n.text.length-1&&!Ui(n.text.charCodeAt(i+1))||t&&!n3(e,ue.OrderedList)&&(n.skipSpace(i+1)==n.text.length||i>n.pos+1||n.next!=49)?-1:i+1-n.pos}function i3(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function r3(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&Ui(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const BS=/^[ \t]*$/,s3=/-->/,l3=/\?>/,ZS=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,s3],[/^\s*<\?/,l3],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,BS],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,BS]];function o3(n,e,t){if(n.next!=60)return-1;let i=n.text.slice(n.pos);for(let r=0,s=ZS.length-(t?1:0);r<s;r++)if(ZS[r][0].test(i))return r;return-1}function x$(n,e){let t=n.countIndent(e,n.pos,n.indent),i=n.countIndent(n.skipSpace(e),e,t);return i>=t+5?t+1:i}function hl(n,e,t){let i=n.length-1;i>=0&&n[i].to==e&&n[i].type==ue.CodeText?n[i].to=t:n.push(We(ue.CodeText,e,t))}const Tp={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let i=e.findColumn(t),r=n.lineStart+i,s=n.lineStart+e.text.length,l=[],o=[];for(hl(l,r,s);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){hl(o,n.lineStart-1,n.lineStart);for(let c of e.markers)o.push(c)}else{if(e.indent<t)break;{if(o.length){for(let h of o)h.type==ue.CodeText?hl(l,h.from,h.to):l.push(h);o=[]}hl(l,n.lineStart-1,n.lineStart);for(let h of e.markers)l.push(h);s=n.lineStart+e.text.length;let c=n.lineStart+e.findColumn(e.baseIndent+4);c<s&&hl(l,c,s)}}return o.length&&(o=o.filter(c=>c.type!=ue.CodeText),o.length&&(e.markers=o.concat(e.markers))),n.addNode(n.buffer.writeElements(l,-r).finish(ue.CodeBlock,s-r),r),!0},FencedCode(n,e){let t=e3(e);if(t<0)return!1;let i=n.lineStart+e.pos,r=e.next,s=t-e.pos,l=e.skipSpace(t),o=v$(e.text,e.text.length,l),c=[We(ue.CodeMark,i,i+s)];l<o&&c.push(We(ue.CodeInfo,n.lineStart+l,n.lineStart+o));for(let h=!0,d=!0,p=!1;n.nextLine()&&e.depth>=n.stack.length;h=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==r;)g++;if(g-e.pos>=s&&e.skipSpace(g)==e.text.length){for(let O of e.markers)c.push(O);d&&p&&hl(c,n.lineStart-1,n.lineStart),c.push(We(ue.CodeMark,n.lineStart+e.pos,n.lineStart+g)),n.nextLine();break}else{p=!0,h||(hl(c,n.lineStart-1,n.lineStart),d=!1);for(let v of e.markers)c.push(v);let O=n.lineStart+e.basePos,b=n.lineStart+e.text.length;O<b&&(hl(c,O,b),d=!1)}}return n.addNode(n.buffer.writeElements(c,-i).finish(ue.FencedCode,n.prevLineEnd()-i),i),!0},Blockquote(n,e){let t=t3(e);return t<0?!1:(n.startContext(ue.Blockquote,e.pos),n.addNode(ue.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(Bx(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(ue.HorizontalRule,t),!0},BulletList(n,e){let t=Zx(e,n,!1);if(t<0)return!1;n.block.type!=ue.BulletList&&n.startContext(ue.BulletList,e.basePos,e.next);let i=x$(e,e.pos+1);return n.startContext(ue.ListItem,e.basePos,i-e.baseIndent),n.addNode(ue.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(i),null},OrderedList(n,e){let t=jx(e,n,!1);if(t<0)return!1;n.block.type!=ue.OrderedList&&n.startContext(ue.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let i=x$(e,e.pos+t);return n.startContext(ue.ListItem,e.basePos,i-e.baseIndent),n.addNode(ue.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(i),null},ATXHeading(n,e){let t=i3(e);if(t<0)return!1;let i=e.pos,r=n.lineStart+i,s=v$(e.text,e.text.length,i),l=s;for(;l>i&&e.text.charCodeAt(l-1)==e.next;)l--;(l==s||l==i||!Ui(e.text.charCodeAt(l-1)))&&(l=e.text.length);let o=n.buffer.write(ue.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(i+t+1,l),r+t+1),-r);l<e.text.length&&o.write(ue.HeaderMark,l-i,s-i);let c=o.finish(ue.ATXHeading1-1+t,e.text.length-i);return n.nextLine(),n.addNode(c,r),!0},HTMLBlock(n,e){let t=o3(e,n,!1);if(t<0)return!1;let i=n.lineStart+e.pos,r=ZS[t][1],s=[],l=r!=BS;for(;!r.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){l=!1;break}for(let h of e.markers)s.push(h)}l&&n.nextLine();let o=r==s3?ue.CommentBlock:r==l3?ue.ProcessingInstructionBlock:ue.HTMLBlock,c=n.prevLineEnd();return n.addNode(n.buffer.writeElements(s,-i).finish(o,c-i),i),!0},SetextHeading:void 0};class eJ{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,i){if(this.stage==-1)return!1;let r=i.content+`
|
|
221
|
+
`+t.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,i,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Sh(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,i){return e.addLeafElement(t,We(ue.LinkReference,this.start,this.start+i,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(O3(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(We(ue.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(m3(e,Sh(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Sh(e,this.pos),i=0;if(t>this.pos){let r=g3(e,t,this.start);if(r){let s=_b(e,r.to-this.start);s>0&&(this.nextStage(r),i=s)}}return i||(i=_b(e,this.pos)),i>0&&i<e.length?i:-1}else return _b(e,this.pos)}}}function _b(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!Ui(t))return-1}return e}class tJ{nextLine(e,t,i){let r=t.depth<e.stack.length?-1:r3(t),s=t.next;if(r<0)return!1;let l=We(ue.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(i,We(s==61?ue.SetextHeading1:ue.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),l])),!0}finish(){return!1}}const a3={LinkReference(n,e){return e.content.charCodeAt(0)==91?new eJ(e):null},SetextHeading(){return new tJ}},nJ=[(n,e)=>i3(e)>=0,(n,e)=>e3(e)>=0,(n,e)=>t3(e)>=0,(n,e)=>Zx(e,n,!0)>=0,(n,e)=>jx(e,n,!0)>=0,(n,e)=>Bx(e,n,!0)>=0,(n,e)=>o3(e,n,!0)>=0],iJ={text:"",end:0};class rJ{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.line=new JK,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=cg.create(ue.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new oJ(i,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let i=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;i<e.markers.length&&(!r||e.markers[i].from<r.end);){let s=e.markers[i++];this.addNode(s.type,s.from,s.to)}if(!r)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let i of this.parser.blockParsers)if(i){let r=i(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let t=new KK(this.lineStart+e.pos,e.text.slice(e.pos));for(let i of this.parser.leafBlockParsers)if(i){let r=i(this,t);r&&t.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let i of this.parser.endLeafBlock)if(i(this,e,t))break e}for(let i of t.parsers)if(i.nextLine(this,e,t))return null;t.content+=`
|
|
222
|
+
`+e.scrub();for(let i of e.markers)t.marks.push(i)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=y3(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=iJ;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let i=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<t.end;){r++;let s=this.ranges[r].from,l=this.lineChunkAt(s);t.end=s+l.length,t.text=t.text.slice(0,this.ranges[r-1].to-i)+l,i=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:i}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=i,e.reset(t);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+ue[r.type]);let l=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>l&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),i;if(this.input.lineChunks)i=t==`
|
|
223
|
+
`?"":t;else{let r=t.indexOf(`
|
|
224
|
+
`);i=r<0?t:t.slice(0,r)}return e+i.length>this.to?i.slice(0,this.to-e):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,i=0){this.block=cg.create(e,i,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,i=0){this.startContext(this.parser.getNodeType(e),t,i)}addNode(e,t,i){typeof e=="number"&&(e=new et(this.parser.nodeSet.types[e],vc,vc,(i??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(XS(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?c3(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let i of e.parsers)if(i.finish(this,e))return;let t=XS(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(ue.Paragraph,e.content.length),e.start)}elt(e,t,i,r){return typeof e=="string"?We(this.parser.getNodeType(e),t,i,r):new f3(e,t)}get buffer(){return new h3(this.parser.nodeSet)}}function c3(n,e,t,i,r){let s=n[e].to,l=[],o=[],c=t.from+i;function h(d,p){for(;p?d>=s:d>s;){let g=n[e+1].from-s;i+=g,d+=g,e++,s=n[e].to}}for(let d=t.firstChild;d;d=d.nextSibling){h(d.from+i,!0);let p=d.from+i,g,O=r.get(d.tree);O?g=O:d.to+i>s?(g=c3(n,e,d,i,r),h(d.to+i,!1)):g=d.toTree(),l.push(g),o.push(p-c)}return h(t.to+i,!1),new et(t.type,l,o,t.to+i-c,t.tree?t.tree.propValues:void 0)}class nO extends Ox{constructor(e,t,i,r,s,l,o,c,h){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=l,this.inlineParsers=o,this.inlineNames=c,this.wrappers=h,this.nodeTypes=Object.create(null);for(let d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,t,i){let r=new rJ(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}configure(e){let t=jS(e);if(!t)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),l=this.leafBlockParsers.slice(),o=this.blockNames.slice(),c=this.inlineParsers.slice(),h=this.inlineNames.slice(),d=this.endLeafBlock.slice(),p=this.wrappers;if(_u(t.defineNodes)){r=Object.assign({},r);let g=i.types.slice(),O;for(let b of t.defineNodes){let{name:v,block:x,composite:k,style:C}=typeof b=="string"?{name:b}:b;if(g.some(E=>E.name==v))continue;k&&(r[g.length]=(E,D,$)=>k(D,$,E.value));let A=g.length,P=k?["Block","BlockContext"]:x?A>=ue.ATXHeading1&&A<=ue.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(Kt.define({id:A,name:v,props:P&&[[Ne.group,P]]})),C&&(O||(O={}),Array.isArray(C)||C instanceof Oi?O[v]=C:Object.assign(O,C))}i=new gf(g),O&&(i=i.extend(Mc(O)))}if(_u(t.props)&&(i=i.extend(...t.props)),_u(t.remove))for(let g of t.remove){let O=this.blockNames.indexOf(g),b=this.inlineNames.indexOf(g);O>-1&&(s[O]=l[O]=void 0),b>-1&&(c[b]=void 0)}if(_u(t.parseBlock))for(let g of t.parseBlock){let O=o.indexOf(g.name);if(O>-1)s[O]=g.parse,l[O]=g.leaf;else{let b=g.before?Cp(o,g.before):g.after?Cp(o,g.after)+1:o.length-1;s.splice(b,0,g.parse),l.splice(b,0,g.leaf),o.splice(b,0,g.name)}g.endLeaf&&d.push(g.endLeaf)}if(_u(t.parseInline))for(let g of t.parseInline){let O=h.indexOf(g.name);if(O>-1)c[O]=g.parse;else{let b=g.before?Cp(h,g.before):g.after?Cp(h,g.after)+1:h.length-1;c.splice(b,0,g.parse),h.splice(b,0,g.name)}}return t.wrap&&(p=p.concat(t.wrap)),new nO(i,s,l,o,d,r,c,h,p)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let i=new Xx(this,e,t);e:for(let r=t;r<i.end;){let s=i.char(r);for(let l of this.inlineParsers)if(l){let o=l(i,s,r);if(o>=0){r=o;continue e}}r++}return i.resolveMarkers(0)}}function _u(n){return n!=null&&n.length>0}function jS(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=jS(n[0]);if(n.length==1)return e;let t=jS(n.slice(1));if(!t||!e)return e||t;let i=(l,o)=>(l||vc).concat(o||vc),r=e.wrap,s=t.wrap;return{props:i(e.props,t.props),defineNodes:i(e.defineNodes,t.defineNodes),parseBlock:i(e.parseBlock,t.parseBlock),parseInline:i(e.parseInline,t.parseInline),remove:i(e.remove,t.remove),wrap:r?s?(l,o,c,h)=>r(s(l,o,c,h),o,c,h):r:s}}function Cp(n,e){let t=n.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let u3=[Kt.none];for(let n=1,e;e=ue[n];n++)u3[n]=Kt.define({id:n,name:e,props:n>=ue.Escape?[]:[[Ne.group,n in JL?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const vc=[];class h3{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,i,r=0){return this.content.push(e,t,i,4+r*4),this}writeElements(e,t=0){for(let i of e)i.writeTo(this,t);return this}finish(e,t){return et.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let tf=class{constructor(e,t,i,r=vc){this.type=e,this.from=t,this.to=i,this.children=r}writeTo(e,t){let i=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-i)}toTree(e){return new h3(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class f3{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return vc}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function We(n,e,t,i){return new tf(n,e,t,i)}const d3={resolve:"Emphasis",mark:"EmphasisMark"},p3={resolve:"Emphasis",mark:"EmphasisMark"},go={},ug={};class gi{constructor(e,t,i,r){this.type=e,this.from=t,this.to=i,this.side=r}}const k$="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let nf=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{nf=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const Bb={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let i=n.char(t+1);for(let r=0;r<k$.length;r++)if(k$.charCodeAt(r)==i)return n.append(We(ue.Escape,t,t+2));return-1},Entity(n,e,t){if(e!=38)return-1;let i=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(n.slice(t+1,t+31));return i?n.append(We(ue.Entity,t,t+1+i[0].length)):-1},InlineCode(n,e,t){if(e!=96||t&&n.char(t-1)==96)return-1;let i=t+1;for(;i<n.end&&n.char(i)==96;)i++;let r=i-t,s=0;for(;i<n.end;i++)if(n.char(i)==96){if(s++,s==r&&n.char(i+1)!=96)return n.append(We(ue.InlineCode,t,i+1,[We(ue.CodeMark,t,t+r),We(ue.CodeMark,i+1-r,i+1)]))}else s=0;return-1},HTMLTag(n,e,t){if(e!=60||t==n.end-1)return-1;let i=n.slice(t+1,n.end),r=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return n.append(We(ue.Autolink,t,t+1+r[0].length,[We(ue.LinkMark,t,t+1),We(ue.URL,t+1,t+r[0].length),We(ue.LinkMark,t+r[0].length,t+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return n.append(We(ue.Comment,t,t+1+s[0].length));let l=/^\?[^]*?\?>/.exec(i);if(l)return n.append(We(ue.ProcessingInstruction,t,t+1+l[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return o?n.append(We(ue.HTMLTag,t,t+1+o[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let i=t+1;for(;n.char(i)==e;)i++;let r=n.slice(t-1,t),s=n.slice(i,i+1),l=nf.test(r),o=nf.test(s),c=/\s|^$/.test(r),h=/\s|^$/.test(s),d=!h&&(!o||c||l),p=!c&&(!l||h||o),g=d&&(e==42||!p||l),O=p&&(e==42||!d||o);return n.append(new gi(e==95?d3:p3,t,i,(g?1:0)|(O?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(We(ue.HardBreak,t,t+2));if(e==32){let i=t+1;for(;n.char(i)==32;)i++;if(n.char(i)==10&&i>=t+2)return n.append(We(ue.HardBreak,t,i+1))}return-1},Link(n,e,t){return e==91?n.append(new gi(go,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new gi(ug,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let i=n.parts.length-1;i>=0;i--){let r=n.parts[i];if(r instanceof gi&&(r.type==go||r.type==ug)){if(!r.side||n.skipSpace(r.to)==t&&!/[(\[]/.test(n.slice(t+1,t+2)))return n.parts[i]=null,-1;let s=n.takeContent(i),l=n.parts[i]=sJ(n,s,r.type==go?ue.Link:ue.Image,r.from,t+1);if(r.type==go)for(let o=0;o<i;o++){let c=n.parts[o];c instanceof gi&&c.type==go&&(c.side=0)}return l.to}}return-1}};function sJ(n,e,t,i,r){let{text:s}=n,l=n.char(r),o=r;if(e.unshift(We(ue.LinkMark,i,i+(t==ue.Image?2:1))),e.push(We(ue.LinkMark,r-1,r)),l==40){let c=n.skipSpace(r+1),h=m3(s,c-n.offset,n.offset),d;h&&(c=n.skipSpace(h.to),c!=h.to&&(d=g3(s,c-n.offset,n.offset),d&&(c=n.skipSpace(d.to)))),n.char(c)==41&&(e.push(We(ue.LinkMark,r,r+1)),o=c+1,h&&e.push(h),d&&e.push(d),e.push(We(ue.LinkMark,c,o)))}else if(l==91){let c=O3(s,r-n.offset,n.offset,!1);c&&(e.push(c),o=c.to)}return We(t,i,o,e)}function m3(n,e,t){if(n.charCodeAt(e)==60){for(let r=e+1;r<n.length;r++){let s=n.charCodeAt(r);if(s==62)return We(ue.URL,e+t,r+1+t);if(s==60||s==10)return!1}return null}else{let r=0,s=e;for(let l=!1;s<n.length;s++){let o=n.charCodeAt(s);if(Ui(o))break;if(l)l=!1;else if(o==40)r++;else if(o==41){if(!r)break;r--}else o==92&&(l=!0)}return s>e?We(ue.URL,e+t,s+t):s==n.length?null:!1}}function g3(n,e,t){let i=n.charCodeAt(e);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=e+1,l=!1;s<n.length;s++){let o=n.charCodeAt(s);if(l)l=!1;else{if(o==r)return We(ue.LinkTitle,e+t,s+1+t);o==92&&(l=!0)}}return null}function O3(n,e,t,i){for(let r=!1,s=e+1,l=Math.min(n.length,s+999);s<l;s++){let o=n.charCodeAt(s);if(r)r=!1;else{if(o==93)return i?!1:We(ue.LinkLabel,e+t,s+1+t);if(i&&!Ui(o)&&(i=!1),o==91)return!1;o==92&&(r=!0)}}return null}class Xx{constructor(e,t,i){this.parser=e,this.text=t,this.offset=i,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,i,r,s){return this.append(new gi(e,t,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof gi&&(t.type==go||t.type==ug))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let i=e;i<this.parts.length;i++){let r=this.parts[i];if(!(r instanceof gi&&r.type.resolve&&r.side&2))continue;let s=r.type==d3||r.type==p3,l=r.to-r.from,o,c=i-1;for(;c>=e;c--){let v=this.parts[c];if(v instanceof gi&&v.side&1&&v.type==r.type&&!(s&&(r.side&1||v.side&2)&&(v.to-v.from+l)%3==0&&((v.to-v.from)%3||l%3))){o=v;break}}if(!o)continue;let h=r.type.resolve,d=[],p=o.from,g=r.to;if(s){let v=Math.min(2,o.to-o.from,l);p=o.to-v,g=r.from+v,h=v==1?"Emphasis":"StrongEmphasis"}o.type.mark&&d.push(this.elt(o.type.mark,p,o.to));for(let v=c+1;v<i;v++)this.parts[v]instanceof tf&&d.push(this.parts[v]),this.parts[v]=null;r.type.mark&&d.push(this.elt(r.type.mark,r.from,g));let O=this.elt(h,p,g,d);this.parts[c]=s&&o.from!=p?new gi(o.type,o.from,p,o.side):null,(this.parts[i]=s&&r.to!=g?new gi(r.type,g,r.to,r.side):null)?this.parts.splice(i,0,O):this.parts[i]=O}let t=[];for(let i=e;i<this.parts.length;i++){let r=this.parts[i];r instanceof tf&&t.push(r)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let i=this.parts[t];if(i instanceof gi&&i.type==e&&i.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof gi?t:null}skipSpace(e){return Sh(this.text,e-this.offset)+this.offset}elt(e,t,i,r){return typeof e=="string"?We(this.parser.getNodeType(e),t,i,r):new f3(e,t)}}Xx.linkStart=go;Xx.imageStart=ug;function XS(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),i=0;for(let r of e){for(;i<t.length&&t[i].to<r.to;)i++;if(i<t.length&&t[i].from<r.from){let s=t[i];s instanceof tf&&(t[i]=new tf(s.type,s.from,s.to,XS(s.children,[r])))}else t.splice(i++,0,r)}return t}const lJ=[ue.CodeBlock,ue.ListItem,ue.OrderedList,ue.BulletList];let oJ=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
|
|
225
|
+
`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=e+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=t;if(!i.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(Ne.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,l=s,o=e.block.children.length,c=l,h=o;for(;;){if(t.to-i>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let d=y3(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,d);else{let p=new et(e.parser.nodeSet.types[ue.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(p,t.tree),e.addNode(p,d)}if(t.type.is("Block")&&(lJ.indexOf(t.type.id)<0?(l=t.to-i,o=e.block.children.length):(l=c,o=h),c=t.to-i,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return l-s}};function y3(n,e){let t=n;for(let i=1;i<e.length;i++){let r=e[i-1].to,s=e[i].from;r<n&&(t-=s-r)}return t}const aJ=Mc({"Blockquote/...":M.quote,HorizontalRule:M.contentSeparator,"ATXHeading1/... SetextHeading1/...":M.heading1,"ATXHeading2/... SetextHeading2/...":M.heading2,"ATXHeading3/...":M.heading3,"ATXHeading4/...":M.heading4,"ATXHeading5/...":M.heading5,"ATXHeading6/...":M.heading6,"Comment CommentBlock":M.comment,Escape:M.escape,Entity:M.character,"Emphasis/...":M.emphasis,"StrongEmphasis/...":M.strong,"Link/... Image/...":M.link,"OrderedList/... BulletList/...":M.list,"BlockQuote/...":M.quote,"InlineCode CodeText":M.monospace,"URL Autolink":M.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":M.processingInstruction,"CodeInfo LinkLabel":M.labelName,LinkTitle:M.string,Paragraph:M.content}),cJ=new nO(new gf(u3).extend(aJ),Object.keys(Tp).map(n=>Tp[n]),Object.keys(Tp).map(n=>a3[n]),Object.keys(Tp),nJ,JL,Object.keys(Bb).map(n=>Bb[n]),Object.keys(Bb),[]);function uJ(n,e,t){let i=[];for(let r=n.firstChild,s=e;;r=r.nextSibling){let l=r?r.from:t;if(l>s&&i.push({from:s,to:l}),!r)break;s=r.to}return i}function hJ(n){let{codeParser:e,htmlParser:t}=n;return{wrap:Mz((r,s)=>{let l=r.type.id;if(e&&(l==ue.CodeBlock||l==ue.FencedCode)){let o="";if(l==ue.FencedCode){let h=r.node.getChild(ue.CodeInfo);h&&(o=s.read(h.from,h.to))}let c=e(o);if(c)return{parser:c,overlay:h=>h.type.id==ue.CodeText,bracketed:l==ue.FencedCode}}else if(t&&(l==ue.HTMLBlock||l==ue.HTMLTag||l==ue.CommentBlock))return{parser:t,overlay:uJ(r.node,r.from,r.to)};return null})}}const fJ={resolve:"Strikethrough",mark:"StrikethroughMark"},dJ={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":M.strikethrough}},{name:"StrikethroughMark",style:M.processingInstruction}],parseInline:[{name:"Strikethrough",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let i=n.slice(t-1,t),r=n.slice(t+2,t+3),s=/\s|^$/.test(i),l=/\s|^$/.test(r),o=nf.test(i),c=nf.test(r);return n.addDelimiter(fJ,t,t+2,!l&&(!c||s||o),!s&&(!o||l||c))},after:"Emphasis"}]};function vh(n,e,t=0,i,r=0){let s=0,l=!0,o=-1,c=-1,h=!1,d=()=>{i.push(n.elt("TableCell",r+o,r+c,n.parser.parseInline(e.slice(o,c),r+o)))};for(let p=t;p<e.length;p++){let g=e.charCodeAt(p);g==124&&!h?((!l||o>-1)&&s++,l=!1,i&&(o>-1&&d(),i.push(n.elt("TableDelimiter",p+r,p+r+1))),o=c=-1):(h||g!=32&&g!=9)&&(o<0&&(o=p),c=p+1),h=!h&&g==92}return o>-1&&(s++,i&&d()),s}function w$(n,e){for(let t=e;t<n.length;t++){let i=n.charCodeAt(t);if(i==124)return!0;i==92&&t++}return!1}const b3=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class T${constructor(){this.rows=null}nextLine(e,t,i){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&b3.test(r=t.text.slice(t.pos))){let s=[];vh(e,i.content,0,s,i.start)==vh(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];vh(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const pJ={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":M.heading}},"TableRow",{name:"TableCell",style:M.content},{name:"TableDelimiter",style:M.processingInstruction}],parseBlock:[{name:"Table",leaf(n,e){return w$(e.content,0)?new T$:null},endLeaf(n,e,t){if(t.parsers.some(r=>r instanceof T$)||!w$(e.text,e.basePos))return!1;let i=n.peekLine();return b3.test(i)&&vh(n,e.text,e.basePos)==vh(n,i,e.basePos)},before:"SetextHeading"}]};class mJ{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const gJ={defineNodes:[{name:"Task",block:!0,style:M.list},{name:"TaskMarker",style:M.atom}],parseBlock:[{name:"TaskList",leaf(n,e){return/^\[[ xX]\][ \t]/.test(e.content)&&n.parentType().name=="ListItem"?new mJ:null},after:"SetextHeading"}]},C$=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,A$=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,OJ=/[\w-]+\.[\w-]+($|\/)/,M$=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,Q$=/\/[a-zA-Z\d@.]+/gy;function E$(n,e,t,i){let r=0;for(let s=e;s<t;s++)n[s]==i&&r++;return r}function yJ(n,e){A$.lastIndex=e;let t=A$.exec(n);if(!t||OJ.exec(t[0])[0].indexOf("_")>-1)return-1;let i=e+t[0].length;for(;;){let r=n[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&E$(n,e,i,")")>E$(n,e,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(n.slice(e,i))))i=e+s.index;else break}return i}function $$(n,e){M$.lastIndex=e;let t=M$.exec(n);if(!t)return-1;let i=t[0][t[0].length-1];return i=="_"||i=="-"?-1:e+t[0].length-(i=="."?1:0)}const bJ={parseInline:[{name:"Autolink",parse(n,e,t){let i=t-n.offset;if(i&&/\w/.test(n.text[i-1]))return-1;C$.lastIndex=i;let r=C$.exec(n.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=yJ(n.text,i+r[0].length),s>-1&&n.hasOpenLink){let l=/([^\[\]]|\[[^\]]*\])*/.exec(n.text.slice(i,s));s=i+l[0].length}}else r[3]?s=$$(n.text,i):(s=$$(n.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(Q$.lastIndex=s,r=Q$.exec(n.text),r&&(s=r.index+r[0].length)));return s<0?-1:(n.addElement(n.elt("URL",t,s+n.offset)),s+n.offset)}}]},SJ=[pJ,gJ,dJ,bJ];function S3(n,e,t){return(i,r,s)=>{if(r!=n||i.char(s+1)==n)return-1;let l=[i.elt(t,s,s+1)];for(let o=s+1;o<i.end;o++){let c=i.char(o);if(c==n)return i.addElement(i.elt(e,s,o+1,l.concat(i.elt(t,o,o+1))));if(c==92&&l.push(i.elt("Escape",o,o+++2)),Ui(c))break}return-1}}const vJ={defineNodes:[{name:"Superscript",style:M.special(M.content)},{name:"SuperscriptMark",style:M.processingInstruction}],parseInline:[{name:"Superscript",parse:S3(94,"Superscript","SuperscriptMark")}]},xJ={defineNodes:[{name:"Subscript",style:M.special(M.content)},{name:"SubscriptMark",style:M.processingInstruction}],parseInline:[{name:"Subscript",parse:S3(126,"Subscript","SubscriptMark")}]},kJ={defineNodes:[{name:"Emoji",style:M.character}],parseInline:[{name:"Emoji",parse(n,e,t){let i;return e!=58||!(i=/^[a-zA-Z_0-9]+:/.exec(n.slice(t+1,n.end)))?-1:n.addElement(n.elt("Emoji",t,t+1+i[0].length))}}]};var R$={};class hg{constructor(e,t,i,r,s,l,o,c,h,d=0,p){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=s,this.score=l,this.buffer=o,this.bufferBase=c,this.curContext=h,this.lookAhead=d,this.parent=p}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new hg(e,[],t,i,i,0,[],0,r?new P$(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:s}=this.p,l=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),o=s.dynamicPrecedence(r);if(o&&(this.score+=o),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,l?8:4,!0),this.reduceContext(r,this.reducePos);return}let c=this.stack.length-(i-1)*3-(e&262144?6:0),h=c?this.stack[c-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&h==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let d=this.reducePos-h;d>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=d));let p=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-p;if(r<s.minRepeatTerm||e&131072){let O=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,h,O,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let O=this.stack[c-3];this.state=s.getGoto(O,r,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let l=this.buffer.length;if(l>0&&this.buffer[l-4]==0&&this.buffer[l-1]>-1){if(t==i)return;if(this.buffer[l-2]>=t){this.buffer[l-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let l=this.buffer.length;if(l>0&&(this.buffer[l-4]!=0||this.buffer[l-1]<0)){let o=!1;for(let c=l;c>0&&this.buffer[c-2]>i;c-=4)if(this.buffer[c-1]>=0){o=!0;break}if(o)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,r>4&&(r-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:l}=this.p;this.pos=r;let o=l.stateFlag(s,1);!o&&(r>i||t<=l.maxNode)&&(this.reducePos=r),this.pushState(s,o?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,r,4)}else this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4)}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new hg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new wJ(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,l;s<t.length;s+=2)(l=t[s+1])!=this.state&&this.p.parser.hasAction(l,e)&&r.push(t[s],l);if(this.stack.length<120)for(let s=0;r.length<8&&s<t.length;s+=2){let l=t[s+1];r.some((o,c)=>c&1&&o==l)||r.push(t[s],l)}t=r}let i=[];for(let r=0;r<t.length&&i.length<4;r+=2){let s=t[r+1];if(s==this.state)continue;let l=this.split();l.pushState(s,this.pos),l.storeNode(0,l.pos,l.pos,4,!0),l.shiftContext(t[r],this.pos),l.reducePos=this.pos,l.score-=200,i.push(l)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,l=>{if(!(l&393216))if(l&65536){let o=(l>>19)-s;if(o>1){let c=l&65535,h=this.stack.length-o*3;if(h>=0&&e.getGoto(this.stack[h],c,!1)>=0)return o<<19|65536|c}}else{let o=i(l,s+1);if(o!=null)return o}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new P$(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class P${constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class wJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class fg{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new fg(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new fg(this.stack,this.pos,this.index)}}function eh(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i<n.length;){let s=0;for(;;){let l=n.charCodeAt(i++),o=!1;if(l==126){s=65535;break}l>=92&&l--,l>=34&&l--;let c=l-32;if(c>=46&&(c-=46,o=!0),s+=c,o)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Vp{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const D$=new Vp;class TJ{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=D$,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let l=this.ranges[--r];s-=i.from-l.to,i=l}for(;t<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let l=this.ranges[++r];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let l=this.rangeIndex,o=this.range;for(;o.to<=i;)o=this.ranges[++l];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>o.to&&(this.chunk2=this.chunk2.slice(0,o.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=D$,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class ic{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;v3(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}ic.prototype.contextual=ic.prototype.fallback=ic.prototype.extend=!1;class dg{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?eh(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(v3(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,l==null)break;e.reset(l,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}dg.prototype.contextual=ic.prototype.fallback=ic.prototype.extend=!1;class wi{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function v3(n,e,t,i,r,s){let l=0,o=1<<i,{dialect:c}=t.p.parser;e:for(;(o&n[l])!=0;){let h=n[l+1];for(let O=l+3;O<h;O+=2)if((n[O+1]&o)>0){let b=n[O];if(c.allows(b)&&(e.token.value==-1||e.token.value==b||CJ(b,e.token.value,r,s))){e.acceptToken(b);break}}let d=e.next,p=0,g=n[l+2];if(e.next<0&&g>p&&n[h+g*3-3]==65535){l=n[h+g*3-1];continue e}for(;p<g;){let O=p+g>>1,b=h+O+(O<<1),v=n[b],x=n[b+1]||65536;if(d<v)g=O;else if(d>=x)p=O+1;else{l=n[b+2],e.advance();continue e}}break}}function N$(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function CJ(n,e,t,i){let r=N$(t,i,e);return r<0||N$(t,i,n)<r}const di=typeof process<"u"&&R$&&/\bparse\b/.test(R$.LOG);let Zb=null;function z$(n,e,t){let i=n.cursor(nt.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class AJ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?z$(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?z$(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],r=this.index[t];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],l=this.start[t]+i.positions[r];if(l>e)return this.nextStart=l,null;if(s instanceof et){if(l==e){if(l<this.safeFrom)return null;let o=l+s.length;if(o<=this.safeTo){let c=s.prop(Ne.lookAhead);if(!c||o+c<this.fragment.to)return s}}this.index[t]++,l+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class MJ{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Vp)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,l=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,c=0;for(let h=0;h<s.length;h++){if((1<<h&l)==0)continue;let d=s[h],p=this.tokens[h];if(!(i&&!d.fallback)&&((d.contextual||p.start!=e.pos||p.mask!=l||p.context!=o)&&(this.updateCachedToken(p,d,e),p.mask=l,p.context=o),p.lookAhead>p.end+25&&(c=Math.max(p.lookAhead,c)),p.value!=0)){let g=t;if(p.extended>-1&&(t=this.addActions(e,p.extended,p.end,t)),t=this.addActions(e,p.value,p.end,t),!d.extend&&(i=p,t>g))break}}for(;this.actions.length>t;)this.actions.pop();return c&&e.setLookAhead(c),!i&&e.pos==this.stream.end&&(i=new Vp,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Vp,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l<s.specialized.length;l++)if(s.specialized[l]==e.value){let o=s.specializers[l](this.stream.read(e.start,e.end),i);if(o>=0&&i.p.parser.dialect.allows(o>>1)){(o&1)==0?e.value=o>>1:e.extended=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=i,r}addActions(e,t,i,r){let{state:s}=e,{parser:l}=e.p,{data:o}=l;for(let c=0;c<2;c++)for(let h=l.stateSlot(s,c?2:1);;h+=3){if(o[h]==65535)if(o[h+1]==1)h=Ss(o,h+2);else{r==0&&o[h+1]==2&&(r=this.putAction(Ss(o,h+2),t,i,r));break}o[h]==t&&(r=this.putAction(Ss(o,h+1),t,i,r))}return r}}class QJ{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new TJ(t,r),this.tokens=new MJ(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[hg.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new AJ(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;l<e.length;l++){let o=e[l];for(;;){if(this.tokens.mainToken=null,o.pos>t)i.push(o);else{if(this.advanceStack(o,i,e))continue;{r||(r=[],s=[]),r.push(o);let c=this.tokens.getMainToken(o);s.push(c.value,c.end)}}break}}if(!i.length){let l=r&&$J(r);if(l)return di&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw di&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let l=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(l)return di&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((o,c)=>c.score-o.score);i.length>l;)i.pop();i.some(o=>o.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l<i.length-1;l++){let o=i[l];for(let c=l+1;c<i.length;c++){let h=i[c];if(o.sameState(h)||o.buffer.length>500&&h.buffer.length>500)if((o.score-h.score||o.buffer.length-h.buffer.length)>0)i.splice(c--,1);else{i.splice(l--,1);continue e}}}i.length>12&&(i.sort((l,o)=>o.score-l.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let l=1;l<i.length;l++)i[l].pos<this.minStackPos&&(this.minStackPos=i[l].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let r=e.pos,{parser:s}=this,l=di?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,d=h?e.curContext.hash:0;for(let p=this.fragments.nodeAt(r);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?s.getGoto(e.state,p.type.id):-1;if(g>-1&&p.length&&(!h||(p.prop(Ne.contextHash)||0)==d))return e.useNode(p,g),di&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(p.type.id)})`),!0;if(!(p instanceof et)||p.children.length==0||p.positions[0]>0)break;let O=p.children[0];if(O instanceof et&&p.positions[0]==0)p=O;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),di&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let h=0;h<c.length;){let d=c[h++],p=c[h++],g=c[h++],O=h==c.length||!i,b=O?e:e.split(),v=this.tokens.mainToken;if(b.apply(d,p,v?v.start:b.pos,g),di&&console.log(l+this.stackID(b)+` (via ${(d&65536)==0?"shift":`reduce of ${s.getName(d&65535)}`} for ${s.getName(p)} @ ${r}${b==e?"":", split"})`),O)return!0;b.pos>r?t.push(b):i.push(b)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return L$(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let l=0;l<e.length;l++){let o=e[l],c=t[l<<1],h=t[(l<<1)+1],d=di?this.stackID(o)+" -> ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),di&&console.log(d+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))))continue;let p=o.split(),g=d;for(let O=0;O<10&&p.forceReduce()&&(di&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,i));O++)di&&(g=this.stackID(p)+" -> ");for(let O of o.recoverByInsert(c))di&&console.log(d+this.stackID(O)+" (via recover-insert)"),this.advanceFully(O,i);this.stream.end>o.pos?(h==o.pos&&(h++,c=0),o.recoverByDelete(c,h),di&&console.log(d+this.stackID(o)+` (via recover-delete ${this.parser.getName(c)})`),L$(o,i)):(!r||r.score<p.score)&&(r=p)}return r}stackToTree(e){return e.close(),et.build({buffer:fg.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(Zb||(Zb=new WeakMap)).get(e);return t||Zb.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function L$(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class EJ{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}const jb=n=>n;class x3{constructor(e){this.start=e.start,this.shift=e.shift||jb,this.reduce=e.reduce||jb,this.reuse=e.reuse||jb,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class xc extends Ox{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let o=0;o<e.repeatNodeCount;o++)t.push("");let i=Object.keys(e.topRules).map(o=>e.topRules[o][1]),r=[];for(let o=0;o<t.length;o++)r.push([]);function s(o,c,h){r[o].push([c,c.deserialize(String(h))])}if(e.nodeProps)for(let o of e.nodeProps){let c=o[0];typeof c=="string"&&(c=Ne[c]);for(let h=1;h<o.length;){let d=o[h++];if(d>=0)s(d,c,o[h++]);else{let p=o[h+-d];for(let g=-d;g>0;g--)s(o[h++],c,p);h++}}}this.nodeSet=new gf(t.map((o,c)=>Kt.define({name:c>=this.minRepeatTerm?void 0:o,id:c,props:r[c],top:i.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=kz;let l=eh(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;o<this.specializerSpecs.length;o++)this.specialized[o]=this.specializerSpecs[o].term;this.specializers=this.specializerSpecs.map(_$),this.states=eh(e.states,Uint32Array),this.data=eh(e.stateData),this.goto=eh(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(o=>typeof o=="number"?new ic(l,o):o),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new QJ(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let l=r[s++],o=l&1,c=r[s++];if(o&&i)return c;for(let h=s+(l>>1);s<h;s++)if(r[s]==e)return c;if(o)return-1}}hasAction(e,t){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),l;;s+=3){if((l=i[s])==65535)if(i[s+1]==1)l=i[s=Ss(i,s+2)];else{if(i[s+1]==2)return Ss(i,s+2);break}if(l==t||l==0)return Ss(i,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ss(this.data,s+2);else break;r=t(Ss(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ss(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];t.some((s,l)=>l&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(xc.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(o=>o.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=_$(l),l})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let r=null;for(let s=0;s<t.length;s++)if(!i[s])for(let l=this.dialects[t[s]],o;(o=this.data[l++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[o]=1;return new EJ(e,i,r)}static deserialize(e){return new xc(e)}}function Ss(n,e){return n[e]|n[e+1]<<16}function $J(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function _$(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}const RJ=55,PJ=1,DJ=56,NJ=2,zJ=57,LJ=3,B$=4,_J=5,Ix=6,k3=7,w3=8,T3=9,C3=10,BJ=11,ZJ=12,jJ=13,Xb=58,XJ=14,IJ=15,Z$=59,A3=21,VJ=23,M3=24,qJ=25,IS=27,Q3=28,HJ=29,YJ=32,UJ=35,WJ=37,GJ=38,FJ=0,KJ=1,JJ={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},eee={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},j$={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function tee(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let X$=null,I$=null,V$=0;function VS(n,e){let t=n.pos+e;if(V$==t&&I$==n)return X$;let i=n.peek(e),r="";for(;tee(i);)r+=String.fromCharCode(i),i=n.peek(++e);return I$=n,V$=t,X$=r?r.toLowerCase():i==nee||i==iee?void 0:null}const E3=60,pg=62,Vx=47,nee=63,iee=33,ree=45;function q$(n,e){this.name=n,this.parent=e}const see=[Ix,C3,k3,w3,T3],lee=new x3({start:null,shift(n,e,t,i){return see.indexOf(e)>-1?new q$(VS(i,1)||"",n):n},reduce(n,e){return e==A3&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==Ix||r==WJ?new q$(VS(i,1)||"",n):n},strict:!1}),oee=new wi((n,e)=>{if(n.next!=E3){n.next<0&&e.context&&n.acceptToken(Xb);return}n.advance();let t=n.next==Vx;t&&n.advance();let i=VS(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?IJ:XJ);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(BJ);if(r&&eee[r])return n.acceptToken(Xb,-2);if(e.dialectEnabled(FJ))return n.acceptToken(ZJ);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(jJ)}else{if(i=="script")return n.acceptToken(k3);if(i=="style")return n.acceptToken(w3);if(i=="textarea")return n.acceptToken(T3);if(JJ.hasOwnProperty(i))return n.acceptToken(C3);r&&j$[r]&&j$[r][i]?n.acceptToken(Xb,-1):n.acceptToken(Ix)}},{contextual:!0}),aee=new wi(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(Z$);break}if(n.next==ree)e++;else if(n.next==pg&&e>=2){t>=3&&n.acceptToken(Z$,-2);break}else e=0;n.advance()}});function cee(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const uee=new wi((n,e)=>{if(n.next==Vx&&n.peek(1)==pg){let t=e.dialectEnabled(KJ)||cee(e.context);n.acceptToken(t?_J:B$,2)}else n.next==pg&&n.acceptToken(B$,1)});function qx(n,e,t){let i=2+n.length;return new wi(r=>{for(let s=0,l=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(e);break}if(s==0&&r.next==E3||s==1&&r.next==Vx||s>=2&&s<i&&r.next==n.charCodeAt(s-2))s++,l++;else if(s==i&&r.next==pg){o>l?r.acceptToken(e,-l):r.acceptToken(t,-(l-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(e,1);break}else s=l=0;r.advance()}})}const hee=qx("script",RJ,PJ),fee=qx("style",DJ,NJ),dee=qx("textarea",zJ,LJ),pee=Mc({"Text RawText IncompleteTag IncompleteCloseTag":M.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":M.angleBracket,TagName:M.tagName,"MismatchedCloseTag/TagName":[M.tagName,M.invalid],AttributeName:M.attributeName,"AttributeValue UnquotedAttributeValue":M.attributeValue,Is:M.definitionOperator,"EntityReference CharacterReference":M.character,Comment:M.blockComment,ProcessingInst:M.processingInstruction,DoctypeDecl:M.documentMeta}),mee=xc.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOa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^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:lee,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[pee],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S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5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[hee,fee,dee,uee,oee,aee,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function $3(n,e){let t=Object.create(null);for(let i of n.getChildren(M3)){let r=i.getChild(qJ),s=i.getChild(IS)||i.getChild(Q3);r&&(t[e.read(r.from,r.to)]=s?s.type.id==IS?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function H$(n,e){let t=n.getChild(VJ);return t?e.read(t.from,t.to):" "}function Ib(n,e,t){let i;for(let r of t)if(!r.attrs||r.attrs(i||(i=$3(n.node.parent.firstChild,e))))return{parser:r.parser,bracketed:!0};return null}function R3(n=[],e=[]){let t=[],i=[],r=[],s=[];for(let o of n)(o.tag=="script"?t:o.tag=="style"?i:o.tag=="textarea"?r:s).push(o);let l=e.length?Object.create(null):null;for(let o of e)(l[o.name]||(l[o.name]=[])).push(o);return Mz((o,c)=>{let h=o.type.id;if(h==HJ)return Ib(o,c,t);if(h==YJ)return Ib(o,c,i);if(h==UJ)return Ib(o,c,r);if(h==A3&&s.length){let d=o.node,p=d.firstChild,g=p&&H$(p,c),O;if(g){for(let b of s)if(b.tag==g&&(!b.attrs||b.attrs(O||(O=$3(p,c))))){let v=d.lastChild,x=v.type.id==GJ?v.from:d.to;if(x>p.to)return{parser:b.parser,overlay:[{from:p.to,to:x}]}}}}if(l&&h==M3){let d=o.node,p;if(p=d.firstChild){let g=l[c.read(p.from,p.to)];if(g)for(let O of g){if(O.tagName&&O.tagName!=H$(d.parent,c))continue;let b=d.lastChild;if(b.type.id==IS){let v=b.from+1,x=b.lastChild,k=b.to-(x&&x.isError?0:1);if(k>v)return{parser:O.parser,overlay:[{from:v,to:k}],bracketed:!0}}else if(b.type.id==Q3)return{parser:O.parser,overlay:[{from:b.from,to:b.to}]}}}}return null})}const gee=135,Y$=1,Oee=136,yee=137,P3=2,bee=138,See=3,vee=4,D3=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],xee=58,kee=40,N3=95,wee=91,qp=45,Tee=46,Cee=35,Aee=37,Mee=38,Qee=92,Eee=10,$ee=42;function rf(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function Hx(n){return n>=48&&n<=57}function U$(n){return Hx(n)||n>=97&&n<=102||n>=65&&n<=70}const z3=(n,e,t)=>(i,r)=>{for(let s=!1,l=0,o=0;;o++){let{next:c}=i;if(rf(c)||c==qp||c==N3||s&&Hx(c))!s&&(c!=qp||o>0)&&(s=!0),l===o&&c==qp&&l++,i.advance();else if(c==Qee&&i.peek(1)!=Eee){if(i.advance(),U$(i.next)){do i.advance();while(U$(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(l==2&&r.canShift(P3)?e:c==kee?t:n);break}}},Ree=new wi(z3(Oee,P3,yee),{contextual:!0}),Pee=new wi(z3(bee,See,vee),{contextual:!0}),Dee=new wi(n=>{if(D3.includes(n.peek(-1))){let{next:e}=n;(rf(e)||e==N3||e==Cee||e==Tee||e==$ee||e==wee||e==xee&&rf(n.peek(1))||e==qp||e==Mee)&&n.acceptToken(gee)}}),Nee=new wi(n=>{if(!D3.includes(n.peek(-1))){let{next:e}=n;if(e==Aee&&(n.advance(),n.acceptToken(Y$)),rf(e)){do n.advance();while(rf(n.next)||Hx(n.next));n.acceptToken(Y$)}}}),zee=Mc({"AtKeyword import charset namespace keyframes media supports font-feature-values":M.definitionKeyword,"from to selector scope MatchFlag":M.keyword,NamespaceName:M.namespace,KeyframeName:M.labelName,KeyframeRangeName:M.operatorKeyword,TagName:M.tagName,ClassName:M.className,PseudoClassName:M.constant(M.className),IdName:M.labelName,"FeatureName PropertyName":M.propertyName,AttributeName:M.attributeName,NumberLiteral:M.number,KeywordQuery:M.keyword,UnaryQueryOp:M.operatorKeyword,"CallTag ValueName FontName":M.atom,VariableName:M.variableName,Callee:M.operatorKeyword,Unit:M.unit,"UniversalSelector NestingSelector":M.definitionOperator,"MatchOp CompareOp":M.compareOperator,"ChildOp SiblingOp, LogicOp":M.logicOperator,BinOp:M.arithmeticOperator,Important:M.modifier,Comment:M.blockComment,ColorLiteral:M.color,"ParenthesizedContent StringLiteral":M.string,":":M.punctuation,"PseudoOp #":M.derefOperator,"; , |":M.separator,"( )":M.paren,"[ ]":M.squareBracket,"{ }":M.brace}),Lee={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},_ee={__proto__:null,or:104,and:104,not:112,only:112,layer:186},Bee={__proto__:null,selector:118,layer:182},Zee={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},jee={__proto__:null,to:223},Xee=xc.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO'#FnQOQ`OOP,QO&jO'#CaPOOO)CAR)CAROOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,]QdO,59YO'_QdO,5:`O'dQdO,5:bO'oQdO,5:iO'oQdO,5:kO'oQdO,5:lO'oQdO'#E}O,hQ`O,58}O,pQdO'#ESOOQS,58},58}OOQP'#Cq'#CqOOQO'#Dr'#DrOOQP,59Y,59YO,wQ`O,59YO,|Q`O,59YOOQP'#Du'#DuOOQP,5:`,5:`O-RQpO'#DwO-^QdO'#DxO-cQ`O'#DxO-hQpO,5:bO.RQaO,5:iO.iQaO,5:lOOQW'#D^'#D^O/eQhO'#DgO/xQhO,5;_O)zQhO'#DeO0VQ`O'#DkO0[QhO'#DnOOQW'#Fj'#FjOOQS,5;_,5;_O0aQ`O'#DhOOQS-E8t-E8tOOQ['#Cv'#CvO0fQdO'#CwO0|QdO'#C}O1dQdO'#DQO1zQ!pO'#DSO4TQ!jO,5:rOOQO'#DX'#DXO,|Q`O'#DWO4eQ!nO'#FgO6hQ`O'#DYO6mQ`O'#Do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cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[zee],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%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%lO%jbFWU!e`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!e`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!e`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!e`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!e`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!e`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$cQ!e`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$XUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU!uQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[Dee,Nee,Ree,Pee,1,2,3,4,new dg("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:n=>Lee[n]||-1},{term:138,get:n=>_ee[n]||-1},{term:4,get:n=>Bee[n]||-1},{term:28,get:n=>Zee[n]||-1},{term:136,get:n=>jee[n]||-1}],tokenPrec:2256});let Vb=null;function qb(){if(!Vb&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));Vb=e.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return Vb||[]}const W$=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),G$=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),Iee=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),Vee=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),gs=/^(\w[\w-]*|-\w[\w-]*|)$/,qee=/^-(-[\w-]*)?$/;function Hee(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const F$=new Az,Yee=["Declaration"];function Uee(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function L3(n,e,t){if(e.to-e.from>4096){let i=F$.get(e);if(i)return i;let r=[],s=new Set,l=e.cursor(nt.IncludeAnonymous);if(l.firstChild())do for(let o of L3(n,l.node,t))s.has(o.label)||(s.add(o.label),r.push(o));while(l.nextSibling());return F$.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var l;if(t(s)&&s.matchContext(Yee)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let o=n.sliceString(s.from,s.to);r.has(o)||(r.add(o),i.push({label:o,type:"variable"}))}}),i}}const Wee=n=>e=>{let{state:t,pos:i}=e,r=yt(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:qb(),validFor:gs};if(r.name=="ValueName")return{from:r.from,options:G$,validFor:gs};if(r.name=="PseudoClassName")return{from:r.from,options:W$,validFor:gs};if(n(r)||(e.explicit||s)&&Hee(r,t.doc))return{from:n(r)||s?r.from:i,options:L3(t.doc,Uee(r),n),validFor:qee};if(r.name=="TagName"){for(let{parent:c}=r;c;c=c.parent)if(c.name=="Block")return{from:r.from,options:qb(),validFor:gs};return{from:r.from,options:Iee,validFor:gs}}if(r.name=="AtKeyword")return{from:r.from,options:Vee,validFor:gs};if(!e.explicit)return null;let l=r.resolve(i),o=l.childBefore(i);return o&&o.name==":"&&l.name=="PseudoClassSelector"?{from:i,options:W$,validFor:gs}:o&&o.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:i,options:G$,validFor:gs}:l.name=="Block"||l.name=="Styles"?{from:i,options:qb(),validFor:gs}:null},Gee=Wee(n=>n.name=="VariableName"),mg=yc.define({name:"css",parser:Xee.configure({props:[Of.add({Declaration:Xp()}),Ec.add({"Block KeyframeList":Nz})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Fee(){return new Yh(mg,mg.data.of({autocomplete:Gee}))}const Kee=316,Jee=317,K$=1,ete=2,tte=3,nte=4,ite=318,rte=320,ste=321,lte=5,ote=6,ate=0,qS=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],_3=125,cte=59,HS=47,ute=42,hte=43,fte=45,dte=60,pte=44,mte=63,gte=46,Ote=91,yte=new x3({start:!1,shift(n,e){return e==lte||e==ote||e==rte?n:e==ste},strict:!1}),bte=new wi((n,e)=>{let{next:t}=n;(t==_3||t==-1||e.context)&&n.acceptToken(ite)},{contextual:!0,fallback:!0}),Ste=new wi((n,e)=>{let{next:t}=n,i;qS.indexOf(t)>-1||t==HS&&((i=n.peek(1))==HS||i==ute)||t!=_3&&t!=cte&&t!=-1&&!e.context&&n.acceptToken(Kee)},{contextual:!0}),vte=new wi((n,e)=>{n.next==Ote&&!e.context&&n.acceptToken(Jee)},{contextual:!0}),xte=new wi((n,e)=>{let{next:t}=n;if(t==hte||t==fte){if(n.advance(),t==n.next){n.advance();let i=!e.context&&e.canShift(K$);n.acceptToken(i?K$:ete)}}else t==mte&&n.peek(1)==gte&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(tte))},{contextual:!0});function Hb(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const kte=new wi((n,e)=>{if(n.next!=dte||!e.dialectEnabled(ate)||(n.advance(),n.next==HS))return;let t=0;for(;qS.indexOf(n.next)>-1;)n.advance(),t++;if(Hb(n.next,!0)){for(n.advance(),t++;Hb(n.next,!1);)n.advance(),t++;for(;qS.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==pte)return;for(let i=0;;i++){if(i==7){if(!Hb(n.next,!0))return;break}if(n.next!="extends".charCodeAt(i))break;n.advance(),t++}}n.acceptToken(nte,-t)}),wte=Mc({"get set async static":M.modifier,"for while do if else switch try catch finally return throw break continue default case defer":M.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":M.operatorKeyword,"let var const using function class extends":M.definitionKeyword,"import export from":M.moduleKeyword,"with debugger new":M.keyword,TemplateString:M.special(M.string),super:M.atom,BooleanLiteral:M.bool,this:M.self,null:M.null,Star:M.modifier,VariableName:M.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":M.function(M.variableName),VariableDefinition:M.definition(M.variableName),Label:M.labelName,PropertyName:M.propertyName,PrivatePropertyName:M.special(M.propertyName),"CallExpression/MemberExpression/PropertyName":M.function(M.propertyName),"FunctionDeclaration/VariableDefinition":M.function(M.definition(M.variableName)),"ClassDeclaration/VariableDefinition":M.definition(M.className),"NewExpression/VariableName":M.className,PropertyDefinition:M.definition(M.propertyName),PrivatePropertyDefinition:M.definition(M.special(M.propertyName)),UpdateOp:M.updateOperator,"LineComment Hashbang":M.lineComment,BlockComment:M.blockComment,Number:M.number,String:M.string,Escape:M.escape,ArithOp:M.arithmeticOperator,LogicOp:M.logicOperator,BitOp:M.bitwiseOperator,CompareOp:M.compareOperator,RegExp:M.regexp,Equals:M.definitionOperator,Arrow:M.function(M.punctuation),": Spread":M.punctuation,"( )":M.paren,"[ ]":M.squareBracket,"{ }":M.brace,"InterpolationStart InterpolationEnd":M.special(M.brace),".":M.derefOperator,", ;":M.separator,"@":M.meta,TypeName:M.typeName,TypeDefinition:M.definition(M.typeName),"type enum interface implements namespace module declare":M.definitionKeyword,"abstract global Privacy readonly override":M.modifier,"is keyof unique infer asserts":M.operatorKeyword,JSXAttributeValue:M.attributeValue,JSXText:M.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":M.angleBracket,"JSXIdentifier JSXNameSpacedName":M.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":M.attributeName,"JSXBuiltin/JSXIdentifier":M.standard(M.tagName)}),Tte={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Cte={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Ate={__proto__:null,"<":193},Mte=xc.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ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S-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:yte,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[wte],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%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u[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new dg("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>Tte[n]||-1},{term:343,get:n=>Cte[n]||-1},{term:95,get:n=>Ate[n]||-1}],tokenPrec:15201}),B3=[Hn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Hn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Hn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Hn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Hn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Hn(`try {
|
|
226
|
+
\${}
|
|
227
|
+
} catch (\${error}) {
|
|
228
|
+
\${}
|
|
229
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Hn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Hn(`if (\${}) {
|
|
230
|
+
\${}
|
|
231
|
+
} else {
|
|
232
|
+
\${}
|
|
233
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Hn(`class \${name} {
|
|
234
|
+
constructor(\${params}) {
|
|
235
|
+
\${}
|
|
236
|
+
}
|
|
237
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Hn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Hn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Qte=B3.concat([Hn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Hn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Hn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),J$=new Az,Z3=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Bu(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const Ete=["FunctionDeclaration"],$te={FunctionDeclaration:Bu("function"),ClassDeclaration:Bu("class"),ClassExpression:()=>!0,EnumDeclaration:Bu("constant"),TypeAliasDeclaration:Bu("type"),NamespaceDeclaration:Bu("namespace"),VariableDefinition(n,e){n.matchContext(Ete)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function j3(n,e){let t=J$.get(e);if(t)return t;let i=[],r=!0;function s(l,o){let c=n.sliceString(l.from,l.to);i.push({label:c,type:o})}return e.cursor(nt.IncludeAnonymous).iterate(l=>{if(r)r=!1;else if(l.name){let o=$te[l.name];if(o&&o(l,s)||Z3.has(l.name))return!1}else if(l.to-l.from>8192){for(let o of j3(n,l.node))i.push(o);return!1}}),J$.set(e,i),i}const eR=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,X3=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Rte(n){let e=yt(n.state).resolveInner(n.pos,-1);if(X3.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&eR.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)Z3.has(r.name)&&(i=i.concat(j3(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:eR}}const Lr=yc.define({name:"javascript",parser:Mte.configure({props:[Of.add({IfStatement:Xp({except:/^\s*({|else\b)/}),TryStatement:Xp({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:i9,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:n9({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Xp({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),Ec.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Nz,BlockComment(n){return{from:n.from+2,to:n.to-2}},JSXElement(n){let e=n.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=n.lastChild;return{from:e.to,to:t.type.isError?n.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(n){var e;let t=(e=n.firstChild)===null||e===void 0?void 0:e.nextSibling,i=n.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?n.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),I3={test:n=>/^JSX/.test(n.name),facet:yx({commentTokens:{block:{open:"{/*",close:"*/}"}}})},V3=Lr.configure({dialect:"ts"},"typescript"),q3=Lr.configure({dialect:"jsx",props:[bx.add(n=>n.isTop?[I3]:void 0)]}),H3=Lr.configure({dialect:"jsx ts",props:[bx.add(n=>n.isTop?[I3]:void 0)]},"typescript");let Y3=n=>({label:n,type:"keyword"});const U3="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Y3),Pte=U3.concat(["declare","implements","private","protected","public"].map(Y3));function Dte(n={}){let e=n.jsx?n.typescript?H3:q3:n.typescript?V3:Lr,t=n.typescript?Qte.concat(Pte):B3.concat(U3);return new Yh(e,[Lr.data.of({autocomplete:kF(X3,LL(t))}),Lr.data.of({autocomplete:Rte}),n.jsx?Lte:[]])}function Nte(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function tR(n,e,t=n.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}const zte=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Lte=fe.inputHandler.of((n,e,t,i,r)=>{if((zte?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Lr.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(c=>{var h;let{head:d}=c,p=yt(l).resolveInner(d-1,-1),g;if(p.name=="JSXStartTag"&&(p=p.parent),!(l.doc.sliceString(d-1,d)!=i||p.name=="JSXAttributeValue"&&p.to>d)){if(i==">"&&p.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(i=="/"&&p.name=="JSXStartCloseTag"){let O=p.parent,b=O.parent;if(b&&O.from==d-2&&((g=tR(l.doc,b.firstChild,d))||((h=b.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let v=`${g}>`;return{range:Y.cursor(d+v.length,-1),changes:{from:d,insert:v}}}}else if(i==">"){let O=Nte(p);if(O&&O.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(l.doc.sliceString(d,d+2))&&(g=tR(l.doc,O,d)))return{range:c,changes:{from:d,insert:`</${g}>`}}}}return{range:c}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Zu=["_blank","_self","_top","_parent"],Yb=["ascii","utf-8","utf-16","latin1","latin1"],Ub=["get","post","put","delete"],Wb=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],pi=["true","false"],xe={},_te={a:{attrs:{href:null,ping:null,type:null,media:null,target:Zu,hreflang:null}},abbr:xe,address:xe,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:xe,aside:xe,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:xe,base:{attrs:{href:null,target:Zu}},bdi:xe,bdo:xe,blockquote:{attrs:{cite:null}},body:xe,br:xe,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Wb,formmethod:Ub,formnovalidate:["novalidate"],formtarget:Zu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:xe,center:xe,cite:xe,code:xe,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:xe,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:xe,div:xe,dl:xe,dt:xe,em:xe,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:xe,figure:xe,footer:xe,form:{attrs:{action:null,name:null,"accept-charset":Yb,autocomplete:["on","off"],enctype:Wb,method:Ub,novalidate:["novalidate"],target:Zu}},h1:xe,h2:xe,h3:xe,h4:xe,h5:xe,h6:xe,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:xe,hgroup:xe,hr:xe,html:{attrs:{manifest:null}},i:xe,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Wb,formmethod:Ub,formnovalidate:["novalidate"],formtarget:Zu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:xe,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:xe,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:xe,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Yb,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:xe,noscript:xe,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:xe,param:{attrs:{name:null,value:null}},pre:xe,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:xe,rt:xe,ruby:xe,samp:xe,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Yb}},section:xe,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:xe,source:{attrs:{src:null,type:null,media:null}},span:xe,strong:xe,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:xe,summary:xe,sup:xe,table:xe,tbody:xe,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:xe,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:xe,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:xe,time:{attrs:{datetime:null}},title:xe,tr:xe,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:xe,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:xe},W3={accesskey:null,class:null,contenteditable:pi,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:pi,autocorrect:pi,autocapitalize:pi,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":pi,"aria-autocomplete":["inline","list","both","none"],"aria-busy":pi,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":pi,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":pi,"aria-hidden":pi,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":pi,"aria-multiselectable":pi,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":pi,"aria-relevant":null,"aria-required":pi,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},G3="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of G3)W3[n]=null;class sf{constructor(e,t){this.tags={..._te,...e},this.globalAttrs={...W3,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}sf.default=new sf;function kc(n,e,t=n.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?n.sliceString(r.from,Math.min(r.to,t)):""}function wc(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function F3(n,e,t){let i=t.tags[kc(n,wc(e))];return(i==null?void 0:i.children)||t.allTags}function Yx(n,e){let t=[];for(let i=wc(e);i&&!i.type.isTop;i=wc(i.parent)){let r=kc(n,i);if(r&&i.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(r)}return t}const K3=/^[:\-\.\w\u00b7-\uffff]*$/;function nR(n,e,t,i,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">",l=wc(t,t.name=="StartTag"||t.name=="TagName");return{from:i,to:r,options:F3(n.doc,l,e).map(o=>({label:o,type:"type"})).concat(Yx(n.doc,t).map((o,c)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function iR(n,e,t,i){let r=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:Yx(n.doc,e).map((s,l)=>({label:s,apply:s+r,type:"type",boost:99-l})),validFor:K3}}function Bte(n,e,t,i){let r=[],s=0;for(let l of F3(n.doc,t,e))r.push({label:"<"+l,type:"type"});for(let l of Yx(n.doc,t))r.push({label:"</"+l+">",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Zte(n,e,t,i,r){let s=wc(t),l=s?e.tags[kc(n.doc,s)]:null,o=l&&l.attrs?Object.keys(l.attrs):[],c=l&&l.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:c.map(h=>({label:h,type:"property"})),validFor:K3}}function jte(n,e,t,i,r){var s;let l=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],c;if(l){let h=n.sliceDoc(l.from,l.to),d=e.globalAttrs[h];if(!d){let p=wc(t),g=p?e.tags[kc(n.doc,p)]:null;d=(g==null?void 0:g.attrs)&&g.attrs[h]}if(d){let p=n.sliceDoc(i,r).toLowerCase(),g='"',O='"';/^['"]/.test(p)?(c=p[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",O=n.sliceDoc(r,r+1)==p[0]?"":p[0],p=p.slice(1),i++):c=/^[^\s<>='"]*$/;for(let b of d)o.push({label:b,apply:g+b+O,type:"constant"})}}return{from:i,to:r,options:o,validFor:c}}function J3(n,e){let{state:t,pos:i}=e,r=yt(t).resolveInner(i,-1),s=r.resolve(i);for(let l=i,o;s==r&&(o=r.childBefore(l));){let c=o.lastChild;if(!c||!c.type.isError||c.from<c.to)break;s=r=o,l=c.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?iR(t,r,r.from,i):nR(t,n,r,r.from,i):r.name=="StartTag"||r.name=="IncompleteTag"?nR(t,n,r,i,i):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?iR(t,r,i,i):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?Zte(t,n,r,r.name=="AttributeName"?r.from:i,i):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?jte(t,n,r,r.name=="Is"?i:r.from,i):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?Bte(t,n,r,i):null}function Xte(n){return J3(sf.default,n)}function Ite(n){let{extraTags:e,extraGlobalAttributes:t}=n,i=t||e?new sf(e,t):sf.default;return r=>J3(i,r)}const Vte=Lr.parser.configure({top:"SingleExpression"}),e5=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:V3.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:q3.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:H3.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:Vte},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Lr.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:mg.parser}],t5=[{name:"style",parser:mg.parser.configure({top:"Styles"})}].concat(G3.map(n=>({name:n,parser:Lr.parser}))),n5=yc.define({name:"html",parser:mee.configure({props:[Of.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let i=n.node;;){let r=i.lastChild;if(!r||r.name!="Element"||r.to!=i.to)break;e=i=r}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),Ec.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),Uz.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Hp=n5.configure({wrap:R3(e5,t5)});function qte(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=R3((n.nestedLanguages||[]).concat(e5),(n.nestedAttributes||[]).concat(t5)));let i=t?n5.configure({wrap:t,dialect:e}):e?Hp.configure({dialect:e}):Hp;return new Yh(i,[Hp.data.of({autocomplete:Ite(n)}),n.autoCloseTags!==!1?Hte:[],Dte().support,Fee().support])}const rR=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Hte=fe.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Hp.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(c=>{var h,d,p;let g=l.doc.sliceString(c.from-1,c.to)==i,{head:O}=c,b=yt(l).resolveInner(O,-1),v;if(g&&i==">"&&b.name=="EndTag"){let x=b.parent;if(((d=(h=x.parent)===null||h===void 0?void 0:h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(v=kc(l.doc,x.parent,O))&&!rR.has(v)){let k=O+(l.doc.sliceString(O,O+1)===">"?1:0),C=`</${v}>`;return{range:c,changes:{from:O,to:k,insert:C}}}}else if(g&&i=="/"&&b.name=="IncompleteCloseTag"){let x=b.parent;if(b.from==O-2&&((p=x.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(v=kc(l.doc,x,O))&&!rR.has(v)){let k=O+(l.doc.sliceString(O,O+1)===">"?1:0),C=`${v}>`;return{range:Y.cursor(O+C.length,-1),changes:{from:O,to:k,insert:C}}}}return{range:c}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),i5=yx({commentTokens:{block:{open:"<!--",close:"-->"}}}),r5=new Ne,s5=cJ.configure({props:[Ec.add(n=>!n.is("Block")||n.is("Document")||YS(n)!=null||Yte(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),r5.add(YS),Of.add({Document:()=>null}),xo.add({Document:i5})]});function YS(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function Yte(n){return n.name=="OrderedList"||n.name=="BulletList"}function Ute(n,e){let t=n;for(;;){let i=t.nextSibling,r;if(!i||(r=YS(i.type))!=null&&r<=e)break;t=i}return t.to}const Wte=Dz.of((n,e,t)=>{for(let i=yt(n).resolveInner(t,-1);i&&!(i.from<e);i=i.parent){let r=i.type.prop(r5);if(r==null)continue;let s=Ute(i,r);if(s>t)return{from:t,to:s}}return null});function Ux(n){return new ji(i5,n,[],"markdown")}const Gte=Ux(s5),Fte=s5.configure([SJ,xJ,vJ,kJ,{props:[Ec.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),gg=Ux(Fte);function Kte(n,e){return t=>{if(t&&n){let i=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?i=n(t):i=Fm.matchLanguageName(n,t,!0),i instanceof Fm)return i.support?i.support.language.parser:Hh.getSkippingParser(i.load());if(i)return i.parser}return e?e.parser:null}}class Gb{constructor(e,t,i,r,s,l,o){this.node=e,this.from=t,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=l,this.item=o}blank(e,t=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;i.length<e;)i+=" ";return i}else{for(let r=this.to-this.from-i.length-this.spaceAfter.length;r>0;r--)i+=" ";return i+(t?this.spaceAfter:"")}}marker(e,t){let i=this.node.name=="OrderedList"?String(+o5(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function l5(n,e){let t=[],i=[];for(let r=n;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],l,o=e.lineAt(s.from),c=s.from-o.from;if(s.name=="Blockquote"&&(l=/^ *>( ?)/.exec(o.text.slice(c))))i.push(new Gb(s,c,c+l[0].length,"",l[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(l=/^( *)\d+([.)])( *)/.exec(o.text.slice(c)))){let h=l[3],d=l[0].length;h.length>=4&&(h=h.slice(0,h.length-4),d-=4),i.push(new Gb(s.parent,c,c+d,l[1],h,l[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(l=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(c)))){let h=l[4],d=l[0].length;h.length>4&&(h=h.slice(0,h.length-4),d-=4);let p=l[2];l[3]&&(p+=l[3].replace(/[xX]/," ")),i.push(new Gb(s.parent,c,c+d,l[1],h,p,s))}}return i}function o5(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function Fb(n,e,t,i=0){for(let r=-1,s=n;;){if(s.name=="ListItem"){let o=o5(s,e),c=+o[2];if(r>=0){if(c!=r+1)return;t.push({from:s.from+o[1].length,to:s.from+o[0].length,insert:String(r+2+i)})}r=c}let l=s.nextSibling;if(!l)break;s=l}}function Wx(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(Qc)!=" ")return n;let i=or(n,4,t),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+n.slice(t)}const Jte=(n={})=>({state:e,dispatch:t})=>{let i=yt(e),{doc:r}=e,s=null,l=e.changeByRange(o=>{if(!o.empty||!gg.isActiveAt(e,o.from,-1)&&!gg.isActiveAt(e,o.from,1))return s={range:o};let c=o.from,h=r.lineAt(c),d=l5(i.resolveInner(c,-1),r);for(;d.length&&d[d.length-1].from>c-h.from;)d.pop();if(!d.length)return s={range:o};let p=d[d.length-1];if(p.to-p.spaceAfter.length>c-h.from)return s={range:o};let g=c>=p.to-p.spaceAfter.length&&!/\S/.test(h.text.slice(p.to));if(p.item&&g){let k=p.node.firstChild,C=p.node.getChild("ListItem","ListItem");if(k.to>=c||C&&C.to<c||h.from>0&&!/[^\s>]/.test(r.lineAt(h.from-1).text)||n.nonTightLists===!1){let A=d.length>1?d[d.length-2]:null,P,E="";A&&A.item?(P=h.from+A.from,E=A.marker(r,1)):P=h.from+(A?A.to:0);let D=[{from:P,to:c,insert:E}];return p.node.name=="OrderedList"&&Fb(p.item,r,D,-2),A&&A.node.name=="OrderedList"&&Fb(A.item,r,D),{range:Y.cursor(P+E.length),changes:D}}else{let A=lR(d,e,h);return{range:Y.cursor(c+A.length+1),changes:{from:h.from,insert:A+e.lineBreak}}}}if(p.node.name=="Blockquote"&&g&&h.from){let k=r.lineAt(h.from-1),C=/>\s*$/.exec(k.text);if(C&&C.index==p.from){let A=e.changes([{from:k.from+C.index,to:k.to},{from:h.from+p.from,to:h.to}]);return{range:o.map(A),changes:A}}}let O=[];p.node.name=="OrderedList"&&Fb(p.item,r,O);let b=p.item&&p.item.from<h.from,v="";if(!b||/^[\s\d.)\-+*>]*/.exec(h.text)[0].length>=p.to)for(let k=0,C=d.length-1;k<=C;k++)v+=k==C&&!b?d[k].marker(r,1):d[k].blank(k<C?or(h.text,4,d[k+1].from)-v.length:null);let x=c;for(;x>h.from&&/\s/.test(h.text.charAt(x-h.from-1));)x--;return v=Wx(v,e),tne(p.node,e.doc)&&(v=lR(d,e,h)+e.lineBreak+v),O.push({from:x,to:c,insert:e.lineBreak+v}),{range:Y.cursor(x+v.length+1),changes:O}});return s?!1:(t(e.update(l,{scrollIntoView:!0,userEvent:"input"})),!0)},ene=Jte();function sR(n){return n.name=="QuoteMark"||n.name=="ListMark"}function tne(n,e){if(n.name!="OrderedList"&&n.name!="BulletList")return!1;let t=n.firstChild,i=n.getChild("ListItem","ListItem");if(!i)return!1;let r=e.lineAt(t.to),s=e.lineAt(i.from),l=/^[\s>]*$/.test(r.text);return r.number+(l?0:1)<s.number}function lR(n,e,t){let i="";for(let r=0,s=n.length-2;r<=s;r++)i+=n[r].blank(r<s?or(t.text,4,n[r+1].from)-i.length:null,r<s);return Wx(i,e)}function nne(n,e){let t=n.resolveInner(e,-1),i=e;sR(t)&&(i=t.from,t=t.parent);for(let r;r=t.childBefore(i);)if(sR(r))i=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")t=r.lastChild,i=t.to;else break;return t}const ine=({state:n,dispatch:e})=>{let t=yt(n),i=null,r=n.changeByRange(s=>{let l=s.from,{doc:o}=n;if(s.empty&&gg.isActiveAt(n,s.from)){let c=o.lineAt(l),h=l5(nne(t,l),o);if(h.length){let d=h[h.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(l-c.from>p&&!/\S/.test(c.text.slice(p,l-c.from)))return{range:Y.cursor(c.from+p),changes:{from:c.from+p,to:l}};if(l-c.from==p&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let g=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let O=d.blank(or(c.text,4,d.to)-or(c.text,4,d.from));return g==c.from&&(O=Wx(O,n)),{range:Y.cursor(g+O.length),changes:{from:g,to:c.from+d.to,insert:O}}}if(g<l)return{range:Y.cursor(g),changes:{from:g,to:l}}}}}return i={range:s}});return i?!1:(e(n.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},rne=[{key:"Enter",run:ene},{key:"Backspace",run:ine}],a5=qte({matchClosingTags:!1});function sne(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:i=!0,base:{parser:r}=Gte,completeHTMLTags:s=!0,pasteURLAsLink:l=!0,htmlTagLanguage:o=a5}=n;if(!(r instanceof nO))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=n.extensions?[n.extensions]:[],h=[o.support,Wte],d;l&&h.push(cne),t instanceof Yh?(h.push(t.support),d=t.language):t&&(d=t);let p=e||d?Kte(e,d):void 0;c.push(hJ({codeParser:p,htmlParser:o.language.parser})),i&&h.push(_s.high(Ac.of(rne)));let g=Ux(r.configure(c));return s&&h.push(g.data.of({autocomplete:lne})),new Yh(g,h)}function lne(n){let{state:e,pos:t}=n,i=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!i)return null;let r=yt(e).resolveInner(t,-1);for(;r&&!r.type.isTop;){if(r.name=="CodeBlock"||r.name=="FencedCode"||r.name=="ProcessingInstructionBlock"||r.name=="CommentBlock"||r.name=="Link"||r.name=="Image")return null;r=r.parent}return{from:t-i[0].length,to:t,options:one(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Kb=null;function one(){if(Kb)return Kb;let n=Xte(new Qx(Ye.create({extensions:a5}),0,!0));return Kb=n?n.options:[]}const ane=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,cne=fe.domEventHandlers({paste:(n,e)=>{var t;let{main:i}=e.state.selection;if(i.empty)return!1;let r=(t=n.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!gg.isActiveAt(e.state,i.from,1)))return!1;let s=yt(e.state),l=!1;return s.iterate({from:i.from,to:i.to,enter:o=>{(o.from>i.from||ane.test(o.name))&&(l=!0)},leave:o=>{o.to<i.to&&(l=!0)}}),l?!1:(e.dispatch({changes:[{from:i.from,insert:"["},{from:i.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});function Gx(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ho=Gx();function c5(n){Ho=n}var xh={exec:()=>null};function it(n,e=""){let t=typeof n=="string"?n:n.source;const i={replace:(r,s)=>{let l=typeof s=="string"?s:s.source;return l=l.replace(Dn.caret,"$1"),t=t.replace(r,l),i},getRegex:()=>new RegExp(t,e)};return i}var Dn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},une=/^(?:[ \t]*(?:\n|$))+/,hne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,fne=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,kf=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,dne=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Fx=/(?:[*+-]|\d{1,9}[.)])/,u5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,h5=it(u5).replace(/bull/g,Fx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),pne=it(u5).replace(/bull/g,Fx).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Kx=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,mne=/^[^\n]+/,Jx=/(?!\s*\])(?:\\.|[^\[\]\\])+/,gne=it(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Jx).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),One=it(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Fx).getRegex(),iO="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ek=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yne=it("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ek).replace("tag",iO).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),f5=it(Kx).replace("hr",kf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",iO).getRegex(),bne=it(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",f5).getRegex(),tk={blockquote:bne,code:hne,def:gne,fences:fne,heading:dne,hr:kf,html:yne,lheading:h5,list:One,newline:une,paragraph:f5,table:xh,text:mne},oR=it("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",kf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",iO).getRegex(),Sne={...tk,lheading:pne,table:oR,paragraph:it(Kx).replace("hr",kf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",oR).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",iO).getRegex()},vne={...tk,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ek).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:xh,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(Kx).replace("hr",kf).replace("heading",` *#{1,6} *[^
|
|
238
|
+
]`).replace("lheading",h5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},xne=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kne=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,d5=/^( {2,}|\\)\n(?!\s*$)/,wne=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,rO=/[\p{P}\p{S}]/u,nk=/[\s\p{P}\p{S}]/u,p5=/[^\s\p{P}\p{S}]/u,Tne=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,nk).getRegex(),m5=/(?!~)[\p{P}\p{S}]/u,Cne=/(?!~)[\s\p{P}\p{S}]/u,Ane=/(?:[^\s\p{P}\p{S}]|~)/u,Mne=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,g5=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Qne=it(g5,"u").replace(/punct/g,rO).getRegex(),Ene=it(g5,"u").replace(/punct/g,m5).getRegex(),O5="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$ne=it(O5,"gu").replace(/notPunctSpace/g,p5).replace(/punctSpace/g,nk).replace(/punct/g,rO).getRegex(),Rne=it(O5,"gu").replace(/notPunctSpace/g,Ane).replace(/punctSpace/g,Cne).replace(/punct/g,m5).getRegex(),Pne=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,p5).replace(/punctSpace/g,nk).replace(/punct/g,rO).getRegex(),Dne=it(/\\(punct)/,"gu").replace(/punct/g,rO).getRegex(),Nne=it(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),zne=it(ek).replace("(?:-->|$)","-->").getRegex(),Lne=it("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",zne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Og=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_ne=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Og).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),y5=it(/^!?\[(label)\]\[(ref)\]/).replace("label",Og).replace("ref",Jx).getRegex(),b5=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",Jx).getRegex(),Bne=it("reflink|nolink(?!\\()","g").replace("reflink",y5).replace("nolink",b5).getRegex(),ik={_backpedal:xh,anyPunctuation:Dne,autolink:Nne,blockSkip:Mne,br:d5,code:kne,del:xh,emStrongLDelim:Qne,emStrongRDelimAst:$ne,emStrongRDelimUnd:Pne,escape:xne,link:_ne,nolink:b5,punctuation:Tne,reflink:y5,reflinkSearch:Bne,tag:Lne,text:wne,url:xh},Zne={...ik,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",Og).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Og).getRegex()},US={...ik,emStrongRDelimAst:Rne,emStrongLDelim:Ene,url:it(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},jne={...US,br:it(d5).replace("{2,}","*").getRegex(),text:it(US.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ap={normal:tk,gfm:Sne,pedantic:vne},ju={normal:ik,gfm:US,breaks:jne,pedantic:Zne},Xne={"&":"&","<":"<",">":">",'"':""","'":"'"},aR=n=>Xne[n];function kr(n,e){if(e){if(Dn.escapeTest.test(n))return n.replace(Dn.escapeReplace,aR)}else if(Dn.escapeTestNoEncode.test(n))return n.replace(Dn.escapeReplaceNoEncode,aR);return n}function cR(n){try{n=encodeURI(n).replace(Dn.percentDecode,"%")}catch{return null}return n}function uR(n,e){var s;const t=n.replace(Dn.findPipe,(l,o,c)=>{let h=!1,d=o;for(;--d>=0&&c[d]==="\\";)h=!h;return h?"|":" |"}),i=t.split(Dn.splitPipe);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(Dn.slashPipe,"|");return i}function Xu(n,e,t){const i=n.length;if(i===0)return"";let r=0;for(;r<i&&n.charAt(i-r-1)===e;)r++;return n.slice(0,i-r)}function Ine(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let i=0;i<n.length;i++)if(n[i]==="\\")i++;else if(n[i]===e[0])t++;else if(n[i]===e[1]&&(t--,t<0))return i;return t>0?-2:-1}function hR(n,e,t,i,r){const s=e.href,l=e.title||null,o=n[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;const c={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:l,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,c}function Vne(n,e,t){const i=n.match(t.other.indentCodeCompensation);if(i===null)return e;const r=i[1];return e.split(`
|
|
239
|
+
`).map(s=>{const l=s.match(t.other.beginningSpace);if(l===null)return s;const[o]=l;return o.length>=r.length?s.slice(r.length):s}).join(`
|
|
240
|
+
`)}var yg=class{constructor(n){dt(this,"options");dt(this,"rules");dt(this,"lexer");this.options=n||Ho}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:Xu(t,`
|
|
241
|
+
`)}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],i=Vne(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const i=Xu(t,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(t=i.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:Xu(e[0],`
|
|
242
|
+
`)}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=Xu(e[0],`
|
|
243
|
+
`).split(`
|
|
244
|
+
`),i="",r="";const s=[];for(;t.length>0;){let l=!1;const o=[];let c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))o.push(t[c]),l=!0;else if(!l)o.push(t[c]);else break;t=t.slice(c);const h=o.join(`
|
|
245
|
+
`),d=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
246
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
247
|
+
${h}`:h,r=r?`${r}
|
|
248
|
+
${d}`:d;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=p,t.length===0)break;const g=s.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const O=g,b=O.raw+`
|
|
249
|
+
`+t.join(`
|
|
250
|
+
`),v=this.blockquote(b);s[s.length-1]=v,i=i.substring(0,i.length-O.raw.length)+v.raw,r=r.substring(0,r.length-O.text.length)+v.text;break}else if((g==null?void 0:g.type)==="list"){const O=g,b=O.raw+`
|
|
251
|
+
`+t.join(`
|
|
252
|
+
`),v=this.list(b);s[s.length-1]=v,i=i.substring(0,i.length-g.raw.length)+v.raw,r=r.substring(0,r.length-O.raw.length)+v.raw,t=b.substring(s.at(-1).raw.length).split(`
|
|
253
|
+
`);continue}}return{type:"blockquote",raw:i,tokens:s,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const i=t.length>1,r={type:"list",raw:"",ordered:i,start:i?+t.slice(0,-1):"",loose:!1,items:[]};t=i?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=i?t:"[*+-]");const s=this.rules.other.listItemRegex(t);let l=!1;for(;n;){let c=!1,h="",d="";if(!(e=s.exec(n))||this.rules.block.hr.test(n))break;h=e[0],n=n.substring(h.length);let p=e[2].split(`
|
|
254
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,k=>" ".repeat(3*k.length)),g=n.split(`
|
|
255
|
+
`,1)[0],O=!p.trim(),b=0;if(this.options.pedantic?(b=2,d=p.trimStart()):O?b=e[1].length+1:(b=e[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,d=p.slice(b),b+=e[1].length),O&&this.rules.other.blankLine.test(g)&&(h+=g+`
|
|
256
|
+
`,n=n.substring(g.length+1),c=!0),!c){const k=this.rules.other.nextBulletRegex(b),C=this.rules.other.hrRegex(b),A=this.rules.other.fencesBeginRegex(b),P=this.rules.other.headingBeginRegex(b),E=this.rules.other.htmlBeginRegex(b);for(;n;){const D=n.split(`
|
|
257
|
+
`,1)[0];let $;if(g=D,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),$=g):$=g.replace(this.rules.other.tabCharGlobal," "),A.test(g)||P.test(g)||E.test(g)||k.test(g)||C.test(g))break;if($.search(this.rules.other.nonSpaceChar)>=b||!g.trim())d+=`
|
|
258
|
+
`+$.slice(b);else{if(O||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(p)||P.test(p)||C.test(p))break;d+=`
|
|
259
|
+
`+g}!O&&!g.trim()&&(O=!0),h+=D+`
|
|
260
|
+
`,n=n.substring(D.length+1),p=$.slice(b)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0));let v=null,x;this.options.gfm&&(v=this.rules.other.listIsTask.exec(d),v&&(x=v[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:h,task:!!v,checked:x,loose:!1,text:d,tokens:[]}),r.raw+=h}const o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){const h=r.items[c].tokens.filter(p=>p.type==="space"),d=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));r.loose=d}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:i,title:r}}}table(n){var l;const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=uR(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(l=e[3])!=null&&l.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
261
|
+
`):[],s={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===i.length){for(const o of i)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<t.length;o++)s.header.push({text:t[o],tokens:this.lexer.inline(t[o]),header:!0,align:s.align[o]});for(const o of r)s.rows.push(uR(o,s.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[h]})));return s}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t=e[1].charAt(e[1].length-1)===`
|
|
262
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const s=Xu(t.slice(0,-1),"\\");if((t.length-s.length)%2===0)return}else{const s=Ine(e[2],"()");if(s===-2)return;if(s>-1){const o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let i=e[2],r="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(i);s&&(i=s[1],r=s[3])}else r=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?i=i.slice(1):i=i.slice(1,-1)),hR(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const i=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[i.toLowerCase()];if(!r){const s=t[0].charAt(0);return{type:"text",raw:s,text:s}}return hR(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let i=this.rules.inline.emStrongLDelim.exec(n);if(!i||i[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const s=[...i[0]].length-1;let l,o,c=s,h=0;const d=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,e=e.slice(-1*n.length+s);(i=d.exec(e))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(o=[...l].length,i[3]||i[4]){c+=o;continue}else if((i[5]||i[6])&&s%3&&!((s+o)%3)){h+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+h);const p=[...i[0]][0].length,g=n.slice(0,s+i.index+p+o);if(Math.min(s,o)%2){const b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}const O=g.slice(2,-2);return{type:"strong",raw:g,text:O,tokens:this.lexer.inlineTokens(O)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return i&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,i;return e[2]==="@"?(t=e[1],i="mailto:"+t):(t=e[1],i=t),{type:"link",raw:e[0],text:t,href:i,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let i,r;if(e[2]==="@")i=e[0],r="mailto:"+i;else{let s;do s=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(s!==e[0]);i=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},ws=class WS{constructor(e){dt(this,"tokens");dt(this,"options");dt(this,"state");dt(this,"tokenizer");dt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ho,this.options.tokenizer=this.options.tokenizer||new yg,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:Dn,block:Ap.normal,inline:ju.normal};this.options.pedantic?(t.block=Ap.pedantic,t.inline=ju.pedantic):this.options.gfm&&(t.block=Ap.gfm,this.options.breaks?t.inline=ju.breaks:t.inline=ju.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ap,inline:ju}}static lex(e,t){return new WS(t).lex(e)}static lexInline(e,t){return new WS(t).inlineTokens(e)}lex(e){e=e.replace(Dn.carriageReturn,`
|
|
263
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const i=this.inlineQueue[t];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],i=!1){var r,s,l;for(this.options.pedantic&&(e=e.replace(Dn.tabCharGlobal," ").replace(Dn.spaceLine,""));e;){let o;if((s=(r=this.options.extensions)==null?void 0:r.block)!=null&&s.some(h=>(o=h.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);const h=t.at(-1);o.raw.length===1&&h!==void 0?h.raw+=`
|
|
264
|
+
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);const h=t.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=`
|
|
265
|
+
`+o.raw,h.text+=`
|
|
266
|
+
`+o.text,this.inlineQueue.at(-1).src=h.text):t.push(o);continue}if(o=this.tokenizer.fences(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.heading(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.hr(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.blockquote(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.list(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.html(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.def(e)){e=e.substring(o.raw.length);const h=t.at(-1);(h==null?void 0:h.type)==="paragraph"||(h==null?void 0:h.type)==="text"?(h.raw+=`
|
|
267
|
+
`+o.raw,h.text+=`
|
|
268
|
+
`+o.raw,this.inlineQueue.at(-1).src=h.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.lheading(e)){e=e.substring(o.raw.length),t.push(o);continue}let c=e;if((l=this.options.extensions)!=null&&l.startBlock){let h=1/0;const d=e.slice(1);let p;this.options.extensions.startBlock.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(c=e.substring(0,h+1))}if(this.state.top&&(o=this.tokenizer.paragraph(c))){const h=t.at(-1);i&&(h==null?void 0:h.type)==="paragraph"?(h.raw+=`
|
|
269
|
+
`+o.raw,h.text+=`
|
|
270
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):t.push(o),i=c.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);const h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=`
|
|
271
|
+
`+o.raw,h.text+=`
|
|
272
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=h.text):t.push(o);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var o,c,h;let i=e,r=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,r.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,l="";for(;e;){s||(l=""),s=!1;let d;if((c=(o=this.options.extensions)==null?void 0:o.inline)!=null&&c.some(g=>(d=g.call({lexer:this},e,t))?(e=e.substring(d.raw.length),t.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);const g=t.at(-1);d.type==="text"&&(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):t.push(d);continue}if(d=this.tokenizer.emStrong(e,i,l)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.del(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),t.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),t.push(d);continue}let p=e;if((h=this.options.extensions)!=null&&h.startInline){let g=1/0;const O=e.slice(1);let b;this.options.extensions.startInline.forEach(v=>{b=v.call({lexer:this},O),typeof b=="number"&&b>=0&&(g=Math.min(g,b))}),g<1/0&&g>=0&&(p=e.substring(0,g+1))}if(d=this.tokenizer.inlineText(p)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(l=d.raw.slice(-1)),s=!0;const g=t.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=d.raw,g.text+=d.text):t.push(d);continue}if(e){const g="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(g);break}else throw new Error(g)}}return t}},bg=class{constructor(n){dt(this,"options");dt(this,"parser");this.options=n||Ho}space(n){return""}code({text:n,lang:e,escaped:t}){var s;const i=(s=(e||"").match(Dn.notSpaceStart))==null?void 0:s[0],r=n.replace(Dn.endingNewline,"")+`
|
|
273
|
+
`;return i?'<pre><code class="language-'+kr(i)+'">'+(t?r:kr(r,!0))+`</code></pre>
|
|
274
|
+
`:"<pre><code>"+(t?r:kr(r,!0))+`</code></pre>
|
|
275
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
276
|
+
${this.parser.parse(n)}</blockquote>
|
|
277
|
+
`}html({text:n}){return n}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
278
|
+
`}hr(n){return`<hr>
|
|
279
|
+
`}list(n){const e=n.ordered,t=n.start;let i="";for(let l=0;l<n.items.length;l++){const o=n.items[l];i+=this.listitem(o)}const r=e?"ol":"ul",s=e&&t!==1?' start="'+t+'"':"";return"<"+r+s+`>
|
|
280
|
+
`+i+"</"+r+`>
|
|
281
|
+
`}listitem(n){var t;let e="";if(n.task){const i=this.checkbox({checked:!!n.checked});n.loose?((t=n.tokens[0])==null?void 0:t.type)==="paragraph"?(n.tokens[0].text=i+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=i+" "+kr(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):e+=i+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
|
|
282
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
283
|
+
`}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let i="";for(let r=0;r<n.rows.length;r++){const s=n.rows[r];t="";for(let l=0;l<s.length;l++)t+=this.tablecell(s[l]);i+=this.tablerow({text:t})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
284
|
+
<thead>
|
|
285
|
+
`+e+`</thead>
|
|
286
|
+
`+i+`</table>
|
|
287
|
+
`}tablerow({text:n}){return`<tr>
|
|
288
|
+
${n}</tr>
|
|
289
|
+
`}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
290
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${kr(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const i=this.parser.parseInline(t),r=cR(n);if(r===null)return i;n=r;let s='<a href="'+n+'"';return e&&(s+=' title="'+kr(e)+'"'),s+=">"+i+"</a>",s}image({href:n,title:e,text:t,tokens:i}){i&&(t=this.parser.parseInline(i,this.parser.textRenderer));const r=cR(n);if(r===null)return kr(t);n=r;let s=`<img src="${n}" alt="${t}"`;return e&&(s+=` title="${kr(e)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:kr(n.text)}},rk=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Ts=class GS{constructor(e){dt(this,"options");dt(this,"renderer");dt(this,"textRenderer");this.options=e||Ho,this.options.renderer=this.options.renderer||new bg,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rk}static parse(e,t){return new GS(t).parse(e)}static parseInline(e,t){return new GS(t).parseInline(e)}parse(e,t=!0){var r,s;let i="";for(let l=0;l<e.length;l++){const o=e[l];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[o.type]){const h=o,d=this.options.extensions.renderers[h.type].call({parser:this},h);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(h.type)){i+=d||"";continue}}const c=o;switch(c.type){case"space":{i+=this.renderer.space(c);continue}case"hr":{i+=this.renderer.hr(c);continue}case"heading":{i+=this.renderer.heading(c);continue}case"code":{i+=this.renderer.code(c);continue}case"table":{i+=this.renderer.table(c);continue}case"blockquote":{i+=this.renderer.blockquote(c);continue}case"list":{i+=this.renderer.list(c);continue}case"html":{i+=this.renderer.html(c);continue}case"paragraph":{i+=this.renderer.paragraph(c);continue}case"text":{let h=c,d=this.renderer.text(h);for(;l+1<e.length&&e[l+1].type==="text";)h=e[++l],d+=`
|
|
291
|
+
`+this.renderer.text(h);t?i+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):i+=d;continue}default:{const h='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}parseInline(e,t=this.renderer){var r,s;let i="";for(let l=0;l<e.length;l++){const o=e[l];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[o.type]){const h=this.options.extensions.renderers[o.type].call({parser:this},o);if(h!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){i+=h||"";continue}}const c=o;switch(c.type){case"escape":{i+=t.text(c);break}case"html":{i+=t.html(c);break}case"link":{i+=t.link(c);break}case"image":{i+=t.image(c);break}case"strong":{i+=t.strong(c);break}case"em":{i+=t.em(c);break}case"codespan":{i+=t.codespan(c);break}case"br":{i+=t.br(c);break}case"del":{i+=t.del(c);break}case"text":{i+=t.text(c);break}default:{const h='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(h),"";throw new Error(h)}}}return i}},i1,Yp=(i1=class{constructor(n){dt(this,"options");dt(this,"block");this.options=n||Ho}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?ws.lex:ws.lexInline}provideParser(){return this.block?Ts.parse:Ts.parseInline}},dt(i1,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),i1),qne=class{constructor(...n){dt(this,"defaults",Gx());dt(this,"options",this.setOptions);dt(this,"parse",this.parseMarkdown(!0));dt(this,"parseInline",this.parseMarkdown(!1));dt(this,"Parser",Ts);dt(this,"Renderer",bg);dt(this,"TextRenderer",rk);dt(this,"Lexer",ws);dt(this,"Tokenizer",yg);dt(this,"Hooks",Yp);this.use(...n)}walkTokens(n,e){var i,r;let t=[];for(const s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{const l=s;for(const o of l.header)t=t.concat(this.walkTokens(o.tokens,e));for(const o of l.rows)for(const c of o)t=t.concat(this.walkTokens(c.tokens,e));break}case"list":{const l=s;t=t.concat(this.walkTokens(l.items,e));break}default:{const l=s;(r=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&r[l.type]?this.defaults.extensions.childTokens[l.type].forEach(o=>{const c=l[o].flat(1/0);t=t.concat(this.walkTokens(c,e))}):l.tokens&&(t=t.concat(this.walkTokens(l.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const i={...t};if(i.async=this.defaults.async||i.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const s=e.renderers[r.name];s?e.renderers[r.name]=function(...l){let o=r.renderer.apply(this,l);return o===!1&&(o=s.apply(this,l)),o}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=e[r.level];s?s.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),i.extensions=e),t.renderer){const r=this.defaults.renderer||new bg(this.defaults);for(const s in t.renderer){if(!(s in r))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const l=s,o=t.renderer[l],c=r[l];r[l]=(...h)=>{let d=o.apply(r,h);return d===!1&&(d=c.apply(r,h)),d||""}}i.renderer=r}if(t.tokenizer){const r=this.defaults.tokenizer||new yg(this.defaults);for(const s in t.tokenizer){if(!(s in r))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const l=s,o=t.tokenizer[l],c=r[l];r[l]=(...h)=>{let d=o.apply(r,h);return d===!1&&(d=c.apply(r,h)),d}}i.tokenizer=r}if(t.hooks){const r=this.defaults.hooks||new Yp;for(const s in t.hooks){if(!(s in r))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const l=s,o=t.hooks[l],c=r[l];Yp.passThroughHooks.has(s)?r[l]=h=>{if(this.defaults.async)return Promise.resolve(o.call(r,h)).then(p=>c.call(r,p));const d=o.call(r,h);return c.call(r,d)}:r[l]=(...h)=>{let d=o.apply(r,h);return d===!1&&(d=c.apply(r,h)),d}}i.hooks=r}if(t.walkTokens){const r=this.defaults.walkTokens,s=t.walkTokens;i.walkTokens=function(l){let o=[];return o.push(s.call(this,l)),r&&(o=o.concat(r.call(this,l))),o}}this.defaults={...this.defaults,...i}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return ws.lex(n,e??this.defaults)}parser(n,e){return Ts.parse(n,e??this.defaults)}parseMarkdown(n){return(t,i)=>{const r={...i},s={...this.defaults,...r},l=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=n);const o=s.hooks?s.hooks.provideLexer():n?ws.lex:ws.lexInline,c=s.hooks?s.hooks.provideParser():n?Ts.parse:Ts.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then(h=>o(h,s)).then(h=>s.hooks?s.hooks.processAllTokens(h):h).then(h=>s.walkTokens?Promise.all(this.walkTokens(h,s.walkTokens)).then(()=>h):h).then(h=>c(h,s)).then(h=>s.hooks?s.hooks.postprocess(h):h).catch(l);try{s.hooks&&(t=s.hooks.preprocess(t));let h=o(t,s);s.hooks&&(h=s.hooks.processAllTokens(h)),s.walkTokens&&this.walkTokens(h,s.walkTokens);let d=c(h,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(h){return l(h)}}}onError(n,e){return t=>{if(t.message+=`
|
|
292
|
+
Please report this to https://github.com/markedjs/marked.`,n){const i="<p>An error occurred:</p><pre>"+kr(t.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(t);throw t}}},Xo=new qne;function lt(n,e){return Xo.parse(n,e)}lt.options=lt.setOptions=function(n){return Xo.setOptions(n),lt.defaults=Xo.defaults,c5(lt.defaults),lt};lt.getDefaults=Gx;lt.defaults=Ho;lt.use=function(...n){return Xo.use(...n),lt.defaults=Xo.defaults,c5(lt.defaults),lt};lt.walkTokens=function(n,e){return Xo.walkTokens(n,e)};lt.parseInline=Xo.parseInline;lt.Parser=Ts;lt.parser=Ts.parse;lt.Renderer=bg;lt.TextRenderer=rk;lt.Lexer=ws;lt.lexer=ws.lex;lt.Tokenizer=yg;lt.Hooks=Yp;lt.parse=lt;lt.options;lt.setOptions;lt.use;lt.walkTokens;lt.parseInline;Ts.parse;ws.lex;function Hne(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n}function FS(n,e){return Array(e+1).join(n)}function S5(n){return n.replace(/^\n*/,"")}function v5(n){for(var e=n.length;e>0&&n[e-1]===`
|
|
293
|
+
`;)e--;return n.substring(0,e)}function x5(n){return v5(S5(n))}var Yne=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function sk(n){return lk(n,Yne)}var k5=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function w5(n){return lk(n,k5)}function Une(n){return C5(n,k5)}var T5=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Wne(n){return lk(n,T5)}function Gne(n){return C5(n,T5)}function lk(n,e){return e.indexOf(n.nodeName)>=0}function C5(n,e){return n.getElementsByTagName&&e.some(function(t){return n.getElementsByTagName(t).length})}var Fne=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function A5(n){return Fne.reduce(function(e,t){return e.replace(t[0],t[1])},n)}var Qn={};Qn.paragraph={filter:"p",replacement:function(n){return`
|
|
294
|
+
|
|
295
|
+
`+n+`
|
|
296
|
+
|
|
297
|
+
`}};Qn.lineBreak={filter:"br",replacement:function(n,e,t){return t.br+`
|
|
298
|
+
`}};Qn.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(n,e,t){var i=Number(e.nodeName.charAt(1));if(t.headingStyle==="setext"&&i<3){var r=FS(i===1?"=":"-",n.length);return`
|
|
299
|
+
|
|
300
|
+
`+n+`
|
|
301
|
+
`+r+`
|
|
302
|
+
|
|
303
|
+
`}else return`
|
|
304
|
+
|
|
305
|
+
`+FS("#",i)+" "+n+`
|
|
306
|
+
|
|
307
|
+
`}};Qn.blockquote={filter:"blockquote",replacement:function(n){return n=x5(n).replace(/^/gm,"> "),`
|
|
308
|
+
|
|
309
|
+
`+n+`
|
|
310
|
+
|
|
311
|
+
`}};Qn.list={filter:["ul","ol"],replacement:function(n,e){var t=e.parentNode;return t.nodeName==="LI"&&t.lastElementChild===e?`
|
|
312
|
+
`+n:`
|
|
313
|
+
|
|
314
|
+
`+n+`
|
|
315
|
+
|
|
316
|
+
`}};Qn.listItem={filter:"li",replacement:function(n,e,t){var i=t.bulletListMarker+" ",r=e.parentNode;if(r.nodeName==="OL"){var s=r.getAttribute("start"),l=Array.prototype.indexOf.call(r.children,e);i=(s?Number(s)+l:l+1)+". "}var o=/\n$/.test(n);return n=x5(n)+(o?`
|
|
317
|
+
`:""),n=n.replace(/\n/gm,`
|
|
318
|
+
`+" ".repeat(i.length)),i+n+(e.nextSibling?`
|
|
319
|
+
`:"")}};Qn.indentedCodeBlock={filter:function(n,e){return e.codeBlockStyle==="indented"&&n.nodeName==="PRE"&&n.firstChild&&n.firstChild.nodeName==="CODE"},replacement:function(n,e,t){return`
|
|
320
|
+
|
|
321
|
+
`+e.firstChild.textContent.replace(/\n/g,`
|
|
322
|
+
`)+`
|
|
323
|
+
|
|
324
|
+
`}};Qn.fencedCodeBlock={filter:function(n,e){return e.codeBlockStyle==="fenced"&&n.nodeName==="PRE"&&n.firstChild&&n.firstChild.nodeName==="CODE"},replacement:function(n,e,t){for(var i=e.firstChild.getAttribute("class")||"",r=(i.match(/language-(\S+)/)||[null,""])[1],s=e.firstChild.textContent,l=t.fence.charAt(0),o=3,c=new RegExp("^"+l+"{3,}","gm"),h;h=c.exec(s);)h[0].length>=o&&(o=h[0].length+1);var d=FS(l,o);return`
|
|
325
|
+
|
|
326
|
+
`+d+r+`
|
|
327
|
+
`+s.replace(/\n$/,"")+`
|
|
328
|
+
`+d+`
|
|
329
|
+
|
|
330
|
+
`}};Qn.horizontalRule={filter:"hr",replacement:function(n,e,t){return`
|
|
331
|
+
|
|
332
|
+
`+t.hr+`
|
|
333
|
+
|
|
334
|
+
`}};Qn.inlineLink={filter:function(n,e){return e.linkStyle==="inlined"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e){var t=ok(e.getAttribute("href")),i=ak(Sg(e.getAttribute("title"))),r=i?' "'+i+'"':"";return"["+n+"]("+t+r+")"}};Qn.referenceLink={filter:function(n,e){return e.linkStyle==="referenced"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e,t){var i=ok(e.getAttribute("href")),r=Sg(e.getAttribute("title"));r&&(r=' "'+ak(r)+'"');var s,l;switch(t.linkReferenceStyle){case"collapsed":s="["+n+"][]",l="["+n+"]: "+i+r;break;case"shortcut":s="["+n+"]",l="["+n+"]: "+i+r;break;default:var o=this.references.length+1;s="["+n+"]["+o+"]",l="["+o+"]: "+i+r}return this.references.push(l),s},references:[],append:function(n){var e="";return this.references.length&&(e=`
|
|
335
|
+
|
|
336
|
+
`+this.references.join(`
|
|
337
|
+
`)+`
|
|
338
|
+
|
|
339
|
+
`,this.references=[]),e}};Qn.emphasis={filter:["em","i"],replacement:function(n,e,t){return n.trim()?t.emDelimiter+n+t.emDelimiter:""}};Qn.strong={filter:["strong","b"],replacement:function(n,e,t){return n.trim()?t.strongDelimiter+n+t.strongDelimiter:""}};Qn.code={filter:function(n){var e=n.previousSibling||n.nextSibling,t=n.parentNode.nodeName==="PRE"&&!e;return n.nodeName==="CODE"&&!t},replacement:function(n){if(!n)return"";n=n.replace(/\r?\n|\r/g," ");for(var e=/^`|^ .*?[^ ].* $|`$/.test(n)?" ":"",t="`",i=n.match(/`+/gm)||[];i.indexOf(t)!==-1;)t=t+"`";return t+e+n+e+t}};Qn.image={filter:"img",replacement:function(n,e){var t=A5(Sg(e.getAttribute("alt"))),i=ok(e.getAttribute("src")||""),r=Sg(e.getAttribute("title")),s=r?' "'+ak(r)+'"':"";return i?"":""}};function Sg(n){return n?n.replace(/(\n+\s*)+/g,`
|
|
340
|
+
`):""}function ok(n){var e=n.replace(/([<>()])/g,"\\$1");return e.indexOf(" ")>=0?"<"+e+">":e}function ak(n){return n.replace(/"/g,'\\"')}function M5(n){this.options=n,this._keep=[],this._remove=[],this.blankRule={replacement:n.blankReplacement},this.keepReplacement=n.keepReplacement,this.defaultRule={replacement:n.defaultReplacement},this.array=[];for(var e in n.rules)this.array.push(n.rules[e])}M5.prototype={add:function(n,e){this.array.unshift(e)},keep:function(n){this._keep.unshift({filter:n,replacement:this.keepReplacement})},remove:function(n){this._remove.unshift({filter:n,replacement:function(){return""}})},forNode:function(n){if(n.isBlank)return this.blankRule;var e;return(e=Jb(this.array,n,this.options))||(e=Jb(this._keep,n,this.options))||(e=Jb(this._remove,n,this.options))?e:this.defaultRule},forEach:function(n){for(var e=0;e<this.array.length;e++)n(this.array[e],e)}};function Jb(n,e,t){for(var i=0;i<n.length;i++){var r=n[i];if(Kne(r,e,t))return r}}function Kne(n,e,t){var i=n.filter;if(typeof i=="string"){if(i===e.nodeName.toLowerCase())return!0}else if(Array.isArray(i)){if(i.indexOf(e.nodeName.toLowerCase())>-1)return!0}else if(typeof i=="function"){if(i.call(n,e,t))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Jne(n){var e=n.element,t=n.isBlock,i=n.isVoid,r=n.isPre||function(p){return p.nodeName==="PRE"};if(!(!e.firstChild||r(e))){for(var s=null,l=!1,o=null,c=fR(o,e,r);c!==e;){if(c.nodeType===3||c.nodeType===4){var h=c.data.replace(/[ \r\n\t]+/g," ");if((!s||/ $/.test(s.data))&&!l&&h[0]===" "&&(h=h.substr(1)),!h){c=e1(c);continue}c.data=h,s=c}else if(c.nodeType===1)t(c)||c.nodeName==="BR"?(s&&(s.data=s.data.replace(/ $/,"")),s=null,l=!1):i(c)||r(c)?(s=null,l=!0):s&&(l=!1);else{c=e1(c);continue}var d=fR(o,c,r);o=c,c=d}s&&(s.data=s.data.replace(/ $/,""),s.data||e1(s))}}function e1(n){var e=n.nextSibling||n.parentNode;return n.parentNode.removeChild(n),e}function fR(n,e,t){return n&&n.parentNode===e||t(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}var ck=typeof window<"u"?window:{};function eie(){var n=ck.DOMParser,e=!1;try{new n().parseFromString("","text/html")&&(e=!0)}catch{}return e}function tie(){var n=function(){};return nie()?n.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:n.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},n}function nie(){var n=!1;try{document.implementation.createHTMLDocument("").open()}catch{ck.ActiveXObject&&(n=!0)}return n}var iie=eie()?ck.DOMParser:tie();function rie(n,e){var t;if(typeof n=="string"){var i=sie().parseFromString('<x-turndown id="turndown-root">'+n+"</x-turndown>","text/html");t=i.getElementById("turndown-root")}else t=n.cloneNode(!0);return Jne({element:t,isBlock:sk,isVoid:w5,isPre:e.preformattedCode?lie:null}),t}var t1;function sie(){return t1=t1||new iie,t1}function lie(n){return n.nodeName==="PRE"||n.nodeName==="CODE"}function oie(n,e){return n.isBlock=sk(n),n.isCode=n.nodeName==="CODE"||n.parentNode.isCode,n.isBlank=aie(n),n.flankingWhitespace=cie(n,e),n}function aie(n){return!w5(n)&&!Wne(n)&&/^\s*$/i.test(n.textContent)&&!Une(n)&&!Gne(n)}function cie(n,e){if(n.isBlock||e.preformattedCode&&n.isCode)return{leading:"",trailing:""};var t=uie(n.textContent);return t.leadingAscii&&dR("left",n,e)&&(t.leading=t.leadingNonAscii),t.trailingAscii&&dR("right",n,e)&&(t.trailing=t.trailingNonAscii),{leading:t.leading,trailing:t.trailing}}function uie(n){var e=n.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:e[1],leadingAscii:e[2],leadingNonAscii:e[3],trailing:e[4],trailingNonAscii:e[5],trailingAscii:e[6]}}function dR(n,e,t){var i,r,s;return n==="left"?(i=e.previousSibling,r=/ $/):(i=e.nextSibling,r=/^ /),i&&(i.nodeType===3?s=r.test(i.nodeValue):t.preformattedCode&&i.nodeName==="CODE"?s=!1:i.nodeType===1&&!sk(i)&&(s=r.test(i.textContent))),s}var hie=Array.prototype.reduce;function vg(n){if(!(this instanceof vg))return new vg(n);var e={rules:Qn,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(t,i){return i.isBlock?`
|
|
341
|
+
|
|
342
|
+
`:""},keepReplacement:function(t,i){return i.isBlock?`
|
|
343
|
+
|
|
344
|
+
`+i.outerHTML+`
|
|
345
|
+
|
|
346
|
+
`:i.outerHTML},defaultReplacement:function(t,i){return i.isBlock?`
|
|
347
|
+
|
|
348
|
+
`+t+`
|
|
349
|
+
|
|
350
|
+
`:t}};this.options=Hne({},e,n),this.rules=new M5(this.options)}vg.prototype={turndown:function(n){if(!pie(n))throw new TypeError(n+" is not a string, or an element/document/fragment node.");if(n==="")return"";var e=Q5.call(this,new rie(n,this.options));return fie.call(this,e)},use:function(n){if(Array.isArray(n))for(var e=0;e<n.length;e++)this.use(n[e]);else if(typeof n=="function")n(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(n,e){return this.rules.add(n,e),this},keep:function(n){return this.rules.keep(n),this},remove:function(n){return this.rules.remove(n),this},escape:function(n){return A5(n)}};function Q5(n){var e=this;return hie.call(n.childNodes,function(t,i){i=new oie(i,e.options);var r="";return i.nodeType===3?r=i.isCode?i.nodeValue:e.escape(i.nodeValue):i.nodeType===1&&(r=die.call(e,i)),E5(t,r)},"")}function fie(n){var e=this;return this.rules.forEach(function(t){typeof t.append=="function"&&(n=E5(n,t.append(e.options)))}),n.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function die(n){var e=this.rules.forNode(n),t=Q5.call(this,n),i=n.flankingWhitespace;return(i.leading||i.trailing)&&(t=t.trim()),i.leading+e.replacement(t,n,this.options)+i.trailing}function E5(n,e){var t=v5(n),i=S5(e),r=Math.max(n.length-t.length,e.length-i.length),s=`
|
|
351
|
+
|
|
352
|
+
`.substring(0,r);return t+s+i}function pie(n){return n!=null&&(typeof n=="string"||n.nodeType&&(n.nodeType===1||n.nodeType===9||n.nodeType===11))}const mie="0.6.0",lf=new vg({headingStyle:"atx",bulletListMarker:"-",codeBlockStyle:"fenced"});function gie(n){return String(n||"").replace(/\n+/g," ").replace(/\|/g,"\\|").trim()}lf.addRule("gfmStrike",{filter:["del","s","strike"],replacement(n){return`~~${n}~~`}});lf.addRule("gfmTaskItem",{filter(n){return n.nodeName==="LI"&&(n.getAttribute("data-type")==="taskItem"||n.hasAttribute("data-checked"))},replacement(n,e){return`- [${e.getAttribute("data-checked")==="true"?"x":" "}] ${n.replace(/\n+/g," ").trim()}
|
|
353
|
+
`}});lf.addRule("gfmTable",{filter:"table",replacement(n,e){const t=Array.from(e.querySelectorAll("tr"));if(!t.length)return"";const i=t.map(p=>Array.from(p.children).filter(g=>g.matches("th,td")).map(g=>gie(lf.turndown(g.innerHTML)))).filter(p=>p.length);if(!i.length)return"";const r=Math.max(...i.map(p=>p.length)),s=i.map(p=>Array.from({length:r},(g,O)=>p[O]||" ")),l=s[0],o=s.slice(1),c=`| ${l.join(" | ")} |`,h=`| ${Array.from({length:r},()=>"---").join(" | ")} |`,d=o.map(p=>`| ${p.join(" | ")} |`);return`
|
|
354
|
+
|
|
355
|
+
${[c,h,...d].join(`
|
|
356
|
+
`)}
|
|
357
|
+
|
|
358
|
+
`}});const Iu=5e4,Yn={nextId:1,pending:new Map,call(n,e={}){const t=this.nextId++,i={id:t,method:n,params:e};return new Promise((r,s)=>{var l;this.pending.set(t,{resolve:r,reject:s}),(l=window.chrome)!=null&&l.webview?window.chrome.webview.postMessage(i):s(new Error("Native bridge is not available."))})}};var mR;(mR=window.chrome)!=null&&mR.webview&&window.chrome.webview.addEventListener("message",n=>{const e=n.data,t=Yn.pending.get(e.id);t&&(Yn.pending.delete(e.id),e.ok?t.resolve(e.result):t.reject(new Error(e.error||"Native bridge failed.")))});function th(n){return lt.parse(n||"",{gfm:!0,breaks:!1})}function pR(n){return lf.turndown(n||"")}function n1(n,e,t,i,r=i){const s=n.lastIndexOf(i,Math.max(0,e-1));if(s<0)return null;const l=n.indexOf(r,Math.max(t,s+i.length));return l<0||e<s+i.length||t>l||i==="*"&&(n[s-1]==="*"||n[s+1]==="*"||n[l-1]==="*"||n[l+1]==="*")||i==="`"&&n.slice(s+i.length,l).includes(`
|
|
359
|
+
`)?null:{open:s,close:l}}function Oie({markdown:n,formatLabel:e,pageAreaRef:t,onScroll:i}){const r=$e.useDeferredValue(n),s=$e.useMemo(()=>th(r),[r]);return _.jsx("section",{className:"page-area",ref:t,onScroll:i,children:_.jsxs("article",{className:"page readonly-preview",children:[_.jsx("p",{className:"page-label",children:e==="NEW"?"New Markdown draft":`Converted from ${e}`}),_.jsx("div",{className:"rendered-markdown",dangerouslySetInnerHTML:{__html:s}})]})})}function vr({label:n,title:e,active:t,disabled:i,onClick:r,className:s=""}){return _.jsx("button",{type:"button",title:e||n,className:`${t?"active":""} ${s}`.trim(),disabled:i,onClick:r,children:n})}function yie(){const[n,e]=$e.useState(`# regen-mde
|
|
360
|
+
|
|
361
|
+
Open a Markdown or Word file to begin.`),[t,i]=$e.useState(""),[r,s]=$e.useState(""),[l,o]=$e.useState(""),[c,h]=$e.useState(""),[d,p]=$e.useState(""),[g,O]=$e.useState("Ready"),[b,v]=$e.useState("markdown"),[x,k]=$e.useState(()=>{var ie,Me;const q=(ie=window.localStorage)==null?void 0:ie.getItem("build-corpus-editor-theme");return q==="dark"||q==="light"?q:(Me=window.matchMedia)!=null&&Me.call(window,"(prefers-color-scheme: dark)").matches?"dark":"light"}),[C,A]=$e.useState(!1),[P,E]=$e.useState(!1),[D,$]=$e.useState(!1),H=$e.useRef(null),W=$e.useRef(null),te=$e.useRef(!1),[ae,re]=$e.useState(null),[ce,se]=$e.useState({start:0,end:0,ready:!1}),z=cq({extensions:[i6,QD.configure({openOnClick:!1,autolink:!0}),KU.configure({placeholder:"Start writing..."}),s6.configure({inline:!1,allowBase64:!0}),FD.configure({resizable:!0}),GD,WD,UD,jD,ZD.configure({nested:!0})],content:th(n),immediatelyRender:!1,onUpdate({editor:q}){const ie=pR(q.getHTML());e(ie),A(!0)}}),B=$e.useCallback(async q=>{O("Opening...");const ie=await Yn.call("open",{path:q}),Me=ie.originalFormat||"",ve=Me==="markdown";i(ie.workingPath||ve&&ie.sourcePath||""),s(ie.workingPath||""),o(ie.sourcePath||""),h(""),p(Me),e(ie.content||"");const Be=(ie.content||"").length>Iu;E(Be),Be||z==null||z.commands.setContent(th(ie.content||"")),A(!1),v(Be?"raw":"markdown"),O(`Opened ${ie.sourcePath}`)},[z]);$e.useEffect(()=>{Yn.call("startup").then(q=>{q.initialPath&&B(q.initialPath)}).catch(q=>O(q.message))},[B]),$e.useEffect(()=>{z&&!C&&n.length<=Iu&&z.commands.setContent(th(n))},[z,n,C]),$e.useEffect(()=>{var q;(q=window.localStorage)==null||q.setItem("build-corpus-editor-theme",x)},[x]);async function K(){try{const q=await Yn.call("chooseOpen");q!=null&&q.path&&await B(q.path)}catch(q){O(q.message)}}async function he(){try{O("Saving...");const q=await Yn.call("save",{path:t,content:n});i(q.output),s(q.output),A(!1),O(`Saved Markdown ${q.output}`)}catch(q){O(q.message)}}async function ge(q){try{O("Saving as...");const ie=window.__REGEN_MDEDITOR_SMOKE_OUT,Me=ie?"saveAsDirect":"saveAs",ve={suggestedPath:t||l||r,format:q,content:n};if(ie){const _n=q==="word"?".docx":".md";ve.targetPath=`${ie}\\ui-save-as-${q}${_n}`}const Be=await Yn.call(Me,ve);Be!=null&&Be.output&&(q==="markdown"?(i(Be.output),s(Be.output),A(!1),O(`Saved Markdown ${Be.output}`)):(h(Be.output),O(`Exported Word ${Be.output}`)))}catch(ie){O(ie.message)}}function J(){const q=(z==null?void 0:z.getAttributes("link").href)||"",ie=window.prompt("URL",q);ie!==null&&(ie.trim()===""?z==null||z.chain().focus().unsetLink().run():z==null||z.chain().focus().extendMarkRange("link").setLink({href:ie.trim()}).run())}async function Q(){try{const q=await Yn.call("chooseImage");q!=null&&q.src&&(z==null||z.chain().focus().setImage({src:q.src,alt:q.alt||""}).run())}catch(q){O(q.message)}}function Z(){const q=window.prompt("Image URL");q&&(z==null||z.chain().focus().setImage({src:q.trim()}).run())}async function G(){var q;try{const ie=await Yn.call("chooseFolder");if(!(ie!=null&&ie.path))return;O("Converting folder...");const Me=await Yn.call("convertBatch",{path:ie.path,moveSources:D});O(`Converted ${((q=Me.outputs)==null?void 0:q.length)||0} files from ${Me.input}`)}catch(ie){O(ie.message)}}async function oe(){var q;try{O("Inlining images...");const ie=await Yn.call("inlineImages",{content:n,basePath:t||r||l});e(ie.content||n),A(!0),E((ie.content||n).length>Iu),v("raw"),O(`Inlined ${ie.converted||0} images${(q=ie.skipped)!=null&&q.length?`; skipped ${ie.skipped.length}`:""}`)}catch(ie){O(ie.message)}}function ye(q){e(q),E(q.length>Iu),A(!0),z&&q.length<=Iu&&z.commands.setContent(th(q))}function Re(q,ie){if(!q||!ie)return;const Me=Math.max(1,q.scrollHeight-q.clientHeight),ve=Math.max(0,ie.scrollHeight-ie.clientHeight),Be=q.scrollTop/Me;ie.scrollTop=Be*ve}const _e=$e.useCallback(q=>{var ie;b!=="split"||te.current||(te.current=!0,Re(q.currentTarget,(ie=H.current)==null?void 0:ie.scrollDOM),window.requestAnimationFrame(()=>{te.current=!1}))},[b]);$e.useEffect(()=>{if(!ae)return;function q(ie){b!=="split"||te.current||(te.current=!0,Re(ie.currentTarget,W.current),window.requestAnimationFrame(()=>{te.current=!1}))}return ae.addEventListener("scroll",q,{passive:!0}),()=>ae.removeEventListener("scroll",q)},[b,ae]);function xt(q,ie,Me){ye(q),se({start:ie,end:Me,ready:!0}),window.requestAnimationFrame(()=>{const ve=H.current;ve&&(ve.focus(),ve.dispatch({selection:{anchor:ie,head:Me}}))})}function ot(){const q=H.current;if(q){const ie=q.state.selection.main;return ce.ready&&ie.from===0&&ie.to===0&&(ce.start!==0||ce.end!==0)?ce:{start:ie.from,end:ie.to,ready:!0}}return ce.ready?ce:{start:n.length,end:n.length}}function dr(q,ie=q,Me="text"){const{start:ve,end:Be}=ot(),_n=n.slice(ve,Be);if(_n&&_n.startsWith(q)&&_n.endsWith(ie)){const ri=_n.slice(q.length,_n.length-ie.length),Sn=`${n.slice(0,ve)}${ri}${n.slice(Be)}`;xt(Sn,ve,ve+ri.length);return}if(ve>=q.length&&n.slice(ve-q.length,ve)===q&&n.slice(Be,Be+ie.length)===ie){const ri=`${n.slice(0,ve-q.length)}${_n}${n.slice(Be+ie.length)}`;xt(ri,ve-q.length,Be-q.length);return}const ii=n1(n,ve,Be,q,ie);if(ii){const ri=`${n.slice(0,ii.open)}${n.slice(ii.open+q.length,ii.close)}${n.slice(ii.close+ie.length)}`,Sn=ve>ii.open?q.length:0;xt(ri,Math.max(ii.open,ve-Sn),Math.max(ii.open,Be-Sn));return}const Gi=_n||Me,Yr=`${n.slice(0,ve)}${q}${Gi}${ie}${n.slice(Be)}`;xt(Yr,ve+q.length,ve+q.length+Gi.length)}function Vr(q,ie=null){const{start:Me,end:ve}=ot(),Be=n.lastIndexOf(`
|
|
362
|
+
`,Math.max(0,Me-1))+1,_n=n.indexOf(`
|
|
363
|
+
`,Me),ii=_n===-1?n.length:_n,Gi=n.slice(Be,ii),Yr=ie?Gi.match(ie):Gi.startsWith(q)?[q]:null;if(Yr){const Sn=Yr[0].length,Fo=`${n.slice(0,Be)}${Gi.slice(Sn)}${n.slice(ii)}`;xt(Fo,Math.max(Be,Me-Sn),Math.max(Be,ve-Sn));return}const ri=`${n.slice(0,Be)}${q}${n.slice(Be)}`;xt(ri,Me+q.length,ve+q.length)}function Yo(q,ie=q){const{start:Me,end:ve}=ot();return!!n1(n,Me,ve,q,ie)}function Dc(q){const{start:ie,end:Me}=ot();return q.find(ve=>n1(n,ie,Me,ve,ve))||""}function qr(){const q=Dc(["*","_"]);dr(q||"*",q||"*","italic")}function Bs(q){const{start:ie}=ot(),Me=n.lastIndexOf(`
|
|
364
|
+
`,Math.max(0,ie-1))+1,ve=n.indexOf(`
|
|
365
|
+
`,ie),Be=ve===-1?n.length:ve;return q.test(n.slice(Me,Be))}function Uo(q,ie=q.length){const{start:Me,end:ve}=ot(),Be=`${n.slice(0,Me)}${q}${n.slice(ve)}`;xt(Be,Me+ie,Me+ie)}$e.useEffect(()=>{if(window.__REGEN_MDEDITOR_SMOKE_OUT)return window.__REGEN_MDEDITOR_SMOKE_API={appendMarkdown(q){const ie=`${n}${q}`;return ye(ie),ie},setMarkdown(q){const ie=String(q||"");return ye(ie),ie},setSelection(q,ie=q){const Me=H.current;if(!Me)throw new Error("Markdown editor view is not ready.");const ve=Math.max(0,Math.min(Number(q)||0,Me.state.doc.length)),Be=Math.max(0,Math.min(Number(ie)||ve,Me.state.doc.length));return Me.focus(),Me.dispatch({selection:{anchor:ve,head:Be}}),se({start:ve,end:Be,ready:!0}),`${ve}:${Be}`},appendRichText(q){if(!z)throw new Error("Rich editor is not ready.");const ie=String(q).split(/\n{2,}/).map(Me=>Me.trim()).filter(Boolean).map(Me=>`<p>${Me.replace(/[&<>"']/g,ve=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[ve])}</p>`).join("");return z.chain().focus().insertContent(ie||"<p></p>").run(),pR(z.getHTML())},getMarkdown(){return n}},()=>{delete window.__REGEN_MDEDITOR_SMOKE_API}},[n,z]);const Wt=!P,Nc=l||t||r||"No file open",Wi=d?d.toUpperCase():"NEW",Wo=n.trim()?n.trim().split(/\s+/).length:0,Hr=(n.match(/\n\|/g)||[]).length>1?1:0,Vl=(n.match(/!\[[^\]]*]\(/g)||[]).length,wf=(n.match(/https?:\/\//g)||[]).length,En=Math.max(18,Math.min(94,92-Vl*8-Hr*5)),sO=Wi==="MARKDOWN"?"MD":Wi==="NEW"?"NEW":Wi,Tf=l?`${Wi} source loaded`:"No source loaded",Cf=t?"Markdown target selected":"Unsaved Markdown draft",Go=c?"Word export written":"Word export ready",lO=x==="dark"?"light":"dark",ni=!1,oO=$e.useMemo(()=>[sne()],[]);return _.jsxs("main",{className:"app-shell","data-theme":x,children:[_.jsxs("aside",{className:"brand-rail","aria-label":"Primary tools",children:[_.jsx("div",{className:"mark",children:"BC"}),_.jsx("div",{className:"rail-item active",children:"Ed"}),_.jsx("div",{className:"rail-item",children:"Cv"}),_.jsx("div",{className:"rail-item",children:"Tb"}),_.jsx("div",{className:"rail-item",children:"Im"}),_.jsx("div",{className:"rail-item",children:"Qa"}),_.jsx("div",{}),_.jsx("div",{className:"rail-item",children:"?"})]}),_.jsxs("header",{className:"topbar",children:[_.jsxs("div",{className:"file-title",children:[_.jsx("strong",{children:"regen-mde"}),_.jsx("span",{title:Nc,children:Nc})]}),_.jsxs("div",{className:"actions",children:[_.jsx("button",{className:"ghost",onClick:K,children:"Open"}),_.jsx("button",{onClick:he,disabled:!t,children:"Save MD"}),_.jsx("button",{onClick:()=>ge("markdown"),children:"Save MD As..."}),_.jsx("button",{onClick:()=>ge("word"),children:"Export Word..."}),_.jsx("button",{className:"ghost",onClick:oe,disabled:!n,children:"Inline Images"}),_.jsx("button",{className:"ghost",onClick:G,children:"Convert Folder"}),_.jsx("button",{className:"ghost",onClick:()=>k(lO),children:x==="dark"?"Light":"Dark"}),_.jsx("button",{className:"primary",onClick:()=>O(`Checked ${Wo} words, ${Hr} tables, ${Vl} images, ${wf} links`),children:"Run Check"})]})]}),_.jsxs("section",{className:"side-panel left-panel",children:[_.jsx("h2",{className:"panel-title",children:"Document Flow"}),_.jsxs("div",{className:"source-card",children:[_.jsx("strong",{children:Tf}),_.jsx("p",{children:C?"The Markdown draft has unsaved changes.":"The Markdown draft is in sync with its save target."}),_.jsxs("label",{className:"batch-option",children:[_.jsx("input",{type:"checkbox",checked:D,onChange:q=>$(q.target.checked)})," Move processed files to sources"]})]}),_.jsxs("div",{className:"format-flow",children:[_.jsxs("div",{className:"flow-step",children:[_.jsx("div",{className:"badge",children:sO}),_.jsxs("div",{children:[_.jsx("b",{children:"Original"}),_.jsx("small",{children:l||"Choose a file to begin"})]}),_.jsx("small",{children:l?"loaded":"empty"})]}),_.jsxs("div",{className:"flow-step",children:[_.jsx("div",{className:"badge",children:"MD"}),_.jsxs("div",{children:[_.jsx("b",{children:"Working draft"}),_.jsx("small",{children:Cf})]}),_.jsx("small",{children:C?"dirty":"saved"})]}),_.jsxs("div",{className:"flow-step",children:[_.jsx("div",{className:"badge",children:"DOCX"}),_.jsxs("div",{children:[_.jsx("b",{children:"Word export"}),_.jsx("small",{children:Go})]}),_.jsx("small",{children:c?"done":"ready"})]})]}),_.jsx("h2",{className:"panel-title",children:"Insert"}),_.jsxs("div",{className:"insert-grid",children:[_.jsxs("button",{className:"insert-tile",disabled:!Wt,onClick:()=>z==null?void 0:z.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),children:[_.jsx("b",{children:"Table"}),"Rows, columns, headers"]}),_.jsxs("button",{className:"insert-tile",disabled:!Wt,onClick:Q,children:[_.jsx("b",{children:"Image"}),"File with alt text"]}),_.jsxs("button",{className:"insert-tile",disabled:!Wt,onClick:()=>z==null?void 0:z.chain().focus().toggleBlockquote().run(),children:[_.jsx("b",{children:"Callout"}),"Note or quotation"]}),_.jsxs("button",{className:"insert-tile",disabled:!Wt,onClick:()=>z==null?void 0:z.chain().focus().toggleTaskList().run(),children:[_.jsx("b",{children:"Task"}),"Checklist block"]})]})]}),_.jsxs("section",{className:`workspace ${b} ${P?"large":""}`,children:[_.jsxs("div",{className:"mode-strip",children:[_.jsxs("div",{className:"segmented","aria-label":"Editor mode",children:[_.jsx("button",{className:b==="markdown"?"active":"",onClick:()=>v("markdown"),children:"Markdown"}),_.jsx("button",{className:b==="raw"?"active":"",onClick:()=>v("raw"),children:"Raw"}),_.jsx("button",{className:b==="split"?"active":"",onClick:()=>v("split"),children:"Split Screen"})]}),_.jsxs("div",{className:"actions",children:[_.jsx("button",{className:"ghost",disabled:!Wt,onClick:()=>z==null?void 0:z.chain().focus().undo().run(),children:"Undo"}),_.jsx("button",{className:"ghost",disabled:!Wt,onClick:()=>z==null?void 0:z.chain().focus().redo().run(),children:"Redo"}),_.jsx("button",{className:"ghost",disabled:!Wt,onClick:J,children:"Link"})]})]}),_.jsxs("div",{className:"canvas-wrap",children:[b!=="raw"&&Wt&&z&&_.jsx("section",{className:"page-area",ref:W,onScroll:_e,children:_.jsxs("article",{className:"page rich",children:[_.jsx("p",{className:"page-label",children:Wi==="NEW"?"New Markdown draft":`Converted from ${Wi}`}),_.jsxs(OY,{editor:z,options:{placement:"top"},className:"bubble-menu",children:[_.jsx(vr,{label:"B",title:"Bold",active:z==null?void 0:z.isActive("bold"),onClick:()=>z==null?void 0:z.chain().focus().toggleBold().run()}),_.jsx(vr,{label:"I",title:"Italic",active:z==null?void 0:z.isActive("italic"),onClick:()=>z==null?void 0:z.chain().focus().toggleItalic().run()}),_.jsx(vr,{label:"S",title:"Strike",active:z==null?void 0:z.isActive("strike"),onClick:()=>z==null?void 0:z.chain().focus().toggleStrike().run()}),_.jsx(vr,{label:"Code",active:z==null?void 0:z.isActive("code"),onClick:()=>z==null?void 0:z.chain().focus().toggleCode().run()}),_.jsx(vr,{label:"Link",active:z==null?void 0:z.isActive("link"),onClick:J})]}),_.jsxs(yY,{editor:z,options:{placement:"right-start"},className:"floating-menu",children:[_.jsx(vr,{label:"H1",onClick:()=>z==null?void 0:z.chain().focus().toggleHeading({level:1}).run()}),_.jsx(vr,{label:"H2",onClick:()=>z==null?void 0:z.chain().focus().toggleHeading({level:2}).run()}),_.jsx(vr,{label:"List",onClick:()=>z==null?void 0:z.chain().focus().toggleBulletList().run()}),_.jsx(vr,{label:"Table",onClick:()=>z==null?void 0:z.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}),_.jsx(vr,{label:"Image",onClick:Q})]}),_.jsx(RP,{editor:z})]})}),b!=="raw"&&!Wt&&_.jsx(Oie,{markdown:n,formatLabel:Wi,pageAreaRef:W,onScroll:_e}),(b==="split"||b==="raw")&&_.jsxs("aside",{className:"markdown-pane editable-markdown",children:[_.jsxs("div",{className:"markdown-toolbar","aria-label":"Markdown formatting",onMouseDown:q=>q.preventDefault(),children:[_.jsx("button",{className:Bs(/^# /)?"active":"",disabled:ni,onClick:()=>Vr("# ",/^#{1,6} /),children:"H1"}),_.jsx("button",{className:Bs(/^## /)?"active":"",disabled:ni,onClick:()=>Vr("## ",/^#{1,6} /),children:"H2"}),_.jsx("button",{className:Yo("**")?"active":"",disabled:ni,onClick:()=>dr("**","**","bold"),children:"B"}),_.jsx("button",{className:Dc(["*","_"])?"active":"",disabled:ni,onClick:qr,children:"I"}),_.jsx("button",{className:Bs(/^- /)?"active":"",disabled:ni,onClick:()=>Vr("- "),children:"List"}),_.jsx("button",{className:Bs(/^> /)?"active":"",disabled:ni,onClick:()=>Vr("> "),children:"Quote"}),_.jsx("button",{className:Yo("`")?"active":"",disabled:ni,onClick:()=>dr("`","`","code"),children:"Code"}),_.jsx("button",{disabled:ni,onClick:()=>dr("[","](https://example.com)","link"),children:"Link"}),_.jsx("button",{disabled:ni,onClick:()=>Uo("",2),children:"Image"}),_.jsx("button",{disabled:ni,onClick:()=>Uo(`
|
|
366
|
+
| Column | Value |
|
|
367
|
+
| --- | --- |
|
|
368
|
+
| Item | Detail |
|
|
369
|
+
`,3),children:"Table"})]}),_.jsx(KL,{className:"source code-source",value:n,height:"100%",basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0,highlightSelectionMatches:!0},extensions:oO,theme:"light",onCreateEditor:q=>{H.current=q;const ie=q.state.selection.main;se({start:ie.from,end:ie.to,ready:!0}),re(q.scrollDOM)},onUpdate:q=>{if(!q.selectionSet)return;const ie=q.state.selection.main;se({start:ie.from,end:ie.to,ready:!0})},onChange:q=>ye(q)})]})]})]}),_.jsxs("aside",{className:"side-panel right-panel",children:[_.jsx("h2",{className:"panel-title",children:"Output Health"}),_.jsxs("div",{className:"source-card",children:[_.jsx("strong",{children:"Round-trip confidence"}),_.jsx("p",{children:"Tables, images, links, and headings are tracked as conversion risks."}),_.jsx("div",{className:"meter","aria-label":"Round-trip confidence",children:_.jsx("span",{style:{width:`${En}%`}})})]}),_.jsx("h2",{className:"panel-title",children:"Table Tools"}),_.jsxs("div",{className:"tool-group",children:[_.jsx("button",{disabled:!Wt||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().addRowAfter().run(),children:"Row +"}),_.jsx("button",{disabled:!Wt||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().addColumnAfter().run(),children:"Col +"}),_.jsx("button",{disabled:!Wt||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().deleteRow().run(),children:"Row -"}),_.jsx("button",{disabled:!Wt||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().deleteColumn().run(),children:"Col -"}),_.jsx("button",{disabled:!Wt||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().toggleHeaderRow().run(),children:"Header"}),_.jsx("button",{disabled:!Wt||!(z!=null&&z.isActive("table")),onClick:()=>z==null?void 0:z.chain().focus().deleteTable().run(),children:"Delete"})]}),_.jsx("h2",{className:"panel-title",children:"Image Tools"}),_.jsxs("div",{className:"tool-group",children:[_.jsx("button",{disabled:!Wt,onClick:Q,children:"File"}),_.jsx("button",{disabled:!Wt,onClick:Z,children:"URL"})]}),_.jsxs("div",{className:"checklist",children:[_.jsxs("div",{className:"check",children:[_.jsx("span",{className:"dot"}),_.jsxs("div",{children:[_.jsx("b",{children:"Markdown target"}),_.jsx("br",{}),t||"Choose Save MD As..."]})]}),_.jsxs("div",{className:"check",children:[_.jsx("span",{className:"dot"}),_.jsxs("div",{children:[_.jsx("b",{children:"Word export"}),_.jsx("br",{}),c||"Ready to export with template hook."]})]}),_.jsxs("div",{className:"check",children:[_.jsx("span",{className:Vl?"dot warn":"dot"}),_.jsxs("div",{children:[_.jsx("b",{children:"Images"}),_.jsx("br",{}),Vl," detected. Asset folder policy still needs final pass."]})]}),_.jsxs("div",{className:"check",children:[_.jsx("span",{className:Hr?"dot warn":"dot"}),_.jsxs("div",{children:[_.jsx("b",{children:"Tables"}),_.jsx("br",{}),Hr," detected. Advanced cell controls are surfaced here."]})]})]})]}),_.jsxs("footer",{className:"statusbar",children:[_.jsxs("span",{children:[g,c?` - Last Word export: ${c}`:""]}),_.jsxs("span",{children:["Words ",Wo," | Tables ",Hr," | Images ",Vl," | Links ",wf]})]})]})}function bie({paneId:n,dropDir:e}){const t=$e.useRef(null),[i,r]=$e.useState("Ready — dictate, type, paste, or drop files."),[s,l]=$e.useState("Voice idle"),[o,c]=$e.useState(!1),[h,d]=$e.useState(0),[p,g]=$e.useState(!1),[O,b]=$e.useState(!1),v=$e.useRef(""),x=$e.useRef([]),k=$e.useRef(null),C=$e.useRef(null),A=$e.useRef(null),P=()=>{var J;return((J=t.current)==null?void 0:J.value)??""},E=J=>{t.current&&(t.current.value=J),v.current=J},D=$e.useCallback(()=>{d(x.current.length)},[]);function $(J,Q,Z){const G=t.current;if(!G)return;const oe=G.value;G.value=oe.slice(0,J)+Z+oe.slice(Q);const ye=J+Z.length;G.selectionStart=ye,G.selectionEnd=ye,v.current=G.value}function H(J,Q="manual"){const Z=t.current;if(!Z)return;const G=Z.selectionStart??Z.value.length,oe=Z.selectionEnd??G;$(G,oe,J),J.trim()&&(x.current.push({start:G,end:G+J.length,text:J,source:Q,at:Date.now()}),D()),Z.focus()}function W(J,Q){let Z=0;for(;Z<J.length&&Z<Q.length&&J[Z]===Q[Z];)Z+=1;let G=J.length,oe=Q.length;for(;G>Z&&oe>Z&&J[G-1]===Q[oe-1];)G-=1,oe-=1;return{start:Z,removed:J.slice(Z,G),inserted:Q.slice(Z,oe)}}function te(){const J=k.current;J&&J.text.trim()&&(x.current.push({...J,end:J.start+J.text.length,at:Date.now()}),D()),k.current=null}function ae(){const J=P(),Q=W(v.current,J);Q.inserted&&(k.current?k.current.text+=Q.inserted:k.current={start:Q.start,text:Q.inserted,source:"type"},clearTimeout(C.current),C.current=setTimeout(te,1300)),v.current=J}function re(){var G;te();const J=x.current.pop();if(D(),!J){r("No blocks to delete.");return}const Z=P().lastIndexOf(J.text);Z>=0&&($(Z,Z+J.text.length,""),r(`Deleted last block (${J.source}).`)),(G=t.current)==null||G.focus()}function ce(){var J;E(""),k.current=null,x.current=[],D(),r("Cleared."),(J=t.current)==null||J.focus()}async function se(J){var G,oe;J.preventDefault(),b(!1);const Q=[...((G=J.dataTransfer)==null?void 0:G.files)||[]],Z=(oe=J.dataTransfer)==null?void 0:oe.getData("text/plain");if(Q.length===0&&Z){H(Z,"drop");return}for(const ye of Q)try{r(`Saving ${ye.name}...`);const Re=await z(ye),_e=await Yn.call("saveDroppedFile",{fileName:ye.name||"drop.bin",mimeType:ye.type||"application/octet-stream",data:Re}),xt=_e.isImage?`
|
|
370
|
+
[Image saved locally]
|
|
371
|
+
${_e.path}
|
|
372
|
+
`:`
|
|
373
|
+
[File saved locally]
|
|
374
|
+
${_e.path}
|
|
375
|
+
`;H(xt,_e.isImage?"image-drop":"file-drop"),r(`Inserted local path for ${ye.name}.`)}catch(Re){r(`Drop failed: ${Re.message}`)}}function z(J){return new Promise((Q,Z)=>{const G=new FileReader;G.onload=()=>{const oe=String(G.result||""),ye=oe.indexOf(",");Q(ye>=0?oe.slice(ye+1):oe)},G.onerror=()=>Z(G.error||new Error("Could not read file.")),G.readAsDataURL(J)})}function B(){const J=window.SpeechRecognition||window.webkitSpeechRecognition;if(!J)return l("Speech API unavailable — Windows dictation (Win+H) still works."),null;const Q=new J;return Q.continuous=!0,Q.interimResults=!1,Q.lang="en-US",Q.onstart=()=>{c(!0),l("Voice listening...")},Q.onend=()=>{c(!1),l("Voice idle"),te()},Q.onerror=Z=>l(`Voice error: ${Z.error}`),Q.onresult=Z=>{for(let G=Z.resultIndex;G<Z.results.length;G+=1)if(Z.results[G].isFinal){const oe=Z.results[G][0].transcript.trim();oe&&(te(),H(`${oe} `,"voice"),te())}},Q}$e.useEffect(()=>{var J;return A.current=B(),(J=t.current)==null||J.focus(),()=>{var Q;try{(Q=A.current)==null||Q.stop()}catch{}clearTimeout(C.current)}},[]);function K(){const J=A.current;J&&(o?J.stop():J.start())}async function he(){te();const J=P();if(!J.trim()){r("Nothing to send.");return}g(!0),r("Sending to terminal...");try{const Q=await Yn.call("sendToPane",{content:J,paneId:n});r(`Pasted into pane ${Q.paneId}. Review in the terminal, then press Enter to submit.`),setTimeout(()=>window.close(),200)}catch(Q){r(`Send failed: ${Q.message}`),g(!1)}}function ge(J){(J.ctrlKey||J.metaKey)&&J.key==="Enter"&&(J.preventDefault(),he())}return _.jsxs("main",{className:"compose-shell","data-theme":"dark",children:[_.jsxs("header",{className:"compose-topbar",children:[_.jsxs("div",{className:"compose-title",children:[_.jsx("strong",{children:"WezTerm Prompt Editor"}),_.jsxs("span",{children:[n?`Pane ${n}`:"No pane bound",e?` · drops → ${e}`:""]})]}),_.jsxs("div",{className:"compose-actions",children:[_.jsx("button",{type:"button",className:o?"active":"",onClick:K,children:o?"Stop Voice":"Start Voice"}),_.jsx("button",{type:"button",onClick:re,children:"Delete Last Block"}),_.jsx("button",{type:"button",onClick:ce,children:"Clear"}),_.jsx("button",{type:"button",className:"primary",onClick:he,disabled:p,children:p?"Sending...":"Send to terminal"})]})]}),_.jsx("section",{className:`compose-editor-wrap${O?" dragging":""}`,onDragOver:J=>{J.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:se,children:_.jsx("textarea",{ref:t,className:"compose-editor",spellCheck:!0,autoFocus:!0,placeholder:"Dictate, type, paste, or drop files here. Images are saved to a temp folder and inserted as a local path. Ctrl+Enter sends.",onInput:ae,onKeyDown:ge})}),_.jsxs("footer",{className:"compose-statusbar",children:[_.jsx("span",{children:i}),_.jsx("span",{children:s}),_.jsxs("span",{children:[h," block",h===1?"":"s"]}),_.jsxs("span",{children:["regen-mde v",mie]})]})]})}function Sie(){var i;const n=document.getElementById("root"),e=eZ.createRoot(n),t=()=>e.render(_.jsx(yie,{}));if(!((i=window.chrome)!=null&&i.webview)){t();return}Yn.call("composeInfo").then(r=>{r!=null&&r.composeMode?e.render(_.jsx(bie,{paneId:r.paneId||"",dropDir:r.dropDir||""})):t()}).catch(()=>t())}Sie();
|