var Ib=e=>{throw TypeError(e)};var Xf=(e,t,n)=>t.has(e)||Ib("Cannot "+n);var z=(e,t,n)=>(Xf(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?Ib("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),he=(e,t,n,r)=>(Xf(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),St=(e,t,n)=>(Xf(e,t,"access private method"),n);var fc=(e,t,n,r)=>({set _(i){he(e,t,i,n)},get _(){return z(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Db=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qN(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Sx={exports:{}},Zd={},kx={exports:{}},we={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ec=Symbol.for("react.element"),GN=Symbol.for("react.portal"),YN=Symbol.for("react.fragment"),QN=Symbol.for("react.strict_mode"),XN=Symbol.for("react.profiler"),JN=Symbol.for("react.provider"),ZN=Symbol.for("react.context"),eO=Symbol.for("react.forward_ref"),tO=Symbol.for("react.suspense"),nO=Symbol.for("react.memo"),rO=Symbol.for("react.lazy"),Pb=Symbol.iterator;function iO(e){return e===null||typeof e!="object"?null:(e=Pb&&e[Pb]||e["@@iterator"],typeof e=="function"?e:null)}var Cx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_x=Object.assign,Tx={};function al(e,t,n){this.props=e,this.context=t,this.refs=Tx,this.updater=n||Cx}al.prototype.isReactComponent={};al.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};al.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Nx(){}Nx.prototype=al.prototype;function Sg(e,t,n){this.props=e,this.context=t,this.refs=Tx,this.updater=n||Cx}var kg=Sg.prototype=new Nx;kg.constructor=Sg;_x(kg,al.prototype);kg.isPureReactComponent=!0;var Lb=Array.isArray,Ox=Object.prototype.hasOwnProperty,Cg={current:null},Mx={key:!0,ref:!0,__self:!0,__source:!0};function Ax(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)Ox.call(t,r)&&!Mx.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,J=N[q];if(0>>1;qi(be,w))uei(st,be)?(N[q]=st,N[ue]=w,q=ue):(N[q]=be,N[ce]=w,q=ce);else if(uei(st,w))N[q]=st,N[ue]=w,q=ue;else break e}}return P}function i(N,P){var w=N.sortIndex-P.sortIndex;return w!==0?w:N.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(N){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=N)r(c),P.sortIndex=P.expirationTime,t(a,P);else break;P=n(c)}}function v(N){if(m=!1,E(N),!h)if(n(a)!==null)h=!0,D(S);else{var P=n(c);P!==null&&M(v,P.startTime-N)}}function S(N,P){h=!1,m&&(m=!1,g(R),R=-1),p=!0;var w=f;try{for(E(P),d=n(a);d!==null&&(!(d.expirationTime>P)||N&&!j());){var q=d.callback;if(typeof q=="function"){d.callback=null,f=d.priorityLevel;var J=q(d.expirationTime<=P);P=e.unstable_now(),typeof J=="function"?d.callback=J:d===n(a)&&r(a),E(P)}else r(a);d=n(a)}if(d!==null)var C=!0;else{var ce=n(c);ce!==null&&M(v,ce.startTime-P),C=!1}return C}finally{d=null,f=w,p=!1}}var x=!1,_=null,R=-1,I=5,$=-1;function j(){return!(e.unstable_now()-$N||125q?(N.sortIndex=w,t(c,N),n(a)===null&&N===n(c)&&(m?(g(R),R=-1):m=!0,M(v,w-q))):(N.sortIndex=J,t(a,N),h||p||(h=!0,D(S))),N},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(N){var P=f;return function(){var w=f;f=P;try{return N.apply(this,arguments)}finally{f=w}}}})(Lx);Px.exports=Lx;var mO=Px.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var gO=A,Sn=mO;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Th=Object.prototype.hasOwnProperty,yO=/^[: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]*$/,Fb={},zb={};function bO(e){return Th.call(zb,e)?!0:Th.call(Fb,e)?!1:yO.test(e)?zb[e]=!0:(Fb[e]=!0,!1)}function EO(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function wO(e,t,n,r){if(t===null||typeof t>"u"||EO(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function qt(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var xt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xt[e]=new qt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xt[t]=new qt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xt[e]=new qt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xt[e]=new qt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){xt[e]=new qt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xt[e]=new qt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xt[e]=new qt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xt[e]=new qt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xt[e]=new qt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tg=/[\-:]([a-z])/g;function Ng(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Tg,Ng);xt[t]=new qt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Tg,Ng);xt[t]=new qt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Tg,Ng);xt[t]=new qt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xt[e]=new qt(e,1,!1,e.toLowerCase(),null,!1,!1)});xt.xlinkHref=new qt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xt[e]=new qt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Og(e,t,n,r){var i=xt.hasOwnProperty(t)?xt[t]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var a=` `+i[s].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{ep=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fl(e):""}function vO(e){switch(e.tag){case 5:return Fl(e.type);case 16:return Fl("Lazy");case 13:return Fl("Suspense");case 19:return Fl("SuspenseList");case 0:case 2:case 15:return e=tp(e.type,!1),e;case 11:return e=tp(e.type.render,!1),e;case 1:return e=tp(e.type,!0),e;default:return""}}function Ah(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ds:return"Fragment";case us:return"Portal";case Nh:return"Profiler";case Mg:return"StrictMode";case Oh:return"Suspense";case Mh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case zx:return(e.displayName||"Context")+".Consumer";case Fx:return(e._context.displayName||"Context")+".Provider";case Ag:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Rg:return t=e.displayName||null,t!==null?t:Ah(e.type)||"Memo";case ci:t=e._payload,e=e._init;try{return Ah(e(t))}catch{}}return null}function xO(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ah(t);case 8:return t===Mg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ux(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function SO(e){var t=Ux(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function mc(e){e._valueTracker||(e._valueTracker=SO(e))}function Hx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ux(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Au(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Rh(e,t){var n=t.checked;return Ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ub(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function jx(e,t){t=t.checked,t!=null&&Og(e,"checked",t,!1)}function Ih(e,t){jx(e,t);var n=Vi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Dh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Dh(e,t.type,Vi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Hb(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Dh(e,t,n){(t!=="number"||Au(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zl=Array.isArray;function Cs(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=gc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ma(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},kO=["Webkit","ms","Moz","O"];Object.keys(Kl).forEach(function(e){kO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kl[t]=Kl[e]})});function qx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Kl.hasOwnProperty(e)&&Kl[e]?(""+t).trim():t+"px"}function Gx(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=qx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var CO=Ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Bh(e,t){if(t){if(CO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Fh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 zh=null;function Ig(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $h=null,_s=null,Ts=null;function Wb(e){if(e=rc(e)){if(typeof $h!="function")throw Error(K(280));var t=e.stateNode;t&&(t=of(t),$h(e.stateNode,e.type,t))}}function Yx(e){_s?Ts?Ts.push(e):Ts=[e]:_s=e}function Qx(){if(_s){var e=_s,t=Ts;if(Ts=_s=null,Wb(e),t)for(e=0;e>>=0,e===0?32:31-(LO(e)/BO|0)|0}var yc=64,bc=4194304;function $l(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=$l(l):(o&=s,o!==0&&(r=$l(o)))}else s=n&~i,s!==0?r=$l(s):o!==0&&(r=$l(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function tc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Jn(t),e[t]=n}function UO(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Gl),e0=" ",t0=!1;function gS(e,t){switch(e){case"keyup":return mM.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yS(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fs=!1;function yM(e,t){switch(e){case"compositionend":return yS(t);case"keypress":return t.which!==32?null:(t0=!0,e0);case"textInput":return e=t.data,e===e0&&t0?null:e;default:return null}}function bM(e,t){if(fs)return e==="compositionend"||!Ug&&gS(e,t)?(e=hS(),au=Fg=ki=null,fs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=o0(n)}}function vS(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?vS(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xS(){for(var e=window,t=Au();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Au(e.document)}return t}function Hg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function TM(e){var t=xS(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&vS(n.ownerDocument.documentElement,n)){if(r!==null&&Hg(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=s0(n,o);var s=s0(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ps=null,Kh=null,Ql=null,qh=!1;function l0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qh||ps==null||ps!==Au(r)||(r=ps,"selectionStart"in r&&Hg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ql&&va(Ql,r)||(Ql=r,r=Fu(Kh,"onSelect"),0gs||(e.current=Zh[gs],Zh[gs]=null,gs--)}function Oe(e,t){gs++,Zh[gs]=e.current,e.current=t}var Wi={},Rt=Gi(Wi),en=Gi(!1),Ao=Wi;function Gs(e,t){var n=e.type.contextTypes;if(!n)return Wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function tn(e){return e=e.childContextTypes,e!=null}function $u(){Pe(en),Pe(Rt)}function h0(e,t,n){if(Rt.current!==Wi)throw Error(K(168));Oe(Rt,t),Oe(en,n)}function AS(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(K(108,xO(e)||"Unknown",i));return Ue({},n,r)}function Uu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Wi,Ao=Rt.current,Oe(Rt,e),Oe(en,en.current),!0}function m0(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=AS(e,t,Ao),r.__reactInternalMemoizedMergedChildContext=e,Pe(en),Pe(Rt),Oe(Rt,e)):Pe(en),Oe(en,n)}var Ur=null,sf=!1,mp=!1;function RS(e){Ur===null?Ur=[e]:Ur.push(e)}function zM(e){sf=!0,RS(e)}function Yi(){if(!mp&&Ur!==null){mp=!0;var e=0,t=Ce;try{var n=Ur;for(Ce=1;e>=s,i-=s,jr=1<<32-Jn(t)+i|n<R?(I=_,_=null):I=_.sibling;var $=f(g,_,E[R],v);if($===null){_===null&&(_=I);break}e&&_&&$.alternate===null&&t(g,_),b=o($,b,R),x===null?S=$:x.sibling=$,x=$,_=I}if(R===E.length)return n(g,_),Be&&ro(g,R),S;if(_===null){for(;RR?(I=_,_=null):I=_.sibling;var j=f(g,_,$.value,v);if(j===null){_===null&&(_=I);break}e&&_&&j.alternate===null&&t(g,_),b=o(j,b,R),x===null?S=j:x.sibling=j,x=j,_=I}if($.done)return n(g,_),Be&&ro(g,R),S;if(_===null){for(;!$.done;R++,$=E.next())$=d(g,$.value,v),$!==null&&(b=o($,b,R),x===null?S=$:x.sibling=$,x=$);return Be&&ro(g,R),S}for(_=r(g,_);!$.done;R++,$=E.next())$=p(_,g,R,$.value,v),$!==null&&(e&&$.alternate!==null&&_.delete($.key===null?R:$.key),b=o($,b,R),x===null?S=$:x.sibling=$,x=$);return e&&_.forEach(function(F){return t(g,F)}),Be&&ro(g,R),S}function y(g,b,E,v){if(typeof E=="object"&&E!==null&&E.type===ds&&E.key===null&&(E=E.props.children),typeof E=="object"&&E!==null){switch(E.$$typeof){case hc:e:{for(var S=E.key,x=b;x!==null;){if(x.key===S){if(S=E.type,S===ds){if(x.tag===7){n(g,x.sibling),b=i(x,E.props.children),b.return=g,g=b;break e}}else if(x.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===ci&&b0(S)===x.type){n(g,x.sibling),b=i(x,E.props),b.ref=_l(g,x,E),b.return=g,g=b;break e}n(g,x);break}else t(g,x);x=x.sibling}E.type===ds?(b=xo(E.props.children,g.mode,v,E.key),b.return=g,g=b):(v=gu(E.type,E.key,E.props,null,g.mode,v),v.ref=_l(g,b,E),v.return=g,g=v)}return s(g);case us:e:{for(x=E.key;b!==null;){if(b.key===x)if(b.tag===4&&b.stateNode.containerInfo===E.containerInfo&&b.stateNode.implementation===E.implementation){n(g,b.sibling),b=i(b,E.children||[]),b.return=g,g=b;break e}else{n(g,b);break}else t(g,b);b=b.sibling}b=Sp(E,g.mode,v),b.return=g,g=b}return s(g);case ci:return x=E._init,y(g,b,x(E._payload),v)}if(zl(E))return h(g,b,E,v);if(vl(E))return m(g,b,E,v);Cc(g,E)}return typeof E=="string"&&E!==""||typeof E=="number"?(E=""+E,b!==null&&b.tag===6?(n(g,b.sibling),b=i(b,E),b.return=g,g=b):(n(g,b),b=xp(E,g.mode,v),b.return=g,g=b),s(g)):n(g,b)}return y}var Qs=LS(!0),BS=LS(!1),Vu=Gi(null),Wu=null,Es=null,Kg=null;function qg(){Kg=Es=Wu=null}function Gg(e){var t=Vu.current;Pe(Vu),e._currentValue=t}function nm(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Os(e,t){Wu=e,Kg=Es=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Zt=!0),e.firstContext=null)}function zn(e){var t=e._currentValue;if(Kg!==e)if(e={context:e,memoizedValue:t,next:null},Es===null){if(Wu===null)throw Error(K(308));Es=e,Wu.dependencies={lanes:0,firstContext:e}}else Es=Es.next=e;return t}var co=null;function Yg(e){co===null?co=[e]:co.push(e)}function FS(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Yg(t)):(n.next=i.next,i.next=n),t.interleaved=n,Qr(e,r)}function Qr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ui=!1;function Qg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function zS(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ve&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Qr(e,n)}return i=r.interleaved,i===null?(t.next=t,Yg(r)):(t.next=i.next,i.next=t),r.interleaved=t,Qr(e,n)}function uu(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pg(e,n)}}function E0(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ku(e,t,n,r){var i=e.updateQueue;ui=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,c=a.next;a.next=null,s===null?o=c:s.next=c,s=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==s&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(o!==null){var d=i.baseState;s=0,u=c=a=null,l=o;do{var f=l.lane,p=l.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var h=e,m=l;switch(f=t,p=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,f=typeof h=="function"?h.call(p,d,f):h,f==null)break e;d=Ue({},d,f);break e;case 2:ui=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[l]:f.push(l))}else p={eventTime:p,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=p,a=d):u=u.next=p,s|=f;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;f=l,l=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(a=d),i.baseState=a,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do s|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Do|=s,e.lanes=s,e.memoizedState=d}}function w0(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=yp.transition;yp.transition={};try{e(!1),t()}finally{Ce=n,yp.transition=r}}function n1(){return $n().memoizedState}function jM(e,t,n){var r=Bi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},r1(e))i1(t,n);else if(n=FS(e,t,n,r),n!==null){var i=Ht();Zn(n,e,r,i),o1(n,t,r)}}function VM(e,t,n){var r=Bi(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(r1(e))i1(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,er(l,s)){var a=t.interleaved;a===null?(i.next=i,Yg(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=FS(e,t,i,r),n!==null&&(i=Ht(),Zn(n,e,r,i),o1(n,t,r))}}function r1(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function i1(e,t){Xl=Gu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function o1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pg(e,n)}}var Yu={readContext:zn,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},WM={readContext:zn,useCallback:function(e,t){return cr().memoizedState=[e,t===void 0?null:t],e},useContext:zn,useEffect:x0,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,fu(4194308,4,XS.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fu(4194308,4,e,t)},useInsertionEffect:function(e,t){return fu(4,2,e,t)},useMemo:function(e,t){var n=cr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=cr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jM.bind(null,$e,e),[r.memoizedState,e]},useRef:function(e){var t=cr();return e={current:e},t.memoizedState=e},useState:v0,useDebugValue:iy,useDeferredValue:function(e){return cr().memoizedState=e},useTransition:function(){var e=v0(!1),t=e[0];return e=HM.bind(null,e[1]),cr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=$e,i=cr();if(Be){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ut===null)throw Error(K(349));Io&30||jS(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,x0(WS.bind(null,r,o,e),[e]),r.flags|=2048,Oa(9,VS.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=cr(),t=ut.identifierPrefix;if(Be){var n=Vr,r=jr;n=(r&~(1<<32-Jn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ta++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[yr]=t,e[ka]=r,m1(e,t,!1,!1),t.stateNode=e;e:{switch(s=Fh(n,r),n){case"dialog":Ie("cancel",e),Ie("close",e),i=r;break;case"iframe":case"object":case"embed":Ie("load",e),i=r;break;case"video":case"audio":for(i=0;iZs&&(t.flags|=128,r=!0,Tl(o,!1),t.lanes=4194304)}else{if(!r)if(e=qu(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Tl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Be)return Ct(t),null}else 2*Qe()-o.renderingStartTime>Zs&&n!==1073741824&&(t.flags|=128,r=!0,Tl(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Qe(),t.sibling=null,n=ze.current,Oe(ze,r?n&1|2:n&1),t):(Ct(t),null);case 22:case 23:return uy(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?hn&1073741824&&(Ct(t),t.subtreeFlags&6&&(t.flags|=8192)):Ct(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function ZM(e,t){switch(Vg(t),t.tag){case 1:return tn(t.type)&&$u(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xs(),Pe(en),Pe(Rt),Zg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jg(t),null;case 13:if(Pe(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(ze),null;case 4:return Xs(),null;case 10:return Gg(t.type._context),null;case 22:case 23:return uy(),null;case 24:return null;default:return null}}var Tc=!1,Ot=!1,eA=typeof WeakSet=="function"?WeakSet:Set,Z=null;function ws(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){We(e,t,r)}else n.current=null}function dm(e,t,n){try{n()}catch(r){We(e,t,r)}}var I0=!1;function tA(e,t){if(Gh=Lu,e=xS(),Hg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(l=s+i),d!==o||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===i&&(l=s),f===o&&++u===r&&(a=s),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yh={focusedElem:e,selectionRange:n},Lu=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,y=h.memoizedState,g=t.stateNode,b=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:Wn(t.type,m),y);g.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var E=t.stateNode.containerInfo;E.nodeType===1?E.textContent="":E.nodeType===9&&E.documentElement&&E.removeChild(E.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(v){We(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return h=I0,I0=!1,h}function Jl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&dm(t,n,o)}i=i.next}while(i!==r)}}function cf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fm(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function b1(e){var t=e.alternate;t!==null&&(e.alternate=null,b1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yr],delete t[ka],delete t[Jh],delete t[BM],delete t[FM])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function E1(e){return e.tag===5||e.tag===3||e.tag===4}function D0(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||E1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zu));else if(r!==4&&(e=e.child,e!==null))for(pm(e,t,n),e=e.sibling;e!==null;)pm(e,t,n),e=e.sibling}function hm(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hm(e,t,n),e=e.sibling;e!==null;)hm(e,t,n),e=e.sibling}var gt=null,Yn=!1;function ei(e,t,n){for(n=n.child;n!==null;)w1(e,t,n),n=n.sibling}function w1(e,t,n){if(wr&&typeof wr.onCommitFiberUnmount=="function")try{wr.onCommitFiberUnmount(ef,n)}catch{}switch(n.tag){case 5:Ot||ws(n,t);case 6:var r=gt,i=Yn;gt=null,ei(e,t,n),gt=r,Yn=i,gt!==null&&(Yn?(e=gt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gt.removeChild(n.stateNode));break;case 18:gt!==null&&(Yn?(e=gt,n=n.stateNode,e.nodeType===8?hp(e.parentNode,n):e.nodeType===1&&hp(e,n),Ea(e)):hp(gt,n.stateNode));break;case 4:r=gt,i=Yn,gt=n.stateNode.containerInfo,Yn=!0,ei(e,t,n),gt=r,Yn=i;break;case 0:case 11:case 14:case 15:if(!Ot&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&dm(n,t,s),i=i.next}while(i!==r)}ei(e,t,n);break;case 1:if(!Ot&&(ws(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){We(n,t,l)}ei(e,t,n);break;case 21:ei(e,t,n);break;case 22:n.mode&1?(Ot=(r=Ot)||n.memoizedState!==null,ei(e,t,n),Ot=r):ei(e,t,n);break;default:ei(e,t,n)}}function P0(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new eA),t.forEach(function(r){var i=uA.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function jn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rA(r/1960))-r,10e?16:e,Ci===null)var r=!1;else{if(e=Ci,Ci=null,Ju=0,ve&6)throw Error(K(331));var i=ve;for(ve|=4,Z=e.current;Z!==null;){var o=Z,s=o.child;if(Z.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aQe()-ay?vo(e,0):ly|=n),nn(e,t)}function N1(e,t){t===0&&(e.mode&1?(t=bc,bc<<=1,!(bc&130023424)&&(bc=4194304)):t=1);var n=Ht();e=Qr(e,t),e!==null&&(tc(e,t,n),nn(e,n))}function cA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),N1(e,n)}function uA(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),N1(e,n)}var O1;O1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||en.current)Zt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Zt=!1,XM(e,t,n);Zt=!!(e.flags&131072)}else Zt=!1,Be&&t.flags&1048576&&IS(t,ju,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;pu(e,t),e=t.pendingProps;var i=Gs(t,Rt.current);Os(t,n),i=ty(null,t,r,e,i,n);var o=ny();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tn(r)?(o=!0,Uu(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Qg(t),i.updater=af,t.stateNode=i,i._reactInternals=t,im(t,r,e,n),t=lm(null,t,r,!0,o,n)):(t.tag=0,Be&&o&&jg(t),$t(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(pu(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=fA(r),e=Wn(r,e),i){case 0:t=sm(null,t,r,e,n);break e;case 1:t=M0(null,t,r,e,n);break e;case 11:t=N0(null,t,r,e,n);break e;case 14:t=O0(null,t,r,Wn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wn(r,i),sm(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wn(r,i),M0(e,t,r,i,n);case 3:e:{if(f1(t),e===null)throw Error(K(387));r=t.pendingProps,o=t.memoizedState,i=o.element,zS(e,t),Ku(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Js(Error(K(423)),t),t=A0(e,t,r,n,i);break e}else if(r!==i){i=Js(Error(K(424)),t),t=A0(e,t,r,n,i);break e}else for(bn=Di(t.stateNode.containerInfo.firstChild),wn=t,Be=!0,Qn=null,n=BS(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ys(),r===i){t=Xr(e,t,n);break e}$t(e,t,r,n)}t=t.child}return t;case 5:return $S(t),e===null&&tm(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Qh(r,i)?s=null:o!==null&&Qh(r,o)&&(t.flags|=32),d1(e,t),$t(e,t,s,n),t.child;case 6:return e===null&&tm(t),null;case 13:return p1(e,t,n);case 4:return Xg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qs(t,null,r,n):$t(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wn(r,i),N0(e,t,r,i,n);case 7:return $t(e,t,t.pendingProps,n),t.child;case 8:return $t(e,t,t.pendingProps.children,n),t.child;case 12:return $t(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Oe(Vu,r._currentValue),r._currentValue=s,o!==null)if(er(o.value,s)){if(o.children===i.children&&!en.current){t=Xr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=Kr(-1,n&-n),a.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),nm(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(K(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),nm(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}$t(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Os(t,n),i=zn(i),r=r(i),t.flags|=1,$t(e,t,r,n),t.child;case 14:return r=t.type,i=Wn(r,t.pendingProps),i=Wn(r.type,i),O0(e,t,r,i,n);case 15:return c1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Wn(r,i),pu(e,t),t.tag=1,tn(r)?(e=!0,Uu(t)):e=!1,Os(t,n),s1(t,r,i),im(t,r,i,n),lm(null,t,r,!0,e,n);case 19:return h1(e,t,n);case 22:return u1(e,t,n)}throw Error(K(156,t.tag))};function M1(e,t){return rS(e,t)}function dA(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Pn(e,t,n,r){return new dA(e,t,n,r)}function fy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fA(e){if(typeof e=="function")return fy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ag)return 11;if(e===Rg)return 14}return 2}function Fi(e,t){var n=e.alternate;return n===null?(n=Pn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function gu(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")fy(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ds:return xo(n.children,i,o,t);case Mg:s=8,i|=8;break;case Nh:return e=Pn(12,n,t,i|2),e.elementType=Nh,e.lanes=o,e;case Oh:return e=Pn(13,n,t,i),e.elementType=Oh,e.lanes=o,e;case Mh:return e=Pn(19,n,t,i),e.elementType=Mh,e.lanes=o,e;case $x:return df(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fx:s=10;break e;case zx:s=9;break e;case Ag:s=11;break e;case Rg:s=14;break e;case ci:s=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Pn(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function xo(e,t,n,r){return e=Pn(7,e,r,t),e.lanes=n,e}function df(e,t,n,r){return e=Pn(22,e,r,t),e.elementType=$x,e.lanes=n,e.stateNode={isHidden:!1},e}function xp(e,t,n){return e=Pn(6,e,null,t),e.lanes=n,e}function Sp(e,t,n){return t=Pn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pA(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rp(0),this.expirationTimes=rp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function py(e,t,n,r,i,o,s,l,a){return e=new pA(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qg(o),e}function hA(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(D1)}catch(e){console.error(e)}}D1(),Dx.exports=kn;var dl=Dx.exports;const P1=Za(dl);var L1,j0=dl;L1=j0.createRoot,j0.hydrateRoot;var gf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yf=typeof window>"u"||"Deno"in globalThis;function Kn(){}function EA(e,t){return typeof e=="function"?e(t):e}function wA(e){return typeof e=="number"&&e>=0&&e!==1/0}function vA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function V0(e,t){return typeof e=="function"?e(t):e}function xA(e,t){return typeof e=="function"?e(t):e}function W0(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==yy(s,t.options))return!1}else if(!Ra(t.queryKey,s))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function K0(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Aa(t.options.mutationKey)!==Aa(o))return!1}else if(!Ra(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function yy(e,t){return((t==null?void 0:t.queryKeyHashFn)||Aa)(e)}function Aa(e){return JSON.stringify(e,(t,n)=>Em(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ra(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ra(e[n],t[n])):!1}function B1(e,t){if(e===t)return e;const n=q0(e)&&q0(t);if(n||Em(e)&&Em(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,l=n?[]:{};let a=0;for(let c=0;c{setTimeout(t,e)})}function kA(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?B1(e,t):t}function CA(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _A(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var by=Symbol();function F1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===by?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var yo,Ei,Fs,mx,TA=(mx=class extends gf{constructor(){super();Se(this,yo);Se(this,Ei);Se(this,Fs);he(this,Fs,t=>{if(!yf&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){z(this,Ei)||this.setEventListener(z(this,Fs))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,Ei))==null||t.call(this),he(this,Ei,void 0))}setEventListener(t){var n;he(this,Fs,t),(n=z(this,Ei))==null||n.call(this),he(this,Ei,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){z(this,yo)!==t&&(he(this,yo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof z(this,yo)=="boolean"?z(this,yo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},yo=new WeakMap,Ei=new WeakMap,Fs=new WeakMap,mx),z1=new TA,zs,wi,$s,gx,NA=(gx=class extends gf{constructor(){super();Se(this,zs,!0);Se(this,wi);Se(this,$s);he(this,$s,t=>{if(!yf&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){z(this,wi)||this.setEventListener(z(this,$s))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,wi))==null||t.call(this),he(this,wi,void 0))}setEventListener(t){var n;he(this,$s,t),(n=z(this,wi))==null||n.call(this),he(this,wi,t(this.setOnline.bind(this)))}setOnline(t){z(this,zs)!==t&&(he(this,zs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return z(this,zs)}},zs=new WeakMap,wi=new WeakMap,$s=new WeakMap,gx),td=new NA;function OA(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function MA(e){return Math.min(1e3*2**e,3e4)}function $1(e){return(e??"online")==="online"?td.isOnline():!0}var U1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function kp(e){return e instanceof U1}function H1(e){let t=!1,n=0,r=!1,i;const o=OA(),s=m=>{var y;r||(f(new U1(m)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},a=()=>{t=!1},c=()=>z1.isFocused()&&(e.networkMode==="always"||td.isOnline())&&e.canRun(),u=()=>$1(e.networkMode)&&e.canRun(),d=m=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,m),i==null||i(),o.resolve(m))},f=m=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,m),i==null||i(),o.reject(m))},p=()=>new Promise(m=>{var y;i=g=>{(r||c())&&m(g)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;i=void 0,r||(m=e.onContinue)==null||m.call(e)}),h=()=>{if(r)return;let m;const y=n===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(g){m=Promise.reject(g)}Promise.resolve(m).then(d).catch(g=>{var x;if(r)return;const b=e.retry??(yf?0:3),E=e.retryDelay??MA,v=typeof E=="function"?E(n,g):E,S=b===!0||typeof b=="number"&&nc()?void 0:p()).then(()=>{t?f(g):h()})})};return{promise:o,cancel:s,continue:()=>(i==null||i(),o),cancelRetry:l,continueRetry:a,canStart:u,start:()=>(u()?h():p().then(h),o)}}function AA(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const o=l=>{t?e.push(l):i(()=>{n(l)})},s=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(a=>{n(a)})})})};return{batch:l=>{let a;t++;try{a=l()}finally{t--,t||s()}return a},batchCalls:l=>(...a)=>{o(()=>{l(...a)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var Ut=AA(),bo,yx,j1=(yx=class{constructor(){Se(this,bo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wA(this.gcTime)&&he(this,bo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(yf?1/0:5*60*1e3))}clearGcTimeout(){z(this,bo)&&(clearTimeout(z(this,bo)),he(this,bo,void 0))}},bo=new WeakMap,yx),Us,Hs,On,Tt,Xa,Eo,qn,Lr,bx,RA=(bx=class extends j1{constructor(t){super();Se(this,qn);Se(this,Us);Se(this,Hs);Se(this,On);Se(this,Tt);Se(this,Xa);Se(this,Eo);he(this,Eo,!1),he(this,Xa,t.defaultOptions),this.setOptions(t.options),this.observers=[],he(this,On,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,he(this,Us,DA(this.options)),this.state=t.state??z(this,Us),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=z(this,Tt))==null?void 0:t.promise}setOptions(t){this.options={...z(this,Xa),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,On).remove(this)}setData(t,n){const r=kA(this.state.data,t,this.options);return St(this,qn,Lr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){St(this,qn,Lr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=z(this,Tt))==null?void 0:r.promise;return(i=z(this,Tt))==null||i.cancel(t),n?n.then(Kn).catch(Kn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(z(this,Us))}isActive(){return this.observers.some(t=>xA(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===by||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!vA(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,Tt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=z(this,Tt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,On).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(z(this,Tt)&&(z(this,Eo)?z(this,Tt).cancel({revert:!0}):z(this,Tt).cancelRetry()),this.scheduleGc()),z(this,On).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||St(this,qn,Lr).call(this,{type:"invalidate"})}fetch(t,n){var a,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(z(this,Tt))return z(this,Tt).continueRetry(),z(this,Tt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(he(this,Eo,!0),r.signal)})},o=()=>{const d=F1(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),he(this,Eo,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(s),(a=this.options.behavior)==null||a.onFetch(s,this),he(this,Hs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&St(this,qn,Lr).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const l=d=>{var f,p,h,m;kp(d)&&d.silent||St(this,qn,Lr).call(this,{type:"error",error:d}),kp(d)||((p=(f=z(this,On).config).onError)==null||p.call(f,d,this),(m=(h=z(this,On).config).onSettled)==null||m.call(h,this.state.data,d,this)),this.scheduleGc()};return he(this,Tt,H1({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,p,h,m;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){l(y);return}(p=(f=z(this,On).config).onSuccess)==null||p.call(f,d,this),(m=(h=z(this,On).config).onSettled)==null||m.call(h,d,this.state.error,this),this.scheduleGc()},onError:l,onFail:(d,f)=>{St(this,qn,Lr).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{St(this,qn,Lr).call(this,{type:"pause"})},onContinue:()=>{St(this,qn,Lr).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),z(this,Tt).start()}},Us=new WeakMap,Hs=new WeakMap,On=new WeakMap,Tt=new WeakMap,Xa=new WeakMap,Eo=new WeakMap,qn=new WeakSet,Lr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...IA(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return kp(i)&&i.revert&&z(this,Hs)?{...z(this,Hs),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),z(this,On).notify({query:this,type:"updated",action:t})})},bx);function IA(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function DA(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var hr,Ex,PA=(Ex=class extends gf{constructor(t={}){super();Se(this,hr);this.config=t,he(this,hr,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??yy(i,n);let s=this.get(o);return s||(s=new RA({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){z(this,hr).has(t.queryHash)||(z(this,hr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=z(this,hr).get(t.queryHash);n&&(t.destroy(),n===t&&z(this,hr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ut.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,hr).get(t)}getAll(){return[...z(this,hr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>W0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>W0(t,r)):n}notify(t){Ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ut.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ut.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},hr=new WeakMap,Ex),mr,Ft,wo,gr,li,wx,LA=(wx=class extends j1{constructor(t){super();Se(this,gr);Se(this,mr);Se(this,Ft);Se(this,wo);this.mutationId=t.mutationId,he(this,Ft,t.mutationCache),he(this,mr,[]),this.state=t.state||BA(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,mr).includes(t)||(z(this,mr).push(t),this.clearGcTimeout(),z(this,Ft).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){he(this,mr,z(this,mr).filter(n=>n!==t)),this.scheduleGc(),z(this,Ft).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,mr).length||(this.state.status==="pending"?this.scheduleGc():z(this,Ft).remove(this))}continue(){var t;return((t=z(this,wo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,l,a,c,u,d,f,p,h,m,y,g,b,E,v,S,x,_;he(this,wo,H1({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,I)=>{St(this,gr,li).call(this,{type:"failed",failureCount:R,error:I})},onPause:()=>{St(this,gr,li).call(this,{type:"pause"})},onContinue:()=>{St(this,gr,li).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,Ft).canRun(this)}));const n=this.state.status==="pending",r=!z(this,wo).canStart();try{if(!n){St(this,gr,li).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=z(this,Ft).config).onMutate)==null?void 0:o.call(i,t,this));const I=await((l=(s=this.options).onMutate)==null?void 0:l.call(s,t));I!==this.state.context&&St(this,gr,li).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const R=await z(this,wo).start();return await((c=(a=z(this,Ft).config).onSuccess)==null?void 0:c.call(a,R,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,R,t,this.state.context)),await((p=(f=z(this,Ft).config).onSettled)==null?void 0:p.call(f,R,null,this.state.variables,this.state.context,this)),await((m=(h=this.options).onSettled)==null?void 0:m.call(h,R,null,t,this.state.context)),St(this,gr,li).call(this,{type:"success",data:R}),R}catch(R){try{throw await((g=(y=z(this,Ft).config).onError)==null?void 0:g.call(y,R,t,this.state.context,this)),await((E=(b=this.options).onError)==null?void 0:E.call(b,R,t,this.state.context)),await((S=(v=z(this,Ft).config).onSettled)==null?void 0:S.call(v,void 0,R,this.state.variables,this.state.context,this)),await((_=(x=this.options).onSettled)==null?void 0:_.call(x,void 0,R,t,this.state.context)),R}finally{St(this,gr,li).call(this,{type:"error",error:R})}}finally{z(this,Ft).runNext(this)}}},mr=new WeakMap,Ft=new WeakMap,wo=new WeakMap,gr=new WeakSet,li=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ut.batch(()=>{z(this,mr).forEach(r=>{r.onMutationUpdate(t)}),z(this,Ft).notify({mutation:this,type:"updated",action:t})})},wx);function BA(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Hr,Gn,Ja,vx,FA=(vx=class extends gf{constructor(t={}){super();Se(this,Hr);Se(this,Gn);Se(this,Ja);this.config=t,he(this,Hr,new Set),he(this,Gn,new Map),he(this,Ja,0)}build(t,n,r){const i=new LA({mutationCache:this,mutationId:++fc(this,Ja)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){z(this,Hr).add(t);const n=Mc(t);if(typeof n=="string"){const r=z(this,Gn).get(n);r?r.push(t):z(this,Gn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,Hr).delete(t)){const n=Mc(t);if(typeof n=="string"){const r=z(this,Gn).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&z(this,Gn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Mc(t);if(typeof n=="string"){const r=z(this,Gn).get(n),i=r==null?void 0:r.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=Mc(t);if(typeof n=="string"){const i=(r=z(this,Gn).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ut.batch(()=>{z(this,Hr).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,Hr).clear(),z(this,Gn).clear()})}getAll(){return Array.from(z(this,Hr))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>K0(n,r))}findAll(t={}){return this.getAll().filter(n=>K0(t,n))}notify(t){Ut.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ut.batch(()=>Promise.all(t.map(n=>n.continue().catch(Kn))))}},Hr=new WeakMap,Gn=new WeakMap,Ja=new WeakMap,vx);function Mc(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Y0(e){return{onFetch:(t,n)=>{var u,d,f,p,h;const r=t.options,i=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,o=((p=t.state.data)==null?void 0:p.pages)||[],s=((h=t.state.data)==null?void 0:h.pageParams)||[];let l={pages:[],pageParams:[]},a=0;const c=async()=>{let m=!1;const y=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=F1(t.options,t.fetchOptions),b=async(E,v,S)=>{if(m)return Promise.reject();if(v==null&&E.pages.length)return Promise.resolve(E);const x={queryKey:t.queryKey,pageParam:v,direction:S?"backward":"forward",meta:t.options.meta};y(x);const _=await g(x),{maxPages:R}=t.options,I=S?_A:CA;return{pages:I(E.pages,_,R),pageParams:I(E.pageParams,v,R)}};if(i&&o.length){const E=i==="backward",v=E?zA:Q0,S={pages:o,pageParams:s},x=v(r,S);l=await b(S,x,E)}else{const E=e??o.length;do{const v=a===0?s[0]??r.initialPageParam:Q0(r,l);if(a>0&&v==null)break;l=await b(l,v),a++}while(a{var m,y;return(y=(m=t.options).persister)==null?void 0:y.call(m,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Q0(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function zA(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ve,vi,xi,js,Vs,Si,Ws,Ks,xx,$A=(xx=class{constructor(e={}){Se(this,Ve);Se(this,vi);Se(this,xi);Se(this,js);Se(this,Vs);Se(this,Si);Se(this,Ws);Se(this,Ks);he(this,Ve,e.queryCache||new PA),he(this,vi,e.mutationCache||new FA),he(this,xi,e.defaultOptions||{}),he(this,js,new Map),he(this,Vs,new Map),he(this,Si,0)}mount(){fc(this,Si)._++,z(this,Si)===1&&(he(this,Ws,z1.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Ve).onFocus())})),he(this,Ks,td.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,Ve).onOnline())})))}unmount(){var e,t;fc(this,Si)._--,z(this,Si)===0&&((e=z(this,Ws))==null||e.call(this),he(this,Ws,void 0),(t=z(this,Ks))==null||t.call(this),he(this,Ks,void 0))}isFetching(e){return z(this,Ve).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,vi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,Ve).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=z(this,Ve).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(V0(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return z(this,Ve).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=z(this,Ve).get(r.queryHash),o=i==null?void 0:i.state.data,s=EA(t,o);if(s!==void 0)return z(this,Ve).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Ut.batch(()=>z(this,Ve).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=z(this,Ve).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=z(this,Ve);Ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=z(this,Ve),r={type:"active",...e};return Ut.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ut.batch(()=>z(this,Ve).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kn).catch(Kn)}invalidateQueries(e,t={}){return Ut.batch(()=>{if(z(this,Ve).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ut.batch(()=>z(this,Ve).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Kn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Kn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=z(this,Ve).build(this,t);return n.isStaleByTime(V0(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kn).catch(Kn)}fetchInfiniteQuery(e){return e.behavior=Y0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kn).catch(Kn)}ensureInfiniteQueryData(e){return e.behavior=Y0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return td.isOnline()?z(this,vi).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,Ve)}getMutationCache(){return z(this,vi)}getDefaultOptions(){return z(this,xi)}setDefaultOptions(e){he(this,xi,e)}setQueryDefaults(e,t){z(this,js).set(Aa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,js).values()],n={};return t.forEach(r=>{Ra(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){z(this,Vs).set(Aa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,Vs).values()];let n={};return t.forEach(r=>{Ra(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=yy(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===by&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,Ve).clear(),z(this,vi).clear()}},Ve=new WeakMap,vi=new WeakMap,xi=new WeakMap,js=new WeakMap,Vs=new WeakMap,Si=new WeakMap,Ws=new WeakMap,Ks=new WeakMap,xx),UA=A.createContext(void 0),HA=({client:e,children:t})=>(A.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),k.jsx(UA.Provider,{value:e,children:t}));const jA=new $A({defaultOptions:{queries:{queryFn:async({queryKey:e})=>{const t=await fetch(e[0],{credentials:"include"});if(!t.ok)throw t.status>=500?new Error(`${t.status}: ${t.statusText}`):new Error(`${t.status}: ${await t.text()}`);return t.json()},refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}}),VA=1,WA=1e6;let Cp=0;function KA(){return Cp=(Cp+1)%Number.MAX_SAFE_INTEGER,Cp.toString()}const _p=new Map,X0=e=>{if(_p.has(e))return;const t=setTimeout(()=>{_p.delete(e),ta({type:"REMOVE_TOAST",toastId:e})},WA);_p.set(e,t)},qA=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,VA)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?X0(n):e.toasts.forEach(r=>{X0(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},yu=[];let bu={toasts:[]};function ta(e){bu=qA(bu,e),yu.forEach(t=>{t(bu)})}function GA({...e}){const t=KA(),n=i=>ta({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>ta({type:"DISMISS_TOAST",toastId:t});return ta({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function YA(){const[e,t]=A.useState(bu);return A.useEffect(()=>(yu.push(t),()=>{const n=yu.indexOf(t);n>-1&&yu.splice(n,1)}),[e]),{...e,toast:GA,dismiss:n=>ta({type:"DISMISS_TOAST",toastId:n})}}function mn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function QA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function V1(...e){return t=>e.forEach(n=>QA(n,t))}function Lo(...e){return A.useCallback(V1(...e),e)}function XA(e,t=[]){let n=[];function r(o,s){const l=A.createContext(s),a=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...h}=d,m=(f==null?void 0:f[e][a])||l,y=A.useMemo(()=>h,Object.values(h));return k.jsx(m.Provider,{value:y,children:p})}function u(d,f){const p=(f==null?void 0:f[e][a])||l,h=A.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(l){const a=(l==null?void 0:l[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...l,[e]:a}}),[l,a])}};return i.scopeName=e,[r,JA(i,...t)]}function JA(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((l,{useScope:a,scopeName:c})=>{const d=a(o)[`__scope${c}`];return{...l,...d}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var nd=A.forwardRef((e,t)=>{const{children:n,...r}=e,i=A.Children.toArray(n),o=i.find(eR);if(o){const s=o.props.children,l=i.map(a=>a===o?A.Children.count(s)>1?A.Children.only(null):A.isValidElement(s)?s.props.children:null:a);return k.jsx(wm,{...r,ref:t,children:A.isValidElement(s)?A.cloneElement(s,void 0,l):null})}return k.jsx(wm,{...r,ref:t,children:n})});nd.displayName="Slot";var wm=A.forwardRef((e,t)=>{const{children:n,...r}=e;if(A.isValidElement(n)){const i=nR(n);return A.cloneElement(n,{...tR(r,n.props),ref:t?V1(t,i):i})}return A.Children.count(n)>1?A.Children.only(null):null});wm.displayName="SlotClone";var ZA=({children:e})=>k.jsx(k.Fragment,{children:e});function eR(e){return A.isValidElement(e)&&e.type===ZA}function tR(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{o(...l),i(...l)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function nR(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function rR(e){const t=e+"CollectionProvider",[n,r]=XA(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:h,children:m}=p,y=Ke.useRef(null),g=Ke.useRef(new Map).current;return k.jsx(i,{scope:h,itemMap:g,collectionRef:y,children:m})};s.displayName=t;const l=e+"CollectionSlot",a=Ke.forwardRef((p,h)=>{const{scope:m,children:y}=p,g=o(l,m),b=Lo(h,g.collectionRef);return k.jsx(nd,{ref:b,children:y})});a.displayName=l;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ke.forwardRef((p,h)=>{const{scope:m,children:y,...g}=p,b=Ke.useRef(null),E=Lo(h,b),v=o(c,m);return Ke.useEffect(()=>(v.itemMap.set(b,{ref:b,...g}),()=>void v.itemMap.delete(b))),k.jsx(nd,{[u]:"",ref:E,children:y})});d.displayName=c;function f(p){const h=o(e+"CollectionConsumer",p);return Ke.useCallback(()=>{const y=h.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(h.itemMap.values()).sort((v,S)=>g.indexOf(v.ref.current)-g.indexOf(S.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:s,Slot:a,ItemSlot:d},f,r]}function iR(e,t=[]){let n=[];function r(o,s){const l=A.createContext(s),a=n.length;n=[...n,s];const c=d=>{var g;const{scope:f,children:p,...h}=d,m=((g=f==null?void 0:f[e])==null?void 0:g[a])||l,y=A.useMemo(()=>h,Object.values(h));return k.jsx(m.Provider,{value:y,children:p})};c.displayName=o+"Provider";function u(d,f){var m;const p=((m=f==null?void 0:f[e])==null?void 0:m[a])||l,h=A.useContext(p);if(h)return h;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(l){const a=(l==null?void 0:l[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...l,[e]:a}}),[l,a])}};return i.scopeName=e,[r,oR(i,...t)]}function oR(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=r.reduce((l,{useScope:a,scopeName:c})=>{const d=a(o)[`__scope${c}`];return{...l,...d}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var sR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],_r=sR.reduce((e,t)=>{const n=A.forwardRef((r,i)=>{const{asChild:o,...s}=r,l=o?nd:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),k.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function W1(e,t){e&&dl.flushSync(()=>e.dispatchEvent(t))}function Jr(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function lR(e,t=globalThis==null?void 0:globalThis.document){const n=Jr(e);A.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var aR="DismissableLayer",vm="dismissableLayer.update",cR="dismissableLayer.pointerDownOutside",uR="dismissableLayer.focusOutside",J0,K1=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q1=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...a}=e,c=A.useContext(K1),[u,d]=A.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=A.useState({}),h=Lo(t,_=>d(_)),m=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(y),b=u?m.indexOf(u):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,v=b>=g,S=fR(_=>{const R=_.target,I=[...c.branches].some($=>$.contains(R));!v||I||(i==null||i(_),s==null||s(_),_.defaultPrevented||l==null||l())},f),x=pR(_=>{const R=_.target;[...c.branches].some($=>$.contains(R))||(o==null||o(_),s==null||s(_),_.defaultPrevented||l==null||l())},f);return lR(_=>{b===c.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},f),A.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(J0=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Z0(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=J0)}},[u,f,n,c]),A.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Z0())},[u,c]),A.useEffect(()=>{const _=()=>p({});return document.addEventListener(vm,_),()=>document.removeEventListener(vm,_)},[]),k.jsx(_r.div,{...a,ref:h,style:{pointerEvents:E?v?"auto":"none":void 0,...e.style},onFocusCapture:mn(e.onFocusCapture,x.onFocusCapture),onBlurCapture:mn(e.onBlurCapture,x.onBlurCapture),onPointerDownCapture:mn(e.onPointerDownCapture,S.onPointerDownCapture)})});q1.displayName=aR;var dR="DismissableLayerBranch",G1=A.forwardRef((e,t)=>{const n=A.useContext(K1),r=A.useRef(null),i=Lo(t,r);return A.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),k.jsx(_r.div,{...e,ref:i})});G1.displayName=dR;function fR(e,t=globalThis==null?void 0:globalThis.document){const n=Jr(e),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const o=l=>{if(l.target&&!r.current){let a=function(){Y1(cR,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=a,t.addEventListener("click",i.current,{once:!0})):a()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pR(e,t=globalThis==null?void 0:globalThis.document){const n=Jr(e),r=A.useRef(!1);return A.useEffect(()=>{const i=o=>{o.target&&!r.current&&Y1(uR,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Z0(){const e=new CustomEvent(vm);document.dispatchEvent(e)}function Y1(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?W1(i,o):i.dispatchEvent(o)}var hR=q1,mR=G1,rd=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{},gR="Portal",Q1=A.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,o]=A.useState(!1);rd(()=>o(!0),[]);const s=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?P1.createPortal(k.jsx(_r.div,{...r,ref:t}),s):null});Q1.displayName=gR;function yR(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var X1=e=>{const{present:t,children:n}=e,r=bR(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=Lo(r.ref,ER(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};X1.displayName="Presence";function bR(e){const[t,n]=A.useState(),r=A.useRef({}),i=A.useRef(e),o=A.useRef("none"),s=e?"mounted":"unmounted",[l,a]=yR(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=Ac(r.current);o.current=l==="mounted"?c:"none"},[l]),rd(()=>{const c=r.current,u=i.current;if(u!==e){const f=o.current,p=Ac(c);e?a("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?a("UNMOUNT"):a(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,a]),rd(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const m=Ac(r.current).includes(p.animationName);if(p.target===t&&m&&(a("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(o.current=Ac(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:A.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Ac(e){return(e==null?void 0:e.animationName)||"none"}function ER(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wR({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=vR({defaultProp:t,onChange:n}),o=e!==void 0,s=o?e:r,l=Jr(n),a=A.useCallback(c=>{if(o){const d=typeof c=="function"?c(e):c;d!==e&&l(d)}else i(c)},[o,e,i,l]);return[s,a]}function vR({defaultProp:e,onChange:t}){const n=A.useState(e),[r]=n,i=A.useRef(r),o=Jr(t);return A.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var xR="VisuallyHidden",Ey=A.forwardRef((e,t)=>k.jsx(_r.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ey.displayName=xR;var wy="ToastProvider",[vy,SR,kR]=rR("Toast"),[J1,yK]=iR("Toast",[kR]),[CR,bf]=J1(wy),Z1=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:o=50,children:s}=e,[l,a]=A.useState(null),[c,u]=A.useState(0),d=A.useRef(!1),f=A.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${wy}\`. Expected non-empty \`string\`.`),k.jsx(vy.Provider,{scope:t,children:k.jsx(CR,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:o,toastCount:c,viewport:l,onViewportChange:a,onToastAdd:A.useCallback(()=>u(p=>p+1),[]),onToastRemove:A.useCallback(()=>u(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:s})})};Z1.displayName=wy;var ek="ToastViewport",_R=["F8"],xm="toast.viewportPause",Sm="toast.viewportResume",tk=A.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=_R,label:i="Notifications ({hotkey})",...o}=e,s=bf(ek,n),l=SR(n),a=A.useRef(null),c=A.useRef(null),u=A.useRef(null),d=A.useRef(null),f=Lo(t,d,s.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=s.toastCount>0;A.useEffect(()=>{const y=g=>{var E;r.length!==0&&r.every(v=>g[v]||g.code===v)&&((E=d.current)==null||E.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),A.useEffect(()=>{const y=a.current,g=d.current;if(h&&y&&g){const b=()=>{if(!s.isClosePausedRef.current){const x=new CustomEvent(xm);g.dispatchEvent(x),s.isClosePausedRef.current=!0}},E=()=>{if(s.isClosePausedRef.current){const x=new CustomEvent(Sm);g.dispatchEvent(x),s.isClosePausedRef.current=!1}},v=x=>{!y.contains(x.relatedTarget)&&E()},S=()=>{y.contains(document.activeElement)||E()};return y.addEventListener("focusin",b),y.addEventListener("focusout",v),y.addEventListener("pointermove",b),y.addEventListener("pointerleave",S),window.addEventListener("blur",b),window.addEventListener("focus",E),()=>{y.removeEventListener("focusin",b),y.removeEventListener("focusout",v),y.removeEventListener("pointermove",b),y.removeEventListener("pointerleave",S),window.removeEventListener("blur",b),window.removeEventListener("focus",E)}}},[h,s.isClosePausedRef]);const m=A.useCallback(({tabbingDirection:y})=>{const b=l().map(E=>{const v=E.ref.current,S=[v,...zR(v)];return y==="forwards"?S:S.reverse()});return(y==="forwards"?b.reverse():b).flat()},[l]);return A.useEffect(()=>{const y=d.current;if(y){const g=b=>{var S,x,_;const E=b.altKey||b.ctrlKey||b.metaKey;if(b.key==="Tab"&&!E){const R=document.activeElement,I=b.shiftKey;if(b.target===y&&I){(S=c.current)==null||S.focus();return}const F=m({tabbingDirection:I?"backwards":"forwards"}),te=F.findIndex(V=>V===R);Tp(F.slice(te+1))?b.preventDefault():I?(x=c.current)==null||x.focus():(_=u.current)==null||_.focus()}};return y.addEventListener("keydown",g),()=>y.removeEventListener("keydown",g)}},[l,m]),k.jsxs(mR,{ref:a,role:"region","aria-label":i.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:h?void 0:"none"},children:[h&&k.jsx(km,{ref:c,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"forwards"});Tp(y)}}),k.jsx(vy.Slot,{scope:n,children:k.jsx(_r.ol,{tabIndex:-1,...o,ref:f})}),h&&k.jsx(km,{ref:u,onFocusFromOutsideViewport:()=>{const y=m({tabbingDirection:"backwards"});Tp(y)}})]})});tk.displayName=ek;var nk="ToastFocusProxy",km=A.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,o=bf(nk,n);return k.jsx(Ey,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:s=>{var c;const l=s.relatedTarget;!((c=o.viewport)!=null&&c.contains(l))&&r()}})});km.displayName=nk;var Ef="Toast",TR="toast.swipeStart",NR="toast.swipeMove",OR="toast.swipeCancel",MR="toast.swipeEnd",rk=A.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:o,...s}=e,[l=!0,a]=wR({prop:r,defaultProp:i,onChange:o});return k.jsx(X1,{present:n||l,children:k.jsx(IR,{open:l,...s,ref:t,onClose:()=>a(!1),onPause:Jr(e.onPause),onResume:Jr(e.onResume),onSwipeStart:mn(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:mn(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:mn(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:mn(e.onSwipeEnd,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),a(!1)})})})});rk.displayName=Ef;var[AR,RR]=J1(Ef,{onClose(){}}),IR=A.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:o,onClose:s,onEscapeKeyDown:l,onPause:a,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...h}=e,m=bf(Ef,n),[y,g]=A.useState(null),b=Lo(t,V=>g(V)),E=A.useRef(null),v=A.useRef(null),S=i||m.duration,x=A.useRef(0),_=A.useRef(S),R=A.useRef(0),{onToastAdd:I,onToastRemove:$}=m,j=Jr(()=>{var Y;(y==null?void 0:y.contains(document.activeElement))&&((Y=m.viewport)==null||Y.focus()),s()}),F=A.useCallback(V=>{!V||V===1/0||(window.clearTimeout(R.current),x.current=new Date().getTime(),R.current=window.setTimeout(j,V))},[j]);A.useEffect(()=>{const V=m.viewport;if(V){const Y=()=>{F(_.current),c==null||c()},D=()=>{const M=new Date().getTime()-x.current;_.current=_.current-M,window.clearTimeout(R.current),a==null||a()};return V.addEventListener(xm,D),V.addEventListener(Sm,Y),()=>{V.removeEventListener(xm,D),V.removeEventListener(Sm,Y)}}},[m.viewport,S,a,c,F]),A.useEffect(()=>{o&&!m.isClosePausedRef.current&&F(S)},[o,S,m.isClosePausedRef,F]),A.useEffect(()=>(I(),()=>$()),[I,$]);const te=A.useMemo(()=>y?uk(y):null,[y]);return m.viewport?k.jsxs(k.Fragment,{children:[te&&k.jsx(DR,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:te}),k.jsx(AR,{scope:n,onClose:j,children:dl.createPortal(k.jsx(vy.ItemSlot,{scope:n,children:k.jsx(hR,{asChild:!0,onEscapeKeyDown:mn(l,()=>{m.isFocusedToastEscapeKeyDownRef.current||j(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:k.jsx(_r.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":m.swipeDirection,...h,ref:b,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:mn(e.onKeyDown,V=>{V.key==="Escape"&&(l==null||l(V.nativeEvent),V.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:mn(e.onPointerDown,V=>{V.button===0&&(E.current={x:V.clientX,y:V.clientY})}),onPointerMove:mn(e.onPointerMove,V=>{if(!E.current)return;const Y=V.clientX-E.current.x,D=V.clientY-E.current.y,M=!!v.current,N=["left","right"].includes(m.swipeDirection),P=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,w=N?P(0,Y):0,q=N?0:P(0,D),J=V.pointerType==="touch"?10:2,C={x:w,y:q},ce={originalEvent:V,delta:C};M?(v.current=C,Rc(NR,d,ce,{discrete:!1})):eE(C,m.swipeDirection,J)?(v.current=C,Rc(TR,u,ce,{discrete:!1}),V.target.setPointerCapture(V.pointerId)):(Math.abs(Y)>J||Math.abs(D)>J)&&(E.current=null)}),onPointerUp:mn(e.onPointerUp,V=>{const Y=v.current,D=V.target;if(D.hasPointerCapture(V.pointerId)&&D.releasePointerCapture(V.pointerId),v.current=null,E.current=null,Y){const M=V.currentTarget,N={originalEvent:V,delta:Y};eE(Y,m.swipeDirection,m.swipeThreshold)?Rc(MR,p,N,{discrete:!0}):Rc(OR,f,N,{discrete:!0}),M.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),DR=e=>{const{__scopeToast:t,children:n,...r}=e,i=bf(Ef,t),[o,s]=A.useState(!1),[l,a]=A.useState(!1);return BR(()=>s(!0)),A.useEffect(()=>{const c=window.setTimeout(()=>a(!0),1e3);return()=>window.clearTimeout(c)},[]),l?null:k.jsx(Q1,{asChild:!0,children:k.jsx(Ey,{...r,children:o&&k.jsxs(k.Fragment,{children:[i.label," ",n]})})})},PR="ToastTitle",ik=A.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return k.jsx(_r.div,{...r,ref:t})});ik.displayName=PR;var LR="ToastDescription",ok=A.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return k.jsx(_r.div,{...r,ref:t})});ok.displayName=LR;var sk="ToastAction",lk=A.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?k.jsx(ck,{altText:n,asChild:!0,children:k.jsx(xy,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${sk}\`. Expected non-empty \`string\`.`),null)});lk.displayName=sk;var ak="ToastClose",xy=A.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=RR(ak,n);return k.jsx(ck,{asChild:!0,children:k.jsx(_r.button,{type:"button",...r,ref:t,onClick:mn(e.onClick,i.onClose)})})});xy.displayName=ak;var ck=A.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return k.jsx(_r.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function uk(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),FR(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!i)if(o){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...uk(r))}}),t}function Rc(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?W1(i,o):i.dispatchEvent(o)}var eE=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),o=r>i;return t==="left"||t==="right"?o&&r>n:!o&&i>n};function BR(e=()=>{}){const t=Jr(e);rd(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function FR(e){return e.nodeType===e.ELEMENT_NODE}function zR(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tp(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var $R=Z1,dk=tk,fk=rk,pk=ik,hk=ok,mk=lk,gk=xy;function yk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,nE=UR,HR=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return nE(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],d=o==null?void 0:o[c];if(u===null)return null;const f=tE(u)||tE(d);return i[c][f]}),l=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(h=>{let[m,y]=h;return Array.isArray(y)?y.includes({...o,...l}[m]):{...o,...l}[m]===y})?[...c,d,f]:c},[]);return nE(e,s,a,n==null?void 0:n.class,n==null?void 0:n.className)};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bk=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var VR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WR=A.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...l},a)=>A.createElement("svg",{ref:a,...VR,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:bk("lucide",i),...l},[...s.map(([c,u])=>A.createElement(c,u)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wo=(e,t)=>{const n=A.forwardRef(({className:r,...i},o)=>A.createElement(WR,{ref:o,iconNode:t,className:bk(`lucide-${jR(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const KR=Wo("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qR=Wo("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GR=Wo("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YR=Wo("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const QR=Wo("Skull",[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XR=Wo("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-react v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Sy=Wo("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ek(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=tI(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const l=s.split(ky);return l[0]===""&&l.length!==1&&l.shift(),wk(l,t)||eI(s)},getConflictingClassGroupIds:(s,l)=>{const a=n[s]||[];return l&&r[s]?[...a,...r[s]]:a}}},wk=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?wk(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(ky);return(s=t.validators.find(({validator:l})=>l(o)))==null?void 0:s.classGroupId},rE=/^\[(.+)\]$/,eI=e=>{if(rE.test(e)){const t=rE.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},tI=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return rI(Object.entries(e.classGroups),n).forEach(([o,s])=>{Cm(s,r,o,t)}),r},Cm=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:iE(t,i);o.classGroupId=n;return}if(typeof i=="function"){if(nI(i)){Cm(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([o,s])=>{Cm(s,iE(t,o),n,r)})})},iE=(e,t)=>{let n=e;return t.split(ky).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},nI=e=>e.isThemeGetter,rI=(e,t)=>t?e.map(([n,r])=>{const i=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,l])=>[t+s,l])):o);return[n,i]}):e,iI=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const i=(o,s)=>{n.set(o,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let s=n.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){n.has(o)?n.set(o,s):i(o,s)}}},vk="!",oI=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],o=t.length,s=l=>{const a=[];let c=0,u=0,d;for(let y=0;yu?d-u:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}};return n?l=>n({className:l,parseClassName:s}):s},sI=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},lI=e=>({cache:iI(e.cacheSize),parseClassName:oI(e),...ZR(e)}),aI=/\s+/,cI=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,o=[],s=e.trim().split(aI);let l="";for(let a=s.length-1;a>=0;a-=1){const c=s[a],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(c);let h=!!p,m=r(h?f.substring(0,p):f);if(!m){if(!h){l=c+(l.length>0?" "+l:l);continue}if(m=r(f),!m){l=c+(l.length>0?" "+l:l);continue}h=!1}const y=sI(u).join(":"),g=d?y+vk:y,b=g+m;if(o.includes(b))continue;o.push(b);const E=i(m,h);for(let v=0;v0?" "+l:l)}return l};function uI(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(u),e());return n=lI(c),r=n.cache.get,i=n.cache.set,o=l,l(a)}function l(a){const c=r(a);if(c)return c;const u=cI(a,n);return i(a,u),u}return function(){return o(uI.apply(null,arguments))}}const Re=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Sk=/^\[(?:([a-z-]+):)?(.+)\]$/i,fI=/^\d+\/\d+$/,pI=new Set(["px","full","screen"]),hI=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,mI=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,gI=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,yI=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bI=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rr=e=>As(e)||pI.has(e)||fI.test(e),ti=e=>fl(e,"length",_I),As=e=>!!e&&!Number.isNaN(Number(e)),Np=e=>fl(e,"number",As),Ol=e=>!!e&&Number.isInteger(Number(e)),EI=e=>e.endsWith("%")&&As(e.slice(0,-1)),me=e=>Sk.test(e),ni=e=>hI.test(e),wI=new Set(["length","size","percentage"]),vI=e=>fl(e,wI,kk),xI=e=>fl(e,"position",kk),SI=new Set(["image","url"]),kI=e=>fl(e,SI,NI),CI=e=>fl(e,"",TI),Ml=()=>!0,fl=(e,t,n)=>{const r=Sk.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},_I=e=>mI.test(e)&&!gI.test(e),kk=()=>!1,TI=e=>yI.test(e),NI=e=>bI.test(e),OI=()=>{const e=Re("colors"),t=Re("spacing"),n=Re("blur"),r=Re("brightness"),i=Re("borderColor"),o=Re("borderRadius"),s=Re("borderSpacing"),l=Re("borderWidth"),a=Re("contrast"),c=Re("grayscale"),u=Re("hueRotate"),d=Re("invert"),f=Re("gap"),p=Re("gradientColorStops"),h=Re("gradientColorStopPositions"),m=Re("inset"),y=Re("margin"),g=Re("opacity"),b=Re("padding"),E=Re("saturate"),v=Re("scale"),S=Re("sepia"),x=Re("skew"),_=Re("space"),R=Re("translate"),I=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",me,t],F=()=>[me,t],te=()=>["",Rr,ti],V=()=>["auto",As,me],Y=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",me],w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[As,me];return{cacheSize:500,separator:":",theme:{colors:[Ml],spacing:[Rr,ti],blur:["none","",ni,me],brightness:q(),borderColor:[e],borderRadius:["none","","full",ni,me],borderSpacing:F(),borderWidth:te(),contrast:q(),grayscale:P(),hueRotate:q(),invert:P(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[EI,ti],inset:j(),margin:j(),opacity:q(),padding:F(),saturate:q(),scale:q(),sepia:P(),skew:q(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[ni]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Y(),me]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ol,me]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Ol,me]}],"grid-cols":[{"grid-cols":[Ml]}],"col-start-end":[{col:["auto",{span:["full",Ol,me]},me]}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":[Ml]}],"row-start-end":[{row:["auto",{span:[Ol,me]},me]}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,t]}],"min-w":[{"min-w":[me,t,"min","max","fit"]}],"max-w":[{"max-w":[me,t,"none","full","min","max","fit","prose",{screen:[ni]},ni]}],h:[{h:[me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ni,ti]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Np]}],"font-family":[{font:[Ml]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",As,Np]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Rr,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Rr,ti]}],"underline-offset":[{"underline-offset":["auto",Rr,me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Y(),xI]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vI]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kI]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:D()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...D()]}],"outline-offset":[{"outline-offset":[Rr,me]}],"outline-w":[{outline:[Rr,ti]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Rr,ti]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ni,CI]}],"shadow-color":[{shadow:[Ml]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",ni,me]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[E]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[Ol,me]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Rr,ti,Np]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},MI=dI(OI);function pl(...e){return MI(JR(e))}const AI=$R,Ck=A.forwardRef(({className:e,...t},n)=>k.jsx(dk,{ref:n,className:pl("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Ck.displayName=dk.displayName;const RI=HR("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),_k=A.forwardRef(({className:e,variant:t,...n},r)=>k.jsx(fk,{ref:r,className:pl(RI({variant:t}),e),...n}));_k.displayName=fk.displayName;const II=A.forwardRef(({className:e,...t},n)=>k.jsx(mk,{ref:n,className:pl("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));II.displayName=mk.displayName;const Tk=A.forwardRef(({className:e,...t},n)=>k.jsx(gk,{ref:n,className:pl("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:k.jsx(Sy,{className:"h-4 w-4"})}));Tk.displayName=gk.displayName;const Nk=A.forwardRef(({className:e,...t},n)=>k.jsx(pk,{ref:n,className:pl("text-sm font-semibold",e),...t}));Nk.displayName=pk.displayName;const Ok=A.forwardRef(({className:e,...t},n)=>k.jsx(hk,{ref:n,className:pl("text-sm opacity-90",e),...t}));Ok.displayName=hk.displayName;function DI(){const{toasts:e}=YA();return k.jsxs(AI,{children:[e.map(function({id:t,title:n,description:r,action:i,...o}){return k.jsxs(_k,{...o,children:[k.jsxs("div",{className:"grid gap-1",children:[n&&k.jsx(Nk,{children:n}),r&&k.jsx(Ok,{children:r})]}),i,k.jsx(Tk,{})]},t)}),k.jsx(Ck,{})]})}function PI(){const[e,t]=A.useState([]),[n,r]=A.useState(!1),[i,o]=A.useState(!1);return A.useEffect(()=>{const s=["Your soul has been corrupted","A new demon has been summoned","System temperature: 666°C"],l=setInterval(()=>{const a={id:Date.now().toString(),message:s[Math.floor(Math.random()*s.length)],timestamp:new Date};t(c=>[...c.slice(-4),a]),o(!0),setTimeout(()=>o(!1),1e3)},3e4);return()=>clearInterval(l)},[]),k.jsxs("div",{className:"relative",children:[k.jsxs("button",{className:`windows-button flex items-center gap-1 ${i?"animate-pulse":""}`,onClick:()=>r(!n),children:[i?k.jsx(QR,{className:"w-4 h-4"}):k.jsx(KR,{className:"w-4 h-4"}),k.jsx("span",{children:e.length})]}),n&&k.jsx("div",{className:"absolute bottom-full right-0 mb-2 w-64 bg-black border-2 border-red-900 p-2 space-y-2",children:e.length>0?e.map(s=>k.jsxs("div",{className:"text-red-500 text-sm p-2 border border-red-900/50 hover:bg-red-900/20",children:[k.jsx("div",{children:s.message}),k.jsx("div",{className:"text-xs text-red-700",children:s.timestamp.toLocaleTimeString()})]},s.id)):k.jsx("div",{className:"text-red-500 text-sm",children:"No notifications"})})]})}function LI({onCreateWindow:e,onClose:t}){const n=[{label:"Terminal of Torment",type:"terminal"},{label:"Soul Explorer",type:"explorer"},{label:"Damned Notepad",type:"notepad"},{label:"Hell Settings",type:"settings"}],r=[{label:"Web Soul Scraper",type:"webscraper"},{label:"Hell Browser",type:"browser"},{label:"Novel Editor",type:"noveleditor"},{label:"DOOM",type:"doom"}];return k.jsxs("div",{className:"absolute bottom-full left-0 mb-1 w-48 bg-black border-2 border-red-900",children:[k.jsx("div",{className:"flex items-center p-2 bg-gradient-to-r from-red-900 to-red-800 border-b-2 border-red-900",children:k.jsx("span",{className:"text-red-300 font-bold select-none",children:"Windows PREQUEL'95"})}),k.jsxs("div",{className:"py-1",children:[n.map(i=>k.jsxs("button",{className:"w-full px-4 py-2 text-left text-red-500 hover:bg-red-900/20 flex items-center gap-2",onClick:()=>{e(i.type),t()},children:[k.jsxs("span",{className:"text-lg",children:[i.type==="terminal"&&"👿",i.type==="explorer"&&"💀",i.type==="notepad"&&"📜",i.type==="settings"&&"⚔️"]}),i.label]},i.type)),r.length>0&&k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"border-t border-red-900 my-1"}),k.jsx("div",{className:"px-4 py-2 text-red-700 text-sm",children:"Applications"}),r.map(i=>k.jsxs("button",{className:"w-full px-4 py-2 text-left text-red-500 hover:bg-red-900/20 flex items-center gap-2",onClick:()=>{e(i.type),t()},children:[k.jsx("span",{className:"text-lg",children:i.type==="doom"?"👹":"🔮"}),i.label]},i.type))]}),k.jsx("div",{className:"border-t border-red-900 my-1"}),k.jsxs("button",{className:"w-full px-4 py-2 text-left text-red-500 hover:bg-red-900/20 flex items-center gap-2",onClick:()=>{t()},children:[k.jsx("span",{className:"text-lg",children:"🔥"}),"Shut Down"]})]})]})}function BI({windows:e,onWindowClick:t,onCreateWindow:n}){const[r,i]=A.useState(!1);return k.jsxs("div",{className:"taskbar fixed bottom-0 w-full h-10 flex items-center px-2 gap-2",children:[k.jsxs("div",{className:"relative",children:[k.jsx("button",{className:`windows-button ${r?"border-red-900":""}`,onClick:()=>i(!r),children:"⛧ Start"}),r&&k.jsx(LI,{onCreateWindow:n,onClose:()=>i(!1)})]}),e.map(o=>k.jsx("button",{className:`windows-button flex-1 max-w-[200px] text-left truncate ${o.active?"border-red-900":""} ${o.minimized?"opacity-75":""}`,onClick:()=>t(o.id),children:o.title},o.id)),k.jsx("div",{className:"flex-1"}),k.jsx(PI,{}),k.jsx("div",{className:"windows-button px-4",children:new Date().toLocaleTimeString()})]})}var wf={exports:{}},Mk={},Ak={exports:{}},FI="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",zI=FI,$I=zI;function Rk(){}function Ik(){}Ik.resetWarningCache=Rk;var UI=function(){function e(r,i,o,s,l,a){if(a!==$I){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Ik,resetWarningCache:Rk};return n.PropTypes=n,n};Ak.exports=UI();var Dk=Ak.exports;function Pk(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;rt===n.identifier)||e.changedTouches&&(0,vn.findInArray)(e.changedTouches,n=>t===n.identifier)}function cD(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function uD(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&$k(e.body,"react-draggable-transparent-selection")}function dD(e){if(e)try{if(e.body&&Uk(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function $k(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function Uk(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.canDragX=hD;Nr.canDragY=mD;Nr.createCoreData=yD;Nr.createDraggableData=bD;Nr.getBoundPosition=fD;Nr.getControlPosition=gD;Nr.snapToGrid=pD;var fn=Tr,xs=Ye;function fD(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:ED(r);const i=_y(e);if(typeof r=="string"){const{ownerDocument:o}=i,s=o.defaultView;let l;if(r==="parent"?l=i.parentNode:l=o.querySelector(r),!(l instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const a=l,c=s.getComputedStyle(i),u=s.getComputedStyle(a);r={left:-i.offsetLeft+(0,fn.int)(u.paddingLeft)+(0,fn.int)(c.marginLeft),top:-i.offsetTop+(0,fn.int)(u.paddingTop)+(0,fn.int)(c.marginTop),right:(0,xs.innerWidth)(a)-(0,xs.outerWidth)(i)-i.offsetLeft+(0,fn.int)(u.paddingRight)-(0,fn.int)(c.marginRight),bottom:(0,xs.innerHeight)(a)-(0,xs.outerHeight)(i)-i.offsetTop+(0,fn.int)(u.paddingBottom)-(0,fn.int)(c.marginBottom)}}return(0,fn.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,fn.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,fn.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,fn.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pD(e,t,n){const r=Math.round(t/e[0])*e[0],i=Math.round(n/e[1])*e[1];return[r,i]}function hD(e){return e.props.axis==="both"||e.props.axis==="x"}function mD(e){return e.props.axis==="both"||e.props.axis==="y"}function gD(e,t,n){const r=typeof t=="number"?(0,xs.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const i=_y(n),o=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return(0,xs.offsetXYFromParent)(r||e,o,n.props.scale)}function yD(e,t,n){const r=!(0,fn.isNum)(e.lastX),i=_y(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function bD(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function ED(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function _y(e){const t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}var vf={},xf={};Object.defineProperty(xf,"__esModule",{value:!0});xf.default=wD;function wD(){}Object.defineProperty(vf,"__esModule",{value:!0});vf.default=void 0;var Mp=xD(A),Yt=Ty(Dk),vD=Ty(dl),_t=Ye,ri=Nr,Ap=Tr,Al=Ty(xf);function Ty(e){return e&&e.__esModule?e:{default:e}}function Hk(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Hk=function(r){return r?n:t})(e)}function xD(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Hk(t);if(n&&n.has(e))return n.get(e);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(o!=="default"&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}function Bt(e,t,n){return t=SD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SD(e){var t=kD(e,"string");return typeof t=="symbol"?t:String(t)}function kD(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Vn={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ii=Vn.mouse,Sf=class extends Mp.Component{constructor(){super(...arguments),Bt(this,"dragging",!1),Bt(this,"lastX",NaN),Bt(this,"lastY",NaN),Bt(this,"touchIdentifier",null),Bt(this,"mounted",!1),Bt(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,_t.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,_t.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const i=(0,_t.getTouchIdentifier)(t);this.touchIdentifier=i;const o=(0,ri.getControlPosition)(t,i,this);if(o==null)return;const{x:s,y:l}=o,a=(0,ri.createCoreData)(this,s,l);(0,Al.default)("DraggableCore: handleDragStart: %j",a),(0,Al.default)("calling",this.props.onStart),!(this.props.onStart(t,a)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,_t.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=l,(0,_t.addEvent)(r,ii.move,this.handleDrag),(0,_t.addEvent)(r,ii.stop,this.handleDragStop))}),Bt(this,"handleDrag",t=>{const n=(0,ri.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX,a=i-this.lastY;if([l,a]=(0,ri.snapToGrid)(this.props.grid,l,a),!l&&!a)return;r=this.lastX+l,i=this.lastY+a}const o=(0,ri.createCoreData)(this,r,i);if((0,Al.default)("DraggableCore: handleDrag: %j",o),this.props.onDrag(t,o)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const a=document.createEvent("MouseEvents");a.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(a)}return}this.lastX=r,this.lastY=i}),Bt(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,ri.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:i}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX||0,c=i-this.lastY||0;[a,c]=(0,ri.snapToGrid)(this.props.grid,a,c),r=this.lastX+a,i=this.lastY+c}const o=(0,ri.createCoreData)(this,r,i);if(this.props.onStop(t,o)===!1||this.mounted===!1)return!1;const l=this.findDOMNode();l&&this.props.enableUserSelectHack&&(0,_t.removeUserSelectStyles)(l.ownerDocument),(0,Al.default)("DraggableCore: handleDragStop: %j",o),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,l&&((0,Al.default)("DraggableCore: Removing handlers"),(0,_t.removeEvent)(l.ownerDocument,ii.move,this.handleDrag),(0,_t.removeEvent)(l.ownerDocument,ii.stop,this.handleDragStop))}),Bt(this,"onMouseDown",t=>(ii=Vn.mouse,this.handleDragStart(t))),Bt(this,"onMouseUp",t=>(ii=Vn.mouse,this.handleDragStop(t))),Bt(this,"onTouchStart",t=>(ii=Vn.touch,this.handleDragStart(t))),Bt(this,"onTouchEnd",t=>(ii=Vn.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,_t.addEvent)(t,Vn.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,_t.removeEvent)(n,Vn.mouse.move,this.handleDrag),(0,_t.removeEvent)(n,Vn.touch.move,this.handleDrag),(0,_t.removeEvent)(n,Vn.mouse.stop,this.handleDragStop),(0,_t.removeEvent)(n,Vn.touch.stop,this.handleDragStop),(0,_t.removeEvent)(t,Vn.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,_t.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:vD.default.findDOMNode(this)}render(){return Mp.cloneElement(Mp.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};vf.default=Sf;Bt(Sf,"displayName","DraggableCore");Bt(Sf,"propTypes",{allowAnyClick:Yt.default.bool,children:Yt.default.node.isRequired,disabled:Yt.default.bool,enableUserSelectHack:Yt.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:Yt.default.arrayOf(Yt.default.number),handle:Yt.default.string,cancel:Yt.default.string,nodeRef:Yt.default.object,onStart:Yt.default.func,onDrag:Yt.default.func,onStop:Yt.default.func,onMouseDown:Yt.default.func,scale:Yt.default.number,className:Ap.dontSetMe,style:Ap.dontSetMe,transform:Ap.dontSetMe});Bt(Sf,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return a.default}}),e.default=void 0;var t=f(A),n=u(Dk),r=u(dl),i=u(jI),o=Ye,s=Nr,l=Tr,a=u(vf),c=u(xf);function u(b){return b&&b.__esModule?b:{default:b}}function d(b){if(typeof WeakMap!="function")return null;var E=new WeakMap,v=new WeakMap;return(d=function(S){return S?v:E})(b)}function f(b,E){if(b&&b.__esModule)return b;if(b===null||typeof b!="object"&&typeof b!="function")return{default:b};var v=d(E);if(v&&v.has(b))return v.get(b);var S={},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in b)if(_!=="default"&&Object.prototype.hasOwnProperty.call(b,_)){var R=x?Object.getOwnPropertyDescriptor(b,_):null;R&&(R.get||R.set)?Object.defineProperty(S,_,R):S[_]=b[_]}return S.default=b,v&&v.set(b,S),S}function p(){return p=Object.assign?Object.assign.bind():function(b){for(var E=1;E{if((0,c.default)("Draggable: onDragStart: %j",S),this.props.onStart(v,(0,s.createDraggableData)(this,S))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),h(this,"onDrag",(v,S)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",S);const x=(0,s.createDraggableData)(this,S),_={x:x.x,y:x.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:$}=_;_.x+=this.state.slackX,_.y+=this.state.slackY;const[j,F]=(0,s.getBoundPosition)(this,_.x,_.y);_.x=j,_.y=F,_.slackX=this.state.slackX+(I-_.x),_.slackY=this.state.slackY+($-_.y),x.x=_.x,x.y=_.y,x.deltaX=_.x-this.state.x,x.deltaY=_.y-this.state.y}if(this.props.onDrag(v,x)===!1)return!1;this.setState(_)}),h(this,"onDragStop",(v,S)=>{if(!this.state.dragging||this.props.onStop(v,(0,s.createDraggableData)(this,S))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",S);const _={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:$}=this.props.position;_.x=I,_.y=$}this.setState(_)}),this.state={dragging:!1,dragged:!1,x:E.position?E.position.x:E.defaultPosition.x,y:E.position?E.position.y:E.defaultPosition.y,prevPropsPosition:{...E.position},slackX:0,slackY:0,isElementSVG:!1},E.position&&!(E.onDrag||E.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var E,v;return(E=(v=this.props)===null||v===void 0||(v=v.nodeRef)===null||v===void 0?void 0:v.current)!==null&&E!==void 0?E:r.default.findDOMNode(this)}render(){const{axis:E,bounds:v,children:S,defaultPosition:x,defaultClassName:_,defaultClassNameDragging:R,defaultClassNameDragged:I,position:$,positionOffset:j,scale:F,...te}=this.props;let V={},Y=null;const M=!!!$||this.state.dragging,N=$||x,P={x:(0,s.canDragX)(this)&&M?this.state.x:N.x,y:(0,s.canDragY)(this)&&M?this.state.y:N.y};this.state.isElementSVG?Y=(0,o.createSVGTransform)(P,j):V=(0,o.createCSSTransform)(P,j);const w=(0,i.default)(S.props.className||"",_,{[R]:this.state.dragging,[I]:this.state.dragged});return t.createElement(a.default,p({},te,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(S),{className:w,style:{...S.props.style,...V},transform:Y}))}}e.default=g,h(g,"displayName","Draggable"),h(g,"propTypes",{...a.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),h(g,"defaultProps",{...a.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Mk);const{default:jk,DraggableCore:CD}=Mk;wf.exports=jk;wf.exports.default=jk;wf.exports.DraggableCore=CD;var _D=wf.exports;const TD=Za(_D);function ND({window:e,children:t,onClose:n,onClick:r,onMinimize:i}){const[o,s]=A.useState(!1);A.useEffect(()=>{const d=()=>{s(globalThis.window.innerWidth<=768)};return d(),globalThis.window.addEventListener("resize",d),()=>globalThis.window.removeEventListener("resize",d)},[]);const l=d=>{d.stopPropagation(),n()},a=d=>{d.stopPropagation(),i()},u=((d,f)=>{if(f)return{width:"90vw",height:"80vh",maxWidth:"90vw",maxHeight:"80vh",top:"10vh",left:"5vw"};switch(d){case"terminal":return{width:"600px",height:"500px"};case"explorer":return{width:"400px",height:"300px"};case"noveleditor":return{width:"800px",height:"600px"};case"webscraper":case"browser":return{width:"600px",height:"500px"};default:return{width:"400px",height:"300px"}}})(e.type,o);return e.minimized?null:k.jsx(TD,{handle:".windows-titlebar",defaultPosition:o?{x:0,y:0}:e.position,bounds:"parent",children:k.jsxs("div",{className:`window absolute ${e.active?"z-10":"z-0"}`,onClick:r,style:{width:u.width,height:u.height,minWidth:o?"90vw":"300px",minHeight:o?"60vh":"200px",maxWidth:o?"90vw":"calc(100vw - 40px)",maxHeight:o?"80vh":"calc(100vh - 80px)",resize:o?"none":"both",overflow:"hidden",...o&&{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)"}},children:[k.jsxs("div",{className:"windows-titlebar flex justify-between items-center px-2",children:[k.jsx("span",{className:"text-red-300 text-xs sm:text-sm select-none",children:e.title}),k.jsxs("div",{className:"flex gap-1",children:[k.jsx("button",{className:"windows-button p-1",onClick:a,children:k.jsx(YR,{className:"w-2 h-2 sm:w-3 sm:h-3"})}),!o&&k.jsx("button",{className:"windows-button p-1",onClick:d=>d.stopPropagation(),children:k.jsx(XR,{className:"w-2 h-2 sm:w-3 sm:h-3"})}),k.jsx("button",{className:"windows-button p-1",onClick:l,children:k.jsx(Sy,{className:"w-2 h-2 sm:w-3 sm:h-3"})})]})]}),k.jsx("div",{className:"h-[calc(100%-24px)] overflow-hidden text-xs sm:text-sm",children:t})]})})}const OD={demon:String.raw` __ ____ ________ ____ ___ _____ / / / __ \/ ___/ _ \/ __ \`/ / / / _ \/ / / /_/ / / / __/ /_/ / /_/ / __/ / / .___/_/ \___/\__, /\__,_/\___/_/ /_/ /_/ `};function MD(e){return OD[e]||""}function AD(){const[e,t]=A.useState(""),[n,r]=A.useState([]),[i,o]=A.useState("C:\\Users\\Prequel"),s=A.useRef(null);A.useEffect(()=>{r([MD("demon"),"Welcome to Hell Command Prompt v6.66"])},[]),A.useEffect(()=>{var a;(a=s.current)==null||a.scrollIntoView({behavior:"smooth"})},[n]);const l=a=>{var p;const c={help:()=>"Available commands: help, dir, cd, cls, type, echo",dir:()=>`Directory listing of souls: . .. TORMENT.EXE SOULS.DAT DEMON.CFG`,cls:()=>(r([]),""),cd:h=>(o(`C:\\Users\\Prequel\\${h}`),`Changed directory to ${h}`)},[u,...d]=a.toLowerCase().split(" "),f=((p=c[u])==null?void 0:p.call(c,d.join(" ")))||`'${u}' is not recognized as an internal command`;r([...n,`${i}>${a}`,f]),t("")};return k.jsxs("div",{className:"bg-black text-red-500 p-2 font-mono h-full overflow-auto",children:[n.map((a,c)=>k.jsx("pre",{className:"whitespace-pre-wrap",children:a},c)),k.jsxs("div",{className:"flex",children:[k.jsxs("span",{children:[i,">"]}),k.jsx("input",{type:"text",value:e,onChange:a=>t(a.target.value),onKeyDown:a=>{a.key==="Enter"&&l(e)},className:"bg-transparent outline-none border-none flex-1 ml-1",autoFocus:!0})]}),k.jsx("div",{ref:s})]})}class RD{constructor(){this.structure={"/":{items:[{name:"SYSTEM",type:"folder"},{name:"SOULS",type:"folder"},{name:"README.TXT",type:"file",content:"Welcome to Hell OS"}]},"/SYSTEM/":{items:[{name:"HELL.SYS",type:"file"},{name:"DEMON.DLL",type:"file"}]},"/SOULS/":{items:[{name:"TORMENTED.666",type:"file"},{name:"DAMNED.LST",type:"file"}]}}}getFolder(t){return this.structure[t]||{items:[]}}}const ID=new RD;function DD(){const[e,t]=A.useState("/"),n=ID.getFolder(e);return k.jsxs("div",{className:"bg-black text-red-500 h-full",children:[k.jsxs("div",{className:"windows-titlebar mb-2 px-2",children:["Address: ",e]}),k.jsx("div",{className:"grid grid-cols-4 gap-2 p-2",children:n.items.map(r=>k.jsxs("div",{className:"flex flex-col items-center cursor-pointer hover:bg-red-900/20 p-2",onDoubleClick:()=>{r.type==="folder"&&t(`${e}${r.name}/`)},children:[k.jsx("div",{className:"text-2xl",children:r.type==="folder"?"📁":"📄"}),k.jsx("div",{className:"text-sm text-center truncate w-full",children:r.name})]},r.name))})]})}function PD(){const[e,t]=A.useState("");return k.jsx("div",{className:"h-full flex flex-col",children:k.jsx("textarea",{className:"flex-1 bg-black text-red-500 p-2 resize-none outline-none border border-red-900",value:e,onChange:n=>t(n.target.value),placeholder:"Write your damned notes here..."})})}function LD(){const[e,t]=A.useState({tormentLevel:6.66,screenFlicker:!0,bloodMode:!0});return k.jsxs("div",{className:"bg-black text-red-500 p-4",children:[k.jsx("h2",{className:"text-xl mb-4 border-b border-red-900 pb-2",children:"Hell Settings"}),k.jsxs("div",{className:"space-y-4",children:[k.jsxs("div",{className:"flex items-center justify-between",children:[k.jsx("label",{children:"Torment Level:"}),k.jsx("input",{type:"range",min:"1",max:"10",step:"0.01",value:e.tormentLevel,onChange:n=>t({...e,tormentLevel:parseFloat(n.target.value)}),className:"accent-red-500"}),k.jsx("span",{className:"ml-2",children:e.tormentLevel})]}),k.jsxs("div",{className:"flex items-center justify-between",children:[k.jsx("label",{children:"Screen Flicker:"}),k.jsx("input",{type:"checkbox",checked:e.screenFlicker,onChange:n=>t({...e,screenFlicker:n.target.checked}),className:"accent-red-500"})]}),k.jsxs("div",{className:"flex items-center justify-between",children:[k.jsx("label",{children:"Blood Mode:"}),k.jsx("input",{type:"checkbox",checked:e.bloodMode,onChange:n=>t({...e,bloodMode:n.target.checked}),className:"accent-red-500"})]})]})]})}function Vk(e,t){return function(){return e.apply(t,arguments)}}const{toString:BD}=Object.prototype,{getPrototypeOf:Ny}=Object,kf=(e=>t=>{const n=BD.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),nr=e=>(e=e.toLowerCase(),t=>kf(t)===e),Cf=e=>t=>typeof t===e,{isArray:hl}=Array,Ia=Cf("undefined");function FD(e){return e!==null&&!Ia(e)&&e.constructor!==null&&!Ia(e.constructor)&&xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Wk=nr("ArrayBuffer");function zD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Wk(e.buffer),t}const $D=Cf("string"),xn=Cf("function"),Kk=Cf("number"),_f=e=>e!==null&&typeof e=="object",UD=e=>e===!0||e===!1,Eu=e=>{if(kf(e)!=="object")return!1;const t=Ny(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},HD=nr("Date"),jD=nr("File"),VD=nr("Blob"),WD=nr("FileList"),KD=e=>_f(e)&&xn(e.pipe),qD=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xn(e.append)&&((t=kf(e))==="formdata"||t==="object"&&xn(e.toString)&&e.toString()==="[object FormData]"))},GD=nr("URLSearchParams"),[YD,QD,XD,JD]=["ReadableStream","Request","Response","Headers"].map(nr),ZD=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function oc(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),hl(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const fo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Gk=e=>!Ia(e)&&e!==fo;function _m(){const{caseless:e}=Gk(this)&&this||{},t={},n=(r,i)=>{const o=e&&qk(t,i)||i;Eu(t[o])&&Eu(r)?t[o]=_m(t[o],r):Eu(r)?t[o]=_m({},r):hl(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(oc(t,(i,o)=>{n&&xn(i)?e[o]=Vk(i,n):e[o]=i},{allOwnKeys:r}),e),tP=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),nP=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},rP=(e,t,n,r)=>{let i,o,s;const l={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!l[s]&&(t[s]=e[s],l[s]=!0);e=n!==!1&&Ny(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},iP=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},oP=e=>{if(!e)return null;if(hl(e))return e;let t=e.length;if(!Kk(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},sP=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ny(Uint8Array)),lP=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},aP=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},cP=nr("HTMLFormElement"),uP=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),lE=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dP=nr("RegExp"),Yk=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};oc(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},fP=e=>{Yk(e,(t,n)=>{if(xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},pP=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return hl(e)?r(e):r(String(e).split(t)),n},hP=()=>{},mP=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Rp="abcdefghijklmnopqrstuvwxyz",aE="0123456789",Qk={DIGIT:aE,ALPHA:Rp,ALPHA_DIGIT:Rp+Rp.toUpperCase()+aE},gP=(e=16,t=Qk.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function yP(e){return!!(e&&xn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const bP=e=>{const t=new Array(10),n=(r,i)=>{if(_f(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=hl(r)?[]:{};return oc(r,(s,l)=>{const a=n(s,i+1);!Ia(a)&&(o[l]=a)}),t[i]=void 0,o}}return r};return n(e,0)},EP=nr("AsyncFunction"),wP=e=>e&&(_f(e)||xn(e))&&xn(e.then)&&xn(e.catch),Xk=((e,t)=>e?setImmediate:t?((n,r)=>(fo.addEventListener("message",({source:i,data:o})=>{i===fo&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),fo.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xn(fo.postMessage)),vP=typeof queueMicrotask<"u"?queueMicrotask.bind(fo):typeof process<"u"&&process.nextTick||Xk,B={isArray:hl,isArrayBuffer:Wk,isBuffer:FD,isFormData:qD,isArrayBufferView:zD,isString:$D,isNumber:Kk,isBoolean:UD,isObject:_f,isPlainObject:Eu,isReadableStream:YD,isRequest:QD,isResponse:XD,isHeaders:JD,isUndefined:Ia,isDate:HD,isFile:jD,isBlob:VD,isRegExp:dP,isFunction:xn,isStream:KD,isURLSearchParams:GD,isTypedArray:sP,isFileList:WD,forEach:oc,merge:_m,extend:eP,trim:ZD,stripBOM:tP,inherits:nP,toFlatObject:rP,kindOf:kf,kindOfTest:nr,endsWith:iP,toArray:oP,forEachEntry:lP,matchAll:aP,isHTMLForm:cP,hasOwnProperty:lE,hasOwnProp:lE,reduceDescriptors:Yk,freezeMethods:fP,toObjectSet:pP,toCamelCase:uP,noop:hP,toFiniteNumber:mP,findKey:qk,global:fo,isContextDefined:Gk,ALPHABET:Qk,generateString:gP,isSpecCompliantForm:yP,toJSONObject:bP,isAsyncFn:EP,isThenable:wP,setImmediate:Xk,asap:vP};function pe(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}B.inherits(pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}});const Jk=pe.prototype,Zk={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zk[e]={value:e}});Object.defineProperties(pe,Zk);Object.defineProperty(Jk,"isAxiosError",{value:!0});pe.from=(e,t,n,r,i,o)=>{const s=Object.create(Jk);return B.toFlatObject(e,s,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),pe.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const xP=null;function Tm(e){return B.isPlainObject(e)||B.isArray(e)}function eC(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function cE(e,t,n){return e?e.concat(t).map(function(i,o){return i=eC(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function SP(e){return B.isArray(e)&&!e.some(Tm)}const kP=B.toFlatObject(B,{},null,function(t){return/^is[A-Z]/.test(t)});function Tf(e,t,n){if(!B.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!B.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(i))throw new TypeError("visitor must be a function");function c(h){if(h===null)return"";if(B.isDate(h))return h.toISOString();if(!a&&B.isBlob(h))throw new pe("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(h)||B.isTypedArray(h)?a&&typeof Blob=="function"?new Blob([h]):Buffer.from(h):h}function u(h,m,y){let g=h;if(h&&!y&&typeof h=="object"){if(B.endsWith(m,"{}"))m=r?m:m.slice(0,-2),h=JSON.stringify(h);else if(B.isArray(h)&&SP(h)||(B.isFileList(h)||B.endsWith(m,"[]"))&&(g=B.toArray(h)))return m=eC(m),g.forEach(function(E,v){!(B.isUndefined(E)||E===null)&&t.append(s===!0?cE([m],v,o):s===null?m:m+"[]",c(E))}),!1}return Tm(h)?!0:(t.append(cE(y,m,o),c(h)),!1)}const d=[],f=Object.assign(kP,{defaultVisitor:u,convertValue:c,isVisitable:Tm});function p(h,m){if(!B.isUndefined(h)){if(d.indexOf(h)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(h),B.forEach(h,function(g,b){(!(B.isUndefined(g)||g===null)&&i.call(t,g,B.isString(b)?b.trim():b,m,f))===!0&&p(g,m?m.concat(b):[b])}),d.pop()}}if(!B.isObject(e))throw new TypeError("data must be an object");return p(e),t}function uE(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Oy(e,t){this._pairs=[],e&&Tf(e,this,t)}const tC=Oy.prototype;tC.append=function(t,n){this._pairs.push([t,n])};tC.toString=function(t){const n=t?function(r){return t.call(this,r,uE)}:uE;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function CP(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function nC(e,t,n){if(!t)return e;const r=n&&n.encode||CP;B.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let o;if(i?o=i(t,n):o=B.isURLSearchParams(t)?t.toString():new Oy(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class dE{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){B.forEach(this.handlers,function(r){r!==null&&t(r)})}}const rC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},_P=typeof URLSearchParams<"u"?URLSearchParams:Oy,TP=typeof FormData<"u"?FormData:null,NP=typeof Blob<"u"?Blob:null,OP={isBrowser:!0,classes:{URLSearchParams:_P,FormData:TP,Blob:NP},protocols:["http","https","file","blob","url","data"]},My=typeof window<"u"&&typeof document<"u",Nm=typeof navigator=="object"&&navigator||void 0,MP=My&&(!Nm||["ReactNative","NativeScript","NS"].indexOf(Nm.product)<0),AP=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",RP=My&&window.location.href||"http://localhost",IP=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:My,hasStandardBrowserEnv:MP,hasStandardBrowserWebWorkerEnv:AP,navigator:Nm,origin:RP},Symbol.toStringTag,{value:"Module"})),Mt={...IP,...OP};function DP(e,t){return Tf(e,new Mt.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Mt.isNode&&B.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function PP(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function LP(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&B.isArray(i)?i.length:s,a?(B.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!l):((!i[s]||!B.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&B.isArray(i[s])&&(i[s]=LP(i[s])),!l)}if(B.isFormData(e)&&B.isFunction(e.entries)){const n={};return B.forEachEntry(e,(r,i)=>{t(PP(r),i,n,0)}),n}return null}function BP(e,t,n){if(B.isString(e))try{return(t||JSON.parse)(e),B.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const sc={transitional:rC,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=B.isObject(t);if(o&&B.isHTMLForm(t)&&(t=new FormData(t)),B.isFormData(t))return i?JSON.stringify(iC(t)):t;if(B.isArrayBuffer(t)||B.isBuffer(t)||B.isStream(t)||B.isFile(t)||B.isBlob(t)||B.isReadableStream(t))return t;if(B.isArrayBufferView(t))return t.buffer;if(B.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return DP(t,this.formSerializer).toString();if((l=B.isFileList(t))||r.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return Tf(l?{"files[]":t}:t,a&&new a,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),BP(t)):t}],transformResponse:[function(t){const n=this.transitional||sc.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(B.isResponse(t)||B.isReadableStream(t))return t;if(t&&B.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(l){if(s)throw l.name==="SyntaxError"?pe.from(l,pe.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],e=>{sc.headers[e]={}});const FP=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),zP=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&FP[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},fE=Symbol("internals");function Rl(e){return e&&String(e).trim().toLowerCase()}function wu(e){return e===!1||e==null?e:B.isArray(e)?e.map(wu):String(e)}function $P(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const UP=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ip(e,t,n,r,i){if(B.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!B.isString(t)){if(B.isString(r))return t.indexOf(r)!==-1;if(B.isRegExp(r))return r.test(t)}}function HP(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function jP(e,t){const n=B.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}class rn{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(l,a,c){const u=Rl(a);if(!u)throw new Error("header name must be a non-empty string");const d=B.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||a]=wu(l))}const s=(l,a)=>B.forEach(l,(c,u)=>o(c,u,a));if(B.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(B.isString(t)&&(t=t.trim())&&!UP(t))s(zP(t),n);else if(B.isHeaders(t))for(const[l,a]of t.entries())o(a,l,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Rl(t),t){const r=B.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return $P(i);if(B.isFunction(n))return n.call(this,i,r);if(B.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Rl(t),t){const r=B.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Ip(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=Rl(s),s){const l=B.findKey(r,s);l&&(!n||Ip(r,r[l],l,n))&&(delete r[l],i=!0)}}return B.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Ip(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return B.forEach(this,(i,o)=>{const s=B.findKey(r,o);if(s){n[s]=wu(i),delete n[o];return}const l=t?HP(o):String(o).trim();l!==o&&delete n[o],n[l]=wu(i),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return B.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&B.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[fE]=this[fE]={accessors:{}}).accessors,i=this.prototype;function o(s){const l=Rl(s);r[l]||(jP(i,s),r[l]=!0)}return B.isArray(t)?t.forEach(o):o(t),this}}rn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);B.reduceDescriptors(rn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});B.freezeMethods(rn);function Dp(e,t){const n=this||sc,r=t||n,i=rn.from(r.headers);let o=r.data;return B.forEach(e,function(l){o=l.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function oC(e){return!!(e&&e.__CANCEL__)}function ml(e,t,n){pe.call(this,e??"canceled",pe.ERR_CANCELED,t,n),this.name="CanceledError"}B.inherits(ml,pe,{__CANCEL__:!0});function sC(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new pe("Request failed with status code "+n.status,[pe.ERR_BAD_REQUEST,pe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function VP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function WP(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(a){const c=Date.now(),u=r[o];s||(s=c),n[i]=a,r[i]=c;let d=o,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),c-s{n=u,i=null,o&&(clearTimeout(o),o=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?s(c,u):(i=c,o||(o=setTimeout(()=>{o=null,s(i)},r-d)))},()=>i&&s(i)]}const id=(e,t,n=3)=>{let r=0;const i=WP(50,250);return KP(o=>{const s=o.loaded,l=o.lengthComputable?o.total:void 0,a=s-r,c=i(a),u=s<=l;r=s;const d={loaded:s,total:l,progress:l?s/l:void 0,bytes:a,rate:c||void 0,estimated:c&&l&&u?(l-s)/c:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},n)},pE=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},hE=e=>(...t)=>B.asap(()=>e(...t)),qP=Mt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Mt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,GP=Mt.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];B.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),B.isString(r)&&s.push("path="+r),B.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function YP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function QP(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function lC(e,t){return e&&!YP(t)?QP(e,t):t}const mE=e=>e instanceof rn?{...e}:e;function Bo(e,t){t=t||{};const n={};function r(c,u,d,f){return B.isPlainObject(c)&&B.isPlainObject(u)?B.merge.call({caseless:f},c,u):B.isPlainObject(u)?B.merge({},u):B.isArray(u)?u.slice():u}function i(c,u,d,f){if(B.isUndefined(u)){if(!B.isUndefined(c))return r(void 0,c,d,f)}else return r(c,u,d,f)}function o(c,u){if(!B.isUndefined(u))return r(void 0,u)}function s(c,u){if(B.isUndefined(u)){if(!B.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function l(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const a={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(c,u,d)=>i(mE(c),mE(u),d,!0)};return B.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=a[u]||i,f=d(e[u],t[u],u);B.isUndefined(f)&&d!==l||(n[u]=f)}),n}const aC=e=>{const t=Bo({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:l}=t;t.headers=s=rn.from(s),t.url=nC(lC(t.baseURL,t.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let a;if(B.isFormData(n)){if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((a=s.getContentType())!==!1){const[c,...u]=a?a.split(";").map(d=>d.trim()).filter(Boolean):[];s.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Mt.hasStandardBrowserEnv&&(r&&B.isFunction(r)&&(r=r(t)),r||r!==!1&&qP(t.url))){const c=i&&o&&GP.read(o);c&&s.set(i,c)}return t},XP=typeof XMLHttpRequest<"u",JP=XP&&function(e){return new Promise(function(n,r){const i=aC(e);let o=i.data;const s=rn.from(i.headers).normalize();let{responseType:l,onUploadProgress:a,onDownloadProgress:c}=i,u,d,f,p,h;function m(){p&&p(),h&&h(),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function g(){if(!y)return;const E=rn.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:E,config:e,request:y};sC(function(_){n(_),m()},function(_){r(_),m()},S),y=null}"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(g)},y.onabort=function(){y&&(r(new pe("Request aborted",pe.ECONNABORTED,e,y)),y=null)},y.onerror=function(){r(new pe("Network Error",pe.ERR_NETWORK,e,y)),y=null},y.ontimeout=function(){let v=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const S=i.transitional||rC;i.timeoutErrorMessage&&(v=i.timeoutErrorMessage),r(new pe(v,S.clarifyTimeoutError?pe.ETIMEDOUT:pe.ECONNABORTED,e,y)),y=null},o===void 0&&s.setContentType(null),"setRequestHeader"in y&&B.forEach(s.toJSON(),function(v,S){y.setRequestHeader(S,v)}),B.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),l&&l!=="json"&&(y.responseType=i.responseType),c&&([f,h]=id(c,!0),y.addEventListener("progress",f)),a&&y.upload&&([d,p]=id(a),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(u=E=>{y&&(r(!E||E.type?new ml(null,e,y):E),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(u),i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u)));const b=VP(i.url);if(b&&Mt.protocols.indexOf(b)===-1){r(new pe("Unsupported protocol "+b+":",pe.ERR_BAD_REQUEST,e));return}y.send(o||null)})},ZP=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(c){if(!i){i=!0,l();const u=c instanceof Error?c:this.reason;r.abort(u instanceof pe?u:new ml(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{s=null,o(new pe(`timeout ${t} of ms exceeded`,pe.ETIMEDOUT))},t);const l=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(o):c.removeEventListener("abort",o)}),e=null)};e.forEach(c=>c.addEventListener("abort",o));const{signal:a}=r;return a.unsubscribe=()=>B.asap(l),a}},eL=function*(e,t){let n=e.byteLength;if(n{const i=tL(e,t);let o=0,s,l=a=>{s||(s=!0,r&&r(a))};return new ReadableStream({async pull(a){try{const{done:c,value:u}=await i.next();if(c){l(),a.close();return}let d=u.byteLength;if(n){let f=o+=d;n(f)}a.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(a){return l(a),i.return()}},{highWaterMark:2})},Nf=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",cC=Nf&&typeof ReadableStream=="function",rL=Nf&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),uC=(e,...t)=>{try{return!!e(...t)}catch{return!1}},iL=cC&&uC(()=>{let e=!1;const t=new Request(Mt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),yE=64*1024,Om=cC&&uC(()=>B.isReadableStream(new Response("").body)),od={stream:Om&&(e=>e.body)};Nf&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!od[t]&&(od[t]=B.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new pe(`Response type '${t}' is not supported`,pe.ERR_NOT_SUPPORT,r)})})})(new Response);const oL=async e=>{if(e==null)return 0;if(B.isBlob(e))return e.size;if(B.isSpecCompliantForm(e))return(await new Request(Mt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(B.isArrayBufferView(e)||B.isArrayBuffer(e))return e.byteLength;if(B.isURLSearchParams(e)&&(e=e+""),B.isString(e))return(await rL(e)).byteLength},sL=async(e,t)=>{const n=B.toFiniteNumber(e.getContentLength());return n??oL(t)},lL=Nf&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:l,onUploadProgress:a,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:f}=aC(e);c=c?(c+"").toLowerCase():"text";let p=ZP([i,o&&o.toAbortSignal()],s),h;const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(a&&iL&&n!=="get"&&n!=="head"&&(y=await sL(u,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),x;if(B.isFormData(r)&&(x=S.headers.get("content-type"))&&u.setContentType(x),S.body){const[_,R]=pE(y,id(hE(a)));r=gE(S.body,yE,_,R)}}B.isString(d)||(d=d?"include":"omit");const g="credentials"in Request.prototype;h=new Request(t,{...f,signal:p,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:g?d:void 0});let b=await fetch(h);const E=Om&&(c==="stream"||c==="response");if(Om&&(l||E&&m)){const S={};["status","statusText","headers"].forEach(I=>{S[I]=b[I]});const x=B.toFiniteNumber(b.headers.get("content-length")),[_,R]=l&&pE(x,id(hE(l),!0))||[];b=new Response(gE(b.body,yE,_,()=>{R&&R(),m&&m()}),S)}c=c||"text";let v=await od[B.findKey(od,c)||"text"](b,e);return!E&&m&&m(),await new Promise((S,x)=>{sC(S,x,{data:v,headers:rn.from(b.headers),status:b.status,statusText:b.statusText,config:e,request:h})})}catch(g){throw m&&m(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new pe("Network Error",pe.ERR_NETWORK,e,h),{cause:g.cause||g}):pe.from(g,g&&g.code,e,h)}}),Mm={http:xP,xhr:JP,fetch:lL};B.forEach(Mm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const bE=e=>`- ${e}`,aL=e=>B.isFunction(e)||e===null||e===!1,dC={getAdapter:e=>{e=B.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since : `+o.map(bE).join(` `):" "+bE(o[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Mm};function Pp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ml(null,e)}function EE(e){return Pp(e),e.headers=rn.from(e.headers),e.data=Dp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dC.getAdapter(e.adapter||sc.adapter)(e).then(function(r){return Pp(e),r.data=Dp.call(e,e.transformResponse,r),r.headers=rn.from(r.headers),r},function(r){return oC(r)||(Pp(e),r&&r.response&&(r.response.data=Dp.call(e,e.transformResponse,r.response),r.response.headers=rn.from(r.response.headers))),Promise.reject(r)})}const fC="1.7.9",Of={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Of[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const wE={};Of.transitional=function(t,n,r){function i(o,s){return"[Axios v"+fC+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,l)=>{if(t===!1)throw new pe(i(s," has been removed"+(n?" in "+n:"")),pe.ERR_DEPRECATED);return n&&!wE[s]&&(wE[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,l):!0}};Of.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function cL(e,t,n){if(typeof e!="object")throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const l=e[o],a=l===void 0||s(l,o,e);if(a!==!0)throw new pe("option "+o+" must be "+a,pe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new pe("Unknown option "+o,pe.ERR_BAD_OPTION)}}const vu={assertOptions:cL,validators:Of},lr=vu.validators;class So{constructor(t){this.defaults=t,this.interceptors={request:new dE,response:new dE}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Bo(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&vu.assertOptions(r,{silentJSONParsing:lr.transitional(lr.boolean),forcedJSONParsing:lr.transitional(lr.boolean),clarifyTimeoutError:lr.transitional(lr.boolean)},!1),i!=null&&(B.isFunction(i)?n.paramsSerializer={serialize:i}:vu.assertOptions(i,{encode:lr.function,serialize:lr.function},!0)),vu.assertOptions(n,{baseUrl:lr.spelling("baseURL"),withXsrfToken:lr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&B.merge(o.common,o[n.method]);o&&B.forEach(["delete","get","head","post","put","patch","common"],h=>{delete o[h]}),n.headers=rn.concat(s,o);const l=[];let a=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(a=a&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,f;if(!a){const h=[EE.bind(this),void 0];for(h.unshift.apply(h,l),h.push.apply(h,c),f=h.length,u=Promise.resolve(n);d{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(l=>{r.subscribe(l),o=l}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,l){r.reason||(r.reason=new ml(o,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ay(function(i){t=i}),cancel:t}}}function uL(e){return function(n){return e.apply(null,n)}}function dL(e){return B.isObject(e)&&e.isAxiosError===!0}const Am={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Am).forEach(([e,t])=>{Am[t]=e});function pC(e){const t=new So(e),n=Vk(So.prototype.request,t);return B.extend(n,So.prototype,t,{allOwnKeys:!0}),B.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return pC(Bo(e,i))},n}const Xe=pC(sc);Xe.Axios=So;Xe.CanceledError=ml;Xe.CancelToken=Ay;Xe.isCancel=oC;Xe.VERSION=fC;Xe.toFormData=Tf;Xe.AxiosError=pe;Xe.Cancel=Xe.CanceledError;Xe.all=function(t){return Promise.all(t)};Xe.spread=uL;Xe.isAxiosError=dL;Xe.mergeConfig=Bo;Xe.AxiosHeaders=rn;Xe.formToJSON=e=>iC(B.isHTMLForm(e)?new FormData(e):e);Xe.getAdapter=dC.getAdapter;Xe.HttpStatusCode=Am;Xe.default=Xe;function fL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,mL={};function vE(e,t){return(mL.jsx?hL:pL).test(e)}const gL=/[ \t\n\f\r]/g;function yL(e){return typeof e=="object"?e.type==="text"?xE(e.value):!1:xE(e)}function xE(e){return e.replace(gL,"")===""}let lc=class{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}};lc.prototype.property={};lc.prototype.normal={};lc.prototype.space=null;function hC(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&xL.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(kE,_L);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!kE.test(o)){let s=o.replace(SL,CL);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Ry}return new i(r,t)}function CL(e){return"-"+e.toLowerCase()}function _L(e){return e.charAt(1).toUpperCase()}const TL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},NL=hC([yC,gC,wC,vC,wL],"html"),Iy=hC([yC,gC,wC,vC,vL],"svg");function OL(e){return e.join(" ").trim()}var xC={},CE=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ML=/\n/g,AL=/^\s*/,RL=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,IL=/^:\s*/,DL=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,PL=/^[;\s]*/,LL=/^\s+|\s+$/g,BL=` `,_E="/",TE="*",oo="",FL="comment",zL="declaration",$L=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(h){var m=h.match(ML);m&&(n+=m.length);var y=h.lastIndexOf(BL);r=~y?h.length-y:r+h.length}function o(){var h={line:n,column:r};return function(m){return m.position=new s(h),c(),m}}function s(h){this.start=h,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(h){var m=new Error(t.source+":"+n+":"+r+": "+h);if(m.reason=h,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function a(h){var m=h.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function c(){a(AL)}function u(h){var m;for(h=h||[];m=d();)m!==!1&&h.push(m);return h}function d(){var h=o();if(!(_E!=e.charAt(0)||TE!=e.charAt(1))){for(var m=2;oo!=e.charAt(m)&&(TE!=e.charAt(m)||_E!=e.charAt(m+1));)++m;if(m+=2,oo===e.charAt(m-1))return l("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,h({type:FL,comment:y})}}function f(){var h=o(),m=a(RL);if(m){if(d(),!a(IL))return l("property missing ':'");var y=a(DL),g=h({type:zL,property:NE(m[0].replace(CE,oo)),value:y?NE(y[0].replace(CE,oo)):oo});return a(PL),g}}function p(){var h=[];u(h);for(var m;m=f();)m!==!1&&(h.push(m),u(h));return h}return c(),p()};function NE(e){return e?e.replace(LL,oo):oo}var UL=Db&&Db.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xC,"__esModule",{value:!0});var OE=xC.default=jL,HL=UL($L);function jL(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,HL.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var s=o.property,l=o.value;i?t(s,l,o):l&&(n=n||{},n[s]=l)}}),n}const VL=OE.default||OE,SC=kC("end"),Dy=kC("start");function kC(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function WL(e){const t=Dy(e),n=SC(e);if(t&&n)return{start:t,end:n}}function na(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ME(e.position):"start"in e||"end"in e?ME(e):"line"in e||"column"in e?Dm(e):""}function Dm(e){return AE(e&&e.line)+":"+AE(e&&e.column)}function ME(e){return Dm(e&&e.start)+"-"+Dm(e&&e.end)}function AE(e){return e&&typeof e=="number"?e:1}class Pt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=l?l.line:void 0,this.name=na(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}Pt.prototype.file="";Pt.prototype.name="";Pt.prototype.reason="";Pt.prototype.message="";Pt.prototype.stack="";Pt.prototype.column=void 0;Pt.prototype.line=void 0;Pt.prototype.ancestors=void 0;Pt.prototype.cause=void 0;Pt.prototype.fatal=void 0;Pt.prototype.place=void 0;Pt.prototype.ruleId=void 0;Pt.prototype.source=void 0;const Py={}.hasOwnProperty,KL=new Map,qL=/[A-Z]/g,GL=/-([a-z])/g,YL=new Set(["table","tbody","thead","tfoot","tr"]),QL=new Set(["td","th"]),CC="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function XL(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=o2(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=i2(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Iy:NL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=_C(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function _C(e,t,n){if(t.type==="element")return JL(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ZL(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return t2(e,t,n);if(t.type==="mdxjsEsm")return e2(e,t);if(t.type==="root")return n2(e,t,n);if(t.type==="text")return r2(e,t)}function JL(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Iy,e.schema=i),e.ancestors.push(t);const o=NC(e,t.tagName,!1),s=s2(e,t);let l=By(e,t);return YL.has(t.tagName)&&(l=l.filter(function(a){return typeof a=="string"?!yL(a):!0})),TC(e,s,o,t),Ly(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function ZL(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Da(e,t.position)}function e2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Da(e,t.position)}function t2(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Iy,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:NC(e,t.name,!0),s=l2(e,t),l=By(e,t);return TC(e,s,o,t),Ly(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function n2(e,t,n){const r={};return Ly(r,By(e,t)),e.create(t,e.Fragment,r,n)}function r2(e,t){return t.value}function TC(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ly(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function i2(e,t,n){return r;function r(i,o,s,l){const c=Array.isArray(s.children)?n:t;return l?c(o,s,l):c(o,s)}}function o2(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),a=Dy(r);return t(i,o,s,l,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function s2(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Py.call(t.properties,i)){const o=a2(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&QL.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function l2(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Da(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Da(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function By(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:KL;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o0?(xr(e,e.length,0,t),e):t}const DE={}.hasOwnProperty;function y2(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Is(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const br=Qi(/[A-Za-z]/),En=Qi(/[\dA-Za-z]/),w2=Qi(/[#-'*+\--9=?A-Z^-~]/);function Pm(e){return e!==null&&(e<32||e===127)}const Lm=Qi(/\d/),v2=Qi(/[\dA-Fa-f]/),x2=Qi(/[!-/:-@[-`{-~]/);function le(e){return e!==null&&e<-2}function on(e){return e!==null&&(e<0||e===32)}function ke(e){return e===-2||e===-1||e===32}const S2=Qi(new RegExp("\\p{P}|\\p{S}","u")),k2=Qi(/\s/);function Qi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function yl(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Me(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(a){return ke(a)?(e.enter(n),l(a)):t(a)}function l(a){return ke(a)&&o++s))return;const _=t.events.length;let R=_,I,$;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(I){$=t.events[R][1].end;break}I=!0}for(g(r),x=_;xE;){const S=n[v];t.containerState=S[1],S[0].exit.call(t,e)}n.length=E}function b(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function O2(e,t,n){return Me(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function LE(e){if(e===null||on(e)||k2(e))return 1;if(S2(e))return 2}function zy(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};BE(d,-a),BE(f,a),s={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=In(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=In(c,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),c=In(c,zy(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=In(c,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=In(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,xr(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n0&&ke(x)?Me(e,b,"linePrefix",o+1)(x):b(x)}function b(x){return x===null||le(x)?e.check(FE,m,v)(x):(e.enter("codeFlowValue"),E(x))}function E(x){return x===null||le(x)?(e.exit("codeFlowValue"),b(x)):(e.consume(x),E)}function v(x){return e.exit("codeFenced"),t(x)}function S(x,_,R){let I=0;return $;function $(Y){return x.enter("lineEnding"),x.consume(Y),x.exit("lineEnding"),j}function j(Y){return x.enter("codeFencedFence"),ke(Y)?Me(x,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):F(Y)}function F(Y){return Y===l?(x.enter("codeFencedFenceSequence"),te(Y)):R(Y)}function te(Y){return Y===l?(I++,x.consume(Y),te):I>=s?(x.exit("codeFencedFenceSequence"),ke(Y)?Me(x,V,"whitespace")(Y):V(Y)):R(Y)}function V(Y){return Y===null||le(Y)?(x.exit("codeFencedFence"),_(Y)):R(Y)}}}function U2(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Fp={name:"codeIndented",tokenize:j2},H2={partial:!0,tokenize:V2};function j2(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Me(e,o,"linePrefix",5)(c)}function o(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?a(c):le(c)?e.attempt(H2,s,a)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||le(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),l)}function a(c){return e.exit("codeIndented"),t(c)}}function V2(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):le(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):Me(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):le(s)?i(s):n(s)}}const W2={name:"codeText",previous:q2,resolve:K2,tokenize:G2};function K2(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Il(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Il(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Il(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function PC(e,t,n,r,i,o,s,l,a){const c=a||Number.POSITIVE_INFINITY;let u=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(g),e.exit(o),f):g===null||g===32||g===41||Pm(g)?n(g):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(g))}function f(g){return g===62?(e.enter(o),e.consume(g),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===62?(e.exit("chunkString"),e.exit(l),f(g)):g===null||g===60||le(g)?n(g):(e.consume(g),g===92?h:p)}function h(g){return g===60||g===62||g===92?(e.consume(g),p):p(g)}function m(g){return!u&&(g===null||g===41||on(g))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(g)):u999||p===null||p===91||p===93&&!a||p===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):le(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||le(p)||l++>999?(e.exit("chunkString"),u(p)):(e.consume(p),a||(a=!ke(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function BC(e,t,n,r,i,o){let s;return l;function l(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),s=f===40?41:f,a):n(f)}function a(f){return f===s?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(o),c(f))}function c(f){return f===s?(e.exit(o),a(s)):f===null?n(f):le(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Me(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===s||f===null||le(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===s||f===92?(e.consume(f),u):u(f)}}function ra(e,t){let n;return r;function r(i){return le(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ke(i)?Me(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const nB={name:"definition",tokenize:iB},rB={partial:!0,tokenize:oB};function iB(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return LC.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Is(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):n(p)}function a(p){return on(p)?ra(e,c)(p):c(p)}function c(p){return PC(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(rB,d,d)(p)}function d(p){return ke(p)?Me(e,f,"whitespace")(p):f(p)}function f(p){return p===null||le(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function oB(e,t,n){return r;function r(l){return on(l)?ra(e,i)(l):n(l)}function i(l){return BC(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return ke(l)?Me(e,s,"whitespace")(l):s(l)}function s(l){return l===null||le(l)?t(l):n(l)}}const sB={name:"hardBreakEscape",tokenize:lB};function lB(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return le(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const aB={name:"headingAtx",resolve:cB,tokenize:uB};function cB(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xr(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function uB(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),o(u)}function o(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||on(u)?(e.exit("atxHeadingSequence"),l(u)):n(u)}function l(u){return u===35?(e.enter("atxHeadingSequence"),a(u)):u===null||le(u)?(e.exit("atxHeading"),t(u)):ke(u)?Me(e,l,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function a(u){return u===35?(e.consume(u),a):(e.exit("atxHeadingSequence"),l(u))}function c(u){return u===null||u===35||on(u)?(e.exit("atxHeadingText"),l(u)):(e.consume(u),c)}}const dB=["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","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],$E=["pre","script","style","textarea"],fB={concrete:!0,name:"htmlFlow",resolveTo:mB,tokenize:gB},pB={partial:!0,tokenize:bB},hB={partial:!0,tokenize:yB};function mB(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function gB(e,t,n){const r=this;let i,o,s,l,a;return c;function c(C){return u(C)}function u(C){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(C),d}function d(C){return C===33?(e.consume(C),f):C===47?(e.consume(C),o=!0,m):C===63?(e.consume(C),i=3,r.interrupt?t:w):br(C)?(e.consume(C),s=String.fromCharCode(C),y):n(C)}function f(C){return C===45?(e.consume(C),i=2,p):C===91?(e.consume(C),i=5,l=0,h):br(C)?(e.consume(C),i=4,r.interrupt?t:w):n(C)}function p(C){return C===45?(e.consume(C),r.interrupt?t:w):n(C)}function h(C){const ce="CDATA[";return C===ce.charCodeAt(l++)?(e.consume(C),l===ce.length?r.interrupt?t:F:h):n(C)}function m(C){return br(C)?(e.consume(C),s=String.fromCharCode(C),y):n(C)}function y(C){if(C===null||C===47||C===62||on(C)){const ce=C===47,be=s.toLowerCase();return!ce&&!o&&$E.includes(be)?(i=1,r.interrupt?t(C):F(C)):dB.includes(s.toLowerCase())?(i=6,ce?(e.consume(C),g):r.interrupt?t(C):F(C)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(C):o?b(C):E(C))}return C===45||En(C)?(e.consume(C),s+=String.fromCharCode(C),y):n(C)}function g(C){return C===62?(e.consume(C),r.interrupt?t:F):n(C)}function b(C){return ke(C)?(e.consume(C),b):$(C)}function E(C){return C===47?(e.consume(C),$):C===58||C===95||br(C)?(e.consume(C),v):ke(C)?(e.consume(C),E):$(C)}function v(C){return C===45||C===46||C===58||C===95||En(C)?(e.consume(C),v):S(C)}function S(C){return C===61?(e.consume(C),x):ke(C)?(e.consume(C),S):E(C)}function x(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),a=C,_):ke(C)?(e.consume(C),x):R(C)}function _(C){return C===a?(e.consume(C),a=null,I):C===null||le(C)?n(C):(e.consume(C),_)}function R(C){return C===null||C===34||C===39||C===47||C===60||C===61||C===62||C===96||on(C)?S(C):(e.consume(C),R)}function I(C){return C===47||C===62||ke(C)?E(C):n(C)}function $(C){return C===62?(e.consume(C),j):n(C)}function j(C){return C===null||le(C)?F(C):ke(C)?(e.consume(C),j):n(C)}function F(C){return C===45&&i===2?(e.consume(C),D):C===60&&i===1?(e.consume(C),M):C===62&&i===4?(e.consume(C),q):C===63&&i===3?(e.consume(C),w):C===93&&i===5?(e.consume(C),P):le(C)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(pB,J,te)(C)):C===null||le(C)?(e.exit("htmlFlowData"),te(C)):(e.consume(C),F)}function te(C){return e.check(hB,V,J)(C)}function V(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),Y}function Y(C){return C===null||le(C)?te(C):(e.enter("htmlFlowData"),F(C))}function D(C){return C===45?(e.consume(C),w):F(C)}function M(C){return C===47?(e.consume(C),s="",N):F(C)}function N(C){if(C===62){const ce=s.toLowerCase();return $E.includes(ce)?(e.consume(C),q):F(C)}return br(C)&&s.length<8?(e.consume(C),s+=String.fromCharCode(C),N):F(C)}function P(C){return C===93?(e.consume(C),w):F(C)}function w(C){return C===62?(e.consume(C),q):C===45&&i===2?(e.consume(C),w):F(C)}function q(C){return C===null||le(C)?(e.exit("htmlFlowData"),J(C)):(e.consume(C),q)}function J(C){return e.exit("htmlFlow"),t(C)}}function yB(e,t,n){const r=this;return i;function i(s){return le(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function bB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Mf,t,n)}}const EB={name:"htmlText",tokenize:wB};function wB(e,t,n){const r=this;let i,o,s;return l;function l(w){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(w),a}function a(w){return w===33?(e.consume(w),c):w===47?(e.consume(w),S):w===63?(e.consume(w),E):br(w)?(e.consume(w),R):n(w)}function c(w){return w===45?(e.consume(w),u):w===91?(e.consume(w),o=0,h):br(w)?(e.consume(w),b):n(w)}function u(w){return w===45?(e.consume(w),p):n(w)}function d(w){return w===null?n(w):w===45?(e.consume(w),f):le(w)?(s=d,M(w)):(e.consume(w),d)}function f(w){return w===45?(e.consume(w),p):d(w)}function p(w){return w===62?D(w):w===45?f(w):d(w)}function h(w){const q="CDATA[";return w===q.charCodeAt(o++)?(e.consume(w),o===q.length?m:h):n(w)}function m(w){return w===null?n(w):w===93?(e.consume(w),y):le(w)?(s=m,M(w)):(e.consume(w),m)}function y(w){return w===93?(e.consume(w),g):m(w)}function g(w){return w===62?D(w):w===93?(e.consume(w),g):m(w)}function b(w){return w===null||w===62?D(w):le(w)?(s=b,M(w)):(e.consume(w),b)}function E(w){return w===null?n(w):w===63?(e.consume(w),v):le(w)?(s=E,M(w)):(e.consume(w),E)}function v(w){return w===62?D(w):E(w)}function S(w){return br(w)?(e.consume(w),x):n(w)}function x(w){return w===45||En(w)?(e.consume(w),x):_(w)}function _(w){return le(w)?(s=_,M(w)):ke(w)?(e.consume(w),_):D(w)}function R(w){return w===45||En(w)?(e.consume(w),R):w===47||w===62||on(w)?I(w):n(w)}function I(w){return w===47?(e.consume(w),D):w===58||w===95||br(w)?(e.consume(w),$):le(w)?(s=I,M(w)):ke(w)?(e.consume(w),I):D(w)}function $(w){return w===45||w===46||w===58||w===95||En(w)?(e.consume(w),$):j(w)}function j(w){return w===61?(e.consume(w),F):le(w)?(s=j,M(w)):ke(w)?(e.consume(w),j):I(w)}function F(w){return w===null||w===60||w===61||w===62||w===96?n(w):w===34||w===39?(e.consume(w),i=w,te):le(w)?(s=F,M(w)):ke(w)?(e.consume(w),F):(e.consume(w),V)}function te(w){return w===i?(e.consume(w),i=void 0,Y):w===null?n(w):le(w)?(s=te,M(w)):(e.consume(w),te)}function V(w){return w===null||w===34||w===39||w===60||w===61||w===96?n(w):w===47||w===62||on(w)?I(w):(e.consume(w),V)}function Y(w){return w===47||w===62||on(w)?I(w):n(w)}function D(w){return w===62?(e.consume(w),e.exit("htmlTextData"),e.exit("htmlText"),t):n(w)}function M(w){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),N}function N(w){return ke(w)?Me(e,P,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):P(w)}function P(w){return e.enter("htmlTextData"),s(w)}}const $y={name:"labelEnd",resolveAll:kB,resolveTo:CB,tokenize:_B},vB={tokenize:TB},xB={tokenize:NB},SB={tokenize:OB};function kB(e){let t=-1;const n=[];for(;++t=3&&(c===null||le(c))?(e.exit("thematicBreak"),t(c)):n(c)}function a(c){return c===i?(e.consume(c),r++,a):(e.exit("thematicBreakSequence"),ke(c)?Me(e,l,"whitespace")(c):l(c))}}const Qt={continuation:{tokenize:zB},exit:UB,name:"list",tokenize:FB},LB={partial:!0,tokenize:HB},BB={partial:!0,tokenize:$B};function FB(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(p){const h=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Lm(p)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(xu,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return n(p)}function a(p){return Lm(p)&&++s<10?(e.consume(p),a):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Mf,r.interrupt?n:u,e.attempt(LB,f,d))}function u(p){return r.containerState.initialBlankLine=!0,o++,f(p)}function d(p){return ke(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function zB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Mf,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Me(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!ke(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(BB,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Me(e,e.attempt(Qt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function $B(e,t,n){const r=this;return Me(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function UB(e){e.exit(this.containerState.type)}function HB(e,t,n){const r=this;return Me(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ke(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const UE={name:"setextUnderline",resolveTo:jB,tokenize:VB};function jB(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function VB(e,t,n){const r=this;let i;return o;function o(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),ke(c)?Me(e,a,"lineSuffix")(c):a(c))}function a(c){return c===null||le(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const WB={tokenize:KB};function KB(e){const t=this,n=e.attempt(Mf,r,e.attempt(this.parser.constructs.flowInitial,i,Me(e,e.attempt(this.parser.constructs.flow,i,e.attempt(X2,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qB={resolveAll:zC()},GB=FC("string"),YB=FC("text");function FC(e){return{resolveAll:zC(e==="text"?QB:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(u){return c(u)?o(u):l(u)}function l(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),a}function a(u){return c(u)?(n.exit("data"),o(u)):(n.consume(u),a)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function cF(e,t){let n=-1;const r=[];let i;for(;++n0){const Ee=L.tokenStack[L.tokenStack.length-1];(Ee[1]||jE).call(L,void 0,Ee[0])}for(T.position={start:oi(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:oi(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},X=-1;++X1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,a);const c={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,c),e.applyData(t,c)}function _F(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TF(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function HC(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function NF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return HC(e,t);const i={src:yl(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function OF(e,t){const n={src:yl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function MF(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function AF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return HC(e,t);const i={href:yl(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function RF(e,t){const n={href:yl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function IF(e,t,n){const r=e.all(t),i=n?DF(n):jC(t),o={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l1}function PF(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Dy(t.children[1]),a=SC(t.children[t.children.length-1]);l&&a&&(s.position={start:l,end:a}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function $F(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,l=s?s.length:t.children.length;let a=-1;const c=[];for(;++a0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(KE(t.slice(i),i>0,!1)),o.join("")}function KE(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===VE||o===WE;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===VE||o===WE;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function jF(e,t){const n={type:"text",value:HF(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function VF(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const WF={blockquote:wF,break:vF,code:xF,delete:SF,emphasis:kF,footnoteReference:CF,heading:_F,html:TF,imageReference:NF,image:OF,inlineCode:MF,linkReference:AF,link:RF,listItem:IF,list:PF,paragraph:LF,root:BF,strong:FF,table:zF,tableCell:UF,tableRow:$F,text:jF,thematicBreak:VF,toml:Dc,yaml:Dc,definition:Dc,footnoteDefinition:Dc};function Dc(){}const VC=-1,Af=0,sd=1,ld=2,Uy=3,Hy=4,jy=5,Vy=6,WC=7,KC=8,qE=typeof self=="object"?self:globalThis,KF=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Af:case VC:return n(s,i);case sd:{const l=n([],i);for(const a of s)l.push(r(a));return l}case ld:{const l=n({},i);for(const[a,c]of s)l[r(a)]=r(c);return l}case Uy:return n(new Date(s),i);case Hy:{const{source:l,flags:a}=s;return n(new RegExp(l,a),i)}case jy:{const l=n(new Map,i);for(const[a,c]of s)l.set(r(a),r(c));return l}case Vy:{const l=n(new Set,i);for(const a of s)l.add(r(a));return l}case WC:{const{name:l,message:a}=s;return n(new qE[l](a),i)}case KC:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i)}return n(new qE[o](s),i)};return r},GE=e=>KF(new Map,e)(0),Zo="",{toString:qF}={},{keys:GF}=Object,Dl=e=>{const t=typeof e;if(t!=="object"||!e)return[Af,t];const n=qF.call(e).slice(8,-1);switch(n){case"Array":return[sd,Zo];case"Object":return[ld,Zo];case"Date":return[Uy,Zo];case"RegExp":return[Hy,Zo];case"Map":return[jy,Zo];case"Set":return[Vy,Zo]}return n.includes("Array")?[sd,n]:n.includes("Error")?[WC,n]:[ld,n]},Pc=([e,t])=>e===Af&&(t==="function"||t==="symbol"),YF=(e,t,n,r)=>{const i=(s,l)=>{const a=r.push(s)-1;return n.set(l,a),a},o=s=>{if(n.has(s))return n.get(s);let[l,a]=Dl(s);switch(l){case Af:{let u=s;switch(a){case"bigint":l=KC,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);u=null;break;case"undefined":return i([VC],s)}return i([l,u],s)}case sd:{if(a)return i([a,[...s]],s);const u=[],d=i([l,u],s);for(const f of s)u.push(o(f));return d}case ld:{if(a)switch(a){case"BigInt":return i([a,s.toString()],s);case"Boolean":case"Number":case"String":return i([a,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const u=[],d=i([l,u],s);for(const f of GF(s))(e||!Pc(Dl(s[f])))&&u.push([o(f),o(s[f])]);return d}case Uy:return i([l,s.toISOString()],s);case Hy:{const{source:u,flags:d}=s;return i([l,{source:u,flags:d}],s)}case jy:{const u=[],d=i([l,u],s);for(const[f,p]of s)(e||!(Pc(Dl(f))||Pc(Dl(p))))&&u.push([o(f),o(p)]);return d}case Vy:{const u=[],d=i([l,u],s);for(const f of s)(e||!Pc(Dl(f)))&&u.push(o(f));return d}}const{message:c}=s;return i([l,{name:a,message:c}],s)};return o},YE=(e,{json:t,lossy:n}={})=>{const r=[];return YF(!(t||n),!!t,new Map,r)(e),r},ad=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?GE(YE(e,t)):structuredClone(e):(e,t)=>GE(YE(e,t));function QF(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function XF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function JF(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||QF,r=e.options.footnoteBackLabel||XF,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let a=-1;for(;++a0&&h.push({type:"text",value:" "});let b=typeof n=="string"?n:n(a,p);typeof b=="string"&&(b={type:"text",value:b}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,p),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...h)}else u.push(...h);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(c,g),l.push(g)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ad(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` `}]}}const qC=function(e){if(e==null)return nz;if(typeof e=="function")return Rf(e);if(typeof e=="object")return Array.isArray(e)?ZF(e):ez(e);if(typeof e=="string")return tz(e);throw new Error("Expected function, string, or object as test")};function ZF(e){const t=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let p=GC,h,m,y;if((!t||o(a,c,u[u.length-1]||void 0))&&(p=lz(n(a,u)),p[0]===QE))return p;if("children"in a&&a.children){const g=a;if(g.children&&p[0]!==oz)for(m=(r?g.children.length:-1)+s,y=u.concat(g);m>-1&&m0&&n.push({type:"text",value:` `}),n}function XE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function JE(e,t){const n=cz(e,t),r=n.one(e,void 0),i=JF(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` `},i),o}function hz(e,t){return e&&"run"in e?async function(n,r){const i=JE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return JE(n,{file:r,...e||t})}}function ZE(e){if(e)throw e}var Su=Object.prototype.hasOwnProperty,QC=Object.prototype.toString,ew=Object.defineProperty,tw=Object.getOwnPropertyDescriptor,nw=function(t){return typeof Array.isArray=="function"?Array.isArray(t):QC.call(t)==="[object Array]"},rw=function(t){if(!t||QC.call(t)!=="[object Object]")return!1;var n=Su.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Su.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Su.call(t,i)},iw=function(t,n){ew&&n.name==="__proto__"?ew(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ow=function(t,n){if(n==="__proto__")if(Su.call(t,n)){if(tw)return tw(t,n).value}else return;return t[n]},mz=function e(){var t,n,r,i,o,s,l=arguments[0],a=1,c=arguments.length,u=!1;for(typeof l=="boolean"&&(u=l,l=arguments[1]||{},a=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});as.length;let a;l&&s.push(i);try{a=e.apply(this,s)}catch(c){const u=c;if(l&&n)throw u;return i(u)}l||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(s,...l){n||(n=!0,t(s,...l))}function o(s){i(null,s)}}const ur={basename:bz,dirname:Ez,extname:wz,join:vz,sep:"/"};function bz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');ac(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Ez(e){if(ac(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function wz(e){ac(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const l=e.codePointAt(t);if(l===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function vz(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Sz(e,t){let n="",r=0,i=-1,o=0,s=-1,l,a;for(;++s<=e.length;){if(s2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else l===46&&o>-1?o++:o=-1}return n}function ac(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const kz={cwd:Cz};function Cz(){return"/"}function $m(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _z(e){if(typeof e=="string")e=new URL(e);else if(!$m(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Tz(e)}function Tz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[p,...h]=u;const m=r[f][1];zm(m)&&zm(p)&&(p=$p(!0,m,p)),r[f]=[c,p,...h]}}}}const Az=new Wy().freeze();function Vp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Wp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Kp(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lw(e){if(!zm(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function aw(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Lc(e){return Rz(e)?e:new XC(e)}function Rz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Iz(e){return typeof e=="string"||Dz(e)}function Dz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Pz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",cw=[],uw={allowDangerousHtml:!0},Lz=/^(https?|ircs?|mailto|xmpp)$/i,Bz=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Fz(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,l=e.rehypePlugins||cw,a=e.remarkPlugins||cw,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...uw}:uw,u=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||zz,p=Az().use(EF).use(a).use(hz,c).use(l),h=new XC;typeof r=="string"&&(h.value=r);for(const b of Bz)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+Pz+b.id,void 0);const m=p.parse(h);let y=p.runSync(m,h);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),YC(y,g),XL(y,{Fragment:k.Fragment,components:o,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function g(b,E,v){if(b.type==="raw"&&v&&typeof E=="number")return u?v.children.splice(E,1):v.children[E]={type:"text",value:b.value},E;if(b.type==="element"){let S;for(S in Bp)if(Object.hasOwn(Bp,S)&&Object.hasOwn(b.properties,S)){const x=b.properties[S],_=Bp[S];(_===null||_.includes(b.tagName))&&(b.properties[S]=f(String(x||""),S,b))}}if(b.type==="element"){let S=t?!t.includes(b.tagName):s?s.includes(b.tagName):!1;if(!S&&n&&typeof E=="number"&&(S=!n(b,E,v)),S&&v&&typeof E=="number")return d&&b.children?v.children.splice(E,1,...b.children):v.children.splice(E,1),E}}}function zz(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Lz.test(e.slice(0,t))?e:""}function $z(){const[e,t]=A.useState(""),[n,r]=A.useState(""),[i,o]=A.useState(!1),[s,l]=A.useState(""),[a,c]=A.useState(!1),u=async()=>{var f,p;o(!0),l("");try{const h=await Xe.request({method:"post",url:"https://api.1001fx.com/data/getcontent",headers:{"Content-Type":"application/json",Accept:"application/json","X-API-KEY":"01J8G6449D8Y83M8T0GTP0CEEH"},data:{url:e}});h.data&&h.data.markdown?r(h.data.markdown):l("No content found. Try a different URL.")}catch(h){l(((p=(f=h.response)==null?void 0:f.data)==null?void 0:p.message)||h.message||"Failed to scrape content. Please check the URL and try again."),console.error(h)}finally{o(!1)}},d=async()=>{try{await navigator.clipboard.writeText(n),c(!0),setTimeout(()=>c(!1),2e3)}catch(f){console.error("Failed to copy text:",f)}};return k.jsxs("div",{className:"flex flex-col h-full bg-black",children:[k.jsxs("div",{className:"p-4 border-b border-red-900",children:[k.jsxs("div",{className:"flex gap-2",children:[k.jsx("input",{type:"text",value:e,onChange:f=>t(f.target.value),placeholder:"Enter URL to scrape...",className:"flex-1 bg-black border border-red-900 p-2 text-red-500 outline-none",onKeyDown:f=>{f.key==="Enter"&&u()}}),k.jsx("button",{onClick:u,disabled:i||!e,className:"windows-button disabled:opacity-50 whitespace-nowrap",children:i?"Scraping...":"Scrape"})]}),s&&k.jsx("div",{className:"text-red-700 mt-2 p-2 border border-red-900/50",children:s})]}),k.jsxs("div",{className:"flex-1 relative overflow-hidden",children:[n&&k.jsxs("button",{onClick:d,className:"windows-button absolute top-2 right-2 flex items-center gap-1 z-10",children:[a?k.jsx(qR,{className:"w-4 h-4"}):k.jsx(GR,{className:"w-4 h-4"}),a?"Copied!":"Copy Text"]}),k.jsx("div",{className:"absolute inset-0 overflow-auto p-4",children:n?k.jsx(Fz,{className:"prose prose-invert prose-red max-w-none",components:{h1:({children:f})=>k.jsx("h1",{className:"text-red-500 text-2xl font-bold mb-4",children:f}),h2:({children:f})=>k.jsx("h2",{className:"text-red-500 text-xl font-bold mb-3",children:f}),h3:({children:f})=>k.jsx("h3",{className:"text-red-500 text-lg font-bold mb-2",children:f}),p:({children:f})=>k.jsx("p",{className:"text-red-400 mb-4",children:f}),a:({children:f,href:p})=>k.jsx("a",{href:p,className:"text-red-300 hover:text-red-200 underline",target:"_blank",rel:"noopener noreferrer",children:f}),ul:({children:f})=>k.jsx("ul",{className:"list-disc list-inside mb-4 text-red-400",children:f}),ol:({children:f})=>k.jsx("ol",{className:"list-decimal list-inside mb-4 text-red-400",children:f}),code:({children:f})=>k.jsx("code",{className:"bg-red-900/20 px-1 rounded text-red-300",children:f}),pre:({children:f})=>k.jsx("pre",{className:"bg-red-900/10 p-4 rounded mb-4 overflow-x-auto",children:f})},children:n}):k.jsx("div",{className:"text-red-700 italic",children:"Scraped content will appear here..."})})]})]})}function Uz(){const[e,t]=A.useState(""),[n,r]=A.useState(!1),[i,o]=A.useState(""),[s,l]=A.useState(""),a=async()=>{var c,u,d;if(e){r(!0),o("");try{const f=await Xe.post("https://logos.stage.int.mov/",{operationName:null,variables:{},query:`{ extract_text(url: "${e}") { text title html } }`},{headers:{"Content-Type":"application/json",Accept:"*/*","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:133.0) Gecko/20100101 Firefox/133.0"}});(d=(u=(c=f.data)==null?void 0:c.data)==null?void 0:u.extract_text)!=null&&d.html?l(f.data.data.extract_text.html):o("No content found for this URL")}catch(f){o(f.message||"Failed to fetch content"),console.error("Browser error:",f)}finally{r(!1)}}};return k.jsxs("div",{className:"flex flex-col h-full bg-black",children:[k.jsxs("div",{className:"p-4 border-b border-red-900",children:[k.jsxs("div",{className:"flex gap-2",children:[k.jsx("input",{type:"text",value:e,onChange:c=>t(c.target.value),placeholder:"Enter URL to browse...",className:"flex-1 bg-black border border-red-900 p-2 text-red-500 outline-none",onKeyDown:c=>{c.key==="Enter"&&a()}}),k.jsx("button",{onClick:a,disabled:n||!e,className:"windows-button disabled:opacity-50 whitespace-nowrap",children:n?"Loading...":"Browse"})]}),i&&k.jsx("div",{className:"text-red-700 mt-2 p-2 border border-red-900/50",children:i})]}),k.jsx("div",{className:"flex-1 relative overflow-hidden",children:k.jsx("div",{className:"absolute inset-0 overflow-auto p-4 text-red-400",dangerouslySetInnerHTML:{__html:s||'
Enter a URL and click Browse to view content...
'}})})]})}const dw=["FATAL ERROR: Soul not found in C:\\HELL\\SOULS","ERROR 666: Demon.dll has performed an illegal operation","BSOD: Blue Screen of DAMNATION","WARNING: Your eternal suffering subscription has expired","CRITICAL: Not enough souls to perform this operation","ERROR: Hellfire.exe has stopped responding","SYSTEM ERROR: Satan is currently unavailable","FATAL: Corrupted pentagram detected in system registry","ERROR: Failed to establish connection with underworld","WARNING: Unauthorized attempt to escape eternal damnation"];function Hz({onClose:e}){return A.useEffect(()=>{const t=setTimeout(()=>{e()},5e3);return()=>clearTimeout(t)},[e]),k.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-50 animate-in fade-in",children:k.jsxs("div",{className:"bg-black border-2 border-red-900 p-4 max-w-md shadow-lg",children:[k.jsxs("div",{className:"windows-titlebar flex justify-between items-center mb-4",children:[k.jsx("span",{className:"text-red-300 text-sm",children:"System Error"}),k.jsx("button",{className:"windows-button text-xs",onClick:e,children:k.jsx(Sy,{className:"h-4 w-4"})})]}),k.jsxs("div",{className:"flex gap-4",children:[k.jsx("div",{className:"text-4xl",children:"💀"}),k.jsxs("div",{children:[k.jsx("p",{className:"text-red-500 mb-4",children:dw[Math.floor(Math.random()*dw.length)]}),k.jsx("div",{className:"flex justify-end",children:k.jsx("button",{className:"windows-button",onClick:e,children:"OK"})})]})]})]})})}function jz(){const[e,t]=A.useState([]),[n,r]=A.useState([]);return A.useEffect(()=>{const i=setInterval(()=>{const s={id:Math.random(),top:Math.random()*100};t(l=>[...l,s]),setTimeout(()=>{t(l=>l.filter(a=>a.id!==s.id))},2e3)},1e3),o=setInterval(()=>{const s={id:Math.random(),top:Math.random()*100,left:Math.random()*100};r(l=>[...l,s]),setTimeout(()=>{r(l=>l.filter(a=>a.id!==s.id))},300)},2e3);return()=>{clearInterval(i),clearInterval(o)}},[]),k.jsxs("div",{className:"glitch-overlay",children:[k.jsx("div",{className:"noise"}),e.map(i=>k.jsx("div",{className:"glitch-line",style:{top:`${i.top}%`}},i.id)),n.map(i=>k.jsx("div",{className:"glitch-artifact",style:{top:`${i.top}%`,left:`${i.left}%`}},i.id))]})}const Vz=` _ __ _ __(_)___ ____/ /___ _ _______ | | /| / / / __ / __ / __ | /| / / ___/ | |/ |/ / / / / / /_/ / /_/ / |/ |/ (__ ) |__/|__/_/_/ /_/__,_/____/|__/|__/____/ ███████████ ████ ░░███░░░░░███ ░░███ ░███ ░███ ████████ ██████ ████████ █████ ████ ██████ ░███ ░██████████ ░░███░░███ ███░░███ ███░░███ ░░███ ░███ ███░░███ ░███ ░███░░░░░░ ░███ ░░░ ░███████ ░███ ░███ ░███ ░███ ░███████ ░███ ░███ ░███ ░███░░░ ░███ ░███ ░███ ░███ ░███░░░ ░███ █████ █████ ░░██████ ░░███████ ░░████████░░██████ █████ ░░░░░ ░░░░░ ░░░░░░ ░░░░░███ ░░░░░░░░ ░░░░░░ ░░░░░ ░███ █████ ░░░░░ `,Wz=` ██████╗ ██████╗ ███████╗ ██████╗ ██╗ ██╗███████╗██╗ ██╔══██╗██╔══██╗██╔════╝██╔═══██╗██║ ██║██╔════╝██║ ██████╔╝██████╔╝█████╗ ██║ ██║██║ ██║█████╗ ██║ ██╔═══╝ ██╔══██╗██╔══╝ ██║▄▄ ██║██║ ██║██╔══╝ ██║ ██║ ██║ ██║███████╗╚██████╔╝╚██████╔╝███████╗███████╗ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚══▀▀═╝ ╚═════╝ ╚══════╝╚══════╝ `,qp=["Initializing hell.sys...","Loading damned.dll...","Corrupting soul registry...","Starting Windows Prequel 95..."];function Kz({onComplete:e}){const[t,n]=A.useState(0),[r,i]=A.useState(!1),[o,s]=A.useState(0),[l,a]=A.useState(!1);return A.useEffect(()=>{console.time("bootSequence");const c=()=>{a(globalThis.window.innerWidth<=768)};c(),globalThis.window.addEventListener("resize",c);const u=setTimeout(()=>{console.timeLog("bootSequence","Logo display"),i(!0);const f=setInterval(()=>{s(p=>(p+1)%3)},500);setTimeout(()=>{clearInterval(f)},4e3)},500);let d=[];return qp.forEach((f,p)=>{const h=setTimeout(()=>{console.timeLog("bootSequence",`Message ${p+1}`),n(p),p===qp.length-1&&setTimeout(()=>{console.timeEnd("bootSequence"),e()},1e3)},1e3*(p+1));d.push(h)}),()=>{clearTimeout(u),d.forEach(f=>clearTimeout(f)),globalThis.window.removeEventListener("resize",c),console.timeEnd("bootSequence")}},[e]),k.jsx("div",{className:"fixed inset-0 bg-black flex items-center justify-center",children:k.jsxs("div",{className:"text-center p-4",children:[r&&k.jsx("pre",{className:`text-red-500 font-mono whitespace-pre animate-pulse ${o===1?"text-red-600":""} ${o===2?"text-red-700":""} `,style:{textShadow:"0 0 10px rgba(255, 0, 0, 0.5)",fontSize:l?"0.35rem":"1rem",lineHeight:l?"1":"1.2"},children:l?Wz:Vz}),k.jsx("div",{className:"mt-8 space-y-2",children:qp.slice(0,t+1).map((c,u)=>k.jsx("div",{className:"text-red-500 font-mono text-xs sm:text-base",style:{opacity:u===t?"0.7":"1",animation:u===t?"typing 0.5s steps(40, end)":"none"},children:c},u))})]})})}function yt(e){this.content=e}yt.prototype={constructor:yt,find:function(e){for(var t=0;t>1}};yt.from=function(e){if(e instanceof yt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new yt(t)};function JC(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=JC(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function ZC(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),l=t.child(--o),a=s.nodeSize;if(s==l){n-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:n,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;ct&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,t-u),Math.min(a.content.size,n-u),r,i+u)}l=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(l,a)=>{let c=l.isText?l.text.slice(Math.max(t,a)-a,n-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);ot)for(let o=0,s=0;st&&((sn)&&(l.isText?l=l.cut(Math.max(0,t-s),Math.min(l.text.length,n-s)):l=l.cut(Math.max(0,t-s-1),Math.min(l.content.size,n-s-1))),r.push(l),i+=l.nodeSize),s=a}return new U(r,i)}cutByIndex(t,n){return t==n?U.empty:t==0&&n==this.content.length?this:new U(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new U(i,o)}addToStart(t){return new U([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new U(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;nthis.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=t)return s==t||n>0?Bc(r+1,s):Bc(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return U.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new U(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return U.empty;let n,r=0;for(let i=0;ithis.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;nr.type.rank-i.type.rank),n}};Te.none=[];class ud extends Error{}class Q{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=t_(this.content,t+this.openStart,n);return r&&new Q(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Q(e_(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Q.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Q(U.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new Q(t,r,i)}}Q.empty=new Q(U.empty,0,0);function e_(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:l}=e.findIndex(n);if(i==t||o.isText){if(l!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(e_(o.content,t-i-1,n-i-1)))}function t_(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return e.cut(0,t).append(n).append(e.cut(t));let l=t_(s.content,t-o-1,n);return l&&e.replaceChild(i,s.copy(l))}function qz(e,t,n){if(n.openStart>e.depth)throw new ud("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ud("Inconsistent open depths");return n_(e,t,n,0)}function n_(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ia(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(ko(e.nodeAfter,r),o++));for(let l=o;li&&Hm(e,t,i+1),s=r.depth>i&&Hm(n,r,i+1),l=[];return ia(null,e,i,l),o&&s&&t.index(i)==n.index(i)?(r_(o,s),ko(Co(o,i_(e,t,n,r,i+1)),l)):(o&&ko(Co(o,dd(e,t,i+1)),l),ia(t,n,i,l),s&&ko(Co(s,dd(n,r,i+1)),l)),ia(r,null,i,l),new U(l)}function dd(e,t,n){let r=[];if(ia(null,e,n,r),e.depth>n){let i=Hm(e,t,n+1);ko(Co(i,dd(e,t,n+1)),r)}return ia(t,null,n,r),new U(r)}function Gz(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)i=t.node(o).copy(U.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Pa{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new fd(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=t;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new Pa(n,r,o)}static resolveCached(t,n){let r=fw.get(t);if(r)for(let o=0;ot&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),o_(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=U.empty,i=0,o=r.childCount){let s=this.contentMatchAt(t).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let a=i;an.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=U.fromJSON(t,n.content),o=t.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};zi.prototype.text=void 0;class pd extends zi{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):o_(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new pd(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new pd(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function o_(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Fo{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Jz(t,n);if(r.next==null)return Fo.empty;let i=s_(r);r.next&&r.err("Unexpected trailing text");let o=o$(i$(i));return s$(o,r),o}matchType(t){for(let n=0;nc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+t.indexOf(r.next[s].next);return o}).join(` `)}}Fo.empty=new Fo(!0);class Jz{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.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(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function s_(e){let t=[];do t.push(Zz(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Zz(e){let t=[];do t.push(e$(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function e$(e){let t=r$(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=t$(e,t);else break;return t}function pw(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function t$(e,t){let n=pw(e),r=n;return e.eat(",")&&(e.next!="}"?r=pw(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function n$(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.isInGroup(t)&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function r$(e){if(e.eat("(")){let t=s_(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=n$(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function i$(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,l,a){let c={term:a,to:l};return t[s].push(c),c}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=o(s.exprs[a],l);if(a==s.exprs.length-1)return c;i(c,l=n())}else if(s.type=="star"){let a=n();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=n();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c{e[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=t[r.join(",")]=new Fo(r.indexOf(e.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:c_(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new zi(this,this.computeAttrs(t),U.from(n),Te.setFrom(r))}createChecked(t=null,n,r){return n=U.from(n),this.checkContent(n),new zi(this,this.computeAttrs(t),n,Te.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=U.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(U.empty,!0);return o?new zi(this,t,n.append(o),Te.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;nr[o]=new f_(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function l$(e,t,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class a${constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?l$(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class If{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=d_(t,i.attrs),this.excluded=null;let o=a_(this.attrs);this.instance=o?new Te(this,o):null}create(t=null){return!t&&this.instance?this.instance:new Te(this,c_(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((o,s)=>r[o]=new If(o,i++,n,s)),r}removeFromSet(t){for(var n=0;n-1}}class p_{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=yt.from(t.nodes),n.marks=yt.from(t.marks||{}),this.nodes=mw.compile(this.spec.nodes,this),this.marks=If.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=Fo.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?gw(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:gw(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof mw){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new pd(r,r.defaultAttrs,t,Te.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeFromJSON(t){return zi.fromJSON(this,t)}markFromJSON(t){return Te.fromJSON(this,t)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function gw(e,t){let n=[];for(let r=0;r-1)&&n.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function c$(e){return e.tag!=null}function u$(e){return e.style!=null}class $i{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(c$(i))this.tags.push(i);else if(u$(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=t.nodes[i.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new bw(this,n,!1);return r.addAll(t,Te.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new bw(this,n,!0);return r.addAll(t,Te.none,n.from,n.to),Q.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;it.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(s.getAttrs){let a=s.getAttrs(n);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(t){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=Ew(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in t.nodes){let o=t.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Ew(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new $i(t,$i.schemaRules(t)))}}const h_={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},d$={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},m_={ol:!0,ul:!0},La=1,Vm=2,oa=4;function yw(e,t,n){return t!=null?(t?La:0)|(t==="full"?Vm:0):e&&e.whitespace=="pre"?La|Vm:n&~oa}class Fc{constructor(t,n,r,i,o,s){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Te.none,this.match=o||(s&oa?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(U.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&La)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=U.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(U.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!h_.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class bw{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,s=yw(null,n.preserveWhitespace,0)|(r?oa:0);i?o=new Fc(i.type,i.attrs,Te.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new Fc(null,null,Te.none,!0,null,s):o=new Fc(t.schema.topNodeType,null,Te.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,o=i.options&Vm?"full":this.localPreserveWS||(i.options&La)>0;if(o==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=t.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),l;m_.hasOwnProperty(s)&&this.parser.normalizeLists&&f$(t);let a=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(l=this.parser.matchTag(t,this,r));e:if(a?a.ignore:d$.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(t=a.skip);let c,u=this.needsBlock;if(h_.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let d=a&&a.skip?n:this.readStyles(t,n);d&&this.addAll(t,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(t,n);c&&this.addElementByRule(t,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i!a.clearMark(c)):n=n.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return n}addElementByRule(t,n,r,i){let o,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(t,r);else{let a=this.enter(s,n.attrs||null,r,n.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[n.mark];r=r.concat(a.create(n.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(a=>this.insertNode(a,r));else{let a=t;typeof n.contentElement=="string"?a=t.querySelector(n.contentElement):typeof n.contentElement=="function"?a=n.contentElement(t):n.contentElement&&(a=n.contentElement),this.findAround(t,a,!0),this.addAll(a,r),this.findAround(t,a,!1)}o&&this.sync(l)&&this.open--}addAll(t,n,r,i){let o=r||0;for(let s=r?t.childNodes[r]:t.firstChild,l=i==null?null:t.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(s,n);this.findAtPoint(t,o)}findPlace(t,n){let r,i;for(let o=this.open;o>=0;o--){let s=this.nodes[o],l=s.findWrapping(t);if(l&&(!r||r.length>l.length)&&(r=l,i=s,!l.length)||s.solid)break}if(!r)return null;this.sync(i);for(let o=0;o(s.type?s.type.allowsMarkType(c.type):ww(c.type,t))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Fc(t,n,a,i,null,l)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));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(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=La)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function f$(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&m_.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function p$(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Ew(e){let t={};for(let n in e)t[n]=e[n];return t}function ww(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(t.marks[i],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&ku(Yp(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return ku(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Go(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=vw(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return vw(t.marks)}}function vw(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Yp(e){return e.document||window.document}const xw=new WeakMap;function h$(e){let t=xw.get(e);return t===void 0&&xw.set(e,t=m$(e)),t}function m$(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i-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 s=i.indexOf(" ");s>0&&(n=i.slice(0,s),i=i.slice(s+1));let l,a=n?e.createElementNS(n,i):e.createElement(i),c=t[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?a.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):a.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:p,contentDOM:h}=ku(e,f,n,r);if(a.appendChild(p),h){if(l)throw new RangeError("Multiple content holes");l=h}}}return{dom:a,contentDOM:l}}const g_=65535,y_=Math.pow(2,16);function g$(e,t){return e+t*y_}function Sw(e){return e&g_}function y$(e){return(e-(e&g_))/y_}const b_=1,E_=2,Cu=4,w_=8;class Wm{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&w_)>0}get deletedBefore(){return(this.delInfo&(b_|Cu))>0}get deletedAfter(){return(this.delInfo&(E_|Cu))>0}get deletedAcross(){return(this.delInfo&Cu)>0}}class gn{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&gn.empty)return gn.empty}recover(t){let n=0,r=Sw(t);if(!this.inverted)for(let i=0;it)break;let c=this.ranges[l+o],u=this.ranges[l+s],d=a+c;if(t<=d){let f=c?t==a?-1:t==d?1:n:n,p=a+i+(f<0?0:u);if(r)return p;let h=t==(n<0?a:d)?null:g$(l/3,t-a),m=t==a?E_:t==d?b_:Cu;return(n<0?t!=a:t!=d)&&(m|=w_),new Wm(p,m,h)}i+=u-c}return r?t+i:new Wm(t+i,0,null)}touches(t,n){let r=0,i=Sw(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;lt)break;let c=this.ranges[l+o],u=a+c;if(t<=u&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;n--){let i=t.getMirror(n);this.appendMap(t.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new Ds;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return tt.fromReplace(t,this.from,this.to,o)}invert(){return new Er(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new _i(n.pos,r.pos,this.mark)}merge(t){return t instanceof _i&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new _i(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new _i(n.from,n.to,t.markFromJSON(n.mark))}}Lt.jsonID("addMark",_i);class Er extends Lt{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Q(Ky(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return tt.fromReplace(t,this.from,this.to,r)}invert(){return new _i(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Er(n.pos,r.pos,this.mark)}merge(t){return t instanceof Er&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Er(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Er(n.from,n.to,t.markFromJSON(n.mark))}}Lt.jsonID("removeMark",Er);class Ti extends Lt{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return tt.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return tt.fromReplace(t,this.pos,this.pos+1,new Q(U.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;ir.pos?null:new dt(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new dt(n.from,n.to,n.gapFrom,n.gapTo,Q.fromJSON(t,n.slice),n.insert,!!n.structure)}}Lt.jsonID("replaceAround",dt);function Km(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function b$(e,t,n,r){let i=[],o=[],s,l;e.doc.nodesBetween(t,n,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,t),p=Math.min(c+a.nodeSize,n),h=r.addToSet(d);for(let m=0;me.step(a)),o.forEach(a=>e.step(a))}function E$(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof If){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,n);for(let u=0;ue.step(new Er(s.from,s.to,s.style)))}function qy(e,t,n,r=n.contentMatch,i=!0){let o=e.doc.nodeAt(t),s=[],l=t+1;for(let a=0;a=0;a--)e.step(s[a])}function w$(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function bl(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth;;--r){let i=e.$from.node(r),o=e.$from.index(r),s=e.$to.indexAfter(r);if(rn;h--)m||r.index(h)>0?(m=!0,u=U.from(r.node(h).copy(u)),d++):a--;let f=U.empty,p=0;for(let h=o,m=!1;h>n;h--)m||i.after(h+1)=0;s--){if(r.size){let l=n[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=U.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new dt(i,o,i,o,new Q(r,0,0),n.length,!0))}function C$(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(s,l)=>{let a=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,a)&&_$(e.doc,e.mapping.slice(o).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let p=r.whitespace=="pre",h=!!r.contentMatch.matchType(r.schema.linebreakReplacement);p&&!h?c=!1:!p&&h&&(c=!0)}c===!1&&x_(e,s,l,o),qy(e,e.mapping.slice(o).map(l,1),r,void 0,c===null);let u=e.mapping.slice(o),d=u.map(l,1),f=u.map(l+s.nodeSize,1);return e.step(new dt(d,f,d+1,f-1,new Q(U.from(r.create(a,null,s.marks)),0,0),1,!0)),c===!0&&v_(e,s,l,o),!1}})}function v_(e,t,n,r){t.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let a=e.mapping.slice(r).map(n+1+o+s.index);e.replaceWith(a,a+1,t.type.schema.linebreakReplacement.create())}}})}function x_(e,t,n,r){t.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=e.mapping.slice(r).map(n+1+o);e.replaceWith(s,s+1,t.type.schema.text(` `))}})}function _$(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function T$(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new dt(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Q(U.from(s),0,0),1,!0))}function Ps(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function N$(e,t,n=1,r){let i=e.doc.resolve(t),o=U.empty,s=U.empty;for(let l=i.depth,a=i.depth-n,c=n-1;l>a;l--,c--){o=U.from(i.node(l).copy(o));let u=r&&r[c];s=U.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}e.step(new ct(t,t,new Q(o.append(s),n,n),!0))}function Xi(e,t){let n=e.resolve(t),r=n.index();return S_(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function O$(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&S_(o,s)&&r.node(i).canReplace(l,l+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function M$(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,o=e.doc.resolve(t-n),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(i);u&&!d?r=!1:!u&&d&&(r=!0)}let l=e.steps.length;if(r===!1){let u=e.doc.resolve(t+n);x_(e,u.node(),u.before(),l)}s.inlineContent&&qy(e,t+n-1,s,o.node().contentMatchAt(o.index()),r==null);let a=e.mapping.slice(l),c=a.map(t-n);if(e.step(new ct(c,a.map(t+n,-1),Q.empty,!0)),r===!0){let u=e.doc.resolve(c);v_(e,u.node(),u.before(),e.steps.length)}return e}function A$(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Pf(e,t,n=t,r=Q.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return C_(i,o,r)?new ct(t,n,r):new R$(i,o,r).fit()}function C_(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class R${constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=U.empty;for(let i=0;i<=t.depth;i++){let o=t.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=U.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new Q(o,s,l);return t>-1?new dt(r.pos,t,this.$to.pos,this.$to.end(),a,n):a.size||r.pos!=this.$to.pos?new ct(r.pos,i.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Xp(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(U.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Xp(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Q(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=Xp(t,n);if(i.childCount<=1&&n>0){let o=t.size-n<=n+i.size;this.unplaced=new Q(Hl(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Q(Hl(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let m=0;m1||a==0||m.content.size)&&(d=y,u.push(__(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=jl(this.placed,n,U.from(u)),this.frontier[n].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,y=l;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n=0;l--){let{match:a,type:c}=this.frontier[l],u=Jp(t,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=jl(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,o)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=jl(this.placed,this.depth,U.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(U.empty,!0);n.childCount&&(this.placed=jl(this.placed,this.frontier.length,n))}}function Hl(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Hl(e.firstChild.content,t-1,n)))}function jl(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(jl(e.lastChild.content,t-1,n)))}function Xp(e,t){for(let n=0;n1&&(r=r.replaceChild(0,__(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(U.empty,!0)))),e.copy(r)}function Jp(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!I$(n,o.content,s)?l:null}function I$(e,t,n){for(let r=n;r0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?l=f:i.before(f)==p&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=D$(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(e.replace(t,n,r),!(e.steps.length>d));f--){let p=s[f];p<0||(t=i.before(p),n=o.after(p))}}function T_(e,t,n,r,i){if(tr){let o=i.contentMatchAt(0),s=o.fillBefore(e).append(e);e=s.append(o.matchFragment(s).fillBefore(U.empty,!0))}return e}function L$(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=A$(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new Q(U.from(r),0,0))}function B$(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=N_(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return e.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return e.delete(r.before(s),n);e.delete(t,n)}function N_(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let o=e.start(i);if(ot.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}class Ls extends Lt{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return tt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return tt.fromReplace(t,this.pos,this.pos+1,new Q(U.from(i),0,n.isLeaf?0:1))}getMap(){return gn.empty}invert(t){return new Ls(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ls(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ls(n.pos,n.attr,n.value)}}Lt.jsonID("attr",Ls);class Ba extends Lt{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return tt.ok(r)}getMap(){return gn.empty}invert(t){return new Ba(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ba(n.attr,n.value)}}Lt.jsonID("docAttr",Ba);let tl=class extends Error{};tl=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};tl.prototype=Object.create(Error.prototype);tl.prototype.constructor=tl;tl.prototype.name="TransformError";class Yy{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Ds}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new tl(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Q.empty){let i=Pf(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Q(U.from(r),0,0))}delete(t,n){return this.replace(t,n,Q.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return P$(this,t,n,r),this}replaceRangeWith(t,n,r){return L$(this,t,n,r),this}deleteRange(t,n){return B$(this,t,n),this}lift(t,n){return v$(this,t,n),this}join(t,n=1){return M$(this,t,n),this}wrap(t,n){return k$(this,t,n),this}setBlockType(t,n=t,r,i=null){return C$(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return T$(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Ls(t,n,r)),this}setDocAttribute(t,n){return this.step(new Ba(t,n)),this}addNodeMark(t,n){return this.step(new Ti(t,n)),this}removeNodeMark(t,n){if(!(n instanceof Te)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n=n.isInSet(r.marks),!n)return this}return this.step(new el(t,n)),this}split(t,n=1,r){return N$(this,t,n,r),this}addMark(t,n,r){return b$(this,t,n,r),this}removeMark(t,n,r){return E$(this,t,n,r),this}clearIncompatible(t,n,r){return qy(this,t,n,r),this}}const Zp=Object.create(null);class se{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new O_(t.min(n),t.max(n))]}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 t=this.ranges;for(let n=0;n=0;o--){let s=n<0?is(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):is(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Bn(t.node(0))}static atStart(t){return is(t,t,0,0,1)||new Bn(t)}static atEnd(t){return is(t,t,t.content.size,t.childCount,-1)||new Bn(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zp[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Zp)throw new RangeError("Duplicate use of selection JSON ID "+t);return Zp[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ie.between(this.$anchor,this.$head).getBookmark()}}se.prototype.visible=!0;class O_{constructor(t,n){this.$from=t,this.$to=n}}let Cw=!1;function _w(e){!Cw&&!e.parent.inlineContent&&(Cw=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ie extends se{constructor(t,n=t){_w(t),_w(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return se.near(r);let i=t.resolve(n.map(this.anchor));return new ie(i.parent.inlineContent?i:r,r)}replace(t,n=Q.empty){if(super.replace(t,n),n==Q.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof ie&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Lf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ie(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=se.findFrom(n,r,!0)||se.findFrom(n,-r,!0);if(o)n=o.$head;else return se.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(se.findFrom(t,-r,!0)||se.findFrom(t,r,!0)).$anchor,t.pos0?0:1);i>0?s=0;s+=i){let l=t.child(s);if(l.isAtom){if(!o&&re.isSelectable(l))return re.create(e,n-(i<0?l.nodeSize:0))}else{let a=is(e,l,n+i,i<0?l.childCount:0,i,o);if(a)return a}n+=l.nodeSize*i}return null}function Tw(e,t,n){let r=e.steps.length-1;if(r{s==null&&(s=u)}),e.setSelection(se.near(e.doc.resolve(s),n))}const Nw=1,zc=2,Ow=4;class z$ extends Yy{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=zc,this}ensureMarks(t){return Te.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&zc)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~zc,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Te.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,o)),this.selection.empty||this.setSelection(se.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ow,this}get scrolledIntoView(){return(this.updated&Ow)>0}}function Mw(e,t){return!t||!e?e:e.bind(t)}class Vl{constructor(t,n,r){this.name=t,this.init=Mw(n.init,r),this.apply=Mw(n.apply,r)}}const $$=[new Vl("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Vl("selection",{init(e,t){return e.selection||se.atStart(t.doc)},apply(e){return e.selection}}),new Vl("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Vl("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class eh{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=$$.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Vl(r.key,r.spec.state,r))})}}class Ss{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;rr.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new eh(t.schema,t.plugins),o=new Ss(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=zi.fromJSON(t.schema,n.doc);else if(s.name=="selection")o.selection=se.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){o[s.name]=c.fromJSON.call(a,t,n[l],o);return}}o[s.name]=s.init(t,o)}}),o}}function M_(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=M_(i,t,{})),n[r]=i}return n}class Je{constructor(t){this.spec=t,this.props={},t.props&&M_(t.props,this,this.props),this.key=t.key?t.key.key:A_("plugin")}getState(t){return t[this.key]}}const th=Object.create(null);function A_(e){return e in th?e+"$"+ ++th[e]:(th[e]=0,e+"$")}class ht{constructor(t="key"){this.key=A_(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const bt=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Fa=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let qm=null;const $r=function(e,t,n){let r=qm||(qm=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},U$=function(){qm=null},zo=function(e,t,n,r){return n&&(Aw(e,t,n,r,-1)||Aw(e,t,n,r,1))},H$=/^(img|br|input|textarea|hr)$/i;function Aw(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Dn(e))){let o=e.parentNode;if(!o||o.nodeType!=1||cc(e)||H$.test(e.nodeName)||e.contentEditable=="false")return!1;t=bt(e)+(i<0?0:1),e=o}else if(e.nodeType==1){if(e=e.childNodes[t+(i<0?-1:0)],e.contentEditable=="false")return!1;t=i<0?Dn(e):0}else return!1}}function Dn(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function j$(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Dn(e)}else if(e.parentNode&&!cc(e))t=bt(e),e=e.parentNode;else return null}}function V$(e,t){for(;;){if(e.nodeType==3&&t2),Mn=nl||(Sr?/Mac/.test(Sr.platform):!1),G$=Sr?/Win/.test(Sr.platform):!1,Wr=/Android \d/.test(Ji),uc=!!Rw&&"webkitFontSmoothing"in Rw.documentElement.style,Y$=uc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Q$(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Ir(e,t){return typeof e=="number"?e:e[t]}function X$(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Iw(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=Fa(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,c=a?Q$(o):X$(l),u=0,d=0;if(t.topc.bottom-Ir(r,"bottom")&&(d=t.bottom-t.top>c.bottom-c.top?t.top+Ir(i,"top")-c.top:t.bottom-c.bottom+Ir(i,"bottom")),t.leftc.right-Ir(r,"right")&&(u=t.right-c.right+Ir(i,"right")),u||d)if(a)o.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let h=l.scrollLeft-f,m=l.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function J$(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let o=(t.left+t.right)/2,s=n+1;s=n-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:D_(e.dom)}}function D_(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Fa(r));return t}function Z$({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;P_(n,r==0?0:r-t)}function P_(e,t){for(let n=0;n=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);let m=h.left>t.left?h.left-t.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>t.top&&!a&&h.left<=t.left&&h.right>=t.left&&(a=u,c={left:Math.max(h.left,Math.min(h.right,t.left)),top:h.top});!n&&(t.left>=h.right&&t.top>=h.top||t.left>=h.left&&t.top>=h.bottom)&&(o=d+1)}}return!n&&a&&(n=a,i=c,r=0),n&&n.nodeType==3?tU(n,i):!n||r&&n.nodeType==1?{node:e,offset:o}:L_(n,i)}function tU(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:e,offset:0}}function Xy(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function nU(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}function iU(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let l=e.docView.nearestDesc(o,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?i=l.posBefore:(!s&&a.right-1?i:e.docView.posFromDOM(t,n,-1)}function B_(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}let c;uc&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?l=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=iU(e,r,i,t))}l==null&&(l=rU(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Dw(e){return e.top=0&&i==r.nodeValue.length?(a--,u=1):n<0?a--:c++,Pl(ai($r(r,a,c),u),u<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Dn(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return nh(a.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(n<0||i==Dn(r))){let a=r.childNodes[i-1],c=a.nodeType==3?$r(a,Dn(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Pl(ai(c,1),!1)}if(o==null&&i=0)}function Pl(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function nh(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function z_(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function lU(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return z_(e,t,()=>{let{node:o}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=e.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=F_(e,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=$r(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const aU=/[\u0590-\u08ac]/;function cU(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=e.domSelection();return l?!aU.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?o:s:z_(e,t,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=e.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",n,"character");let p=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:h,focusOffset:m}=e.domSelectionRange(),y=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),y}):r.pos==r.start()||r.pos==r.end()}let Pw=null,Lw=null,Bw=!1;function uU(e,t,n){return Pw==t&&Lw==n?Bw:(Pw=t,Lw=n,Bw=n=="up"||n=="down"?lU(e,t,n):cU(e,t,n))}const Fn=0,Fw=1,po=2,kr=3;class dc{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Fn,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;nbt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;nt||s instanceof U_){i=t-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof $_&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?bt(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&n<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(t,n,u);t=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=bt(f.dom)+1;break}t-=f.size}i==-1&&(i=0)}if(i>-1&&(c>n||l==this.children.length-1)){n=c;for(let u=l+1;uh&&sn){let h=l;l=a,a=h}let p=document.createRange();p.setEnd(a.node,a.offset),p.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(p)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i=r:tr){let l=r+o.border,a=s-o.border;if(t>=l&&n<=a){this.dirty=t==r||n==s?po:Fw,t==l&&n==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=kr:o.markDirty(t-l,n-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?po:kr}r=s}this.dirty=po}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?po:Fw;n.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==Fn&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class dU extends dc{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class $o extends dc{constructor(t,n,r,i,o){super(t,[],r,i),this.mark=n,this.spec=o}static create(t,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Go.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new $o(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&kr||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=kr&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Fn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=Jm(o,0,t,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Go.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=V_(u,r,n),c?a=new fU(t,n,r,i,u,d||null,f,c,o,s+1):n.isText?new Ff(t,n,r,i,u,f,o):new Hi(t,n,r,i,u,d||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>U.empty)}return t}matchesNode(t,n,r){return this.dirty==Fn&&t.eq(this.node)&&hd(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,o=t.composing?this.localCompositionInfo(t,n):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new hU(this,s&&s.node,t);yU(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,t):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?Te.none:this.node.child(u).marks,r,t),a.placeWidget(c,t,i)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,t);let p;a.findNodeMatch(c,u,d,f)||l&&t.state.selection.from>i&&t.state.selection.to-1&&a.updateNodeAt(c,u,d,p,t)||a.updateNextNode(c,u,d,t,f,i)||a.addNode(c,u,d,t,i),i+=c.nodeSize}),a.syncToMarks([],r,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==po)&&(s&&this.protectLocalComposition(t,s),H_(this.contentDOM,this.children,t),nl&&bU(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof ie)||rn+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=EU(this.node.content,s,r-n,i-n);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new dU(this,o,n,i);t.input.compositionNodes.push(s),this.children=Jm(this.children,r,r+i.length,t,s)}update(t,n,r,i){return this.dirty==kr||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Fn}updateOuterDeco(t){if(hd(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=j_(this.dom,this.nodeDOM,Xm(this.outerDeco,this.node,n),Xm(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function zw(e,t,n,r,i){V_(r,t,e);let o=new Hi(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Ff extends Hi{constructor(t,n,r,i,o,s,l){super(t,n,r,i,o,null,s,l,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==kr||this.dirty!=Fn&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Fn||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Fn,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),o=document.createTextNode(i.text);return new Ff(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=kr)}get domAtom(){return!1}isText(t){return this.node.text==t}}class U_ extends dc{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Fn&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class fU extends Hi{constructor(t,n,r,i,o,s,l,a,c,u){super(t,n,r,i,o,s,l,c,u),this.spec=a}update(t,n,r,i){if(this.dirty==kr)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,i),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function H_(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,t.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=$o.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof $o)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let a=l.node;if(a){if(a!=e.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function gU(e,t){return e.type.side-t.type.side}function yU(e,t,n,r){let i=t.locals(e),o=0;if(i.length==0){for(let c=0;co;)l.push(i[s++]);let h=o+f.nodeSize;if(f.isText){let y=h;s!y.inline):l.slice();r(f,m,t.forChild(o,f),p),o=h}}function bU(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function EU(e,t,n,r){for(let i=0,o=0;i=n){if(o>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let c=l=0&&c+t.length+l>=n)return l+c;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return-1}function Jm(e,t,n,r,i){let o=[];for(let s=0,l=0;s=n||u<=t?o.push(a):(cn&&o.push(a.slice(n-c,a.size,r)))}return o}function Jy(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(Bf(n)){for(a=s;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&re.isSelectable(d)&&i.parent&&!(d.isInline&&W$(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new re(s==f?l:r.resolve(f))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,f=s;for(let p=0;p{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!W_(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function vU(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setStart(r.parentNode,bt(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&sn&&Ui<=11&&(r.disabled=!0,r.disabled=!1)}function K_(e,t){if(t instanceof re){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Vw(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Vw(e)}function Vw(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Zy(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||ie.between(t,n,r)}function Ww(e){return e.editable&&!e.hasFocus()?!1:q_(e)}function q_(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function xU(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return zo(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Zm(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&se.findFrom(o,t)}function di(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Kw(e,t,n){let r=e.state.selection;if(r instanceof ie)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=e.state.doc.resolve(i.pos+o.nodeSize*(t<0?-1:1));return di(e,new ie(r.$anchor,s))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=Zm(e.state,t);return i&&i instanceof re?di(e,i):!1}else if(!(Mn&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=t<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=e.docView.descAt(l))&&!s.contentDOM?re.isSelectable(o)?di(e,new re(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):uc?di(e,new ie(e.state.doc.resolve(t<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof re&&r.node.isInline)return di(e,new ie(t>0?r.$to:r.$from));{let i=Zm(e.state,t);return i?di(e,i):!1}}}function md(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function la(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function ts(e,t){return t<0?SU(e):kU(e)}function SU(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(tr&&n.nodeType==1&&r0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(la(l,-1))i=n,o=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(G_(n))break;{let l=n.previousSibling;for(;l&&la(l,-1);)i=n.parentNode,o=bt(l),l=l.previousSibling;if(l)n=l,r=md(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?eg(e,n,r):i&&eg(e,i,o)}function kU(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=md(n),o,s;for(;;)if(r{e.state==i&&qr(e)},50)}function qw(e,t){let n=e.state.doc.resolve(t);if(!(At||G$)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function Gw(e,t,n){let r=e.state.selection;if(r instanceof ie&&!r.empty||n.indexOf("s")>-1||Mn&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=Zm(e.state,t);if(s&&s instanceof re)return di(e,s)}if(!i.parent.inlineContent){let s=t<0?i:o,l=r instanceof Bn?se.near(s,t):se.findFrom(s,t);return l?di(e,l):!1}return!1}function Yw(e,t){if(!(e.state.selection instanceof ie))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=e.state.tr;return t<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),e.dispatch(s),!0}return!1}function Qw(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function TU(e){if(!jt||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Qw(e,r,"true"),setTimeout(()=>Qw(e,r,"false"),20)}return!1}function NU(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function OU(e,t){let n=t.keyCode,r=NU(t);if(n==8||Mn&&n==72&&r=="c")return Yw(e,-1)||ts(e,-1);if(n==46&&!t.shiftKey||Mn&&n==68&&r=="c")return Yw(e,1)||ts(e,1);if(n==13||n==27)return!0;if(n==37||Mn&&n==66&&r=="c"){let i=n==37?qw(e,e.state.selection.from)=="ltr"?-1:1:-1;return Kw(e,i,r)||ts(e,i)}else if(n==39||Mn&&n==70&&r=="c"){let i=n==39?qw(e,e.state.selection.from)=="ltr"?1:-1:1;return Kw(e,i,r)||ts(e,i)}else{if(n==38||Mn&&n==80&&r=="c")return Gw(e,-1,r)||ts(e,-1);if(n==40||Mn&&n==78&&r=="c")return TU(e)||Gw(e,1,r)||ts(e,1);if(r==(Mn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Y_(e,t){e.someProp("transformCopied",p=>{t=p(t,e)});let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=e.someProp("clipboardSerializer")||Go.fromSchema(e.state.schema),l=tT(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=eT[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",p=>p(t,e))||t.content.textBetween(0,t.content.size,` `);return{dom:a,text:f,slice:t}}function Q_(e,t,n,r,i){let o=i.parent.type.spec.code,s,l;if(!n&&!t)return null;let a=t&&(r||o||!n);if(a){if(e.someProp("transformPastedText",f=>{t=f(t,o||r,e)}),o)return t?new Q(U.from(e.state.schema.text(t.replace(/\r\n?/g,` `))),0,0):Q.empty;let d=e.someProp("clipboardTextParser",f=>f(t,i,r,e));if(d)l=d;else{let f=i.marks(),{schema:p}=e.state,h=Go.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let y=s.appendChild(document.createElement("p"));m&&y.appendChild(h.serializeNode(p.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),s=IU(n),uc&&DU(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||$i.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!MU.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=PU(Xw(l,+u[1],+u[2]),u[4]);else if(l=Q.maxOpen(AU(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d{l=d(l,e)}),l}const MU=/^(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 AU(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&J_(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Z_(s[s.length-1],o.length));let u=X_(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return U.from(s)}return e}function X_(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,U.from(e));return e}function J_(e,t,n,r,i){if(i1&&(o=0),i=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(U.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function Xw(e,t,n){return tn})),ih.createHTML(e)):e}function IU(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=tT().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&eT[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"").reverse().join("")),n.innerHTML=RU(e),i)for(let o=0;o=0;l-=2){let a=n.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=U.from(a.create(r[l+1],i)),o++,s++}return new Q(i,o,s)}const Vt={},Wt={},LU={touchstart:!0,touchmove:!0};class BU{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function FU(e){for(let t in Vt){let n=Vt[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{$U(e,r)&&!eb(e,r)&&(e.editable||!(r.type in Wt))&&n(e,r)},LU[t]?{passive:!0}:void 0)}jt&&e.dom.addEventListener("input",()=>null),ng(e)}function Ni(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function zU(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function ng(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>eb(e,r))})}function eb(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function $U(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function UU(e,t){!eb(e,t)&&Vt[t.type]&&(e.editable||!(t.type in Wt))&&Vt[t.type](e,t)}Wt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!rT(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Wr&&At&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),nl&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,so(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||OU(e,n)?n.preventDefault():Ni(e,"key")};Wt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Wt.keypress=(e,t)=>{let n=t;if(rT(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Mn&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof ie)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i))&&e.dispatch(e.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function zf(e){return{left:e.clientX,top:e.clientY}}function HU(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function tb(e,t,n,r,i){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,l=>s>o.depth?l(e,n,o.nodeAfter,o.before(s),i,!0):l(e,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function Bs(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function jU(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&re.isSelectable(r)?(Bs(e,new re(n)),!0):!1}function VU(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof re&&(r=n.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(re.isSelectable(l)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(Bs(e,re.create(e.state.doc,i)),!0):!1}function WU(e,t,n,r,i){return tb(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(i?VU(e,n):jU(e,n))}function KU(e,t,n,r){return tb(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function qU(e,t,n,r){return tb(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||GU(e,n,r)}function GU(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Bs(e,ie.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)Bs(e,ie.create(r,l+1,l+1+s.content.size));else if(re.isSelectable(s))Bs(e,re.create(r,l));else continue;return!0}}function nb(e){return gd(e)}const nT=Mn?"metaKey":"ctrlKey";Vt.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=nb(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&HU(n,e.input.lastClick)&&!n[nT]&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(zf(n));s&&(o=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new YU(e,s,n,!!r)):(o=="doubleClick"?KU:qU)(e,s.pos,s.inside,n)?n.preventDefault():Ni(e,"pointer"))};class YU{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[nT],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),s=n.inside;else{let u=t.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,a=l?t.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=t.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof re&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&tr&&!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()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ni(t,"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(()=>qr(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(zf(t))),this.updateAllowDefault(t),this.allowDefault||!n?Ni(this.view,"pointer"):WU(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||jt&&this.mightDrag&&!this.mightDrag.node.isAtom||At&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Bs(this.view,se.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Ni(this.view,"pointer")}move(t){this.updateAllowDefault(t),Ni(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}Vt.touchstart=e=>{e.input.lastTouch=Date.now(),nb(e),Ni(e,"pointer")};Vt.touchmove=e=>{e.input.lastTouch=Date.now(),Ni(e,"pointer")};Vt.contextmenu=e=>nb(e);function rT(e,t){return e.composing?!0:jt&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const QU=Wr?5e3:-1;Wt.compositionstart=Wt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ie&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))e.markCursor=e.state.storedMarks||n.marks(),gd(e,!0),e.markCursor=null;else if(gd(e,!t.selection.empty),tr&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=e.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}e.input.composing=!0}iT(e,QU)};Wt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,iT(e,20))};function iT(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>gd(e),t))}function oT(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=JU());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function XU(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=j$(t.focusNode,t.focusOffset),r=V$(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function JU(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function gd(e,t=!1){if(!(Wr&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),oT(e),t||e.docView&&e.docView.dirty){let n=Jy(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!e.state.selection.empty?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function ZU(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const za=sn&&Ui<15||nl&&Y$<604;Vt.copy=Wt.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let o=za?null:n.clipboardData,s=r.content(),{dom:l,text:a}=Y_(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):ZU(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function e3(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function t3(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?$a(e,r.value,null,i,t):$a(e,r.textContent,r.innerHTML,i,t)},50)}function $a(e,t,n,r,i){let o=Q_(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",a=>a(e,i,o||Q.empty)))return!0;if(!o)return!1;let s=e3(o),l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function sT(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Wt.paste=(e,t)=>{let n=t;if(e.composing&&!Wr)return;let r=za?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&$a(e,sT(r),r.getData("text/html"),i,n)?n.preventDefault():t3(e,n)};class lT{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const aT=Mn?"altKey":"ctrlKey";Vt.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(zf(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof re?i.to-1:i.to))){if(r&&r.mightDrag)s=re.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(s=re.create(e.state.doc,d.posBefore))}}let l=(s||e.state.selection).content(),{dom:a,text:c,slice:u}=Y_(e,l);(!n.dataTransfer.files.length||!At||I_>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(za?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",za||n.dataTransfer.setData("text/plain",c),e.dragging=new lT(u,!n[aT],s)};Vt.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Wt.dragover=Wt.dragenter=(e,t)=>t.preventDefault();Wt.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(zf(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",h=>{s=h(s,e)}):s=Q_(e,sT(n.dataTransfer),za?null:n.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!n[aT]);if(e.someProp("handleDrop",h=>h(e,n,s||Q.empty,l))){n.preventDefault();return}if(!s)return;n.preventDefault();let a=s?k_(e.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=e.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&re.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new re(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,y,g,b)=>h=b),c.setSelection(Zy(e,p,c.doc.resolve(h)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))};Vt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&qr(e)},20))};Vt.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Vt.beforeinput=(e,t)=>{if(At&&Wr&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,so(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in Wt)Vt[e]=Wt[e];function Ua(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class yd{constructor(t,n){this.toDOM=t,this.spec=n||_o,this.side=this.spec.side||0}map(t,n,r,i){let{pos:o,deleted:s}=t.mapResult(n.from+i,this.side<0?-1:1);return s?null:new wt(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof yd&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ua(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class ji{constructor(t,n){this.attrs=t,this.spec=n||_o}map(t,n,r,i){let o=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new wt(o,s,this)}valid(t,n){return n.from=t&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;st){let l=this.children[s]+1;this.children[s+2].findInner(t-l,n-l,r,i+l,o)}}map(t,n,r){return this==Nt||t.maps.length==0?this:this.mapInner(t,n,0,0,r||_o)}mapInner(t,n,r,i,o){let s;for(let l=0;l{let c=a+r,u;if(u=uT(n,l,c)){for(i||(i=this.children.slice());ol&&d.to=t){this.children[l]==t&&(r=this.children[l+2]);break}let o=t+1,s=o+n.content.size;for(let l=0;lo&&a.type instanceof ji){let c=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;ci.map(t,n,_o));return gi.from(r)}forChild(t,n){if(n.isLeaf)return Le.empty;let r=[];for(let i=0;in instanceof Le)?t:t.reduce((n,r)=>n.concat(r instanceof Le?r:r.members),[]))}}forEachSet(t){for(let n=0;n{let y=m-h-(p-f);for(let g=0;gb+u-d)continue;let E=l[g]+u-d;p>=E?l[g+1]=f<=E?-2:-1:f>=u&&y&&(l[g]+=y,l[g+1]+=y)}d+=y}),u=n.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let f=n.map(e[c+1]+o,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(d),y=r.maybeChild(h);if(y&&m==d&&m+y.nodeSize==p){let g=l[c+2].mapInner(n,y,u+1,e[c]+o+1,s);g!=Nt?(l[c]=d,l[c+1]=p,l[c+2]=g):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=r3(l,e,t,n,i,o,s),u=bd(c,r,0,s);t=u.local;for(let d=0;dn&&s.to{let c=uT(e,l,a+n);if(c){o=!0;let u=bd(c,l,n+a+1,r);u!=Nt&&i.push(a,a+l.nodeSize,u)}});let s=cT(o?dT(e):e,-n).sort(To);for(let l=0;l0;)t++;e.splice(t,0,n)}function oh(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Nt&&t.push(r)}),e.cursorWrapper&&t.push(Le.create(e.state.doc,[e.cursorWrapper.deco])),gi.from(t)}const i3={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},o3=sn&&Ui<=11;class s3{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class l3{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new s3,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),o3&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,i3)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;nthis.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(Ww(this.view)){if(this.suppressingSelectionUpdates)return qr(this.view);if(sn&&Ui<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&zo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Fa(o))n.add(o);for(let o=t.anchorNode;o;o=Fa(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ww(t)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(t.editable)for(let u=0;ud.nodeName=="BR");if(u.length==2){let[d,f]=u;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of u){let p=f.parentNode;p&&p.nodeName=="LI"&&(!d||u3(t,d)!=p)&&f.remove()}}}let c=null;o<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||i)&&(o>-1&&(t.docView.markDirty(o,s),a3(t)),this.handleDOMChange(o,s,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||qr(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let u=0;ui;y--){let g=r.childNodes[y-1],b=g.pmViewDesc;if(g.nodeName=="BR"&&!b){o=y;break}if(!b||b.size)break}let d=e.state.doc,f=e.someProp("domParser")||$i.fromSchema(e.state.schema),p=d.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:f3,context:p});if(c&&c[0].pos!=null){let y=c[0].pos,g=c[1]&&c[1].pos;g==null&&(g=y),h={anchor:y+s,head:g+s}}return{doc:m,sel:h,from:s,to:l}}function f3(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(jt&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||jt&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const p3=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function h3(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let I=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,$=Jy(e,I);if($&&!e.state.selection.eq($)){if(At&&Wr&&e.input.lastKeyCode===13&&Date.now()-100F(e,so(13,"Enter"))))return;let j=e.state.tr.setSelection($);I=="pointer"?j.setMeta("pointer",!0):I=="key"&&j.scrollIntoView(),o&&j.setMeta("composition",o),e.dispatch(j)}return}let s=e.state.doc.resolve(t),l=s.sharedDepth(n);t=s.before(l+1),n=e.state.doc.resolve(n).after(l+1);let a=e.state.selection,c=d3(e,t,n),u=e.state.doc,d=u.slice(c.from,c.to),f,p;e.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Wr)&&i.some(I=>I.nodeType==1&&!p3.test(I.nodeName))&&(!h||h.endA>=h.endB)&&e.someProp("handleKeyDown",I=>I(e,so(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof ie&&!a.empty&&a.$head.sameParent(a.$anchor)&&!e.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let I=rv(e,e.state.doc,c.sel);if(I&&!I.eq(e.state.selection)){let $=e.state.tr.setSelection(I);o&&$.setMeta("composition",o),e.dispatch($)}}return}e.state.selection.frome.state.selection.from&&h.start<=e.state.selection.from+2&&e.state.selection.from>=c.from?h.start=e.state.selection.from:h.endA=e.state.selection.to-2&&e.state.selection.to<=c.to&&(h.endB+=e.state.selection.to-h.endA,h.endA=e.state.selection.to)),sn&&Ui<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),y=c.doc.resolveNoCache(h.endB-c.from),g=u.resolve(h.start),b=m.sameParent(y)&&m.parent.inlineContent&&g.end()>=h.endA,E;if((nl&&e.input.lastIOSEnter>Date.now()-225&&(!b||i.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!b&&m.posI(e,so(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>h.start&&g3(u,h.start,h.endA,m,y)&&e.someProp("handleKeyDown",I=>I(e,so(8,"Backspace")))){Wr&&At&&e.domObserver.suppressSelectionUpdates();return}At&&h.endB==h.start&&(e.input.lastChromeDelete=Date.now()),Wr&&!b&&m.start()!=y.start()&&y.parentOffset==0&&m.depth==y.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,y=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{e.someProp("handleKeyDown",function(I){return I(e,so(13,"Enter"))})},20));let v=h.start,S=h.endA,x,_,R;if(b){if(m.pos==y.pos)sn&&Ui<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>qr(e),20)),x=e.state.tr.delete(v,S),_=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(R=m3(m.parent.content.cut(m.parentOffset,y.parentOffset),g.parent.content.cut(g.parentOffset,h.endA-g.start()))))x=e.state.tr,R.type=="add"?x.addMark(v,S,R.mark):x.removeMark(v,S,R.mark);else if(m.parent.child(m.index()).isText&&m.index()==y.index()-(y.textOffset?0:1)){let I=m.parent.textBetween(m.parentOffset,y.parentOffset);if(e.someProp("handleTextInput",$=>$(e,v,S,I)))return;x=e.state.tr.insertText(I,v,S)}}if(x||(x=e.state.tr.replace(v,S,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let I=rv(e,x.doc,c.sel);I&&!(At&&e.composing&&I.empty&&(h.start!=h.endB||e.input.lastChromeDeletet.content.size?null:Zy(e,t.resolve(n.anchor),t.resolve(n.head))}function m3(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,o=r,s,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;un||sh(s,!0,!1)0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function y3(e,t,n,r,i){let o=e.findDiffStart(t,n);if(o==null)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&t<=57343&&n>=55296&&n<=56319}class b3{constructor(t,n){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 BU,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(cv),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=lv(this),sv(this),this.nodeViews=av(this),this.docView=zw(this.state.doc,ov(this),oh(this),this.dom,this),this.domObserver=new l3(this,(r,i,o,s)=>h3(this,r,i,o,s)),this.domObserver.start(),FU(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&ng(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(cv),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,o=!1,s=!1;t.storedMarks&&this.composing&&(oT(this),s=!0),this.state=t;let l=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=av(this);w3(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&ng(this),this.editable=lv(this),sv(this);let a=oh(this),c=ov(this),u=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(t.doc,c,a);(d||!t.selection.eq(i.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&J$(this);if(s){this.domObserver.stop();let p=d&&(sn||At)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&E3(i.selection,t.selection);if(d){let h=At?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=XU(this)),(o||!this.docView.update(t.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=zw(t.doc,c,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&xU(this))?qr(this,p):(K_(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Z$(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof re){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Iw(this,n.getBoundingClientRect(),t)}else Iw(this,this.coordsAtPos(this.state.selection.head,1),t)}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new lT(t.slice,t.move,i<0?void 0:re.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;sn.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return oU(this,t)}coordsAtPos(t,n=1){return F_(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return uU(this,n||this.state,t)}pasteHTML(t,n){return $a(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return $a(this,t,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(zU(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],oh(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,U$())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return UU(this,t)}dispatch(t){let n=this._props.dispatchTransaction;n?n.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){let t=this.domSelection();return t?jt&&this.root.nodeType===11&&K$(this.dom.ownerDocument)==this.dom&&c3(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function ov(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[wt.node(0,e.state.doc.content.size,t)]}function sv(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:wt.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function lv(e){return!e.someProp("editable",t=>t(e.state)===!1)}function E3(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function av(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function w3(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function cv(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Ki={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:"'"},Ed={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},v3=typeof navigator<"u"&&/Mac/.test(navigator.platform),x3=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Et=0;Et<10;Et++)Ki[48+Et]=Ki[96+Et]=String(Et);for(var Et=1;Et<=24;Et++)Ki[Et+111]="F"+Et;for(var Et=65;Et<=90;Et++)Ki[Et]=String.fromCharCode(Et+32),Ed[Et]=String.fromCharCode(Et);for(var lh in Ki)Ed.hasOwnProperty(lh)||(Ed[lh]=Ki[lh]);function S3(e){var t=v3&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||x3&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Ed:Ki)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const k3=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function C3(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let l=0;l127)&&(o=Ki[r.keyCode])&&o!=i){let l=t[ah(o,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const N3=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function fT(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const O3=(e,t,n)=>{let r=fT(e,n);if(!r)return!1;let i=sb(r);if(!i){let s=r.blockRange(),l=s&&bl(s);return l==null?!1:(t&&t(e.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(gT(e,i,t,-1))return!0;if(r.parent.content.size==0&&(rl(o,"end")||re.isSelectable(o)))for(let s=r.depth;;s--){let l=Pf(e.doc,r.before(s),r.after(s),Q.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},M3=(e,t,n)=>{let r=fT(e,n);if(!r)return!1;let i=sb(r);return i?pT(e,i,t):!1},A3=(e,t,n)=>{let r=hT(e,n);if(!r)return!1;let i=lb(r);return i?pT(e,i,t):!1};function pT(e,t,n){let r=t.nodeBefore,i=r,o=t.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=t.nodeAfter,l=s,a=t.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=Pf(e.doc,o,a,Q.empty);if(!c||c.from!=o||c instanceof ct&&c.slice.size>=a-o)return!1;if(n){let u=e.tr.step(c);u.setSelection(ie.create(u.doc,o)),n(u.scrollIntoView())}return!0}function rl(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const R3=(e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=sb(r)}let s=o&&o.nodeBefore;return!s||!re.isSelectable(s)?!1:(t&&t(e.tr.setSelection(re.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function sb(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function hT(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset{let r=hT(e,n);if(!r)return!1;let i=lb(r);if(!i)return!1;let o=i.nodeAfter;if(gT(e,i,t,1))return!0;if(r.parent.content.size==0&&(rl(o,"start")||re.isSelectable(o))){let s=Pf(e.doc,r.before(),r.after(),Q.empty);if(s&&s.slice.size{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){let n=e.node(t);if(e.index(t)+1{let n=e.selection,r=n instanceof re,i;if(r){if(n.node.isTextblock||!Xi(e.doc,n.from))return!1;i=n.from}else if(i=Df(e.doc,n.from,-1),i==null)return!1;if(t){let o=e.tr.join(i);r&&o.setSelection(re.create(o.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},L3=(e,t)=>{let n=e.selection,r;if(n instanceof re){if(n.node.isTextblock||!Xi(e.doc,n.to))return!1;r=n.to}else if(r=Df(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},B3=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),o=i&&bl(i);return o==null?!1:(t&&t(e.tr.lift(i,o).scrollIntoView()),!0)},F3=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(` `).scrollIntoView()),!0)};function mT(e){for(let t=0;t{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=mT(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let l=n.after(),a=e.tr.replaceWith(l,l,s.createAndFill());a.setSelection(se.near(a.doc.resolve(l),1)),t(a.scrollIntoView())}return!0},$3=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Bn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=mT(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Ps(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&bl(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},H3=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(re.create(e.doc,i))),!0)};function j3(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||Xi(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function gT(e,t,n,r){let i=t.nodeBefore,o=t.nodeAfter,s,l,a=i.type.spec.isolating||o.type.spec.isolating;if(!a&&j3(e,t,n))return!0;let c=!a&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(n){let p=t.pos+o.nodeSize,h=U.empty;for(let g=s.length-1;g>=0;g--)h=U.from(s[g].create(null,h));h=U.from(i.copy(h));let m=e.tr.step(new dt(t.pos-1,p,t.pos,p,new Q(h,1,0),s.length,!0)),y=m.doc.resolve(p+2*s.length);y.nodeAfter&&y.nodeAfter.type==i.type&&Xi(m.doc,y.pos)&&m.join(y.pos),n(m.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&a?null:se.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&bl(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(c&&rl(o,"start",!0)&&rl(i,"end")){let p=i,h=[];for(;h.push(p),!p.isTextblock;)p=p.lastChild;let m=o,y=1;for(;!m.isTextblock;m=m.firstChild)y++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(n){let g=U.empty;for(let E=h.length-1;E>=0;E--)g=U.from(h[E].copy(g));let b=e.tr.step(new dt(t.pos-h.length,t.pos+o.nodeSize,t.pos+y,t.pos+o.nodeSize-y,new Q(g,h.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function yT(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(ie.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const V3=yT(-1),W3=yT(1);function K3(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),l=s&&Gy(s,e,t);return l?(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0):!1}}function uv(e,t=null){return function(n,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(e,t)))if(a.type==e)i=!0;else{let u=n.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,e)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let a=s.resolve(t.start-2);o=new fd(a,a,t.depth),t.endIndex=0;u--)o=U.from(n[u].type.create(n[u].attrs,o));e.step(new dt(t.start-(r?2:0),t.end,t.start,t.end,new Q(o,0,0),n.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?X3(t,n,e,o):J3(t,n,o):!0:!1}}function X3(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);om;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,a=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?U.empty:U.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new dt(d-(l?1:0),f+(a?1:0),d+1,f-1,new Q((l?U.empty:U.from(i.copy(U.empty))).append(a?U.empty:U.from(i.copy(U.empty))),l?0:1,a?0:1),l?0:1)),t(r.scrollIntoView()),!0}function Z3(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==e);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=e)return!1;if(n){let c=a.lastChild&&a.lastChild.type==l.type,u=U.from(c?e.create():null),d=new Q(U.from(e.create(null,U.from(l.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;n(t.tr.step(new dt(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function $f(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Uf{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...u)=>{const d=a(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],a=!!t,c=t||o.tr,u=()=>(!a&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...m)=>{const y=this.buildProps(c,n),g=p(...m)(y);return l.push(g),d}])),run:u};return d}createCan(t){const{rawCommands:n,state:r}=this,i=!1,o=t||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([a,c])=>[a,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(t,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:t,editor:i,view:s,state:$f({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}class e4{constructor(){this.callbacks={}}on(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),this}emit(t,...n){const r=this.callbacks[t];return r&&r.forEach(i=>i.apply(this,n)),this}off(t,n){const r=this.callbacks[t];return r&&(n?this.callbacks[t]=r.filter(i=>i!==n):delete this.callbacks[t]),this}once(t,n){const r=(...i)=>{this.off(t,r),n.apply(this,i)};return this.on(t,r)}removeAllListeners(){this.callbacks={}}}function ee(e,t,n){return e.config[t]===void 0&&e.parent?ee(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?ee(e.parent,t,n):null}):e.config[t]}function Hf(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function bT(e){const t=[],{nodeExtensions:n,markExtensions:r}=Hf(e),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage,extensions:i},a=ee(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{t.push({type:d,name:f,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=ee(s,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...o,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,t.push({type:s.name,name:u,attribute:f})})}),t}function pt(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function He(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?String(o).split(" "):[],a=r[i]?r[i].split(" "):[],c=l.filter(u=>!a.includes(u));r[i]=[...a,...c].join(" ")}else if(i==="style"){const l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],a=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;a.forEach(u=>{const[d,f]=u.split(":").map(p=>p.trim());c.set(d,f)}),l.forEach(u=>{const[d,f]=u.split(":").map(p=>p.trim());c.set(d,f)}),r[i]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[i]=o}),r},{})}function rg(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>He(n,r),{})}function ET(e){return typeof e=="function"}function ye(e,t=void 0,...n){return ET(e)?t?e.bind(t)(...n):e(...n):e}function t4(e={}){return Object.keys(e).length===0&&e.constructor===Object}function n4(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function dv(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(n):n4(n.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function fv(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&t4(n)?!1:n!=null))}function r4(e,t){var n;const r=bT(e),{nodeExtensions:i,markExtensions:o}=Hf(e),s=(n=i.find(c=>ee(c,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},f=e.reduce((g,b)=>{const E=ee(b,"extendNodeSchema",d);return{...g,...E?E(c):{}}},{}),p=fv({...f,content:ye(ee(c,"content",d)),marks:ye(ee(c,"marks",d)),group:ye(ee(c,"group",d)),inline:ye(ee(c,"inline",d)),atom:ye(ee(c,"atom",d)),selectable:ye(ee(c,"selectable",d)),draggable:ye(ee(c,"draggable",d)),code:ye(ee(c,"code",d)),whitespace:ye(ee(c,"whitespace",d)),linebreakReplacement:ye(ee(c,"linebreakReplacement",d)),defining:ye(ee(c,"defining",d)),isolating:ye(ee(c,"isolating",d)),attrs:Object.fromEntries(u.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))}),h=ye(ee(c,"parseHTML",d));h&&(p.parseDOM=h.map(g=>dv(g,u)));const m=ee(c,"renderHTML",d);m&&(p.toDOM=g=>m({node:g,HTMLAttributes:rg(g,u)}));const y=ee(c,"renderText",d);return y&&(p.toText=y),[c.name,p]})),a=Object.fromEntries(o.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:t},f=e.reduce((y,g)=>{const b=ee(g,"extendMarkSchema",d);return{...y,...b?b(c):{}}},{}),p=fv({...f,inclusive:ye(ee(c,"inclusive",d)),excludes:ye(ee(c,"excludes",d)),group:ye(ee(c,"group",d)),spanning:ye(ee(c,"spanning",d)),code:ye(ee(c,"code",d)),attrs:Object.fromEntries(u.map(y=>{var g;return[y.name,{default:(g=y==null?void 0:y.attribute)===null||g===void 0?void 0:g.default}]}))}),h=ye(ee(c,"parseHTML",d));h&&(p.parseDOM=h.map(y=>dv(y,u)));const m=ee(c,"renderHTML",d);return m&&(p.toDOM=y=>m({mark:y,HTMLAttributes:rg(y,u)})),[c.name,p]}));return new p_({topNode:s,nodes:l,marks:a})}function ch(e,t){return t.nodes[e]||t.marks[e]||null}function pv(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function ab(e,t){const n=Go.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}const i4=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,o,s,l)=>{var a,c;const u=((c=(a=i.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),n};function cb(e){return Object.prototype.toString.call(e)==="[object RegExp]"}class jf{constructor(t){this.find=t.find,this.handler=t.handler}}const o4=(e,t)=>{if(cb(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function $c(e){var t;const{editor:n,from:r,to:i,text:o,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=i4(c)+o;return s.forEach(f=>{if(u)return;const p=o4(d,f.find);if(!p)return;const h=a.state.tr,m=$f({state:a.state,transaction:h}),y={from:r-(p[0].length-o.length),to:i},{commands:g,chain:b,can:E}=new Uf({editor:n,state:m});f.handler({state:m,range:y,match:p,commands:g,chain:b,can:E})===null||!h.steps.length||(h.setMeta(l,{transform:h,from:r,to:i,text:o}),a.dispatch(h),u=!0)}),u}function s4(e){const{editor:t,rules:n}=e,r=new Je({state:{init(){return null},apply(i,o,s){const l=i.getMeta(r);if(l)return l;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=ab(U.from(u),s.schema);const{from:d}=a,f=d+u.length;$c({editor:t,from:d,to:f,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return $c({editor:t,from:o,to:s,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&$c({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?$c({editor:t,from:s.pos,to:s.pos,text:` `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function l4(e){return Object.prototype.toString.call(e).slice(8,-1)}function Uc(e){return l4(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Vf(e,t){const n={...e};return Uc(e)&&Uc(t)&&Object.keys(t).forEach(r=>{Uc(t[r])&&Uc(e[r])?n[r]=Vf(e[r],t[r]):n[r]=t[r]}),n}class Cr{constructor(t={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ye(ee(this,"addOptions",{name:this.name}))),this.storage=ye(ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new Cr(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Vf(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new Cr(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ye(ee(n,"addOptions",{name:n.name})),n.storage=ye(ee(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const a=s.find(c=>(c==null?void 0:c.type.name)===n.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}}function a4(e){return typeof e=="number"}class c4{constructor(t){this.find=t.find,this.handler=t.handler}}const u4=(e,t,n)=>{if(cb(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=e,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function d4(e){const{editor:t,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:c,can:u}=new Uf({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(r,h),y=Math.min(i,h+p.content.size),g=p.textBetween(m-h,y-h,void 0,"");u4(g,o.find,s).forEach(E=>{if(E.index===void 0)return;const v=m+E.index+1,S=v+E[0].length,x={from:n.tr.mapping.map(v),to:n.tr.mapping.map(S)},_=o.handler({state:n,range:x,match:E,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});d.push(_)})}),d.every(p=>p!==null)}let Hc=null;const f4=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function p4(e){const{editor:t,rules:n}=e;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:u,from:d,to:f,rule:p,pasteEvt:h})=>{const m=u.tr,y=$f({state:u,transaction:m});if(!(!d4({editor:t,state:y,from:Math.max(d-1,0),to:f.b-1,rule:p,pasteEvent:h,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return n.map(u=>new Je({view(d){const f=h=>{var m;r=!((m=d.dom.parentElement)===null||m===void 0)&&m.contains(h.target)?d.dom.parentElement:null,r&&(Hc=t)},p=()=>{Hc&&(Hc=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",p),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",p)}}},props:{handleDOMEvents:{drop:(d,f)=>{if(o=r===d.dom.parentElement,l=f,!o){const p=Hc;p&&setTimeout(()=>{const h=p.state.selection;h&&p.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(d,f)=>{var p;const h=(p=f.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=f,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(d,f,p)=>{const h=d[0],m=h.getMeta("uiEvent")==="paste"&&!i,y=h.getMeta("uiEvent")==="drop"&&!o,g=h.getMeta("applyPasteRules"),b=!!g;if(!m&&!y&&!b)return;if(b){let{text:S}=g;typeof S=="string"?S=S:S=ab(U.from(S),p.schema);const{from:x}=g,_=x+S.length,R=f4(S);return a({rule:u,state:p,from:x,to:{b:_},pasteEvt:R})}const E=f.doc.content.findDiffStart(p.doc.content),v=f.doc.content.findDiffEnd(p.doc.content);if(!(!a4(E)||!v||E===v.b))return a({rule:u,state:p,from:E,to:v,pasteEvt:s})}}))}function h4(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}class ks{constructor(t,n){this.splittableMarks=[],this.editor=n,this.extensions=ks.resolve(t),this.schema=r4(this.extensions,n),this.setupExtensions()}static resolve(t){const n=ks.sort(ks.flatten(t)),r=h4(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(t){return t.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=ee(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(t){return t.sort((r,i)=>{const o=ee(r,"priority")||100,s=ee(i,"priority")||100;return o>s?-1:o{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:ch(n.name,this.schema)},i=ee(n,"addCommands",r);return i?{...t,...i()}:t},{})}get plugins(){const{editor:t}=this,n=ks.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:t,type:ch(s.name,this.schema)},a=[],c=ee(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&ee(s,"exitable",l)&&(u.ArrowRight=()=>Cr.handleExit({editor:t,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([y,g])=>[y,()=>g({editor:t})]));u={...u,...m}}const d=T3(u);a.push(d);const f=ee(s,"addInputRules",l);pv(s,t.options.enableInputRules)&&f&&r.push(...f());const p=ee(s,"addPasteRules",l);pv(s,t.options.enablePasteRules)&&p&&i.push(...p());const h=ee(s,"addProseMirrorPlugins",l);if(h){const m=h();a.push(...m)}return a}).flat();return[s4({editor:t,rules:r}),...p4({editor:t,rules:i}),...o]}get attributes(){return bT(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:n}=Hf(this.extensions);return Object.fromEntries(n.filter(r=>!!ee(r,"addNodeView")).map(r=>{const i=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:t,type:pt(r.name,this.schema)},s=ee(r,"addNodeView",o);if(!s)return[];const l=(a,c,u,d,f)=>{const p=rg(a,i);return s()({node:a,view:c,getPos:u,decorations:d,innerDecorations:f,editor:t,extension:r,HTMLAttributes:p})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(t=>{var n;this.editor.extensionStorage[t.name]=t.storage;const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:ch(t.name,this.schema)};t.type==="mark"&&(!((n=ye(ee(t,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(t.name);const i=ee(t,"onBeforeCreate",r),o=ee(t,"onCreate",r),s=ee(t,"onUpdate",r),l=ee(t,"onSelectionUpdate",r),a=ee(t,"onTransaction",r),c=ee(t,"onFocus",r),u=ee(t,"onBlur",r),d=ee(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class It{constructor(t={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ye(ee(this,"addOptions",{name:this.name}))),this.storage=ye(ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new It(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Vf(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new It({...this.config,...t});return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ye(ee(n,"addOptions",{name:n.name})),n.storage=ye(ee(n,"addStorage",{name:n.name,options:n.options})),n}}function wT(e,t,n){const{from:r,to:i}=t,{blockSeparator:o=` `,textSerializers:s={}}=n||{};let l="";return e.nodesBetween(r,i,(a,c,u,d)=>{var f;a.isBlock&&c>r&&(l+=o);const p=s==null?void 0:s[a.type.name];if(p)return u&&(l+=p({node:a,pos:c,parent:u,index:d,range:t})),!1;a.isText&&(l+=(f=a==null?void 0:a.text)===null||f===void 0?void 0:f.slice(Math.max(r,c)-c,i-c))}),l}function vT(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const m4=It.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Je({key:new ht("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),a=vT(n);return wT(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),g4=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),y4=(e=!1)=>({commands:t})=>t.setContent("",e),b4=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=t,d=c.resolve(u.map(a)),f=c.resolve(u.map(a+l.nodeSize)),p=d.blockRange(f);if(!p)return;const h=bl(p);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());t.setNodeMarkup(p.start,m)}(h||h===0)&&t.lift(p,h)})}),!0},E4=e=>t=>e(t),w4=()=>({state:e,dispatch:t})=>$3(e,t),v4=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new ie(r.doc.resolve(s-1))),!0},x4=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const l=i.before(o),a=i.after(o);e.delete(l,a).scrollIntoView()}return!0}return!1},S4=e=>({tr:t,state:n,dispatch:r})=>{const i=pt(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const a=o.before(s),c=o.after(s);t.delete(a,c).scrollIntoView()}return!0}return!1},k4=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},C4=()=>({state:e,dispatch:t})=>N3(e,t),_4=()=>({commands:e})=>e.keyboardShortcut("Enter"),T4=()=>({state:e,dispatch:t})=>z3(e,t);function wd(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:cb(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function xT(e,t,n={}){return e.find(r=>r.type===t&&wd(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function hv(e,t,n={}){return!!xT(e,t,n)}function ub(e,t,n){var r;if(!e||!t)return;let i=e.parent.childAfter(e.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===t))&&(i=e.parent.childBefore(e.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===t)||(n=n||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!xT([...i.node.marks],t,n)))return;let s=i.index,l=e.start()+i.offset,a=s+1,c=l+i.node.nodeSize;for(;s>0&&hv([...e.parent.child(s-1).marks],t,n);)s-=1,l-=e.parent.child(s).nodeSize;for(;a({tr:n,state:r,dispatch:i})=>{const o=Zi(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:u}=l;if(i){const d=ub(a,o,t);if(d&&d.from<=c&&d.to>=u){const f=ie.create(s,d.from,d.to);n.setSelection(f)}}return!0},O4=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r({editor:n,view:r,tr:i,dispatch:o})=>{t={scrollIntoView:!0,...t};const s=()=>{r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&e===null||e===!1)return!0;if(o&&e===null&&!ST(n.state.selection))return s(),!0;const l=kT(i.doc,e)||n.state.selection,a=n.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},A4=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),R4=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),CT=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&CT(r)}return e};function jc(e){const t=`${e}`,n=new window.DOMParser().parseFromString(t,"text/html").body;return CT(n)}function vd(e,t,n){if(e instanceof zi||e instanceof U)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return U.fromArray(e.map(l=>t.nodeFromJSON(l)));const s=t.nodeFromJSON(e);return n.errorOnInvalidContent&&s.check(),s}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),vd("",t,n)}if(i){if(n.errorOnInvalidContent){let s=!1,l="";const a=new p_({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?$i.fromSchema(a).parseSlice(jc(e),n.parseOptions):$i.fromSchema(a).parse(jc(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const o=$i.fromSchema(t);return n.slice?o.parseSlice(jc(e),n.parseOptions).content:o.parse(jc(e),n.parseOptions)}return vd("",t,n)}function I4(e,t,n){const r=e.steps.length-1;if(r{s===0&&(s=u)}),e.setSelection(se.near(e.doc.resolve(s),n))}const D4=e=>!("type"in e),P4=(e,t,n)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=vd(t,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:o.options.enableContentCheck})}catch(h){return o.emit("contentError",{editor:o,error:h,disableCollaboration:()=>{o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:a,to:c}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((D4(l)?l:[l]).forEach(h=>{h.check(),u=u?h.isText&&h.marks.length===0:!1,d=d?h.isBlock:!1}),a===c&&d){const{parent:h}=r.doc.resolve(a);h.isTextblock&&!h.type.spec.code&&!h.childCount&&(a-=1,c+=1)}let p;if(u){if(Array.isArray(t))p=t.map(h=>h.text||"").join("");else if(t instanceof U){let h="";t.forEach(m=>{m.text&&(h+=m.text)}),p=h}else typeof t=="object"&&t&&t.text?p=t.text:p=t;r.insertText(p,a,c)}else p=l,r.replaceWith(a,c,p);n.updateSelection&&I4(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:p}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:p})}return!0},L4=()=>({state:e,dispatch:t})=>P3(e,t),B4=()=>({state:e,dispatch:t})=>L3(e,t),F4=()=>({state:e,dispatch:t})=>O3(e,t),z4=()=>({state:e,dispatch:t})=>I3(e,t),$4=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Df(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},U4=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Df(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},H4=()=>({state:e,dispatch:t})=>M3(e,t),j4=()=>({state:e,dispatch:t})=>A3(e,t);function _T(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function TT(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function V4(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let l=0;l({editor:t,view:n,tr:r,dispatch:i})=>{const o=V4(e).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function Ha(e,t,n={}){const{from:r,to:i,empty:o}=e.selection,s=t?pt(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(d,f)=>{if(d.isText)return;const p=Math.max(r,f),h=Math.min(i,f+d.nodeSize);l.push({node:d,from:p,to:h})});const a=i-r,c=l.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>wd(d.node.attrs,n,{strict:!1}));return o?!!c.length:c.reduce((d,f)=>d+f.to-f.from,0)>=a}const K4=(e,t={})=>({state:n,dispatch:r})=>{const i=pt(e,n.schema);return Ha(n,i,t)?B3(n,r):!1},q4=()=>({state:e,dispatch:t})=>U3(e,t),G4=e=>({state:t,dispatch:n})=>{const r=pt(e,t.schema);return Q3(r)(t,n)},Y4=()=>({state:e,dispatch:t})=>F3(e,t);function Wf(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function mv(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}const Q4=(e,t)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Wf(typeof e=="string"?e:e.name,r.schema);return l?(l==="node"&&(o=pt(e,r.schema)),l==="mark"&&(s=Zi(e,r.schema)),i&&n.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{o&&o===c.type&&n.setNodeMarkup(u,void 0,mv(c.attrs,t)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(mv(d.attrs,t)))})})}),!0):!1},X4=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),J4=()=>({tr:e,dispatch:t})=>{if(t){const n=new Bn(e.doc);e.setSelection(n)}return!0},Z4=()=>({state:e,dispatch:t})=>R3(e,t),eH=()=>({state:e,dispatch:t})=>D3(e,t),tH=()=>({state:e,dispatch:t})=>H3(e,t),nH=()=>({state:e,dispatch:t})=>W3(e,t),rH=()=>({state:e,dispatch:t})=>V3(e,t);function ig(e,t,n={},r={}){return vd(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const iH=(e,t=!1,n={},r={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{var a,c;const{doc:u}=o;if(n.preserveWhitespace!=="full"){const d=ig(e,i.schema,n,{errorOnInvalidContent:(a=r.errorOnInvalidContent)!==null&&a!==void 0?a:i.options.enableContentCheck});return s&&o.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:u.content.size},e,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck})};function NT(e,t){const n=Zi(t,e.schema),{from:r,to:i,empty:o}=e.selection,s=[];o?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,a=>{s.push(...a.marks)});const l=s.find(a=>a.type.name===n.name);return l?{...l.attrs}:{}}function oH(e,t){const n=new Yy(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function sH(e){for(let t=0;t{t(r)&&n.push({node:r,pos:i})}),n}function lH(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,o)=>{n(i)&&r.push({node:i,pos:o})}),r}function OT(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function db(e){return t=>OT(t.$from,e)}function aH(e,t){const n={from:0,to:e.content.size};return wT(e,n,t)}function cH(e,t){const n=pt(t,e.schema),{from:r,to:i}=e.selection,o=[];e.doc.nodesBetween(r,i,l=>{o.push(l)});const s=o.reverse().find(l=>l.type.name===n.name);return s?{...s.attrs}:{}}function MT(e,t){const n=Wf(typeof t=="string"?t:t.name,e.schema);return n==="node"?cH(e,t):n==="mark"?NT(e,t):{}}function uH(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function dH(e){const t=uH(e);return t.length===1?t:t.filter((n,r)=>!t.filter((o,s)=>s!==r).some(o=>n.oldRange.from>=o.oldRange.from&&n.oldRange.to<=o.oldRange.to&&n.newRange.from>=o.newRange.from&&n.newRange.to<=o.newRange.to))}function fH(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,o)=>{const s=[];if(i.ranges.length)i.forEach((l,a)=>{s.push({from:l,to:a})});else{const{from:l,to:a}=n[o];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{const c=t.slice(o).map(l,-1),u=t.slice(o).map(a),d=t.invert().map(c,-1),f=t.invert().map(u);r.push({oldRange:{from:d,to:f},newRange:{from:c,to:u}})})}),dH(r)}function fb(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const o=n.resolve(e),s=ub(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(e,t,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function _u(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(o=>o.type===t&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function sg(e,t,n={}){const{empty:r,ranges:i}=e.selection,o=t?Zi(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(d=>o?o.name===d.type.name:!0).find(d=>wd(d.attrs,n,{strict:!1}));let s=0;const l=[];if(i.forEach(({$from:d,$to:f})=>{const p=d.pos,h=f.pos;e.doc.nodesBetween(p,h,(m,y)=>{if(!m.isText&&!m.marks.length)return;const g=Math.max(p,y),b=Math.min(h,y+m.nodeSize),E=b-g;s+=E,l.push(...m.marks.map(v=>({mark:v,from:g,to:b})))})}),s===0)return!1;const a=l.filter(d=>o?o.name===d.mark.type.name:!0).filter(d=>wd(d.mark.attrs,n,{strict:!1})).reduce((d,f)=>d+f.to-f.from,0),c=l.filter(d=>o?d.mark.type!==o&&d.mark.type.excludes(o):!0).reduce((d,f)=>d+f.to-f.from,0);return(a>0?a+c:a)>=s}function pH(e,t,n={}){if(!t)return Ha(e,null,n)||sg(e,null,n);const r=Wf(t,e.schema);return r==="node"?Ha(e,t,n):r==="mark"?sg(e,t,n):!1}function gv(e,t){const{nodeExtensions:n}=Hf(t),r=n.find(s=>s.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ye(ee(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Kf(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return/^\s*$/m.test((r=e.text)!==null&&r!==void 0?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(o=>{i!==!1&&(Kf(o,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function hH(e){return e instanceof re}function mH(e,t,n){var r;const{selection:i}=t;let o=null;if(ST(i)&&(o=i.$cursor),o){const l=(r=e.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(l)||!l.some(a=>a.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:l,$to:a})=>{let c=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,a.pos,(u,d,f)=>{if(c)return!1;if(u.isInline){const p=!f||f.type.allowsMarkType(n),h=!!n.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(n));c=p&&h}return!c}),c})}const gH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:l}=o,a=Zi(e,r.schema);if(i)if(s){const c=NT(r,a);n.addStoredMark(a.create({...c,...t}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(f,p)=>{const h=Math.max(p,u),m=Math.min(p+f.nodeSize,d);f.marks.find(g=>g.type===a)?f.marks.forEach(g=>{a===g.type&&n.addMark(h,m,a.create({...g.attrs,...t}))}):n.addMark(h,m,a.create(t))})});return mH(r,n,a)},yH=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),bH=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const o=pt(e,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>uv(o,{...s,...t})(n)?!0:l.clearNodes()).command(({state:l})=>uv(o,{...s,...t})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},EH=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=mo(e,0,r.content.size),o=re.create(r,i);t.setSelection(o)}return!0},wH=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:o}=typeof e=="number"?{from:e,to:e}:e,s=ie.atStart(r).from,l=ie.atEnd(r).to,a=mo(i,s,l),c=mo(o,s,l),u=ie.create(r,a,c);t.setSelection(u)}return!0},vH=e=>({state:t,dispatch:n})=>{const r=pt(e,t.schema);return Z3(r)(t,n)};function yv(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}const xH=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=t,{$from:l,$to:a}=o,c=i.extensionManager.attributes,u=_u(c,l.node().type.name,l.node().attrs);if(o instanceof re&&o.node.isBlock)return!l.parentOffset||!Ps(s,l.pos)?!1:(r&&(e&&yv(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,f=l.depth===0?void 0:sH(l.node(-1).contentMatchAt(l.indexAfter(-1)));let p=d&&f?[{type:f,attrs:u}]:void 0,h=Ps(t.doc,t.mapping.map(l.pos),1,p);if(!p&&!h&&Ps(t.doc,t.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(h=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(h&&(o instanceof ie&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,p),f&&!d&&!l.parentOffset&&l.parent.type!==f)){const m=t.mapping.map(l.before()),y=t.doc.resolve(m);l.node(-1).canReplaceWith(y.index(),y.index()+1,f)&&t.setNodeMarkup(t.mapping.map(l.before()),f)}e&&yv(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return h},SH=(e,t={})=>({tr:n,state:r,dispatch:i,editor:o})=>{var s;const l=pt(e,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let g=U.empty;const b=a.index(-1)?1:a.index(-2)?2:3;for(let R=a.depth-b;R>=a.depth-3;R-=1)g=U.from(a.node(R).copy(g));const E=a.indexAfter(-1){if(_>-1)return!1;R.isTextblock&&R.content.size===0&&(_=I+1)}),_>-1&&n.setSelection(ie.near(n.doc.resolve(_))),n.scrollIntoView()}return!0}const p=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,h={..._u(f,d.type.name,d.attrs),...t},m={..._u(f,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,c.pos);const y=p?[{type:l,attrs:h},{type:p,attrs:m}]:[{type:l,attrs:h}];if(!Ps(n.doc,a.pos,2))return!1;if(i){const{selection:g,storedMarks:b}=r,{splittableMarks:E}=o.extensionManager,v=b||g.$to.parentOffset&&g.$from.marks();if(n.split(a.pos,2,y).scrollIntoView(),!v||!i)return!0;const S=v.filter(x=>E.includes(x.type.name));n.ensureMarks(S)}return!0},uh=(e,t)=>{const n=db(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Xi(e.doc,n.pos)&&e.join(n.pos),!0},dh=(e,t)=>{const n=db(s=>s.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Xi(e.doc,r)&&e.join(r),!0},kH=(e,t,n,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:f}=i.extensionManager,p=pt(e,s.schema),h=pt(t,s.schema),{selection:m,storedMarks:y}=s,{$from:g,$to:b}=m,E=g.blockRange(b),v=y||m.$to.parentOffset&&m.$from.marks();if(!E)return!1;const S=db(x=>gv(x.type.name,d))(m);if(E.depth>=1&&S&&E.depth-S.depth<=1){if(S.node.type===p)return c.liftListItem(h);if(gv(S.node.type.name,d)&&p.validContent(S.node.content)&&l)return a().command(()=>(o.setNodeMarkup(S.pos,p),!0)).command(()=>uh(o,p)).command(()=>dh(o,p)).run()}return!n||!v||!l?a().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>uh(o,p)).command(()=>dh(o,p)).run():a().command(()=>{const x=u().wrapInList(p,r),_=v.filter(R=>f.includes(R.type.name));return o.ensureMarks(_),x?!0:c.clearNodes()}).wrapInList(p,r).command(()=>uh(o,p)).command(()=>dh(o,p)).run()},CH=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Zi(e,r.schema);return sg(r,s,t)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,t)},_H=(e,t,n={})=>({state:r,commands:i})=>{const o=pt(e,r.schema),s=pt(t,r.schema),l=Ha(r,o,n);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?i.setNode(s,a):i.setNode(o,{...a,...n})},TH=(e,t={})=>({state:n,commands:r})=>{const i=pt(e,n.schema);return Ha(n,i,t)?r.lift(i):r.wrapIn(i,t)},NH=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(o.text){const a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,e.schema.text(o.text,a))}else s.delete(o.from,o.to)}return!0}}return!1},OH=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(o=>{e.removeMark(o.$from.pos,o.$to.pos)}),!0},MH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=Zi(e,r.schema),{$from:c,empty:u,ranges:d}=l;if(!i)return!0;if(u&&s){let{from:f,to:p}=l;const h=(o=c.marks().find(y=>y.type===a))===null||o===void 0?void 0:o.attrs,m=ub(c,a,h);m&&(f=m.from,p=m.to),n.removeMark(f,p,a)}else d.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},AH=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const l=Wf(typeof e=="string"?e:e.name,r.schema);return l?(l==="node"&&(o=pt(e,r.schema)),l==="mark"&&(s=Zi(e,r.schema)),i&&n.selection.ranges.forEach(a=>{const c=a.$from.pos,u=a.$to.pos;let d,f,p,h;n.selection.empty?r.doc.nodesBetween(c,u,(m,y)=>{o&&o===m.type&&(p=Math.max(y,c),h=Math.min(y+m.nodeSize,u),d=y,f=m)}):r.doc.nodesBetween(c,u,(m,y)=>{y=c&&y<=u&&(o&&o===m.type&&n.setNodeMarkup(y,void 0,{...m.attrs,...t}),s&&m.marks.length&&m.marks.forEach(g=>{if(s===g.type){const b=Math.max(y,c),E=Math.min(y+m.nodeSize,u);n.addMark(b,E,s.create({...g.attrs,...t}))}}))}),f&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...f.attrs,...t}),s&&f.marks.length&&f.marks.forEach(m=>{s===m.type&&n.addMark(p,h,s.create({...m.attrs,...t}))}))}),!0):!1},RH=(e,t={})=>({state:n,dispatch:r})=>{const i=pt(e,n.schema);return K3(i,t)(n,r)},IH=(e,t={})=>({state:n,dispatch:r})=>{const i=pt(e,n.schema);return q3(i,t)(n,r)};var DH=Object.freeze({__proto__:null,blur:g4,clearContent:y4,clearNodes:b4,command:E4,createParagraphNear:w4,cut:v4,deleteCurrentNode:x4,deleteNode:S4,deleteRange:k4,deleteSelection:C4,enter:_4,exitCode:T4,extendMarkRange:N4,first:O4,focus:M4,forEach:A4,insertContent:R4,insertContentAt:P4,joinBackward:F4,joinDown:B4,joinForward:z4,joinItemBackward:$4,joinItemForward:U4,joinTextblockBackward:H4,joinTextblockForward:j4,joinUp:L4,keyboardShortcut:W4,lift:K4,liftEmptyBlock:q4,liftListItem:G4,newlineInCode:Y4,resetAttributes:Q4,scrollIntoView:X4,selectAll:J4,selectNodeBackward:Z4,selectNodeForward:eH,selectParentNode:tH,selectTextblockEnd:nH,selectTextblockStart:rH,setContent:iH,setMark:gH,setMeta:yH,setNode:bH,setNodeSelection:EH,setTextSelection:wH,sinkListItem:vH,splitBlock:xH,splitListItem:SH,toggleList:kH,toggleMark:CH,toggleNode:_H,toggleWrap:TH,undoInputRule:NH,unsetAllMarks:OH,unsetMark:MH,updateAttributes:AH,wrapIn:RH,wrapInList:IH});const PH=It.create({name:"commands",addCommands(){return{...DH}}}),LH=It.create({name:"drop",addProseMirrorPlugins(){return[new Je({key:new ht("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),BH=It.create({name:"editable",addProseMirrorPlugins(){return[new Je({key:new ht("editable"),props:{editable:()=>this.editor.options.editable}})]}}),FH=It.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Je({key:new ht("focusEvents"),props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),zH=It.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:f,parent:p}=d,h=d.parent.isTextblock&&f>0?l.doc.resolve(f-1):d,m=h.parent.type.spec.isolating,y=d.pos-d.parentOffset,g=m&&h.parent.childCount===1?y===d.pos:se.atStart(c).from===f;return!u||!p.type.isTextblock||p.textContent.length||!g||g&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return _T()||TT()?o:i},addProseMirrorPlugins(){return[new Je({key:new ht("clearDocument"),appendTransaction:(e,t,n)=>{const r=e.some(m=>m.docChanged)&&!t.doc.eq(n.doc),i=e.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;const{empty:o,from:s,to:l}=t.selection,a=se.atStart(t.doc).from,c=se.atEnd(t.doc).to;if(o||!(s===a&&l===c)||!Kf(n.doc))return;const f=n.tr,p=$f({state:n,transaction:f}),{commands:h}=new Uf({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),$H=It.create({name:"paste",addProseMirrorPlugins(){return[new Je({key:new ht("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),UH=It.create({name:"tabindex",addProseMirrorPlugins(){return[new Je({key:new ht("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class lo{get name(){return this.node.type.name}constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=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}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}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 t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new lo(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new lo(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new lo(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;const a=new lo(l,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),t.push(new lo(l,this.editor,i,i?n:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let l=0;l{r&&i.length>0||(s.node.type.name===t&&o.every(a=>n[a]===s.node.attrs[a])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}}const HH=`.ProseMirror { position: relative; } .ProseMirror { word-wrap: break-word; white-space: pre-wrap; white-space: break-spaces; -webkit-font-variant-ligatures: none; font-variant-ligatures: none; font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ } .ProseMirror [contenteditable="false"] { white-space: normal; } .ProseMirror [contenteditable="false"] [contenteditable="true"] { white-space: pre-wrap; } .ProseMirror pre { white-space: pre-wrap; } img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 0 !important; height: 0 !important; } .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; margin: 0; } .ProseMirror-gapcursor:after { content: ""; display: block; position: absolute; top: -2px; width: 20px; border-top: 1px solid black; animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; } @keyframes ProseMirror-cursor-blink { to { visibility: hidden; } } .ProseMirror-hideselection *::selection { background: transparent; } .ProseMirror-hideselection *::-moz-selection { background: transparent; } .ProseMirror-hideselection * { caret-color: transparent; } .ProseMirror-focused .ProseMirror-gapcursor { display: block; } .tippy-box[data-animation=fade][data-state=hidden] { opacity: 0 }`;function jH(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}class VH extends e4{constructor(t={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:i})=>this.options.onDrop(n,r,i)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=jH(HH,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,n=!0){this.setOptions({editable:t}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(t,n){const r=ET(n)?n(t,[...this.state.plugins]):[...this.state.plugins,t],i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}unregisterPlugin(t){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(t).forEach(o=>{const s=typeof o=="string"?`${o}$`:o.key;r=n.filter(l=>!l.key.startsWith(s))}),n.length===r.length)return;const i=this.state.reconfigure({plugins:r});return this.view.updateState(i),i}createExtensionManager(){var t,n;const i=[...this.options.enableCoreExtensions?[BH,m4.configure({blockSeparator:(n=(t=this.options.coreExtensionOptions)===null||t===void 0?void 0:t.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),PH,FH,zH,UH,LH,$H].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new ks(i,this)}createCommandManager(){this.commandManager=new Uf({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var t;let n;try{n=ig(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),n=ig(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=kT(n,this.options.autofocus);this.view=new b3(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)===null||t===void 0?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Ss.create({doc:n,selection:r||void 0})});const i=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(i),this.createNodeViews(),this.prependClass();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(s=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(s)});return}const n=this.state.apply(t),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:t,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:t}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const i=t.getMeta("focus"),o=t.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:t}),o&&this.emit("blur",{editor:this,event:o.event,transaction:t}),!(!t.docChanged||t.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:t})}getAttributes(t){return MT(this.state,t)}isActive(t,n){const r=typeof t=="string"?t:null,i=typeof t=="string"?n:t;return pH(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ab(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:n=` `,textSerializers:r={}}=t||{};return aH(this.state.doc,{blockSeparator:n,textSerializers:{...vT(this.schema),...r}})}get isEmpty(){return Kf(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const t=this.view.dom;t&&t.editor&&delete t.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var t;return!(!((t=this.view)===null||t===void 0)&&t.docView)}$node(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(t,n))||null}$nodes(t,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(t,n))||null}$pos(t){const n=this.state.doc.resolve(t);return new lo(n,this)}get $doc(){return this.$pos(0)}}function il(e){return new jf({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ye(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=t,s=r[r.length-1],l=r[0];if(s){const a=l.search(/\S/),c=n.from+l.indexOf(s),u=c+s.length;if(fb(n.from,n.to,t.doc).filter(p=>p.mark.type.excluded.find(m=>m===e.type&&m!==p.mark.type)).filter(p=>p.to>c).length)return null;un.from&&o.delete(n.from+a,c);const f=n.from+a+s.length;o.addMark(n.from+a,f,e.type.create(i||{})),o.removeStoredMark(e.type)}}})}function AT(e){return new jf({find:e.find,handler:({state:t,range:n,match:r})=>{const i=ye(e.getAttributes,void 0,r)||{},{tr:o}=t,s=n.from;let l=n.to;const a=e.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];o.insertText(d,s+r[0].length-1),o.replaceWith(u,l,a)}else if(r[0]){const c=e.type.isInline?s:s-1;o.insert(c,e.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function lg(e){return new jf({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),o=ye(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)}})}function ja(e){return new jf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const o=ye(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),c=a&&Gy(a,e.type,o);if(!c)return null;if(s.wrap(a,c),e.keepMarks&&e.editor){const{selection:d,storedMarks:f}=t,{splittableMarks:p}=e.editor.extensionManager,h=f||d.$to.parentOffset&&d.$from.marks();if(h){const m=h.filter(y=>p.includes(y.type.name));s.ensureMarks(m)}}if(e.keepAttributes){const d=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===e.type&&Xi(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,u))&&s.join(n.from-1)}})}class ot{constructor(t={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...t},this.name=this.config.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ye(ee(this,"addOptions",{name:this.name}))),this.storage=ye(ee(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(t={}){return new ot(t)}configure(t={}){const n=this.extend({...this.config,addOptions:()=>Vf(this.options,t)});return n.name=this.name,n.parent=this.parent,n}extend(t={}){const n=new ot(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&Object.keys(t.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ye(ee(n,"addOptions",{name:n.name})),n.storage=ye(ee(n,"addStorage",{name:n.name,options:n.options})),n}}function Uo(e){return new c4({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const o=ye(e.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=t,l=r[r.length-1],a=r[0];let c=n.to;if(l){const u=a.search(/\S/),d=n.from+a.indexOf(l),f=d+l.length;if(fb(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(y=>y===e.type&&y!==h.mark.type)).filter(h=>h.to>d).length)return null;fn.from&&s.delete(n.from+u,d),c=n.from+u+l.length,s.addMark(n.from+u,c,e.type.create(o||{})),s.removeStoredMark(e.type)}}})}function WH(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var RT={exports:{}},fh={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var bv;function KH(){if(bv)return fh;bv=1;var e=Ke;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function l(d,f){var p=f(),h=r({inst:{value:p,getSnapshot:f}}),m=h[0].inst,y=h[1];return o(function(){m.value=p,m.getSnapshot=f,a(m)&&y({inst:m})},[d,p,f]),i(function(){return a(m)&&y({inst:m}),d(function(){a(m)&&y({inst:m})})},[d]),s(p),p}function a(d){var f=d.getSnapshot;d=d.value;try{var p=f();return!n(d,p)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:l;return fh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,fh}RT.exports=KH();var pb=RT.exports;const qH=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},GH=({contentComponent:e})=>{const t=pb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return Ke.createElement(Ke.Fragment,null,Object.values(t))};function YH(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:P1.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}class QH extends Ke.Component{constructor(t){var n;super(t),this.editorContentRef=Ke.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=t.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const t=this.props.editor;if(t&&!t.isDestroyed&&t.options.element){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.options.element.childNodes),t.setOptions({element:n}),t.contentComponent=YH(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=t.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),t.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!t.options.element.firstChild))return;const n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){const{editor:t,innerRef:n,...r}=this.props;return Ke.createElement(Ke.Fragment,null,Ke.createElement("div",{ref:qH(n,this.editorContentRef),...r}),(t==null?void 0:t.contentComponent)&&Ke.createElement(GH,{contentComponent:t.contentComponent}))}}const XH=A.forwardRef((e,t)=>{const n=Ke.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return Ke.createElement(QH,{key:n,innerRef:t,...e})}),JH=Ke.memo(XH);var ZH=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],n.get(i[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i of t.entries())if(!n.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(t[i]!==n[i])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var s=o[i];if(!(s==="_owner"&&t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n},ej=WH(ZH),IT={exports:{}},ph={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ev;function tj(){if(Ev)return ph;Ev=1;var e=Ke,t=pb;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,l=e.useMemo,a=e.useDebugValue;return ph.useSyncExternalStoreWithSelector=function(c,u,d,f,p){var h=o(null);if(h.current===null){var m={hasValue:!1,value:null};h.current=m}else m=h.current;h=l(function(){function g(x){if(!b){if(b=!0,E=x,x=f(x),p!==void 0&&m.hasValue){var _=m.value;if(p(_,x))return v=_}return v=x}if(_=v,r(E,x))return _;var R=f(x);return p!==void 0&&p(_,R)?_:(E=x,v=R)}var b=!1,E,v,S=d===void 0?null:d;return[function(){return g(u())},S===null?void 0:function(){return g(S())}]},[u,d,f,p]);var y=i(c,h[0],h[1]);return s(function(){m.hasValue=!0,m.value=y},[y]),a(y),y},ph}IT.exports=tj();var nj=IT.exports;const rj=typeof window<"u"?A.useLayoutEffect:A.useEffect;class ij{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,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(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(i=>i())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function oj(e){var t;const[n]=A.useState(()=>new ij(e.editor)),r=nj.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!==null&&t!==void 0?t:ej);return rj(()=>n.watch(e.editor),[e.editor,n]),A.useDebugValue(r),r}const sj=!1,ag=typeof window>"u",lj=ag||!!(typeof window<"u"&&window.next);class aj{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,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(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return ag||lj?null:this.createEditor();if(this.options.current.immediatelyRender&&ag&&sj)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onBeforeCreate)===null||o===void 0?void 0:o.call(i,...r)},onBlur:(...r)=>{var i,o;return(o=(i=this.options.current).onBlur)===null||o===void 0?void 0:o.call(i,...r)},onCreate:(...r)=>{var i,o;return(o=(i=this.options.current).onCreate)===null||o===void 0?void 0:o.call(i,...r)},onDestroy:(...r)=>{var i,o;return(o=(i=this.options.current).onDestroy)===null||o===void 0?void 0:o.call(i,...r)},onFocus:(...r)=>{var i,o;return(o=(i=this.options.current).onFocus)===null||o===void 0?void 0:o.call(i,...r)},onSelectionUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onSelectionUpdate)===null||o===void 0?void 0:o.call(i,...r)},onTransaction:(...r)=>{var i,o;return(o=(i=this.options.current).onTransaction)===null||o===void 0?void 0:o.call(i,...r)},onUpdate:(...r)=>{var i,o;return(o=(i=this.options.current).onUpdate)===null||o===void 0?void 0:o.call(i,...r)},onContentError:(...r)=>{var i,o;return(o=(i=this.options.current).onContentError)===null||o===void 0?void 0:o.call(i,...r)},onDrop:(...r)=>{var i,o;return(o=(i=this.options.current).onDrop)===null||o===void 0?void 0:o.call(i,...r)},onPaste:(...r)=>{var i,o;return(o=(i=this.options.current).onPaste)===null||o===void 0?void 0:o.call(i,...r)}};return new VH(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}}function cj(e={},t=[]){const n=A.useRef(e);n.current=e;const[r]=A.useState(()=>new aj(n)),i=pb.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return A.useDebugValue(i),A.useEffect(r.onRender(t)),oj({editor:i,selector:({transactionNumber:o})=>e.shouldRerenderOnTransaction===!1?null:e.immediatelyRender&&o===0?0:o+1}),i}const uj=A.createContext({editor:null});uj.Consumer;const dj=A.createContext({onDragStart:void 0}),fj=()=>A.useContext(dj);Ke.forwardRef((e,t)=>{const{onDragStart:n}=fj(),r=e.as||"div";return Ke.createElement(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});const pj=/^\s*>\s$/,hj=ot.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return["blockquote",He(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ja({find:pj,type:this.type})]}}),mj=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,gj=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,yj=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,bj=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Ej=Cr.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",He(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[il({find:mj,type:this.type}),il({find:yj,type:this.type})]},addPasteRules(){return[Uo({find:gj,type:this.type}),Uo({find:bj,type:this.type})]}}),wj="listItem",wv="textStyle",vv=/^\s*([-+*])\s$/,vj=ot.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:e}){return["ul",He(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wj,this.editor.getAttributes(wv)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ja({find:vv,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ja({find:vv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(wv),editor:this.editor})),[e]}}),xj=/(^|[^`])`([^`]+)`(?!`)/,Sj=/(^|[^`])`([^`]+)`(?!`)/g,kj=Cr.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",He(this.options.HTMLAttributes,e),0]},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[il({find:xj,type:this.type})]},addPasteRules(){return[Uo({find:Sj,type:this.type})]}}),Cj=/^```([a-z]+)?[\s\n]$/,_j=/^~~~([a-z]+)?[\s\n]$/,DT=ot.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",He(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` `);return!o||!s?!1:e.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?e.commands.command(({tr:c})=>(c.setSelection(se.near(r.resolve(l))),!0)):e.commands.exitCode()}}},addInputRules(){return[lg({find:Cj,type:this.type,getAttributes:e=>({language:e[1]})}),lg({find:_j,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Je({key:new ht("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,` `));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(ie.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),Tj=ot.create({name:"doc",topNode:!0,content:"block+"});function Nj(e={}){return new Je({view(t){return new Oj(t,e)}})}class Oj{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r;if(n){let l=t.nodeBefore,a=t.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=l?u.bottom:u.top;l&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=k_(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}const Mj=It.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Nj(this.options)]}});class qe extends se{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return qe.valid(r)?new qe(r):se.near(r)}content(){return Q.empty}eq(t){return t instanceof qe&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new qe(t.resolve(n.pos))}getBookmark(){return new hb(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!Aj(t)||!Rj(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&qe.valid(t))return t;let i=t.pos,o=null;for(let s=t.depth;;s--){let l=t.node(s);if(n>0?t.indexAfter(s)0){o=l.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;i+=n;let a=t.doc.resolve(i);if(qe.valid(a))return a}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!re.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let l=t.doc.resolve(i);if(qe.valid(l))return l}return null}}}qe.prototype.visible=!1;qe.findFrom=qe.findGapCursorFrom;se.jsonID("gapcursor",qe);class hb{constructor(t){this.pos=t}map(t){return new hb(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return qe.valid(n)?new qe(n):se.near(n)}}function Aj(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Rj(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Ij(){return new Je({props:{decorations:Bj,createSelectionBetween(e,t,n){return t.pos==n.pos&&qe.valid(n)?new qe(n):null},handleClick:Pj,handleKeyDown:Dj,handleDOMEvents:{beforeinput:Lj}}})}const Dj=ob({ArrowLeft:Vc("horiz",-1),ArrowRight:Vc("horiz",1),ArrowUp:Vc("vert",-1),ArrowDown:Vc("vert",1)});function Vc(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,o){let s=r.selection,l=t>0?s.$to:s.$from,a=s.empty;if(s instanceof ie){if(!o.endOfTextblock(n)||l.depth==0)return!1;a=!1,l=r.doc.resolve(t>0?l.after():l.before())}let c=qe.findGapCursorFrom(l,t,a);return c?(i&&i(r.tr.setSelection(new qe(c))),!0):!1}}function Pj(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!qe.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&re.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new qe(r))),!0)}function Lj(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof qe))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=U.empty;for(let s=r.length-1;s>=0;s--)i=U.from(r[s].createAndFill(null,i));let o=e.state.tr.replace(n.pos,n.pos,new Q(i,0,0));return o.setSelection(ie.near(o.doc.resolve(n.pos+1))),e.dispatch(o),!1}function Bj(e){if(!(e.selection instanceof qe))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Le.create(e.doc,[wt.widget(e.selection.head,t,{key:"gapcursor"})])}const Fj=It.create({name:"gapCursor",addProseMirrorPlugins(){return[Ij()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=ye(ee(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),zj=ot.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",He(this.options.HTMLAttributes,e)]},renderText(){return` `},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&s){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),PT=ot.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(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,He(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>lg({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var xd=200,ft=function(){};ft.prototype.append=function(t){return t.length?(t=ft.from(t),!this.length&&t||t.length=n?ft.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};ft.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ft.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};ft.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};ft.from=function(t){return t instanceof ft?t:t&&t.length?new LT(t):ft.empty};var LT=function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=xd)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=xd)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(ft);ft.empty=new LT([]);var $j=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t}(ft);const Uj=500;class Xn{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=t.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new dr(d.map));let p=d.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new dr(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(o)):d.selection,a=new Xn(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(t,n,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;ujj&&(l=Hj(l,c),s-=c),new Xn(l.append(o),s)}remapping(t,n){let r=new Ds;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},t,n),r}addMaps(t){return this.eventCount==0?this:new Xn(this.items.append(t.map(n=>new dr(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=t.mapping,s=t.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=n;this.items.forEach(f=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=t.steps[p].invert(t.docs[p]),y=f.selection&&f.selection.map(o.slice(a+1,p));y&&l++,r.push(new dr(h,m,y))}else r.push(new dr(h))},i);let c=[];for(let f=n;fUj&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=t)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(n.slice(r)),c=a&&a.getMap();if(r--,c&&n.appendMap(c,r),a){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let d=new dr(c.invert(),a,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new Xn(ft.from(i.reverse()),o)}}Xn.empty=new Xn(ft.empty,0);function Hj(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class dr{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new dr(n.getMap().invert(),n,this.selection)}}}class fi{constructor(t,n,r,i,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const jj=20;function Vj(e,t,n,r){let i=n.getMeta(No),o;if(i)return i.historyState;n.getMeta(qj)&&(e=new fi(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(No))return s.getMeta(No).redo?new fi(e.done.addTransform(n,void 0,r,Tu(t)),e.undone,xv(n.mapping.maps),e.prevTime,e.prevComposition):new fi(e.done,e.undone.addTransform(n,void 0,r,Tu(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),a=e.prevTime==0||!s&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Wj(n,e.prevRanges)),c=s?hh(e.prevRanges,n.mapping):xv(n.mapping.maps);return new fi(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,Tu(t)),Xn.empty,c,n.time,l??e.prevComposition)}else return(o=n.getMeta("rebased"))?new fi(e.done.rebased(n,o),e.undone.rebased(n,o),hh(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new fi(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),hh(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Wj(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=t[o]&&(n=!0)}),n}function xv(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,o,s)=>t.push(o,s));return t}function hh(e,t){if(!e)return null;let n=[];for(let r=0;r{let i=No.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let o=Kj(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const FT=BT(!1,!0),zT=BT(!0,!0),Yj=It.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>FT(e,t),redo:()=>({state:e,dispatch:t})=>zT(e,t)}},addProseMirrorPlugins(){return[Gj(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()}}}),Qj=ot.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",He(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{const{selection:n}=t,{$from:r,$to:i}=n,o=e();return r.parentOffset===0?o.insertContentAt({from:Math.max(r.pos-1,0),to:i.pos},{type:this.name}):hH(n)?o.insertContentAt(i.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:s,dispatch:l})=>{var a;if(l){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(ie.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(re.create(s.doc,c.pos)):s.setSelection(ie.create(s.doc,c.pos));else{const d=(a=c.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(s.insert(u,d),s.setSelection(ie.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[AT({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Xj=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Jj=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Zj=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,e5=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,t5=Cr.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",He(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[il({find:Xj,type:this.type}),il({find:Zj,type:this.type})]},addPasteRules(){return[Uo({find:Jj,type:this.type}),Uo({find:e5,type:this.type})]}}),n5=ot.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",He(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),r5="listItem",kv="textStyle",Cv=/^(\d+)\.\s$/,i5=ot.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:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",He(this.options.HTMLAttributes,n),0]:["ol",He(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(r5,this.editor.getAttributes(kv)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ja({find:Cv,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ja({find:Cv,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(kv)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),o5=ot.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",He(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),s5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,l5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,a5=Cr.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",He(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[il({find:s5,type:this.type})]},addPasteRules(){return[Uo({find:l5,type:this.type})]}}),c5=ot.create({name:"text",group:"inline"}),u5=It.create({name:"starterKit",addExtensions(){var e,t,n,r,i,o,s,l,a,c,u,d,f,p,h,m,y,g;const b=[];return this.options.bold!==!1&&b.push(Ej.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.blockquote!==!1&&b.push(hj.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bulletList!==!1&&b.push(vj.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&b.push(kj.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&b.push(DT.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&b.push(Tj.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&b.push(Mj.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&b.push(Fj.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&b.push(zj.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&b.push(PT.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&b.push(Yj.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&b.push(Qj.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&b.push(t5.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&b.push(n5.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&b.push(i5.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&b.push(o5.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&b.push(a5.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&b.push(c5.configure((g=this.options)===null||g===void 0?void 0:g.text)),b}}),d5=Cr.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",He(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),f5="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",p5="ελ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",ol=(e,t)=>{for(const n in t)e[n]=t[n];return e},cg="numeric",ug="ascii",dg="alpha",aa="asciinumeric",Wl="alphanumeric",fg="domain",$T="emoji",h5="scheme",m5="slashscheme",gh="whitespace";function g5(e,t){return e in t||(t[e]=[]),t[e]}function go(e,t,n){t[cg]&&(t[aa]=!0,t[Wl]=!0),t[ug]&&(t[aa]=!0,t[dg]=!0),t[aa]&&(t[Wl]=!0),t[dg]&&(t[Wl]=!0),t[Wl]&&(t[fg]=!0),t[$T]&&(t[fg]=!0);for(const r in t){const i=g5(r,n);i.indexOf(e)<0&&i.push(e)}}function y5(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Jt(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Jt.groups={};Jt.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;re.ta(t,n,r,i),je=(e,t,n,r,i)=>e.tr(t,n,r,i),_v=(e,t,n,r,i)=>e.ts(t,n,r,i),W=(e,t,n,r,i)=>e.tt(t,n,r,i),Br="WORD",pg="UWORD",UT="ASCIINUMERICAL",HT="ALPHANUMERICAL",Va="LOCALHOST",hg="TLD",mg="UTLD",Nu="SCHEME",ls="SLASH_SCHEME",mb="NUM",gg="WS",gb="NL",ca="OPENBRACE",ua="CLOSEBRACE",Sd="OPENBRACKET",kd="CLOSEBRACKET",Cd="OPENPAREN",_d="CLOSEPAREN",Td="OPENANGLEBRACKET",Nd="CLOSEANGLEBRACKET",Od="FULLWIDTHLEFTPAREN",Md="FULLWIDTHRIGHTPAREN",Ad="LEFTCORNERBRACKET",Rd="RIGHTCORNERBRACKET",Id="LEFTWHITECORNERBRACKET",Dd="RIGHTWHITECORNERBRACKET",Pd="FULLWIDTHLESSTHAN",Ld="FULLWIDTHGREATERTHAN",Bd="AMPERSAND",yb="APOSTROPHE",Fd="ASTERISK",pi="AT",zd="BACKSLASH",$d="BACKTICK",Ud="CARET",yi="COLON",bb="COMMA",Hd="DOLLAR",fr="DOT",jd="EQUALS",Eb="EXCLAMATION",Nn="HYPHEN",da="PERCENT",Vd="PIPE",Wd="PLUS",Kd="POUND",fa="QUERY",wb="QUOTE",jT="FULLWIDTHMIDDLEDOT",vb="SEMI",pr="SLASH",pa="TILDE",qd="UNDERSCORE",VT="EMOJI",Gd="SYM";var WT=Object.freeze({__proto__:null,WORD:Br,UWORD:pg,ASCIINUMERICAL:UT,ALPHANUMERICAL:HT,LOCALHOST:Va,TLD:hg,UTLD:mg,SCHEME:Nu,SLASH_SCHEME:ls,NUM:mb,WS:gg,NL:gb,OPENBRACE:ca,CLOSEBRACE:ua,OPENBRACKET:Sd,CLOSEBRACKET:kd,OPENPAREN:Cd,CLOSEPAREN:_d,OPENANGLEBRACKET:Td,CLOSEANGLEBRACKET:Nd,FULLWIDTHLEFTPAREN:Od,FULLWIDTHRIGHTPAREN:Md,LEFTCORNERBRACKET:Ad,RIGHTCORNERBRACKET:Rd,LEFTWHITECORNERBRACKET:Id,RIGHTWHITECORNERBRACKET:Dd,FULLWIDTHLESSTHAN:Pd,FULLWIDTHGREATERTHAN:Ld,AMPERSAND:Bd,APOSTROPHE:yb,ASTERISK:Fd,AT:pi,BACKSLASH:zd,BACKTICK:$d,CARET:Ud,COLON:yi,COMMA:bb,DOLLAR:Hd,DOT:fr,EQUALS:jd,EXCLAMATION:Eb,HYPHEN:Nn,PERCENT:da,PIPE:Vd,PLUS:Wd,POUND:Kd,QUERY:fa,QUOTE:wb,FULLWIDTHMIDDLEDOT:jT,SEMI:vb,SLASH:pr,TILDE:pa,UNDERSCORE:qd,EMOJI:VT,SYM:Gd});const Dr=/[a-z]/,Ll=new RegExp("\\p{L}","u"),yh=new RegExp("\\p{Emoji}","u"),Pr=/\d/,bh=/\s/,Tv="\r",Eh=` `,b5="️",E5="‍",wh="";let Wc=null,Kc=null;function w5(e=[]){const t={};Jt.groups=t;const n=new Jt;Wc==null&&(Wc=Nv(f5)),Kc==null&&(Kc=Nv(p5)),W(n,"'",yb),W(n,"{",ca),W(n,"}",ua),W(n,"[",Sd),W(n,"]",kd),W(n,"(",Cd),W(n,")",_d),W(n,"<",Td),W(n,">",Nd),W(n,"(",Od),W(n,")",Md),W(n,"「",Ad),W(n,"」",Rd),W(n,"『",Id),W(n,"』",Dd),W(n,"<",Pd),W(n,">",Ld),W(n,"&",Bd),W(n,"*",Fd),W(n,"@",pi),W(n,"`",$d),W(n,"^",Ud),W(n,":",yi),W(n,",",bb),W(n,"$",Hd),W(n,".",fr),W(n,"=",jd),W(n,"!",Eb),W(n,"-",Nn),W(n,"%",da),W(n,"|",Vd),W(n,"+",Wd),W(n,"#",Kd),W(n,"?",fa),W(n,'"',wb),W(n,"/",pr),W(n,";",vb),W(n,"~",pa),W(n,"_",qd),W(n,"\\",zd),W(n,"・",jT);const r=je(n,Pr,mb,{[cg]:!0});je(r,Pr,r);const i=je(r,Dr,UT,{[aa]:!0}),o=je(r,Ll,HT,{[Wl]:!0}),s=je(n,Dr,Br,{[ug]:!0});je(s,Pr,i),je(s,Dr,s),je(i,Pr,i),je(i,Dr,i);const l=je(n,Ll,pg,{[dg]:!0});je(l,Dr),je(l,Pr,o),je(l,Ll,l),je(o,Pr,o),je(o,Dr),je(o,Ll,o);const a=W(n,Eh,gb,{[gh]:!0}),c=W(n,Tv,gg,{[gh]:!0}),u=je(n,bh,gg,{[gh]:!0});W(n,wh,u),W(c,Eh,a),W(c,wh,u),je(c,bh,u),W(u,Tv),W(u,Eh),je(u,bh,u),W(u,wh,u);const d=je(n,yh,VT,{[$T]:!0});W(d,"#"),je(d,yh,d),W(d,b5,d);const f=W(d,E5);W(f,"#"),je(f,yh,d);const p=[[Dr,s],[Pr,i]],h=[[Dr,null],[Ll,l],[Pr,o]];for(let m=0;mm[0]>y[0]?1:-1);for(let m=0;m=0?b[fg]=!0:Dr.test(y)?Pr.test(y)?b[aa]=!0:b[ug]=!0:b[cg]=!0,_v(n,y,y,b)}return _v(n,"localhost",Va,{ascii:!0}),n.jd=new Jt(Gd),{start:n,tokens:ol({groups:t},WT)}}function KT(e,t){const n=v5(t.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s=0&&(d+=n[s].length,f++),c+=n[s].length,o+=n[s].length,s++;o-=d,s-=f,c-=d,i.push({t:u.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function v5(e){const t=[],n=e.length;let r=0;for(;r56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function si(e,t,n,r,i){let o;const s=t.length;for(let l=0;l=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Wa={defaultProtocol:"http",events:null,format:Ov,formatHref:Ov,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function xb(e,t=null){let n=ol({},Wa);e&&(n=ol(n,e instanceof xb?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;on?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Wa.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),o=this.toFormattedString(e),s={},l=e.get("className",n,t),a=e.get("target",n,t),c=e.get("rel",n,t),u=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&ol(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function qf(e,t){class n extends qT{constructor(i,o){super(i,o),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const Mv=qf("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Av=qf("text"),x5=qf("nl"),qc=qf("url",{isLink:!0,toHref(e=Wa.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==Va&&e[1].t===yi}}),Tn=e=>new Jt(e);function S5({groups:e}){const t=e.domain.concat([Bd,Fd,pi,zd,$d,Ud,Hd,jd,Nn,mb,da,Vd,Wd,Kd,pr,Gd,pa,qd]),n=[yi,bb,fr,Eb,da,fa,wb,vb,Td,Nd,ca,ua,kd,Sd,Cd,_d,Od,Md,Ad,Rd,Id,Dd,Pd,Ld],r=[Bd,yb,Fd,zd,$d,Ud,Hd,jd,Nn,ca,ua,da,Vd,Wd,Kd,fa,pr,Gd,pa,qd],i=Tn(),o=W(i,pa);ge(o,r,o),ge(o,e.domain,o);const s=Tn(),l=Tn(),a=Tn();ge(i,e.domain,s),ge(i,e.scheme,l),ge(i,e.slashscheme,a),ge(s,r,o),ge(s,e.domain,s);const c=W(s,pi);W(o,pi,c),W(l,pi,c),W(a,pi,c);const u=W(o,fr);ge(u,r,o),ge(u,e.domain,o);const d=Tn();ge(c,e.domain,d),ge(d,e.domain,d);const f=W(d,fr);ge(f,e.domain,d);const p=Tn(Mv);ge(f,e.tld,p),ge(f,e.utld,p),W(c,Va,p);const h=W(d,Nn);W(h,Nn,h),ge(h,e.domain,d),ge(p,e.domain,d),W(p,fr,f),W(p,Nn,h);const m=W(p,yi);ge(m,e.numeric,Mv);const y=W(s,Nn),g=W(s,fr);W(y,Nn,y),ge(y,e.domain,s),ge(g,r,o),ge(g,e.domain,s);const b=Tn(qc);ge(g,e.tld,b),ge(g,e.utld,b),ge(b,e.domain,s),ge(b,r,o),W(b,fr,g),W(b,Nn,y),W(b,pi,c);const E=W(b,yi),v=Tn(qc);ge(E,e.numeric,v);const S=Tn(qc),x=Tn();ge(S,t,S),ge(S,n,x),ge(x,t,S),ge(x,n,x),W(b,pr,S),W(v,pr,S);const _=W(l,yi),R=W(a,yi),I=W(R,pr),$=W(I,pr);ge(l,e.domain,s),W(l,fr,g),W(l,Nn,y),ge(a,e.domain,s),W(a,fr,g),W(a,Nn,y),ge(_,e.domain,S),W(_,pr,S),W(_,fa,S),ge($,e.domain,S),ge($,t,S),W($,pr,S);const j=[[ca,ua],[Sd,kd],[Cd,_d],[Td,Nd],[Od,Md],[Ad,Rd],[Id,Dd],[Pd,Ld]];for(let F=0;F=0&&f++,i++,u++;if(f<0)i-=u,i0&&(o.push(vh(Av,t,s)),s=[]),i-=f,u-=f;const p=d.t,h=n.slice(i-u,i);o.push(vh(p,t,h))}}return s.length>0&&o.push(vh(Av,t,s)),o}function vh(e,t,n){const r=n[0].s,i=n[n.length-1].e,o=t.slice(r,i);return new e(o,n)}const C5=typeof console<"u"&&console&&console.warn||(()=>{}),_5="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",De={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function T5(){return Jt.groups={},De.scanner=null,De.parser=null,De.tokenQueue=[],De.pluginQueue=[],De.customSchemes=[],De.initialized=!1,De}function Rv(e,t=!1){if(De.initialized&&C5(`linkifyjs: already initialized - will not register custom scheme "${e}" ${_5}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" 3. "-" cannot repeat`);De.customSchemes.push([e,t])}function N5(){De.scanner=w5(De.customSchemes);for(let e=0;e{const i=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=t.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=oH(n.doc,[...t]);if(fH(l).forEach(({newRange:c})=>{const u=lH(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const p=f.split(" ").filter(g=>g!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;const y=Sb(h).map(g=>g.toObject(e.defaultProtocol));if(!O5(y))return!1;y.filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>e.validate(g.value)).filter(g=>e.shouldAutoLink(g.value)).forEach(g=>{fb(g.from,g.to,r.doc).some(b=>b.mark.type===e.type)||s.addMark(g.from,g.to,e.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function A5(e){return new Je({key:new ht("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||!t.editable)return!1;let s=r.target;const l=[];for(;s.nodeName!=="DIV";)l.push(s),s=s.parentNode;if(!l.find(f=>f.nodeName==="A"))return!1;const a=MT(t.state,e.type.name),c=r.target,u=(i=c==null?void 0:c.href)!==null&&i!==void 0?i:a.href,d=(o=c==null?void 0:c.target)!==null&&o!==void 0?o:a.target;return c&&u?(window.open(u,d),!0):!1}}})}function R5(e){return new Je({key:new ht("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:i}=t,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=GT(l,{defaultProtocol:e.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:e.editor.commands.setMark(e.type,{href:a.href})}}})}const I5=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function no(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(I5,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z+.-]+(?:[^a-z+.-:]|$))`,"i"))}const D5=Cr.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(e=>{if(typeof e=="string"){Rv(e);return}Rv(e.scheme,e.optionalSlashes)})},onDestroy(){T5()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!no(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!no(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!no(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",He(this.options.HTMLAttributes,e),0]:["a",He(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!no(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!no(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Uo({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=GT(e).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!no(s,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(o=>t.push({text:o.value,data:{href:o.href},index:o.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)===null||t===void 0?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(M5({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!no(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&e.push(A5({type:this.type})),this.options.linkOnPaste&&e.push(R5({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}}),P5=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,L5=ot.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},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}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",He(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[AT({find:P5,type:this.type,getAttributes:e=>{const[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),B5=It.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Je({key:new ht("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((s,l)=>{const a=r>=l&&r<=l+s.nodeSize,c=!s.isLeaf&&Kf(s);if((a||!this.options.showOnlyCurrent)&&c){const u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);const d=wt.node(l,l+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:a}):this.options.placeholder});i.push(d)}return this.options.includeChildren}),Le.create(e,i)}}})]}});var yg,bg;if(typeof WeakMap<"u"){let e=new WeakMap;yg=t=>e.get(t),bg=(t,n)=>(e.set(t,n),n)}else{const e=[];let n=0;yg=r=>{for(let i=0;i(n==10&&(n=0),e[n++]=r,e[n++]=i)}var Ge=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t=n){(o||(o=[])).push({type:"overlong_rowspan",pos:u,n:g-E});break}const v=i+E*t;for(let S=0;Sr&&(o+=c.attrs.colspan)}}for(let s=0;s1&&(n=!0)}t==-1?t=o:t!=o&&(t=Math.max(t,o))}return t}function $5(e,t,n){e.problems||(e.problems=[]);const r={};for(let i=0;i0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function H5(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function rr(e){const t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function Gf(e){const t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;const n=El(t.$head)||j5(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function j5(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){const r=t.type.spec.tableRole;if(r=="cell"||r=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function Eg(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function V5(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function kb(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function YT(e,t,n){const r=e.node(-1),i=Ge.get(r),o=e.start(-1),s=i.nextCell(e.pos-o,t,n);return s==null?null:e.node(0).resolve(o+s)}function Ho(e,t,n=1){const r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(i=>i>0)||(r.colwidth=null)),r}function QT(e,t,n=1){const r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let i=0;iu!=n.pos-o);a.unshift(n.pos-o);const c=a.map(u=>{const d=r.nodeAt(u);if(!d)throw RangeError(`No cell with offset ${u} found`);const f=o+u+1;return new O_(l.resolve(f),l.resolve(f+d.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=t,this.$headCell=n}map(t,n){const r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Eg(r)&&Eg(i)&&kb(r,i)){const o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?Fr.rowSelection(r,i):o&&this.isColSelection()?Fr.colSelection(r,i):new Fr(r,i)}return ie.between(r,i)}content(){const t=this.$anchorCell.node(-1),n=Ge.get(t),r=this.$anchorCell.start(-1),i=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),o={},s=[];for(let a=i.top;a0||y>0){let g=h.attrs;if(m>0&&(g=Ho(g,0,m)),y>0&&(g=Ho(g,g.colspan-y,y)),p.lefti.bottom){const g={...h.attrs,rowspan:Math.min(p.bottom,i.bottom)-Math.max(p.top,i.top)};p.top0)return!1;const r=t+this.$anchorCell.nodeAfter.attrs.rowspan,i=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,i)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){const r=t.node(-1),i=Ge.get(r),o=t.start(-1),s=i.findCell(t.pos-o),l=i.findCell(n.pos-o),a=t.node(0);return s.top<=l.top?(s.top>0&&(t=a.resolve(o+i.map[s.left])),l.bottom0&&(n=a.resolve(o+i.map[l.left])),s.bottom0)return!1;const s=i+this.$anchorCell.nodeAfter.attrs.colspan,l=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,l)==n.width}eq(t){return t instanceof Fr&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){const r=t.node(-1),i=Ge.get(r),o=t.start(-1),s=i.findCell(t.pos-o),l=i.findCell(n.pos-o),a=t.node(0);return s.left<=l.left?(s.left>0&&(t=a.resolve(o+i.map[s.top*i.width])),l.right0&&(n=a.resolve(o+i.map[l.top*i.width])),s.right{t.push(wt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),Le.create(e.doc,t)}function G5({$from:e,$to:t}){if(e.pos==t.pos||e.pos=0&&!(e.after(i+1)=0&&!(t.before(o+1)>t.start(o));o--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Y5({$from:e,$to:t}){let n,r;for(let i=e.depth;i>0;i--){const o=e.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){n=o;break}}for(let i=t.depth;i>0;i--){const o=t.node(i);if(o.type.spec.tableRole==="cell"||o.type.spec.tableRole==="header_cell"){r=o;break}}return n!==r&&t.parentOffset===0}function Q5(e,t,n){const r=(t||e).selection,i=(t||e).doc;let o,s;if(r instanceof re&&(s=r.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")o=Ae.create(i,r.from);else if(s=="row"){const l=i.resolve(r.from+1);o=Ae.rowSelection(l,l)}else if(!n){const l=Ge.get(r.node),a=r.from+1,c=a+l.map[l.width*l.height-1];o=Ae.create(i,a+1,c)}}else r instanceof ie&&G5(r)?o=ie.create(i,r.from):r instanceof ie&&Y5(r)&&(o=ie.create(i,r.$from.start(),r.$from.end()));return o&&(t||(t=e.tr)).setSelection(o),t}var X5=new ht("fix-tables");function JT(e,t,n,r){const i=e.childCount,o=t.childCount;e:for(let s=0,l=0;s{i.type.spec.tableRole=="table"&&(n=J5(e,i,o,n))};return t?t.doc!=e.doc&&JT(t.doc,e.doc,0,r):e.doc.descendants(r),n}function J5(e,t,n,r){const i=Ge.get(t);if(!i.problems)return r;r||(r=e.tr);const o=[];for(let a=0;a0){let p="cell";u.firstChild&&(p=u.firstChild.type.spec.tableRole);const h=[];for(let y=0;y0?-1:0;W5(t,r,i+o)&&(o=i==0||i==t.width?null:0);for(let s=0;s0&&i0&&t.map[l-1]==a||i0?-1:0;rV(t,r,i+a)&&(a=i==0||i==t.height?null:0);for(let c=0,u=t.width*i;c0&&i0&&d==t.map[u-t.width]){const f=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(l).map(d+r),null,{...f,rowspan:f.rowspan-1}),c+=f.colspan-1}else if(i0&&n[o]==n[o-1]||r.right0&&n[i]==n[i-e]||r.bottomn[r.type.spec.tableRole])(e,t)}function cV(e){return(t,n)=>{var r;const i=t.selection;let o,s;if(i instanceof Ae){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,s=i.$anchorCell.pos}else{if(o=H5(i.$from),!o)return!1;s=(r=El(i.$from))==null?void 0:r.pos}if(o==null||s==null||o.attrs.colspan==1&&o.attrs.rowspan==1)return!1;if(n){let l=o.attrs;const a=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const u=Or(t),d=t.tr;for(let p=0;p{s.attrs[e]!==t&&o.setNodeMarkup(l,null,{...s.attrs,[e]:t})}):o.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(o)}return!0}}function dV(e){return function(t,n){if(!rr(t))return!1;if(n){const r=Dt(t.schema),i=Or(t),o=t.tr,s=i.map.cellsInRect(e=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),l=s.map(a=>i.table.nodeAt(a));for(let a=0;a{const h=p+o.tableStart,m=s.doc.nodeAt(h);m&&s.setNodeMarkup(h,f,m.attrs)}),r(s)}return!0}}Ka("row",{useDeprecatedLogic:!0});Ka("column",{useDeprecatedLogic:!0});var fV=Ka("cell",{useDeprecatedLogic:!0});function pV(e,t){if(t<0){const n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let r=e.index(-1)-1,i=e.before();r>=0;r--){const o=e.node(-1).child(r),s=o.lastChild;if(s)return i-1-s.nodeSize;i-=o.nodeSize}}else{if(e.index()0;r--)if(n.node(r).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Gc(e,t){const n=e.selection;if(!(n instanceof Ae))return!1;if(t){const r=e.tr,i=Dt(e.schema).cell.createAndFill().content;n.forEachCell((o,s)=>{o.content.eq(i)||r.replace(r.mapping.map(s+1),r.mapping.map(s+o.nodeSize-1),new Q(i,0,0))}),r.docChanged&&t(r)}return!0}function mV(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole=="table");)n--,r--,t=t.child(0).content;const i=t.child(0),o=i.type.spec.tableRole,s=i.type.schema,l=[];if(o=="row")for(let a=0;a=0;s--){const{rowspan:l,colspan:a}=o.child(s).attrs;for(let c=i;c=t.length&&t.push(U.empty),n[i]r&&(f=f.type.createChecked(Ho(f.attrs,f.attrs.colspan,u+f.attrs.colspan-r),f.content)),c.push(f),u+=f.attrs.colspan;for(let p=1;pi&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,i-d.attrs.rowspan)},d.content)),a.push(d)}o.push(U.from(a))}n=o,t=i}return{width:e,height:t,rows:n}}function bV(e,t,n,r,i,o,s){const l=e.doc.type.schema,a=Dt(l);let c,u;if(i>t.width)for(let d=0,f=0;dt.height){const d=[];for(let h=0,m=(t.height-1)*t.width;h=t.width?!1:n.nodeAt(t.map[m+h]).type==a.header_cell;d.push(y?u||(u=a.header_cell.createAndFill()):c||(c=a.cell.createAndFill()))}const f=a.row.create(null,U.from(d)),p=[];for(let h=t.height;h{if(!i)return!1;const o=n.selection;if(o instanceof Ae)return Ou(n,r,se.near(o.$headCell,t));if(e!="horiz"&&!o.empty)return!1;const s=nN(i,e,t);if(s==null)return!1;if(e=="horiz")return Ou(n,r,se.near(n.doc.resolve(o.head+t),t));{const l=n.doc.resolve(s),a=YT(l,e,t);let c;return a?c=se.near(a,1):t<0?c=se.near(n.doc.resolve(l.before(-1)),-1):c=se.near(n.doc.resolve(l.after(-1)),1),Ou(n,r,c)}}}function Qc(e,t){return(n,r,i)=>{if(!i)return!1;const o=n.selection;let s;if(o instanceof Ae)s=o;else{const a=nN(i,e,t);if(a==null)return!1;s=new Ae(n.doc.resolve(a))}const l=YT(s.$headCell,e,t);return l?Ou(n,r,new Ae(s.$anchorCell,l)):!1}}function wV(e,t){const n=e.state.doc,r=El(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new Ae(r))),!0):!1}function vV(e,t,n){if(!rr(e.state))return!1;let r=mV(n);const i=e.state.selection;if(i instanceof Ae){r||(r={width:1,height:1,rows:[U.from(wg(Dt(e.state.schema).cell,n))]});const o=i.$anchorCell.node(-1),s=i.$anchorCell.start(-1),l=Ge.get(o).rectBetween(i.$anchorCell.pos-s,i.$headCell.pos-s);return r=yV(r,l.right-l.left,l.bottom-l.top),$v(e.state,e.dispatch,s,l,r),!0}else if(r){const o=Gf(e.state),s=o.start(-1);return $v(e.state,e.dispatch,s,Ge.get(o.node(-1)).findCell(o.pos-s),r),!0}else return!1}function xV(e,t){var n;if(t.ctrlKey||t.metaKey)return;const r=Uv(e,t.target);let i;if(t.shiftKey&&e.state.selection instanceof Ae)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&(i=El(e.state.selection.$anchor))!=null&&((n=xh(e,t))==null?void 0:n.pos)!=i.pos)o(i,t),t.preventDefault();else if(!r)return;function o(a,c){let u=xh(e,c);const d=bi.getState(e.state)==null;if(!u||!kb(a,u))if(d)u=a;else return;const f=new Ae(a,u);if(d||!e.state.selection.eq(f)){const p=e.state.tr.setSelection(f);d&&p.setMeta(bi,a.pos),e.dispatch(p)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",l),bi.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(bi,-1))}function l(a){const c=a,u=bi.getState(e.state);let d;if(u!=null)d=e.state.doc.resolve(u);else if(Uv(e,c.target)!=r&&(d=xh(e,t),!d))return s();d&&o(d,c)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",l)}function nN(e,t,n){if(!(e.state.selection instanceof ie))return null;const{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){const o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if(o.type.spec.tableRole=="cell"||o.type.spec.tableRole=="header_cell"){const l=r.before(i),a=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?l:null}}return null}function Uv(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function xh(e,t){const n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?El(e.state.doc.resolve(n.pos)):null}var SV=class{constructor(t,n){this.node=t,this.defaultCellMinWidth=n,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",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),vg(t,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type!=this.node.type?!1:(this.node=t,vg(t,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(t){return t.type=="attributes"&&(t.target==this.table||this.colgroup.contains(t.target))}};function vg(e,t,n,r,i,o){var s;let l=0,a=!0,c=t.firstChild;const u=e.firstChild;if(u){for(let d=0,f=0;dnew r(f,n,p)),new CV(-1,!1)},apply(s,l){return l.apply(s)}},props:{attributes:s=>{const l=yn.getState(s);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,l)=>{_V(s,l,e,i)},mouseleave:s=>{TV(s)},mousedown:(s,l)=>{NV(s,l,t,n)}},decorations:s=>{const l=yn.getState(s);if(l&&l.activeHandle>-1)return IV(s,l.activeHandle)},nodeViews:{}}});return o}var CV=class Mu{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){const n=this,r=t.getMeta(yn);if(r&&r.setHandle!=null)return new Mu(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Mu(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let i=t.mapping.map(n.activeHandle,-1);return Eg(t.doc.resolve(i))||(i=-1),new Mu(i,n.dragging)}return n}};function _V(e,t,n,r){const i=yn.getState(e.state);if(i&&!i.dragging){const o=MV(t.target);let s=-1;if(o){const{left:l,right:a}=o.getBoundingClientRect();t.clientX-l<=n?s=Hv(e,t,"left",n):a-t.clientX<=n&&(s=Hv(e,t,"right",n))}if(s!=i.activeHandle){if(!r&&s!==-1){const l=e.state.doc.resolve(s),a=l.node(-1),c=Ge.get(a),u=l.start(-1);if(c.colCount(l.pos-u)+l.nodeAfter.attrs.colspan-1==c.width-1)return}rN(e,s)}}}function TV(e){const t=yn.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&rN(e,-1)}function NV(e,t,n,r){var i;const o=(i=e.dom.ownerDocument.defaultView)!=null?i:window,s=yn.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;const l=e.state.doc.nodeAt(s.activeHandle),a=OV(e,s.activeHandle,l.attrs);e.dispatch(e.state.tr.setMeta(yn,{setDragging:{startX:t.clientX,startWidth:a}}));function c(d){o.removeEventListener("mouseup",c),o.removeEventListener("mousemove",u);const f=yn.getState(e.state);f!=null&&f.dragging&&(AV(e,f.activeHandle,jv(f.dragging,d,n)),e.dispatch(e.state.tr.setMeta(yn,{setDragging:null})))}function u(d){if(!d.which)return c(d);const f=yn.getState(e.state);if(f&&f.dragging){const p=jv(f.dragging,d,n);Vv(e,f.activeHandle,p,r)}}return Vv(e,s.activeHandle,a,r),o.addEventListener("mouseup",c),o.addEventListener("mousemove",u),t.preventDefault(),!0}function OV(e,t,{colspan:n,colwidth:r}){const i=r&&r[r.length-1];if(i)return i;const o=e.domAtPos(t);let l=o.node.childNodes[o.offset].offsetWidth,a=n;if(r)for(let c=0;c{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function FV(e,t,n,r,i){const o=BV(e),s=[],l=[];for(let c=0;c{const{selection:t}=e.state;if(!zV(t))return!1;let n=0;const r=OT(t.ranges[0].$from,o=>o.type.name==="table");return r==null||r.node.descendants(o=>{if(o.type.name==="table")return!1;["tableCell","tableHeader"].includes(o.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1},$V=ot.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:PV,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){const{colgroup:n,tableWidth:r,tableMinWidth:i}=LV(e,this.options.cellMinWidth);return["table",He(this.options.HTMLAttributes,t,{style:r?`width: ${r}`:`min-width: ${i}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:o})=>{const s=FV(o.schema,e,t,n);if(i){const l=r.selection.from+1;r.replaceSelectionWith(s).scrollIntoView().setSelection(ie.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Z5(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>eV(e,t),deleteColumn:()=>({state:e,dispatch:t})=>nV(e,t),addRowBefore:()=>({state:e,dispatch:t})=>iV(e,t),addRowAfter:()=>({state:e,dispatch:t})=>oV(e,t),deleteRow:()=>({state:e,dispatch:t})=>lV(e,t),deleteTable:()=>({state:e,dispatch:t})=>hV(e,t),mergeCells:()=>({state:e,dispatch:t})=>Dv(e,t),splitCell:()=>({state:e,dispatch:t})=>Pv(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Ka("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Ka("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>fV(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>Dv(e,t)?!0:Pv(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>uV(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>Bv(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>Bv(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&ZT(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){const r=Ae.create(t.doc,e.anchorCell,e.headCell);t.setSelection(r)}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:Xc,"Mod-Backspace":Xc,Delete:Xc,"Mod-Delete":Xc}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[kV({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],DV({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:ye(ee(e,"tableRole",t))}}}),UV=ot.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",He(this.options.HTMLAttributes,e),0]}}),HV=ot.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:e}){return["td",He(this.options.HTMLAttributes,e),0]}}),jV=ot.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:e}){return["th",He(this.options.HTMLAttributes,e),0]}});function VV(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function iN(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&iN(n)}),e}let qv=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function oN(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Oi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const WV="",Gv=e=>!!e.scope,KV=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};let qV=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=oN(t)}openNode(t){if(!Gv(t))return;const n=KV(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){Gv(t)&&(this.buffer+=WV)}value(){return this.buffer}span(t){this.buffer+=``}};const Yv=(e={})=>{const t={children:[]};return Object.assign(t,e),t};let GV=class sN{constructor(){this.rootNode=Yv(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=Yv({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{sN._collapse(n)}))}},YV=class extends GV{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new qV(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function qa(e){return e?typeof e=="string"?e:e.source:null}function lN(e){return Yo("(?=",e,")")}function QV(e){return Yo("(?:",e,")*")}function XV(e){return Yo("(?:",e,")?")}function Yo(...e){return e.map(n=>qa(n)).join("")}function JV(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Cb(...e){return"("+(JV(e).capture?"":"?:")+e.map(r=>qa(r)).join("|")+")"}function aN(e){return new RegExp(e.toString()+"|").exec("").length-1}function ZV(e,t){const n=e&&e.exec(t);return n&&n.index===0}const eW=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function _b(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let o=qa(r),s="";for(;o.length>0;){const l=eW.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(t)}const tW=/\b\B/,cN="[a-zA-Z]\\w*",Tb="[a-zA-Z_]\\w*",uN="\\b\\d+(\\.\\d+)?",dN="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",fN="\\b(0b[01]+)",nW="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",rW=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Yo(t,/.*\b/,e.binary,/\b.*/)),Oi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Ga={begin:"\\\\[\\s\\S]",relevance:0},iW={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ga]},oW={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ga]},sW={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Yf=function(e,t,n={}){const r=Oi({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Cb("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Yo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},lW=Yf("//","$"),aW=Yf("/\\*","\\*/"),cW=Yf("#","$"),uW={scope:"number",begin:uN,relevance:0},dW={scope:"number",begin:dN,relevance:0},fW={scope:"number",begin:fN,relevance:0},pW={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ga,{begin:/\[/,end:/\]/,relevance:0,contains:[Ga]}]},hW={scope:"title",begin:cN,relevance:0},mW={scope:"title",begin:Tb,relevance:0},gW={begin:"\\.\\s*"+Tb,relevance:0},yW=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var Jc=Object.freeze({__proto__:null,APOS_STRING_MODE:iW,BACKSLASH_ESCAPE:Ga,BINARY_NUMBER_MODE:fW,BINARY_NUMBER_RE:fN,COMMENT:Yf,C_BLOCK_COMMENT_MODE:aW,C_LINE_COMMENT_MODE:lW,C_NUMBER_MODE:dW,C_NUMBER_RE:dN,END_SAME_AS_BEGIN:yW,HASH_COMMENT_MODE:cW,IDENT_RE:cN,MATCH_NOTHING_RE:tW,METHOD_GUARD:gW,NUMBER_MODE:uW,NUMBER_RE:uN,PHRASAL_WORDS_MODE:sW,QUOTE_STRING_MODE:oW,REGEXP_MODE:pW,RE_STARTERS_RE:nW,SHEBANG:rW,TITLE_MODE:hW,UNDERSCORE_IDENT_RE:Tb,UNDERSCORE_TITLE_MODE:mW});function bW(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function EW(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function wW(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=bW,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function vW(e,t){Array.isArray(e.illegal)&&(e.illegal=Cb(...e.illegal))}function xW(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function SW(e,t){e.relevance===void 0&&(e.relevance=1)}const kW=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Yo(n.beforeMatch,lN(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},CW=["of","and","for","in","not","or","if","then","parent","list","value"],_W="keyword";function pN(e,t,n=_W){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(o){Object.assign(r,pN(e[o],t,o))}),r;function i(o,s){t&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){const a=l.split("|");r[a[0]]=[o,TW(a[0],a[1])]})}}function TW(e,t){return t?Number(t):NW(e)?0:1}function NW(e){return CW.includes(e.toLowerCase())}const Qv={},Oo=e=>{console.error(e)},Xv=(e,...t)=>{console.log(`WARN: ${e}`,...t)},ns=(e,t)=>{Qv[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Qv[`${e}/${t}`]=!0)},Yd=new Error;function hN(e,t,{key:n}){let r=0;const i=e[n],o={},s={};for(let l=1;l<=t.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=aN(t[l-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function OW(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Oo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Yd;if(typeof e.beginScope!="object"||e.beginScope===null)throw Oo("beginScope must be object"),Yd;hN(e,e.begin,{key:"beginScope"}),e.begin=_b(e.begin,{joinWith:""})}}function MW(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Oo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Yd;if(typeof e.endScope!="object"||e.endScope===null)throw Oo("endScope must be object"),Yd;hN(e,e.end,{key:"endScope"}),e.end=_b(e.end,{joinWith:""})}}function AW(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function RW(e){AW(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),OW(e),MW(e)}function IW(e){function t(s,l){return new RegExp(qa(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=aN(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(a=>a[1]);this.matcherRe=t(_b(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(l);if(!a)return null;const c=a.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return a.splice(0,c),Object.assign(a,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const a=new n;return this.rules.slice(l).forEach(([c,u])=>a.addRule(c,u)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let c=a.exec(l);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(l)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){const l=new r;return s.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){const a=s;if(s.isCompiled)return a;[EW,xW,RW,kW].forEach(u=>u(s,l)),e.compilerExtensions.forEach(u=>u(s,l)),s.__beforeBegin=null,[wW,vW,SW].forEach(u=>u(s,l)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=pN(s.keywords,e.case_insensitive)),a.keywordPatternRe=t(c,!0),l&&(s.begin||(s.begin=/\B|\b/),a.beginRe=t(a.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(a.endRe=t(a.end)),a.terminatorEnd=qa(a.end)||"",s.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(a.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return DW(u==="self"?s:u)})),s.contains.forEach(function(u){o(u,a)}),s.starts&&o(s.starts,l),a.matcher=i(a),a}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Oi(e.classNameAliases||{}),o(e)}function mN(e){return e?e.endsWithParent||mN(e.starts):!1}function DW(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Oi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:mN(e)?Oi(e,{starts:e.starts?Oi(e.starts):null}):Object.isFrozen(e)?Oi(e):e}var PW="11.10.0";let LW=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}};const Sh=oN,Jv=Oi,Zv=Symbol("nomatch"),BW=7,gN=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:YV};function a(M){return l.noHighlightRe.test(M)}function c(M){let N=M.className+" ";N+=M.parentNode?M.parentNode.className:"";const P=l.languageDetectRe.exec(N);if(P){const w=I(P[1]);return w||(Xv(o.replace("{}",P[1])),Xv("Falling back to no-highlight mode for this block.",M)),w?P[1]:"no-highlight"}return N.split(/\s+/).find(w=>a(w)||I(w))}function u(M,N,P){let w="",q="";typeof N=="object"?(w=M,P=N.ignoreIllegals,q=N.language):(ns("10.7.0","highlight(lang, code, ...args) has been deprecated."),ns("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),q=M,w=N),P===void 0&&(P=!0);const J={code:w,language:q};Y("before:highlight",J);const C=J.result?J.result:d(J.language,J.code,P);return C.code=J.code,Y("after:highlight",C),C}function d(M,N,P,w){const q=Object.create(null);function J(T,L){return T.keywords[L]}function C(){if(!oe.keywords){ae.addText(xe);return}let T=0;oe.keywordPatternRe.lastIndex=0;let L=oe.keywordPatternRe.exec(xe),H="";for(;L;){H+=xe.substring(T,L.index);const X=de.case_insensitive?L[0].toLowerCase():L[0],Ee=J(oe,X);if(Ee){const[nt,un]=Ee;if(ae.addText(H),H="",q[X]=(q[X]||0)+1,q[X]<=BW&&(Gt+=un),nt.startsWith("_"))H+=L[0];else{const to=de.classNameAliases[nt]||nt;ue(L[0],to)}}else H+=L[0];T=oe.keywordPatternRe.lastIndex,L=oe.keywordPatternRe.exec(xe)}H+=xe.substring(T),ae.addText(H)}function ce(){if(xe==="")return;let T=null;if(typeof oe.subLanguage=="string"){if(!t[oe.subLanguage]){ae.addText(xe);return}T=d(oe.subLanguage,xe,!0,Fe[oe.subLanguage]),Fe[oe.subLanguage]=T._top}else T=p(xe,oe.subLanguage.length?oe.subLanguage:null);oe.relevance>0&&(Gt+=T.relevance),ae.__addSublanguage(T._emitter,T.language)}function be(){oe.subLanguage!=null?ce():C(),xe=""}function ue(T,L){T!==""&&(ae.startScope(L),ae.addText(T),ae.endScope())}function st(T,L){let H=1;const X=L.length-1;for(;H<=X;){if(!T._emit[H]){H++;continue}const Ee=de.classNameAliases[T[H]]||T[H],nt=L[H];Ee?ue(nt,Ee):(xe=nt,C(),xe=""),H++}}function mt(T,L){return T.scope&&typeof T.scope=="string"&&ae.openNode(de.classNameAliases[T.scope]||T.scope),T.beginScope&&(T.beginScope._wrap?(ue(xe,de.classNameAliases[T.beginScope._wrap]||T.beginScope._wrap),xe=""):T.beginScope._multi&&(st(T.beginScope,L),xe="")),oe=Object.create(T,{parent:{value:oe}}),oe}function ln(T,L,H){let X=ZV(T.endRe,H);if(X){if(T["on:end"]){const Ee=new qv(T);T["on:end"](L,Ee),Ee.isMatchIgnored&&(X=!1)}if(X){for(;T.endsParent&&T.parent;)T=T.parent;return T}}if(T.endsWithParent)return ln(T.parent,L,H)}function _n(T){return oe.matcher.regexIndex===0?(xe+=T[0],1):(O=!0,0)}function ir(T){const L=T[0],H=T.rule,X=new qv(H),Ee=[H.__beforeBegin,H["on:begin"]];for(const nt of Ee)if(nt&&(nt(T,X),X.isMatchIgnored))return _n(L);return H.skip?xe+=L:(H.excludeBegin&&(xe+=L),be(),!H.returnBegin&&!H.excludeBegin&&(xe=L)),mt(H,T),H.returnBegin?0:L.length}function eo(T){const L=T[0],H=N.substring(T.index),X=ln(oe,T,H);if(!X)return Zv;const Ee=oe;oe.endScope&&oe.endScope._wrap?(be(),ue(L,oe.endScope._wrap)):oe.endScope&&oe.endScope._multi?(be(),st(oe.endScope,T)):Ee.skip?xe+=L:(Ee.returnEnd||Ee.excludeEnd||(xe+=L),be(),Ee.excludeEnd&&(xe=L));do oe.scope&&ae.closeNode(),!oe.skip&&!oe.subLanguage&&(Gt+=oe.relevance),oe=oe.parent;while(oe!==X.parent);return X.starts&&mt(X.starts,T),Ee.returnEnd?0:L.length}function or(){const T=[];for(let L=oe;L!==de;L=L.parent)L.scope&&T.unshift(L.scope);T.forEach(L=>ae.openNode(L))}let Hn={};function lt(T,L){const H=L&&L[0];if(xe+=T,H==null)return be(),0;if(Hn.type==="begin"&&L.type==="end"&&Hn.index===L.index&&H===""){if(xe+=N.slice(L.index,L.index+1),!i){const X=new Error(`0 width match regex (${M})`);throw X.languageName=M,X.badRule=Hn.rule,X}return 1}if(Hn=L,L.type==="begin")return ir(L);if(L.type==="illegal"&&!P){const X=new Error('Illegal lexeme "'+H+'" for mode "'+(oe.scope||"")+'"');throw X.mode=oe,X}else if(L.type==="end"){const X=eo(L);if(X!==Zv)return X}if(L.type==="illegal"&&H==="")return 1;if(Mr>1e5&&Mr>L.index*3)throw new Error("potential infinite loop, way more iterations than matches");return xe+=H,H.length}const de=I(M);if(!de)throw Oo(o.replace("{}",M)),new Error('Unknown language: "'+M+'"');const an=IW(de);let ne="",oe=w||an;const Fe={},ae=new l.__emitter(l);or();let xe="",Gt=0,cn=0,Mr=0,O=!1;try{if(de.__emitTokens)de.__emitTokens(N,ae);else{for(oe.matcher.considerAll();;){Mr++,O?O=!1:oe.matcher.considerAll(),oe.matcher.lastIndex=cn;const T=oe.matcher.exec(N);if(!T)break;const L=N.substring(cn,T.index),H=lt(L,T);cn=T.index+H}lt(N.substring(cn))}return ae.finalize(),ne=ae.toHTML(),{language:M,value:ne,relevance:Gt,illegal:!1,_emitter:ae,_top:oe}}catch(T){if(T.message&&T.message.includes("Illegal"))return{language:M,value:Sh(N),illegal:!0,relevance:0,_illegalBy:{message:T.message,index:cn,context:N.slice(cn-100,cn+100),mode:T.mode,resultSoFar:ne},_emitter:ae};if(i)return{language:M,value:Sh(N),illegal:!1,relevance:0,errorRaised:T,_emitter:ae,_top:oe};throw T}}function f(M){const N={value:Sh(M),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return N._emitter.addText(M),N}function p(M,N){N=N||l.languages||Object.keys(t);const P=f(M),w=N.filter(I).filter(j).map(be=>d(be,M,!1));w.unshift(P);const q=w.sort((be,ue)=>{if(be.relevance!==ue.relevance)return ue.relevance-be.relevance;if(be.language&&ue.language){if(I(be.language).supersetOf===ue.language)return 1;if(I(ue.language).supersetOf===be.language)return-1}return 0}),[J,C]=q,ce=J;return ce.secondBest=C,ce}function h(M,N,P){const w=N&&n[N]||P;M.classList.add("hljs"),M.classList.add(`language-${w}`)}function m(M){let N=null;const P=c(M);if(a(P))return;if(Y("before:highlightElement",{el:M,language:P}),M.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",M);return}if(M.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(M)),l.throwUnescapedHTML))throw new LW("One of your code blocks includes unescaped HTML.",M.innerHTML);N=M;const w=N.textContent,q=P?u(w,{language:P,ignoreIllegals:!0}):p(w);M.innerHTML=q.value,M.dataset.highlighted="yes",h(M,P,q.language),M.result={language:q.language,re:q.relevance,relevance:q.relevance},q.secondBest&&(M.secondBest={language:q.secondBest.language,relevance:q.secondBest.relevance}),Y("after:highlightElement",{el:M,result:q,text:w})}function y(M){l=Jv(l,M)}const g=()=>{v(),ns("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){v(),ns("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function v(){if(document.readyState==="loading"){E=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(){E&&v()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",S,!1);function x(M,N){let P=null;try{P=N(e)}catch(w){if(Oo("Language definition for '{}' could not be registered.".replace("{}",M)),i)Oo(w);else throw w;P=s}P.name||(P.name=M),t[M]=P,P.rawDefinition=N.bind(null,e),P.aliases&&$(P.aliases,{languageName:M})}function _(M){delete t[M];for(const N of Object.keys(n))n[N]===M&&delete n[N]}function R(){return Object.keys(t)}function I(M){return M=(M||"").toLowerCase(),t[M]||t[n[M]]}function $(M,{languageName:N}){typeof M=="string"&&(M=[M]),M.forEach(P=>{n[P.toLowerCase()]=N})}function j(M){const N=I(M);return N&&!N.disableAutodetect}function F(M){M["before:highlightBlock"]&&!M["before:highlightElement"]&&(M["before:highlightElement"]=N=>{M["before:highlightBlock"](Object.assign({block:N.el},N))}),M["after:highlightBlock"]&&!M["after:highlightElement"]&&(M["after:highlightElement"]=N=>{M["after:highlightBlock"](Object.assign({block:N.el},N))})}function te(M){F(M),r.push(M)}function V(M){const N=r.indexOf(M);N!==-1&&r.splice(N,1)}function Y(M,N){const P=M;r.forEach(function(w){w[P]&&w[P](N)})}function D(M){return ns("10.7.0","highlightBlock will be removed entirely in v12.0"),ns("10.7.0","Please use highlightElement now."),m(M)}Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:v,highlightElement:m,highlightBlock:D,configure:y,initHighlighting:g,initHighlightingOnLoad:b,registerLanguage:x,unregisterLanguage:_,listLanguages:R,getLanguage:I,registerAliases:$,autoDetection:j,inherit:Jv,addPlugin:te,removePlugin:V}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=PW,e.regex={concat:Yo,lookahead:lN,either:Cb,optional:XV,anyNumberOfTimes:QV};for(const M in Jc)typeof Jc[M]=="object"&&iN(Jc[M]);return Object.assign(e,Jc),e},sl=gN({});sl.newInstance=()=>gN({});var FW=sl;sl.HighlightJS=sl;sl.default=sl;var zW=VV(FW);function yN(e,t=[]){return e.map(n=>{const r=[...t,...n.properties?n.properties.className:[]];return n.children?yN(n.children,r):{text:n.value,classes:r}}).flat()}function ex(e){return e.value||e.children||[]}function $W(e){return!!zW.getLanguage(e)}function tx({doc:e,name:t,lowlight:n,defaultLanguage:r}){const i=[];return og(e,o=>o.type.name===t).forEach(o=>{var s;let l=o.pos+1;const a=o.node.attrs.language||r,c=n.listLanguages(),u=a&&(c.includes(a)||$W(a)||!((s=n.registered)===null||s===void 0)&&s.call(n,a))?ex(n.highlight(a,o.node.textContent)):ex(n.highlightAuto(o.node.textContent));yN(u).forEach(d=>{const f=l+d.text.length;if(d.classes.length){const p=wt.inline(l,f,{class:d.classes.join(" ")});i.push(p)}l=f})}),Le.create(e,i)}function UW(e){return typeof e=="function"}function HW({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(i=>UW(t[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new Je({key:new ht("lowlight"),state:{init:(i,{doc:o})=>tx({doc:o,name:e,lowlight:t,defaultLanguage:n}),apply:(i,o,s,l)=>{const a=s.selection.$head.parent.type.name,c=l.selection.$head.parent.type.name,u=og(s.doc,f=>f.type.name===e),d=og(l.doc,f=>f.type.name===e);return i.docChanged&&([a,c].includes(e)||d.length!==u.length||i.steps.some(f=>f.from!==void 0&&f.to!==void 0&&u.some(p=>p.pos>=f.from&&p.pos+p.node.nodeSize<=f.to)))?tx({doc:i.doc,name:e,lowlight:t,defaultLanguage:n}):o.map(i.mapping,i.doc)}},props:{decorations(i){return r.getState(i)}}});return r}const jW=DT.extend({addOptions(){var e;return{...(e=this.parent)===null||e===void 0?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...((e=this.parent)===null||e===void 0?void 0:e.call(this))||[],HW({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function VW(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[S,d,l,n,e.C_BLOCK_COMMENT_MODE,u,c],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:x.concat([{begin:/\(/,end:/\)/,keywords:v,contains:x.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"",keywords:v,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function WW(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=VW(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function KW(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const a={match:/\\"/},c={className:"string",begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],p=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],g={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],E=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],v=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],S=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:y,built_in:[...b,...E,"set","shopt",...v,...S]},contains:[p,e.SHEBANG(),h,d,o,s,g,l,a,c,u,n]}}function qW(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",y={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},g=[d,l,n,e.C_BLOCK_COMMENT_MODE,u,c],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:y,contains:g.concat([{begin:/\(/,end:/\)/,keywords:y,contains:g.concat(["self"]),relevance:0}]),relevance:0},E={begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:y,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:y,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(f,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,l,{begin:/\(/,end:/\)/,keywords:y,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:y,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:d,strings:c,keywords:y}}}function GW(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",s="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},u={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},f={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},p=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],m=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],y=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],g=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],v={type:m,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:y},S={className:"function.dispatch",relevance:0,keywords:{_hint:g},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},x=[S,d,l,n,e.C_BLOCK_COMMENT_MODE,u,c],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:x.concat([{begin:/\(/,end:/\)/,keywords:v,contains:x.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+s+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:p,returnBegin:!0,contains:[f],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,u]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,u,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,u,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:v,illegal:"",keywords:v,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:v},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function YW(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(o),built_in:t,literal:r},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},d=e.inherit(u,{illegal:/\n/}),f={className:"subst",begin:/\{/,end:/\}/,keywords:s},p=e.inherit(f,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,p]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]},y=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]});f.contains=[m,h,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],p.contains=[y,h,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const g={variants:[c,m,h,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},E=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",v={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+E+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[g,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},v]}}const QW=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),XW=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],JW=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ZW=[...XW,...JW],e6=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),t6=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),n6=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),r6=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function i6(e){const t=e.regex,n=QW(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",o=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+t6.join("|")+")"},{begin:":(:)?("+n6.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+r6.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:e6.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+ZW.join("|")+")\\b"}]}}function o6(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function s6(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"bN(e,t,n-1))}function c6(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+bN("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),a={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},u={className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:a,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:a,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,nx,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},nx,c]}}const rx="[A-Za-z$_][0-9A-Za-z$_]*",u6=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],d6=["true","false","null","undefined","NaN","Infinity"],EN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],vN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],f6=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],p6=[].concat(vN,EN,wN);function h6(e){const t=e.regex,n=(N,{after:P})=>{const w="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(N,P)=>{const w=N[0].length+N.index,q=N.input[w];if(q==="<"||q===","){P.ignoreMatch();return}q===">"&&(n(N,{after:w})||P.ignoreMatch());let J;const C=N.input.substring(w);if(J=C.match(/^\s*=/)){P.ignoreMatch();return}if((J=C.match(/^\s+extends\s+/))&&J.index===0){P.ignoreMatch();return}}},l={$pattern:rx,keyword:u6,literal:d6,built_in:p6,"variable.language":f6},a="[0-9](_?[0-9])*",c=`\\.(${a})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${a})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,m,y,{match:/\$\d+/},d];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(E)});const v=[].concat(b,f.contains),S=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(v)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...EN,...wN]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(N){return t.concat("(?!",N.join("|"),")")}const te={match:t.concat(/\b/,F([...vN,"super","import"].map(N=>`${N}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,m,y,b,{match:/\$\d+/},d,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},te,j,_,Y,{match:/\$[(.]/}]}}function m6(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var cs="[0-9](_*[0-9])*",tu=`\\.(${cs})`,nu="[0-9a-fA-F](_*[0-9a-fA-F])*",g6={className:"number",variants:[{begin:`(\\b(${cs})((${tu})|\\.)?|(${tu}))[eE][+-]?(${cs})[fFdD]?\\b`},{begin:`\\b(${cs})((${tu})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${tu})[fFdD]?\\b`},{begin:`\\b(${cs})[fFdD]\\b`},{begin:`\\b0[xX]((${nu})\\.?|(${nu})?\\.(${nu}))[pP][+-]?(${cs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${nu})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function y6(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,i]}]};i.contains.push(s);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"string"}),"self"]}]},c=g6,u=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,u,n,r,l,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,l,a,s,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,a]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` `},c]}}const b6=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),E6=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],w6=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],v6=[...E6,...w6],x6=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xN=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),SN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),S6=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),k6=xN.concat(SN).sort().reverse();function C6(e){const t=b6(e),n=k6,r="and or not only",i="[\\w-]+",o="("+i+"|@\\{"+i+"\\})",s=[],l=[],a=function(E){return{className:"string",begin:"~?"+E+".*?"+E}},c=function(E,v,S){return{className:E,begin:v,relevance:S}},u={$pattern:/[a-z-]+/,keyword:r,attribute:x6.join(" ")},d={begin:"\\(",end:"\\)",contains:l,keywords:u,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const f=l.concat({begin:/\{/,end:/\}/,contains:s}),p={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+S6.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},m={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:u,returnEnd:!0,contains:l,relevance:0}},y={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:f}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+v6.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",o,0),c("selector-id","#"+o),c("selector-class","\\."+o,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+xN.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+SN.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:f},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[g]};return s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,m,y,b,h,g,p,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:s}}function _6(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function T6(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,a={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},u={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(c,{contains:[]}),f=e.inherit(u,{contains:[]});c.contains.push(f),u.contains.push(d);let p=[n,a];return[c,u,d,f].forEach(g=>{g.contains=g.contains.concat(p)}),p=p.concat(c,u),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:p},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:p}]}]},n,o,c,u,{className:"quote",begin:"^>\\s+",contains:p,end:"$"},i,r,a,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function O6(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},a={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+a.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:a,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function M6(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},s={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},a={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,o,a],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(m,y,g="\\1")=>{const b=g==="\\1"?g:t.concat(g,y);return t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,g,r)},p=(m,y,g)=>t.concat(t.concat("(?:",m,")"),y,/(?:\\.|[^\\\/])*?/,g,r),h=[a,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:u,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:f("s|tr|y",t.either(...d,{capture:!0}))},{begin:f("s|tr|y","\\(","\\)")},{begin:f("s|tr|y","\\[","\\]")},{begin:f("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...d,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=h,s.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:h}}function A6(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(V,Y)=>{Y.data._beginMatch=V[1]||V[2]},"on:end":(V,Y)=>{Y.data._beginMatch!==V[1]&&Y.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[ ]`,h={scope:"string",variants:[u,c,d,f]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},y=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:g,literal:(V=>{const Y=[];return V.forEach(D=>{Y.push(D),D.toLowerCase()===D?Y.push(D.toUpperCase()):Y.push(D.toLowerCase())}),Y})(y),built_in:b},S=V=>V.map(Y=>Y.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,t.concat(p,"+"),t.concat("(?!",S(b).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},_=t.concat(r,"\\b(?!\\()"),R={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},I={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},$={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[I,s,R,e.C_BLOCK_COMMENT_MODE,h,m,x]},j={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",S(g).join("\\b|"),"|",S(b).join("\\b|"),"\\b)"),r,t.concat(p,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[$]};$.contains.push(j);const F=[I,R,e.C_BLOCK_COMMENT_MODE,h,m,x],te={begin:t.concat(/#\[\s*\\?/,t.either(i,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:y,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:y,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:i},{match:o}]}]};return{case_insensitive:!1,keywords:v,contains:[te,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},s,j,R,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",te,s,R,e.C_BLOCK_COMMENT_MODE,h,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},h,m]}}function R6(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function I6(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function D6(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},a={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},u={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,u,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,u,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,u,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",p=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,h=`\\b|${r.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${p}))[eE][+-]?(${f})[jJ]?(?=${h})`},{begin:`(${p})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${f})[jJ](?=${h})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},g={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",a,m,d,e.HASH_COMMENT_MODE]}]};return c.contains=[d,m,a],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[a,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,g,d]}]}}function P6(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function L6(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function B6(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],u={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[e.BACKSLASH_ESCAPE,u],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,u]})]}]},f="[1-9](_?[0-9])*|0",p="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},x=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:s},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,u],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,c),relevance:0}].concat(a,c);u.contains=x,m.contains=x;const $=[{begin:/^\s*=>/,starts:{end:"$",contains:x}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:x}}];return c.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat($).concat(c).concat(x)}}function F6(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],a=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],u=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:u,keyword:l,literal:a,built_in:c},illegal:""},o]}}const z6=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),$6=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],U6=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],H6=[...$6,...U6],j6=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),V6=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),W6=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),K6=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function q6(e){const t=z6(e),n=W6,r=V6,i="@[a-z-]+",o="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+H6.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+K6.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:j6.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function G6(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Y6(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],a=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],u=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],p=u,h=[...c,...a].filter(S=>!u.includes(S)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},y={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},g={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function b(S){return t.concat(/\b/,t.either(...S.map(x=>x.replace(/\s+/,"\\s+"))),/\b/)}const E={scope:"keyword",match:b(f),relevance:0};function v(S,{exceptions:x,when:_}={}){const R=_;return x=x||[],S.map(I=>I.match(/\|\d+$/)||x.includes(I)?I:R(I)?`${I}|0`:I)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:v(h,{when:S=>S.length<3}),literal:o,type:l,built_in:d},contains:[{scope:"type",match:b(s)},E,g,m,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,y]}}function kN(e){return e?typeof e=="string"?e:e.source:null}function Bl(e){return _e("(?=",e,")")}function _e(...e){return e.map(n=>kN(n)).join("")}function Q6(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function zt(...e){return"("+(Q6(e).capture?"":"?:")+e.map(r=>kN(r)).join("|")+")"}const Nb=e=>_e(/\b/,e,/\w$/.test(e)?/\b/:/\B/),X6=["Protocol","Type"].map(Nb),ix=["init","self"].map(Nb),J6=["Any","Self"],kh=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ox=["false","nil","true"],Z6=["assignment","associativity","higherThan","left","lowerThan","none","right"],e9=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],sx=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],CN=zt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),_N=zt(CN,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ch=_e(CN,_N,"*"),TN=zt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Qd=zt(TN,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),ar=_e(TN,Qd,"*"),ru=_e(/[A-Z]/,Qd,"*"),t9=["attached","autoclosure",_e(/convention\(/,zt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",_e(/objc\(/,ar,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],n9=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function r9(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,zt(...X6,...ix)],className:{2:"keyword"}},o={match:_e(/\./,zt(...kh)),relevance:0},s=kh.filter(de=>typeof de=="string").concat(["_|0"]),l=kh.filter(de=>typeof de!="string").concat(J6).map(Nb),a={variants:[{className:"keyword",match:zt(...l,...ix)}]},c={$pattern:zt(/\b\w+/,/#\w+/),keyword:s.concat(e9),literal:ox},u=[i,o,a],d={match:_e(/\./,zt(...sx)),relevance:0},f={className:"built_in",match:_e(/\b/,zt(...sx),/(?=\()/)},p=[d,f],h={match:/->/,relevance:0},m={className:"operator",relevance:0,variants:[{match:Ch},{match:`\\.(\\.|${_N})+`}]},y=[h,m],g="([0-9]_*)+",b="([0-9a-fA-F]_*)+",E={className:"number",relevance:0,variants:[{match:`\\b(${g})(\\.(${g}))?([eE][+-]?(${g}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${g}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},v=(de="")=>({className:"subst",variants:[{match:_e(/\\/,de,/[0\\tnr"']/)},{match:_e(/\\/,de,/u\{[0-9a-fA-F]{1,8}\}/)}]}),S=(de="")=>({className:"subst",match:_e(/\\/,de,/[\t ]*(?:[\r\n]|\r\n)/)}),x=(de="")=>({className:"subst",label:"interpol",begin:_e(/\\/,de,/\(/),end:/\)/}),_=(de="")=>({begin:_e(de,/"""/),end:_e(/"""/,de),contains:[v(de),S(de),x(de)]}),R=(de="")=>({begin:_e(de,/"/),end:_e(/"/,de),contains:[v(de),x(de)]}),I={className:"string",variants:[_(),_("#"),_("##"),_("###"),R(),R("#"),R("##"),R("###")]},$=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],j={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:$},F=de=>{const an=_e(de,/\//),ne=_e(/\//,de);return{begin:an,end:ne,contains:[...$,{scope:"comment",begin:`#(?!.*${ne})`,end:/$/}]}},te={scope:"regexp",variants:[F("###"),F("##"),F("#"),j]},V={match:_e(/`/,ar,/`/)},Y={className:"variable",match:/\$\d+/},D={className:"variable",match:`\\$${Qd}+`},M=[V,Y,D],N={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:n9,contains:[...y,E,I]}]}},P={scope:"keyword",match:_e(/@/,zt(...t9),Bl(zt(/\(/,/\s+/)))},w={scope:"meta",match:_e(/@/,ar)},q=[N,P,w],J={match:Bl(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:_e(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Qd,"+")},{className:"type",match:ru,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:_e(/\s+&\s+/,Bl(ru)),relevance:0}]},C={begin://,keywords:c,contains:[...r,...u,...q,h,J]};J.contains.push(C);const ce={match:_e(ar,/\s*:/),keywords:"_|0",relevance:0},be={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ce,...r,te,...u,...p,...y,E,I,...M,...q,J]},ue={begin://,keywords:"repeat each",contains:[...r,J]},st={begin:zt(Bl(_e(ar,/\s*:/)),Bl(_e(ar,/\s+/,ar,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:ar}]},mt={begin:/\(/,end:/\)/,keywords:c,contains:[st,...r,...u,...y,E,I,...q,J,be],endsParent:!0,illegal:/["']/},ln={match:[/(func|macro)/,/\s+/,zt(V.match,ar,Ch)],className:{1:"keyword",3:"title.function"},contains:[ue,mt,t],illegal:[/\[/,/%/]},_n={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ue,mt,t],illegal:/\[|%/},ir={match:[/operator/,/\s+/,Ch],className:{1:"keyword",3:"title"}},eo={begin:[/precedencegroup/,/\s+/,ru],className:{1:"keyword",3:"title"},contains:[J],keywords:[...Z6,...ox],end:/}/},or={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Hn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},lt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,ar,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[ue,...u,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:ru},...u],relevance:0}]};for(const de of I.variants){const an=de.contains.find(oe=>oe.label==="interpol");an.keywords=c;const ne=[...u,...p,...y,E,I,...M];an.contains=[...ne,{begin:/\(/,end:/\)/,contains:["self",...ne]}]}return{name:"Swift",keywords:c,contains:[...r,ln,_n,or,Hn,lt,ir,eo,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},te,...u,...p,...y,E,I,...M,...q,J,be]}}const Xd="[A-Za-z$_][0-9A-Za-z$_]*",NN=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ON=["true","false","null","undefined","NaN","Infinity"],MN=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],AN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],RN=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],IN=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],DN=[].concat(RN,MN,AN);function i9(e){const t=e.regex,n=(N,{after:P})=>{const w="",end:""},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(N,P)=>{const w=N[0].length+N.index,q=N.input[w];if(q==="<"||q===","){P.ignoreMatch();return}q===">"&&(n(N,{after:w})||P.ignoreMatch());let J;const C=N.input.substring(w);if(J=C.match(/^\s*=/)){P.ignoreMatch();return}if((J=C.match(/^\s+extends\s+/))&&J.index===0){P.ignoreMatch();return}}},l={$pattern:Xd,keyword:NN,literal:ON,built_in:DN,"variable.language":IN},a="[0-9](_?[0-9])*",c=`\\.(${a})`,u="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${a})\\b`},{begin:`\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},p={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},E=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,m,y,{match:/\$\d+/},d];f.contains=E.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(E)});const v=[].concat(b,f.contains),S=v.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(v)}]),x={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S},_={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...MN,...AN]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},$={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[x],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(N){return t.concat("(?!",N.join("|"),")")}const te={match:t.concat(/\b/,F([...RN,"super","import"].map(N=>`${N}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Y={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},x]},D="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(D)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[x]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:S,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,m,y,b,{match:/\$\d+/},d,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:D,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:S}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:o},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},$,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[x]},te,j,_,Y,{match:/\$[(.]/}]}}function o9(e){const t=e.regex,n=i9(e),r=Xd,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:Xd,keyword:NN.concat(a),literal:ON,built_in:DN.concat(i),"variable.language":IN},u={className:"meta",begin:"@"+r},d=(m,y,g)=>{const b=m.contains.findIndex(E=>E.label===y);if(b===-1)throw new Error("can not find mode to replace");m.contains.splice(b,1,g)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(u);const f=n.contains.find(m=>m.scope==="attr"),p=Object.assign({},f,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,p]),n.contains=n.contains.concat([u,o,s,p]),d(n,"shebang",e.SHEBANG()),d(n,"use_strict",l);const h=n.contains.find(m=>m.label==="func.def");return h.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function s9(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,a={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,i),/ +/,t.either(s,l),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:"label",begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,a,c,u,d,f,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[f]}]}}function l9(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},a={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,i,e.QUOTE_STRING_MODE,a,c,l]}}function a9(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,a,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,a,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function c9(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},l=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},p={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},h={begin:/\{/,end:/\}/,contains:[p],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[p],illegal:"\\n",relevance:0},y=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},h,m,o,s],g=[...y];return g.pop(),g.push(l),p.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}const u9={arduino:WW,bash:KW,c:qW,cpp:GW,csharp:YW,css:i6,diff:o6,go:s6,graphql:l6,ini:a6,java:c6,javascript:h6,json:m6,kotlin:y6,less:C6,lua:_6,makefile:T6,markdown:N6,objectivec:O6,perl:M6,php:A6,"php-template":R6,plaintext:I6,python:D6,"python-repl":P6,r:L6,ruby:B6,rust:F6,scss:q6,shell:G6,sql:Y6,swift:r9,typescript:o9,vbnet:s9,wasm:l9,xml:a9,yaml:c9};function PN(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&PN(n)}),e}let lx=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function LN(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function Mi(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const i in r)n[i]=r[i]}),n}const d9="",ax=e=>!!e.scope,f9=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,i)=>`${r}${"_".repeat(i+1)}`)].join(" ")}return`${t}${e}`};class p9{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=LN(t)}openNode(t){if(!ax(t))return;const n=f9(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){ax(t)&&(this.buffer+=d9)}value(){return this.buffer}span(t){this.buffer+=``}}const cx=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Ob{constructor(){this.rootNode=cx(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=cx({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Ob._collapse(n)}))}}class h9 extends Ob{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new p9(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ya(e){return e?typeof e=="string"?e:e.source:null}function BN(e){return Qo("(?=",e,")")}function m9(e){return Qo("(?:",e,")*")}function g9(e){return Qo("(?:",e,")?")}function Qo(...e){return e.map(n=>Ya(n)).join("")}function y9(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Mb(...e){return"("+(y9(e).capture?"":"?:")+e.map(r=>Ya(r)).join("|")+")"}function FN(e){return new RegExp(e.toString()+"|").exec("").length-1}function b9(e,t){const n=e&&e.exec(t);return n&&n.index===0}const E9=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Ab(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const i=n;let o=Ya(r),s="";for(;o.length>0;){const l=E9.exec(o);if(!l){s+=o;break}s+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),l[0][0]==="\\"&&l[1]?s+="\\"+String(Number(l[1])+i):(s+=l[0],l[0]==="("&&n++)}return s}).map(r=>`(${r})`).join(t)}const w9=/\b\B/,zN="[a-zA-Z]\\w*",Rb="[a-zA-Z_]\\w*",$N="\\b\\d+(\\.\\d+)?",UN="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",HN="\\b(0b[01]+)",v9="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",x9=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Qo(t,/.*\b/,e.binary,/\b.*/)),Mi({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},Qa={begin:"\\\\[\\s\\S]",relevance:0},S9={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Qa]},k9={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Qa]},C9={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Qf=function(e,t,n={}){const r=Mi({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=Mb("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Qo(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},_9=Qf("//","$"),T9=Qf("/\\*","\\*/"),N9=Qf("#","$"),O9={scope:"number",begin:$N,relevance:0},M9={scope:"number",begin:UN,relevance:0},A9={scope:"number",begin:HN,relevance:0},R9={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Qa,{begin:/\[/,end:/\]/,relevance:0,contains:[Qa]}]},I9={scope:"title",begin:zN,relevance:0},D9={scope:"title",begin:Rb,relevance:0},P9={begin:"\\.\\s*"+Rb,relevance:0},L9=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var iu=Object.freeze({__proto__:null,APOS_STRING_MODE:S9,BACKSLASH_ESCAPE:Qa,BINARY_NUMBER_MODE:A9,BINARY_NUMBER_RE:HN,COMMENT:Qf,C_BLOCK_COMMENT_MODE:T9,C_LINE_COMMENT_MODE:_9,C_NUMBER_MODE:M9,C_NUMBER_RE:UN,END_SAME_AS_BEGIN:L9,HASH_COMMENT_MODE:N9,IDENT_RE:zN,MATCH_NOTHING_RE:w9,METHOD_GUARD:P9,NUMBER_MODE:O9,NUMBER_RE:$N,PHRASAL_WORDS_MODE:C9,QUOTE_STRING_MODE:k9,REGEXP_MODE:R9,RE_STARTERS_RE:v9,SHEBANG:x9,TITLE_MODE:I9,UNDERSCORE_IDENT_RE:Rb,UNDERSCORE_TITLE_MODE:D9});function B9(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function F9(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function z9(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=B9,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function $9(e,t){Array.isArray(e.illegal)&&(e.illegal=Mb(...e.illegal))}function U9(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function H9(e,t){e.relevance===void 0&&(e.relevance=1)}const j9=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=Qo(n.beforeMatch,BN(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},V9=["of","and","for","in","not","or","if","then","parent","list","value"],W9="keyword";function jN(e,t,n=W9){const r=Object.create(null);return typeof e=="string"?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(o){Object.assign(r,jN(e[o],t,o))}),r;function i(o,s){t&&(s=s.map(l=>l.toLowerCase())),s.forEach(function(l){const a=l.split("|");r[a[0]]=[o,K9(a[0],a[1])]})}}function K9(e,t){return t?Number(t):q9(e)?0:1}function q9(e){return V9.includes(e.toLowerCase())}const ux={},Mo=e=>{console.error(e)},dx=(e,...t)=>{console.log(`WARN: ${e}`,...t)},rs=(e,t)=>{ux[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ux[`${e}/${t}`]=!0)},Jd=new Error;function VN(e,t,{key:n}){let r=0;const i=e[n],o={},s={};for(let l=1;l<=t.length;l++)s[l+r]=i[l],o[l+r]=!0,r+=FN(t[l-1]);e[n]=s,e[n]._emit=o,e[n]._multi=!0}function G9(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Mo("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Jd;if(typeof e.beginScope!="object"||e.beginScope===null)throw Mo("beginScope must be object"),Jd;VN(e,e.begin,{key:"beginScope"}),e.begin=Ab(e.begin,{joinWith:""})}}function Y9(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Mo("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Jd;if(typeof e.endScope!="object"||e.endScope===null)throw Mo("endScope must be object"),Jd;VN(e,e.end,{key:"endScope"}),e.end=Ab(e.end,{joinWith:""})}}function Q9(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function X9(e){Q9(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),G9(e),Y9(e)}function J9(e){function t(s,l){return new RegExp(Ya(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(l?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(l,a){a.position=this.position++,this.matchIndexes[this.matchAt]=a,this.regexes.push([a,l]),this.matchAt+=FN(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(a=>a[1]);this.matcherRe=t(Ab(l,{joinWith:"|"}),!0),this.lastIndex=0}exec(l){this.matcherRe.lastIndex=this.lastIndex;const a=this.matcherRe.exec(l);if(!a)return null;const c=a.findIndex((d,f)=>f>0&&d!==void 0),u=this.matchIndexes[c];return a.splice(0,c),Object.assign(a,u)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(l){if(this.multiRegexes[l])return this.multiRegexes[l];const a=new n;return this.rules.slice(l).forEach(([c,u])=>a.addRule(c,u)),a.compile(),this.multiRegexes[l]=a,a}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(l,a){this.rules.push([l,a]),a.type==="begin"&&this.count++}exec(l){const a=this.getMatcher(this.regexIndex);a.lastIndex=this.lastIndex;let c=a.exec(l);if(this.resumingScanAtSamePosition()&&!(c&&c.index===this.lastIndex)){const u=this.getMatcher(0);u.lastIndex=this.lastIndex+1,c=u.exec(l)}return c&&(this.regexIndex+=c.position+1,this.regexIndex===this.count&&this.considerAll()),c}}function i(s){const l=new r;return s.contains.forEach(a=>l.addRule(a.begin,{rule:a,type:"begin"})),s.terminatorEnd&&l.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&l.addRule(s.illegal,{type:"illegal"}),l}function o(s,l){const a=s;if(s.isCompiled)return a;[F9,U9,X9,j9].forEach(u=>u(s,l)),e.compilerExtensions.forEach(u=>u(s,l)),s.__beforeBegin=null,[z9,$9,H9].forEach(u=>u(s,l)),s.isCompiled=!0;let c=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),c=s.keywords.$pattern,delete s.keywords.$pattern),c=c||/\w+/,s.keywords&&(s.keywords=jN(s.keywords,e.case_insensitive)),a.keywordPatternRe=t(c,!0),l&&(s.begin||(s.begin=/\B|\b/),a.beginRe=t(a.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(a.endRe=t(a.end)),a.terminatorEnd=Ya(a.end)||"",s.endsWithParent&&l.terminatorEnd&&(a.terminatorEnd+=(s.end?"|":"")+l.terminatorEnd)),s.illegal&&(a.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(u){return Z9(u==="self"?s:u)})),s.contains.forEach(function(u){o(u,a)}),s.starts&&o(s.starts,l),a.matcher=i(a),a}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Mi(e.classNameAliases||{}),o(e)}function WN(e){return e?e.endsWithParent||WN(e.starts):!1}function Z9(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Mi(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:WN(e)?Mi(e,{starts:e.starts?Mi(e.starts):null}):Object.isFrozen(e)?Mi(e):e}var eK="11.11.1";class tK extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const _h=LN,fx=Mi,px=Symbol("nomatch"),nK=7,KN=function(e){const t=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:h9};function a(D){return l.noHighlightRe.test(D)}function c(D){let M=D.className+" ";M+=D.parentNode?D.parentNode.className:"";const N=l.languageDetectRe.exec(M);if(N){const P=R(N[1]);return P||(dx(o.replace("{}",N[1])),dx("Falling back to no-highlight mode for this block.",D)),P?N[1]:"no-highlight"}return M.split(/\s+/).find(P=>a(P)||R(P))}function u(D,M,N){let P="",w="";typeof M=="object"?(P=D,N=M.ignoreIllegals,w=M.language):(rs("10.7.0","highlight(lang, code, ...args) has been deprecated."),rs("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),w=D,P=M),N===void 0&&(N=!0);const q={code:P,language:w};V("before:highlight",q);const J=q.result?q.result:d(q.language,q.code,N);return J.code=q.code,V("after:highlight",J),J}function d(D,M,N,P){const w=Object.create(null);function q(O,T){return O.keywords[T]}function J(){if(!ne.keywords){Fe.addText(ae);return}let O=0;ne.keywordPatternRe.lastIndex=0;let T=ne.keywordPatternRe.exec(ae),L="";for(;T;){L+=ae.substring(O,T.index);const H=lt.case_insensitive?T[0].toLowerCase():T[0],X=q(ne,H);if(X){const[Ee,nt]=X;if(Fe.addText(L),L="",w[H]=(w[H]||0)+1,w[H]<=nK&&(xe+=nt),Ee.startsWith("_"))L+=T[0];else{const un=lt.classNameAliases[Ee]||Ee;be(T[0],un)}}else L+=T[0];O=ne.keywordPatternRe.lastIndex,T=ne.keywordPatternRe.exec(ae)}L+=ae.substring(O),Fe.addText(L)}function C(){if(ae==="")return;let O=null;if(typeof ne.subLanguage=="string"){if(!t[ne.subLanguage]){Fe.addText(ae);return}O=d(ne.subLanguage,ae,!0,oe[ne.subLanguage]),oe[ne.subLanguage]=O._top}else O=p(ae,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(xe+=O.relevance),Fe.__addSublanguage(O._emitter,O.language)}function ce(){ne.subLanguage!=null?C():J(),ae=""}function be(O,T){O!==""&&(Fe.startScope(T),Fe.addText(O),Fe.endScope())}function ue(O,T){let L=1;const H=T.length-1;for(;L<=H;){if(!O._emit[L]){L++;continue}const X=lt.classNameAliases[O[L]]||O[L],Ee=T[L];X?be(Ee,X):(ae=Ee,J(),ae=""),L++}}function st(O,T){return O.scope&&typeof O.scope=="string"&&Fe.openNode(lt.classNameAliases[O.scope]||O.scope),O.beginScope&&(O.beginScope._wrap?(be(ae,lt.classNameAliases[O.beginScope._wrap]||O.beginScope._wrap),ae=""):O.beginScope._multi&&(ue(O.beginScope,T),ae="")),ne=Object.create(O,{parent:{value:ne}}),ne}function mt(O,T,L){let H=b9(O.endRe,L);if(H){if(O["on:end"]){const X=new lx(O);O["on:end"](T,X),X.isMatchIgnored&&(H=!1)}if(H){for(;O.endsParent&&O.parent;)O=O.parent;return O}}if(O.endsWithParent)return mt(O.parent,T,L)}function ln(O){return ne.matcher.regexIndex===0?(ae+=O[0],1):(Mr=!0,0)}function _n(O){const T=O[0],L=O.rule,H=new lx(L),X=[L.__beforeBegin,L["on:begin"]];for(const Ee of X)if(Ee&&(Ee(O,H),H.isMatchIgnored))return ln(T);return L.skip?ae+=T:(L.excludeBegin&&(ae+=T),ce(),!L.returnBegin&&!L.excludeBegin&&(ae=T)),st(L,O),L.returnBegin?0:T.length}function ir(O){const T=O[0],L=M.substring(O.index),H=mt(ne,O,L);if(!H)return px;const X=ne;ne.endScope&&ne.endScope._wrap?(ce(),be(T,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(ce(),ue(ne.endScope,O)):X.skip?ae+=T:(X.returnEnd||X.excludeEnd||(ae+=T),ce(),X.excludeEnd&&(ae=T));do ne.scope&&Fe.closeNode(),!ne.skip&&!ne.subLanguage&&(xe+=ne.relevance),ne=ne.parent;while(ne!==H.parent);return H.starts&&st(H.starts,O),X.returnEnd?0:T.length}function eo(){const O=[];for(let T=ne;T!==lt;T=T.parent)T.scope&&O.unshift(T.scope);O.forEach(T=>Fe.openNode(T))}let or={};function Hn(O,T){const L=T&&T[0];if(ae+=O,L==null)return ce(),0;if(or.type==="begin"&&T.type==="end"&&or.index===T.index&&L===""){if(ae+=M.slice(T.index,T.index+1),!i){const H=new Error(`0 width match regex (${D})`);throw H.languageName=D,H.badRule=or.rule,H}return 1}if(or=T,T.type==="begin")return _n(T);if(T.type==="illegal"&&!N){const H=new Error('Illegal lexeme "'+L+'" for mode "'+(ne.scope||"")+'"');throw H.mode=ne,H}else if(T.type==="end"){const H=ir(T);if(H!==px)return H}if(T.type==="illegal"&&L==="")return ae+=` `,1;if(cn>1e5&&cn>T.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ae+=L,L.length}const lt=R(D);if(!lt)throw Mo(o.replace("{}",D)),new Error('Unknown language: "'+D+'"');const de=J9(lt);let an="",ne=P||de;const oe={},Fe=new l.__emitter(l);eo();let ae="",xe=0,Gt=0,cn=0,Mr=!1;try{if(lt.__emitTokens)lt.__emitTokens(M,Fe);else{for(ne.matcher.considerAll();;){cn++,Mr?Mr=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=Gt;const O=ne.matcher.exec(M);if(!O)break;const T=M.substring(Gt,O.index),L=Hn(T,O);Gt=O.index+L}Hn(M.substring(Gt))}return Fe.finalize(),an=Fe.toHTML(),{language:D,value:an,relevance:xe,illegal:!1,_emitter:Fe,_top:ne}}catch(O){if(O.message&&O.message.includes("Illegal"))return{language:D,value:_h(M),illegal:!0,relevance:0,_illegalBy:{message:O.message,index:Gt,context:M.slice(Gt-100,Gt+100),mode:O.mode,resultSoFar:an},_emitter:Fe};if(i)return{language:D,value:_h(M),illegal:!1,relevance:0,errorRaised:O,_emitter:Fe,_top:ne};throw O}}function f(D){const M={value:_h(D),illegal:!1,relevance:0,_top:s,_emitter:new l.__emitter(l)};return M._emitter.addText(D),M}function p(D,M){M=M||l.languages||Object.keys(t);const N=f(D),P=M.filter(R).filter($).map(ce=>d(ce,D,!1));P.unshift(N);const w=P.sort((ce,be)=>{if(ce.relevance!==be.relevance)return be.relevance-ce.relevance;if(ce.language&&be.language){if(R(ce.language).supersetOf===be.language)return 1;if(R(be.language).supersetOf===ce.language)return-1}return 0}),[q,J]=w,C=q;return C.secondBest=J,C}function h(D,M,N){const P=M&&n[M]||N;D.classList.add("hljs"),D.classList.add(`language-${P}`)}function m(D){let M=null;const N=c(D);if(a(N))return;if(V("before:highlightElement",{el:D,language:N}),D.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",D);return}if(D.children.length>0&&(l.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(D)),l.throwUnescapedHTML))throw new tK("One of your code blocks includes unescaped HTML.",D.innerHTML);M=D;const P=M.textContent,w=N?u(P,{language:N,ignoreIllegals:!0}):p(P);D.innerHTML=w.value,D.dataset.highlighted="yes",h(D,N,w.language),D.result={language:w.language,re:w.relevance,relevance:w.relevance},w.secondBest&&(D.secondBest={language:w.secondBest.language,relevance:w.secondBest.relevance}),V("after:highlightElement",{el:D,result:w,text:P})}function y(D){l=fx(l,D)}const g=()=>{v(),rs("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){v(),rs("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let E=!1;function v(){function D(){v()}if(document.readyState==="loading"){E||window.addEventListener("DOMContentLoaded",D,!1),E=!0;return}document.querySelectorAll(l.cssSelector).forEach(m)}function S(D,M){let N=null;try{N=M(e)}catch(P){if(Mo("Language definition for '{}' could not be registered.".replace("{}",D)),i)Mo(P);else throw P;N=s}N.name||(N.name=D),t[D]=N,N.rawDefinition=M.bind(null,e),N.aliases&&I(N.aliases,{languageName:D})}function x(D){delete t[D];for(const M of Object.keys(n))n[M]===D&&delete n[M]}function _(){return Object.keys(t)}function R(D){return D=(D||"").toLowerCase(),t[D]||t[n[D]]}function I(D,{languageName:M}){typeof D=="string"&&(D=[D]),D.forEach(N=>{n[N.toLowerCase()]=M})}function $(D){const M=R(D);return M&&!M.disableAutodetect}function j(D){D["before:highlightBlock"]&&!D["before:highlightElement"]&&(D["before:highlightElement"]=M=>{D["before:highlightBlock"](Object.assign({block:M.el},M))}),D["after:highlightBlock"]&&!D["after:highlightElement"]&&(D["after:highlightElement"]=M=>{D["after:highlightBlock"](Object.assign({block:M.el},M))})}function F(D){j(D),r.push(D)}function te(D){const M=r.indexOf(D);M!==-1&&r.splice(M,1)}function V(D,M){const N=D;r.forEach(function(P){P[N]&&P[N](M)})}function Y(D){return rs("10.7.0","highlightBlock will be removed entirely in v12.0"),rs("10.7.0","Please use highlightElement now."),m(D)}Object.assign(e,{highlight:u,highlightAuto:p,highlightAll:v,highlightElement:m,highlightBlock:Y,configure:y,initHighlighting:g,initHighlightingOnLoad:b,registerLanguage:S,unregisterLanguage:x,listLanguages:_,getLanguage:R,registerAliases:I,autoDetection:$,inherit:fx,addPlugin:F,removePlugin:te}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=eK,e.regex={concat:Qo,lookahead:BN,either:Mb,optional:g9,anyNumberOfTimes:m9};for(const D in iu)typeof iu[D]=="object"&&PN(iu[D]);return Object.assign(e,iu),e},ll=KN({});ll.newInstance=()=>KN({});var rK=ll;ll.HighlightJS=ll;ll.default=ll;const iK=Za(rK),hx={},oK="hljs-";function sK(e){const t=iK.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:i,register:o,registerAlias:s,registered:l};function n(a,c,u){const d=u||hx,f=typeof d.prefix=="string"?d.prefix:oK;if(!t.getLanguage(a))throw new Error("Unknown language: `"+a+"` is not registered");t.configure({__emitter:lK,classPrefix:f});const p=t.highlight(c,{ignoreIllegals:!0,language:a});if(p.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:p.errorRaised});const h=p._emitter.root,m=h.data;return m.language=p.language,m.relevance=p.relevance,h}function r(a,c){const d=(c||hx).subset||i();let f=-1,p=0,h;for(;++fp&&(p=y.data.relevance,h=y)}return h||{type:"root",children:[],data:{language:void 0,relevance:p}}}function i(){return t.listLanguages()}function o(a,c){if(typeof a=="string")t.registerLanguage(a,c);else{let u;for(u in a)Object.hasOwn(a,u)&&t.registerLanguage(u,a[u])}}function s(a,c){if(typeof a=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:a});else{let u;for(u in a)if(Object.hasOwn(a,u)){const d=a[u];t.registerAliases(typeof d=="string"?d:[...d],{languageName:u})}}}function l(a){return!!t.getLanguage(a)}}class lK{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(s,l){return l?s+"_".repeat(l):n.options.classPrefix+s}),i=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const aK=sK(u9),cK=[u5.configure({bulletList:{HTMLAttributes:{class:"list-disc list-inside leading-normal"}},orderedList:{HTMLAttributes:{class:"list-decimal list-inside leading-normal"}},code:{HTMLAttributes:{class:"bg-red-900/20 rounded px-1"}},paragraph:{HTMLAttributes:{class:"leading-relaxed"}}}),d5,D5.configure({HTMLAttributes:{class:"text-red-300 underline hover:text-red-400"}}),L5.configure({HTMLAttributes:{class:"max-w-full rounded border border-red-900"}}),PT.configure({levels:[1,2,3]}),B5.configure({placeholder:"Begin typing your damned notes here..."}),$V.configure({resizable:!0,HTMLAttributes:{class:"border-collapse border border-red-900"}}),UV,HV.configure({HTMLAttributes:{class:"border border-red-900/50 p-2"}}),jV.configure({HTMLAttributes:{class:"border border-red-900 bg-red-900/20 p-2 font-bold"}}),jW.configure({lowlight:aK,HTMLAttributes:{class:"bg-red-900/10 p-4 rounded-sm font-mono text-sm"}})];function uK(){const e=cj({extensions:cK,content:"",editorProps:{attributes:{class:"prose prose-invert prose-red prose-sm max-w-none min-h-[200px] p-4 focus:outline-none text-red-400 [&_p]:my-1.5 [&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:mt-2 [&_h3]:mb-1 [&_ul]:my-2 [&_ol]:my-2 leading-relaxed"}}});if(!e)return null;const t=({onClick:n,active:r,disabled:i,children:o})=>k.jsx("button",{onClick:n,className:`windows-button ${r?"border-red-900":""} ${i?"opacity-50 cursor-not-allowed":""} text-xs px-1.5 py-0.5`,disabled:i,type:"button",children:o});return k.jsxs("div",{className:"h-full bg-black flex flex-col",children:[k.jsxs("div",{className:"border-b border-red-900 p-0.5 flex flex-wrap gap-0.5",children:[k.jsxs("div",{className:"flex gap-0.5 border-r border-red-900/50 pr-0.5",children:[k.jsx(t,{onClick:()=>e.chain().focus().toggleHeading({level:1}).run(),active:e.isActive("heading",{level:1}),children:"H1"}),k.jsx(t,{onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),active:e.isActive("heading",{level:2}),children:"H2"}),k.jsx(t,{onClick:()=>e.chain().focus().toggleBold().run(),active:e.isActive("bold"),children:"B"}),k.jsx(t,{onClick:()=>e.chain().focus().toggleItalic().run(),active:e.isActive("italic"),children:"I"}),k.jsx(t,{onClick:()=>e.chain().focus().toggleUnderline().run(),active:e.isActive("underline"),children:"U"})]}),k.jsxs("div",{className:"flex gap-0.5 border-r border-red-900/50 pr-0.5",children:[k.jsx(t,{onClick:()=>e.chain().focus().toggleBulletList().run(),active:e.isActive("bulletList"),children:"•"}),k.jsx(t,{onClick:()=>e.chain().focus().toggleOrderedList().run(),active:e.isActive("orderedList"),children:"1."})]}),k.jsxs("div",{className:"flex gap-0.5 border-r border-red-900/50 pr-0.5",children:[k.jsx(t,{onClick:()=>{const n=window.prompt("Enter URL:");n&&e.chain().focus().setLink({href:n}).run()},children:"Link"}),k.jsx(t,{onClick:()=>{const n=window.prompt("Enter image URL:");n&&e.chain().focus().setImage({src:n}).run()},children:"Img"})]}),k.jsx("div",{className:"flex gap-0.5 border-r border-red-900/50 pr-0.5",children:k.jsx(t,{onClick:()=>e.chain().focus().toggleCodeBlock().run(),active:e.isActive("codeBlock"),children:"Code"})}),k.jsxs("div",{className:"flex gap-0.5",children:[k.jsx(t,{onClick:()=>e.chain().focus().insertTable({rows:3,cols:3}).run(),children:"Tbl"}),k.jsx(t,{onClick:()=>e.chain().focus().addColumnBefore().run(),disabled:!e.can().addColumnBefore(),children:"+Col"}),k.jsx(t,{onClick:()=>e.chain().focus().addRowBefore().run(),disabled:!e.can().addRowBefore(),children:"+Row"}),k.jsx(t,{onClick:()=>e.chain().focus().deleteTable().run(),disabled:!e.can().deleteTable(),children:"Del"})]})]}),k.jsx("div",{className:"flex-1 overflow-auto bg-black",children:k.jsx(JH,{editor:e,className:"h-full"})})]})}function dK({label:e,icon:t,url:n}){const r=()=>{window.open(n,"_blank")};return k.jsxs("button",{onClick:r,className:"flex flex-col items-center w-20 sm:w-24 p-2 rounded hover:bg-red-900/20 focus:outline-none group touch-manipulation",children:[k.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 mb-1 border-2 border-red-900 overflow-hidden",children:k.jsx("img",{src:t,alt:e,className:"w-full h-full object-cover",loading:"lazy"})}),k.jsx("span",{className:"text-red-400 text-xs sm:text-sm text-center break-words w-full",children:e})]})}function fK(){const e=A.useRef(null);A.useState(null);const[t,n]=A.useState(!0),[r,i]=A.useState(null);return A.useEffect(()=>{if(e.current)try{const o=document.createElement("iframe");o.src="https://js-dos.com/DOOM/",o.style.width="100%",o.style.height="100%",o.style.border="none",o.allow="fullscreen",o.onload=()=>{n(!1)},o.onerror=()=>{i("Failed to load Doom. Check your internet connection."),n(!1)},e.current.appendChild(o);const s=setTimeout(()=>{t&&n(!1)},1e4);return()=>{if(clearTimeout(s),e.current){const l=e.current.querySelector("iframe");l&&e.current.removeChild(l)}}}catch(o){console.error("Error initializing Doom:",o),i("Failed to initialize Doom."),n(!1)}},[t]),k.jsx("div",{className:"h-full flex flex-col",children:k.jsxs("div",{className:"flex-1 bg-black p-2 overflow-hidden flex flex-col",children:[t&&k.jsx("div",{className:"flex-1 flex items-center justify-center text-red-500",children:k.jsxs("div",{className:"text-center",children:[k.jsx("div",{className:"animate-pulse text-xl mb-2",children:"Loading DOOM..."}),k.jsx("div",{className:"text-sm",children:"Preparing your journey to hell..."})]})}),r&&k.jsx("div",{className:"flex-1 flex items-center justify-center text-red-500",children:k.jsxs("div",{className:"text-center",children:[k.jsx("div",{className:"text-xl mb-2",children:"Error"}),k.jsx("div",{className:"text-sm",children:r})]})}),k.jsx("div",{id:"doom-container",ref:e,className:`flex-1 flex items-center justify-center ${t||r?"opacity-0":"opacity-100"}`,style:{minHeight:"300px",transition:"opacity 0.5s ease"}}),k.jsxs("div",{className:"mt-2 text-red-500 text-xs doom-controls",children:[k.jsx("div",{className:"flex justify-between items-center mb-2",children:k.jsx("span",{className:"font-bold",children:"DOOM Controls"})}),k.jsxs("div",{className:"grid grid-cols-2 gap-x-4",children:[k.jsxs("div",{children:[k.jsx("p",{children:"- Move: UP, DOWN, LEFT, RIGHT"}),k.jsx("p",{children:"- Use: W"}),k.jsx("p",{children:"- Fire: S"})]}),k.jsxs("div",{children:[k.jsx("p",{children:"- Speed on: SPACE"}),k.jsx("p",{children:"- Strafe on: ALT"}),k.jsx("p",{children:"- Strafe: A, D"})]})]})]})]})})}const pK=[{label:"@nonbIesse",icon:"/icons/laBGtPESCKBpVLeg94KbwUs8PmPyLjSi8xGaKGaODv0IKTL9LYQtiF9rFyWGUKMRaD-2_JnMdwAB6v-LmF4-hkxP8nYBjG9InpV4DWqr7bqdd7igwlWsMFPkWg8nD8eHCVrsiFSS0rrrysYxrNEKb1VjH_Odo9Z4q01MV-LELMWLdQPGH9eJetqrV5QX7lxazi2JixP3NKw1d-blrCjn0-_cG6Dy4xYbELRO8HdF5vkgEGQq-G-sD2nFsQ.jpg",url:"https://t.me/nonbIesse"},{label:"@Ey3zzzz",icon:"icons/photo_2025-01-31_02-11-08.jpg",url:"https://t.me/Ey3zzzz"},{label:"@TreeNixxx",icon:"icons/photo_2025-01-31_19-33-00.jpg",url:"https://t.me/TreeNixxx"},{label:"ơʂìղէìմʂ",icon:"icons/photo_2025-02-01_15-30-53.jpg",url:"https://t.me/+POdMf0guHLw4MTA0"},{label:"Prequel",icon:"icons/I am serny. i ruin things.png",url:"https://t.me/presequel"}];function hK(){const[e,t]=A.useState(!1),[n,r]=A.useState([]),[i,o]=A.useState(!1),[s,l]=A.useState(!0);A.useEffect(()=>{const f=()=>{const p=window.innerWidth<=768;t(p),p||r([{id:"terminal-default",type:"terminal",title:"Hell Command Prompt",active:!0,position:{x:100,y:100}}])};return f(),window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]),A.useEffect(()=>{const f=p=>(p.preventDefault(),!1);return document.addEventListener("contextmenu",f),()=>{document.removeEventListener("contextmenu",f)}},[]),A.useEffect(()=>{const f=setInterval(()=>{Math.random()<.1&&o(!0)},3e4);return()=>clearInterval(f)},[]);const a=f=>{r(n.map(p=>({...p,active:p.id===f,minimized:p.id===f?!1:p.minimized})))},c=f=>{r(n.map(p=>({...p,minimized:p.id===f?!0:p.minimized})))},u=f=>{const p={terminal:"Hell Command Prompt",explorer:"Soul Explorer",notepad:"Damned Notepad",settings:"Hell Settings",webscraper:"Web Soul Scraper",browser:"Hell Browser",noveleditor:"Novel Editor of Doom",doom:"DOOM"},h=Math.max(50,(window.innerWidth-300)/2),m=Math.max(50,(window.innerHeight-400)/2),y={id:`${f}-${Date.now()}`,type:f,title:p[f],active:!0,position:{x:h,y:m}};r(n.map(g=>({...g,active:!1})).concat(y))},d=f=>{r(p=>p.filter(h=>h.id!==f))};return s?k.jsx(Kz,{onComplete:()=>l(!1)}):k.jsxs("div",{className:"h-screen w-screen overflow-hidden crt touch-manipulation",onContextMenu:f=>f.preventDefault(),children:[k.jsx("div",{className:"animated-wallpaper"}),k.jsx(jz,{}),k.jsx("div",{className:"absolute top-2 sm:top-4 left-2 sm:left-4 grid grid-cols-3 sm:grid-cols-1 gap-2 sm:gap-4 p-2",children:pK.map(f=>k.jsx(dK,{label:f.label,icon:f.icon,url:f.url},f.url))}),n.map(f=>k.jsxs(ND,{window:f,onClose:()=>d(f.id),onClick:()=>a(f.id),onMinimize:()=>c(f.id),children:[f.type==="terminal"&&k.jsx(AD,{}),f.type==="explorer"&&k.jsx(DD,{}),f.type==="notepad"&&k.jsx(PD,{}),f.type==="settings"&&k.jsx(LD,{}),f.type==="webscraper"&&k.jsx($z,{}),f.type==="browser"&&k.jsx(Uz,{}),f.type==="noveleditor"&&k.jsx(uK,{}),f.type==="doom"&&k.jsx(fK,{})]},f.id)),k.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50",children:k.jsx(BI,{windows:n,onWindowClick:a,onCreateWindow:u})}),i&&k.jsx(Hz,{onClose:()=>o(!1)})]})}function mK(){return k.jsx(hK,{})}L1(document.getElementById("root")).render(k.jsx(A.StrictMode,{children:k.jsxs(HA,{client:jA,children:[k.jsx(mK,{}),k.jsx(DI,{})]})}));