vzcode 0.52.0 → 0.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,147 +0,0 @@
1
- function ZA(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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 Yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var X_={exports:{}},Xp={},Y_={exports:{}},Et={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Jc=Symbol.for("react.element"),WA=Symbol.for("react.portal"),BA=Symbol.for("react.fragment"),XA=Symbol.for("react.strict_mode"),YA=Symbol.for("react.profiler"),UA=Symbol.for("react.provider"),FA=Symbol.for("react.context"),qA=Symbol.for("react.forward_ref"),zA=Symbol.for("react.suspense"),VA=Symbol.for("react.memo"),GA=Symbol.for("react.lazy"),y1=Symbol.iterator;function HA(t){return t===null||typeof t!="object"?null:(t=y1&&t[y1]||t["@@iterator"],typeof t=="function"?t:null)}var U_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F_=Object.assign,q_={};function Ga(t,e,n){this.props=t,this.context=e,this.refs=q_,this.updater=n||U_}Ga.prototype.isReactComponent={};Ga.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Ga.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function z_(){}z_.prototype=Ga.prototype;function cy(t,e,n){this.props=t,this.context=e,this.refs=q_,this.updater=n||U_}var fy=cy.prototype=new z_;fy.constructor=cy;F_(fy,Ga.prototype);fy.isPureReactComponent=!0;var S1=Array.isArray,V_=Object.prototype.hasOwnProperty,hy={current:null},G_={key:!0,ref:!0,__self:!0,__source:!0};function H_(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)V_.call(e,r)&&!G_.hasOwnProperty(r)&&(i[r]=e[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];i.children=a}if(t&&t.defaultProps)for(r in l=t.defaultProps,l)i[r]===void 0&&(i[r]=l[r]);return{$$typeof:Jc,type:t,key:o,ref:s,props:i,_owner:hy.current}}function KA(t,e){return{$$typeof:Jc,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function dy(t){return typeof t=="object"&&t!==null&&t.$$typeof===Jc}function JA(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var b1=/\/+/g;function _g(t,e){return typeof t=="object"&&t!==null&&t.key!=null?JA(""+t.key):e.toString(36)}function hd(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Jc:case WA:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+_g(s,0):r,S1(i)?(n="",t!=null&&(n=t.replace(b1,"$&/")+"/"),hd(i,e,n,"",function(u){return u})):i!=null&&(dy(i)&&(i=KA(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(b1,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",S1(t))for(var l=0;l<t.length;l++){o=t[l];var a=r+_g(o,l);s+=hd(o,e,n,a,i)}else if(a=HA(t),typeof a=="function")for(t=a.call(t),l=0;!(o=t.next()).done;)o=o.value,a=r+_g(o,l++),s+=hd(o,e,n,a,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function Tf(t,e,n){if(t==null)return t;var r=[],i=0;return hd(t,r,"","",function(o){return e.call(n,o,i++)}),r}function e2(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Er={current:null},dd={transition:null},t2={ReactCurrentDispatcher:Er,ReactCurrentBatchConfig:dd,ReactCurrentOwner:hy};Et.Children={map:Tf,forEach:function(t,e,n){Tf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Tf(t,function(){e++}),e},toArray:function(t){return Tf(t,function(e){return e})||[]},only:function(t){if(!dy(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Et.Component=Ga;Et.Fragment=BA;Et.Profiler=YA;Et.PureComponent=cy;Et.StrictMode=XA;Et.Suspense=zA;Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t2;Et.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=F_({},t.props),i=t.key,o=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=hy.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(a in e)V_.call(e,a)&&!G_.hasOwnProperty(a)&&(r[a]=e[a]===void 0&&l!==void 0?l[a]:e[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Jc,type:t.type,key:i,ref:o,props:r,_owner:s}};Et.createContext=function(t){return t={$$typeof:FA,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:UA,_context:t},t.Consumer=t};Et.createElement=H_;Et.createFactory=function(t){var e=H_.bind(null,t);return e.type=t,e};Et.createRef=function(){return{current:null}};Et.forwardRef=function(t){return{$$typeof:qA,render:t}};Et.isValidElement=dy;Et.lazy=function(t){return{$$typeof:GA,_payload:{_status:-1,_result:t},_init:e2}};Et.memo=function(t,e){return{$$typeof:VA,type:t,compare:e===void 0?null:e}};Et.startTransition=function(t){var e=dd.transition;dd.transition={};try{t()}finally{dd.transition=e}};Et.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Et.useCallback=function(t,e){return Er.current.useCallback(t,e)};Et.useContext=function(t){return Er.current.useContext(t)};Et.useDebugValue=function(){};Et.useDeferredValue=function(t){return Er.current.useDeferredValue(t)};Et.useEffect=function(t,e){return Er.current.useEffect(t,e)};Et.useId=function(){return Er.current.useId()};Et.useImperativeHandle=function(t,e,n){return Er.current.useImperativeHandle(t,e,n)};Et.useInsertionEffect=function(t,e){return Er.current.useInsertionEffect(t,e)};Et.useLayoutEffect=function(t,e){return Er.current.useLayoutEffect(t,e)};Et.useMemo=function(t,e){return Er.current.useMemo(t,e)};Et.useReducer=function(t,e,n){return Er.current.useReducer(t,e,n)};Et.useRef=function(t){return Er.current.useRef(t)};Et.useState=function(t){return Er.current.useState(t)};Et.useSyncExternalStore=function(t,e,n){return Er.current.useSyncExternalStore(t,e,n)};Et.useTransition=function(){return Er.current.useTransition()};Et.version="18.2.0";Y_.exports=Et;var Z=Y_.exports;const Qi=vi(Z),n2=ZA({__proto__:null,default:Qi},[Z]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var r2=Z,i2=Symbol.for("react.element"),o2=Symbol.for("react.fragment"),s2=Object.prototype.hasOwnProperty,l2=r2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a2={key:!0,ref:!0,__self:!0,__source:!0};function K_(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)s2.call(e,r)&&!a2.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:i2,type:t,key:o,ref:s,props:i,_owner:l2.current}}Xp.Fragment=o2;Xp.jsx=K_;Xp.jsxs=K_;X_.exports=Xp;var ee=X_.exports,J_={exports:{}},ei={},eP={exports:{}},tP={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(t){function e(N,Y){var q=N.length;N.push(Y);e:for(;0<q;){var ae=q-1>>>1,pe=N[ae];if(0<i(pe,Y))N[ae]=Y,N[q]=pe,q=ae;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var Y=N[0],q=N.pop();if(q!==Y){N[0]=q;e:for(var ae=0,pe=N.length,U=pe>>>1;ae<U;){var H=2*(ae+1)-1,se=N[H],Ie=H+1,F=N[Ie];if(0>i(se,q))Ie<pe&&0>i(F,se)?(N[ae]=F,N[Ie]=q,ae=Ie):(N[ae]=se,N[H]=q,ae=H);else if(Ie<pe&&0>i(F,q))N[ae]=F,N[Ie]=q,ae=Ie;else break e}}return Y}function i(N,Y){var q=N.sortIndex-Y.sortIndex;return q!==0?q:N.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,f=null,h=3,d=!1,p=!1,g=!1,O=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(N){for(var Y=n(u);Y!==null;){if(Y.callback===null)r(u);else if(Y.startTime<=N)r(u),Y.sortIndex=Y.expirationTime,e(a,Y);else break;Y=n(u)}}function S(N){if(g=!1,y(N),!p)if(n(a)!==null)p=!0,M(k);else{var Y=n(u);Y!==null&&L(S,Y.startTime-N)}}function k(N,Y){p=!1,g&&(g=!1,v(w),w=-1),d=!0;var q=h;try{for(y(Y),f=n(a);f!==null&&(!(f.expirationTime>Y)||N&&!E());){var ae=f.callback;if(typeof ae=="function"){f.callback=null,h=f.priorityLevel;var pe=ae(f.expirationTime<=Y);Y=t.unstable_now(),typeof pe=="function"?f.callback=pe:f===n(a)&&r(a),y(Y)}else r(a);f=n(a)}if(f!==null)var U=!0;else{var H=n(u);H!==null&&L(S,H.startTime-Y),U=!1}return U}finally{f=null,h=q,d=!1}}var P=!1,C=null,w=-1,x=5,_=-1;function E(){return!(t.unstable_now()-_<x)}function $(){if(C!==null){var N=t.unstable_now();_=N;var Y=!0;try{Y=C(!0,N)}finally{Y?j():(P=!1,C=null)}}else P=!1}var j;if(typeof m=="function")j=function(){m($)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,G=W.port2;W.port1.onmessage=$,j=function(){G.postMessage(null)}}else j=function(){O($,0)};function M(N){C=N,P||(P=!0,j())}function L(N,Y){w=O(function(){N(t.unstable_now())},Y)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(N){N.callback=null},t.unstable_continueExecution=function(){p||d||(p=!0,M(k))},t.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):x=0<N?Math.floor(1e3/N):5},t.unstable_getCurrentPriorityLevel=function(){return h},t.unstable_getFirstCallbackNode=function(){return n(a)},t.unstable_next=function(N){switch(h){case 1:case 2:case 3:var Y=3;break;default:Y=h}var q=h;h=Y;try{return N()}finally{h=q}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(N,Y){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var q=h;h=N;try{return Y()}finally{h=q}},t.unstable_scheduleCallback=function(N,Y,q){var ae=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?ae+q:ae):q=ae,N){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=q+pe,N={id:c++,callback:Y,priorityLevel:N,startTime:q,expirationTime:pe,sortIndex:-1},q>ae?(N.sortIndex=q,e(u,N),n(a)===null&&N===n(u)&&(g?(v(w),w=-1):g=!0,L(S,q-ae))):(N.sortIndex=pe,e(a,N),p||d||(p=!0,M(k))),N},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(N){var Y=h;return function(){var q=h;h=Y;try{return N.apply(this,arguments)}finally{h=q}}}})(tP);eP.exports=tP;var u2=eP.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var nP=Z,Jr=u2;function Oe(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var rP=new Set,pc={};function yl(t,e){$a(t,e),$a(t+"Capture",e)}function $a(t,e){for(pc[t]=e,t=0;t<e.length;t++)rP.add(e[t])}var Co=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gm=Object.prototype.hasOwnProperty,c2=/^[: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]*$/,w1={},k1={};function f2(t){return Gm.call(k1,t)?!0:Gm.call(w1,t)?!1:c2.test(t)?k1[t]=!0:(w1[t]=!0,!1)}function h2(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function d2(t,e,n,r){if(e===null||typeof e>"u"||h2(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Tr(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var ar={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ar[t]=new Tr(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ar[e]=new Tr(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ar[t]=new Tr(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ar[t]=new Tr(t,2,!1,t,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(t){ar[t]=new Tr(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ar[t]=new Tr(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ar[t]=new Tr(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ar[t]=new Tr(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ar[t]=new Tr(t,5,!1,t.toLowerCase(),null,!1,!1)});var py=/[\-:]([a-z])/g;function gy(t){return t[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(t){var e=t.replace(py,gy);ar[e]=new Tr(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(py,gy);ar[e]=new Tr(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(py,gy);ar[e]=new Tr(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ar[t]=new Tr(t,1,!1,t.toLowerCase(),null,!1,!1)});ar.xlinkHref=new Tr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ar[t]=new Tr(t,1,!1,t.toLowerCase(),null,!0,!0)});function my(t,e,n,r){var i=ar.hasOwnProperty(e)?ar[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(d2(e,n,i,r)&&(n=null),r||i===null?f2(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var Mo=nP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$f=Symbol.for("react.element"),Jl=Symbol.for("react.portal"),ea=Symbol.for("react.fragment"),Oy=Symbol.for("react.strict_mode"),Hm=Symbol.for("react.profiler"),iP=Symbol.for("react.provider"),oP=Symbol.for("react.context"),vy=Symbol.for("react.forward_ref"),Km=Symbol.for("react.suspense"),Jm=Symbol.for("react.suspense_list"),yy=Symbol.for("react.memo"),Bo=Symbol.for("react.lazy"),sP=Symbol.for("react.offscreen"),x1=Symbol.iterator;function hu(t){return t===null||typeof t!="object"?null:(t=x1&&t[x1]||t["@@iterator"],typeof t=="function"?t:null)}var wn=Object.assign,Pg;function Lu(t){if(Pg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Pg=e&&e[1]||""}return`
34
- `+Pg+t}var Cg=!1;function Eg(t,e){if(!t||Cg)return"";Cg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var r=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){r=u}t.call(e.prototype)}else{try{throw Error()}catch(u){r=u}t()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
- `),o=r.stack.split(`
36
- `),s=i.length-1,l=o.length-1;1<=s&&0<=l&&i[s]!==o[l];)l--;for(;1<=s&&0<=l;s--,l--)if(i[s]!==o[l]){if(s!==1||l!==1)do if(s--,l--,0>l||i[s]!==o[l]){var a=`
37
- `+i[s].replace(" at new "," at ");return t.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",t.displayName)),a}while(1<=s&&0<=l);break}}}finally{Cg=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Lu(t):""}function p2(t){switch(t.tag){case 5:return Lu(t.type);case 16:return Lu("Lazy");case 13:return Lu("Suspense");case 19:return Lu("SuspenseList");case 0:case 2:case 15:return t=Eg(t.type,!1),t;case 11:return t=Eg(t.type.render,!1),t;case 1:return t=Eg(t.type,!0),t;default:return""}}function eO(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case ea:return"Fragment";case Jl:return"Portal";case Hm:return"Profiler";case Oy:return"StrictMode";case Km:return"Suspense";case Jm:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case oP:return(t.displayName||"Context")+".Consumer";case iP:return(t._context.displayName||"Context")+".Provider";case vy:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case yy:return e=t.displayName||null,e!==null?e:eO(t.type)||"Memo";case Bo:e=t._payload,t=t._init;try{return eO(t(e))}catch{}}return null}function g2(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return eO(e);case 8:return e===Oy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ms(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function lP(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function m2(t){var e=lP(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Rf(t){t._valueTracker||(t._valueTracker=m2(t))}function aP(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=lP(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Zd(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function tO(t,e){var n=e.checked;return wn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function _1(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=ms(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function uP(t,e){e=e.checked,e!=null&&my(t,"checked",e,!1)}function nO(t,e){uP(t,e);var n=ms(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?rO(t,e.type,n):e.hasOwnProperty("defaultValue")&&rO(t,e.type,ms(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function P1(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function rO(t,e,n){(e!=="number"||Zd(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Zu=Array.isArray;function pa(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+ms(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function iO(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(Oe(91));return wn({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function C1(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(Oe(92));if(Zu(n)){if(1<n.length)throw Error(Oe(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:ms(n)}}function cP(t,e){var n=ms(e.value),r=ms(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function E1(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function fP(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function oO(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?fP(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Qf,hP=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Qf=Qf||document.createElement("div"),Qf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Qf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function gc(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Hu={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},O2=["Webkit","ms","Moz","O"];Object.keys(Hu).forEach(function(t){O2.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Hu[e]=Hu[t]})});function dP(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Hu.hasOwnProperty(t)&&Hu[t]?(""+e).trim():e+"px"}function pP(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=dP(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var v2=wn({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 sO(t,e){if(e){if(v2[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Oe(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Oe(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Oe(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Oe(62))}}function lO(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 aO=null;function Sy(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var uO=null,ga=null,ma=null;function T1(t){if(t=nf(t)){if(typeof uO!="function")throw Error(Oe(280));var e=t.stateNode;e&&(e=zp(e),uO(t.stateNode,t.type,e))}}function gP(t){ga?ma?ma.push(t):ma=[t]:ga=t}function mP(){if(ga){var t=ga,e=ma;if(ma=ga=null,T1(t),e)for(t=0;t<e.length;t++)T1(e[t])}}function OP(t,e){return t(e)}function vP(){}var Tg=!1;function yP(t,e,n){if(Tg)return t(e,n);Tg=!0;try{return OP(t,e,n)}finally{Tg=!1,(ga!==null||ma!==null)&&(vP(),mP())}}function mc(t,e){var n=t.stateNode;if(n===null)return null;var r=zp(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(Oe(231,e,typeof n));return n}var cO=!1;if(Co)try{var du={};Object.defineProperty(du,"passive",{get:function(){cO=!0}}),window.addEventListener("test",du,du),window.removeEventListener("test",du,du)}catch{cO=!1}function y2(t,e,n,r,i,o,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{e.apply(n,u)}catch(c){this.onError(c)}}var Ku=!1,Wd=null,Bd=!1,fO=null,S2={onError:function(t){Ku=!0,Wd=t}};function b2(t,e,n,r,i,o,s,l,a){Ku=!1,Wd=null,y2.apply(S2,arguments)}function w2(t,e,n,r,i,o,s,l,a){if(b2.apply(this,arguments),Ku){if(Ku){var u=Wd;Ku=!1,Wd=null}else throw Error(Oe(198));Bd||(Bd=!0,fO=u)}}function Sl(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function SP(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function $1(t){if(Sl(t)!==t)throw Error(Oe(188))}function k2(t){var e=t.alternate;if(!e){if(e=Sl(t),e===null)throw Error(Oe(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return $1(i),t;if(o===r)return $1(i),e;o=o.sibling}throw Error(Oe(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s)throw Error(Oe(189))}}if(n.alternate!==r)throw Error(Oe(190))}if(n.tag!==3)throw Error(Oe(188));return n.stateNode.current===n?t:e}function bP(t){return t=k2(t),t!==null?wP(t):null}function wP(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=wP(t);if(e!==null)return e;t=t.sibling}return null}var kP=Jr.unstable_scheduleCallback,R1=Jr.unstable_cancelCallback,x2=Jr.unstable_shouldYield,_2=Jr.unstable_requestPaint,Rn=Jr.unstable_now,P2=Jr.unstable_getCurrentPriorityLevel,by=Jr.unstable_ImmediatePriority,xP=Jr.unstable_UserBlockingPriority,Xd=Jr.unstable_NormalPriority,C2=Jr.unstable_LowPriority,_P=Jr.unstable_IdlePriority,Yp=null,so=null;function E2(t){if(so&&typeof so.onCommitFiberRoot=="function")try{so.onCommitFiberRoot(Yp,t,void 0,(t.current.flags&128)===128)}catch{}}var Ai=Math.clz32?Math.clz32:R2,T2=Math.log,$2=Math.LN2;function R2(t){return t>>>=0,t===0?32:31-(T2(t)/$2|0)|0}var Af=64,Mf=4194304;function Wu(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Yd(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Wu(l):(o&=s,o!==0&&(r=Wu(o)))}else s=n&~i,s!==0?r=Wu(s):o!==0&&(r=Wu(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Ai(e),i=1<<n,r|=t[n],e&=~i;return r}function Q2(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function A2(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var s=31-Ai(o),l=1<<s,a=i[s];a===-1?(!(l&n)||l&r)&&(i[s]=Q2(l,e)):a<=e&&(t.expiredLanes|=l),o&=~l}}function hO(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function PP(){var t=Af;return Af<<=1,!(Af&4194240)&&(Af=64),t}function $g(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ef(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ai(e),t[e]=n}function M2(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Ai(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function wy(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Ai(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var Gt=0;function CP(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var EP,ky,TP,$P,RP,dO=!1,Df=[],os=null,ss=null,ls=null,Oc=new Map,vc=new Map,zo=[],D2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Q1(t,e){switch(t){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":ss=null;break;case"mouseover":case"mouseout":ls=null;break;case"pointerover":case"pointerout":Oc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":vc.delete(e.pointerId)}}function pu(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=nf(e),e!==null&&ky(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function N2(t,e,n,r,i){switch(e){case"focusin":return os=pu(os,t,e,n,r,i),!0;case"dragenter":return ss=pu(ss,t,e,n,r,i),!0;case"mouseover":return ls=pu(ls,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Oc.set(o,pu(Oc.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,vc.set(o,pu(vc.get(o)||null,t,e,n,r,i)),!0}return!1}function QP(t){var e=Hs(t.target);if(e!==null){var n=Sl(e);if(n!==null){if(e=n.tag,e===13){if(e=SP(n),e!==null){t.blockedOn=e,RP(t.priority,function(){TP(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function pd(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=pO(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);aO=r,n.target.dispatchEvent(r),aO=null}else return e=nf(n),e!==null&&ky(e),t.blockedOn=n,!1;e.shift()}return!0}function A1(t,e,n){pd(t)&&n.delete(e)}function j2(){dO=!1,os!==null&&pd(os)&&(os=null),ss!==null&&pd(ss)&&(ss=null),ls!==null&&pd(ls)&&(ls=null),Oc.forEach(A1),vc.forEach(A1)}function gu(t,e){t.blockedOn===e&&(t.blockedOn=null,dO||(dO=!0,Jr.unstable_scheduleCallback(Jr.unstable_NormalPriority,j2)))}function yc(t){function e(i){return gu(i,t)}if(0<Df.length){gu(Df[0],t);for(var n=1;n<Df.length;n++){var r=Df[n];r.blockedOn===t&&(r.blockedOn=null)}}for(os!==null&&gu(os,t),ss!==null&&gu(ss,t),ls!==null&&gu(ls,t),Oc.forEach(e),vc.forEach(e),n=0;n<zo.length;n++)r=zo[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<zo.length&&(n=zo[0],n.blockedOn===null);)QP(n),n.blockedOn===null&&zo.shift()}var Oa=Mo.ReactCurrentBatchConfig,Ud=!0;function I2(t,e,n,r){var i=Gt,o=Oa.transition;Oa.transition=null;try{Gt=1,xy(t,e,n,r)}finally{Gt=i,Oa.transition=o}}function L2(t,e,n,r){var i=Gt,o=Oa.transition;Oa.transition=null;try{Gt=4,xy(t,e,n,r)}finally{Gt=i,Oa.transition=o}}function xy(t,e,n,r){if(Ud){var i=pO(t,e,n,r);if(i===null)Zg(t,e,r,Fd,n),Q1(t,r);else if(N2(i,t,e,n,r))r.stopPropagation();else if(Q1(t,r),e&4&&-1<D2.indexOf(t)){for(;i!==null;){var o=nf(i);if(o!==null&&EP(o),o=pO(t,e,n,r),o===null&&Zg(t,e,r,Fd,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Zg(t,e,r,null,n)}}var Fd=null;function pO(t,e,n,r){if(Fd=null,t=Sy(r),t=Hs(t),t!==null)if(e=Sl(t),e===null)t=null;else if(n=e.tag,n===13){if(t=SP(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Fd=t,null}function AP(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(P2()){case by:return 1;case xP:return 4;case Xd:case C2:return 16;case _P:return 536870912;default:return 16}default:return 16}}var Ho=null,_y=null,gd=null;function MP(){if(gd)return gd;var t,e=_y,n=e.length,r,i="value"in Ho?Ho.value:Ho.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[o-r];r++);return gd=i.slice(t,1<r?1-r:void 0)}function md(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Nf(){return!0}function M1(){return!1}function ti(t){function e(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(o):o[l]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Nf:M1,this.isPropagationStopped=M1,this}return wn(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Nf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Nf)},persist:function(){},isPersistent:Nf}),e}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Py=ti(Ha),tf=wn({},Ha,{view:0,detail:0}),Z2=ti(tf),Rg,Qg,mu,Up=wn({},tf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cy,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==mu&&(mu&&t.type==="mousemove"?(Rg=t.screenX-mu.screenX,Qg=t.screenY-mu.screenY):Qg=Rg=0,mu=t),Rg)},movementY:function(t){return"movementY"in t?t.movementY:Qg}}),D1=ti(Up),W2=wn({},Up,{dataTransfer:0}),B2=ti(W2),X2=wn({},tf,{relatedTarget:0}),Ag=ti(X2),Y2=wn({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),U2=ti(Y2),F2=wn({},Ha,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),q2=ti(F2),z2=wn({},Ha,{data:0}),N1=ti(z2),V2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},G2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},H2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function K2(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=H2[t])?!!e[t]:!1}function Cy(){return K2}var J2=wn({},tf,{key:function(t){if(t.key){var e=V2[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=md(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?G2[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cy,charCode:function(t){return t.type==="keypress"?md(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?md(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),eM=ti(J2),tM=wn({},Up,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),j1=ti(tM),nM=wn({},tf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cy}),rM=ti(nM),iM=wn({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),oM=ti(iM),sM=wn({},Up,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),lM=ti(sM),aM=[9,13,27,32],Ey=Co&&"CompositionEvent"in window,Ju=null;Co&&"documentMode"in document&&(Ju=document.documentMode);var uM=Co&&"TextEvent"in window&&!Ju,DP=Co&&(!Ey||Ju&&8<Ju&&11>=Ju),I1=String.fromCharCode(32),L1=!1;function NP(t,e){switch(t){case"keyup":return aM.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jP(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ta=!1;function cM(t,e){switch(t){case"compositionend":return jP(e);case"keypress":return e.which!==32?null:(L1=!0,I1);case"textInput":return t=e.data,t===I1&&L1?null:t;default:return null}}function fM(t,e){if(ta)return t==="compositionend"||!Ey&&NP(t,e)?(t=MP(),gd=_y=Ho=null,ta=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return DP&&e.locale!=="ko"?null:e.data;default:return null}}var hM={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Z1(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!hM[t.type]:e==="textarea"}function IP(t,e,n,r){gP(r),e=qd(e,"onChange"),0<e.length&&(n=new Py("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var ec=null,Sc=null;function dM(t){VP(t,0)}function Fp(t){var e=ia(t);if(aP(e))return t}function pM(t,e){if(t==="change")return e}var LP=!1;if(Co){var Mg;if(Co){var Dg="oninput"in document;if(!Dg){var W1=document.createElement("div");W1.setAttribute("oninput","return;"),Dg=typeof W1.oninput=="function"}Mg=Dg}else Mg=!1;LP=Mg&&(!document.documentMode||9<document.documentMode)}function B1(){ec&&(ec.detachEvent("onpropertychange",ZP),Sc=ec=null)}function ZP(t){if(t.propertyName==="value"&&Fp(Sc)){var e=[];IP(e,Sc,t,Sy(t)),yP(dM,e)}}function gM(t,e,n){t==="focusin"?(B1(),ec=e,Sc=n,ec.attachEvent("onpropertychange",ZP)):t==="focusout"&&B1()}function mM(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Fp(Sc)}function OM(t,e){if(t==="click")return Fp(e)}function vM(t,e){if(t==="input"||t==="change")return Fp(e)}function yM(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Di=typeof Object.is=="function"?Object.is:yM;function bc(t,e){if(Di(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Gm.call(e,i)||!Di(t[i],e[i]))return!1}return!0}function X1(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Y1(t,e){var n=X1(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=X1(n)}}function WP(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?WP(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function BP(){for(var t=window,e=Zd();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Zd(t.document)}return e}function Ty(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function SM(t){var e=BP(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&WP(n.ownerDocument.documentElement,n)){if(r!==null&&Ty(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=Y1(n,o);var s=Y1(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var bM=Co&&"documentMode"in document&&11>=document.documentMode,na=null,gO=null,tc=null,mO=!1;function U1(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mO||na==null||na!==Zd(r)||(r=na,"selectionStart"in r&&Ty(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}),tc&&bc(tc,r)||(tc=r,r=qd(gO,"onSelect"),0<r.length&&(e=new Py("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=na)))}function jf(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var ra={animationend:jf("Animation","AnimationEnd"),animationiteration:jf("Animation","AnimationIteration"),animationstart:jf("Animation","AnimationStart"),transitionend:jf("Transition","TransitionEnd")},Ng={},XP={};Co&&(XP=document.createElement("div").style,"AnimationEvent"in window||(delete ra.animationend.animation,delete ra.animationiteration.animation,delete ra.animationstart.animation),"TransitionEvent"in window||delete ra.transitionend.transition);function qp(t){if(Ng[t])return Ng[t];if(!ra[t])return t;var e=ra[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in XP)return Ng[t]=e[n];return t}var YP=qp("animationend"),UP=qp("animationiteration"),FP=qp("animationstart"),qP=qp("transitionend"),zP=new Map,F1="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xs(t,e){zP.set(t,e),yl(e,[t])}for(var jg=0;jg<F1.length;jg++){var Ig=F1[jg],wM=Ig.toLowerCase(),kM=Ig[0].toUpperCase()+Ig.slice(1);xs(wM,"on"+kM)}xs(YP,"onAnimationEnd");xs(UP,"onAnimationIteration");xs(FP,"onAnimationStart");xs("dblclick","onDoubleClick");xs("focusin","onFocus");xs("focusout","onBlur");xs(qP,"onTransitionEnd");$a("onMouseEnter",["mouseout","mouseover"]);$a("onMouseLeave",["mouseout","mouseover"]);$a("onPointerEnter",["pointerout","pointerover"]);$a("onPointerLeave",["pointerout","pointerover"]);yl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));yl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));yl("onBeforeInput",["compositionend","keypress","textInput","paste"]);yl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));yl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));yl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xM=new Set("cancel close invalid load scroll toggle".split(" ").concat(Bu));function q1(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,w2(r,e,void 0,t),t.currentTarget=null}function VP(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==o&&i.isPropagationStopped())break e;q1(i,l,u),o=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==o&&i.isPropagationStopped())break e;q1(i,l,u),o=a}}}if(Bd)throw t=fO,Bd=!1,fO=null,t}function sn(t,e){var n=e[bO];n===void 0&&(n=e[bO]=new Set);var r=t+"__bubble";n.has(r)||(GP(e,t,2,!1),n.add(r))}function Lg(t,e,n){var r=0;e&&(r|=4),GP(n,t,r,e)}var If="_reactListening"+Math.random().toString(36).slice(2);function wc(t){if(!t[If]){t[If]=!0,rP.forEach(function(n){n!=="selectionchange"&&(xM.has(n)||Lg(n,!1,t),Lg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[If]||(e[If]=!0,Lg("selectionchange",!1,e))}}function GP(t,e,n,r){switch(AP(e)){case 1:var i=I2;break;case 4:i=L2;break;default:i=xy}n=i.bind(null,e,n,t),i=void 0,!cO||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function Zg(t,e,n,r,i){var o=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===i||l.nodeType===8&&l.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;s=s.return}for(;l!==null;){if(s=Hs(l),s===null)return;if(a=s.tag,a===5||a===6){r=o=s;continue e}l=l.parentNode}}r=r.return}yP(function(){var u=o,c=Sy(n),f=[];e:{var h=zP.get(t);if(h!==void 0){var d=Py,p=t;switch(t){case"keypress":if(md(n)===0)break e;case"keydown":case"keyup":d=eM;break;case"focusin":p="focus",d=Ag;break;case"focusout":p="blur",d=Ag;break;case"beforeblur":case"afterblur":d=Ag;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=D1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=B2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=rM;break;case YP:case UP:case FP:d=U2;break;case qP:d=oM;break;case"scroll":d=Z2;break;case"wheel":d=lM;break;case"copy":case"cut":case"paste":d=q2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=j1}var g=(e&4)!==0,O=!g&&t==="scroll",v=g?h!==null?h+"Capture":null:h;g=[];for(var m=u,y;m!==null;){y=m;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,v!==null&&(S=mc(m,v),S!=null&&g.push(kc(m,S,y)))),O)break;m=m.return}0<g.length&&(h=new d(h,p,null,n,c),f.push({event:h,listeners:g}))}}if(!(e&7)){e:{if(h=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",h&&n!==aO&&(p=n.relatedTarget||n.fromElement)&&(Hs(p)||p[Eo]))break e;if((d||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,d?(p=n.relatedTarget||n.toElement,d=u,p=p?Hs(p):null,p!==null&&(O=Sl(p),p!==O||p.tag!==5&&p.tag!==6)&&(p=null)):(d=null,p=u),d!==p)){if(g=D1,S="onMouseLeave",v="onMouseEnter",m="mouse",(t==="pointerout"||t==="pointerover")&&(g=j1,S="onPointerLeave",v="onPointerEnter",m="pointer"),O=d==null?h:ia(d),y=p==null?h:ia(p),h=new g(S,m+"leave",d,n,c),h.target=O,h.relatedTarget=y,S=null,Hs(c)===u&&(g=new g(v,m+"enter",p,n,c),g.target=y,g.relatedTarget=O,S=g),O=S,d&&p)t:{for(g=d,v=p,m=0,y=g;y;y=Ml(y))m++;for(y=0,S=v;S;S=Ml(S))y++;for(;0<m-y;)g=Ml(g),m--;for(;0<y-m;)v=Ml(v),y--;for(;m--;){if(g===v||v!==null&&g===v.alternate)break t;g=Ml(g),v=Ml(v)}g=null}else g=null;d!==null&&z1(f,h,d,g,!1),p!==null&&O!==null&&z1(f,O,p,g,!0)}}e:{if(h=u?ia(u):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var k=pM;else if(Z1(h))if(LP)k=vM;else{k=mM;var P=gM}else(d=h.nodeName)&&d.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=OM);if(k&&(k=k(t,u))){IP(f,k,n,c);break e}P&&P(t,h,u),t==="focusout"&&(P=h._wrapperState)&&P.controlled&&h.type==="number"&&rO(h,"number",h.value)}switch(P=u?ia(u):window,t){case"focusin":(Z1(P)||P.contentEditable==="true")&&(na=P,gO=u,tc=null);break;case"focusout":tc=gO=na=null;break;case"mousedown":mO=!0;break;case"contextmenu":case"mouseup":case"dragend":mO=!1,U1(f,n,c);break;case"selectionchange":if(bM)break;case"keydown":case"keyup":U1(f,n,c)}var C;if(Ey)e:{switch(t){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else ta?NP(t,n)&&(w="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(w="onCompositionStart");w&&(DP&&n.locale!=="ko"&&(ta||w!=="onCompositionStart"?w==="onCompositionEnd"&&ta&&(C=MP()):(Ho=c,_y="value"in Ho?Ho.value:Ho.textContent,ta=!0)),P=qd(u,w),0<P.length&&(w=new N1(w,t,null,n,c),f.push({event:w,listeners:P}),C?w.data=C:(C=jP(n),C!==null&&(w.data=C)))),(C=uM?cM(t,n):fM(t,n))&&(u=qd(u,"onBeforeInput"),0<u.length&&(c=new N1("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=C))}VP(f,e)})}function kc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function qd(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=mc(t,n),o!=null&&r.unshift(kc(t,o,i)),o=mc(t,e),o!=null&&r.push(kc(t,o,i))),t=t.return}return r}function Ml(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function z1(t,e,n,r,i){for(var o=e._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,i?(a=mc(n,o),a!=null&&s.unshift(kc(n,a,l))):i||(a=mc(n,o),a!=null&&s.push(kc(n,a,l)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var _M=/\r\n?/g,PM=/\u0000|\uFFFD/g;function V1(t){return(typeof t=="string"?t:""+t).replace(_M,`
38
- `).replace(PM,"")}function Lf(t,e,n){if(e=V1(e),V1(t)!==e&&n)throw Error(Oe(425))}function zd(){}var OO=null,vO=null;function yO(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var SO=typeof setTimeout=="function"?setTimeout:void 0,CM=typeof clearTimeout=="function"?clearTimeout:void 0,G1=typeof Promise=="function"?Promise:void 0,EM=typeof queueMicrotask=="function"?queueMicrotask:typeof G1<"u"?function(t){return G1.resolve(null).then(t).catch(TM)}:SO;function TM(t){setTimeout(function(){throw t})}function Wg(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),yc(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);yc(e)}function as(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function H1(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Ka=Math.random().toString(36).slice(2),to="__reactFiber$"+Ka,xc="__reactProps$"+Ka,Eo="__reactContainer$"+Ka,bO="__reactEvents$"+Ka,$M="__reactListeners$"+Ka,RM="__reactHandles$"+Ka;function Hs(t){var e=t[to];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Eo]||n[to]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=H1(t);t!==null;){if(n=t[to])return n;t=H1(t)}return e}t=n,n=t.parentNode}return null}function nf(t){return t=t[to]||t[Eo],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function ia(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(Oe(33))}function zp(t){return t[xc]||null}var wO=[],oa=-1;function _s(t){return{current:t}}function un(t){0>oa||(t.current=wO[oa],wO[oa]=null,oa--)}function rn(t,e){oa++,wO[oa]=t.current,t.current=e}var Os={},vr=_s(Os),jr=_s(!1),ul=Os;function Ra(t,e){var n=t.type.contextTypes;if(!n)return Os;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ir(t){return t=t.childContextTypes,t!=null}function Vd(){un(jr),un(vr)}function K1(t,e,n){if(vr.current!==Os)throw Error(Oe(168));rn(vr,e),rn(jr,n)}function HP(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(Oe(108,g2(t)||"Unknown",i));return wn({},n,r)}function Gd(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Os,ul=vr.current,rn(vr,t),rn(jr,jr.current),!0}function J1(t,e,n){var r=t.stateNode;if(!r)throw Error(Oe(169));n?(t=HP(t,e,ul),r.__reactInternalMemoizedMergedChildContext=t,un(jr),un(vr),rn(vr,t)):un(jr),rn(jr,n)}var bo=null,Vp=!1,Bg=!1;function KP(t){bo===null?bo=[t]:bo.push(t)}function QM(t){Vp=!0,KP(t)}function Ps(){if(!Bg&&bo!==null){Bg=!0;var t=0,e=Gt;try{var n=bo;for(Gt=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}bo=null,Vp=!1}catch(i){throw bo!==null&&(bo=bo.slice(t+1)),kP(by,Ps),i}finally{Gt=e,Bg=!1}}return null}var sa=[],la=0,Hd=null,Kd=0,li=[],ai=0,cl=null,ko=1,xo="";function Xs(t,e){sa[la++]=Kd,sa[la++]=Hd,Hd=t,Kd=e}function JP(t,e,n){li[ai++]=ko,li[ai++]=xo,li[ai++]=cl,cl=t;var r=ko;t=xo;var i=32-Ai(r)-1;r&=~(1<<i),n+=1;var o=32-Ai(e)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,ko=1<<32-Ai(e)+i|n<<i|r,xo=o+t}else ko=1<<o|n<<i|r,xo=t}function $y(t){t.return!==null&&(Xs(t,1),JP(t,1,0))}function Ry(t){for(;t===Hd;)Hd=sa[--la],sa[la]=null,Kd=sa[--la],sa[la]=null;for(;t===cl;)cl=li[--ai],li[ai]=null,xo=li[--ai],li[ai]=null,ko=li[--ai],li[ai]=null}var Hr=null,Vr=null,gn=!1,Ti=null;function eC(t,e){var n=ci(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function eS(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Hr=t,Vr=as(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Hr=t,Vr=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=cl!==null?{id:ko,overflow:xo}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=ci(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Hr=t,Vr=null,!0):!1;default:return!1}}function kO(t){return(t.mode&1)!==0&&(t.flags&128)===0}function xO(t){if(gn){var e=Vr;if(e){var n=e;if(!eS(t,e)){if(kO(t))throw Error(Oe(418));e=as(n.nextSibling);var r=Hr;e&&eS(t,e)?eC(r,n):(t.flags=t.flags&-4097|2,gn=!1,Hr=t)}}else{if(kO(t))throw Error(Oe(418));t.flags=t.flags&-4097|2,gn=!1,Hr=t}}}function tS(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Hr=t}function Zf(t){if(t!==Hr)return!1;if(!gn)return tS(t),gn=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!yO(t.type,t.memoizedProps)),e&&(e=Vr)){if(kO(t))throw tC(),Error(Oe(418));for(;e;)eC(t,e),e=as(e.nextSibling)}if(tS(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(Oe(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Vr=as(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Vr=null}}else Vr=Hr?as(t.stateNode.nextSibling):null;return!0}function tC(){for(var t=Vr;t;)t=as(t.nextSibling)}function Qa(){Vr=Hr=null,gn=!1}function Qy(t){Ti===null?Ti=[t]:Ti.push(t)}var AM=Mo.ReactCurrentBatchConfig;function Pi(t,e){if(t&&t.defaultProps){e=wn({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}var Jd=_s(null),ep=null,aa=null,Ay=null;function My(){Ay=aa=ep=null}function Dy(t){var e=Jd.current;un(Jd),t._currentValue=e}function _O(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function va(t,e){ep=t,Ay=aa=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Dr=!0),t.firstContext=null)}function mi(t){var e=t._currentValue;if(Ay!==t)if(t={context:t,memoizedValue:e,next:null},aa===null){if(ep===null)throw Error(Oe(308));aa=t,ep.dependencies={lanes:0,firstContext:t}}else aa=aa.next=t;return e}var Ks=null;function Ny(t){Ks===null?Ks=[t]:Ks.push(t)}function nC(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Ny(e)):(n.next=i.next,i.next=n),e.interleaved=n,To(t,r)}function To(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Xo=!1;function jy(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rC(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function _o(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function us(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,Nt&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,To(t,n)}return i=r.interleaved,i===null?(e.next=e,Ny(r)):(e.next=i.next,i.next=e),r.interleaved=e,To(t,n)}function Od(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,wy(t,n)}}function nS(t,e){var n=t.updateQueue,r=t.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=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function tp(t,e,n,r){var i=t.updateQueue;Xo=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?o=u:s.next=u,s=a;var c=t.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(o!==null){var f=i.baseState;s=0,c=u=a=null,l=o;do{var h=l.lane,d=l.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:d,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var p=t,g=l;switch(h=e,d=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(d,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,h=typeof p=="function"?p.call(d,f,h):p,h==null)break e;f=wn({},f,h);break e;case 2:Xo=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else d={eventTime:d,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=d,a=f):c=c.next=d,s|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(1);if(c===null&&(a=f),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);hl|=s,t.lanes=s,t.memoizedState=f}}function rS(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(Oe(191,i));i.call(r)}}}var iC=new nP.Component().refs;function PO(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:wn({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Gp={isMounted:function(t){return(t=t._reactInternals)?Sl(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=_r(),i=fs(t),o=_o(r,i);o.payload=e,n!=null&&(o.callback=n),e=us(t,o,i),e!==null&&(Mi(e,t,i,r),Od(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=_r(),i=fs(t),o=_o(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=us(t,o,i),e!==null&&(Mi(e,t,i,r),Od(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=_r(),r=fs(t),i=_o(n,r);i.tag=2,e!=null&&(i.callback=e),e=us(t,i,r),e!==null&&(Mi(e,t,r,n),Od(e,t,r))}};function iS(t,e,n,r,i,o,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,s):e.prototype&&e.prototype.isPureReactComponent?!bc(n,r)||!bc(i,o):!0}function oC(t,e,n){var r=!1,i=Os,o=e.contextType;return typeof o=="object"&&o!==null?o=mi(o):(i=Ir(e)?ul:vr.current,r=e.contextTypes,o=(r=r!=null)?Ra(t,i):Os),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Gp,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function oS(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Gp.enqueueReplaceState(e,e.state,null)}function CO(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=iC,jy(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=mi(o):(o=Ir(e)?ul:vr.current,i.context=Ra(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(PO(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Gp.enqueueReplaceState(i,i.state,null),tp(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Ou(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Oe(309));var r=n.stateNode}if(!r)throw Error(Oe(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var l=i.refs;l===iC&&(l=i.refs={}),s===null?delete l[o]:l[o]=s},e._stringRef=o,e)}if(typeof t!="string")throw Error(Oe(284));if(!n._owner)throw Error(Oe(290,t))}return t}function Wf(t,e){throw t=Object.prototype.toString.call(e),Error(Oe(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function sS(t){var e=t._init;return e(t._payload)}function sC(t){function e(v,m){if(t){var y=v.deletions;y===null?(v.deletions=[m],v.flags|=16):y.push(m)}}function n(v,m){if(!t)return null;for(;m!==null;)e(v,m),m=m.sibling;return null}function r(v,m){for(v=new Map;m!==null;)m.key!==null?v.set(m.key,m):v.set(m.index,m),m=m.sibling;return v}function i(v,m){return v=hs(v,m),v.index=0,v.sibling=null,v}function o(v,m,y){return v.index=y,t?(y=v.alternate,y!==null?(y=y.index,y<m?(v.flags|=2,m):y):(v.flags|=2,m)):(v.flags|=1048576,m)}function s(v){return t&&v.alternate===null&&(v.flags|=2),v}function l(v,m,y,S){return m===null||m.tag!==6?(m=Vg(y,v.mode,S),m.return=v,m):(m=i(m,y),m.return=v,m)}function a(v,m,y,S){var k=y.type;return k===ea?c(v,m,y.props.children,S,y.key):m!==null&&(m.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Bo&&sS(k)===m.type)?(S=i(m,y.props),S.ref=Ou(v,m,y),S.return=v,S):(S=kd(y.type,y.key,y.props,null,v.mode,S),S.ref=Ou(v,m,y),S.return=v,S)}function u(v,m,y,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=Gg(y,v.mode,S),m.return=v,m):(m=i(m,y.children||[]),m.return=v,m)}function c(v,m,y,S,k){return m===null||m.tag!==7?(m=sl(y,v.mode,S,k),m.return=v,m):(m=i(m,y),m.return=v,m)}function f(v,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Vg(""+m,v.mode,y),m.return=v,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case $f:return y=kd(m.type,m.key,m.props,null,v.mode,y),y.ref=Ou(v,null,m),y.return=v,y;case Jl:return m=Gg(m,v.mode,y),m.return=v,m;case Bo:var S=m._init;return f(v,S(m._payload),y)}if(Zu(m)||hu(m))return m=sl(m,v.mode,y,null),m.return=v,m;Wf(v,m)}return null}function h(v,m,y,S){var k=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:l(v,m,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case $f:return y.key===k?a(v,m,y,S):null;case Jl:return y.key===k?u(v,m,y,S):null;case Bo:return k=y._init,h(v,m,k(y._payload),S)}if(Zu(y)||hu(y))return k!==null?null:c(v,m,y,S,null);Wf(v,y)}return null}function d(v,m,y,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(y)||null,l(m,v,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case $f:return v=v.get(S.key===null?y:S.key)||null,a(m,v,S,k);case Jl:return v=v.get(S.key===null?y:S.key)||null,u(m,v,S,k);case Bo:var P=S._init;return d(v,m,y,P(S._payload),k)}if(Zu(S)||hu(S))return v=v.get(y)||null,c(m,v,S,k,null);Wf(m,S)}return null}function p(v,m,y,S){for(var k=null,P=null,C=m,w=m=0,x=null;C!==null&&w<y.length;w++){C.index>w?(x=C,C=null):x=C.sibling;var _=h(v,C,y[w],S);if(_===null){C===null&&(C=x);break}t&&C&&_.alternate===null&&e(v,C),m=o(_,m,w),P===null?k=_:P.sibling=_,P=_,C=x}if(w===y.length)return n(v,C),gn&&Xs(v,w),k;if(C===null){for(;w<y.length;w++)C=f(v,y[w],S),C!==null&&(m=o(C,m,w),P===null?k=C:P.sibling=C,P=C);return gn&&Xs(v,w),k}for(C=r(v,C);w<y.length;w++)x=d(C,v,w,y[w],S),x!==null&&(t&&x.alternate!==null&&C.delete(x.key===null?w:x.key),m=o(x,m,w),P===null?k=x:P.sibling=x,P=x);return t&&C.forEach(function(E){return e(v,E)}),gn&&Xs(v,w),k}function g(v,m,y,S){var k=hu(y);if(typeof k!="function")throw Error(Oe(150));if(y=k.call(y),y==null)throw Error(Oe(151));for(var P=k=null,C=m,w=m=0,x=null,_=y.next();C!==null&&!_.done;w++,_=y.next()){C.index>w?(x=C,C=null):x=C.sibling;var E=h(v,C,_.value,S);if(E===null){C===null&&(C=x);break}t&&C&&E.alternate===null&&e(v,C),m=o(E,m,w),P===null?k=E:P.sibling=E,P=E,C=x}if(_.done)return n(v,C),gn&&Xs(v,w),k;if(C===null){for(;!_.done;w++,_=y.next())_=f(v,_.value,S),_!==null&&(m=o(_,m,w),P===null?k=_:P.sibling=_,P=_);return gn&&Xs(v,w),k}for(C=r(v,C);!_.done;w++,_=y.next())_=d(C,v,w,_.value,S),_!==null&&(t&&_.alternate!==null&&C.delete(_.key===null?w:_.key),m=o(_,m,w),P===null?k=_:P.sibling=_,P=_);return t&&C.forEach(function($){return e(v,$)}),gn&&Xs(v,w),k}function O(v,m,y,S){if(typeof y=="object"&&y!==null&&y.type===ea&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case $f:e:{for(var k=y.key,P=m;P!==null;){if(P.key===k){if(k=y.type,k===ea){if(P.tag===7){n(v,P.sibling),m=i(P,y.props.children),m.return=v,v=m;break e}}else if(P.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Bo&&sS(k)===P.type){n(v,P.sibling),m=i(P,y.props),m.ref=Ou(v,P,y),m.return=v,v=m;break e}n(v,P);break}else e(v,P);P=P.sibling}y.type===ea?(m=sl(y.props.children,v.mode,S,y.key),m.return=v,v=m):(S=kd(y.type,y.key,y.props,null,v.mode,S),S.ref=Ou(v,m,y),S.return=v,v=S)}return s(v);case Jl:e:{for(P=y.key;m!==null;){if(m.key===P)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){n(v,m.sibling),m=i(m,y.children||[]),m.return=v,v=m;break e}else{n(v,m);break}else e(v,m);m=m.sibling}m=Gg(y,v.mode,S),m.return=v,v=m}return s(v);case Bo:return P=y._init,O(v,m,P(y._payload),S)}if(Zu(y))return p(v,m,y,S);if(hu(y))return g(v,m,y,S);Wf(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(n(v,m.sibling),m=i(m,y),m.return=v,v=m):(n(v,m),m=Vg(y,v.mode,S),m.return=v,v=m),s(v)):n(v,m)}return O}var Aa=sC(!0),lC=sC(!1),rf={},lo=_s(rf),_c=_s(rf),Pc=_s(rf);function Js(t){if(t===rf)throw Error(Oe(174));return t}function Iy(t,e){switch(rn(Pc,e),rn(_c,t),rn(lo,rf),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:oO(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=oO(e,t)}un(lo),rn(lo,e)}function Ma(){un(lo),un(_c),un(Pc)}function aC(t){Js(Pc.current);var e=Js(lo.current),n=oO(e,t.type);e!==n&&(rn(_c,t),rn(lo,n))}function Ly(t){_c.current===t&&(un(lo),un(_c))}var yn=_s(0);function np(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var Xg=[];function Zy(){for(var t=0;t<Xg.length;t++)Xg[t]._workInProgressVersionPrimary=null;Xg.length=0}var vd=Mo.ReactCurrentDispatcher,Yg=Mo.ReactCurrentBatchConfig,fl=0,bn=null,Xn=null,Jn=null,rp=!1,nc=!1,Cc=0,MM=0;function cr(){throw Error(Oe(321))}function Wy(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!Di(t[n],e[n]))return!1;return!0}function By(t,e,n,r,i,o){if(fl=o,bn=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,vd.current=t===null||t.memoizedState===null?IM:LM,t=n(r,i),nc){o=0;do{if(nc=!1,Cc=0,25<=o)throw Error(Oe(301));o+=1,Jn=Xn=null,e.updateQueue=null,vd.current=ZM,t=n(r,i)}while(nc)}if(vd.current=ip,e=Xn!==null&&Xn.next!==null,fl=0,Jn=Xn=bn=null,rp=!1,e)throw Error(Oe(300));return t}function Xy(){var t=Cc!==0;return Cc=0,t}function eo(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jn===null?bn.memoizedState=Jn=t:Jn=Jn.next=t,Jn}function Oi(){if(Xn===null){var t=bn.alternate;t=t!==null?t.memoizedState:null}else t=Xn.next;var e=Jn===null?bn.memoizedState:Jn.next;if(e!==null)Jn=e,Xn=t;else{if(t===null)throw Error(Oe(310));Xn=t,t={memoizedState:Xn.memoizedState,baseState:Xn.baseState,baseQueue:Xn.baseQueue,queue:Xn.queue,next:null},Jn===null?bn.memoizedState=Jn=t:Jn=Jn.next=t}return Jn}function Ec(t,e){return typeof e=="function"?e(t):e}function Ug(t){var e=Oi(),n=e.queue;if(n===null)throw Error(Oe(311));n.lastRenderedReducer=t;var r=Xn,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var l=s=null,a=null,u=o;do{var c=u.lane;if((fl&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:t(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=f,s=r):a=a.next=f,bn.lanes|=c,hl|=c}u=u.next}while(u!==null&&u!==o);a===null?s=r:a.next=l,Di(r,e.memoizedState)||(Dr=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=a,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,bn.lanes|=o,hl|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function Fg(t){var e=Oi(),n=e.queue;if(n===null)throw Error(Oe(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=t(o,s.action),s=s.next;while(s!==i);Di(o,e.memoizedState)||(Dr=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function uC(){}function cC(t,e){var n=bn,r=Oi(),i=e(),o=!Di(r.memoizedState,i);if(o&&(r.memoizedState=i,Dr=!0),r=r.queue,Yy(dC.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||Jn!==null&&Jn.memoizedState.tag&1){if(n.flags|=2048,Tc(9,hC.bind(null,n,r,i,e),void 0,null),er===null)throw Error(Oe(349));fl&30||fC(n,e,i)}return i}function fC(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=bn.updateQueue,e===null?(e={lastEffect:null,stores:null},bn.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function hC(t,e,n,r){e.value=n,e.getSnapshot=r,pC(e)&&gC(t)}function dC(t,e,n){return n(function(){pC(e)&&gC(t)})}function pC(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Di(t,n)}catch{return!0}}function gC(t){var e=To(t,1);e!==null&&Mi(e,t,1,-1)}function lS(t){var e=eo();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ec,lastRenderedState:t},e.queue=t,t=t.dispatch=jM.bind(null,bn,t),[e.memoizedState,t]}function Tc(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=bn.updateQueue,e===null?(e={lastEffect:null,stores:null},bn.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function mC(){return Oi().memoizedState}function yd(t,e,n,r){var i=eo();bn.flags|=t,i.memoizedState=Tc(1|e,n,void 0,r===void 0?null:r)}function Hp(t,e,n,r){var i=Oi();r=r===void 0?null:r;var o=void 0;if(Xn!==null){var s=Xn.memoizedState;if(o=s.destroy,r!==null&&Wy(r,s.deps)){i.memoizedState=Tc(e,n,o,r);return}}bn.flags|=t,i.memoizedState=Tc(1|e,n,o,r)}function aS(t,e){return yd(8390656,8,t,e)}function Yy(t,e){return Hp(2048,8,t,e)}function OC(t,e){return Hp(4,2,t,e)}function vC(t,e){return Hp(4,4,t,e)}function yC(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function SC(t,e,n){return n=n!=null?n.concat([t]):null,Hp(4,4,yC.bind(null,e,t),n)}function Uy(){}function bC(t,e){var n=Oi();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Wy(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function wC(t,e){var n=Oi();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Wy(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function kC(t,e,n){return fl&21?(Di(n,e)||(n=PP(),bn.lanes|=n,hl|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Dr=!0),t.memoizedState=n)}function DM(t,e){var n=Gt;Gt=n!==0&&4>n?n:4,t(!0);var r=Yg.transition;Yg.transition={};try{t(!1),e()}finally{Gt=n,Yg.transition=r}}function xC(){return Oi().memoizedState}function NM(t,e,n){var r=fs(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_C(t))PC(e,n);else if(n=nC(t,e,n,r),n!==null){var i=_r();Mi(n,t,r,i),CC(n,e,r)}}function jM(t,e,n){var r=fs(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_C(t))PC(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Di(l,s)){var a=e.interleaved;a===null?(i.next=i,Ny(e)):(i.next=a.next,a.next=i),e.interleaved=i;return}}catch{}finally{}n=nC(t,e,i,r),n!==null&&(i=_r(),Mi(n,t,r,i),CC(n,e,r))}}function _C(t){var e=t.alternate;return t===bn||e!==null&&e===bn}function PC(t,e){nc=rp=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function CC(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,wy(t,n)}}var ip={readContext:mi,useCallback:cr,useContext:cr,useEffect:cr,useImperativeHandle:cr,useInsertionEffect:cr,useLayoutEffect:cr,useMemo:cr,useReducer:cr,useRef:cr,useState:cr,useDebugValue:cr,useDeferredValue:cr,useTransition:cr,useMutableSource:cr,useSyncExternalStore:cr,useId:cr,unstable_isNewReconciler:!1},IM={readContext:mi,useCallback:function(t,e){return eo().memoizedState=[t,e===void 0?null:e],t},useContext:mi,useEffect:aS,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,yd(4194308,4,yC.bind(null,e,t),n)},useLayoutEffect:function(t,e){return yd(4194308,4,t,e)},useInsertionEffect:function(t,e){return yd(4,2,t,e)},useMemo:function(t,e){var n=eo();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=eo();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=NM.bind(null,bn,t),[r.memoizedState,t]},useRef:function(t){var e=eo();return t={current:t},e.memoizedState=t},useState:lS,useDebugValue:Uy,useDeferredValue:function(t){return eo().memoizedState=t},useTransition:function(){var t=lS(!1),e=t[0];return t=DM.bind(null,t[1]),eo().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=bn,i=eo();if(gn){if(n===void 0)throw Error(Oe(407));n=n()}else{if(n=e(),er===null)throw Error(Oe(349));fl&30||fC(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,aS(dC.bind(null,r,o,t),[t]),r.flags|=2048,Tc(9,hC.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=eo(),e=er.identifierPrefix;if(gn){var n=xo,r=ko;n=(r&~(1<<32-Ai(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Cc++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=MM++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},LM={readContext:mi,useCallback:bC,useContext:mi,useEffect:Yy,useImperativeHandle:SC,useInsertionEffect:OC,useLayoutEffect:vC,useMemo:wC,useReducer:Ug,useRef:mC,useState:function(){return Ug(Ec)},useDebugValue:Uy,useDeferredValue:function(t){var e=Oi();return kC(e,Xn.memoizedState,t)},useTransition:function(){var t=Ug(Ec)[0],e=Oi().memoizedState;return[t,e]},useMutableSource:uC,useSyncExternalStore:cC,useId:xC,unstable_isNewReconciler:!1},ZM={readContext:mi,useCallback:bC,useContext:mi,useEffect:Yy,useImperativeHandle:SC,useInsertionEffect:OC,useLayoutEffect:vC,useMemo:wC,useReducer:Fg,useRef:mC,useState:function(){return Fg(Ec)},useDebugValue:Uy,useDeferredValue:function(t){var e=Oi();return Xn===null?e.memoizedState=t:kC(e,Xn.memoizedState,t)},useTransition:function(){var t=Fg(Ec)[0],e=Oi().memoizedState;return[t,e]},useMutableSource:uC,useSyncExternalStore:cC,useId:xC,unstable_isNewReconciler:!1};function Da(t,e){try{var n="",r=e;do n+=p2(r),r=r.return;while(r);var i=n}catch(o){i=`
39
- Error generating stack: `+o.message+`
40
- `+o.stack}return{value:t,source:e,stack:i,digest:null}}function qg(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function EO(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var WM=typeof WeakMap=="function"?WeakMap:Map;function EC(t,e,n){n=_o(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){sp||(sp=!0,IO=r),EO(t,e)},n}function TC(t,e,n){n=_o(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){EO(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){EO(t,e),typeof r!="function"&&(cs===null?cs=new Set([this]):cs.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function uS(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new WM;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=tD.bind(null,t,e,n),e.then(t,t))}function cS(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function fS(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=_o(-1,1),e.tag=2,us(n,e,1))),n.lanes|=1),t)}var BM=Mo.ReactCurrentOwner,Dr=!1;function kr(t,e,n,r){e.child=t===null?lC(e,null,n,r):Aa(e,t.child,n,r)}function hS(t,e,n,r,i){n=n.render;var o=e.ref;return va(e,i),r=By(t,e,n,r,o,i),n=Xy(),t!==null&&!Dr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,$o(t,e,i)):(gn&&n&&$y(e),e.flags|=1,kr(t,e,r,i),e.child)}function dS(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!Jy(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,$C(t,e,o,r,i)):(t=kd(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,!(t.lanes&i)){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:bc,n(s,r)&&t.ref===e.ref)return $o(t,e,i)}return e.flags|=1,t=hs(o,r),t.ref=e.ref,t.return=e,e.child=t}function $C(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(bc(o,r)&&t.ref===e.ref)if(Dr=!1,e.pendingProps=r=o,(t.lanes&i)!==0)t.flags&131072&&(Dr=!0);else return e.lanes=t.lanes,$o(t,e,i)}return TO(t,e,n,r,i)}function RC(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},rn(ca,Ur),Ur|=n;else{if(!(n&1073741824))return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,rn(ca,Ur),Ur|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,rn(ca,Ur),Ur|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,rn(ca,Ur),Ur|=r;return kr(t,e,i,n),e.child}function QC(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function TO(t,e,n,r,i){var o=Ir(n)?ul:vr.current;return o=Ra(e,o),va(e,i),n=By(t,e,n,r,o,i),r=Xy(),t!==null&&!Dr?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,$o(t,e,i)):(gn&&r&&$y(e),e.flags|=1,kr(t,e,n,i),e.child)}function pS(t,e,n,r,i){if(Ir(n)){var o=!0;Gd(e)}else o=!1;if(va(e,i),e.stateNode===null)Sd(t,e),oC(e,n,r),CO(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,l=e.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=mi(u):(u=Ir(n)?ul:vr.current,u=Ra(e,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&oS(e,s,r,u),Xo=!1;var h=e.memoizedState;s.state=h,tp(e,r,s,i),a=e.memoizedState,l!==r||h!==a||jr.current||Xo?(typeof c=="function"&&(PO(e,n,c,r),a=e.memoizedState),(l=Xo||iS(e,n,l,r,h,a,u))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,rC(t,e),l=e.memoizedProps,u=e.type===e.elementType?l:Pi(e.type,l),s.props=u,f=e.pendingProps,h=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=mi(a):(a=Ir(n)?ul:vr.current,a=Ra(e,a));var d=n.getDerivedStateFromProps;(c=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==a)&&oS(e,s,r,a),Xo=!1,h=e.memoizedState,s.state=h,tp(e,r,s,i);var p=e.memoizedState;l!==f||h!==p||jr.current||Xo?(typeof d=="function"&&(PO(e,n,d,r),p=e.memoizedState),(u=Xo||iS(e,n,u,r,h,p,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,p,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,p,a)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),s.props=r,s.state=p,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return $O(t,e,n,r,o,i)}function $O(t,e,n,r,i,o){QC(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&J1(e,n,!1),$o(t,e,o);r=e.stateNode,BM.current=e;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Aa(e,t.child,null,o),e.child=Aa(e,null,l,o)):kr(t,e,l,o),e.memoizedState=r.state,i&&J1(e,n,!0),e.child}function AC(t){var e=t.stateNode;e.pendingContext?K1(t,e.pendingContext,e.pendingContext!==e.context):e.context&&K1(t,e.context,!1),Iy(t,e.containerInfo)}function gS(t,e,n,r,i){return Qa(),Qy(i),e.flags|=256,kr(t,e,n,r),e.child}var RO={dehydrated:null,treeContext:null,retryLane:0};function QO(t){return{baseLanes:t,cachePool:null,transitions:null}}function MC(t,e,n){var r=e.pendingProps,i=yn.current,o=!1,s=(e.flags&128)!==0,l;if((l=s)||(l=t!==null&&t.memoizedState===null?!1:(i&2)!==0),l?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),rn(yn,i&1),t===null)return xO(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=r.children,t=r.fallback,o?(r=e.mode,o=e.child,s={mode:"hidden",children:s},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=s):o=eg(s,r,0,null),t=sl(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=QO(n),e.memoizedState=RO,t):Fy(e,s));if(i=t.memoizedState,i!==null&&(l=i.dehydrated,l!==null))return XM(t,e,s,r,l,i,n);if(o){o=r.fallback,s=e.mode,i=t.child,l=i.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=a,e.deletions=null):(r=hs(i,a),r.subtreeFlags=i.subtreeFlags&14680064),l!==null?o=hs(l,o):(o=sl(o,s,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,s=t.child.memoizedState,s=s===null?QO(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~n,e.memoizedState=RO,r}return o=t.child,t=o.sibling,r=hs(o,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Fy(t,e){return e=eg({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Bf(t,e,n,r){return r!==null&&Qy(r),Aa(e,t.child,null,n),t=Fy(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function XM(t,e,n,r,i,o,s){if(n)return e.flags&256?(e.flags&=-257,r=qg(Error(Oe(422))),Bf(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=eg({mode:"visible",children:r.children},i,0,null),o=sl(o,i,s,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,e.mode&1&&Aa(e,t.child,null,s),e.child.memoizedState=QO(s),e.memoizedState=RO,o);if(!(e.mode&1))return Bf(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var l=r.dgst;return r=l,o=Error(Oe(419)),r=qg(o,r,void 0),Bf(t,e,s,r)}if(l=(s&t.childLanes)!==0,Dr||l){if(r=er,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|s)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,To(t,i),Mi(r,t,i,-1))}return Ky(),r=qg(Error(Oe(421))),Bf(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=nD.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Vr=as(i.nextSibling),Hr=e,gn=!0,Ti=null,t!==null&&(li[ai++]=ko,li[ai++]=xo,li[ai++]=cl,ko=t.id,xo=t.overflow,cl=e),e=Fy(e,r.children),e.flags|=4096,e)}function mS(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),_O(t.return,e,n)}function zg(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function DC(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(kr(t,e,r.children,n),r=yn.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&mS(t,n,e);else if(t.tag===19)mS(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(rn(yn,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&np(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),zg(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&np(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}zg(e,!0,n,null,o);break;case"together":zg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Sd(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function $o(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),hl|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Oe(153));if(e.child!==null){for(t=e.child,n=hs(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=hs(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function YM(t,e,n){switch(e.tag){case 3:AC(e),Qa();break;case 5:aC(e);break;case 1:Ir(e.type)&&Gd(e);break;case 4:Iy(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;rn(Jd,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(rn(yn,yn.current&1),e.flags|=128,null):n&e.child.childLanes?MC(t,e,n):(rn(yn,yn.current&1),t=$o(t,e,n),t!==null?t.sibling:null);rn(yn,yn.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return DC(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),rn(yn,yn.current),r)break;return null;case 22:case 23:return e.lanes=0,RC(t,e,n)}return $o(t,e,n)}var NC,AO,jC,IC;NC=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};AO=function(){};jC=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Js(lo.current);var o=null;switch(n){case"input":i=tO(t,i),r=tO(t,r),o=[];break;case"select":i=wn({},i,{value:void 0}),r=wn({},r,{value:void 0}),o=[];break;case"textarea":i=iO(t,i),r=iO(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=zd)}sO(n,r);var s;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var l=i[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(pc.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var a=r[u];if(l=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(o||(o=[]),o.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(o=o||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(pc.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&sn("scroll",t),o||l===a||(o=[])):(o=o||[]).push(u,a))}n&&(o=o||[]).push("style",n);var u=o;(e.updateQueue=u)&&(e.flags|=4)}};IC=function(t,e,n,r){n!==r&&(e.flags|=4)};function vu(t,e){if(!gn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function fr(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function UM(t,e,n){var r=e.pendingProps;switch(Ry(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fr(e),null;case 1:return Ir(e.type)&&Vd(),fr(e),null;case 3:return r=e.stateNode,Ma(),un(jr),un(vr),Zy(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Zf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ti!==null&&(WO(Ti),Ti=null))),AO(t,e),fr(e),null;case 5:Ly(e);var i=Js(Pc.current);if(n=e.type,t!==null&&e.stateNode!=null)jC(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Oe(166));return fr(e),null}if(t=Js(lo.current),Zf(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[to]=e,r[xc]=o,t=(e.mode&1)!==0,n){case"dialog":sn("cancel",r),sn("close",r);break;case"iframe":case"object":case"embed":sn("load",r);break;case"video":case"audio":for(i=0;i<Bu.length;i++)sn(Bu[i],r);break;case"source":sn("error",r);break;case"img":case"image":case"link":sn("error",r),sn("load",r);break;case"details":sn("toggle",r);break;case"input":_1(r,o),sn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},sn("invalid",r);break;case"textarea":C1(r,o),sn("invalid",r)}sO(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var l=o[s];s==="children"?typeof l=="string"?r.textContent!==l&&(o.suppressHydrationWarning!==!0&&Lf(r.textContent,l,t),i=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(o.suppressHydrationWarning!==!0&&Lf(r.textContent,l,t),i=["children",""+l]):pc.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&sn("scroll",r)}switch(n){case"input":Rf(r),P1(r,o,!0);break;case"textarea":Rf(r),E1(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=zd)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=fP(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[to]=e,t[xc]=r,NC(t,e,!1,!1),e.stateNode=t;e:{switch(s=lO(n,r),n){case"dialog":sn("cancel",t),sn("close",t),i=r;break;case"iframe":case"object":case"embed":sn("load",t),i=r;break;case"video":case"audio":for(i=0;i<Bu.length;i++)sn(Bu[i],t);i=r;break;case"source":sn("error",t),i=r;break;case"img":case"image":case"link":sn("error",t),sn("load",t),i=r;break;case"details":sn("toggle",t),i=r;break;case"input":_1(t,r),i=tO(t,r),sn("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=wn({},r,{value:void 0}),sn("invalid",t);break;case"textarea":C1(t,r),i=iO(t,r),sn("invalid",t);break;default:i=r}sO(n,i),l=i;for(o in l)if(l.hasOwnProperty(o)){var a=l[o];o==="style"?pP(t,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&hP(t,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&gc(t,a):typeof a=="number"&&gc(t,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(pc.hasOwnProperty(o)?a!=null&&o==="onScroll"&&sn("scroll",t):a!=null&&my(t,o,a,s))}switch(n){case"input":Rf(t),P1(t,r,!1);break;case"textarea":Rf(t),E1(t);break;case"option":r.value!=null&&t.setAttribute("value",""+ms(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?pa(t,!!r.multiple,o,!1):r.defaultValue!=null&&pa(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=zd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return fr(e),null;case 6:if(t&&e.stateNode!=null)IC(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(Oe(166));if(n=Js(Pc.current),Js(lo.current),Zf(e)){if(r=e.stateNode,n=e.memoizedProps,r[to]=e,(o=r.nodeValue!==n)&&(t=Hr,t!==null))switch(t.tag){case 3:Lf(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Lf(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[to]=e,e.stateNode=r}return fr(e),null;case 13:if(un(yn),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(gn&&Vr!==null&&e.mode&1&&!(e.flags&128))tC(),Qa(),e.flags|=98560,o=!1;else if(o=Zf(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(Oe(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(Oe(317));o[to]=e}else Qa(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;fr(e),o=!1}else Ti!==null&&(WO(Ti),Ti=null),o=!0;if(!o)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||yn.current&1?Fn===0&&(Fn=3):Ky())),e.updateQueue!==null&&(e.flags|=4),fr(e),null);case 4:return Ma(),AO(t,e),t===null&&wc(e.stateNode.containerInfo),fr(e),null;case 10:return Dy(e.type._context),fr(e),null;case 17:return Ir(e.type)&&Vd(),fr(e),null;case 19:if(un(yn),o=e.memoizedState,o===null)return fr(e),null;if(r=(e.flags&128)!==0,s=o.rendering,s===null)if(r)vu(o,!1);else{if(Fn!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(s=np(t),s!==null){for(e.flags|=128,vu(o,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,t=s.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return rn(yn,yn.current&1|2),e.child}t=t.sibling}o.tail!==null&&Rn()>Na&&(e.flags|=128,r=!0,vu(o,!1),e.lanes=4194304)}else{if(!r)if(t=np(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),vu(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!gn)return fr(e),null}else 2*Rn()-o.renderingStartTime>Na&&n!==1073741824&&(e.flags|=128,r=!0,vu(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Rn(),e.sibling=null,n=yn.current,rn(yn,r?n&1|2:n&1),e):(fr(e),null);case 22:case 23:return Hy(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Ur&1073741824&&(fr(e),e.subtreeFlags&6&&(e.flags|=8192)):fr(e),null;case 24:return null;case 25:return null}throw Error(Oe(156,e.tag))}function FM(t,e){switch(Ry(e),e.tag){case 1:return Ir(e.type)&&Vd(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ma(),un(jr),un(vr),Zy(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Ly(e),null;case 13:if(un(yn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Oe(340));Qa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return un(yn),null;case 4:return Ma(),null;case 10:return Dy(e.type._context),null;case 22:case 23:return Hy(),null;case 24:return null;default:return null}}var Xf=!1,pr=!1,qM=typeof WeakSet=="function"?WeakSet:Set,We=null;function ua(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xn(t,e,r)}else n.current=null}function MO(t,e,n){try{n()}catch(r){xn(t,e,r)}}var OS=!1;function zM(t,e){if(OO=Ud,t=BP(),Ty(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.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,u=0,c=0,f=t,h=null;t:for(;;){for(var d;f!==n||i!==0&&f.nodeType!==3||(l=s+i),f!==o||r!==0&&f.nodeType!==3||(a=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++u===i&&(l=s),h===o&&++c===r&&(a=s),(d=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=d}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(vO={focusedElem:t,selectionRange:n},Ud=!1,We=e;We!==null;)if(e=We,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,We=t;else for(;We!==null;){e=We;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,O=p.memoizedState,v=e.stateNode,m=v.getSnapshotBeforeUpdate(e.elementType===e.type?g:Pi(e.type,g),O);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Oe(163))}}catch(S){xn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,We=t;break}We=e.return}return p=OS,OS=!1,p}function rc(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&MO(e,n,o)}i=i.next}while(i!==r)}}function Kp(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function DO(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function LC(t){var e=t.alternate;e!==null&&(t.alternate=null,LC(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[to],delete e[xc],delete e[bO],delete e[$M],delete e[RM])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ZC(t){return t.tag===5||t.tag===3||t.tag===4}function vS(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ZC(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function NO(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=zd));else if(r!==4&&(t=t.child,t!==null))for(NO(t,e,n),t=t.sibling;t!==null;)NO(t,e,n),t=t.sibling}function jO(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(jO(t,e,n),t=t.sibling;t!==null;)jO(t,e,n),t=t.sibling}var nr=null,Ci=!1;function jo(t,e,n){for(n=n.child;n!==null;)WC(t,e,n),n=n.sibling}function WC(t,e,n){if(so&&typeof so.onCommitFiberUnmount=="function")try{so.onCommitFiberUnmount(Yp,n)}catch{}switch(n.tag){case 5:pr||ua(n,e);case 6:var r=nr,i=Ci;nr=null,jo(t,e,n),nr=r,Ci=i,nr!==null&&(Ci?(t=nr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):nr.removeChild(n.stateNode));break;case 18:nr!==null&&(Ci?(t=nr,n=n.stateNode,t.nodeType===8?Wg(t.parentNode,n):t.nodeType===1&&Wg(t,n),yc(t)):Wg(nr,n.stateNode));break;case 4:r=nr,i=Ci,nr=n.stateNode.containerInfo,Ci=!0,jo(t,e,n),nr=r,Ci=i;break;case 0:case 11:case 14:case 15:if(!pr&&(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)&&MO(n,e,s),i=i.next}while(i!==r)}jo(t,e,n);break;case 1:if(!pr&&(ua(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){xn(n,e,l)}jo(t,e,n);break;case 21:jo(t,e,n);break;case 22:n.mode&1?(pr=(r=pr)||n.memoizedState!==null,jo(t,e,n),pr=r):jo(t,e,n);break;default:jo(t,e,n)}}function yS(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new qM),e.forEach(function(r){var i=rD.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ki(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,s=e,l=s;e:for(;l!==null;){switch(l.tag){case 5:nr=l.stateNode,Ci=!1;break e;case 3:nr=l.stateNode.containerInfo,Ci=!0;break e;case 4:nr=l.stateNode.containerInfo,Ci=!0;break e}l=l.return}if(nr===null)throw Error(Oe(160));WC(o,s,i),nr=null,Ci=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){xn(i,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)BC(e,t),e=e.sibling}function BC(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(ki(e,t),Wi(t),r&4){try{rc(3,t,t.return),Kp(3,t)}catch(g){xn(t,t.return,g)}try{rc(5,t,t.return)}catch(g){xn(t,t.return,g)}}break;case 1:ki(e,t),Wi(t),r&512&&n!==null&&ua(n,n.return);break;case 5:if(ki(e,t),Wi(t),r&512&&n!==null&&ua(n,n.return),t.flags&32){var i=t.stateNode;try{gc(i,"")}catch(g){xn(t,t.return,g)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,s=n!==null?n.memoizedProps:o,l=t.type,a=t.updateQueue;if(t.updateQueue=null,a!==null)try{l==="input"&&o.type==="radio"&&o.name!=null&&uP(i,o),lO(l,s);var u=lO(l,o);for(s=0;s<a.length;s+=2){var c=a[s],f=a[s+1];c==="style"?pP(i,f):c==="dangerouslySetInnerHTML"?hP(i,f):c==="children"?gc(i,f):my(i,c,f,u)}switch(l){case"input":nO(i,o);break;case"textarea":cP(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var d=o.value;d!=null?pa(i,!!o.multiple,d,!1):h!==!!o.multiple&&(o.defaultValue!=null?pa(i,!!o.multiple,o.defaultValue,!0):pa(i,!!o.multiple,o.multiple?[]:"",!1))}i[xc]=o}catch(g){xn(t,t.return,g)}}break;case 6:if(ki(e,t),Wi(t),r&4){if(t.stateNode===null)throw Error(Oe(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(g){xn(t,t.return,g)}}break;case 3:if(ki(e,t),Wi(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{yc(e.containerInfo)}catch(g){xn(t,t.return,g)}break;case 4:ki(e,t),Wi(t);break;case 13:ki(e,t),Wi(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(Vy=Rn())),r&4&&yS(t);break;case 22:if(c=n!==null&&n.memoizedState!==null,t.mode&1?(pr=(u=pr)||c,ki(e,t),pr=u):ki(e,t),Wi(t),r&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(We=t,c=t.child;c!==null;){for(f=We=c;We!==null;){switch(h=We,d=h.child,h.tag){case 0:case 11:case 14:case 15:rc(4,h,h.return);break;case 1:ua(h,h.return);var p=h.stateNode;if(typeof p.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(g){xn(r,n,g)}}break;case 5:ua(h,h.return);break;case 22:if(h.memoizedState!==null){bS(f);continue}}d!==null?(d.return=h,We=d):bS(f)}c=c.sibling}e:for(c=null,f=t;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(l=f.stateNode,a=f.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=dP("display",s))}catch(g){xn(t,t.return,g)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){xn(t,t.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ki(e,t),Wi(t),r&4&&yS(t);break;case 21:break;default:ki(e,t),Wi(t)}}function Wi(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(ZC(n)){var r=n;break e}n=n.return}throw Error(Oe(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(gc(i,""),r.flags&=-33);var o=vS(t);jO(t,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,l=vS(t);NO(t,l,s);break;default:throw Error(Oe(161))}}catch(a){xn(t,t.return,a)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function VM(t,e,n){We=t,XC(t)}function XC(t,e,n){for(var r=(t.mode&1)!==0;We!==null;){var i=We,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Xf;if(!s){var l=i.alternate,a=l!==null&&l.memoizedState!==null||pr;l=Xf;var u=pr;if(Xf=s,(pr=a)&&!u)for(We=i;We!==null;)s=We,a=s.child,s.tag===22&&s.memoizedState!==null?wS(i):a!==null?(a.return=s,We=a):wS(i);for(;o!==null;)We=o,XC(o),o=o.sibling;We=i,Xf=l,pr=u}SS(t)}else i.subtreeFlags&8772&&o!==null?(o.return=i,We=o):SS(t)}}function SS(t){for(;We!==null;){var e=We;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:pr||Kp(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!pr)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Pi(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&rS(e,o,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}rS(e,s,n)}break;case 5:var l=e.stateNode;if(n===null&&e.flags&4){n=l;var a=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&yc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Oe(163))}pr||e.flags&512&&DO(e)}catch(h){xn(e,e.return,h)}}if(e===t){We=null;break}if(n=e.sibling,n!==null){n.return=e.return,We=n;break}We=e.return}}function bS(t){for(;We!==null;){var e=We;if(e===t){We=null;break}var n=e.sibling;if(n!==null){n.return=e.return,We=n;break}We=e.return}}function wS(t){for(;We!==null;){var e=We;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Kp(4,e)}catch(a){xn(e,n,a)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(a){xn(e,i,a)}}var o=e.return;try{DO(e)}catch(a){xn(e,o,a)}break;case 5:var s=e.return;try{DO(e)}catch(a){xn(e,s,a)}}}catch(a){xn(e,e.return,a)}if(e===t){We=null;break}var l=e.sibling;if(l!==null){l.return=e.return,We=l;break}We=e.return}}var GM=Math.ceil,op=Mo.ReactCurrentDispatcher,qy=Mo.ReactCurrentOwner,pi=Mo.ReactCurrentBatchConfig,Nt=0,er=null,Dn=null,lr=0,Ur=0,ca=_s(0),Fn=0,$c=null,hl=0,Jp=0,zy=0,ic=null,Ar=null,Vy=0,Na=1/0,So=null,sp=!1,IO=null,cs=null,Yf=!1,Ko=null,lp=0,oc=0,LO=null,bd=-1,wd=0;function _r(){return Nt&6?Rn():bd!==-1?bd:bd=Rn()}function fs(t){return t.mode&1?Nt&2&&lr!==0?lr&-lr:AM.transition!==null?(wd===0&&(wd=PP()),wd):(t=Gt,t!==0||(t=window.event,t=t===void 0?16:AP(t.type)),t):1}function Mi(t,e,n,r){if(50<oc)throw oc=0,LO=null,Error(Oe(185));ef(t,n,r),(!(Nt&2)||t!==er)&&(t===er&&(!(Nt&2)&&(Jp|=n),Fn===4&&Vo(t,lr)),Lr(t,r),n===1&&Nt===0&&!(e.mode&1)&&(Na=Rn()+500,Vp&&Ps()))}function Lr(t,e){var n=t.callbackNode;A2(t,e);var r=Yd(t,t===er?lr:0);if(r===0)n!==null&&R1(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&R1(n),e===1)t.tag===0?QM(kS.bind(null,t)):KP(kS.bind(null,t)),EM(function(){!(Nt&6)&&Ps()}),n=null;else{switch(CP(r)){case 1:n=by;break;case 4:n=xP;break;case 16:n=Xd;break;case 536870912:n=_P;break;default:n=Xd}n=HC(n,YC.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function YC(t,e){if(bd=-1,wd=0,Nt&6)throw Error(Oe(327));var n=t.callbackNode;if(ya()&&t.callbackNode!==n)return null;var r=Yd(t,t===er?lr:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=ap(t,r);else{e=r;var i=Nt;Nt|=2;var o=FC();(er!==t||lr!==e)&&(So=null,Na=Rn()+500,ol(t,e));do try{JM();break}catch(l){UC(t,l)}while(1);My(),op.current=o,Nt=i,Dn!==null?e=0:(er=null,lr=0,e=Fn)}if(e!==0){if(e===2&&(i=hO(t),i!==0&&(r=i,e=ZO(t,i))),e===1)throw n=$c,ol(t,0),Vo(t,r),Lr(t,Rn()),n;if(e===6)Vo(t,r);else{if(i=t.current.alternate,!(r&30)&&!HM(i)&&(e=ap(t,r),e===2&&(o=hO(t),o!==0&&(r=o,e=ZO(t,o))),e===1))throw n=$c,ol(t,0),Vo(t,r),Lr(t,Rn()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(Oe(345));case 2:Ys(t,Ar,So);break;case 3:if(Vo(t,r),(r&130023424)===r&&(e=Vy+500-Rn(),10<e)){if(Yd(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){_r(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=SO(Ys.bind(null,t,Ar,So),e);break}Ys(t,Ar,So);break;case 4:if(Vo(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-Ai(r);o=1<<s,s=e[s],s>i&&(i=s),r&=~o}if(r=i,r=Rn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*GM(r/1960))-r,10<r){t.timeoutHandle=SO(Ys.bind(null,t,Ar,So),r);break}Ys(t,Ar,So);break;case 5:Ys(t,Ar,So);break;default:throw Error(Oe(329))}}}return Lr(t,Rn()),t.callbackNode===n?YC.bind(null,t):null}function ZO(t,e){var n=ic;return t.current.memoizedState.isDehydrated&&(ol(t,e).flags|=256),t=ap(t,e),t!==2&&(e=Ar,Ar=n,e!==null&&WO(e)),t}function WO(t){Ar===null?Ar=t:Ar.push.apply(Ar,t)}function HM(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!Di(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Vo(t,e){for(e&=~zy,e&=~Jp,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Ai(e),r=1<<n;t[n]=-1,e&=~r}}function kS(t){if(Nt&6)throw Error(Oe(327));ya();var e=Yd(t,0);if(!(e&1))return Lr(t,Rn()),null;var n=ap(t,e);if(t.tag!==0&&n===2){var r=hO(t);r!==0&&(e=r,n=ZO(t,r))}if(n===1)throw n=$c,ol(t,0),Vo(t,e),Lr(t,Rn()),n;if(n===6)throw Error(Oe(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Ys(t,Ar,So),Lr(t,Rn()),null}function Gy(t,e){var n=Nt;Nt|=1;try{return t(e)}finally{Nt=n,Nt===0&&(Na=Rn()+500,Vp&&Ps())}}function dl(t){Ko!==null&&Ko.tag===0&&!(Nt&6)&&ya();var e=Nt;Nt|=1;var n=pi.transition,r=Gt;try{if(pi.transition=null,Gt=1,t)return t()}finally{Gt=r,pi.transition=n,Nt=e,!(Nt&6)&&Ps()}}function Hy(){Ur=ca.current,un(ca)}function ol(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,CM(n)),Dn!==null)for(n=Dn.return;n!==null;){var r=n;switch(Ry(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Vd();break;case 3:Ma(),un(jr),un(vr),Zy();break;case 5:Ly(r);break;case 4:Ma();break;case 13:un(yn);break;case 19:un(yn);break;case 10:Dy(r.type._context);break;case 22:case 23:Hy()}n=n.return}if(er=t,Dn=t=hs(t.current,null),lr=Ur=e,Fn=0,$c=null,zy=Jp=hl=0,Ar=ic=null,Ks!==null){for(e=0;e<Ks.length;e++)if(n=Ks[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Ks=null}return t}function UC(t,e){do{var n=Dn;try{if(My(),vd.current=ip,rp){for(var r=bn.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}rp=!1}if(fl=0,Jn=Xn=bn=null,nc=!1,Cc=0,qy.current=null,n===null||n.return===null){Fn=1,$c=e,Dn=null;break}e:{var o=t,s=n.return,l=n,a=e;if(e=lr,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var d=cS(s);if(d!==null){d.flags&=-257,fS(d,s,l,o,e),d.mode&1&&uS(o,u,e),e=d,a=u;var p=e.updateQueue;if(p===null){var g=new Set;g.add(a),e.updateQueue=g}else p.add(a);break e}else{if(!(e&1)){uS(o,u,e),Ky();break e}a=Error(Oe(426))}}else if(gn&&l.mode&1){var O=cS(s);if(O!==null){!(O.flags&65536)&&(O.flags|=256),fS(O,s,l,o,e),Qy(Da(a,l));break e}}o=a=Da(a,l),Fn!==4&&(Fn=2),ic===null?ic=[o]:ic.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var v=EC(o,a,e);nS(o,v);break e;case 1:l=a;var m=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(cs===null||!cs.has(y)))){o.flags|=65536,e&=-e,o.lanes|=e;var S=TC(o,l,e);nS(o,S);break e}}o=o.return}while(o!==null)}zC(n)}catch(k){e=k,Dn===n&&n!==null&&(Dn=n=n.return);continue}break}while(1)}function FC(){var t=op.current;return op.current=ip,t===null?ip:t}function Ky(){(Fn===0||Fn===3||Fn===2)&&(Fn=4),er===null||!(hl&268435455)&&!(Jp&268435455)||Vo(er,lr)}function ap(t,e){var n=Nt;Nt|=2;var r=FC();(er!==t||lr!==e)&&(So=null,ol(t,e));do try{KM();break}catch(i){UC(t,i)}while(1);if(My(),Nt=n,op.current=r,Dn!==null)throw Error(Oe(261));return er=null,lr=0,Fn}function KM(){for(;Dn!==null;)qC(Dn)}function JM(){for(;Dn!==null&&!x2();)qC(Dn)}function qC(t){var e=GC(t.alternate,t,Ur);t.memoizedProps=t.pendingProps,e===null?zC(t):Dn=e,qy.current=null}function zC(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=FM(n,e),n!==null){n.flags&=32767,Dn=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Fn=6,Dn=null;return}}else if(n=UM(n,e,Ur),n!==null){Dn=n;return}if(e=e.sibling,e!==null){Dn=e;return}Dn=e=t}while(e!==null);Fn===0&&(Fn=5)}function Ys(t,e,n){var r=Gt,i=pi.transition;try{pi.transition=null,Gt=1,eD(t,e,n,r)}finally{pi.transition=i,Gt=r}return null}function eD(t,e,n,r){do ya();while(Ko!==null);if(Nt&6)throw Error(Oe(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(Oe(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(M2(t,o),t===er&&(Dn=er=null,lr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Yf||(Yf=!0,HC(Xd,function(){return ya(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=pi.transition,pi.transition=null;var s=Gt;Gt=1;var l=Nt;Nt|=4,qy.current=null,zM(t,n),BC(n,t),SM(vO),Ud=!!OO,vO=OO=null,t.current=n,VM(n),_2(),Nt=l,Gt=s,pi.transition=o}else t.current=n;if(Yf&&(Yf=!1,Ko=t,lp=i),o=t.pendingLanes,o===0&&(cs=null),E2(n.stateNode),Lr(t,Rn()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(sp)throw sp=!1,t=IO,IO=null,t;return lp&1&&t.tag!==0&&ya(),o=t.pendingLanes,o&1?t===LO?oc++:(oc=0,LO=t):oc=0,Ps(),null}function ya(){if(Ko!==null){var t=CP(lp),e=pi.transition,n=Gt;try{if(pi.transition=null,Gt=16>t?16:t,Ko===null)var r=!1;else{if(t=Ko,Ko=null,lp=0,Nt&6)throw Error(Oe(331));var i=Nt;for(Nt|=4,We=t.current;We!==null;){var o=We,s=o.child;if(We.flags&16){var l=o.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(We=u;We!==null;){var c=We;switch(c.tag){case 0:case 11:case 15:rc(8,c,o)}var f=c.child;if(f!==null)f.return=c,We=f;else for(;We!==null;){c=We;var h=c.sibling,d=c.return;if(LC(c),c===u){We=null;break}if(h!==null){h.return=d,We=h;break}We=d}}}var p=o.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var O=g.sibling;g.sibling=null,g=O}while(g!==null)}}We=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,We=s;else e:for(;We!==null;){if(o=We,o.flags&2048)switch(o.tag){case 0:case 11:case 15:rc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,We=v;break e}We=o.return}}var m=t.current;for(We=m;We!==null;){s=We;var y=s.child;if(s.subtreeFlags&2064&&y!==null)y.return=s,We=y;else e:for(s=m;We!==null;){if(l=We,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Kp(9,l)}}catch(k){xn(l,l.return,k)}if(l===s){We=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,We=S;break e}We=l.return}}if(Nt=i,Ps(),so&&typeof so.onPostCommitFiberRoot=="function")try{so.onPostCommitFiberRoot(Yp,t)}catch{}r=!0}return r}finally{Gt=n,pi.transition=e}}return!1}function xS(t,e,n){e=Da(n,e),e=EC(t,e,1),t=us(t,e,1),e=_r(),t!==null&&(ef(t,1,e),Lr(t,e))}function xn(t,e,n){if(t.tag===3)xS(t,t,n);else for(;e!==null;){if(e.tag===3){xS(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(cs===null||!cs.has(r))){t=Da(n,t),t=TC(e,t,1),e=us(e,t,1),t=_r(),e!==null&&(ef(e,1,t),Lr(e,t));break}}e=e.return}}function tD(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=_r(),t.pingedLanes|=t.suspendedLanes&n,er===t&&(lr&n)===n&&(Fn===4||Fn===3&&(lr&130023424)===lr&&500>Rn()-Vy?ol(t,0):zy|=n),Lr(t,e)}function VC(t,e){e===0&&(t.mode&1?(e=Mf,Mf<<=1,!(Mf&130023424)&&(Mf=4194304)):e=1);var n=_r();t=To(t,e),t!==null&&(ef(t,e,n),Lr(t,n))}function nD(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),VC(t,n)}function rD(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Oe(314))}r!==null&&r.delete(e),VC(t,n)}var GC;GC=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||jr.current)Dr=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Dr=!1,YM(t,e,n);Dr=!!(t.flags&131072)}else Dr=!1,gn&&e.flags&1048576&&JP(e,Kd,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Sd(t,e),t=e.pendingProps;var i=Ra(e,vr.current);va(e,n),i=By(null,e,r,t,i,n);var o=Xy();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ir(r)?(o=!0,Gd(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,jy(e),i.updater=Gp,e.stateNode=i,i._reactInternals=e,CO(e,r,t,n),e=$O(null,e,r,!0,o,n)):(e.tag=0,gn&&o&&$y(e),kr(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Sd(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=oD(r),t=Pi(r,t),i){case 0:e=TO(null,e,r,t,n);break e;case 1:e=pS(null,e,r,t,n);break e;case 11:e=hS(null,e,r,t,n);break e;case 14:e=dS(null,e,r,Pi(r.type,t),n);break e}throw Error(Oe(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pi(r,i),TO(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pi(r,i),pS(t,e,r,i,n);case 3:e:{if(AC(e),t===null)throw Error(Oe(387));r=e.pendingProps,o=e.memoizedState,i=o.element,rC(t,e),tp(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Da(Error(Oe(423)),e),e=gS(t,e,r,n,i);break e}else if(r!==i){i=Da(Error(Oe(424)),e),e=gS(t,e,r,n,i);break e}else for(Vr=as(e.stateNode.containerInfo.firstChild),Hr=e,gn=!0,Ti=null,n=lC(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qa(),r===i){e=$o(t,e,n);break e}kr(t,e,r,n)}e=e.child}return e;case 5:return aC(e),t===null&&xO(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,yO(r,i)?s=null:o!==null&&yO(r,o)&&(e.flags|=32),QC(t,e),kr(t,e,s,n),e.child;case 6:return t===null&&xO(e),null;case 13:return MC(t,e,n);case 4:return Iy(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Aa(e,null,r,n):kr(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pi(r,i),hS(t,e,r,i,n);case 7:return kr(t,e,e.pendingProps,n),e.child;case 8:return kr(t,e,e.pendingProps.children,n),e.child;case 12:return kr(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,rn(Jd,r._currentValue),r._currentValue=s,o!==null)if(Di(o.value,s)){if(o.children===i.children&&!jr.current){e=$o(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);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=_o(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),_O(o.return,n,e),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Oe(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),_O(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}kr(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,va(e,n),i=mi(i),r=r(i),e.flags|=1,kr(t,e,r,n),e.child;case 14:return r=e.type,i=Pi(r,e.pendingProps),i=Pi(r.type,i),dS(t,e,r,i,n);case 15:return $C(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Pi(r,i),Sd(t,e),e.tag=1,Ir(r)?(t=!0,Gd(e)):t=!1,va(e,n),oC(e,r,i),CO(e,r,i,n),$O(null,e,r,!0,t,n);case 19:return DC(t,e,n);case 22:return RC(t,e,n)}throw Error(Oe(156,e.tag))};function HC(t,e){return kP(t,e)}function iD(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ci(t,e,n,r){return new iD(t,e,n,r)}function Jy(t){return t=t.prototype,!(!t||!t.isReactComponent)}function oD(t){if(typeof t=="function")return Jy(t)?1:0;if(t!=null){if(t=t.$$typeof,t===vy)return 11;if(t===yy)return 14}return 2}function hs(t,e){var n=t.alternate;return n===null?(n=ci(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function kd(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")Jy(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case ea:return sl(n.children,i,o,e);case Oy:s=8,i|=8;break;case Hm:return t=ci(12,n,e,i|2),t.elementType=Hm,t.lanes=o,t;case Km:return t=ci(13,n,e,i),t.elementType=Km,t.lanes=o,t;case Jm:return t=ci(19,n,e,i),t.elementType=Jm,t.lanes=o,t;case sP:return eg(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case iP:s=10;break e;case oP:s=9;break e;case vy:s=11;break e;case yy:s=14;break e;case Bo:s=16,r=null;break e}throw Error(Oe(130,t==null?t:typeof t,""))}return e=ci(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function sl(t,e,n,r){return t=ci(7,t,r,e),t.lanes=n,t}function eg(t,e,n,r){return t=ci(22,t,r,e),t.elementType=sP,t.lanes=n,t.stateNode={isHidden:!1},t}function Vg(t,e,n){return t=ci(6,t,null,e),t.lanes=n,t}function Gg(t,e,n){return e=ci(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function sD(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=$g(0),this.expirationTimes=$g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$g(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function e0(t,e,n,r,i,o,s,l,a){return t=new sD(t,e,n,l,a),e===1?(e=1,o===!0&&(e|=8)):e=0,o=ci(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jy(o),t}function lD(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Jl,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function KC(t){if(!t)return Os;t=t._reactInternals;e:{if(Sl(t)!==t||t.tag!==1)throw Error(Oe(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ir(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(Oe(171))}if(t.tag===1){var n=t.type;if(Ir(n))return HP(t,n,e)}return e}function JC(t,e,n,r,i,o,s,l,a){return t=e0(n,r,!0,t,i,o,s,l,a),t.context=KC(null),n=t.current,r=_r(),i=fs(n),o=_o(r,i),o.callback=e??null,us(n,o,i),t.current.lanes=i,ef(t,i,r),Lr(t,r),t}function tg(t,e,n,r){var i=e.current,o=_r(),s=fs(i);return n=KC(n),e.context===null?e.context=n:e.pendingContext=n,e=_o(o,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=us(i,e,s),t!==null&&(Mi(t,i,s,o),Od(t,i,s)),s}function up(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function _S(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function t0(t,e){_S(t,e),(t=t.alternate)&&_S(t,e)}function aD(){return null}var eE=typeof reportError=="function"?reportError:function(t){console.error(t)};function n0(t){this._internalRoot=t}ng.prototype.render=n0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(Oe(409));tg(t,e,null,null)};ng.prototype.unmount=n0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;dl(function(){tg(null,t,null,null)}),e[Eo]=null}};function ng(t){this._internalRoot=t}ng.prototype.unstable_scheduleHydration=function(t){if(t){var e=$P();t={blockedOn:null,target:t,priority:e};for(var n=0;n<zo.length&&e!==0&&e<zo[n].priority;n++);zo.splice(n,0,t),n===0&&QP(t)}};function r0(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function rg(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function PS(){}function uD(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=up(s);o.call(u)}}var s=JC(e,r,t,0,null,!1,!1,"",PS);return t._reactRootContainer=s,t[Eo]=s.current,wc(t.nodeType===8?t.parentNode:t),dl(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var l=r;r=function(){var u=up(a);l.call(u)}}var a=e0(t,0,!1,null,null,!1,!1,"",PS);return t._reactRootContainer=a,t[Eo]=a.current,wc(t.nodeType===8?t.parentNode:t),dl(function(){tg(e,a,n,r)}),a}function ig(t,e,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var l=i;i=function(){var a=up(s);l.call(a)}}tg(e,s,t,i)}else s=uD(n,e,t,i,r);return up(s)}EP=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Wu(e.pendingLanes);n!==0&&(wy(e,n|1),Lr(e,Rn()),!(Nt&6)&&(Na=Rn()+500,Ps()))}break;case 13:dl(function(){var r=To(t,1);if(r!==null){var i=_r();Mi(r,t,1,i)}}),t0(t,1)}};ky=function(t){if(t.tag===13){var e=To(t,134217728);if(e!==null){var n=_r();Mi(e,t,134217728,n)}t0(t,134217728)}};TP=function(t){if(t.tag===13){var e=fs(t),n=To(t,e);if(n!==null){var r=_r();Mi(n,t,e,r)}t0(t,e)}};$P=function(){return Gt};RP=function(t,e){var n=Gt;try{return Gt=t,e()}finally{Gt=n}};uO=function(t,e,n){switch(e){case"input":if(nO(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=zp(r);if(!i)throw Error(Oe(90));aP(r),nO(r,i)}}}break;case"textarea":cP(t,n);break;case"select":e=n.value,e!=null&&pa(t,!!n.multiple,e,!1)}};OP=Gy;vP=dl;var cD={usingClientEntryPoint:!1,Events:[nf,ia,zp,gP,mP,Gy]},yu={findFiberByHostInstance:Hs,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},fD={bundleType:yu.bundleType,version:yu.version,rendererPackageName:yu.rendererPackageName,rendererConfig:yu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Mo.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=bP(t),t===null?null:t.stateNode},findFiberByHostInstance:yu.findFiberByHostInstance||aD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Uf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Uf.isDisabled&&Uf.supportsFiber)try{Yp=Uf.inject(fD),so=Uf}catch{}}ei.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cD;ei.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!r0(e))throw Error(Oe(200));return lD(t,e,null,n)};ei.createRoot=function(t,e){if(!r0(t))throw Error(Oe(299));var n=!1,r="",i=eE;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=e0(t,1,!1,null,null,n,!1,r,i),t[Eo]=e.current,wc(t.nodeType===8?t.parentNode:t),new n0(e)};ei.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(Oe(188)):(t=Object.keys(t).join(","),Error(Oe(268,t)));return t=bP(e),t=t===null?null:t.stateNode,t};ei.flushSync=function(t){return dl(t)};ei.hydrate=function(t,e,n){if(!rg(e))throw Error(Oe(200));return ig(null,t,e,!0,n)};ei.hydrateRoot=function(t,e,n){if(!r0(t))throw Error(Oe(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=eE;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=JC(e,null,t,1,n??null,i,!1,o,s),t[Eo]=e.current,wc(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new ng(e)};ei.render=function(t,e,n){if(!rg(e))throw Error(Oe(200));return ig(null,t,e,!1,n)};ei.unmountComponentAtNode=function(t){if(!rg(t))throw Error(Oe(40));return t._reactRootContainer?(dl(function(){ig(null,null,t,!1,function(){t._reactRootContainer=null,t[Eo]=null})}),!0):!1};ei.unstable_batchedUpdates=Gy;ei.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!rg(n))throw Error(Oe(200));if(t==null||t._reactInternals===void 0)throw Error(Oe(38));return ig(t,e,n,!1,r)};ei.version="18.2.0-next-9e3b772b8-20220608";function tE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tE)}catch(t){console.error(t)}}tE(),J_.exports=ei;var of=J_.exports;const Ff=vi(of);var nE,CS=of;nE=CS.createRoot,CS.hydrateRoot;function Jo(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var rE={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function(){function n(r,i,o){function s(u,c){if(!i[u]){if(!r[u]){var f=typeof Jo=="function"&&Jo;if(!c&&f)return f(u,!0);if(l)return l(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var d=i[u]={exports:{}};r[u][0].call(d.exports,function(p){var g=r[u][1][p];return s(g||p)},d,d.exports,n,r,i,o)}return i[u].exports}for(var l=typeof Jo=="function"&&Jo,a=0;a<o.length;a++)s(o[a]);return s}return n}()({1:[function(n,r,i){(function(o,s){(function(){(function(l,a){a(typeof i=="object"&&typeof r<"u"?i:l.async={})})(this,function(l){function a(Q,...T){return(...A)=>Q(...T,...A)}function u(Q){return function(...T){var A=T.pop();return Q.call(this,T,A)}}var c=typeof queueMicrotask=="function"&&queueMicrotask,f=typeof s=="function"&&s,h=typeof o=="object"&&typeof o.nextTick=="function";function d(Q){setTimeout(Q,0)}function p(Q){return(T,...A)=>Q(()=>T(...A))}var g;c?g=queueMicrotask:f?g=s:h?g=o.nextTick:g=d;var O=p(g);function v(Q){return S(Q)?function(...T){const A=T.pop(),B=Q.apply(this,T);return m(B,A)}:u(function(T,A){var B;try{B=Q.apply(this,T)}catch(K){return A(K)}if(B&&typeof B.then=="function")return m(B,A);A(null,B)})}function m(Q,T){return Q.then(A=>{y(T,null,A)},A=>{y(T,A&&A.message?A:new Error(A))})}function y(Q,T,A){try{Q(T,A)}catch(B){O(K=>{throw K},B)}}function S(Q){return Q[Symbol.toStringTag]==="AsyncFunction"}function k(Q){return Q[Symbol.toStringTag]==="AsyncGenerator"}function P(Q){return typeof Q[Symbol.asyncIterator]=="function"}function C(Q){if(typeof Q!="function")throw new Error("expected a function");return S(Q)?v(Q):Q}function w(Q,T=Q.length){if(!T)throw new Error("arity is undefined");function A(...B){return typeof B[T-1]=="function"?Q.apply(this,B):new Promise((K,te)=>{B[T-1]=(re,...ie)=>{if(re)return te(re);K(ie.length>1?ie:ie[0])},Q.apply(this,B)})}return A}function x(Q){return function(A,...B){return w(function(te){var re=this;return Q(A,(ie,fe)=>{C(ie).apply(re,B.concat(fe))},te)})}}function _(Q,T,A,B){T=T||[];var K=[],te=0,re=C(A);return Q(T,(ie,fe,Ge)=>{var $t=te++;re(ie,(It,Qt)=>{K[$t]=Qt,Ge(It)})},ie=>{B(ie,K)})}function E(Q){return Q&&typeof Q.length=="number"&&Q.length>=0&&Q.length%1===0}const $={};function j(Q){function T(...A){if(Q!==null){var B=Q;Q=null,B.apply(this,A)}}return Object.assign(T,Q),T}function W(Q){return Q[Symbol.iterator]&&Q[Symbol.iterator]()}function G(Q){var T=-1,A=Q.length;return function(){return++T<A?{value:Q[T],key:T}:null}}function M(Q){var T=-1;return function(){var B=Q.next();return B.done?null:(T++,{value:B.value,key:T})}}function L(Q){var T=Q?Object.keys(Q):[],A=-1,B=T.length;return function K(){var te=T[++A];return te==="__proto__"?K():A<B?{value:Q[te],key:te}:null}}function N(Q){if(E(Q))return G(Q);var T=W(Q);return T?M(T):L(Q)}function Y(Q){return function(...T){if(Q===null)throw new Error("Callback was already called.");var A=Q;Q=null,A.apply(this,T)}}function q(Q,T,A,B){let K=!1,te=!1,re=!1,ie=0,fe=0;function Ge(){ie>=T||re||K||(re=!0,Q.next().then(({value:Qt,done:oi})=>{if(!(te||K)){if(re=!1,oi){K=!0,ie<=0&&B(null);return}ie++,A(Qt,fe,$t),fe++,Ge()}}).catch(It))}function $t(Qt,oi){if(ie-=1,!te){if(Qt)return It(Qt);if(Qt===!1){K=!0,te=!0;return}if(oi===$||K&&ie<=0)return K=!0,B(null);Ge()}}function It(Qt){te||(re=!1,K=!0,B(Qt))}Ge()}var ae=Q=>(T,A,B)=>{if(B=j(B),Q<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!T)return B(null);if(k(T))return q(T,Q,A,B);if(P(T))return q(T[Symbol.asyncIterator](),Q,A,B);var K=N(T),te=!1,re=!1,ie=0,fe=!1;function Ge(It,Qt){if(!re)if(ie-=1,It)te=!0,B(It);else if(It===!1)te=!0,re=!0;else{if(Qt===$||te&&ie<=0)return te=!0,B(null);fe||$t()}}function $t(){for(fe=!0;ie<Q&&!te;){var It=K();if(It===null){te=!0,ie<=0&&B(null);return}ie+=1,A(It.value,It.key,Y(Ge))}fe=!1}$t()};function pe(Q,T,A,B){return ae(T)(Q,C(A),B)}var U=w(pe,4);function H(Q,T,A){A=j(A);var B=0,K=0,{length:te}=Q,re=!1;te===0&&A(null);function ie(fe,Ge){fe===!1&&(re=!0),re!==!0&&(fe?A(fe):(++K===te||Ge===$)&&A(null))}for(;B<te;B++)T(Q[B],B,Y(ie))}function se(Q,T,A){return U(Q,1/0,T,A)}function Ie(Q,T,A){var B=E(Q)?H:se;return B(Q,C(T),A)}var F=w(Ie,3);function z(Q,T,A){return _(F,Q,T,A)}var J=w(z,3),be=x(J);function Ae(Q,T,A){return U(Q,1,T,A)}var Me=w(Ae,3);function De(Q,T,A){return _(Me,Q,T,A)}var nt=w(De,3),st=x(nt);const Tt=Symbol("promiseCallback");function cn(){let Q,T;function A(B,...K){if(B)return T(B);Q(K.length>1?K:K[0])}return A[Tt]=new Promise((B,K)=>{Q=B,T=K}),A}function tr(Q,T,A){typeof T!="number"&&(A=T,T=null),A=j(A||cn());var B=Object.keys(Q).length;if(!B)return A(null);T||(T=B);var K={},te=0,re=!1,ie=!1,fe=Object.create(null),Ge=[],$t=[],It={};Object.keys(Q).forEach(Ve=>{var ot=Q[Ve];if(!Array.isArray(ot)){Qt(Ve,[ot]),$t.push(Ve);return}var At=ot.slice(0,ot.length-1),pn=At.length;if(pn===0){Qt(Ve,ot),$t.push(Ve);return}It[Ve]=pn,At.forEach(Gn=>{if(!Q[Gn])throw new Error("async.auto task `"+Ve+"` has a non-existent dependency `"+Gn+"` in "+At.join(", "));Ql(Gn,()=>{pn--,pn===0&&Qt(Ve,ot)})})}),Lt(),oi();function Qt(Ve,ot){Ge.push(()=>cu(Ve,ot))}function oi(){if(!re){if(Ge.length===0&&te===0)return A(null,K);for(;Ge.length&&te<T;){var Ve=Ge.shift();Ve()}}}function Ql(Ve,ot){var At=fe[Ve];At||(At=fe[Ve]=[]),At.push(ot)}function Ns(Ve){var ot=fe[Ve]||[];ot.forEach(At=>At()),oi()}function cu(Ve,ot){if(!ie){var At=Y((Gn,...si)=>{if(te--,Gn===!1){re=!0;return}if(si.length<2&&([si]=si),Gn){var Al={};if(Object.keys(K).forEach(js=>{Al[js]=K[js]}),Al[Ve]=si,ie=!0,fe=Object.create(null),re)return;A(Gn,Al)}else K[Ve]=si,Ns(Ve)});te++;var pn=C(ot[ot.length-1]);ot.length>1?pn(K,At):pn(At)}}function Lt(){for(var Ve,ot=0;$t.length;)Ve=$t.pop(),ot++,it(Ve).forEach(At=>{--It[At]===0&&$t.push(At)});if(ot!==B)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}function it(Ve){var ot=[];return Object.keys(Q).forEach(At=>{const pn=Q[At];Array.isArray(pn)&&pn.indexOf(Ve)>=0&&ot.push(At)}),ot}return A[Tt]}var Pn=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,Qn=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,wi=/,/,jn=/(=.+)?(\s*)$/;function R(Q){let T="",A=0,B=Q.indexOf("*/");for(;A<Q.length;)if(Q[A]==="/"&&Q[A+1]==="/"){let K=Q.indexOf(`
41
- `,A);A=K===-1?Q.length:K}else if(B!==-1&&Q[A]==="/"&&Q[A+1]==="*"){let K=Q.indexOf("*/",A);K!==-1?(A=K+2,B=Q.indexOf("*/",A)):(T+=Q[A],A++)}else T+=Q[A],A++;return T}function ne(Q){const T=R(Q.toString());let A=T.match(Pn);if(A||(A=T.match(Qn)),!A)throw new Error(`could not parse args in autoInject
42
- Source:
43
- `+T);let[,B]=A;return B.replace(/\s/g,"").split(wi).map(K=>K.replace(jn,"").trim())}function ce(Q,T){var A={};return Object.keys(Q).forEach(B=>{var K=Q[B],te,re=S(K),ie=!re&&K.length===1||re&&K.length===0;if(Array.isArray(K))te=[...K],K=te.pop(),A[B]=te.concat(te.length>0?fe:K);else if(ie)A[B]=K;else{if(te=ne(K),K.length===0&&!re&&te.length===0)throw new Error("autoInject task functions require explicit parameters.");re||te.pop(),A[B]=te.concat(fe)}function fe(Ge,$t){var It=te.map(Qt=>Ge[Qt]);It.push($t),C(K)(...It)}}),tr(A,T)}class we{constructor(){this.head=this.tail=null,this.length=0}removeLink(T){return T.prev?T.prev.next=T.next:this.head=T.next,T.next?T.next.prev=T.prev:this.tail=T.prev,T.prev=T.next=null,this.length-=1,T}empty(){for(;this.head;)this.shift();return this}insertAfter(T,A){A.prev=T,A.next=T.next,T.next?T.next.prev=A:this.tail=A,T.next=A,this.length+=1}insertBefore(T,A){A.prev=T.prev,A.next=T,T.prev?T.prev.next=A:this.head=A,T.prev=A,this.length+=1}unshift(T){this.head?this.insertBefore(this.head,T):ye(this,T)}push(T){this.tail?this.insertAfter(this.tail,T):ye(this,T)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var T=this.head;T;)yield T.data,T=T.next}remove(T){for(var A=this.head;A;){var{next:B}=A;T(A)&&this.removeLink(A),A=B}return this}}function ye(Q,T){Q.length=1,Q.head=Q.tail=T}function Pe(Q,T,A){if(T==null)T=1;else if(T===0)throw new RangeError("Concurrency must not be zero");var B=C(Q),K=0,te=[];const re={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function ie(it,Ve){re[it].push(Ve)}function fe(it,Ve){const ot=(...At)=>{Ge(it,ot),Ve(...At)};re[it].push(ot)}function Ge(it,Ve){if(!it)return Object.keys(re).forEach(ot=>re[ot]=[]);if(!Ve)return re[it]=[];re[it]=re[it].filter(ot=>ot!==Ve)}function $t(it,...Ve){re[it].forEach(ot=>ot(...Ve))}var It=!1;function Qt(it,Ve,ot,At){if(At!=null&&typeof At!="function")throw new Error("task callback must be a function");Lt.started=!0;var pn,Gn;function si(js,...fu){if(js)return ot?Gn(js):pn();if(fu.length<=1)return pn(fu[0]);pn(fu)}var Al=Lt._createTaskItem(it,ot?si:At||si);if(Ve?Lt._tasks.unshift(Al):Lt._tasks.push(Al),It||(It=!0,O(()=>{It=!1,Lt.process()})),ot||!At)return new Promise((js,fu)=>{pn=js,Gn=fu})}function oi(it){return function(Ve,...ot){K-=1;for(var At=0,pn=it.length;At<pn;At++){var Gn=it[At],si=te.indexOf(Gn);si===0?te.shift():si>0&&te.splice(si,1),Gn.callback(Ve,...ot),Ve!=null&&$t("error",Ve,Gn.data)}K<=Lt.concurrency-Lt.buffer&&$t("unsaturated"),Lt.idle()&&$t("drain"),Lt.process()}}function Ql(it){return it.length===0&&Lt.idle()?(O(()=>$t("drain")),!0):!1}const Ns=it=>Ve=>{if(!Ve)return new Promise((ot,At)=>{fe(it,(pn,Gn)=>{if(pn)return At(pn);ot(Gn)})});Ge(it),ie(it,Ve)};var cu=!1,Lt={_tasks:new we,_createTaskItem(it,Ve){return{data:it,callback:Ve}},*[Symbol.iterator](){yield*Lt._tasks[Symbol.iterator]()},concurrency:T,payload:A,buffer:T/4,started:!1,paused:!1,push(it,Ve){return Array.isArray(it)?Ql(it)?void 0:it.map(ot=>Qt(ot,!1,!1,Ve)):Qt(it,!1,!1,Ve)},pushAsync(it,Ve){return Array.isArray(it)?Ql(it)?void 0:it.map(ot=>Qt(ot,!1,!0,Ve)):Qt(it,!1,!0,Ve)},kill(){Ge(),Lt._tasks.empty()},unshift(it,Ve){return Array.isArray(it)?Ql(it)?void 0:it.map(ot=>Qt(ot,!0,!1,Ve)):Qt(it,!0,!1,Ve)},unshiftAsync(it,Ve){return Array.isArray(it)?Ql(it)?void 0:it.map(ot=>Qt(ot,!0,!0,Ve)):Qt(it,!0,!0,Ve)},remove(it){Lt._tasks.remove(it)},process(){if(!cu){for(cu=!0;!Lt.paused&&K<Lt.concurrency&&Lt._tasks.length;){var it=[],Ve=[],ot=Lt._tasks.length;Lt.payload&&(ot=Math.min(ot,Lt.payload));for(var At=0;At<ot;At++){var pn=Lt._tasks.shift();it.push(pn),te.push(pn),Ve.push(pn.data)}K+=1,Lt._tasks.length===0&&$t("empty"),K===Lt.concurrency&&$t("saturated");var Gn=Y(oi(it));B(Ve,Gn)}cu=!1}},length(){return Lt._tasks.length},running(){return K},workersList(){return te},idle(){return Lt._tasks.length+K===0},pause(){Lt.paused=!0},resume(){Lt.paused!==!1&&(Lt.paused=!1,O(Lt.process))}};return Object.defineProperties(Lt,{saturated:{writable:!1,value:Ns("saturated")},unsaturated:{writable:!1,value:Ns("unsaturated")},empty:{writable:!1,value:Ns("empty")},drain:{writable:!1,value:Ns("drain")},error:{writable:!1,value:Ns("error")}}),Lt}function Je(Q,T){return Pe(Q,1,T)}function tt(Q,T,A){return Pe(Q,T,A)}function ue(Q,T,A,B){B=j(B);var K=C(A);return Me(Q,(te,re,ie)=>{K(T,te,(fe,Ge)=>{T=Ge,ie(fe)})},te=>B(te,T))}var _e=w(ue,4);function Se(...Q){var T=Q.map(C);return function(...A){var B=this,K=A[A.length-1];return typeof K=="function"?A.pop():K=cn(),_e(T,A,(te,re,ie)=>{re.apply(B,te.concat((fe,...Ge)=>{ie(fe,Ge)}))},(te,re)=>K(te,...re)),K[Tt]}}function ke(...Q){return Se(...Q.reverse())}function Qe(Q,T,A,B){return _(ae(T),Q,A,B)}var Le=w(Qe,4);function lt(Q,T,A,B){var K=C(A);return Le(Q,T,(te,re)=>{K(te,(ie,...fe)=>ie?re(ie):re(ie,fe))},(te,re)=>{for(var ie=[],fe=0;fe<re.length;fe++)re[fe]&&(ie=ie.concat(...re[fe]));return B(te,ie)})}var ge=w(lt,4);function Be(Q,T,A){return ge(Q,1/0,T,A)}var pt=w(Be,3);function Fe(Q,T,A){return ge(Q,1,T,A)}var at=w(Fe,3);function Rt(...Q){return function(...T){var A=T.pop();return A(null,...Q)}}function zt(Q,T){return(A,B,K,te)=>{var re=!1,ie;const fe=C(K);A(B,(Ge,$t,It)=>{fe(Ge,(Qt,oi)=>{if(Qt||Qt===!1)return It(Qt);if(Q(oi)&&!ie)return re=!0,ie=T(!0,Ge),It(null,$);It()})},Ge=>{if(Ge)return te(Ge);te(null,re?ie:T(!1))})}}function Wt(Q,T,A){return zt(B=>B,(B,K)=>K)(F,Q,T,A)}var Ut=w(Wt,3);function Cn(Q,T,A,B){return zt(K=>K,(K,te)=>te)(ae(T),Q,A,B)}var On=w(Cn,4);function $r(Q,T,A){return zt(B=>B,(B,K)=>K)(ae(1),Q,T,A)}var An=w($r,3);function In(Q){return(T,...A)=>C(T)(...A,(B,...K)=>{typeof console=="object"&&(B?console.error&&console.error(B):console[Q]&&K.forEach(te=>console[Q](te)))})}var Ln=In("dir");function yt(Q,T,A){A=Y(A);var B=C(Q),K=C(T),te;function re(fe,...Ge){if(fe)return A(fe);fe!==!1&&(te=Ge,K(...Ge,ie))}function ie(fe,Ge){if(fe)return A(fe);if(fe!==!1){if(!Ge)return A(null,...te);B(re)}}return ie(null,!0)}var Ze=w(yt,3);function qe(Q,T,A){const B=C(T);return Ze(Q,(...K)=>{const te=K.pop();B(...K,(re,ie)=>te(re,!ie))},A)}function He(Q){return(T,A,B)=>Q(T,B)}function Te(Q,T,A){return F(Q,He(C(T)),A)}var me=w(Te,3);function ct(Q,T,A,B){return ae(T)(Q,He(C(A)),B)}var ht=w(ct,4);function kt(Q,T,A){return ht(Q,1,T,A)}var Vt=w(kt,3);function en(Q){return S(Q)?Q:function(...T){var A=T.pop(),B=!0;T.push((...K)=>{B?O(()=>A(...K)):A(...K)}),Q.apply(this,T),B=!1}}function Ft(Q,T,A){return zt(B=>!B,B=>!B)(F,Q,T,A)}var fn=w(Ft,3);function gt(Q,T,A,B){return zt(K=>!K,K=>!K)(ae(T),Q,A,B)}var ut=w(gt,4);function Xe(Q,T,A){return zt(B=>!B,B=>!B)(Me,Q,T,A)}var xt=w(Xe,3);function En(Q,T,A,B){var K=new Array(T.length);Q(T,(te,re,ie)=>{A(te,(fe,Ge)=>{K[re]=!!Ge,ie(fe)})},te=>{if(te)return B(te);for(var re=[],ie=0;ie<T.length;ie++)K[ie]&&re.push(T[ie]);B(null,re)})}function Rr(Q,T,A,B){var K=[];Q(T,(te,re,ie)=>{A(te,(fe,Ge)=>{if(fe)return ie(fe);Ge&&K.push({index:re,value:te}),ie(fe)})},te=>{if(te)return B(te);B(null,K.sort((re,ie)=>re.index-ie.index).map(re=>re.value))})}function Sr(Q,T,A,B){var K=E(T)?En:Rr;return K(Q,T,C(A),B)}function br(Q,T,A){return Sr(F,Q,T,A)}var D=w(br,3);function I(Q,T,A,B){return Sr(ae(T),Q,A,B)}var X=w(I,4);function le(Q,T,A){return Sr(Me,Q,T,A)}var V=w(le,3);function he(Q,T){var A=Y(T),B=C(en(Q));function K(te){if(te)return A(te);te!==!1&&B(K)}return K()}var Ce=w(he,2);function de(Q,T,A,B){var K=C(A);return Le(Q,T,(te,re)=>{K(te,(ie,fe)=>ie?re(ie):re(ie,{key:fe,val:te}))},(te,re)=>{for(var ie={},{hasOwnProperty:fe}=Object.prototype,Ge=0;Ge<re.length;Ge++)if(re[Ge]){var{key:$t}=re[Ge],{val:It}=re[Ge];fe.call(ie,$t)?ie[$t].push(It):ie[$t]=[It]}return B(te,ie)})}var ve=w(de,4);function et(Q,T,A){return ve(Q,1/0,T,A)}function Re(Q,T,A){return ve(Q,1,T,A)}var _t=In("log");function Bt(Q,T,A,B){B=j(B);var K={},te=C(A);return ae(T)(Q,(re,ie,fe)=>{te(re,ie,(Ge,$t)=>{if(Ge)return fe(Ge);K[ie]=$t,fe(Ge)})},re=>B(re,K))}var rt=w(Bt,4);function St(Q,T,A){return rt(Q,1/0,T,A)}function vt(Q,T,A){return rt(Q,1,T,A)}function mt(Q,T=A=>A){var A=Object.create(null),B=Object.create(null),K=C(Q),te=u((re,ie)=>{var fe=T(...re);fe in A?O(()=>ie(null,...A[fe])):fe in B?B[fe].push(ie):(B[fe]=[ie],K(...re,(Ge,...$t)=>{Ge||(A[fe]=$t);var It=B[fe];delete B[fe];for(var Qt=0,oi=It.length;Qt<oi;Qt++)It[Qt](Ge,...$t)}))});return te.memo=A,te.unmemoized=Q,te}var wt;h?wt=o.nextTick:f?wt=s:wt=d;var hn=p(wt),on=w((Q,T,A)=>{var B=E(T)?[]:{};Q(T,(K,te,re)=>{C(K)((ie,...fe)=>{fe.length<2&&([fe]=fe),B[te]=fe,re(ie)})},K=>A(K,B))},3);function bt(Q,T){return on(F,Q,T)}function Xt(Q,T,A){return on(ae(T),Q,A)}function jt(Q,T){var A=C(Q);return Pe((B,K)=>{A(B[0],K)},T,1)}class dn{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(T){let A;for(;T>0&&vn(this.heap[T],this.heap[A=Tn(T)]);){let B=this.heap[T];this.heap[T]=this.heap[A],this.heap[A]=B,T=A}}percDown(T){let A;for(;(A=Zn(T))<this.heap.length&&(A+1<this.heap.length&&vn(this.heap[A+1],this.heap[A])&&(A=A+1),!vn(this.heap[T],this.heap[A]));){let B=this.heap[T];this.heap[T]=this.heap[A],this.heap[A]=B,T=A}}push(T){T.pushCount=++this.pushCount,this.heap.push(T),this.percUp(this.heap.length-1)}unshift(T){return this.heap.push(T)}shift(){let[T]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),T}toArray(){return[...this]}*[Symbol.iterator](){for(let T=0;T<this.heap.length;T++)yield this.heap[T].data}remove(T){let A=0;for(let B=0;B<this.heap.length;B++)T(this.heap[B])||(this.heap[A]=this.heap[B],A++);this.heap.splice(A);for(let B=Tn(this.heap.length-1);B>=0;B--)this.percDown(B);return this}}function Zn(Q){return(Q<<1)+1}function Tn(Q){return(Q+1>>1)-1}function vn(Q,T){return Q.priority!==T.priority?Q.priority<T.priority:Q.pushCount<T.pushCount}function Wn(Q,T){var A=jt(Q,T),{push:B,pushAsync:K}=A;A._tasks=new dn,A._createTaskItem=({data:re,priority:ie},fe)=>({data:re,priority:ie,callback:fe});function te(re,ie){return Array.isArray(re)?re.map(fe=>({data:fe,priority:ie})):{data:re,priority:ie}}return A.push=function(re,ie=0,fe){return B(te(re,ie),fe)},A.pushAsync=function(re,ie=0,fe){return K(te(re,ie),fe)},delete A.unshift,delete A.unshiftAsync,A}function Zr(Q,T){if(T=j(T),!Array.isArray(Q))return T(new TypeError("First argument to race must be an array of functions"));if(!Q.length)return T();for(var A=0,B=Q.length;A<B;A++)C(Q[A])(T)}var Vn=w(Zr,2);function ni(Q,T,A,B){var K=[...Q].reverse();return _e(K,T,A,B)}function ri(Q){var T=C(Q);return u(function(B,K){return B.push((te,...re)=>{let ie={};if(te&&(ie.error=te),re.length>0){var fe=re;re.length<=1&&([fe]=re),ie.value=fe}K(null,ie)}),T.apply(this,B)})}function ur(Q){var T;return Array.isArray(Q)?T=Q.map(ri):(T={},Object.keys(Q).forEach(A=>{T[A]=ri.call(this,Q[A])})),T}function wr(Q,T,A,B){const K=C(A);return Sr(Q,T,(te,re)=>{K(te,(ie,fe)=>{re(ie,!fe)})},B)}function _l(Q,T,A){return wr(F,Q,T,A)}var Zi=w(_l,3);function Pl(Q,T,A,B){return wr(ae(T),Q,A,B)}var Cl=w(Pl,4);function As(Q,T,A){return wr(Me,Q,T,A)}var Ms=w(As,3);function po(Q){return function(){return Q}}const ii=5,No=0;function go(Q,T,A){var B={times:ii,intervalFunc:po(No)};if(arguments.length<3&&typeof Q=="function"?(A=T||cn(),T=Q):(mo(B,Q),A=A||cn()),typeof T!="function")throw new Error("Invalid arguments for async.retry");var K=C(T),te=1;function re(){K((ie,...fe)=>{ie!==!1&&(ie&&te++<B.times&&(typeof B.errorFilter!="function"||B.errorFilter(ie))?setTimeout(re,B.intervalFunc(te-1)):A(ie,...fe))})}return re(),A[Tt]}function mo(Q,T){if(typeof T=="object")Q.times=+T.times||ii,Q.intervalFunc=typeof T.interval=="function"?T.interval:po(+T.interval||No),Q.errorFilter=T.errorFilter;else if(typeof T=="number"||typeof T=="string")Q.times=+T||ii;else throw new Error("Invalid arguments for async.retry")}function El(Q,T){T||(T=Q,Q=null);let A=Q&&Q.arity||T.length;S(T)&&(A+=1);var B=C(T);return u((K,te)=>{(K.length<A-1||te==null)&&(K.push(te),te=cn());function re(ie){B(...K,ie)}return Q?go(Q,re,te):go(re,te),te[Tt]})}function wf(Q,T){return on(Me,Q,T)}function iu(Q,T,A){return zt(Boolean,B=>B)(F,Q,T,A)}var Tl=w(iu,3);function kf(Q,T,A,B){return zt(Boolean,K=>K)(ae(T),Q,A,B)}var $l=w(kf,4);function xg(Q,T,A){return zt(Boolean,B=>B)(Me,Q,T,A)}var Ds=w(xg,3);function xf(Q,T,A){var B=C(T);return J(Q,(te,re)=>{B(te,(ie,fe)=>{if(ie)return re(ie);re(ie,{value:te,criteria:fe})})},(te,re)=>{if(te)return A(te);A(null,re.sort(K).map(ie=>ie.value))});function K(te,re){var ie=te.criteria,fe=re.criteria;return ie<fe?-1:ie>fe?1:0}}var _f=w(xf,3);function Pf(Q,T,A){var B=C(Q);return u((K,te)=>{var re=!1,ie;function fe(){var Ge=Q.name||"anonymous",$t=new Error('Callback function "'+Ge+'" timed out.');$t.code="ETIMEDOUT",A&&($t.info=A),re=!0,te($t)}K.push((...Ge)=>{re||(te(...Ge),clearTimeout(ie))}),ie=setTimeout(fe,T),B(...K)})}function Oo(Q){for(var T=Array(Q);Q--;)T[Q]=Q;return T}function vo(Q,T,A,B){var K=C(A);return Le(Oo(Q),T,K,B)}function ou(Q,T,A){return vo(Q,1/0,T,A)}function su(Q,T,A){return vo(Q,1,T,A)}function Rl(Q,T,A,B){arguments.length<=3&&typeof T=="function"&&(B=A,A=T,T=Array.isArray(Q)?[]:{}),B=j(B||cn());var K=C(A);return F(Q,(te,re,ie)=>{K(T,te,re,ie)},te=>B(te,T)),B[Tt]}function Cf(Q,T){var A=null,B;return Vt(Q,(K,te)=>{C(K)((re,...ie)=>{if(re===!1)return te(re);ie.length<2?[B]=ie:B=ie,A=re,te(re?null:{})})},()=>T(A,B))}var lu=w(Cf);function au(Q){return(...T)=>(Q.unmemoized||Q)(...T)}function Ef(Q,T,A){A=Y(A);var B=C(T),K=C(Q),te=[];function re(fe,...Ge){if(fe)return A(fe);te=Ge,fe!==!1&&K(ie)}function ie(fe,Ge){if(fe)return A(fe);if(fe!==!1){if(!Ge)return A(null,...te);B(re)}}return K(ie)}var uu=w(Ef,3);function O1(Q,T,A){const B=C(Q);return uu(K=>B((te,re)=>K(te,!re)),T,A)}function IA(Q,T){if(T=j(T),!Array.isArray(Q))return T(new Error("First argument to waterfall must be an array of functions"));if(!Q.length)return T();var A=0;function B(te){var re=C(Q[A++]);re(...te,Y(K))}function K(te,...re){if(te!==!1){if(te||A===Q.length)return T(te,...re);B(re)}}B([])}var v1=w(IA),LA={apply:a,applyEach:be,applyEachSeries:st,asyncify:v,auto:tr,autoInject:ce,cargo:Je,cargoQueue:tt,compose:ke,concat:pt,concatLimit:ge,concatSeries:at,constant:Rt,detect:Ut,detectLimit:On,detectSeries:An,dir:Ln,doUntil:qe,doWhilst:Ze,each:me,eachLimit:ht,eachOf:F,eachOfLimit:U,eachOfSeries:Me,eachSeries:Vt,ensureAsync:en,every:fn,everyLimit:ut,everySeries:xt,filter:D,filterLimit:X,filterSeries:V,forever:Ce,groupBy:et,groupByLimit:ve,groupBySeries:Re,log:_t,map:J,mapLimit:Le,mapSeries:nt,mapValues:St,mapValuesLimit:rt,mapValuesSeries:vt,memoize:mt,nextTick:hn,parallel:bt,parallelLimit:Xt,priorityQueue:Wn,queue:jt,race:Vn,reduce:_e,reduceRight:ni,reflect:ri,reflectAll:ur,reject:Zi,rejectLimit:Cl,rejectSeries:Ms,retry:go,retryable:El,seq:Se,series:wf,setImmediate:O,some:Tl,someLimit:$l,someSeries:Ds,sortBy:_f,timeout:Pf,times:ou,timesLimit:vo,timesSeries:su,transform:Rl,tryEach:lu,unmemoize:au,until:O1,waterfall:v1,whilst:uu,all:fn,allLimit:ut,allSeries:xt,any:Tl,anyLimit:$l,anySeries:Ds,find:Ut,findLimit:On,findSeries:An,flatMap:pt,flatMapLimit:ge,flatMapSeries:at,forEach:me,forEachSeries:Vt,forEachLimit:ht,forEachOf:F,forEachOfSeries:Me,forEachOfLimit:U,inject:_e,foldl:_e,foldr:ni,select:D,selectLimit:X,selectSeries:V,wrapSync:v,during:uu,doDuring:Ze};l.default=LA,l.apply=a,l.applyEach=be,l.applyEachSeries=st,l.asyncify=v,l.auto=tr,l.autoInject=ce,l.cargo=Je,l.cargoQueue=tt,l.compose=ke,l.concat=pt,l.concatLimit=ge,l.concatSeries=at,l.constant=Rt,l.detect=Ut,l.detectLimit=On,l.detectSeries=An,l.dir=Ln,l.doUntil=qe,l.doWhilst=Ze,l.each=me,l.eachLimit=ht,l.eachOf=F,l.eachOfLimit=U,l.eachOfSeries=Me,l.eachSeries=Vt,l.ensureAsync=en,l.every=fn,l.everyLimit=ut,l.everySeries=xt,l.filter=D,l.filterLimit=X,l.filterSeries=V,l.forever=Ce,l.groupBy=et,l.groupByLimit=ve,l.groupBySeries=Re,l.log=_t,l.map=J,l.mapLimit=Le,l.mapSeries=nt,l.mapValues=St,l.mapValuesLimit=rt,l.mapValuesSeries=vt,l.memoize=mt,l.nextTick=hn,l.parallel=bt,l.parallelLimit=Xt,l.priorityQueue=Wn,l.queue=jt,l.race=Vn,l.reduce=_e,l.reduceRight=ni,l.reflect=ri,l.reflectAll=ur,l.reject=Zi,l.rejectLimit=Cl,l.rejectSeries=Ms,l.retry=go,l.retryable=El,l.seq=Se,l.series=wf,l.setImmediate=O,l.some=Tl,l.someLimit=$l,l.someSeries=Ds,l.sortBy=_f,l.timeout=Pf,l.times=ou,l.timesLimit=vo,l.timesSeries=su,l.transform=Rl,l.tryEach=lu,l.unmemoize=au,l.until=O1,l.waterfall=v1,l.whilst=uu,l.all=fn,l.allLimit=ut,l.allSeries=xt,l.any=Tl,l.anyLimit=$l,l.anySeries=Ds,l.find=Ut,l.findLimit=On,l.findSeries=An,l.flatMap=pt,l.flatMapLimit=ge,l.flatMapSeries=at,l.forEach=me,l.forEachSeries=Vt,l.forEachLimit=ht,l.forEachOf=F,l.forEachOfSeries=Me,l.forEachOfLimit=U,l.inject=_e,l.foldl=_e,l.foldr=ni,l.select=D,l.selectLimit=X,l.selectSeries=V,l.wrapSync=v,l.during=uu,l.doDuring=Ze,Object.defineProperty(l,"__esModule",{value:!0})})}).call(this)}).call(this,n("_process"),n("timers").setImmediate)},{_process:9,timers:33}],2:[function(n,r,i){var o=typeof Reflect=="object"?Reflect:null,s=o&&typeof o.apply=="function"?o.apply:function(_,E,$){return Function.prototype.apply.call(_,E,$)},l;o&&typeof o.ownKeys=="function"?l=o.ownKeys:Object.getOwnPropertySymbols?l=function(_){return Object.getOwnPropertyNames(_).concat(Object.getOwnPropertySymbols(_))}:l=function(_){return Object.getOwnPropertyNames(_)};function a(x){console&&console.warn&&console.warn(x)}var u=Number.isNaN||function(_){return _!==_};function c(){c.init.call(this)}r.exports=c,r.exports.once=P,c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var f=10;function h(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}Object.defineProperty(c,"defaultMaxListeners",{enumerable:!0,get:function(){return f},set:function(x){if(typeof x!="number"||x<0||u(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");f=x}}),c.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(_){if(typeof _!="number"||_<0||u(_))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+_+".");return this._maxListeners=_,this};function d(x){return x._maxListeners===void 0?c.defaultMaxListeners:x._maxListeners}c.prototype.getMaxListeners=function(){return d(this)},c.prototype.emit=function(_){for(var E=[],$=1;$<arguments.length;$++)E.push(arguments[$]);var j=_==="error",W=this._events;if(W!==void 0)j=j&&W.error===void 0;else if(!j)return!1;if(j){var G;if(E.length>0&&(G=E[0]),G instanceof Error)throw G;var M=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw M.context=G,M}var L=W[_];if(L===void 0)return!1;if(typeof L=="function")s(L,this,E);else for(var N=L.length,Y=y(L,N),$=0;$<N;++$)s(Y[$],this,E);return!0};function p(x,_,E,$){var j,W,G;if(h(E),W=x._events,W===void 0?(W=x._events=Object.create(null),x._eventsCount=0):(W.newListener!==void 0&&(x.emit("newListener",_,E.listener?E.listener:E),W=x._events),G=W[_]),G===void 0)G=W[_]=E,++x._eventsCount;else if(typeof G=="function"?G=W[_]=$?[E,G]:[G,E]:$?G.unshift(E):G.push(E),j=d(x),j>0&&G.length>j&&!G.warned){G.warned=!0;var M=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");M.name="MaxListenersExceededWarning",M.emitter=x,M.type=_,M.count=G.length,a(M)}return x}c.prototype.addListener=function(_,E){return p(this,_,E,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(_,E){return p(this,_,E,!0)};function g(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function O(x,_,E){var $={fired:!1,wrapFn:void 0,target:x,type:_,listener:E},j=g.bind($);return j.listener=E,$.wrapFn=j,j}c.prototype.once=function(_,E){return h(E),this.on(_,O(this,_,E)),this},c.prototype.prependOnceListener=function(_,E){return h(E),this.prependListener(_,O(this,_,E)),this},c.prototype.removeListener=function(_,E){var $,j,W,G,M;if(h(E),j=this._events,j===void 0)return this;if($=j[_],$===void 0)return this;if($===E||$.listener===E)--this._eventsCount===0?this._events=Object.create(null):(delete j[_],j.removeListener&&this.emit("removeListener",_,$.listener||E));else if(typeof $!="function"){for(W=-1,G=$.length-1;G>=0;G--)if($[G]===E||$[G].listener===E){M=$[G].listener,W=G;break}if(W<0)return this;W===0?$.shift():S($,W),$.length===1&&(j[_]=$[0]),j.removeListener!==void 0&&this.emit("removeListener",_,M||E)}return this},c.prototype.off=c.prototype.removeListener,c.prototype.removeAllListeners=function(_){var E,$,j;if($=this._events,$===void 0)return this;if($.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):$[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete $[_]),this;if(arguments.length===0){var W=Object.keys($),G;for(j=0;j<W.length;++j)G=W[j],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(E=$[_],typeof E=="function")this.removeListener(_,E);else if(E!==void 0)for(j=E.length-1;j>=0;j--)this.removeListener(_,E[j]);return this};function v(x,_,E){var $=x._events;if($===void 0)return[];var j=$[_];return j===void 0?[]:typeof j=="function"?E?[j.listener||j]:[j]:E?k(j):y(j,j.length)}c.prototype.listeners=function(_){return v(this,_,!0)},c.prototype.rawListeners=function(_){return v(this,_,!1)},c.listenerCount=function(x,_){return typeof x.listenerCount=="function"?x.listenerCount(_):m.call(x,_)},c.prototype.listenerCount=m;function m(x){var _=this._events;if(_!==void 0){var E=_[x];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}c.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function y(x,_){for(var E=new Array(_),$=0;$<_;++$)E[$]=x[$];return E}function S(x,_){for(;_+1<x.length;_++)x[_]=x[_+1];x.pop()}function k(x){for(var _=new Array(x.length),E=0;E<_.length;++E)_[E]=x[E].listener||x[E];return _}function P(x,_){return new Promise(function(E,$){function j(G){x.removeListener(_,W),$(G)}function W(){typeof x.removeListener=="function"&&x.removeListener("error",j),E([].slice.call(arguments))}w(x,_,W,{once:!0}),_!=="error"&&C(x,j,{once:!0})})}function C(x,_,E){typeof x.on=="function"&&w(x,"error",_,E)}function w(x,_,E,$){if(typeof x.on=="function")$.once?x.once(_,E):x.on(_,E);else if(typeof x.addEventListener=="function")x.addEventListener(_,function j(W){$.once&&x.removeEventListener(_,j),E(W)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof x)}},{}],3:[function(n,r,i){r.exports=function o(s,l){if(s===l)return!0;if(s&&l&&typeof s=="object"&&typeof l=="object"){if(s.constructor!==l.constructor)return!1;var a,u,c;if(Array.isArray(s)){if(a=s.length,a!=l.length)return!1;for(u=a;u--!==0;)if(!o(s[u],l[u]))return!1;return!0}if(s.constructor===RegExp)return s.source===l.source&&s.flags===l.flags;if(s.valueOf!==Object.prototype.valueOf)return s.valueOf()===l.valueOf();if(s.toString!==Object.prototype.toString)return s.toString()===l.toString();if(c=Object.keys(s),a=c.length,a!==Object.keys(l).length)return!1;for(u=a;u--!==0;)if(!Object.prototype.hasOwnProperty.call(l,c[u]))return!1;for(u=a;u--!==0;){var f=c[u];if(!o(s[f],l[f]))return!1}return!0}return s!==s&&l!==l}},{}],4:[function(n,r,i){var o=r.exports=function(s,l){if(l||(l=16),s===void 0&&(s=128),s<=0)return"0";for(var a=Math.log(Math.pow(2,s))/Math.log(l),u=2;a===1/0;u*=2)a=Math.log(Math.pow(2,s/u))/Math.log(l)*u;for(var c=a-Math.floor(a),f="",u=0;u<Math.floor(a);u++){var h=Math.floor(Math.random()*l).toString(l);f=h+f}if(c){var d=Math.pow(l,c),h=Math.floor(Math.random()*d).toString(l);f=h+f}var p=parseInt(f,l);return p!==1/0&&p>=Math.pow(2,s)?o(s,l):f};o.rack=function(s,l,a){var u=function(f){var h=0;do{if(h++>10)if(a)s+=a;else throw new Error("too many ID collisions, use more bits");var d=o(s,l)}while(Object.hasOwnProperty.call(c,d));return c[d]=f,d},c=u.hats={};return u.get=function(f){return u.hats[f]},u.set=function(f,h){return u.hats[f]=h,u},u.bits=s||128,u.base=l||16,u}},{}],5:[function(n,r,i){r.exports=o;function o(s,l,a,u){var c=function(h,d,p,g){l(p,h,d,"left"),l(g,d,h,"right")},f=s.transformX=function(h,d){a(h),a(d);for(var p=[],g=0;g<d.length;g++){for(var O=d[g],v=[],m=0;m<h.length;){var y=[];if(c(h[m],O,v,y),m++,y.length===1)O=y[0];else if(y.length===0){for(var S=m;S<h.length;S++)u(v,h[S]);O=null;break}else{for(var k=f(h.slice(m),y),P=0;P<k[0].length;P++)u(v,k[0][P]);for(var C=0;C<k[1].length;C++)u(p,k[1][C]);O=null;break}}O!=null&&u(p,O),h=v}return[h,p]};s.transform=function(h,d,p){if(!(p==="left"||p==="right"))throw new Error("type must be 'left' or 'right'");return d.length===0?h:h.length===1&&d.length===1?l([],h[0],d[0],p):p==="left"?f(h,d)[0]:f(d,h)[1]}}},{}],6:[function(n,r,i){r.exports={type:n("./json0")}},{"./json0":7}],7:[function(n,r,i){var o=function(p){return Object.prototype.toString.call(p)=="[object Array]"},s=function(p){return!!p&&p.constructor===Object},l=function(p){return JSON.parse(JSON.stringify(p))},a={name:"json0",uri:"http://sharejs.org/types/JSONv0"},u={};a.registerSubtype=function(p){u[p.name]=p},a.create=function(p){return p===void 0?null:l(p)},a.invertComponent=function(p){var g={p:p.p};return p.t&&u[p.t]&&(g.t=p.t,g.o=u[p.t].invert(p.o)),p.si!==void 0&&(g.sd=p.si),p.sd!==void 0&&(g.si=p.sd),p.oi!==void 0&&(g.od=p.oi),p.od!==void 0&&(g.oi=p.od),p.li!==void 0&&(g.ld=p.li),p.ld!==void 0&&(g.li=p.ld),p.na!==void 0&&(g.na=-p.na),p.lm!==void 0&&(g.lm=p.p[p.p.length-1],g.p=p.p.slice(0,p.p.length-1).concat([p.lm])),g},a.invert=function(p){for(var g=p.slice().reverse(),O=[],v=0;v<g.length;v++)O.push(a.invertComponent(g[v]));return O},a.checkValidOp=function(p){for(var g=0;g<p.length;g++)if(!o(p[g].p))throw new Error("Missing path")},a.checkList=function(p){if(!o(p))throw new Error("Referenced element not a list")},a.checkObj=function(p){if(!s(p))throw new Error("Referenced element not an object (it was "+JSON.stringify(p)+")")};function c(p){p.t="text0";var g={p:p.p.pop()};p.si!=null&&(g.i=p.si),p.sd!=null&&(g.d=p.sd),p.o=[g]}function f(p){p.p.push(p.o[0].p),p.o[0].i!=null&&(p.si=p.o[0].i),p.o[0].d!=null&&(p.sd=p.o[0].d),delete p.t,delete p.o}a.apply=function(p,g){a.checkValidOp(g),g=l(g);for(var O={data:p},v=0;v<g.length;v++){var m=g[v];(m.si!=null||m.sd!=null)&&c(m);for(var y=null,S=O,k="data",P=0;P<m.p.length;P++){var C=m.p[P];if(y=S,S=S[k],k=C,y==null)throw new Error("Path invalid")}if(m.t&&m.o!==void 0&&u[m.t])S[k]=u[m.t].apply(S[k],m.o);else if(m.na!==void 0){if(typeof S[k]!="number")throw new Error("Referenced element not a number");S[k]+=m.na}else if(m.li!==void 0&&m.ld!==void 0)a.checkList(S),S[k]=m.li;else if(m.li!==void 0)a.checkList(S),S.splice(k,0,m.li);else if(m.ld!==void 0)a.checkList(S),S.splice(k,1);else if(m.lm!==void 0){if(a.checkList(S),m.lm!=k){var w=S[k];S.splice(k,1),S.splice(m.lm,0,w)}}else if(m.oi!==void 0)a.checkObj(S),S[k]=m.oi;else if(m.od!==void 0)a.checkObj(S),delete S[k];else throw new Error("invalid / missing instruction in op")}return O.data},a.shatter=function(p){for(var g=[],O=0;O<p.length;O++)g.push([p[O]]);return g},a.incrementalApply=function(p,g,O){for(var v=0;v<g.length;v++){var m=[g[v]];p=a.apply(p,m),O(m,p)}return p};var h=a.pathMatches=function(p,g,O){if(p.length!=g.length)return!1;for(var v=0;v<p.length;v++)if(p[v]!==g[v]&&(!O||v!==p.length-1))return!1;return!0};a.append=function(p,g){if(g=l(g),p.length===0){p.push(g);return}var O=p[p.length-1];if((g.si!=null||g.sd!=null)&&(O.si!=null||O.sd!=null)&&(c(g),c(O)),h(g.p,O.p))if(g.t&&O.t&&g.t===O.t&&u[g.t]){if(O.o=u[g.t].compose(O.o,g.o),g.si!=null||g.sd!=null){for(var v=g.p,m=0;m<O.o.length-1;m++)g.o=[O.o.pop()],g.p=v.slice(),f(g),p.push(g);f(O)}}else O.na!=null&&g.na!=null?p[p.length-1]={p:O.p,na:O.na+g.na}:O.li!==void 0&&g.li===void 0&&g.ld===O.li?O.ld!==void 0?delete O.li:p.pop():O.od!==void 0&&O.oi===void 0&&g.oi!==void 0&&g.od===void 0?O.oi=g.oi:O.oi!==void 0&&g.od!==void 0?g.oi!==void 0?O.oi=g.oi:O.od!==void 0?delete O.oi:p.pop():g.lm!==void 0&&g.p[g.p.length-1]===g.lm||p.push(g);else(g.si!=null||g.sd!=null)&&(O.si!=null||O.sd!=null)&&(f(g),f(O)),p.push(g)},a.compose=function(p,g){a.checkValidOp(p),a.checkValidOp(g);for(var O=l(p),v=0;v<g.length;v++)a.append(O,g[v]);return O},a.normalize=function(p){var g=[];p=o(p)?p:[p];for(var O=0;O<p.length;O++){var v=p[O];v.p==null&&(v.p=[]),a.append(g,v)}return g},a.commonLengthForOps=function(p,g){var O=p.p.length,v=g.p.length;if((p.na!=null||p.t)&&O++,(g.na!=null||g.t)&&v++,O===0)return-1;if(v===0)return null;O--,v--;for(var m=0;m<O;m++){var y=p.p[m];if(m>=v||y!==g.p[m])return null}return O},a.canOpAffectPath=function(p,g){return a.commonLengthForOps({p:g},p)!=null},a.transformComponent=function(p,g,O,v){g=l(g);var m=a.commonLengthForOps(O,g),y=a.commonLengthForOps(g,O),S=g.p.length,k=O.p.length;if((g.na!=null||g.t)&&S++,(O.na!=null||O.t)&&k++,y!=null&&k>S&&g.p[y]==O.p[y]){if(g.ld!==void 0){var P=l(O);P.p=P.p.slice(S),g.ld=a.apply(l(g.ld),[P])}else if(g.od!==void 0){var P=l(O);P.p=P.p.slice(S),g.od=a.apply(l(g.od),[P])}}if(m!=null){var C=S==k,P=O;if((g.si!=null||g.sd!=null)&&(O.si!=null||O.sd!=null)&&(c(g),P=l(O),c(P)),P.t&&u[P.t]){if(g.t&&g.t===P.t){var w=u[g.t].transform(g.o,P.o,v);if(g.si!=null||g.sd!=null)for(var x=g.p,_=0;_<w.length;_++)g.o=[w[_]],g.p=x.slice(),f(g),a.append(p,g);else(!o(w)||w.length>0)&&(g.o=w,a.append(p,g));return p}}else if(O.na===void 0){if(O.li!==void 0&&O.ld!==void 0){if(O.p[m]===g.p[m])if(C){if(g.ld!==void 0)if(g.li!==void 0&&v==="left")g.ld=l(O.li);else return p}else return p}else if(O.li!==void 0)g.li!==void 0&&g.ld===void 0&&C&&g.p[m]===O.p[m]?v==="right"&&g.p[m]++:O.p[m]<=g.p[m]&&g.p[m]++,g.lm!==void 0&&C&&O.p[m]<=g.lm&&g.lm++;else if(O.ld!==void 0){if(g.lm!==void 0&&C){if(O.p[m]===g.p[m])return p;var x=O.p[m],E=g.p[m],$=g.lm;(x<$||x===$&&E<$)&&g.lm--}if(O.p[m]<g.p[m])g.p[m]--;else if(O.p[m]===g.p[m]){if(k<S)return p;if(g.ld!==void 0)if(g.li!==void 0)delete g.ld;else return p}}else if(O.lm!==void 0)if(g.lm!==void 0&&S===k){var E=g.p[m],$=g.lm,j=O.p[m],W=O.lm;if(j!==W)if(E===j)if(v==="left")g.p[m]=W,E===$&&(g.lm=W);else return p;else E>j&&g.p[m]--,E>W?g.p[m]++:E===W&&j>W&&(g.p[m]++,E===$&&g.lm++),($>j||$===j&&$>E)&&g.lm--,$>W?g.lm++:$===W&&(W>j&&$>E||W<j&&$<E?v==="right"&&g.lm++:$>E?g.lm++:$===j&&g.lm--)}else if(g.li!==void 0&&g.ld===void 0&&C){var E=O.p[m],$=O.lm;x=g.p[m],x>E&&g.p[m]--,x>$&&g.p[m]++}else{var E=O.p[m],$=O.lm;x=g.p[m],x===E?g.p[m]=$:(x>E&&g.p[m]--,(x>$||x===$&&E>$)&&g.p[m]++)}else if(O.oi!==void 0&&O.od!==void 0){if(g.p[m]===O.p[m])if(g.oi!==void 0&&C){if(v==="right")return p;g.od=O.oi}else return p}else if(O.oi!==void 0){if(g.oi!==void 0&&g.p[m]===O.p[m])if(v==="left")a.append(p,{p:g.p,od:O.oi});else return p}else if(O.od!==void 0&&g.p[m]==O.p[m]){if(!C)return p;if(g.oi!==void 0)delete g.od;else return p}}}return a.append(p,g),p},n("./bootstrapTransform")(a,a.transformComponent,a.checkValidOp,a.append);var d=n("./text0");a.registerSubtype(d),r.exports=a},{"./bootstrapTransform":5,"./text0":8}],8:[function(n,r,i){var o=r.exports={name:"text0",uri:"http://sharejs.org/types/textv0",create:function(d){if(d!=null&&typeof d!="string")throw new Error("Initial data must be a string");return d||""}},s=function(d,p,g){return d.slice(0,p)+g+d.slice(p)},l=function(d){if(typeof d.p!="number")throw new Error("component missing position field");if(typeof d.i=="string"==(typeof d.d=="string"))throw new Error("component needs an i or d field");if(d.p<0)throw new Error("position cannot be negative")},a=function(d){for(var p=0;p<d.length;p++)l(d[p])};o.apply=function(d,p){var g;a(p);for(var O=0;O<p.length;O++){var v=p[O];if(v.i!=null)d=s(d,v.p,v.i);else{if(g=d.slice(v.p,v.p+v.d.length),v.d!==g)throw new Error("Delete component '"+v.d+"' does not match deleted text '"+g+"'");d=d.slice(0,v.p)+d.slice(v.p+v.d.length)}}return d};var u=o._append=function(d,p){if(!(p.i===""||p.d===""))if(d.length===0)d.push(p);else{var g=d[d.length-1];g.i!=null&&p.i!=null&&g.p<=p.p&&p.p<=g.p+g.i.length?d[d.length-1]={i:s(g.i,p.p-g.p,p.i),p:g.p}:g.d!=null&&p.d!=null&&p.p<=g.p&&g.p<=p.p+p.d.length?d[d.length-1]={d:s(p.d,g.p-p.p,g.d),p:p.p}:d.push(p)}};o.compose=function(d,p){a(d),a(p);for(var g=d.slice(),O=0;O<p.length;O++)u(g,p[O]);return g},o.normalize=function(d){var p=[];(d.i!=null||d.p!=null)&&(d=[d]);for(var g=0;g<d.length;g++){var O=d[g];O.p==null&&(O.p=0),u(p,O)}return p};var c=function(d,p,g){return p.i!=null?p.p<d||p.p===d&&g?d+p.i.length:d:d<=p.p?d:d<=p.p+p.d.length?p.p:d-p.d.length};o.transformCursor=function(d,p,g){for(var O=g==="right",v=0;v<p.length;v++)d=c(d,p[v],O);return d};var f=o._tc=function(d,p,g,O){if(l(p),l(g),p.i!=null)u(d,{i:p.i,p:c(p.p,g,O==="right")});else if(g.i!=null){var v=p.d;p.p<g.p&&(u(d,{d:v.slice(0,g.p-p.p),p:p.p}),v=v.slice(g.p-p.p)),v!==""&&u(d,{d:v,p:p.p+g.i.length})}else if(p.p>=g.p+g.d.length)u(d,{d:p.d,p:p.p-g.d.length});else if(p.p+p.d.length<=g.p)u(d,p);else{var m={d:"",p:p.p};p.p<g.p&&(m.d=p.d.slice(0,g.p-p.p)),p.p+p.d.length>g.p+g.d.length&&(m.d+=p.d.slice(g.p+g.d.length-p.p));var y=Math.max(p.p,g.p),S=Math.min(p.p+p.d.length,g.p+g.d.length),k=p.d.slice(y-p.p,S-p.p),P=g.d.slice(y-g.p,S-g.p);if(k!==P)throw new Error("Delete ops delete different text in the same region of the document");m.d!==""&&(m.p=c(m.p,g),u(d,m))}return d},h=function(d){return d.i!=null?{d:d.i,p:d.p}:{i:d.d,p:d.p}};o.invert=function(d){d=d.slice().reverse();for(var p=0;p<d.length;p++)d[p]=h(d[p]);return d},n("./bootstrapTransform")(o,f,a,u)},{"./bootstrapTransform":5}],9:[function(n,r,i){var o=r.exports={},s,l;function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=a}catch{s=a}try{typeof clearTimeout=="function"?l=clearTimeout:l=u}catch{l=u}})();function c(S){if(s===setTimeout)return setTimeout(S,0);if((s===a||!s)&&setTimeout)return s=setTimeout,setTimeout(S,0);try{return s(S,0)}catch{try{return s.call(null,S,0)}catch{return s.call(this,S,0)}}}function f(S){if(l===clearTimeout)return clearTimeout(S);if((l===u||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(S);try{return l(S)}catch{try{return l.call(null,S)}catch{return l.call(this,S)}}}var h=[],d=!1,p,g=-1;function O(){!d||!p||(d=!1,p.length?h=p.concat(h):g=-1,h.length&&v())}function v(){if(!d){var S=c(O);d=!0;for(var k=h.length;k;){for(p=h,h=[];++g<k;)p&&p[g].run();g=-1,k=h.length}p=null,d=!1,f(S)}}o.nextTick=function(S){var k=new Array(arguments.length-1);if(arguments.length>1)for(var P=1;P<arguments.length;P++)k[P-1]=arguments[P];h.push(new m(S,k)),h.length===1&&!d&&c(v)};function m(S,k){this.fun=S,this.array=k}m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function y(){}o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(S){return[]},o.binding=function(S){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(S){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],10:[function(n,r,i){var o=n("./doc"),s=n("./query"),l=n("./presence/presence"),a=n("./presence/doc-presence"),u=n("./snapshot-request/snapshot-version-request"),c=n("./snapshot-request/snapshot-timestamp-request"),f=n("../emitter"),h=n("../error"),d=n("../message-actions").ACTIONS,p=n("../types"),g=n("../util"),O=n("../logger"),v=n("./presence/doc-presence-emitter"),m=h.CODES;function y(w){return w.readyState===0||w.readyState===1?"connecting":"disconnected"}r.exports=S;function S(w){f.EventEmitter.call(this),this.collections={},this.nextQueryId=1,this.nextSnapshotRequestId=1,this.queries={},this._presences={},this._docPresenceEmitter=new v,this._snapshotRequests={},this.seq=1,this._presenceSeq=1,this.id=null,this.agent=null,this.debug=!1,this.state=y(w),this.bindToSocket(w)}f.mixin(S),S.prototype.bindToSocket=function(w){this.socket&&(this.socket.close(),this.socket.onmessage=null,this.socket.onopen=null,this.socket.onerror=null,this.socket.onclose=null),this.socket=w;var x=y(w);this._setState(x),this.canSend=!1;var _=this;w.onmessage=function(E){try{var $=typeof E.data=="string"?JSON.parse(E.data):E.data}catch{O.warn("Failed to parse message",E);return}_.debug&&O.info("RECV",JSON.stringify($));var j={data:$};if(_.emit("receive",j),!!j.data)try{_.handleMessage(j.data)}catch(W){g.nextTick(function(){_.emit("error",W)})}},w.readyState===1&&_._initializeHandshake(),w.onopen=function(){_._setState("connecting"),_._initializeHandshake()},w.onerror=function(E){_.emit("connection error",E)},w.onclose=function(E){E==="closed"||E==="Closed"?_._setState("closed",E):E==="stopped"||E==="Stopped by server"?_._setState("stopped",E):_._setState("disconnected",E)}},S.prototype.handleMessage=function(w){var x=null;switch(w.error&&(x=k(w.error,w),delete w.error),w.a){case d.initLegacy:return this._handleLegacyInit(w);case d.handshake:return this._handleHandshake(x,w);case d.queryFetch:var _=this.queries[w.id];_&&_._handleFetch(x,w.data,w.extra);return;case d.querySubscribe:var _=this.queries[w.id];_&&_._handleSubscribe(x,w.data,w.extra);return;case d.queryUnsubscribe:return;case d.queryUpdate:var _=this.queries[w.id];if(!_)return;if(x)return _._handleError(x);w.diff&&_._handleDiff(w.diff),w.hasOwnProperty("extra")&&_._handleExtra(w.extra);return;case d.bulkFetch:return this._handleBulkMessage(x,w,"_handleFetch");case d.bulkSubscribe:case d.bulkUnsubscribe:return this._handleBulkMessage(x,w,"_handleSubscribe");case d.snapshotFetch:case d.snapshotFetchByTimestamp:return this._handleSnapshotFetch(x,w);case d.fetch:var E=this.getExisting(w.c,w.d);E&&E._handleFetch(x,w.data);return;case d.subscribe:case d.unsubscribe:var E=this.getExisting(w.c,w.d);E&&E._handleSubscribe(x,w.data);return;case d.op:var E=this.getExisting(w.c,w.d);E&&E._handleOp(x,w);return;case d.presence:return this._handlePresence(x,w);case d.presenceSubscribe:return this._handlePresenceSubscribe(x,w);case d.presenceUnsubscribe:return this._handlePresenceUnsubscribe(x,w);case d.presenceRequest:return this._handlePresenceRequest(x,w);case d.pingPong:return this._handlePingPong(x);default:O.warn("Ignoring unrecognized message",w)}};function k(w,x){var _=new Error(w.message);return _.code=w.code,x&&(_.data=x),_}S.prototype._handleBulkMessage=function(w,x,_){if(x.data)for(var E in x.data){var $=x.data[E],j=this.getExisting(x.c,E);j&&(w?j[_](w):$.error?j[_](k($.error)):j[_](null,$))}else if(Array.isArray(x.b))for(var W=0;W<x.b.length;W++){var E=x.b[W],j=this.getExisting(x.c,E);j&&j[_](w)}else if(x.b)for(var E in x.b){var j=this.getExisting(x.c,E);j&&j[_](w)}else O.error("Invalid bulk message",x)},S.prototype._reset=function(){this.agent=null},S.prototype._setState=function(w,x){if(this.state!==w){if(w==="connecting"&&this.state!=="disconnected"&&this.state!=="stopped"&&this.state!=="closed"||w==="connected"&&this.state!=="connecting"){var _=new h(m.ERR_CONNECTION_STATE_TRANSITION_INVALID,"Cannot transition directly from "+this.state+" to "+w);return this.emit("error",_)}this.state=w,this.canSend=w==="connected",(w==="disconnected"||w==="stopped"||w==="closed")&&this._reset(),this.startBulk();for(var E in this.queries){var $=this.queries[E];$._onConnectionStateChanged()}for(var j in this.collections){var W=this.collections[j];for(var E in W)W[E]._onConnectionStateChanged()}for(var G in this._presences)this._presences[G]._onConnectionStateChanged();for(var E in this._snapshotRequests){var M=this._snapshotRequests[E];M._onConnectionStateChanged()}this.endBulk(),this.emit(w,x),this.emit("state",w,x)}},S.prototype.startBulk=function(){this.bulk||(this.bulk={})},S.prototype.endBulk=function(){if(this.bulk)for(var w in this.bulk){var x=this.bulk[w];this._sendBulk("f",w,x.f),this._sendBulk("s",w,x.s),this._sendBulk("u",w,x.u)}this.bulk=null},S.prototype._sendBulk=function(w,x,_){if(_){var E=[],$={},j=0,W;for(var G in _){var M=_[G];M==null?E.push(G):($[G]=M,W=G,j++)}if(E.length===1){var G=E[0];this.send({a:w,c:x,d:G})}else E.length&&this.send({a:"b"+w,c:x,b:E});if(j===1){var L=$[W];this.send({a:w,c:x,d:W,v:L})}else j&&this.send({a:"b"+w,c:x,b:$})}},S.prototype._sendActions=function(w,x,_){if(this._addDoc(x),this.bulk){var E=this.bulk[x.collection]||(this.bulk[x.collection]={}),$=E[w]||(E[w]={}),j=$.hasOwnProperty(x.id);return $[x.id]=_,j}else{var W={a:w,c:x.collection,d:x.id,v:_};this.send(W)}},S.prototype.sendFetch=function(w){return this._sendActions(d.fetch,w,w.version)},S.prototype.sendSubscribe=function(w){return this._sendActions(d.subscribe,w,w.version)},S.prototype.sendUnsubscribe=function(w){return this._sendActions(d.unsubscribe,w)},S.prototype.sendOp=function(w,x){this._addDoc(w);var _={a:d.op,c:w.collection,d:w.id,v:w.version,src:x.src,seq:x.seq,x:{}};"op"in x&&(_.op=x.op),x.create&&(_.create=x.create),x.del&&(_.del=x.del),w.submitSource&&(_.x.source=x.source),this.send(_)},S.prototype.send=function(w){this.debug&&O.info("SEND",JSON.stringify(w)),this.emit("send",w),this.socket.send(JSON.stringify(w))},S.prototype.ping=function(){if(!this.canSend)throw new h(m.ERR_CANNOT_PING_OFFLINE,"Socket must be CONNECTED to ping");var w={a:d.pingPong};this.send(w)},S.prototype.close=function(){this.socket.close()},S.prototype.getExisting=function(w,x){if(this.collections[w])return this.collections[w][x]},S.prototype.get=function(w,x){var _=this.collections[w]||(this.collections[w]={}),E=_[x];return E||(E=_[x]=new o(this,w,x),this.emit("doc",E)),E._wantsDestroy=!1,E},S.prototype._destroyDoc=function(w){w._wantsDestroy&&(g.digAndRemove(this.collections,w.collection,w.id),w.emit("destroy"))},S.prototype._addDoc=function(w){var x=this.collections[w.collection];x||(x=this.collections[w.collection]={}),x[w.id]!==w&&(x[w.id]=w)},S.prototype._createQuery=function(w,x,_,E,$){var j=this.nextQueryId++,W=new s(w,this,j,x,_,E,$);return this.queries[j]=W,W.send(),W},S.prototype._destroyQuery=function(w){delete this.queries[w.id]},S.prototype.createFetchQuery=function(w,x,_,E){return this._createQuery(d.queryFetch,w,x,_,E)},S.prototype.createSubscribeQuery=function(w,x,_,E){return this._createQuery(d.querySubscribe,w,x,_,E)},S.prototype.hasPending=function(){return!!(this._firstDoc(P)||this._firstQuery(P)||this._firstSnapshotRequest())};function P(w){return w.hasPending()}S.prototype.hasWritePending=function(){return!!this._firstDoc(C)};function C(w){return w.hasWritePending()}S.prototype.whenNothingPending=function(w){var x=this._firstDoc(P);if(x){x.once("nothing pending",this._nothingPendingRetry(w));return}var _=this._firstQuery(P);if(_){_.once("ready",this._nothingPendingRetry(w));return}var E=this._firstSnapshotRequest();if(E){E.once("ready",this._nothingPendingRetry(w));return}g.nextTick(w)},S.prototype._nothingPendingRetry=function(w){var x=this;return function(){g.nextTick(function(){x.whenNothingPending(w)})}},S.prototype._firstDoc=function(w){for(var x in this.collections){var _=this.collections[x];for(var E in _){var $=_[E];if(w($))return $}}},S.prototype._firstQuery=function(w){for(var x in this.queries){var _=this.queries[x];if(w(_))return _}},S.prototype._firstSnapshotRequest=function(){for(var w in this._snapshotRequests)return this._snapshotRequests[w]},S.prototype.fetchSnapshot=function(w,x,_,E){typeof _=="function"&&(E=_,_=null);var $=this.nextSnapshotRequestId++,j=new u(this,$,w,x,_,E);this._snapshotRequests[j.requestId]=j,j.send()},S.prototype.fetchSnapshotByTimestamp=function(w,x,_,E){typeof _=="function"&&(E=_,_=null);var $=this.nextSnapshotRequestId++,j=new c(this,$,w,x,_,E);this._snapshotRequests[j.requestId]=j,j.send()},S.prototype._handleSnapshotFetch=function(w,x){var _=this._snapshotRequests[x.id];_&&(delete this._snapshotRequests[x.id],_._handleResponse(w,x))},S.prototype._handleLegacyInit=function(w){if(w.protocolMinor)return this._initializeHandshake();this._initialize(w)},S.prototype._initializeHandshake=function(){this.send({a:d.handshake,id:this.id})},S.prototype._handleHandshake=function(w,x){if(w)return this.emit("error",w);this._initialize(x)},S.prototype._handlePingPong=function(w){if(w)return this.emit("error",w);this.emit("pong")},S.prototype._initialize=function(w){if(this.state==="connecting"){if(w.protocol!==1)return this.emit("error",new h(m.ERR_PROTOCOL_VERSION_NOT_SUPPORTED,"Unsupported protocol version: "+w.protocol));if(p.map[w.type]!==p.defaultType)return this.emit("error",new h(m.ERR_DEFAULT_TYPE_MISMATCH,w.type+" does not match the server default type"));if(typeof w.id!="string")return this.emit("error",new h(m.ERR_CLIENT_ID_BADLY_FORMED,"Client id must be a string"));this.id=w.id,this._setState("connected")}},S.prototype.getPresence=function(w){var x=this,_=g.digOrCreate(this._presences,w,function(){return new l(x,w)});return _._wantsDestroy=!1,_},S.prototype.getDocPresence=function(w,x){var _=a.channel(w,x),E=this,$=g.digOrCreate(this._presences,_,function(){return new a(E,w,x)});return $._wantsDestroy=!1,$},S.prototype._sendPresenceAction=function(w,x,_){this._addPresence(_);var E={a:w,ch:_.channel,seq:x};return this.send(E),E.seq},S.prototype._addPresence=function(w){g.digOrCreate(this._presences,w.channel,function(){return w})},S.prototype._requestRemotePresence=function(w){this.send({a:d.presenceRequest,ch:w})},S.prototype._handlePresenceSubscribe=function(w,x){var _=g.dig(this._presences,x.ch);_&&_._handleSubscribe(w,x.seq)},S.prototype._handlePresenceUnsubscribe=function(w,x){var _=g.dig(this._presences,x.ch);_&&_._handleUnsubscribe(w,x.seq)},S.prototype._handlePresence=function(w,x){var _=g.dig(this._presences,x.ch);_&&_._receiveUpdate(w,x)},S.prototype._handlePresenceRequest=function(w,x){var _=g.dig(this._presences,x.ch);_&&_._broadcastAllLocalPresence(w,x)}},{"../emitter":24,"../error":25,"../logger":26,"../message-actions":28,"../types":31,"../util":32,"./doc":11,"./presence/doc-presence":14,"./presence/doc-presence-emitter":13,"./presence/presence":17,"./query":20,"./snapshot-request/snapshot-timestamp-request":22,"./snapshot-request/snapshot-version-request":23}],11:[function(n,r,i){var o=n("../emitter"),s=n("../logger"),l=n("../error"),a=n("../types"),u=n("../util"),c=u.clone,f=n("fast-deep-equal"),h=n("../message-actions").ACTIONS,d=l.CODES;r.exports=p;function p(m,y,S){o.EventEmitter.call(this),this.connection=m,this.collection=y,this.id=S,this.version=null,this.type=null,this.data=void 0,this.inflightFetch=[],this.inflightSubscribe=null,this.pendingFetch=[],this.pendingSubscribe=[],this.subscribed=!1,this.wantSubscribe=!1,this._wantsDestroy=!1,this.inflightOp=null,this.pendingOps=[],this.type=null,this.applyStack=null,this.preventCompose=!1,this.submitSource=!1,this.paused=!1,this._dataStateVersion=0}o.mixin(p),p.prototype.destroy=function(m){this._wantsDestroy=!0;var y=this;y.whenNothingPending(function(){y.wantSubscribe?y.unsubscribe(function(S){if(S)return m?m(S):y.emit("error",S);y.connection._destroyDoc(y),m&&m()}):(y.connection._destroyDoc(y),m&&m())})},p.prototype._setType=function(m){if(typeof m=="string"&&(m=a.map[m]),m)this.type=m;else if(m===null)this.type=m,this._setData(void 0);else{var y=new l(d.ERR_DOC_TYPE_NOT_RECOGNIZED,"Missing type "+m);return this.emit("error",y)}},p.prototype._setData=function(m){this.data=m,this._dataStateVersion++},p.prototype.ingestSnapshot=function(m,y){if(!m)return y&&y();if(typeof m.v!="number"){var S=new l(d.ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION,"Missing version in ingested snapshot. "+this.collection+"."+this.id);return y?y(S):this.emit("error",S)}if(this.type||this.hasWritePending()){if(this.version==null){if(this.hasWritePending())return y&&this.once("no write pending",y);var S=new l(d.ERR_DOC_MISSING_VERSION,"Cannot ingest snapshot in doc with null version. "+this.collection+"."+this.id);return y?y(S):this.emit("error",S)}return m.v>this.version?this.fetch(y):y&&y()}if(this.version>m.v)return y&&y();this.version=m.v;var k=m.type===void 0?a.defaultType:m.type;this._setType(k),this._setData(this.type&&this.type.deserialize?this.type.deserialize(m.data):m.data),this.emit("load"),y&&y()},p.prototype.whenNothingPending=function(m){var y=this;u.nextTick(function(){if(y.hasPending()){y.once("nothing pending",m);return}m()})},p.prototype.hasPending=function(){return!!(this.inflightOp||this.pendingOps.length||this.inflightFetch.length||this.inflightSubscribe||this.pendingFetch.length||this.pendingSubscribe.length)},p.prototype.hasWritePending=function(){return!!(this.inflightOp||this.pendingOps.length)},p.prototype._emitNothingPending=function(){this.hasWritePending()||(this.emit("no write pending"),!this.hasPending()&&this.emit("nothing pending"))},p.prototype._emitResponseError=function(m,y){if(m&&m.code===d.ERR_SNAPSHOT_READ_SILENT_REJECTION){this.wantSubscribe=!1,y&&y(),this._emitNothingPending();return}if(y){y(m),this._emitNothingPending();return}this._emitNothingPending(),this.emit("error",m)},p.prototype._handleFetch=function(m,y){var S=this.pendingFetch;this.pendingFetch=[];var k=this.inflightFetch.shift();if(k&&S.push(k),S.length&&(k=function(P){u.callEach(S,P)}),m)return this._emitResponseError(m,k);this.ingestSnapshot(y,k),this._emitNothingPending()},p.prototype._handleSubscribe=function(m,y){var S=this.inflightSubscribe;this.inflightSubscribe=null;var k=this.pendingFetch;this.pendingFetch=[],S.callback&&k.push(S.callback);var P;if(k.length&&(P=function(C){u.callEach(k,C)}),m)return this._emitResponseError(m,P);this.subscribed=S.wantSubscribe,this.subscribed?this.ingestSnapshot(y,P):P&&P(),this._emitNothingPending(),this._flushSubscribe()},p.prototype._handleOp=function(m,y){if(m)return this.inflightOp?this._rollback(m):this.emit("error",m);if(this.inflightOp&&y.src===this.inflightOp.src&&y.seq===this.inflightOp.seq){this._opAcknowledged(y);return}if(this.version==null||y.v>this.version){this.fetch();return}if(!(y.v<this.version)){if(this.inflightOp){var S=v(this.inflightOp,y);if(S)return this._hardRollback(S)}for(var k=0;k<this.pendingOps.length;k++){var S=v(this.pendingOps[k],y);if(S)return this._hardRollback(S)}this.version++;try{this._otApply(y,!1)}catch(P){return this._hardRollback(P)}}},p.prototype._onConnectionStateChanged=function(){this.connection.canSend?(this.flush(),this._resubscribe()):(this.inflightOp&&(this.pendingOps.unshift(this.inflightOp),this.inflightOp=null),this.subscribed=!1,this.inflightSubscribe&&(this.inflightSubscribe.wantSubscribe?(this.pendingSubscribe.unshift(this.inflightSubscribe),this.inflightSubscribe=null):this._handleSubscribe()),this.inflightFetch.length&&(this.pendingFetch=this.pendingFetch.concat(this.inflightFetch),this.inflightFetch.length=0))},p.prototype._resubscribe=function(){if(!this.pendingSubscribe.length&&this.wantSubscribe)return this.subscribe();var m=this.pendingSubscribe.some(function(y){return y.wantSubscribe});!m&&this.pendingFetch.length&&this.fetch(),this._flushSubscribe()},p.prototype.fetch=function(m){this._fetch({},m)},p.prototype._fetch=function(m,y){this.pendingFetch.push(y);var S=this.connection.canSend&&(m.force||!this.inflightFetch.length);S&&(this.inflightFetch.push(this.pendingFetch.shift()),this.connection.sendFetch(this))},p.prototype.subscribe=function(m){var y=!0;this._queueSubscribe(y,m)},p.prototype.unsubscribe=function(m){var y=!1;this._queueSubscribe(y,m)},p.prototype._queueSubscribe=function(m,y){var S=this.pendingSubscribe[this.pendingSubscribe.length-1]||this.inflightSubscribe,k=S&&S.wantSubscribe===m;if(k){S.callback=g([S.callback,y]);return}this.pendingSubscribe.push({wantSubscribe:!!m,callback:y}),this._flushSubscribe()},p.prototype._flushSubscribe=function(){if(!(this.inflightSubscribe||!this.pendingSubscribe.length)){if(this.connection.canSend){this.inflightSubscribe=this.pendingSubscribe.shift(),this.wantSubscribe=this.inflightSubscribe.wantSubscribe,this.wantSubscribe?this.connection.sendSubscribe(this):(this.subscribed=!1,this.connection.sendUnsubscribe(this));return}if(!this.pendingSubscribe[0].wantSubscribe){this.inflightSubscribe=this.pendingSubscribe.shift();var m=this;u.nextTick(function(){m._handleSubscribe()})}}};function g(m){return m=m.filter(u.truthy),m.length?function(y){u.callEach(m,y)}:null}p.prototype.flush=function(){!this.connection.canSend||this.inflightOp||!this.paused&&this.pendingOps.length&&this._sendOp()};function O(m){delete m.op,delete m.create,delete m.del}function v(m,y){if(m.del)return O(y);if(y.del)return new l(d.ERR_DOC_WAS_DELETED,"Document was deleted");if(y.create)return new l(d.ERR_DOC_ALREADY_CREATED,"Document already created");if("op"in y){if(m.create)return new l(d.ERR_DOC_ALREADY_CREATED,"Document already created");if(m.type.transformX){var S=m.type.transformX(m.op,y.op);m.op=S[0],y.op=S[1]}else{var k=m.type.transform(m.op,y.op,"left"),P=m.type.transform(y.op,m.op,"right");m.op=k,y.op=P}}}p.prototype._otApply=function(m,y){if("op"in m){if(!this.type)throw new l(d.ERR_DOC_DOES_NOT_EXIST,"Cannot apply op to uncreated document. "+this.collection+"."+this.id);if(this.emit("before op batch",m.op,y),!y&&this.type===a.defaultType&&m.op.length>1){this.applyStack||(this.applyStack=[]);for(var S=this.applyStack.length,k=0;k<m.op.length;k++){var P=m.op[k],C={op:[P]};this.emit("before op",C.op,y,m.src);for(var w=S;w<this.applyStack.length;w++){var x=v(this.applyStack[w],C);if(x)return this._hardRollback(x)}this._setData(this.type.apply(this.data,C.op)),this.emit("op",C.op,y,m.src)}this.emit("op batch",m.op,y),this._popApplyStack(S);return}this.emit("before op",m.op,y,m.src),this._setData(this.type.apply(this.data,m.op)),this.emit("op",m.op,y,m.src),this.emit("op batch",m.op,y);return}if(m.create){this._setType(m.create.type),this.type.deserialize?this.type.createDeserialized?this._setData(this.type.createDeserialized(m.create.data)):this._setData(this.type.deserialize(this.type.create(m.create.data))):this._setData(this.type.create(m.create.data)),this.emit("create",y);return}if(m.del){var _=this.data;this._setType(null),this.emit("del",_,y);return}},p.prototype._sendOp=function(){if(this.connection.canSend){var m=this.connection.id;this.inflightOp||(this.inflightOp=this.pendingOps.shift());var y=this.inflightOp;if(!y){var S=new l(d.ERR_INFLIGHT_OP_MISSING,"No op to send on call to _sendOp");return this.emit("error",S)}if(y.sentAt=Date.now(),y.retries=y.retries==null?0:y.retries+1,y.seq==null){if(this.connection.seq>=u.MAX_SAFE_INTEGER)return this.emit("error",new l(d.ERR_CONNECTION_SEQ_INTEGER_OVERFLOW,"Connection seq has exceeded the max safe integer, maybe from being open for too long"));y.seq=this.connection.seq++}this.connection.sendOp(this,y),y.src==null&&(y.src=m)}},p.prototype._submit=function(m,y,S){if(y||(y=!0),"op"in m){if(!this.type){var k=new l(d.ERR_DOC_DOES_NOT_EXIST,"Cannot submit op. Document has not been created. "+this.collection+"."+this.id);return S?S(k):this.emit("error",k)}this.type.normalize&&(m.op=this.type.normalize(m.op))}try{this._pushOp(m,y,S),this._otApply(m,y)}catch(C){return this._hardRollback(C)}var P=this;u.nextTick(function(){P.flush()})},p.prototype._pushOp=function(m,y,S){if(m.source=y,this.applyStack)this.applyStack.push(m);else{var k=this._tryCompose(m);if(k){k.callbacks.push(S);return}}m.type=this.type,m.callbacks=[S],this.pendingOps.push(m)},p.prototype._popApplyStack=function(m){if(m>0){this.applyStack.length=m;return}var y=this.applyStack[0];if(this.applyStack=null,!!y){var S=this.pendingOps.indexOf(y);if(S!==-1)for(var k=this.pendingOps.splice(S),S=0;S<k.length;S++){var y=k[S],P=this._tryCompose(y);P?P.callbacks=P.callbacks.concat(y.callbacks):this.pendingOps.push(y)}}},p.prototype._tryCompose=function(m){if(!this.preventCompose){var y=this.pendingOps[this.pendingOps.length-1];if(!(!y||y.sentAt)&&!(this.submitSource&&!f(m.source,y.source))){if(y.create&&"op"in m)return y.create.data=this.type.apply(y.create.data,m.op),y;if("op"in y&&"op"in m&&this.type.compose)return y.op=this.type.compose(y.op,m.op),y}}},p.prototype.submitOp=function(m,y,S){typeof y=="function"&&(S=y,y=null);var k={op:m},P=y&&y.source;this._submit(k,P,S)},p.prototype.create=function(m,y,S,k){if(typeof y=="function"?(k=y,S=null,y=null):typeof S=="function"&&(k=S,S=null),y||(y=a.defaultType.uri),this.type){var P=new l(d.ERR_DOC_ALREADY_CREATED,"Document already exists");return k?k(P):this.emit("error",P)}var C={create:{type:y,data:m}},w=S&&S.source;this._submit(C,w,k)},p.prototype.del=function(m,y){if(typeof m=="function"&&(y=m,m=null),!this.type){var S=new l(d.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");return y?y(S):this.emit("error",S)}var k={del:!0},P=m&&m.source;this._submit(k,P,y)},p.prototype.pause=function(){this.paused=!0},p.prototype.resume=function(){this.paused=!1,this.flush()},p.prototype.toSnapshot=function(){return{v:this.version,data:c(this.data),type:this.type.uri}},p.prototype._opAcknowledged=function(m){if(this.inflightOp.create)this.version=m.v;else if(m.v!==this.version)return s.warn("Invalid version from server. Expected: "+this.version+" Received: "+m.v,m),this.fetch();if(m[h.fixup])for(var y=0;y<m[h.fixup].length;y++){for(var S=m[h.fixup][y],k=0;k<this.pendingOps.length;k++){var P=v(this.pendingOps[y],S);if(P)return this._hardRollback(P)}try{this._otApply(S,!1)}catch(C){return this._hardRollback(C)}}this.version++,this._clearInflightOp()},p.prototype._rollback=function(m){var y=this.inflightOp;if(!("op"in y&&y.type.invert))return this._hardRollback(m);try{y.op=y.type.invert(y.op)}catch{return this._hardRollback(m)}for(var S=0;S<this.pendingOps.length;S++){var k=v(this.pendingOps[S],y);if(k)return this._hardRollback(k)}try{this._otApply(y,!1)}catch(P){return this._hardRollback(P)}if(m.code===d.ERR_OP_SUBMIT_REJECTED)return this._clearInflightOp(null);this._clearInflightOp(m)},p.prototype._hardRollback=function(m){var y=this.pendingOps,S=this.inflightOp;this._setType(null),this.version=null,this.inflightOp=null,this.pendingOps=[];var k=this;this._fetch({force:!0},function(P){if(P&&(s.error("Hard rollback doc fetch failed.",P,S),k.emit("error",new l(d.ERR_HARD_ROLLBACK_FETCH_FAILED,"Hard rollback fetch failed: "+P.message))),m.code===d.ERR_OP_SUBMIT_REJECTED){if(S&&(u.callEach(S.callbacks),S=null),!y.length)return;m=new l(d.ERR_PENDING_OP_REMOVED_BY_OP_SUBMIT_REJECTED,"Discarding pending op because of hard rollback during ERR_OP_SUBMIT_REJECTED")}S&&y.unshift(S);for(var C=!!y.length,w=0;w<y.length;w++)C=u.callEach(y[w].callbacks,m)&&C;m&&!C&&k.emit("error",m)})},p.prototype._clearInflightOp=function(m){var y=this.inflightOp;this.inflightOp=null;var S=u.callEach(y.callbacks,m);if(this.flush(),this._emitNothingPending(),m&&!S)return this.emit("error",m)}},{"../emitter":24,"../error":25,"../logger":26,"../message-actions":28,"../types":31,"../util":32,"fast-deep-equal":3}],12:[function(n,r,i){i.Connection=n("./connection"),i.Doc=n("./doc"),i.Error=n("../error"),i.Query=n("./query"),i.types=n("../types"),i.logger=n("../logger")},{"../error":25,"../logger":26,"../types":31,"./connection":10,"./doc":11,"./query":20}],13:[function(n,r,i){var o=n("../../util"),s=n("events").EventEmitter,l=["create","del","destroy","load","op"];r.exports=a;function a(){this._docs={},this._forwarders={},this._emitters={}}a.prototype.addEventListener=function(u,c,f){this._registerDoc(u);var h=o.dig(this._emitters,u.collection,u.id);h.on(c,f)},a.prototype.removeEventListener=function(u,c,f){var h=o.dig(this._emitters,u.collection,u.id);h&&(h.off(c,f),h._eventsCount===1&&this._unregisterDoc(u))},a.prototype._registerDoc=function(u){var c=!0;if(o.digOrCreate(this._docs,u.collection,u.id,function(){return c=!1,u}),!c){var f=o.digOrCreate(this._emitters,u.collection,u.id,function(){var d=new s;return d.setMaxListeners(1e3),d}),h=this;l.forEach(function(d){var p=o.digOrCreate(h._forwarders,u.collection,u.id,d,function(){return f.emit.bind(f,d)});u.on(d,p)}),this.addEventListener(u,"destroy",this._unregisterDoc.bind(this,u))}},a.prototype._unregisterDoc=function(u){var c=o.dig(this._forwarders,u.collection,u.id);for(var f in c)u.off(f,c[f]);var h=o.dig(this._emitters,u.collection,u.id);h.removeAllListeners(),o.digAndRemove(this._forwarders,u.collection,u.id),o.digAndRemove(this._emitters,u.collection,u.id),o.digAndRemove(this._docs,u.collection,u.id)}},{"../../util":32,events:2}],14:[function(n,r,i){var o=n("./presence"),s=n("./local-doc-presence"),l=n("./remote-doc-presence");function a(u,c,f){var h=a.channel(c,f);o.call(this,u,h),this.collection=c,this.id=f}r.exports=a,a.prototype=Object.create(o.prototype),a.channel=function(u,c){return u+"."+c},a.prototype._createLocalPresence=function(u){return new s(this,u)},a.prototype._createRemotePresence=function(u){return new l(this,u)}},{"./local-doc-presence":15,"./presence":17,"./remote-doc-presence":18}],15:[function(n,r,i){var o=n("./local-presence"),s=n("../../error"),l=n("../../util"),a=s.CODES;r.exports=u;function u(c,f){o.call(this,c,f),this.collection=this.presence.collection,this.id=this.presence.id,this._doc=this.connection.get(this.collection,this.id),this._emitter=this.connection._docPresenceEmitter,this._isSending=!1,this._docDataVersionByPresenceVersion={},this._opHandler=this._transformAgainstOp.bind(this),this._createOrDelHandler=this._handleCreateOrDel.bind(this),this._loadHandler=this._handleLoad.bind(this),this._destroyHandler=this.destroy.bind(this),this._registerWithDoc()}u.prototype=Object.create(o.prototype),u.prototype.submit=function(c,f){if(!this._doc.type){if(c===null)return this._callbackOrEmit(null,f);var h={code:a.ERR_DOC_DOES_NOT_EXIST,message:"Cannot submit presence. Document has not been created"};return this._callbackOrEmit(h,f)}this._docDataVersionByPresenceVersion[this.presenceVersion]=this._doc._dataStateVersion,o.prototype.submit.call(this,c,f)},u.prototype.destroy=function(c){this._emitter.removeEventListener(this._doc,"op",this._opHandler),this._emitter.removeEventListener(this._doc,"create",this._createOrDelHandler),this._emitter.removeEventListener(this._doc,"del",this._createOrDelHandler),this._emitter.removeEventListener(this._doc,"load",this._loadHandler),this._emitter.removeEventListener(this._doc,"destroy",this._destroyHandler),o.prototype.destroy.call(this,c)},u.prototype._sendPending=function(){if(!this._isSending){this._isSending=!0;var c=this;this._doc.whenNothingPending(function(){c._isSending=!1,c.connection.canSend&&(c._pendingMessages.forEach(function(f){f.t=c._doc.type.uri,f.v=c._doc.version,c.connection.send(f)}),c._pendingMessages=[],c._docDataVersionByPresenceVersion={})})}},u.prototype._registerWithDoc=function(){this._emitter.addEventListener(this._doc,"op",this._opHandler),this._emitter.addEventListener(this._doc,"create",this._createOrDelHandler),this._emitter.addEventListener(this._doc,"del",this._createOrDelHandler),this._emitter.addEventListener(this._doc,"load",this._loadHandler),this._emitter.addEventListener(this._doc,"destroy",this._destroyHandler)},u.prototype._transformAgainstOp=function(c,f){var h=this,d=this._doc._dataStateVersion;this._pendingMessages.forEach(function(p){var g=h._docDataVersionByPresenceVersion[p.pv];if(!(g>=d))try{p.p=h._transformPresence(p.p,c,f),h._docDataVersionByPresenceVersion[p.pv]=d}catch(v){var O=h._getCallback(p.pv);h._callbackOrEmit(v,O)}});try{this.value=this._transformPresence(this.value,c,f)}catch(p){this.emit("error",p)}},u.prototype._handleCreateOrDel=function(){this._pendingMessages.forEach(function(c){c.p=null}),this.value=null},u.prototype._handleLoad=function(){this.value=null,this._pendingMessages=[],this._docDataVersionByPresenceVersion={}},u.prototype._message=function(){var c=o.prototype._message.call(this);return c.c=this.collection,c.d=this.id,c.v=null,c.t=null,c},u.prototype._transformPresence=function(c,f,h){var d=this._doc.type;if(!l.supportsPresence(d))throw new s(a.ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE,"Type does not support presence: "+d.name);return d.transformPresence(c,f,h)}},{"../../error":25,"../../util":32,"./local-presence":16}],16:[function(n,r,i){var o=n("../../emitter"),s=n("../../message-actions").ACTIONS,l=n("../../util");r.exports=a;function a(u,c){if(o.EventEmitter.call(this),!c||typeof c!="string")throw new Error("LocalPresence presenceId must be a string");this.presence=u,this.presenceId=c,this.connection=u.connection,this.presenceVersion=0,this.value=null,this._pendingMessages=[],this._callbacksByPresenceVersion={}}o.mixin(a),a.prototype.submit=function(u,c){this.value=u,this.send(c)},a.prototype.send=function(u){var c=this._message();this._pendingMessages.push(c),this._callbacksByPresenceVersion[c.pv]=u,this._sendPending()},a.prototype.destroy=function(u){var c=this;this.submit(null,function(f){if(f)return c._callbackOrEmit(f,u);delete c.presence.localPresences[c.presenceId],u&&u()})},a.prototype._sendPending=function(){if(this.connection.canSend){var u=this;this._pendingMessages.forEach(function(c){u.connection.send(c)}),this._pendingMessages=[]}},a.prototype._ack=function(u,c){var f=this._getCallback(c);this._callbackOrEmit(u,f)},a.prototype._message=function(){return{a:s.presence,ch:this.presence.channel,id:this.presenceId,p:this.value,pv:this.presenceVersion++}},a.prototype._getCallback=function(u){var c=this._callbacksByPresenceVersion[u];return delete this._callbacksByPresenceVersion[u],c},a.prototype._callbackOrEmit=function(u,c){if(c)return l.nextTick(c,u);u&&this.emit("error",u)}},{"../../emitter":24,"../../message-actions":28,"../../util":32}],17:[function(n,r,i){var o=n("../../emitter"),s=n("./local-presence"),l=n("./remote-presence"),a=n("../../util"),u=n("async"),c=n("hat"),f=n("../../message-actions").ACTIONS;r.exports=h;function h(d,p){if(o.EventEmitter.call(this),!p||typeof p!="string")throw new Error("Presence channel must be provided");this.connection=d,this.channel=p,this.wantSubscribe=!1,this.subscribed=!1,this.remotePresences={},this.localPresences={},this._remotePresenceInstances={},this._subscriptionCallbacksBySeq={},this._wantsDestroy=!1}o.mixin(h),h.prototype.subscribe=function(d){this._sendSubscriptionAction(!0,d)},h.prototype.unsubscribe=function(d){this._sendSubscriptionAction(!1,d)},h.prototype.create=function(d){if(this._wantsDestroy)throw new Error("Presence is being destroyed");d=d||c();var p=this._createLocalPresence(d);return this.localPresences[d]=p,p},h.prototype.destroy=function(d){this._wantsDestroy=!0;var p=this,g=Object.keys(p.localPresences);this.unsubscribe(function(O){if(O)return p._callbackOrEmit(O,d);var v=Object.keys(p._remotePresenceInstances);u.parallel([function(m){u.each(g,function(y,S){p.localPresences[y].destroy(S)},m)},function(m){if(!p._wantsDestroy)return m();u.each(v,function(y,S){p._remotePresenceInstances[y].destroy(S)},m)}],function(m){p._wantsDestroy&&delete p.connection._presences[p.channel],p._callbackOrEmit(m,d)})})},h.prototype._sendSubscriptionAction=function(d,p){if(d=!!d,d===this.wantSubscribe){if(!p)return;if(d===this.subscribed)return a.nextTick(p);if(Object.keys(this._subscriptionCallbacksBySeq).length)return this._combineSubscribeCallbackWithLastAdded(p)}this.wantSubscribe=d;var g=this.wantSubscribe?f.presenceSubscribe:f.presenceUnsubscribe,O=this.connection._presenceSeq++;this._subscriptionCallbacksBySeq[O]=p,this.connection.canSend&&this.connection._sendPresenceAction(g,O,this)},h.prototype._requestRemotePresence=function(){this.connection._requestRemotePresence(this.channel)},h.prototype._handleSubscribe=function(d,p){this.wantSubscribe&&(this.subscribed=!0);var g=this._subscriptionCallback(p);this._callbackOrEmit(d,g)},h.prototype._handleUnsubscribe=function(d,p){this.subscribed=!1;var g=this._subscriptionCallback(p);this._callbackOrEmit(d,g)},h.prototype._receiveUpdate=function(d,p){var g=a.dig(this.localPresences,p.id);if(g)return g._ack(d,p.pv);if(d)return this.emit("error",d);var O=this,v=a.digOrCreate(this._remotePresenceInstances,p.id,function(){return O._createRemotePresence(p.id)});v.receiveUpdate(p)},h.prototype._updateRemotePresence=function(d){this.remotePresences[d.presenceId]=d.value,d.value===null&&this._removeRemotePresence(d.presenceId),this.emit("receive",d.presenceId,d.value)},h.prototype._broadcastAllLocalPresence=function(d){if(d)return this.emit("error",d);for(var p in this.localPresences){var g=this.localPresences[p];g.value!==null&&g.send()}},h.prototype._removeRemotePresence=function(d){this._remotePresenceInstances[d].destroy(),delete this._remotePresenceInstances[d],delete this.remotePresences[d]},h.prototype._onConnectionStateChanged=function(){if(!this.connection.canSend){this.subscribed=!1;return}this._resubscribe();for(var d in this.localPresences)this.localPresences[d]._sendPending()},h.prototype._resubscribe=function(){var d=[];for(var p in this._subscriptionCallbacksBySeq){var g=this._subscriptionCallback(p);d.push(g)}if(!this.wantSubscribe)return this._callEachOrEmit(d);var O=this;this.subscribe(function(v){O._callEachOrEmit(d,v)})},h.prototype._subscriptionCallback=function(d){var p=this._subscriptionCallbacksBySeq[d];return delete this._subscriptionCallbacksBySeq[d],p},h.prototype._callbackOrEmit=function(d,p){if(p)return a.nextTick(p,d);d&&this.emit("error",d)},h.prototype._createLocalPresence=function(d){return new s(this,d)},h.prototype._createRemotePresence=function(d){return new l(this,d)},h.prototype._callEachOrEmit=function(d,p){var g=a.callEach(d,p);!g&&p&&this.emit("error",p)},h.prototype._combineSubscribeCallbackWithLastAdded=function(d){var p=Object.keys(this._subscriptionCallbacksBySeq),g=p[p.length-1],O=this._subscriptionCallbacksBySeq[g];if(!O)return this._subscriptionCallbacksBySeq[g]=d;this._subscriptionCallbacksBySeq[g]=function(v){O(v),d(v)}}},{"../../emitter":24,"../../message-actions":28,"../../util":32,"./local-presence":16,"./remote-presence":19,async:1,hat:4}],18:[function(n,r,i){var o=n("./remote-presence"),s=n("../../ot");r.exports=l;function l(a,u){o.call(this,a,u),this.collection=this.presence.collection,this.id=this.presence.id,this.src=null,this.presenceVersion=null,this._doc=this.connection.get(this.collection,this.id),this._emitter=this.connection._docPresenceEmitter,this._pending=null,this._opCache=null,this._pendingSetPending=!1,this._opHandler=this._handleOp.bind(this),this._createDelHandler=this._handleCreateDel.bind(this),this._loadHandler=this._handleLoad.bind(this),this._registerWithDoc()}l.prototype=Object.create(o.prototype),l.prototype.receiveUpdate=function(a){this._pending&&a.pv<this._pending.pv||(this.src=a.src,this._pending=a,this._setPendingPresence())},l.prototype.destroy=function(a){this._emitter.removeEventListener(this._doc,"op",this._opHandler),this._emitter.removeEventListener(this._doc,"create",this._createDelHandler),this._emitter.removeEventListener(this._doc,"del",this._createDelHandler),this._emitter.removeEventListener(this._doc,"load",this._loadHandler),o.prototype.destroy.call(this,a)},l.prototype._registerWithDoc=function(){this._emitter.addEventListener(this._doc,"op",this._opHandler),this._emitter.addEventListener(this._doc,"create",this._createDelHandler),this._emitter.addEventListener(this._doc,"del",this._createDelHandler),this._emitter.addEventListener(this._doc,"load",this._loadHandler)},l.prototype._setPendingPresence=function(){if(!this._pendingSetPending){this._pendingSetPending=!0;var a=this;this._doc.whenNothingPending(function(){if(a._pendingSetPending=!1,!!a._pending){if(a._pending.pv<a.presenceVersion)return a._pending=null;if(a._pending.v>a._doc.version)return a._doc.fetch();a._catchUpStalePresence()&&(a.value=a._pending.p,a.presenceVersion=a._pending.pv,a._pending=null,a.presence._updateRemotePresence(a))}})}},l.prototype._handleOp=function(a,u,c){var f=c===this.src;this._transformAgainstOp(a,f),this._cacheOp(a,f),this._setPendingPresence()},o.prototype._handleCreateDel=function(){this._cacheOp(null),this._setPendingPresence()},o.prototype._handleLoad=function(){this.value=null,this._pending=null,this._opCache=null,this.presence._updateRemotePresence(this)},l.prototype._transformAgainstOp=function(a,u){if(this.value){try{this.value=this._doc.type.transformPresence(this.value,a,u)}catch(c){return this.presence.emit("error",c)}this.presence._updateRemotePresence(this)}},l.prototype._catchUpStalePresence=function(){if(this._pending.v>=this._doc.version)return!0;if(!this._opCache)return this._startCachingOps(),this._doc.fetch(),this.presence._requestRemotePresence(),!1;for(;this._opCache[this._pending.v];){var a=this._opCache[this._pending.v],u=a.op,c=a.isOwnOp;u===null?(this._pending.p=null,this._pending.v++):s.transformPresence(this._pending,u,c)}var f=this._pending.v>=this._doc.version;return f&&this._stopCachingOps(),f},l.prototype._startCachingOps=function(){this._opCache=[]},l.prototype._stopCachingOps=function(){this._opCache=null},l.prototype._cacheOp=function(a,u){this._opCache&&(a=a?{op:a}:null,this._opCache[this._doc.version-1]={op:a,isOwnOp:u})}},{"../../ot":29,"./remote-presence":19}],19:[function(n,r,i){var o=n("../../util");r.exports=s;function s(l,a){this.presence=l,this.presenceId=a,this.connection=this.presence.connection,this.value=null,this.presenceVersion=0}s.prototype.receiveUpdate=function(l){l.pv<this.presenceVersion||(this.value=l.p,this.presenceVersion=l.pv,this.presence._updateRemotePresence(this))},s.prototype.destroy=function(l){delete this.presence._remotePresenceInstances[this.presenceId],delete this.presence.remotePresences[this.presenceId],l&&o.nextTick(l)}},{"../../util":32}],20:[function(n,r,i){var o=n("../emitter"),s=n("../message-actions").ACTIONS,l=n("../util");r.exports=a;function a(u,c,f,h,d,p,g){o.EventEmitter.call(this),this.action=u,this.connection=c,this.id=f,this.collection=h,this.query=d,this.results=null,p&&p.results&&(this.results=p.results,delete p.results),this.extra=void 0,this.options=p,this.callback=g,this.ready=!1,this.sent=!1}o.mixin(a),a.prototype.hasPending=function(){return!this.ready},a.prototype.send=function(){if(this.connection.canSend){var u={a:this.action,id:this.id,c:this.collection,q:this.query};if(this.options&&(u.o=this.options),this.results){for(var c=[],f=0;f<this.results.length;f++){var h=this.results[f];c.push([h.id,h.version])}u.r=c}this.connection.send(u),this.sent=!0}},a.prototype.destroy=function(u){this.connection.canSend&&this.action===s.querySubscribe&&this.connection.send({a:s.queryUnsubscribe,id:this.id}),this.connection._destroyQuery(this),u&&l.nextTick(u)},a.prototype._onConnectionStateChanged=function(){this.connection.canSend&&!this.sent?this.send():this.sent=!1},a.prototype._handleFetch=function(u,c,f){this.connection._destroyQuery(this),this._handleResponse(u,c,f)},a.prototype._handleSubscribe=function(u,c,f){this._handleResponse(u,c,f)},a.prototype._handleResponse=function(u,c,f){var h=this.callback;if(this.callback=null,u)return this._finishResponse(u,h);if(!c)return this._finishResponse(null,h);var d=this,p=1,g=function(y){if(y)return d._finishResponse(y,h);--p||d._finishResponse(null,h)};if(Array.isArray(c))p+=c.length,this.results=this._ingestSnapshots(c,g),this.extra=f;else for(var O in c){p++;var v=c[O],m=this.connection.get(v.c||this.collection,O);m.ingestSnapshot(v,g)}g()},a.prototype._ingestSnapshots=function(u,c){for(var f=[],h=0;h<u.length;h++){var d=u[h],p=this.connection.get(d.c||this.collection,d.d);p.ingestSnapshot(d,c),f.push(p)}return f},a.prototype._finishResponse=function(u,c){if(this.emit("ready"),this.ready=!0,u)return this.connection._destroyQuery(this),c?c(u):this.emit("error",u);c&&c(null,this.results,this.extra)},a.prototype._handleError=function(u){this.emit("error",u)},a.prototype._handleDiff=function(u){for(var c=0;c<u.length;c++){var f=u[c];f.type==="insert"&&(f.values=this._ingestSnapshots(f.values))}for(var c=0;c<u.length;c++){var f=u[c];switch(f.type){case"insert":var h=f.values;Array.prototype.splice.apply(this.results,[f.index,0].concat(h)),this.emit("insert",h,f.index);break;case"remove":var p=f.howMany||1,d=this.results.splice(f.index,p);this.emit("remove",d,f.index);break;case"move":var p=f.howMany||1,g=this.results.splice(f.from,p);Array.prototype.splice.apply(this.results,[f.to,0].concat(g)),this.emit("move",g,f.from,f.to);break}}this.emit("changed",this.results)},a.prototype._handleExtra=function(u){this.extra=u,this.emit("extra",u)}},{"../emitter":24,"../message-actions":28,"../util":32}],21:[function(n,r,i){var o=n("../../snapshot"),s=n("../../emitter");r.exports=l;function l(a,u,c,f,h){if(s.EventEmitter.call(this),typeof h!="function")throw new Error("Callback is required for SnapshotRequest");this.requestId=u,this.connection=a,this.id=f,this.collection=c,this.callback=h,this.sent=!1}s.mixin(l),l.prototype.send=function(){this.connection.canSend&&(this.connection.send(this._message()),this.sent=!0)},l.prototype._onConnectionStateChanged=function(){this.connection.canSend?this.sent||this.send():this.sent=!1},l.prototype._handleResponse=function(a,u){if(this.emit("ready"),a)return this.callback(a);var c=u.meta?u.meta:null,f=new o(this.id,u.v,u.type,u.data,c);this.callback(null,f)}},{"../../emitter":24,"../../snapshot":30}],22:[function(n,r,i){var o=n("./snapshot-request"),s=n("../../util"),l=n("../../message-actions").ACTIONS;r.exports=a;function a(u,c,f,h,d,p){if(o.call(this,u,c,f,h,p),!s.isValidTimestamp(d))throw new Error("Snapshot timestamp must be a positive integer or null");this.timestamp=d}a.prototype=Object.create(o.prototype),a.prototype._message=function(){return{a:l.snapshotFetchByTimestamp,id:this.requestId,c:this.collection,d:this.id,ts:this.timestamp}}},{"../../message-actions":28,"../../util":32,"./snapshot-request":21}],23:[function(n,r,i){var o=n("./snapshot-request"),s=n("../../util"),l=n("../../message-actions").ACTIONS;r.exports=a;function a(u,c,f,h,d,p){if(o.call(this,u,c,f,h,p),!s.isValidVersion(d))throw new Error("Snapshot version must be a positive integer or null");this.version=d}a.prototype=Object.create(o.prototype),a.prototype._message=function(){return{a:l.snapshotFetch,id:this.requestId,c:this.collection,d:this.id,v:this.version}}},{"../../message-actions":28,"../../util":32,"./snapshot-request":21}],24:[function(n,r,i){var o=n("events").EventEmitter;i.EventEmitter=o,i.mixin=s;function s(l){for(var a in o.prototype)l.prototype[a]=o.prototype[a]}},{events:2}],25:[function(n,r,i){function o(s,l){this.code=s,this.message=l||"",Error.captureStackTrace?Error.captureStackTrace(this,o):this.stack=new Error().stack}o.prototype=Object.create(Error.prototype),o.prototype.constructor=o,o.prototype.name="ShareDBError",o.CODES={ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT:"ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT",ERR_APPLY_SNAPSHOT_NOT_PROVIDED:"ERR_APPLY_SNAPSHOT_NOT_PROVIDED",ERR_FIXUP_IS_ONLY_VALID_ON_APPLY:"ERR_FIXUP_IS_ONLY_VALID_ON_APPLY",ERR_CANNOT_FIXUP_DELETION:"ERR_CANNOT_FIXUP_DELETION",ERR_CLIENT_ID_BADLY_FORMED:"ERR_CLIENT_ID_BADLY_FORMED",ERR_CANNOT_PING_OFFLINE:"ERR_CANNOT_PING_OFFLINE",ERR_CONNECTION_SEQ_INTEGER_OVERFLOW:"ERR_CONNECTION_SEQ_INTEGER_OVERFLOW",ERR_CONNECTION_STATE_TRANSITION_INVALID:"ERR_CONNECTION_STATE_TRANSITION_INVALID",ERR_DATABASE_ADAPTER_NOT_FOUND:"ERR_DATABASE_ADAPTER_NOT_FOUND",ERR_DATABASE_DOES_NOT_SUPPORT_SUBSCRIBE:"ERR_DATABASE_DOES_NOT_SUPPORT_SUBSCRIBE",ERR_DATABASE_METHOD_NOT_IMPLEMENTED:"ERR_DATABASE_METHOD_NOT_IMPLEMENTED",ERR_DEFAULT_TYPE_MISMATCH:"ERR_DEFAULT_TYPE_MISMATCH",ERR_DOC_MISSING_VERSION:"ERR_DOC_MISSING_VERSION",ERR_DOC_ALREADY_CREATED:"ERR_DOC_ALREADY_CREATED",ERR_DOC_DOES_NOT_EXIST:"ERR_DOC_DOES_NOT_EXIST",ERR_DOC_TYPE_NOT_RECOGNIZED:"ERR_DOC_TYPE_NOT_RECOGNIZED",ERR_DOC_WAS_DELETED:"ERR_DOC_WAS_DELETED",ERR_INFLIGHT_OP_MISSING:"ERR_INFLIGHT_OP_MISSING",ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION:"ERR_INGESTED_SNAPSHOT_HAS_NO_VERSION",ERR_MAX_SUBMIT_RETRIES_EXCEEDED:"ERR_MAX_SUBMIT_RETRIES_EXCEEDED",ERR_MESSAGE_BADLY_FORMED:"ERR_MESSAGE_BADLY_FORMED",ERR_MILESTONE_ARGUMENT_INVALID:"ERR_MILESTONE_ARGUMENT_INVALID",ERR_OP_ALREADY_SUBMITTED:"ERR_OP_ALREADY_SUBMITTED",ERR_OP_NOT_ALLOWED_IN_PROJECTION:"ERR_OP_NOT_ALLOWED_IN_PROJECTION",ERR_OP_SUBMIT_REJECTED:"ERR_OP_SUBMIT_REJECTED",ERR_PENDING_OP_REMOVED_BY_OP_SUBMIT_REJECTED:"ERR_PENDING_OP_REMOVED_BY_OP_SUBMIT_REJECTED",ERR_HARD_ROLLBACK_FETCH_FAILED:"ERR_HARD_ROLLBACK_FETCH_FAILED",ERR_OP_VERSION_MISMATCH_AFTER_TRANSFORM:"ERR_OP_VERSION_MISMATCH_AFTER_TRANSFORM",ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM:"ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM",ERR_OP_VERSION_NEWER_THAN_CURRENT_SNAPSHOT:"ERR_OP_VERSION_NEWER_THAN_CURRENT_SNAPSHOT",ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED:"ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED",ERR_OT_OP_BADLY_FORMED:"ERR_OT_OP_BADLY_FORMED",ERR_OT_OP_NOT_APPLIED:"ERR_OT_OP_NOT_APPLIED",ERR_OT_OP_NOT_PROVIDED:"ERR_OT_OP_NOT_PROVIDED",ERR_PRESENCE_TRANSFORM_FAILED:"ERR_PRESENCE_TRANSFORM_FAILED",ERR_PROTOCOL_VERSION_NOT_SUPPORTED:"ERR_PROTOCOL_VERSION_NOT_SUPPORTED",ERR_QUERY_CHANNEL_MISSING:"ERR_QUERY_CHANNEL_MISSING",ERR_QUERY_EMITTER_LISTENER_NOT_ASSIGNED:"ERR_QUERY_EMITTER_LISTENER_NOT_ASSIGNED",ERR_SNAPSHOT_READ_SILENT_REJECTION:"ERR_SNAPSHOT_READ_SILENT_REJECTION",ERR_SNAPSHOT_READS_REJECTED:"ERR_SNAPSHOT_READS_REJECTED",ERR_SUBMIT_TRANSFORM_OPS_NOT_FOUND:"ERR_SUBMIT_TRANSFORM_OPS_NOT_FOUND",ERR_TYPE_CANNOT_BE_PROJECTED:"ERR_TYPE_CANNOT_BE_PROJECTED",ERR_TYPE_DOES_NOT_SUPPORT_COMPOSE:"ERR_TYPE_DOES_NOT_SUPPORT_COMPOSE",ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE:"ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE",ERR_UNKNOWN_ERROR:"ERR_UNKNOWN_ERROR"},r.exports=o},{}],26:[function(n,r,i){var o=n("./logger"),s=new o;r.exports=s},{"./logger":27}],27:[function(n,r,i){var o=["info","warn","error"];function s(){var l={};o.forEach(function(a){l[a]=console[a].bind(console)}),this.setMethods(l)}r.exports=s,s.prototype.setMethods=function(l){l=l||{};var a=this;o.forEach(function(u){typeof l[u]=="function"&&(a[u]=l[u])})}},{}],28:[function(n,r,i){i.ACTIONS={initLegacy:"init",handshake:"hs",queryFetch:"qf",querySubscribe:"qs",queryUnsubscribe:"qu",queryUpdate:"q",bulkFetch:"bf",bulkSubscribe:"bs",bulkUnsubscribe:"bu",fetch:"f",fixup:"fixup",subscribe:"s",unsubscribe:"u",op:"op",snapshotFetch:"nf",snapshotFetchByTimestamp:"nt",pingPong:"pp",presence:"p",presenceSubscribe:"ps",presenceUnsubscribe:"pu",presenceRequest:"pr"}},{}],29:[function(n,r,i){var o=n("./types"),s=n("./error"),l=n("./util"),a=s.CODES;i.checkOp=function(f){if(f==null||typeof f!="object")return new s(a.ERR_OT_OP_BADLY_FORMED,"Op must be an object");if(f.create!=null){if(typeof f.create!="object")return new s(a.ERR_OT_OP_BADLY_FORMED,"Create data must be an object");var h=f.create.type;if(typeof h!="string")return new s(a.ERR_OT_OP_BADLY_FORMED,"Missing create type");var d=o.map[h];if(d==null||typeof d!="object")return new s(a.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type")}else if(f.del!=null){if(f.del!==!0)return new s(a.ERR_OT_OP_BADLY_FORMED,"del value must be true")}else if(!("op"in f))return new s(a.ERR_OT_OP_BADLY_FORMED,"Missing op, create, or del");if(f.src!=null&&typeof f.src!="string")return new s(a.ERR_OT_OP_BADLY_FORMED,"src must be a string");if(f.seq!=null&&typeof f.seq!="number")return new s(a.ERR_OT_OP_BADLY_FORMED,"seq must be a number");if(f.src==null&&f.seq!=null||f.src!=null&&f.seq==null)return new s(a.ERR_OT_OP_BADLY_FORMED,"Both src and seq must be set together");if(f.m!=null&&typeof f.m!="object")return new s(a.ERR_OT_OP_BADLY_FORMED,"op.m must be an object or null")},i.normalizeType=function(f){return o.map[f]&&o.map[f].uri},i.apply=function(f,h){if(typeof f!="object")return new s(a.ERR_APPLY_SNAPSHOT_NOT_PROVIDED,"Missing snapshot");if(f.v!=null&&h.v!=null&&f.v!==h.v)return new s(a.ERR_APPLY_OP_VERSION_DOES_NOT_MATCH_SNAPSHOT,"Version mismatch");if(h.create){if(f.type)return new s(a.ERR_DOC_ALREADY_CREATED,"Document already exists");var d=h.create,p=o.map[d.type];if(!p)return new s(a.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{f.data=p.create(d.data),f.type=p.uri,f.v++}catch(O){return O}}else if(h.del)f.data=void 0,f.type=null,f.v++;else if("op"in h){var g=u(f,h.op);if(g)return g;f.v++}else f.v++};function u(f,h){if(!f.type)return new s(a.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");if(h===void 0)return new s(a.ERR_OT_OP_NOT_PROVIDED,"Missing op");var d=o.map[f.type];if(!d)return new s(a.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{f.data=d.apply(f.data,h)}catch(p){return new s(a.ERR_OT_OP_NOT_APPLIED,p.message)}}i.transform=function(f,h,d){if(h.v!=null&&h.v!==d.v)return new s(a.ERR_OP_VERSION_MISMATCH_DURING_TRANSFORM,"Version mismatch");if(d.del){if(h.create||"op"in h)return new s(a.ERR_DOC_WAS_DELETED,"Document was deleted")}else{if(d.create&&("op"in h||h.create||h.del)||"op"in d&&h.create)return new s(a.ERR_DOC_ALREADY_CREATED,"Document was created remotely");if("op"in d&&"op"in h){if(!f)return new s(a.ERR_DOC_DOES_NOT_EXIST,"Document does not exist");if(typeof f=="string"&&(f=o.map[f],!f))return new s(a.ERR_DOC_TYPE_NOT_RECOGNIZED,"Unknown type");try{h.op=f.transform(h.op,d.op,"left")}catch(p){return p}}}h.v!=null&&h.v++},i.applyOps=function(f,h,d){d=d||{};for(var p=0;p<h.length;p++){var g=h[p];if(d._normalizeLegacyJson0Ops)try{c(f,g)}catch{return new s(a.ERR_OT_LEGACY_JSON0_OP_CANNOT_BE_NORMALIZED,"Cannot normalize legacy json0 op")}f.v=g.v;var O=i.apply(f,g);if(O)return O}},i.transformPresence=function(f,h,d){var p=this.checkOp(h);if(p)return p;var g=f.t;if(typeof g=="string"&&(g=o.map[g]),!g)return{code:a.ERR_DOC_TYPE_NOT_RECOGNIZED,message:"Unknown type"};if(!l.supportsPresence(g))return{code:a.ERR_TYPE_DOES_NOT_SUPPORT_PRESENCE,message:"Type does not support presence"};if(h.create||h.del){f.p=null,f.v++;return}try{f.p=f.p===null?null:g.transformPresence(f.p,h.op,d)}catch(O){return{code:a.ERR_PRESENCE_TRANSFORM_FAILED,message:O.message||O}}f.v++};function c(f,h){if(f.type===o.defaultType.uri){var d=h.op;if(d){var p=f.data;d.length>1&&(p=l.clone(p));for(var g=0;g<d.length;g++){var O=d[g];typeof O.lm=="string"&&(O.lm=+O.lm);for(var v=O.p,m=p,y=0;y<v.length;y++){var S=v[y];Object.prototype.toString.call(m)=="[object Array]"?v[y]=+S:m.constructor===Object&&(v[y]=S.toString()),m=m[S]}g<d.length-1&&(p=o.defaultType.apply(p,[O]))}}}}},{"./error":25,"./types":31,"./util":32}],30:[function(n,r,i){r.exports=o;function o(s,l,a,u,c){this.id=s,this.v=l,this.type=a,this.data=u,this.m=c}},{}],31:[function(n,r,i){i.defaultType=n("ot-json0").type,i.map={},i.register=function(o){o.name&&(i.map[o.name]=o),o.uri&&(i.map[o.uri]=o)},i.register(i.defaultType)},{"ot-json0":6}],32:[function(n,r,i){(function(o){(function(){i.doNothing=s;function s(){}i.hasKeys=function(l){for(var a in l)return!0;return!1},i.isInteger=Number.isInteger||function(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l},i.isValidVersion=function(l){return l===null?!0:i.isInteger(l)&&l>=0},i.isValidTimestamp=function(l){return i.isValidVersion(l)},i.MAX_SAFE_INTEGER=9007199254740991,i.dig=function(){for(var l=arguments[0],a=1;a<arguments.length;a++){var u=arguments[a];l=l[u]||(a===arguments.length-1?void 0:{})}return l},i.digOrCreate=function(){for(var l=arguments[0],a=arguments[arguments.length-1],u=1;u<arguments.length-1;u++){var c=arguments[u];l=l[c]||(l[c]=u===arguments.length-2?a():{})}return l},i.digAndRemove=function(){for(var l=arguments[0],a=[l],u=1;u<arguments.length-1;u++){var c=arguments[u];if(!l.hasOwnProperty(c))break;l=l[c],a.push(l)}for(var u=a.length-1;u>=0;u--){var f=a[u],c=arguments[u+1],h=f[c];(u===a.length-1||!i.hasKeys(h))&&delete f[c]}},i.supportsPresence=function(l){return l&&typeof l.transformPresence=="function"},i.callEach=function(l,a){var u=!1;return l.forEach(function(c){c&&(c(a),u=!0)}),u},i.truthy=function(l){return!!l},i.nextTick=function(l){if(typeof o<"u"&&o.nextTick)return o.nextTick.apply(null,arguments);for(var a=[],u=1;u<arguments.length;u++)a[u-1]=arguments[u];setTimeout(function(){l.apply(null,a)})},i.clone=function(l){return l===void 0?void 0:JSON.parse(JSON.stringify(l))}}).call(this)}).call(this,n("_process"))},{_process:9}],33:[function(n,r,i){(function(o,s){(function(){var l=n("process/browser.js").nextTick,a=Function.prototype.apply,u=Array.prototype.slice,c={},f=0;i.setTimeout=function(){return new h(a.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new h(a.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(d){d.close()};function h(d,p){this._id=d,this._clearFn=p}h.prototype.unref=h.prototype.ref=function(){},h.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(d,p){clearTimeout(d._idleTimeoutId),d._idleTimeout=p},i.unenroll=function(d){clearTimeout(d._idleTimeoutId),d._idleTimeout=-1},i._unrefActive=i.active=function(d){clearTimeout(d._idleTimeoutId);var p=d._idleTimeout;p>=0&&(d._idleTimeoutId=setTimeout(function(){d._onTimeout&&d._onTimeout()},p))},i.setImmediate=typeof o=="function"?o:function(d){var p=f++,g=arguments.length<2?!1:u.call(arguments,1);return c[p]=!0,l(function(){c[p]&&(g?d.apply(null,g):d.call(null),i.clearImmediate(p))}),p},i.clearImmediate=typeof s=="function"?s:function(d){delete c[d]}}).call(this)}).call(this,n("timers").setImmediate,n("timers").clearImmediate)},{"process/browser.js":9,timers:33}],34:[function(n,r,i){r.exports=n("sharedb/lib/client")},{"sharedb/lib/client":12}]},{},[34])(34)})})(rE);var hD=rE.exports;const iE=vi(hD);var oE={exports:{}};(function(t,e){(function(n){t.exports=n()})(function(){return function(){function n(r,i,o){function s(u,c){if(!i[u]){if(!r[u]){var f=typeof Jo=="function"&&Jo;if(!c&&f)return f(u,!0);if(l)return l(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var d=i[u]={exports:{}};r[u][0].call(d.exports,function(p){var g=r[u][1][p];return s(g||p)},d,d.exports,n,r,i,o)}return i[u].exports}for(var l=typeof Jo=="function"&&Jo,a=0;a<o.length;a++)s(o[a]);return s}return n}()({1:[function(n,r,i){(function(o){(function(){var s=n("object-assign");/*!
44
- * The buffer module from node.js, for the browser.
45
- *
46
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
47
- * @license MIT
48
- */function l(M,L){if(M===L)return 0;for(var N=M.length,Y=L.length,q=0,ae=Math.min(N,Y);q<ae;++q)if(M[q]!==L[q]){N=M[q],Y=L[q];break}return N<Y?-1:Y<N?1:0}function a(M){return o.Buffer&&typeof o.Buffer.isBuffer=="function"?o.Buffer.isBuffer(M):!!(M!=null&&M._isBuffer)}var u=n("util/"),c=Object.prototype.hasOwnProperty,f=Array.prototype.slice,h=function(){return(function(){}).name==="foo"}();function d(M){return Object.prototype.toString.call(M)}function p(M){return a(M)||typeof o.ArrayBuffer!="function"?!1:typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(M):M?!!(M instanceof DataView||M.buffer&&M.buffer instanceof ArrayBuffer):!1}var g=r.exports=P,O=/\s*function\s+([^\(\s]*)\s*/;function v(M){if(u.isFunction(M)){if(h)return M.name;var L=M.toString(),N=L.match(O);return N&&N[1]}}g.AssertionError=function(L){this.name="AssertionError",this.actual=L.actual,this.expected=L.expected,this.operator=L.operator,L.message?(this.message=L.message,this.generatedMessage=!1):(this.message=S(this),this.generatedMessage=!0);var N=L.stackStartFunction||k;if(Error.captureStackTrace)Error.captureStackTrace(this,N);else{var Y=new Error;if(Y.stack){var q=Y.stack,ae=v(N),pe=q.indexOf(`
49
- `+ae);if(pe>=0){var U=q.indexOf(`
50
- `,pe+1);q=q.substring(U+1)}this.stack=q}}},u.inherits(g.AssertionError,Error);function m(M,L){return typeof M=="string"?M.length<L?M:M.slice(0,L):M}function y(M){if(h||!u.isFunction(M))return u.inspect(M);var L=v(M),N=L?": "+L:"";return"[Function"+N+"]"}function S(M){return m(y(M.actual),128)+" "+M.operator+" "+m(y(M.expected),128)}function k(M,L,N,Y,q){throw new g.AssertionError({message:N,actual:M,expected:L,operator:Y,stackStartFunction:q})}g.fail=k;function P(M,L){M||k(M,!0,L,"==",g.ok)}g.ok=P,g.equal=function(L,N,Y){L!=N&&k(L,N,Y,"==",g.equal)},g.notEqual=function(L,N,Y){L==N&&k(L,N,Y,"!=",g.notEqual)},g.deepEqual=function(L,N,Y){C(L,N,!1)||k(L,N,Y,"deepEqual",g.deepEqual)},g.deepStrictEqual=function(L,N,Y){C(L,N,!0)||k(L,N,Y,"deepStrictEqual",g.deepStrictEqual)};function C(M,L,N,Y){if(M===L)return!0;if(a(M)&&a(L))return l(M,L)===0;if(u.isDate(M)&&u.isDate(L))return M.getTime()===L.getTime();if(u.isRegExp(M)&&u.isRegExp(L))return M.source===L.source&&M.global===L.global&&M.multiline===L.multiline&&M.lastIndex===L.lastIndex&&M.ignoreCase===L.ignoreCase;if((M===null||typeof M!="object")&&(L===null||typeof L!="object"))return N?M===L:M==L;if(p(M)&&p(L)&&d(M)===d(L)&&!(M instanceof Float32Array||M instanceof Float64Array))return l(new Uint8Array(M.buffer),new Uint8Array(L.buffer))===0;if(a(M)!==a(L))return!1;Y=Y||{actual:[],expected:[]};var q=Y.actual.indexOf(M);return q!==-1&&q===Y.expected.indexOf(L)?!0:(Y.actual.push(M),Y.expected.push(L),x(M,L,N,Y))}function w(M){return Object.prototype.toString.call(M)=="[object Arguments]"}function x(M,L,N,Y){if(M==null||L===null||L===void 0)return!1;if(u.isPrimitive(M)||u.isPrimitive(L))return M===L;if(N&&Object.getPrototypeOf(M)!==Object.getPrototypeOf(L))return!1;var q=w(M),ae=w(L);if(q&&!ae||!q&&ae)return!1;if(q)return M=f.call(M),L=f.call(L),C(M,L,N);var pe=G(M),U=G(L),H,se;if(pe.length!==U.length)return!1;for(pe.sort(),U.sort(),se=pe.length-1;se>=0;se--)if(pe[se]!==U[se])return!1;for(se=pe.length-1;se>=0;se--)if(H=pe[se],!C(M[H],L[H],N,Y))return!1;return!0}g.notDeepEqual=function(L,N,Y){C(L,N,!1)&&k(L,N,Y,"notDeepEqual",g.notDeepEqual)},g.notDeepStrictEqual=_;function _(M,L,N){C(M,L,!0)&&k(M,L,N,"notDeepStrictEqual",_)}g.strictEqual=function(L,N,Y){L!==N&&k(L,N,Y,"===",g.strictEqual)},g.notStrictEqual=function(L,N,Y){L===N&&k(L,N,Y,"!==",g.notStrictEqual)};function E(M,L){if(!M||!L)return!1;if(Object.prototype.toString.call(L)=="[object RegExp]")return L.test(M);try{if(M instanceof L)return!0}catch{}return Error.isPrototypeOf(L)?!1:L.call({},M)===!0}function $(M){var L;try{M()}catch(N){L=N}return L}function j(M,L,N,Y){var q;if(typeof L!="function")throw new TypeError('"block" argument must be a function');typeof N=="string"&&(Y=N,N=null),q=$(L),Y=(N&&N.name?" ("+N.name+").":".")+(Y?" "+Y:"."),M&&!q&&k(q,N,"Missing expected exception"+Y);var ae=typeof Y=="string",pe=!M&&u.isError(q),U=!M&&q&&!N;if((pe&&ae&&E(q,N)||U)&&k(q,N,"Got unwanted exception"+Y),M&&q&&N&&!E(q,N)||!M&&q)throw q}g.throws=function(M,L,N){j(!0,M,L,N)},g.doesNotThrow=function(M,L,N){j(!1,M,L,N)},g.ifError=function(M){if(M)throw M};function W(M,L){M||k(M,!0,L,"==",W)}g.strict=s(W,g,{equal:g.strictEqual,deepEqual:g.deepStrictEqual,notEqual:g.notStrictEqual,notDeepEqual:g.notDeepStrictEqual}),g.strict.strict=g.strict;var G=Object.keys||function(M){var L=[];for(var N in M)c.call(M,N)&&L.push(N);return L}}).call(this)}).call(this,typeof Yr<"u"?Yr:typeof self<"u"?self:typeof window<"u"?window:{})},{"object-assign":22,"util/":4}],2:[function(n,r,i){typeof Object.create=="function"?r.exports=function(s,l){s.super_=l,s.prototype=Object.create(l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}})}:r.exports=function(s,l){s.super_=l;var a=function(){};a.prototype=l.prototype,s.prototype=new a,s.prototype.constructor=s}},{}],3:[function(n,r,i){r.exports=function(s){return s&&typeof s=="object"&&typeof s.copy=="function"&&typeof s.fill=="function"&&typeof s.readUInt8=="function"}},{}],4:[function(n,r,i){(function(o,s){(function(){var l=/%[sdj%]/g;i.format=function(U){if(!x(U)){for(var H=[],se=0;se<arguments.length;se++)H.push(c(arguments[se]));return H.join(" ")}for(var se=1,Ie=arguments,F=Ie.length,z=String(U).replace(l,function(be){if(be==="%%")return"%";if(se>=F)return be;switch(be){case"%s":return String(Ie[se++]);case"%d":return Number(Ie[se++]);case"%j":try{return JSON.stringify(Ie[se++])}catch{return"[Circular]"}default:return be}}),J=Ie[se];se<F;J=Ie[++se])P(J)||!j(J)?z+=" "+J:z+=" "+c(J);return z},i.deprecate=function(U,H){if(E(s.process))return function(){return i.deprecate(U,H).apply(this,arguments)};if(o.noDeprecation===!0)return U;var se=!1;function Ie(){if(!se){if(o.throwDeprecation)throw new Error(H);o.traceDeprecation?console.trace(H):console.error(H),se=!0}return U.apply(this,arguments)}return Ie};var a={},u;i.debuglog=function(U){if(E(u)&&(u=o.env.NODE_DEBUG||""),U=U.toUpperCase(),!a[U])if(new RegExp("\\b"+U+"\\b","i").test(u)){var H=o.pid;a[U]=function(){var se=i.format.apply(i,arguments);console.error("%s %d: %s",U,H,se)}}else a[U]=function(){};return a[U]};function c(U,H){var se={seen:[],stylize:h};return arguments.length>=3&&(se.depth=arguments[2]),arguments.length>=4&&(se.colors=arguments[3]),k(H)?se.showHidden=H:H&&i._extend(se,H),E(se.showHidden)&&(se.showHidden=!1),E(se.depth)&&(se.depth=2),E(se.colors)&&(se.colors=!1),E(se.customInspect)&&(se.customInspect=!0),se.colors&&(se.stylize=f),p(se,U,se.depth)}i.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function f(U,H){var se=c.styles[H];return se?"\x1B["+c.colors[se][0]+"m"+U+"\x1B["+c.colors[se][1]+"m":U}function h(U,H){return U}function d(U){var H={};return U.forEach(function(se,Ie){H[se]=!0}),H}function p(U,H,se){if(U.customInspect&&H&&M(H.inspect)&&H.inspect!==i.inspect&&!(H.constructor&&H.constructor.prototype===H)){var Ie=H.inspect(se,U);return x(Ie)||(Ie=p(U,Ie,se)),Ie}var F=g(U,H);if(F)return F;var z=Object.keys(H),J=d(z);if(U.showHidden&&(z=Object.getOwnPropertyNames(H)),G(H)&&(z.indexOf("message")>=0||z.indexOf("description")>=0))return O(H);if(z.length===0){if(M(H)){var be=H.name?": "+H.name:"";return U.stylize("[Function"+be+"]","special")}if($(H))return U.stylize(RegExp.prototype.toString.call(H),"regexp");if(W(H))return U.stylize(Date.prototype.toString.call(H),"date");if(G(H))return O(H)}var Ae="",Me=!1,De=["{","}"];if(S(H)&&(Me=!0,De=["[","]"]),M(H)){var nt=H.name?": "+H.name:"";Ae=" [Function"+nt+"]"}if($(H)&&(Ae=" "+RegExp.prototype.toString.call(H)),W(H)&&(Ae=" "+Date.prototype.toUTCString.call(H)),G(H)&&(Ae=" "+O(H)),z.length===0&&(!Me||H.length==0))return De[0]+Ae+De[1];if(se<0)return $(H)?U.stylize(RegExp.prototype.toString.call(H),"regexp"):U.stylize("[Object]","special");U.seen.push(H);var st;return Me?st=v(U,H,se,J,z):st=z.map(function(Tt){return m(U,H,se,J,Tt,Me)}),U.seen.pop(),y(st,Ae,De)}function g(U,H){if(E(H))return U.stylize("undefined","undefined");if(x(H)){var se="'"+JSON.stringify(H).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return U.stylize(se,"string")}if(w(H))return U.stylize(""+H,"number");if(k(H))return U.stylize(""+H,"boolean");if(P(H))return U.stylize("null","null")}function O(U){return"["+Error.prototype.toString.call(U)+"]"}function v(U,H,se,Ie,F){for(var z=[],J=0,be=H.length;J<be;++J)pe(H,String(J))?z.push(m(U,H,se,Ie,String(J),!0)):z.push("");return F.forEach(function(Ae){Ae.match(/^\d+$/)||z.push(m(U,H,se,Ie,Ae,!0))}),z}function m(U,H,se,Ie,F,z){var J,be,Ae;if(Ae=Object.getOwnPropertyDescriptor(H,F)||{value:H[F]},Ae.get?Ae.set?be=U.stylize("[Getter/Setter]","special"):be=U.stylize("[Getter]","special"):Ae.set&&(be=U.stylize("[Setter]","special")),pe(Ie,F)||(J="["+F+"]"),be||(U.seen.indexOf(Ae.value)<0?(P(se)?be=p(U,Ae.value,null):be=p(U,Ae.value,se-1),be.indexOf(`
51
- `)>-1&&(z?be=be.split(`
52
- `).map(function(Me){return" "+Me}).join(`
53
- `).substr(2):be=`
54
- `+be.split(`
55
- `).map(function(Me){return" "+Me}).join(`
56
- `))):be=U.stylize("[Circular]","special")),E(J)){if(z&&F.match(/^\d+$/))return be;J=JSON.stringify(""+F),J.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(J=J.substr(1,J.length-2),J=U.stylize(J,"name")):(J=J.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),J=U.stylize(J,"string"))}return J+": "+be}function y(U,H,se){var Ie=U.reduce(function(F,z){return z.indexOf(`
57
- `)>=0,F+z.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Ie>60?se[0]+(H===""?"":H+`
58
- `)+" "+U.join(`,
59
- `)+" "+se[1]:se[0]+H+" "+U.join(", ")+" "+se[1]}function S(U){return Array.isArray(U)}i.isArray=S;function k(U){return typeof U=="boolean"}i.isBoolean=k;function P(U){return U===null}i.isNull=P;function C(U){return U==null}i.isNullOrUndefined=C;function w(U){return typeof U=="number"}i.isNumber=w;function x(U){return typeof U=="string"}i.isString=x;function _(U){return typeof U=="symbol"}i.isSymbol=_;function E(U){return U===void 0}i.isUndefined=E;function $(U){return j(U)&&N(U)==="[object RegExp]"}i.isRegExp=$;function j(U){return typeof U=="object"&&U!==null}i.isObject=j;function W(U){return j(U)&&N(U)==="[object Date]"}i.isDate=W;function G(U){return j(U)&&(N(U)==="[object Error]"||U instanceof Error)}i.isError=G;function M(U){return typeof U=="function"}i.isFunction=M;function L(U){return U===null||typeof U=="boolean"||typeof U=="number"||typeof U=="string"||typeof U=="symbol"||typeof U>"u"}i.isPrimitive=L,i.isBuffer=n("./support/isBuffer");function N(U){return Object.prototype.toString.call(U)}function Y(U){return U<10?"0"+U.toString(10):U.toString(10)}var q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ae(){var U=new Date,H=[Y(U.getHours()),Y(U.getMinutes()),Y(U.getSeconds())].join(":");return[U.getDate(),q[U.getMonth()],H].join(" ")}i.log=function(){console.log("%s - %s",ae(),i.format.apply(i,arguments))},i.inherits=n("inherits"),i._extend=function(U,H){if(!H||!j(H))return U;for(var se=Object.keys(H),Ie=se.length;Ie--;)U[se[Ie]]=H[se[Ie]];return U};function pe(U,H){return Object.prototype.hasOwnProperty.call(U,H)}}).call(this)}).call(this,n("_process"),typeof Yr<"u"?Yr:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":3,_process:33,inherits:2}],5:[function(n,r,i){(function(o){(function(){var s=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],l=typeof globalThis>"u"?o:globalThis;r.exports=function(){for(var u=[],c=0;c<s.length;c++)typeof l[s[c]]=="function"&&(u[u.length]=s[c]);return u}}).call(this)}).call(this,typeof Yr<"u"?Yr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],6:[function(n,r,i){var o=n("get-intrinsic"),s=n("./"),l=s(o("String.prototype.indexOf"));r.exports=function(u,c){var f=o(u,!!c);return typeof f=="function"&&l(u,".prototype.")>-1?s(f):f}},{"./":7,"get-intrinsic":11}],7:[function(n,r,i){var o=n("function-bind"),s=n("get-intrinsic"),l=s("%Function.prototype.apply%"),a=s("%Function.prototype.call%"),u=s("%Reflect.apply%",!0)||o.call(a,l),c=s("%Object.getOwnPropertyDescriptor%",!0),f=s("%Object.defineProperty%",!0),h=s("%Math.max%");if(f)try{f({},"a",{value:1})}catch{f=null}r.exports=function(g){var O=u(o,a,arguments);if(c&&f){var v=c(O,"length");v.configurable&&f(O,"length",{value:1+h(0,g.length-(arguments.length-1))})}return O};var d=function(){return u(o,l,arguments)};f?f(r.exports,"apply",{value:d}):r.exports.apply=d},{"function-bind":10,"get-intrinsic":11}],8:[function(n,r,i){var o=n("is-callable"),s=Object.prototype.toString,l=Object.prototype.hasOwnProperty,a=function(d,p,g){for(var O=0,v=d.length;O<v;O++)l.call(d,O)&&(g==null?p(d[O],O,d):p.call(g,d[O],O,d))},u=function(d,p,g){for(var O=0,v=d.length;O<v;O++)g==null?p(d.charAt(O),O,d):p.call(g,d.charAt(O),O,d)},c=function(d,p,g){for(var O in d)l.call(d,O)&&(g==null?p(d[O],O,d):p.call(g,d[O],O,d))},f=function(d,p,g){if(!o(p))throw new TypeError("iterator must be a function");var O;arguments.length>=3&&(O=g),s.call(d)==="[object Array]"?a(d,p,O):typeof d=="string"?u(d,p,O):c(d,p,O)};r.exports=f},{"is-callable":19}],9:[function(n,r,i){var o="Function.prototype.bind called on incompatible ",s=Array.prototype.slice,l=Object.prototype.toString,a="[object Function]";r.exports=function(c){var f=this;if(typeof f!="function"||l.call(f)!==a)throw new TypeError(o+f);for(var h=s.call(arguments,1),d,p=function(){if(this instanceof d){var y=f.apply(this,h.concat(s.call(arguments)));return Object(y)===y?y:this}else return f.apply(c,h.concat(s.call(arguments)))},g=Math.max(0,f.length-h.length),O=[],v=0;v<g;v++)O.push("$"+v);if(d=Function("binder","return function ("+O.join(",")+"){ return binder.apply(this,arguments); }")(p),f.prototype){var m=function(){};m.prototype=f.prototype,d.prototype=new m,m.prototype=null}return d}},{}],10:[function(n,r,i){var o=n("./implementation");r.exports=Function.prototype.bind||o},{"./implementation":9}],11:[function(n,r,i){var o,s=SyntaxError,l=Function,a=TypeError,u=function(M){try{return l('"use strict"; return ('+M+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var f=function(){throw new a},h=c?function(){try{return arguments.callee,f}catch{try{return c(arguments,"callee").get}catch{return f}}}():f,d=n("has-symbols")(),p=Object.getPrototypeOf||function(M){return M.__proto__},g={},O=typeof Uint8Array>"u"?o:p(Uint8Array),v={"%AggregateError%":typeof AggregateError>"u"?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?o:ArrayBuffer,"%ArrayIteratorPrototype%":d?p([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":typeof Atomics>"u"?o:Atomics,"%BigInt%":typeof BigInt>"u"?o:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?o:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?o:Float32Array,"%Float64Array%":typeof Float64Array>"u"?o:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?o:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":g,"%Int8Array%":typeof Int8Array>"u"?o:Int8Array,"%Int16Array%":typeof Int16Array>"u"?o:Int16Array,"%Int32Array%":typeof Int32Array>"u"?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d?p(p([][Symbol.iterator]())):o,"%JSON%":typeof JSON=="object"?JSON:o,"%Map%":typeof Map>"u"?o:Map,"%MapIteratorPrototype%":typeof Map>"u"||!d?o:p(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?o:Promise,"%Proxy%":typeof Proxy>"u"?o:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?o:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?o:Set,"%SetIteratorPrototype%":typeof Set>"u"||!d?o:p(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d?p(""[Symbol.iterator]()):o,"%Symbol%":d?Symbol:o,"%SyntaxError%":s,"%ThrowTypeError%":h,"%TypedArray%":O,"%TypeError%":a,"%Uint8Array%":typeof Uint8Array>"u"?o:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?o:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?o:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?o:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?o:WeakMap,"%WeakRef%":typeof WeakRef>"u"?o:WeakRef,"%WeakSet%":typeof WeakSet>"u"?o:WeakSet};try{null.error}catch(M){var m=p(p(M));v["%Error.prototype%"]=m}var y=function M(L){var N;if(L==="%AsyncFunction%")N=u("async function () {}");else if(L==="%GeneratorFunction%")N=u("function* () {}");else if(L==="%AsyncGeneratorFunction%")N=u("async function* () {}");else if(L==="%AsyncGenerator%"){var Y=M("%AsyncGeneratorFunction%");Y&&(N=Y.prototype)}else if(L==="%AsyncIteratorPrototype%"){var q=M("%AsyncGenerator%");q&&(N=p(q.prototype))}return v[L]=N,N},S={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},k=n("function-bind"),P=n("has"),C=k.call(Function.call,Array.prototype.concat),w=k.call(Function.apply,Array.prototype.splice),x=k.call(Function.call,String.prototype.replace),_=k.call(Function.call,String.prototype.slice),E=k.call(Function.call,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,W=function(L){var N=_(L,0,1),Y=_(L,-1);if(N==="%"&&Y!=="%")throw new s("invalid intrinsic syntax, expected closing `%`");if(Y==="%"&&N!=="%")throw new s("invalid intrinsic syntax, expected opening `%`");var q=[];return x(L,$,function(ae,pe,U,H){q[q.length]=U?x(H,j,"$1"):pe||ae}),q},G=function(L,N){var Y=L,q;if(P(S,Y)&&(q=S[Y],Y="%"+q[0]+"%"),P(v,Y)){var ae=v[Y];if(ae===g&&(ae=y(Y)),typeof ae>"u"&&!N)throw new a("intrinsic "+L+" exists, but is not available. Please file an issue!");return{alias:q,name:Y,value:ae}}throw new s("intrinsic "+L+" does not exist!")};r.exports=function(L,N){if(typeof L!="string"||L.length===0)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof N!="boolean")throw new a('"allowMissing" argument must be a boolean');if(E(/^%?[^%]*%?$/,L)===null)throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Y=W(L),q=Y.length>0?Y[0]:"",ae=G("%"+q+"%",N),pe=ae.name,U=ae.value,H=!1,se=ae.alias;se&&(q=se[0],w(Y,C([0,1],se)));for(var Ie=1,F=!0;Ie<Y.length;Ie+=1){var z=Y[Ie],J=_(z,0,1),be=_(z,-1);if((J==='"'||J==="'"||J==="`"||be==='"'||be==="'"||be==="`")&&J!==be)throw new s("property names with quotes must have matching quotes");if((z==="constructor"||!F)&&(H=!0),q+="."+z,pe="%"+q+"%",P(v,pe))U=v[pe];else if(U!=null){if(!(z in U)){if(!N)throw new a("base intrinsic for "+L+" exists, but the property is not available.");return}if(c&&Ie+1>=Y.length){var Ae=c(U,z);F=!!Ae,F&&"get"in Ae&&!("originalValue"in Ae.get)?U=Ae.get:U=U[z]}else F=P(U,z),U=U[z];F&&!H&&(v[pe]=U)}}return U}},{"function-bind":10,has:16,"has-symbols":13}],12:[function(n,r,i){var o=n("get-intrinsic"),s=o("%Object.getOwnPropertyDescriptor%",!0);if(s)try{s([],"length")}catch{s=null}r.exports=s},{"get-intrinsic":11}],13:[function(n,r,i){var o=typeof Symbol<"u"&&Symbol,s=n("./shams");r.exports=function(){return typeof o!="function"||typeof Symbol!="function"||typeof o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:s()}},{"./shams":14}],14:[function(n,r,i){r.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var s={},l=Symbol("test"),a=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var u=42;s[l]=u;for(l in s)return!1;if(typeof Object.keys=="function"&&Object.keys(s).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(s).length!==0)return!1;var c=Object.getOwnPropertySymbols(s);if(c.length!==1||c[0]!==l||!Object.prototype.propertyIsEnumerable.call(s,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(s,l);if(f.value!==u||f.enumerable!==!0)return!1}return!0}},{}],15:[function(n,r,i){var o=n("has-symbols/shams");r.exports=function(){return o()&&!!Symbol.toStringTag}},{"has-symbols/shams":14}],16:[function(n,r,i){var o=n("function-bind");r.exports=o.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":10}],17:[function(n,r,i){typeof Object.create=="function"?r.exports=function(s,l){l&&(s.super_=l,s.prototype=Object.create(l.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(s,l){if(l){s.super_=l;var a=function(){};a.prototype=l.prototype,s.prototype=new a,s.prototype.constructor=s}}},{}],18:[function(n,r,i){var o=n("has-tostringtag/shams")(),s=n("call-bind/callBound"),l=s("Object.prototype.toString"),a=function(h){return o&&h&&typeof h=="object"&&Symbol.toStringTag in h?!1:l(h)==="[object Arguments]"},u=function(h){return a(h)?!0:h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&l(h)!=="[object Array]"&&l(h.callee)==="[object Function]"},c=function(){return a(arguments)}();a.isLegacyArguments=u,r.exports=c?a:u},{"call-bind/callBound":6,"has-tostringtag/shams":15}],19:[function(n,r,i){var o=Function.prototype.toString,s=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,l,a;if(typeof s=="function"&&typeof Object.defineProperty=="function")try{l=Object.defineProperty({},"length",{get:function(){throw a}}),a={},s(function(){throw 42},null,l)}catch(C){C!==a&&(s=null)}else s=null;var u=/^\s*class\b/,c=function(w){try{var x=o.call(w);return u.test(x)}catch{return!1}},f=function(w){try{return c(w)?!1:(o.call(w),!0)}catch{return!1}},h=Object.prototype.toString,d="[object Object]",p="[object Function]",g="[object GeneratorFunction]",O="[object HTMLAllCollection]",v="[object HTML document.all class]",m="[object HTMLCollection]",y=typeof Symbol=="function"&&!!Symbol.toStringTag,S=!(0 in[,]),k=function(){return!1};if(typeof document=="object"){var P=document.all;h.call(P)===h.call(document.all)&&(k=function(w){if((S||!w)&&(typeof w>"u"||typeof w=="object"))try{var x=h.call(w);return(x===O||x===v||x===m||x===d)&&w("")==null}catch{}return!1})}r.exports=s?function(w){if(k(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;try{s(w,null,l)}catch(x){if(x!==a)return!1}return!c(w)&&f(w)}:function(w){if(k(w))return!0;if(!w||typeof w!="function"&&typeof w!="object")return!1;if(y)return f(w);if(c(w))return!1;var x=h.call(w);return x!==p&&x!==g&&!/^\[object HTML/.test(x)?!1:f(w)}},{}],20:[function(n,r,i){var o=Object.prototype.toString,s=Function.prototype.toString,l=/^\s*(?:function)?\*/,a=n("has-tostringtag/shams")(),u=Object.getPrototypeOf,c=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch{}},f;r.exports=function(d){if(typeof d!="function")return!1;if(l.test(s.call(d)))return!0;if(!a){var p=o.call(d);return p==="[object GeneratorFunction]"}if(!u)return!1;if(typeof f>"u"){var g=c();f=g?u(g):!1}return u(d)===f}},{"has-tostringtag/shams":15}],21:[function(n,r,i){(function(o){(function(){var s=n("for-each"),l=n("available-typed-arrays"),a=n("call-bind/callBound"),u=a("Object.prototype.toString"),c=n("has-tostringtag/shams")(),f=n("gopd"),h=typeof globalThis>"u"?o:globalThis,d=l(),p=a("Array.prototype.indexOf",!0)||function(S,k){for(var P=0;P<S.length;P+=1)if(S[P]===k)return P;return-1},g=a("String.prototype.slice"),O={},v=Object.getPrototypeOf;c&&f&&v&&s(d,function(y){var S=new h[y];if(Symbol.toStringTag in S){var k=v(S),P=f(k,Symbol.toStringTag);if(!P){var C=v(k);P=f(C,Symbol.toStringTag)}O[y]=P.get}});var m=function(S){var k=!1;return s(O,function(P,C){if(!k)try{k=P.call(S)===C}catch{}}),k};r.exports=function(S){if(!S||typeof S!="object")return!1;if(!c||!(Symbol.toStringTag in S)){var k=g(u(S),8,-1);return p(d,k)>-1}return f?m(S):!1}}).call(this)}).call(this,typeof Yr<"u"?Yr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":5,"call-bind/callBound":6,"for-each":8,gopd:12,"has-tostringtag/shams":15}],22:[function(n,r,i){var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;function a(c){if(c==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(c)}function u(){try{if(!Object.assign)return!1;var c=new String("abc");if(c[5]="de",Object.getOwnPropertyNames(c)[0]==="5")return!1;for(var f={},h=0;h<10;h++)f["_"+String.fromCharCode(h)]=h;var d=Object.getOwnPropertyNames(f).map(function(g){return f[g]});if(d.join("")!=="0123456789")return!1;var p={};return"abcdefghijklmnopqrst".split("").forEach(function(g){p[g]=g}),Object.keys(Object.assign({},p)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}r.exports=u()?Object.assign:function(c,f){for(var h,d=a(c),p,g=1;g<arguments.length;g++){h=Object(arguments[g]);for(var O in h)s.call(h,O)&&(d[O]=h[O]);if(o){p=o(h);for(var v=0;v<p.length;v++)l.call(h,p[v])&&(d[p[v]]=h[p[v]])}}return d}},{}],23:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.eachChildOf=i.advancer=i.readCursor=i.writeCursor=i.WriteCursor=i.ReadCursor=i.isValidPathItem=void 0;function o(v,m){if(!v)throw new Error(m)}const s=v=>v!=null&&typeof v=="object"&&!Array.isArray(v),l=(v,m)=>typeof v==typeof m?v>m:typeof v=="string"&&typeof m=="number";function a(v,m){for(let y in v){const S=y;m.write(S,v[S])}}const u=v=>typeof v=="number"||typeof v=="string"&&v!=="__proto__";i.isValidPathItem=u;class c{constructor(m=null){this.parents=[],this.indexes=[],this.lcIdx=-1,this.idx=-1,this.container=m}ascend(){o(this.parents.length===this.indexes.length/2),this.idx===0?this.parents.length?(this.lcIdx=this.indexes.pop(),this.container=this.parents.pop(),this.idx=this.indexes.pop()):(this.lcIdx=0,this.idx=-1):(o(this.idx>0),this.idx--,s(this.container[this.idx])&&this.idx--)}getPath(){const m=[];let y=this.container,S=this.parents.length-1,k=this.idx;for(;k>=0;)m.unshift(y[k]),k===0?(k=this.indexes[S*2],y=this.parents[S--]):k-=s(y[k-1])?2:1;return m}}class f extends c{get(){return this.container?this.container.slice(this.idx+1):null}getKey(){return o(this.container!=null,"Invalid call to getKey before cursor descended"),this.container[this.idx]}getComponent(){let m;return this.container&&this.container.length>this.idx+1&&s(m=this.container[this.idx+1])?m:null}descendFirst(){let m=this.idx+1;if(!this.container||m>=this.container.length||s(this.container[m])&&m+1>=this.container.length)return!1;s(this.container[m])&&m++;const y=this.container[m];return Array.isArray(y)?(this.indexes.push(this.idx),this.parents.push(this.container),this.indexes.push(m),this.idx=0,this.container=y):this.idx=m,!0}nextSibling(){if(o(this.parents.length===this.indexes.length/2),this.idx>0||this.parents.length===0)return!1;const m=this.indexes[this.indexes.length-1]+1,y=this.parents[this.parents.length-1];return m>=y.length?!1:(o(!isNaN(m)),this.indexes[this.indexes.length-1]=m,this.container=y[m],!0)}_init(m,y,S,k){this.container=m,this.idx=y,this.parents=S.slice(),this.indexes=k.slice()}clone(){const m=new f;return m._init(this.container,this.idx,this.parents,this.indexes),m}*[Symbol.iterator](){if(this.descendFirst()){do yield this.getKey();while(this.nextSibling());this.ascend()}}traverse(m,y){const S=this.getComponent();S&&y(S,m);for(const k of this)m&&m.descend(k),this.traverse(m,y),m&&m.ascend()}eachPick(m,y){this.traverse(m,(S,k)=>{S.p!=null&&y(S.p,k)})}eachDrop(m,y){this.traverse(m,(S,k)=>{S.d!=null&&y(S.d,k)})}}i.ReadCursor=f;class h extends c{constructor(m=null){super(m),this.pendingDescent=[],this._op=m}flushDescent(){o(this.parents.length===this.indexes.length/2),this.container===null&&(this._op=this.container=[]);for(let m=0;m<this.pendingDescent.length;m++){const y=this.pendingDescent[m];let S=this.idx+1;if(S<this.container.length&&s(this.container[S])&&S++,o(S===this.container.length||!s(this.container[S])),S===this.container.length)this.container.push(y),this.idx=S;else if(this.container[S]===y)this.idx=S;else{if(!Array.isArray(this.container[S])){const k=this.container.splice(S,this.container.length-S);this.container.push(k),this.lcIdx>-1&&(this.lcIdx=S)}for(this.indexes.push(this.idx),this.parents.push(this.container),this.lcIdx!==-1&&(o(l(y,this.container[this.lcIdx][0])),S=this.lcIdx+1,this.lcIdx=-1);S<this.container.length&&l(y,this.container[S][0]);)S++;if(this.indexes.push(S),this.idx=0,S<this.container.length&&this.container[S][0]===y)this.container=this.container[S];else{const k=[y];this.container.splice(S,0,k),this.container=k}}}this.pendingDescent.length=0}reset(){this.lcIdx=-1}getComponent(){this.flushDescent();const m=this.idx+1;if(m<this.container.length&&s(this.container[m]))return this.container[m];{const y={};return this.container.splice(m,0,y),y}}write(m,y){const S=this.getComponent();o(S[m]==null||S[m]===y,"Internal consistency error: Overwritten component. File a bug"),S[m]=y}get(){return this._op}descend(m){if(!(0,i.isValidPathItem)(m))throw Error("Invalid JSON key");this.pendingDescent.push(m)}descendPath(m){return this.pendingDescent.push(...m),this}ascend(){this.pendingDescent.length?this.pendingDescent.pop():super.ascend()}mergeTree(m,y=a){if(m===null)return;if(o(Array.isArray(m)),m===this._op)throw Error("Cannot merge into my own tree");const S=this.lcIdx,k=this.parents.length;let P=0;for(let C=0;C<m.length;C++){const w=m[C];typeof w=="string"||typeof w=="number"?(P++,this.descend(w)):Array.isArray(w)?this.mergeTree(w,y):typeof w=="object"&&y(w,this)}for(;P--;)this.ascend();this.lcIdx=this.parents.length===k?S:-1}at(m,y){this.descendPath(m),y(this);for(let S=0;S<m.length;S++)this.ascend();return this}writeAtPath(m,y,S){return this.at(m,()=>this.write(y,S)),this.reset(),this}writeMove(m,y,S=0){return this.writeAtPath(m,"p",S).writeAtPath(y,"d",S)}getPath(){const m=super.getPath();return m.push(...this.pendingDescent),m}}i.WriteCursor=h;const d=()=>new h;i.writeCursor=d;const p=v=>new f(v);i.readCursor=p;function g(v,m,y){let S,k;k=S=v?v.descendFirst():!1;function P(C){let w;for(;k;){const x=w=v.getKey();if(C!=null){let _=!1;if(m&&typeof x=="number"&&(w=m(x,v.getComponent()),w<0&&(w=~w,_=!0)),l(w,C))return null;if(w===C&&!_)return v}y&&typeof w=="number"&&y(w,v.getComponent()),k=v.nextSibling()}return null}return P.end=()=>{S&&v.ascend()},P}i.advancer=g;function O(v,m,y){let S,k,P,C;for(S=k=v&&v.descendFirst(),P=C=m&&m.descendFirst();S||P;){let w=S?v.getKey():null,x=P?m.getKey():null;w!==null&&x!==null&&(l(x,w)?x=null:w!==x&&(w=null)),y(w??x,w!=null?v:null,x!=null?m:null),w!=null&&S&&(S=v.nextSibling()),x!=null&&P&&(P=m.nextSibling())}k&&v.ascend(),C&&m.ascend()}i.eachChildOf=O},{}],24:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0});function o(s){if(s===null)return null;if(Array.isArray(s))return s.map(o);if(typeof s=="object"){const l={};for(let a in s)l[a]=o(s[a]);return l}else return s}i.default=o},{}],25:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0});function o(a,u){if(Array.isArray(u))return!1;for(let c in a)if(!l(a[c],u[c]))return!1;for(let c in u)if(a[c]===void 0)return!1;return!0}function s(a,u){if(!Array.isArray(u)||a.length!==u.length)return!1;for(let c=0;c<a.length;c++)if(!l(a[c],u[c]))return!1;return!0}function l(a,u){return a===u?!0:a===null||u===null||typeof a!="object"||typeof u!="object"?!1:Array.isArray(a)?s(a,u):o(a,u)}i.default=l},{}],26:[function(n,r,i){var o=this&&this.__createBinding||(Object.create?function(u,c,f,h){h===void 0&&(h=f);var d=Object.getOwnPropertyDescriptor(c,f);(!d||("get"in d?!c.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(u,h,d)}:function(u,c,f,h){h===void 0&&(h=f),u[h]=c[f]}),s=this&&this.__exportStar||function(u,c){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&o(c,u,f)};Object.defineProperty(i,"__esModule",{value:!0}),i.ConflictType=i.WriteCursor=i.ReadCursor=void 0,s(n("./json1.release.js"),i);var l=n("./cursor.js");Object.defineProperty(i,"ReadCursor",{enumerable:!0,get:function(){return l.ReadCursor}}),Object.defineProperty(i,"WriteCursor",{enumerable:!0,get:function(){return l.WriteCursor}});var a=n("./types");Object.defineProperty(i,"ConflictType",{enumerable:!0,get:function(){return a.ConflictType}})},{"./cursor.js":23,"./json1.release.js":27,"./types":29}],27:[function(n,r,i){var o=this&&this.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(i,"__esModule",{value:!0}),i.editOp=i.replaceOp=i.insertOp=i.moveOp=i.removeOp=i.type=void 0;const s=o(n("./deepEqual.js")),l=o(n("./deepClone.js")),a=n("./cursor.js"),u=n("./types.js"),c=!0,f=()=>{};function h(R,ne){if(!R)throw new Error(ne)}let d=!1;i.type={name:"p",uri:"p",readCursor:a.readCursor,writeCursor:a.writeCursor,create:R=>R,isNoop:R=>R==null,setDebug(R){d=R,f.quiet=!R},registerSubtype:W,checkValidOp:pe,normalize:U,apply:H,transformPosition:Ie,transformPresence:F,compose:J,tryTransform:cn,transform:Pn,makeInvertible:Me,invert:be,invertWithDoc:De,RM_UNEXPECTED_CONTENT:u.ConflictType.RM_UNEXPECTED_CONTENT,DROP_COLLISION:u.ConflictType.DROP_COLLISION,BLACKHOLE:u.ConflictType.BLACKHOLE,transformNoConflict:(R,ne,ce)=>jn(()=>!0,R,ne,ce),typeAllowingConflictsPred:R=>Object.assign(Object.assign({},i.type),{transform:(ne,ce,we)=>jn(R,ne,ce,we)})};const p=R=>R?R.getComponent():null;function g(R){return R&&typeof R=="object"&&!Array.isArray(R)}const O=R=>Array.isArray(R)?R.slice():R!==null&&typeof R=="object"?Object.assign({},R):R,v=R=>R&&(R.p!=null||R.r!==void 0),m=R=>R&&(R.d!=null||R.i!==void 0),y=(R,ne=!0)=>(0,a.writeCursor)().writeAtPath(R,"r",ne).get();i.removeOp=y;const S=(R,ne)=>(0,a.writeCursor)().writeMove(R,ne).get();i.moveOp=S;const k=(R,ne)=>(0,a.writeCursor)().writeAtPath(R,"i",ne).get();i.insertOp=k;const P=(R,ne,ce)=>(0,a.writeCursor)().at(R,we=>{we.write("r",ne),we.write("i",ce)}).get();i.replaceOp=P;const C=(R,ne,ce,we=!1)=>(0,a.writeCursor)().at(R,ye=>Y(ye,ne,ce,we)).get();function w(R,ne){return h(R!=null),typeof ne=="number"?(h(Array.isArray(R),"Invalid key - child is not an array"),(R=R.slice()).splice(ne,1)):(h(g(R),"Invalid key - child is not an object"),delete(R=Object.assign({},R))[ne]),R}function x(R,ne,ce){return typeof ne=="number"?(h(R!=null,"Container is missing for key"),h(Array.isArray(R),"Cannot use numerical key for object container"),h(R.length>=ne,"Cannot insert into out of bounds index"),R.splice(ne,0,ce)):(h(g(R),"Cannot insert into missing item"),h(R[ne]===void 0,"Trying to overwrite value at key. Your op needs to remove it first"),R[ne]=ce),ce}i.editOp=C;const _=(R,ne,ce)=>((R=O(R))[ne]=ce,R),E=(R,ne)=>R!=null&&(typeof ne=="number"?Array.isArray(R):typeof R=="object"),$=(R,ne)=>E(R,ne)?R[ne]:void 0,j={};function W(R){let ne=R.type?R.type:R;ne.name&&(j[ne.name]=ne),ne.uri&&(j[ne.uri]=ne)}const G=R=>{const ne=j[R];if(ne)return ne;throw Error("Missing type: "+R)};W(n("ot-text-unicode"));const M=(R,ne)=>R+ne;W({name:"number",apply:M,compose:M,invert:R=>-R,transform:R=>R});const L=R=>R==null?null:R.et?G(R.et):R.es?j["text-unicode"]:R.ena!=null?j.number:null,N=R=>R.es?R.es:R.ena!=null?R.ena:R.e,Y=(R,ne,ce,we=!1)=>{const[ye,Pe]=typeof ne=="string"?[G(ne),ne]:[ne,ne.name];!we&&ye.isNoop&&ye.isNoop(ce)||(Pe==="number"?R.write("ena",ce):Pe==="text-unicode"?R.write("es",ce):(R.write("et",Pe),R.write("e",ce)))};function q(R){h(typeof R=="number"),h(R>=0),h(R===(0|R))}function ae(R){typeof R=="number"?q(R):h(typeof R=="string")}function pe(R){if(R===null)return;const ne=new Set,ce=new Set,we=Pe=>{let Je=!0,tt=!1;for(let ue in Pe){const _e=Pe[ue];if(Je=!1,h(ue==="p"||ue==="r"||ue==="d"||ue==="i"||ue==="e"||ue==="es"||ue==="ena"||ue==="et","Invalid component item '"+ue+"'"),ue==="p")q(_e),h(!ne.has(_e)),ne.add(_e),h(Pe.r===void 0);else if(ue==="d")q(_e),h(!ce.has(_e)),ce.add(_e),h(Pe.i===void 0);else if(ue==="e"||ue==="es"||ue==="ena"){h(!tt),tt=!0;const Se=L(Pe);h(Se,"Missing type in edit"),Se.checkValidOp&&Se.checkValidOp(N(Pe))}}h(!Je)},ye=(Pe,Je,tt)=>{if(!Array.isArray(Pe))throw Error("Op must be null or a list");if(Pe.length===0)throw Error("Empty descent");Je||ae(Pe[0]);let ue=1,_e=0,Se=0;for(let ke=0;ke<Pe.length;ke++){const Qe=Pe[ke];if(h(Qe!=null),Array.isArray(Qe)){const Le=ye(Qe,!1);if(_e){const lt=typeof Se,ge=typeof Le;lt===ge?h(Se<Le,"descent keys are not in order"):h(lt==="number"&&ge==="string")}Se=Le,_e++,ue=3}else typeof Qe=="object"?(h(ue===1,`Prev not scalar - instead ${ue}`),we(Qe),ue=2):(h(ue!==3),ae(Qe),h((0,a.isValidPathItem)(Qe),"Invalid path key"),ue=1)}return h(_e!==1,"Operation makes multiple descents. Remove some []"),h(ue===2||ue===3),Pe[0]};ye(R,!0),h(ne.size===ce.size,"Mismatched picks and drops in op");for(let Pe=0;Pe<ne.size;Pe++)h(ne.has(Pe)),h(ce.has(Pe))}function U(R){let ne=0,ce=[];const we=(0,a.writeCursor)();return we.mergeTree(R,(ye,Pe)=>{const Je=L(ye);if(Je){const ue=N(ye);Y(Pe,Je,Je.normalize?Je.normalize(ue):ue)}for(const ue of["r","p","i","d"])if(ye[ue]!==void 0){const _e=ue==="p"||ue==="d"?(tt=ye[ue],ce[tt]==null&&(ce[tt]=ne++),ce[tt]):ye[ue];Pe.write(ue,_e)}var tt}),we.get()}function H(R,ne){if(f.quiet=!d,pe(ne),ne===null)return R;const ce=[];return R=function we(ye,Pe){let Je=ye,tt=0,ue={root:ye},_e=0,Se=ue,ke="root";function Qe(){for(;_e<tt;_e++){let Le=Pe[_e];typeof Le!="object"&&(h(E(Se,ke)),Se=Se[ke]=O(Se[ke]),ke=Le)}}for(;tt<Pe.length;tt++){const Le=Pe[tt];if(Array.isArray(Le)){const lt=we(Je,Le);lt!==Je&&lt!==void 0&&(Qe(),Je=Se[ke]=lt)}else if(typeof Le=="object"){Le.d!=null?(Qe(),Je=x(Se,ke,ce[Le.d])):Le.i!==void 0&&(Qe(),Je=x(Se,ke,Le.i));const lt=L(Le);if(lt)Qe(),Je=Se[ke]=lt.apply(Je,N(Le));else if(Le.e!==void 0)throw Error("Subtype "+Le.et+" undefined")}else Je=$(Je,Le)}return ue.root}(R=function we(ye,Pe){const Je=[];let tt=0;for(;tt<Pe.length;tt++){const ue=Pe[tt];if(Array.isArray(ue))break;typeof ue!="object"&&(Je.push(ye),ye=$(ye,ue))}for(let ue=Pe.length-1;ue>=tt;ue--)ye=we(ye,Pe[ue]);for(--tt;tt>=0;tt--){const ue=Pe[tt];if(typeof ue!="object"){const _e=Je.pop();ye=ye===$(_e,ue)?_e:ye===void 0?w(_e,ue):_(_e,ue,ye)}else v(ue)&&(h(ye!==void 0,"Cannot pick up or remove undefined"),ue.p!=null&&(ce[ue.p]=ye),ye=void 0)}return ye}(R,ne),ne)}const se=()=>{};function Ie(R,ne){R=R.slice(),pe(ne);const ce=(0,a.readCursor)(ne);let we,ye,Pe=!1;const Je=[];for(let ue=0;;ue++){const _e=R[ue],Se=ce.getComponent();if(Se&&(Se.r!==void 0?Pe=!0:Se.p!=null&&(Pe=!1,we=Se.p,ye=ue)),ue>=R.length)break;let ke=0;const Qe=(0,a.advancer)(ce,void 0,(lt,ge)=>{v(ge)&&ke++});Je.unshift(Qe);const Le=Qe(_e);if(typeof _e=="number"&&(R[ue]-=ke),!Le)break}if(Je.forEach(ue=>ue.end()),Pe)return null;const tt=()=>{let ue=0;if(we!=null){const _e=ce.getPath();ue=_e.length,R=_e.concat(R.slice(ye))}for(c;ue<R.length;ue++){const _e=R[ue],Se=p(ce),ke=L(Se);if(ke){const ge=N(Se);ke.transformPosition?R[ue]=ke.transformPosition(R[ue],ge):ke.transformCursor&&(R[ue]=ke.transformCursor(R[ue],ge));break}let Qe=0;const Le=(0,a.advancer)(ce,(ge,Be)=>m(Be)?~(ge-Qe):ge-Qe,(ge,Be)=>{m(Be)&&Qe++}),lt=Le(_e);if(typeof _e=="number"&&(R[ue]+=Qe),!lt)break}};return we!=null?ce.eachDrop(null,ue=>{ue===we&&tt()}):tt(),R}function F(R,ne){if(!R||!R.start||!R.end)return null;const ce=Ie(R.start,ne),we=Ie(R.end,ne);return ce&&we?Object.assign(Object.assign({},R),{start:ce,end:we}):ce?Object.assign(Object.assign({},R),{start:ce,end:ce}):we?Object.assign(Object.assign({},R),{start:we,end:we}):null}const z=(R,ne,ce)=>{typeof ne=="number"?(h(Array.isArray(R)),h(ne<R.length)):(h(!Array.isArray(R)),h(R[ne]!==void 0)),ce===void 0?typeof ne=="number"?R.splice(ne,1):delete R[ne]:R[ne]=ce};function J(R,ne){if(pe(R),pe(ne),R==null)return ne;if(ne==null)return R;let ce=0;const we=(0,a.readCursor)(R),ye=(0,a.readCursor)(ne),Pe=(0,a.writeCursor)(),Je=[],tt=[],ue=[],_e=[],Se=[],ke=[],Qe=new Set;we.traverse(null,ge=>{ge.p!=null&&(ue[ge.p]=we.clone())}),ye.traverse(null,ge=>{ge.d!=null&&(_e[ge.d]=ye.clone())});const Le=(0,a.writeCursor)();return function ge(Be,pt,Fe,at,Rt,zt,Wt,Ut){h(pt||Fe);const Cn=p(pt),On=p(Fe),$r=!!On&&On.r!==void 0,An=!!Cn&&Cn.i!==void 0,In=Cn?Cn.d:null,Ln=On?On.p:null,yt=(zt||$r)&&Ln==null;if(Ln!=null)at=_e[Ln],Wt=tt[Ln]=new a.WriteCursor;else if(On&&On.r!==void 0)at=null;else{const Xe=p(at);Xe&&Xe.d!=null&&(at=null)}const Ze=p(at);if(In!=null)if(Be=ue[In],Ut=Je[In]=new a.WriteCursor,yt)zt&&!$r&&Ut.write("r",!0);else{const Xe=Se[In]=ce++;Wt.write("d",Xe)}else if(Cn&&Cn.i!==void 0)Be=null;else{const Xe=p(Be);Xe&&Xe.p!=null&&(Be=null)}let qe;An?(h(Rt===void 0),qe=Cn.i):qe=Rt;const He=(Ln==null?!An||zt||$r:qe===void 0)?null:Wt.getComponent();if(Ln!=null){if(!(Rt!==void 0||An)){const Xe=In!=null?Se[In]:ce++;ke[Ln]=Xe,Ut.write("p",Xe)}}else $r&&(An||Rt!==void 0||(On.r,Ut.write("r",On.r)));const Te=yt?null:L(Cn),me=L(Ze);if((Te||me)&&(Te&&Te.name,me&&me.name),Te&&me){h(Te===me);const Xe=N(Cn),xt=N(Ze),En=Te.compose(Xe,xt);Y(Wt,Te,En),Qe.add(Ze)}else Te?Y(Wt,Te,N(Cn)):me&&(Y(Wt,me,N(Ze)),Qe.add(Ze));const ct=typeof qe=="object"&&qe!=null;let ht=!1,kt=0,Vt=0,en=0,Ft=0,fn=0;const gt=(0,a.advancer)(at,(Xe,xt)=>m(xt)?Ft-Xe-1:Xe-Ft,(Xe,xt)=>{m(xt)&&Ft++}),ut=(0,a.advancer)(Be,(Xe,xt)=>v(xt)?kt-Xe-1:Xe-kt,(Xe,xt)=>{v(xt)&&kt++});if((0,a.eachChildOf)(pt,Fe,(Xe,xt,En)=>{let Rr,Sr,br=Xe,D=Xe,I=Xe;if(typeof Xe=="number"){let V=Xe+en;Sr=gt(V),D=V+Ft;let he=Xe+Vt;Rr=ut(he),m(p(Sr))&&(Rr=null),br=he+kt,I=Xe+fn,h(br>=0,"p1PickKey is negative"),h(D>=0,"p2DropKey is negative");const Ce=m(p(xt)),de=v(p(En));(Ce||de&&!yt)&&fn--,Ce&&Vt--,de&&en--}else Rr=ut(Xe),Sr=gt(Xe);Ut.descend(br),Wt.descend(D);const X=ct&&!m(p(xt))?qe[I]:void 0,le=ge(Rr,xt,En,Sr,X,yt,Wt,Ut);ct&&!yt?X!==le&&(ht||(qe=Array.isArray(qe)?qe.slice():Object.assign({},qe),ht=!0),z(qe,I,le)):h(le===void 0),Wt.ascend(),Ut.ascend()}),ut.end(),gt.end(),He!=null)He.i=qe;else if(!zt&&!$r&&Ln==null)return qe}(we,we.clone(),ye,ye.clone(),void 0,!1,Pe,Le),Pe.reset(),Pe.mergeTree(Le.get()),Pe.reset(),Pe.get(),Je.map(ge=>ge.get()),tt.map(ge=>ge.get()),we.traverse(Pe,(ge,Be)=>{const pt=ge.p;if(pt!=null){const Fe=Se[pt];Fe!=null&&Be.write("p",Fe);const at=Je[pt];at&&at.get(),at&&Be.mergeTree(at.get())}else ge.r!==void 0&&Be.write("r",ge.r)}),Pe.reset(),Pe.get(),ye.traverse(Pe,(ge,Be)=>{const pt=ge.d;if(pt!=null){const at=ke[pt];at!=null&&Be.write("d",at);const Rt=tt[pt];Rt&&Be.mergeTree(Rt.get())}else ge.i!==void 0&&Be.write("i",ge.i);const Fe=L(ge);Fe&&!Qe.has(ge)&&Y(Be,Fe,N(ge))}),Pe.get()}function be(R){if(R==null)return null;const ne=new a.ReadCursor(R),ce=new a.WriteCursor;let we;const ye=[],Pe=[];if(function tt(ue,_e,Se){const ke=ue.getComponent();let Qe,Le=!1;if(ke){ke.p!=null&&(_e.write("d",ke.p),ye[ke.p]=ue.clone()),ke.r!==void 0&&_e.write("i",ke.r),ke.d!=null&&(_e.write("p",ke.d),Se=void 0),ke.i!==void 0&&(Se=Qe=ke.i);const ge=L(ke);ge&&(Se===void 0?(we||(we=new Set),we.add(ke)):(N(ke),Se=ge.apply(Se,N(ke)),Le=!0))}let lt=0;for(const ge of ue){_e.descend(ge);const Be=typeof ge=="number"?ge-lt:ge,pt=$(Se,Be);m(ue.getComponent())&&lt++;const Fe=tt(ue,_e,pt);if(Se!==void 0&&Fe!==void 0){if(Le||(Le=!0,Se=O(Se)),!E(Se,Be))throw Error("Cannot modify child - invalid operation");Se[Be]=Fe}_e.ascend()}if(Qe===void 0)return Le?Se:void 0;_e.write("r",Se)}(ne,ce,void 0),we){let tt=function(ue,_e,Se){const ke=_e.getComponent();if(ke){const ge=ke.d;if(ge!=null&&(ue=ye[ge],Se=Pe[ge]=(0,a.writeCursor)()),we.has(ke)){const Be=L(ke);if(!Be.invert)throw Error(`Cannot invert subtype ${Be.name}`);Y(Se,Be,Be.invert(N(ke)))}}let Qe=0,Le=0;const lt=(0,a.advancer)(ue,(ge,Be)=>v(Be)?Qe-ge-1:ge-Qe,(ge,Be)=>{v(Be)&&Qe++});for(const ge of _e)if(typeof ge=="number"){const Be=ge-Le,pt=lt(Be),Fe=Be+Qe;Se.descend(Fe),tt(pt,_e,Se),m(_e.getComponent())&&Le++,Se.ascend()}else Se.descend(ge),tt(lt(ge),_e,Se),Se.ascend();lt.end()};ce.reset(),tt(ne.clone(),ne,ce),Pe.length&&(ce.reset(),ne.traverse(ce,(ue,_e)=>{const Se=ue.p;if(Se!=null){const ke=Pe[Se];ke&&ke.get(),ke&&_e.mergeTree(ke.get())}}))}return ce.get()}const Ae=(R,ne)=>R.some(ce=>typeof ce=="object"&&(Array.isArray(ce)?Ae(ce,ne):ne(ce)));function Me(R,ne){if(R==null||!Ae(R,_e=>{var Se;return _e.r!==void 0||((Se=L(_e))===null||Se===void 0?void 0:Se.makeInvertible)!=null}))return R;const ce=new a.ReadCursor(R),we=new a.WriteCursor;let ye=!1;const Pe=[],Je=[],tt=(_e,Se,ke)=>{const Qe=_e.getComponent();let Le=!1;if(Qe){Qe.d!=null&&Se.write("d",Qe.d),Qe.i!==void 0&&Se.write("i",Qe.i);const ge=Qe.p;if(ge!=null&&(Pe[ge]=_e.clone(),h(ke!==void 0,"Operation picks up at an invalid key"),Je[ge]=ke,Se.write("p",Qe.p)),Qe.r!==void 0&&ke===void 0)throw Error("Invalid doc / op in makeInvertible: removed item missing from doc");const Be=L(Qe);Be&&(Be.makeInvertible?ye=!0:Y(Se,Be,N(Qe),!0))}let lt=0;for(const ge of _e){Se.descend(ge);const Be=typeof ge=="number"?ge-lt:ge,pt=$(ke,Be),Fe=tt(_e,Se,pt);pt!==Fe&&(Le||(Le=!0,ke=O(ke)),Fe===void 0?(ke=w(ke,Be),typeof ge=="number"&&lt++):ke[Be]=Fe),Se.ascend()}return Qe&&(Qe.r!==void 0?(Se.write("r",(0,l.default)(ke)),ke=void 0):Qe.p!=null&&(ke=void 0)),ke};if(tt(ce,we,ne),we.get(),ye){let _e=function(Se,ke,Qe,Le,lt){const ge=ke.getComponent();if(ge){ge.i!==void 0?(Le=ge.i,lt=!0):ge.d!=null&&(Le=Je[ge.d],Se=Pe[ge.d],lt=!1,ge.d);let at=L(ge);if(at&&at.makeInvertible){const Rt=N(ge);Y(Qe,at,at.makeInvertible(Rt,Le),!0)}}let Be=0,pt=0;const Fe=(0,a.advancer)(Se,(at,Rt)=>v(Rt)?Be-at-1:at-Be,(at,Rt)=>{v(Rt)&&Be++});for(const at of ke)if(typeof at=="number"){const Rt=at-pt,zt=Fe(Rt),Wt=$(Le,lt?Rt:Rt+Be);Qe.descend(at),_e(zt,ke,Qe,Wt,lt),m(ke.getComponent())&&pt++,Qe.ascend()}else{const Rt=$(Le,at);Qe.descend(at),_e(Fe(at),ke,Qe,Rt,lt),Qe.ascend()}Fe.end()};we.reset(),_e(ce.clone(),ce,we,ne,!1)}return we.get()}function De(R,ne){return be(Me(R,ne))}const nt=0,st=1,Tt=R=>{if(R==null)return null;const ne=R.slice();for(let ce=0;ce<R.length;ce++){const we=ne[ce];Array.isArray(we)&&(ne[ce]=Tt(we))}return ne};function cn(R,ne,ce){h(ce==="left"||ce==="right","Direction must be left or right");const we=ce==="left"?nt:st;if(f.quiet=!d,f.prefix=0,ne==null)return{ok:!0,result:R};pe(R),pe(ne);let ye=null;const Pe=[],Je=[],tt=[],ue=[],_e=[],Se=[],ke=[],Qe=[],Le=[],lt=[],ge=[],Be=[],pt=[],Fe=[],at=[];let Rt=0;const zt=(0,a.readCursor)(R),Wt=(0,a.readCursor)(ne),Ut=(0,a.writeCursor)();if(function yt(Ze,qe=null,He){const Te=p(qe);Te&&(Te.r!==void 0?He=qe.clone():Te.p!=null&&(He=null,Se[Te.p]=Ze.clone()));const me=Ze.getComponent();let ct;me&&(ct=me.p)!=null&&(_e[ct]=qe?qe.clone():null,tt[ct]=Ze.clone(),He&&(lt[ct]=!0,Le[ct]=He),Te&&Te.p!=null&&(Fe[ct]=Te.p));const ht=(0,a.advancer)(qe);for(const kt of Ze)yt(Ze,ht(kt),He);ht.end()}(Wt,zt,null),function yt(Ze,qe,He,Te,me){const ct=He.getComponent();let ht,kt=!1;ct&&((ht=ct.d)!=null?(ue[ht]=He.clone(),Te!=null&&(at[Te]==null&&(at[Te]=[]),at[Te].push(ht)),Ze=_e[ht]||null,qe=tt[ht]||null,lt[ht]?(me&&(ge[ht]=!0),me=Le[ht]||null):!me||we!==st&&Fe[ht]!=null||ye==null&&(ye={type:u.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.removeOp)(me.getPath()),op2:(0,i.moveOp)(qe.getPath(),He.getPath())}),kt=!0):ct.i!==void 0&&(Ze=qe=null,kt=!0,me&&ye==null&&(ye={type:u.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.removeOp)(me.getPath()),op2:(0,i.insertOp)(He.getPath(),ct.i)})));const Vt=p(Ze);Vt&&(Vt.r!==void 0?me=Ze.clone():Vt.p!=null&&(Vt.p,Te=Vt.p,me=null));const en=L(ct);en&&me&&ye==null&&(ye={type:u.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.removeOp)(me.getPath()),op2:(0,i.editOp)(He.getPath(),en,N(ct),!0)});let Ft=0,fn=0;const gt=(0,a.advancer)(qe,(Xe,xt)=>v(xt)?Ft-Xe-1:Xe-Ft,(Xe,xt)=>{v(xt)&&Ft++}),ut=(0,a.advancer)(Ze);for(const Xe of He)if(typeof Xe=="number"){const xt=Xe-fn,En=gt(xt);fn+=+yt(ut(xt+Ft),En,He,Te,me)}else{const xt=gt(Xe);yt(ut(Xe),xt,He,Te,me)}return gt.end(),ut.end(),kt}(zt,Wt,Wt.clone(),null,null),ue.map(yt=>yt&&yt.get()),ye)return{ok:!1,conflict:ye};ge.map(yt=>!!yt);const Cn=[];let On=null;(function yt(Ze,qe,He,Te,me){let ct=!1;const ht=p(qe);if(v(ht)){const gt=ht.p;gt!=null?(He=ue[gt],Te=Be[gt]=(0,a.writeCursor)(),ct=!0,me=null):(He=null,me=qe.clone())}else m(p(He))&&(He=null);const kt=Ze.getComponent();if(kt){const gt=kt.p;gt!=null?(me&&(Qe[gt]=me),Cn[gt]=me||we===st&&ct?null:Te.getComponent(),Pe[gt]=Ze.clone(),He&&(ke[gt]=He.clone())):kt.r!==void 0&&(me||Te.write("r",!0),(me||ct)&&(On==null&&(On=new Set),On.add(kt)))}let Vt=0,en=0;const Ft=(0,a.advancer)(qe,void 0,(gt,ut)=>{v(ut)&&Vt++}),fn=(0,a.advancer)(He,(gt,ut)=>m(ut)?~(gt-en):gt-en,(gt,ut)=>{m(ut)&&en++});if(Ze)for(const gt of Ze)if(typeof gt=="string"){const ut=Ft(gt),Xe=fn(gt);Te.descend(gt),yt(Ze,ut,Xe,Te,me),Te.ascend()}else{const ut=Ft(gt),Xe=gt-Vt,xt=v(p(ut))?null:fn(Xe),En=Xe+en;h(En>=0),Te.descend(En),yt(Ze,ut,xt,Te,me),Te.ascend()}Ft.end(),fn.end()})(zt,Wt,Wt.clone(),Ut,null),Ut.reset();let $r=[];if(function yt(Ze,qe,He,Te,me,ct){h(qe);const ht=qe.getComponent();let kt=p(Te),Vt=!1;const en=(V,he,Ce)=>V?(0,i.moveOp)(V.getPath(),he.getPath()):(0,i.insertOp)(he.getPath(),Ce.i);if(m(ht)){const V=ht.d;V!=null&&(Je[V]=qe.clone());const he=V!=null?Cn[V]:null;let Ce=!1;if(ht.i!==void 0||V!=null&&he){let de;kt&&(kt.i!==void 0||(de=kt.d)!=null&&!lt[de])&&(Ce=de!=null?V!=null&&V===Fe[de]:(0,s.default)(kt.i,ht.i),Ce||de!=null&&we!==st&&Fe[de]!=null||ye==null&&(ye={type:u.ConflictType.DROP_COLLISION,op1:en(V!=null?Pe[V]:null,qe,ht),op2:en(de!=null?tt[de]:null,Te,kt)})),Ce||(ct?ye==null&&(ye={type:u.ConflictType.RM_UNEXPECTED_CONTENT,op1:en(V!=null?Pe[V]:null,qe,ht),op2:(0,i.removeOp)(ct.getPath())}):(V!=null?($r[Rt]=V,me.write("d",he.p=Rt++)):me.write("i",(0,l.default)(ht.i)),Vt=!0))}else if(V!=null&&!he){const de=Qe[V];de&&(ct=de.clone())}V!=null?(Ze=Pe[V],He=Se[V],Te=ke[V]):ht.i!==void 0&&(Ze=He=null,Ce||(Te=null))}else v(p(Ze))&&(Ze=He=Te=null);const Ft=p(Ze),fn=p(He);if(v(fn)){const V=fn.p;fn.r!==void 0&&(!Ft||Ft.r===void 0)||lt[V]?(Te=null,ct=He.clone()):V!=null&&(Te=ue[V],we!==st&&Fe[V]!=null||((me=pt[V])||(me=pt[V]=(0,a.writeCursor)()),me.reset(),ct=null))}else!m(ht)&&m(kt)&&(Te=null);kt=Te!=null?Te.getComponent():null;const gt=L(ht);if(gt){const V=N(ht);if(ct)ye==null&&(ye={type:u.ConflictType.RM_UNEXPECTED_CONTENT,op1:(0,i.editOp)(qe.getPath(),gt,V,!0),op2:(0,i.removeOp)(ct.getPath())});else{const he=L(kt);let Ce;if(he){if(gt!==he)throw Error("Transforming incompatible types");const de=N(kt);Ce=gt.transform(V,de,ce)}else Ce=(0,l.default)(V);Y(me,gt,Ce)}}let ut=0,Xe=0,xt=0,En=0,Rr=0,Sr=0,br=Ze!=null&&Ze.descendFirst(),D=br;const I=(0,a.advancer)(He,void 0,(V,he)=>{v(he)&&xt++});let X=Te!=null&&Te.descendFirst(),le=X;for(const V of qe)if(typeof V=="number"){let he;const Ce=m(qe.getComponent()),de=V-Xe;{let rt;for(se();br&&typeof(rt=Ze.getKey())=="number";){rt+=ut;const St=Ze.getComponent(),vt=v(St);if(rt>de||rt===de&&(!vt||we===nt&&Ce))break;if(vt){ut--;const mt=St.p;Fe.includes(mt),St.d,p(pt[St.d]),v(p(pt[St.d])),(St.r===void 0||On&&On.has(St))&&(mt==null||!Cn[mt]||we!==st&&Fe.includes(mt))||Rr--}br=Ze.nextSibling()}he=br&&rt===de?Ze:null}const ve=de-ut;let et=I(ve);const Re=ve-xt;let _t=null;{let rt,St;for(se();X&&typeof(rt=Te.getKey())=="number";){St=rt-En;const vt=Te.getComponent(),mt=m(vt);if(St>Re)break;if(St===Re){if(!mt){_t=Te;break}{if(we===nt&&Ce){_t=Te;break}const wt=et&&v(et.getComponent());if(we===nt&&wt)break}}if(mt){const wt=vt.d;Fe[wt],vt.i===void 0&&(lt[wt]||Fe[wt]!=null&&we!==st)?(lt[wt]||Fe[wt]!=null&&we===nt)&&(En++,Sr--):En++}X=Te.nextSibling()}}const Bt=Re+En+Rr+Sr;h(Bt>=0,"trying to descend to a negative index"),me.descend(Bt),Ce&&(he=et=_t=null,Xe++),yt(he,qe,et,_t,me,ct)&&Sr++,me.ascend()}else{let he;for(;br&&(he=Ze.getKey(),typeof he!="string"||!(he>V||he===V));)br=Ze.nextSibling();const Ce=br&&he===V?Ze:null,de=I(V);let ve;for(;X&&(ve=Te.getKey(),typeof ve!="string"||!(ve>V||ve===V));)X=Te.nextSibling();const et=X&&ve===V?Te:null;me.descend(V),yt(Ce,qe,de,et,me,ct),me.ascend()}return I.end(),D&&Ze.ascend(),le&&Te.ascend(),Vt}(zt,zt.clone(),Wt,Wt.clone(),Ut,null),ye)return{ok:!1,conflict:ye};Ut.reset();const An=(yt,Ze,qe)=>yt.traverse(Ze,(He,Te)=>{He.d!=null&&qe(He.d,yt,Te)});(lt.length||Be.length)&&(An(Wt,Ut,(yt,Ze,qe)=>{lt[yt]&&!ge[yt]&&qe.write("r",!0),Be[yt]&&qe.mergeTree(Be[yt].get())}),Ut.reset());const In=[],Ln=[];if((pt.length||lt.length)&&!ye){const yt=(0,a.readCursor)(Tt(Ut.get()));if(An(yt,null,(Ze,qe)=>{In[Ze]=qe.clone()}),pt.forEach(Ze=>{Ze&&An((0,a.readCursor)(Ze.get()),null,(qe,He)=>{In[qe]=He.clone()})}),function Ze(qe,He,Te,me,ct,ht){f.prefix++;const kt=p(He);if(kt&&v(kt))if(kt.p!=null){const ut=kt.p;In[ut].getPath(),Te=In[ut],me=Ln[ut]=(0,a.writeCursor)()}else kt.r!==void 0&&(Te=null);else m(p(Te))&&(Te=null);const Vt=qe.getComponent();if(Vt){let ut;if((ut=Vt.d)!=null){const Xe=pt[ut];Xe&&(Xe.get(),me.mergeTree(Xe.get()),Te=(0,a.readCursor)(Xe.get()))}}let en=0,Ft=0;const fn=(0,a.advancer)(He,void 0,(ut,Xe)=>{v(Xe)&&en--}),gt=(0,a.advancer)(Te,(ut,Xe)=>m(Xe)?-(ut-Ft)-1:ut-Ft,(ut,Xe)=>{m(Xe)&&Ft++});for(const ut of qe)if(typeof ut=="number"){const Xe=fn(ut),xt=ut+en,En=gt(xt),Rr=xt+Ft;me.descend(Rr),Ze(qe,Xe,En,me),me.ascend()}else me.descend(ut),Ze(qe,fn(ut),gt(ut),me),me.ascend();fn.end(),gt.end()}(Wt,yt,yt.clone(),Ut),Ut.reset(),ye)return{ok:!1,conflict:ye};if(Ut.get(),Ln.length){const Ze=Ln.map(He=>He?He.get():null),qe=(0,a.readCursor)(Tt(Ut.get()));if(An(qe,Ut,(He,Te,me)=>{const ct=Ze[He];ct&&(me.mergeTree(ct),Ze[He]=null)}),Ze.find(He=>He)){const He=(0,a.writeCursor)(),Te=(0,a.writeCursor)();let me=0,ct=0;Ze.forEach(ht=>{ht!=null&&An((0,a.readCursor)(ht),null,kt=>{const Vt=$r[kt];He.writeMove(Pe[Vt].getPath(),Je[Vt].getPath(),me++);const en=at[Vt];en&&en.forEach(Ft=>{lt[Ft]||we!==st&&Fe[Ft]!=null||Te.writeMove(tt[Ft].getPath(),ue[Ft].getPath(),ct++)})})}),ye={type:u.ConflictType.BLACKHOLE,op1:He.get(),op2:Te.get()}}}}return ye?{ok:!1,conflict:ye}:{ok:!0,result:Ut.get()}}const tr=R=>{const ne=new Error("Transform detected write conflict");throw ne.conflict=R,ne.type=ne.name="writeConflict",ne};function Pn(R,ne,ce){const we=cn(R,ne,ce);if(we.ok)return we.result;tr(we.conflict)}const Qn=R=>{const ne=(0,a.writeCursor)();return(0,a.readCursor)(R).traverse(ne,(ce,we)=>{(m(ce)||L(ce))&&we.write("r",!0)}),ne.get()},wi=(R,ne)=>{const{type:ce,op1:we,op2:ye}=R;switch(ce){case u.ConflictType.DROP_COLLISION:return ne==="left"?[null,Qn(ye)]:[Qn(we),null];case u.ConflictType.RM_UNEXPECTED_CONTENT:let Pe=!1;return(0,a.readCursor)(we).traverse(null,Je=>{Je.r!==void 0&&(Pe=!0)}),Pe?[null,Qn(ye)]:[Qn(we),null];case u.ConflictType.BLACKHOLE:return[Qn(we),Qn(ye)];default:throw Error("Unrecognised conflict: "+ce)}};function jn(R,ne,ce,we){let ye=null;for(;;){const Pe=cn(ne,ce,we);if(Pe.ok)return J(ye,Pe.result);{const{conflict:Je}=Pe;R(Je)||tr(Je);const[tt,ue]=wi(Je,we);ne=J(U(ne),tt),ce=J(U(ce),ue),ye=J(ye,ue)}}}},{"./cursor.js":23,"./deepClone.js":24,"./deepEqual.js":25,"./log":28,"./types.js":29,assert:1,"ot-text-unicode":31}],28:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0});function o(...s){if(o.quiet)return;const{inspect:l}=n("util"),a=c=>typeof c=="string"?c:l(c,{depth:10,colors:!0}),u=Array(o.prefix).fill(" ").join("");console.log(u+s.map(a).join(" "))}i.default=o,o.quiet=!0,o.prefix=0},{util:37}],29:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.ConflictType=void 0;var o;(function(s){s[s.RM_UNEXPECTED_CONTENT=1]="RM_UNEXPECTED_CONTENT",s[s.DROP_COLLISION=2]="DROP_COLLISION",s[s.BLACKHOLE=3]="BLACKHOLE"})(o||(i.ConflictType=o={}))},{}],30:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0});const o=n("./type"),s=n("unicount");function l(a,u){return{get:a,getLength(){return a().length},insert(c,f,h){const d=s.strPosToUni(a(),c);return u([d,f],h)},remove(c,f,h){const d=s.strPosToUni(a(),c);return u([d,{d:f}],h)},_onOp(c){o.eachOp(c,(f,h,d)=>{switch(typeof f){case"string":this.onInsert&&this.onInsert(d,f);break;case"object":const p=o.dlen(f.d);this.onRemove&&this.onRemove(d,p)}})},onInsert:null,onRemove:null}}i.default=l,l.provides={text:!0}},{"./type":32,unicount:34}],31:[function(n,r,i){var o=this&&this.__createBinding||(Object.create?function(O,v,m,y){y===void 0&&(y=m),Object.defineProperty(O,y,{enumerable:!0,get:function(){return v[m]}})}:function(O,v,m,y){y===void 0&&(y=m),O[y]=v[m]}),s=this&&this.__setModuleDefault||(Object.create?function(O,v){Object.defineProperty(O,"default",{enumerable:!0,value:v})}:function(O,v){O.default=v}),l=this&&this.__importStar||function(O){if(O&&O.__esModule)return O;var v={};if(O!=null)for(var m in O)Object.hasOwnProperty.call(O,m)&&o(v,O,m);return s(v,O),v},a=this&&this.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(i,"__esModule",{value:!0}),i.type=i.remove=i.insert=void 0;const u=n("unicount"),c=l(n("./type")),f=a(n("./api")),h={create(O){return O},toString(O){return O},builder(O){if(typeof O!="string")throw Error("Invalid document snapshot: "+O);const v=[];return{skip(m){let y=u.uniToStrPos(O,m);if(y>O.length)throw Error("The op is too long for this document");v.push(O.slice(0,y)),O=O.slice(y)},append(m){v.push(m)},del(m){O=O.slice(u.uniToStrPos(O,m))},build(){return v.join("")+O}}},slice:c.uniSlice},d=c.default(h),p=Object.assign(Object.assign({},d),{api:f.default});i.type=p,i.insert=(O,v)=>v.length===0?[]:O===0?[v]:[O,v],i.remove=(O,v)=>c.dlen(v)===0?[]:O===0?[{d:v}]:[O,{d:v}];var g=n("./type");Object.defineProperty(i,"makeType",{enumerable:!0,get:function(){return g.default}})},{"./api":30,"./type":32,unicount:34}],32:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.uniSlice=i.dlen=i.eachOp=void 0;const o=n("unicount"),s=x=>{if(!Array.isArray(x))throw Error("Op must be an array of components");let _=null;for(let E=0;E<x.length;E++){const $=x[E];switch(typeof $){case"object":if(typeof $.d!="number"&&typeof $.d!="string")throw Error("Delete must be number or string");if(i.dlen($.d)<=0)throw Error("Deletes must not be empty");break;case"string":if(!($.length>0))throw Error("Inserts cannot be empty");break;case"number":if(!($>0))throw Error("Skip components must be >0");if(typeof _=="number")throw Error("Adjacent skip components should be combined");break}_=$}if(typeof _=="number")throw Error("Op has a trailing skip")};function l(x,_){let E=0,$=0;for(let j=0;j<x.length;j++){const W=x[j];switch(_(W,E,$),typeof W){case"object":E+=i.dlen(W.d);break;case"string":$+=o.strPosToUni(W);break;case"number":E+=W,$+=W;break}}}i.eachOp=l;function a(x,_){const E=[],$=f(E);return l(x,(j,W,G)=>{$(_(j,W,G))}),g(E)}const u=x=>x,c=x=>a(x,u);i.dlen=x=>typeof x=="number"?x:o.strPosToUni(x);const f=x=>_=>{if(!(!_||_.d===0||_.d===""))if(x.length===0)x.push(_);else if(typeof _==typeof x[x.length-1])if(typeof _=="object"){const E=x[x.length-1];E.d=typeof E.d=="string"&&typeof _.d=="string"?E.d+_.d:i.dlen(E.d)+i.dlen(_.d)}else x[x.length-1]+=_;else x.push(_)},h=x=>typeof x=="number"?x:typeof x=="string"?o.strPosToUni(x):typeof x.d=="number"?x.d:o.strPosToUni(x.d);i.uniSlice=(x,_,E)=>{const $=o.uniToStrPos(x,_),j=E==null?1/0:o.uniToStrPos(x,E);return x.slice($,j)};const d=(x,_,E)=>typeof x=="number"?E==null?x-_:Math.min(x,E)-_:i.uniSlice(x,_,E),p=x=>{let _=0,E=0;return{take:(W,G)=>{if(_===x.length)return W===-1?null:W;const M=x[_];let L;if(typeof M=="number")return W===-1||M-E<=W?(L=M-E,++_,E=0,L):(E+=W,W);if(typeof M=="string"){if(W===-1||G==="i"||o.strPosToUni(M.slice(E))<=W)return L=M.slice(E),++_,E=0,L;{const N=E+o.uniToStrPos(M.slice(E),W);return L=M.slice(E,N),E=N,L}}else{if(W===-1||G==="d"||i.dlen(M.d)-E<=W)return L={d:d(M.d,E)},++_,E=0,L;{let N=d(M.d,E,E+W);return E+=W,{d:N}}}},peek:()=>x[_]}},g=x=>(x.length>0&&typeof x[x.length-1]=="number"&&x.pop(),x);function O(x,_,E){if(E!=="left"&&E!=="right")throw Error("side ("+E+") must be 'left' or 'right'");s(x),s(_);const $=[],j=f($),{take:W,peek:G}=p(x);for(let L=0;L<_.length;L++){const N=_[L];let Y,q;switch(typeof N){case"number":for(Y=N;Y>0;)q=W(Y,"i"),j(q),typeof q!="string"&&(Y-=h(q));break;case"string":E==="left"&&typeof G()=="string"&&j(W(-1)),j(o.strPosToUni(N));break;case"object":for(Y=i.dlen(N.d);Y>0;)switch(q=W(Y,"i"),typeof q){case"number":Y-=q;break;case"string":j(q);break;case"object":Y-=i.dlen(q.d)}break}}let M;for(;M=W(-1);)j(M);return g($)}function v(x,_){s(x),s(_);const E=[],$=f(E),{take:j}=p(x);for(let G=0;G<_.length;G++){const M=_[G];let L,N;switch(typeof M){case"number":for(L=M;L>0;)N=j(L,"d"),$(N),typeof N!="object"&&(L-=h(N));break;case"string":$(M);break;case"object":L=i.dlen(M.d);let Y=0;for(;Y<L;)switch(N=j(L-Y,"d"),typeof N){case"number":$({d:d(M.d,Y,Y+N)}),Y+=N;break;case"string":Y+=o.strPosToUni(N);break;case"object":$(N)}break}}let W;for(;W=j(-1);)$(W);return g(E)}const m=(x,_)=>{let E=0;for(let $=0;$<_.length&&x>E;$++){const j=_[$];switch(typeof j){case"number":{E+=j;break}case"string":const W=o.strPosToUni(j);E+=W,x+=W;break;case"object":x-=Math.min(i.dlen(j.d),x-E);break}}return x},y=(x,_)=>typeof x=="number"?m(x,_):x.map(E=>m(E,_));function S(x,_,E){return a(x,($,j)=>typeof $=="object"&&typeof $.d=="number"?{d:E.slice(_,j,j+$.d)}:$)}function k(x){return a(x,_=>{switch(typeof _){case"object":if(typeof _.d=="number")throw Error("Cannot invert text op: Deleted characters missing from operation. makeInvertible must be called first.");return _.d;case"string":return{d:_};case"number":return _}})}function P(x){return a(x,_=>typeof _=="object"&&typeof _.d=="string"?{d:o.strPosToUni(_.d)}:_)}function C(x){let _=!0;return l(x,E=>{typeof E=="object"&&typeof E.d=="number"&&(_=!1)}),_}function w(x){return{name:"text-unicode",uri:"http://sharejs.org/types/text-unicode",trim:g,normalize:c,checkOp:s,create(_=""){if(typeof _!="string")throw Error("Initial data must be a string");return x.create(_)},apply(_,E){s(E);const $=x.builder(_);for(let j=0;j<E.length;j++){const W=E[j];switch(typeof W){case"number":$.skip(W);break;case"string":$.append(W);break;case"object":$.del(i.dlen(W.d));break}}return $.build()},transform:O,compose:v,transformPosition:m,transformSelection:y,isInvertible:C,makeInvertible(_,E){return S(_,E,x)},stripInvertible:P,invert:k,invertWithDoc(_,E){return k(S(_,E,x))},isNoop:_=>_.length===0}}i.default=w},{unicount:34}],33:[function(n,r,i){var o=r.exports={},s,l;function a(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=a}catch{s=a}try{typeof clearTimeout=="function"?l=clearTimeout:l=u}catch{l=u}})();function c(S){if(s===setTimeout)return setTimeout(S,0);if((s===a||!s)&&setTimeout)return s=setTimeout,setTimeout(S,0);try{return s(S,0)}catch{try{return s.call(null,S,0)}catch{return s.call(this,S,0)}}}function f(S){if(l===clearTimeout)return clearTimeout(S);if((l===u||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(S);try{return l(S)}catch{try{return l.call(null,S)}catch{return l.call(this,S)}}}var h=[],d=!1,p,g=-1;function O(){!d||!p||(d=!1,p.length?h=p.concat(h):g=-1,h.length&&v())}function v(){if(!d){var S=c(O);d=!0;for(var k=h.length;k;){for(p=h,h=[];++g<k;)p&&p[g].run();g=-1,k=h.length}p=null,d=!1,f(S)}}o.nextTick=function(S){var k=new Array(arguments.length-1);if(arguments.length>1)for(var P=1;P<arguments.length;P++)k[P-1]=arguments[P];h.push(new m(S,k)),h.length===1&&!d&&c(v)};function m(S,k){this.fun=S,this.array=k}m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={};function y(){}o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(S){return[]},o.binding=function(S){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(S){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],34:[function(n,r,i){Object.defineProperty(i,"__esModule",{value:!0}),i.uniToStrPos=i.strPosToUni=void 0,i.strPosToUni=(o,s=o.length)=>{let l=0,a=0;for(;a<s;a++){const u=o.charCodeAt(a);u>=55296&&u<=57343&&(l++,a++)}if(a!==s)throw Error("Invalid offset - splits unicode bytes");return a-l},i.uniToStrPos=(o,s)=>{let l=0;for(;s>0;s--){const a=o.charCodeAt(l);l+=a>=55296&&a<=57343?2:1}return l}},{}],35:[function(n,r,i){arguments[4][3][0].apply(i,arguments)},{dup:3}],36:[function(n,r,i){var o=n("is-arguments"),s=n("is-generator-function"),l=n("which-typed-array"),a=n("is-typed-array");function u(R){return R.call.bind(R)}var c=typeof BigInt<"u",f=typeof Symbol<"u",h=u(Object.prototype.toString),d=u(Number.prototype.valueOf),p=u(String.prototype.valueOf),g=u(Boolean.prototype.valueOf);if(c)var O=u(BigInt.prototype.valueOf);if(f)var v=u(Symbol.prototype.valueOf);function m(R,ne){if(typeof R!="object")return!1;try{return ne(R),!0}catch{return!1}}i.isArgumentsObject=o,i.isGeneratorFunction=s,i.isTypedArray=a;function y(R){return typeof Promise<"u"&&R instanceof Promise||R!==null&&typeof R=="object"&&typeof R.then=="function"&&typeof R.catch=="function"}i.isPromise=y;function S(R){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(R):a(R)||F(R)}i.isArrayBufferView=S;function k(R){return l(R)==="Uint8Array"}i.isUint8Array=k;function P(R){return l(R)==="Uint8ClampedArray"}i.isUint8ClampedArray=P;function C(R){return l(R)==="Uint16Array"}i.isUint16Array=C;function w(R){return l(R)==="Uint32Array"}i.isUint32Array=w;function x(R){return l(R)==="Int8Array"}i.isInt8Array=x;function _(R){return l(R)==="Int16Array"}i.isInt16Array=_;function E(R){return l(R)==="Int32Array"}i.isInt32Array=E;function $(R){return l(R)==="Float32Array"}i.isFloat32Array=$;function j(R){return l(R)==="Float64Array"}i.isFloat64Array=j;function W(R){return l(R)==="BigInt64Array"}i.isBigInt64Array=W;function G(R){return l(R)==="BigUint64Array"}i.isBigUint64Array=G;function M(R){return h(R)==="[object Map]"}M.working=typeof Map<"u"&&M(new Map);function L(R){return typeof Map>"u"?!1:M.working?M(R):R instanceof Map}i.isMap=L;function N(R){return h(R)==="[object Set]"}N.working=typeof Set<"u"&&N(new Set);function Y(R){return typeof Set>"u"?!1:N.working?N(R):R instanceof Set}i.isSet=Y;function q(R){return h(R)==="[object WeakMap]"}q.working=typeof WeakMap<"u"&&q(new WeakMap);function ae(R){return typeof WeakMap>"u"?!1:q.working?q(R):R instanceof WeakMap}i.isWeakMap=ae;function pe(R){return h(R)==="[object WeakSet]"}pe.working=typeof WeakSet<"u"&&pe(new WeakSet);function U(R){return pe(R)}i.isWeakSet=U;function H(R){return h(R)==="[object ArrayBuffer]"}H.working=typeof ArrayBuffer<"u"&&H(new ArrayBuffer);function se(R){return typeof ArrayBuffer>"u"?!1:H.working?H(R):R instanceof ArrayBuffer}i.isArrayBuffer=se;function Ie(R){return h(R)==="[object DataView]"}Ie.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Ie(new DataView(new ArrayBuffer(1),0,1));function F(R){return typeof DataView>"u"?!1:Ie.working?Ie(R):R instanceof DataView}i.isDataView=F;var z=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function J(R){return h(R)==="[object SharedArrayBuffer]"}function be(R){return typeof z>"u"?!1:(typeof J.working>"u"&&(J.working=J(new z)),J.working?J(R):R instanceof z)}i.isSharedArrayBuffer=be;function Ae(R){return h(R)==="[object AsyncFunction]"}i.isAsyncFunction=Ae;function Me(R){return h(R)==="[object Map Iterator]"}i.isMapIterator=Me;function De(R){return h(R)==="[object Set Iterator]"}i.isSetIterator=De;function nt(R){return h(R)==="[object Generator]"}i.isGeneratorObject=nt;function st(R){return h(R)==="[object WebAssembly.Module]"}i.isWebAssemblyCompiledModule=st;function Tt(R){return m(R,d)}i.isNumberObject=Tt;function cn(R){return m(R,p)}i.isStringObject=cn;function tr(R){return m(R,g)}i.isBooleanObject=tr;function Pn(R){return c&&m(R,O)}i.isBigIntObject=Pn;function Qn(R){return f&&m(R,v)}i.isSymbolObject=Qn;function wi(R){return Tt(R)||cn(R)||tr(R)||Pn(R)||Qn(R)}i.isBoxedPrimitive=wi;function jn(R){return typeof Uint8Array<"u"&&(se(R)||be(R))}i.isAnyArrayBuffer=jn,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(R){Object.defineProperty(i,R,{enumerable:!1,value:function(){throw new Error(R+" is not supported in userland")}})})},{"is-arguments":18,"is-generator-function":20,"is-typed-array":21,"which-typed-array":38}],37:[function(n,r,i){(function(o){(function(){var s=Object.getOwnPropertyDescriptors||function(z){for(var J=Object.keys(z),be={},Ae=0;Ae<J.length;Ae++)be[J[Ae]]=Object.getOwnPropertyDescriptor(z,J[Ae]);return be},l=/%[sdj%]/g;i.format=function(F){if(!_(F)){for(var z=[],J=0;J<arguments.length;J++)z.push(f(arguments[J]));return z.join(" ")}for(var J=1,be=arguments,Ae=be.length,Me=String(F).replace(l,function(nt){if(nt==="%%")return"%";if(J>=Ae)return nt;switch(nt){case"%s":return String(be[J++]);case"%d":return Number(be[J++]);case"%j":try{return JSON.stringify(be[J++])}catch{return"[Circular]"}default:return nt}}),De=be[J];J<Ae;De=be[++J])C(De)||!W(De)?Me+=" "+De:Me+=" "+f(De);return Me},i.deprecate=function(F,z){if(typeof o<"u"&&o.noDeprecation===!0)return F;if(typeof o>"u")return function(){return i.deprecate(F,z).apply(this,arguments)};var J=!1;function be(){if(!J){if(o.throwDeprecation)throw new Error(z);o.traceDeprecation?console.trace(z):console.error(z),J=!0}return F.apply(this,arguments)}return be};var a={},u=/^$/;if(o.env.NODE_DEBUG){var c=o.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+c+"$","i")}i.debuglog=function(F){if(F=F.toUpperCase(),!a[F])if(u.test(F)){var z=o.pid;a[F]=function(){var J=i.format.apply(i,arguments);console.error("%s %d: %s",F,z,J)}}else a[F]=function(){};return a[F]};function f(F,z){var J={seen:[],stylize:d};return arguments.length>=3&&(J.depth=arguments[2]),arguments.length>=4&&(J.colors=arguments[3]),P(z)?J.showHidden=z:z&&i._extend(J,z),$(J.showHidden)&&(J.showHidden=!1),$(J.depth)&&(J.depth=2),$(J.colors)&&(J.colors=!1),$(J.customInspect)&&(J.customInspect=!0),J.colors&&(J.stylize=h),g(J,F,J.depth)}i.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function h(F,z){var J=f.styles[z];return J?"\x1B["+f.colors[J][0]+"m"+F+"\x1B["+f.colors[J][1]+"m":F}function d(F,z){return F}function p(F){var z={};return F.forEach(function(J,be){z[J]=!0}),z}function g(F,z,J){if(F.customInspect&&z&&L(z.inspect)&&z.inspect!==i.inspect&&!(z.constructor&&z.constructor.prototype===z)){var be=z.inspect(J,F);return _(be)||(be=g(F,be,J)),be}var Ae=O(F,z);if(Ae)return Ae;var Me=Object.keys(z),De=p(Me);if(F.showHidden&&(Me=Object.getOwnPropertyNames(z)),M(z)&&(Me.indexOf("message")>=0||Me.indexOf("description")>=0))return v(z);if(Me.length===0){if(L(z)){var nt=z.name?": "+z.name:"";return F.stylize("[Function"+nt+"]","special")}if(j(z))return F.stylize(RegExp.prototype.toString.call(z),"regexp");if(G(z))return F.stylize(Date.prototype.toString.call(z),"date");if(M(z))return v(z)}var st="",Tt=!1,cn=["{","}"];if(k(z)&&(Tt=!0,cn=["[","]"]),L(z)){var tr=z.name?": "+z.name:"";st=" [Function"+tr+"]"}if(j(z)&&(st=" "+RegExp.prototype.toString.call(z)),G(z)&&(st=" "+Date.prototype.toUTCString.call(z)),M(z)&&(st=" "+v(z)),Me.length===0&&(!Tt||z.length==0))return cn[0]+st+cn[1];if(J<0)return j(z)?F.stylize(RegExp.prototype.toString.call(z),"regexp"):F.stylize("[Object]","special");F.seen.push(z);var Pn;return Tt?Pn=m(F,z,J,De,Me):Pn=Me.map(function(Qn){return y(F,z,J,De,Qn,Tt)}),F.seen.pop(),S(Pn,st,cn)}function O(F,z){if($(z))return F.stylize("undefined","undefined");if(_(z)){var J="'"+JSON.stringify(z).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return F.stylize(J,"string")}if(x(z))return F.stylize(""+z,"number");if(P(z))return F.stylize(""+z,"boolean");if(C(z))return F.stylize("null","null")}function v(F){return"["+Error.prototype.toString.call(F)+"]"}function m(F,z,J,be,Ae){for(var Me=[],De=0,nt=z.length;De<nt;++De)U(z,String(De))?Me.push(y(F,z,J,be,String(De),!0)):Me.push("");return Ae.forEach(function(st){st.match(/^\d+$/)||Me.push(y(F,z,J,be,st,!0))}),Me}function y(F,z,J,be,Ae,Me){var De,nt,st;if(st=Object.getOwnPropertyDescriptor(z,Ae)||{value:z[Ae]},st.get?st.set?nt=F.stylize("[Getter/Setter]","special"):nt=F.stylize("[Getter]","special"):st.set&&(nt=F.stylize("[Setter]","special")),U(be,Ae)||(De="["+Ae+"]"),nt||(F.seen.indexOf(st.value)<0?(C(J)?nt=g(F,st.value,null):nt=g(F,st.value,J-1),nt.indexOf(`
60
- `)>-1&&(Me?nt=nt.split(`
61
- `).map(function(Tt){return" "+Tt}).join(`
62
- `).slice(2):nt=`
63
- `+nt.split(`
64
- `).map(function(Tt){return" "+Tt}).join(`
65
- `))):nt=F.stylize("[Circular]","special")),$(De)){if(Me&&Ae.match(/^\d+$/))return nt;De=JSON.stringify(""+Ae),De.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(De=De.slice(1,-1),De=F.stylize(De,"name")):(De=De.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),De=F.stylize(De,"string"))}return De+": "+nt}function S(F,z,J){var be=F.reduce(function(Ae,Me){return Me.indexOf(`
66
- `)>=0,Ae+Me.replace(/\u001b\[\d\d?m/g,"").length+1},0);return be>60?J[0]+(z===""?"":z+`
67
- `)+" "+F.join(`,
68
- `)+" "+J[1]:J[0]+z+" "+F.join(", ")+" "+J[1]}i.types=n("./support/types");function k(F){return Array.isArray(F)}i.isArray=k;function P(F){return typeof F=="boolean"}i.isBoolean=P;function C(F){return F===null}i.isNull=C;function w(F){return F==null}i.isNullOrUndefined=w;function x(F){return typeof F=="number"}i.isNumber=x;function _(F){return typeof F=="string"}i.isString=_;function E(F){return typeof F=="symbol"}i.isSymbol=E;function $(F){return F===void 0}i.isUndefined=$;function j(F){return W(F)&&Y(F)==="[object RegExp]"}i.isRegExp=j,i.types.isRegExp=j;function W(F){return typeof F=="object"&&F!==null}i.isObject=W;function G(F){return W(F)&&Y(F)==="[object Date]"}i.isDate=G,i.types.isDate=G;function M(F){return W(F)&&(Y(F)==="[object Error]"||F instanceof Error)}i.isError=M,i.types.isNativeError=M;function L(F){return typeof F=="function"}i.isFunction=L;function N(F){return F===null||typeof F=="boolean"||typeof F=="number"||typeof F=="string"||typeof F=="symbol"||typeof F>"u"}i.isPrimitive=N,i.isBuffer=n("./support/isBuffer");function Y(F){return Object.prototype.toString.call(F)}function q(F){return F<10?"0"+F.toString(10):F.toString(10)}var ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function pe(){var F=new Date,z=[q(F.getHours()),q(F.getMinutes()),q(F.getSeconds())].join(":");return[F.getDate(),ae[F.getMonth()],z].join(" ")}i.log=function(){console.log("%s - %s",pe(),i.format.apply(i,arguments))},i.inherits=n("inherits"),i._extend=function(F,z){if(!z||!W(z))return F;for(var J=Object.keys(z),be=J.length;be--;)F[J[be]]=z[J[be]];return F};function U(F,z){return Object.prototype.hasOwnProperty.call(F,z)}var H=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;i.promisify=function(z){if(typeof z!="function")throw new TypeError('The "original" argument must be of type Function');if(H&&z[H]){var J=z[H];if(typeof J!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(J,H,{value:J,enumerable:!1,writable:!1,configurable:!0}),J}function J(){for(var be,Ae,Me=new Promise(function(st,Tt){be=st,Ae=Tt}),De=[],nt=0;nt<arguments.length;nt++)De.push(arguments[nt]);De.push(function(st,Tt){st?Ae(st):be(Tt)});try{z.apply(this,De)}catch(st){Ae(st)}return Me}return Object.setPrototypeOf(J,Object.getPrototypeOf(z)),H&&Object.defineProperty(J,H,{value:J,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(J,s(z))},i.promisify.custom=H;function se(F,z){if(!F){var J=new Error("Promise was rejected with a falsy value");J.reason=F,F=J}return z(F)}function Ie(F){if(typeof F!="function")throw new TypeError('The "original" argument must be of type Function');function z(){for(var J=[],be=0;be<arguments.length;be++)J.push(arguments[be]);var Ae=J.pop();if(typeof Ae!="function")throw new TypeError("The last argument must be of type Function");var Me=this,De=function(){return Ae.apply(Me,arguments)};F.apply(this,J).then(function(nt){o.nextTick(De.bind(null,null,nt))},function(nt){o.nextTick(se.bind(null,nt,De))})}return Object.setPrototypeOf(z,Object.getPrototypeOf(F)),Object.defineProperties(z,s(F)),z}i.callbackify=Ie}).call(this)}).call(this,n("_process"))},{"./support/isBuffer":35,"./support/types":36,_process:33,inherits:17}],38:[function(n,r,i){(function(o){(function(){var s=n("for-each"),l=n("available-typed-arrays"),a=n("call-bind/callBound"),u=n("gopd"),c=a("Object.prototype.toString"),f=n("has-tostringtag/shams")(),h=typeof globalThis>"u"?o:globalThis,d=l(),p=a("String.prototype.slice"),g={},O=Object.getPrototypeOf;f&&u&&O&&s(d,function(y){if(typeof h[y]=="function"){var S=new h[y];if(Symbol.toStringTag in S){var k=O(S),P=u(k,Symbol.toStringTag);if(!P){var C=O(k);P=u(C,Symbol.toStringTag)}g[y]=P.get}}});var v=function(S){var k=!1;return s(g,function(P,C){if(!k)try{var w=P.call(S);w===C&&(k=w)}catch{}}),k},m=n("is-typed-array");r.exports=function(S){return m(S)?!f||!(Symbol.toStringTag in S)?p(c(S),8,-1):v(S):!1}}).call(this)}).call(this,typeof Yr<"u"?Yr:typeof self<"u"?self:typeof window<"u"?window:{})},{"available-typed-arrays":5,"call-bind/callBound":6,"for-each":8,gopd:12,"has-tostringtag/shams":15,"is-typed-array":21}],39:[function(n,r,i){const o=n("ot-json1-presence"),s=n("ot-text-unicode");r.exports={json1Presence:o,textUnicode:s}},{"ot-json1-presence":26,"ot-text-unicode":31}]},{},[39])(39)})})(oE);var dD=oE.exports;const pD=vi(dD),{json1Presence:i0,textUnicode:sE}=pD;function gD(t){return new Worker("/assets/worker-y75r0vyN.js",{name:t==null?void 0:t.name})}function mD(t){return new Worker("/assets/worker-VwMsqrhy.js",{name:t==null?void 0:t.name})}const OD=!0,ES=800,lE="vzCodeSidebarWidth",aE="vzCodeCodeEditorWidth",uE=220;let og=uE;const cE=800;let sg=cE,BO=!1;if(typeof window<"u"&&OD){const t=window.localStorage.getItem(lE),e=window.localStorage.getItem(aE);t!==null&&(og=+t,BO=!0),e!==null&&(sg=+e,BO=!0)}const vD={codeEditorWidth:sg,sidebarWidth:og,moveSplitPane:()=>{},isDraggingRight:!1,isDraggingLeft:!1,setIsDragging:()=>{}},lg=Z.createContext(vD),yD={sidebarWidth:uE,codeEditorWidth:cE,isDraggingLeft:!1,isDraggingRight:!1,isInitialized:!1},SD=(t,e)=>{switch(e.type){case"initialize":return{...t,sidebarWidth:og,codeEditorWidth:sg,isInitialized:!0};case"move":return e.side==="left"?{...t,sidebarWidth:t.sidebarWidth+e.movementX}:{...t,codeEditorWidth:t.codeEditorWidth+e.movementX};case"setIsDragging":return e.side==="left"?{...t,isDraggingLeft:e.isDragging}:{...t,isDraggingRight:e.isDragging};default:return t}},bD=({children:t})=>{const[e,n]=Z.useReducer(SD,yD),r=Z.useCallback((f,h)=>{n({type:"setIsDragging",isDragging:f,side:h})},[n]),i=Z.useCallback((f,h)=>{n({type:"move",movementX:f,side:h})},[n]),{sidebarWidth:o,codeEditorWidth:s,isDraggingLeft:l,isDraggingRight:a,isInitialized:u}=e;typeof window<"u"&&Z.useLayoutEffect(()=>{BO&&!u&&n({type:"initialize"})},[u]),Z.useEffect(()=>{o!==og&&setTimeout(()=>{window.localStorage.setItem(lE,""+o)},ES),s!==sg&&setTimeout(()=>{window.localStorage.setItem(aE,""+s)},ES)},[s,o]);const c={codeEditorWidth:s,sidebarWidth:o,moveSplitPane:i,isDraggingLeft:l,isDraggingRight:a,setIsDragging:r};return ee.jsx(lg.Provider,{value:c,children:t})},fE=1200,wD=t=>{const e=t.match(/\.([^.]+)$/);return e?e[1]:""},kD=t=>{const n=/Mac|iMac|MacBook/i.test(navigator.userAgent)?t.metaKey:t.ctrlKey;return n&&t.key==="s"?!0:!!(t.key==="F5"||n&&t.key==="Enter"||t.shiftKey&&t.key==="Enter"||t.altKey&&t.key==="Enter"||n&&t.shiftKey&&(t.key==="B"||t.key==="b")||n&&t.shiftKey&&t.key==="F10"||t.key==="F8"||t.key==="F9")},xD=({shareDBDoc:t,submitOperation:e,prettierWorker:n,enableManualPretter:r})=>{const i=Z.useRef(new Set),[o,s]=Z.useState(null),l=Z.useRef(!1);return Z.useEffect(()=>{if(!t)return;const a=d=>{const{fileId:p,error:g,fileTextPrettified:O}=d.data;if(g){s(g);return}else s(null);l.current=!0,e(v=>({...v,files:{...v.files,[p]:{...v.files[p],text:O}}})),l.current=!1};n.addEventListener("message",a);const u=async()=>{const p=t.data.files,g=i.current,O=Array.from(g);g.clear();for(const v of O){const m=p[v],y={fileText:m.text,fileExtension:wD(m.name),fileId:v};n.postMessage(y)}};let c,f,h;return r?(h=d=>{kD(d)&&(d.preventDefault(),u())},document.addEventListener("keydown",h)):(c=()=>{clearTimeout(f),f=setTimeout(u,fE)},window.addEventListener("mousemove",c),window.addEventListener("keydown",c)),t.on("op batch",(d,p)=>{if(p){if(l.current)return;if(d&&d.length===4&&d[0]==="files"&&typeof d[1]=="string"&&d[2]==="text"){const g=d[1];i.current.add(g),r||c()}}}),()=>{n.removeEventListener("message",a),r?document.removeEventListener("keydown",h):(window.removeEventListener("keydown",c),window.removeEventListener("mousemove",c),clearTimeout(f))}},[t]),{prettierError:o}},_D=500,PD=fE+_D,CD=({content:t,typeScriptWorker:e})=>{const n=Z.useRef(null),r=Z.useCallback(i=>{i!==null&&(clearTimeout(n.current),n.current=window.setTimeout(()=>{e.postMessage({event:"update-content",details:i})},PD))},[e]);Z.useEffect(()=>{r(t)},[t])},ED=(t,e)=>{if(e.type!=="close_tabs")return t;const n=t.tabList.filter(o=>!e.fileIdsToClose.includes(o.fileId));if(!e.fileIdsToClose.includes(t.activeFileId))return{...t,tabList:n};const r=t.tabList.findIndex(o=>o.fileId===t.activeFileId);let i=null;for(let o=r-1;o>=0;o--)if(!e.fileIdsToClose.includes(t.tabList[o].fileId)){i=t.tabList[o].fileId;break}if(!i){for(let o=r+1;o<t.tabList.length;o++)if(!e.fileIdsToClose.includes(t.tabList[o].fileId)){i=t.tabList[o].fileId;break}}return{...t,tabList:n,activeFileId:i}},TD=(t,e)=>{if(e.type!=="open_tab")return t;const n=t.tabList.findIndex(a=>a.fileId===e.fileId),r=n!==-1,i=r&&t.tabList[n].isTransient,o=t.tabList.findIndex(a=>a.isTransient&&a.fileId!==e.fileId),s={fileId:e.fileId,isTransient:e.isTransient};let l;return r?i?l=t.tabList.map(a=>a.fileId===e.fileId?s:a):l=[...t.tabList]:o!==-1?(l=[...t.tabList],l[o]=s):l=[...t.tabList,s],{...t,activeFileId:e.fileId,tabList:l,editorWantsFocus:!e.isTransient}},$D=(t,e)=>e.type==="set_active_file_id"?{...t,activeFileId:e.activeFileId}:t,RD=(t,e)=>e.type==="set_is_settings_open"?{...t,isSettingsOpen:e.value}:t,QD=(t,e)=>e.type==="set_theme"?{...t,theme:e.themeLabel}:t,AD=(t,e)=>e.type==="editor_no_longer_wants_focus"?{...t,editorWantsFocus:!1}:t,MD=(t,e)=>e.type==="set_username"?{...t,username:e.username}:t,DD=({defaultTheme:t,initialUsername:e="Anonymous"})=>({tabList:[],activeFileId:null,theme:t,isSettingsOpen:!1,editorWantsFocus:!1,username:e}),ND=[$D,TD,ED,QD,RD,AD,MD],jD=(t,e)=>ND.reduce((n,r)=>r(n,e),t);class Zt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=ja(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),no.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=ja(this,e,n);let r=[];return this.decompose(e,n,r,0),no.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new sc(this),o=new sc(e);for(let s=n,l=n;;){if(i.next(s),o.next(s),s=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(l+=i.value.length,i.done||l>=r)return!0}}iter(e=1){return new sc(this,e)}iterRange(e,n=this.length){return new hE(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new dE(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Zt.empty:e.length<=32?new $n(e):no.from($n.split(e,[]))}}class $n extends Zt{constructor(e,n=ID(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.text[o],l=i+s.length;if((n?r:l)>=e)return new LD(i,l,r,s);i=l+1,r++}}decompose(e,n,r,i){let o=e<=0&&n>=this.length?this:new $n(TS(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let s=r.pop(),l=xd(o.text,s.text.slice(),0,o.length);if(l.length<=32)r.push(new $n(l,s.length+o.length));else{let a=l.length>>1;r.push(new $n(l.slice(0,a)),new $n(l.slice(a)))}}else r.push(o)}replace(e,n,r){if(!(r instanceof $n))return super.replace(e,n,r);[e,n]=ja(this,e,n);let i=xd(this.text,xd(r.text,TS(this.text,0,e)),n),o=this.length+r.length-(n-e);return i.length<=32?new $n(i,o):no.from($n.split(i,[]),o)}sliceString(e,n=this.length,r=`
69
- `){[e,n]=ja(this,e,n);let i="";for(let o=0,s=0;o<=n&&s<this.text.length;s++){let l=this.text[s],a=o+l.length;o>e&&s&&(i+=r),e<a&&n>o&&(i+=l.slice(Math.max(0,e-o),n-o)),o=a+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let o of e)r.push(o),i+=o.length+1,r.length==32&&(n.push(new $n(r,i)),r=[],i=-1);return i>-1&&n.push(new $n(r,i)),n}}class no extends Zt{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let o=0;;o++){let s=this.children[o],l=i+s.length,a=r+s.lines-1;if((n?a:l)>=e)return s.lineInner(e,n,r,i);i=l+1,r=a+1}}decompose(e,n,r,i){for(let o=0,s=0;s<=n&&o<this.children.length;o++){let l=this.children[o],a=s+l.length;if(e<=a&&n>=s){let u=i&((s<=e?1:0)|(a>=n?2:0));s>=e&&a<=n&&!u?r.push(l):l.decompose(e-s,n-s,r,u)}s=a+1}}replace(e,n,r){if([e,n]=ja(this,e,n),r.lines<this.lines)for(let i=0,o=0;i<this.children.length;i++){let s=this.children[i],l=o+s.length;if(e>=o&&n<=l){let a=s.replace(e-o,n-o,r),u=this.lines-s.lines+a.lines;if(a.lines<u>>5-1&&a.lines>u>>5+1){let c=this.children.slice();return c[i]=a,new no(c,this.length-(n-e)+r.length)}return super.replace(o,l,a)}o=l+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
70
- `){[e,n]=ja(this,e,n);let i="";for(let o=0,s=0;o<this.children.length&&s<=n;o++){let l=this.children[o],a=s+l.length;s>e&&o&&(i+=r),e<a&&n>s&&(i+=l.sliceString(e-s,n-s,r)),s=a+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof no))return 0;let r=0,[i,o,s,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,o+=n){if(i==s||o==l)return r;let a=this.children[i],u=e.children[o];if(a!=u)return r+a.scanIdentical(u,n);r+=a.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let d of e)r+=d.lines;if(r<32){let d=[];for(let p of e)p.flatten(d);return new $n(d,n)}let i=Math.max(32,r>>5),o=i<<1,s=i>>1,l=[],a=0,u=-1,c=[];function f(d){let p;if(d.lines>o&&d instanceof no)for(let g of d.children)f(g);else d.lines>s&&(a>s||!a)?(h(),l.push(d)):d instanceof $n&&a&&(p=c[c.length-1])instanceof $n&&d.lines+p.lines<=32?(a+=d.lines,u+=d.length+1,c[c.length-1]=new $n(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>i&&h(),a+=d.lines,u+=d.length+1,c.push(d))}function h(){a!=0&&(l.push(c.length==1?c[0]:no.from(c,u)),u=-1,a=c.length=0)}for(let d of e)f(d);return h(),l.length==1?l[0]:new no(l,n)}}Zt.empty=new $n([""],0);function ID(t){let e=-1;for(let n of t)e+=n.length+1;return e}function xd(t,e,n=0,r=1e9){for(let i=0,o=0,s=!0;o<t.length&&i<=r;o++){let l=t[o],a=i+l.length;a>=n&&(a>r&&(l=l.slice(0,r-i)),i<n&&(l=l.slice(n-i)),s?(e[e.length-1]+=l,s=!1):e.push(l)),i=a+1}return e}function TS(t,e,n){return xd(t,[""],e,n)}class sc{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof $n?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],s=o>>1,l=i instanceof $n?i.text.length:i.children.length;if(s==(n>0?l:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
71
- `,this;e--}else if(i instanceof $n){let a=i.text[s+(n<0?-1:0)];if(this.offsets[r]+=n,a.length>Math.max(0,e))return this.value=e==0?a:n>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=i.children[s+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof $n?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class hE{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new sc(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class dE{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Zt.prototype[Symbol.iterator]=function(){return this.iter()},sc.prototype[Symbol.iterator]=hE.prototype[Symbol.iterator]=dE.prototype[Symbol.iterator]=function(){return this});let LD=class{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}};function ja(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}let Sa="lc,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t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(t=>t?parseInt(t,36):1);for(let t=1;t<Sa.length;t++)Sa[t]+=Sa[t-1];function ZD(t){for(let e=1;e<Sa.length;e+=2)if(Sa[e]>t)return Sa[e-1]<=t;return!1}function $S(t){return t>=127462&&t<=127487}const RS=8205;function mr(t,e,n=!0,r=!0){return(n?pE:WD)(t,e,r)}function pE(t,e,n){if(e==t.length)return e;e&&gE(t.charCodeAt(e))&&mE(t.charCodeAt(e-1))&&e--;let r=ir(t,e);for(e+=ui(r);e<t.length;){let i=ir(t,e);if(r==RS||i==RS||n&&ZD(i))e+=ui(i),r=i;else if($S(i)){let o=0,s=e-2;for(;s>=0&&$S(ir(t,s));)o++,s-=2;if(o%2==0)break;e+=2}else break}return e}function WD(t,e,n){for(;e>0;){let r=pE(t,e-2,n);if(r<e)return r;e--}return 0}function gE(t){return t>=56320&&t<57344}function mE(t){return t>=55296&&t<56320}function ir(t,e){let n=t.charCodeAt(e);if(!mE(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return gE(r)?(n-55296<<10)+(r-56320)+65536:n}function o0(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function ui(t){return t<65536?1:2}const XO=/\r\n?|\n/;var Un=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(Un||(Un={}));class ao{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let o=this.sections[n++],s=this.sections[n++];s<0?(e(r,i,o),i+=o):i+=s,r+=o}}iterChangedRanges(e,n=!1){YO(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new ao(e)}composeDesc(e){return this.empty?e:e.empty?this:OE(this,e)}mapDesc(e,n=!1){return e.empty?this:UO(this,e,n)}mapPos(e,n=-1,r=Un.Simple){let i=0,o=0;for(let s=0;s<this.sections.length;){let l=this.sections[s++],a=this.sections[s++],u=i+l;if(a<0){if(u>e)return o+(e-i);o+=l}else{if(r!=Un.Simple&&u>=e&&(r==Un.TrackDel&&i<e&&u>e||r==Un.TrackBefore&&i<e||r==Un.TrackAfter&&u>e))return null;if(u>e||u==e&&n<0&&!l)return e==i||n<0?o:o+a;o+=a}i=u}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return o}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let o=this.sections[r++],s=this.sections[r++],l=i+o;if(s>=0&&i<=n&&l>=e)return i<e&&l>n?"cover":!0;i=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ao(e)}static create(e){return new ao(e)}}class Yn extends ao{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return YO(this,(n,r,i,o,s)=>e=e.replace(i,i+(r-n),s),!1),e}mapDesc(e,n=!1){return UO(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,o=0;i<n.length;i+=2){let s=n[i],l=n[i+1];if(l>=0){n[i]=l,n[i+1]=s;let a=i>>1;for(;r.length<a;)r.push(Zt.empty);r.push(s?e.slice(o,o+s):Zt.empty)}o+=s}return new Yn(n,r)}compose(e){return this.empty?e:e.empty?this:OE(this,e,!0)}map(e,n=!1){return e.empty?this:UO(this,e,n,!0)}iterChanges(e,n=!1){YO(this,e,n)}get desc(){return ao.create(this.sections)}filter(e){let n=[],r=[],i=[],o=new Rc(this);e:for(let s=0,l=0;;){let a=s==e.length?1e9:e[s++];for(;l<a||l==a&&o.len==0;){if(o.done)break e;let c=Math.min(o.len,a-l);dr(i,c,-1);let f=o.ins==-1?-1:o.off==0?o.ins:0;dr(n,c,f),f>0&&es(r,n,o.text),o.forward(c),l+=c}let u=e[s++];for(;l<u;){if(o.done)break e;let c=Math.min(o.len,u-l);dr(n,c,-1),dr(i,c,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(c),l+=c}}return{changes:new Yn(n,r),filtered:ao.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],o=[],s=0,l=null;function a(c=!1){if(!c&&!i.length)return;s<n&&dr(i,n-s,-1);let f=new Yn(i,o);l=l?l.compose(f.map(l)):f,i=[],o=[],s=0}function u(c){if(Array.isArray(c))for(let f of c)u(f);else if(c instanceof Yn){if(c.length!=n)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${n})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:h=f,insert:d}=c;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let p=d?typeof d=="string"?Zt.of(d.split(r||XO)):d:Zt.empty,g=p.length;if(f==h&&g==0)return;f<s&&a(),f>s&&dr(i,f-s,-1),dr(i,h-f,g),es(o,i,p),s=h}}return u(e),a(!l),l}static empty(e){return new Yn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let o=e[i];if(typeof o=="number")n.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((s,l)=>l&&typeof s!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)n.push(o[0],0);else{for(;r.length<i;)r.push(Zt.empty);r[i]=Zt.of(o.slice(1)),n.push(o[0],r[i].length)}}}return new Yn(n,r)}static createSet(e,n){return new Yn(e,n)}}function dr(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function es(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(Zt.empty);t.push(n)}}function YO(t,e,n){let r=t.inserted;for(let i=0,o=0,s=0;s<t.sections.length;){let l=t.sections[s++],a=t.sections[s++];if(a<0)i+=l,o+=l;else{let u=i,c=o,f=Zt.empty;for(;u+=l,c+=a,a&&r&&(f=f.append(r[s-2>>1])),!(n||s==t.sections.length||t.sections[s+1]<0);)l=t.sections[s++],a=t.sections[s++];e(i,u,o,c,f),i=u,o=c}}}function UO(t,e,n,r=!1){let i=[],o=r?[]:null,s=new Rc(t),l=new Rc(e);for(let a=-1;;)if(s.ins==-1&&l.ins==-1){let u=Math.min(s.len,l.len);dr(i,u,-1),s.forward(u),l.forward(u)}else if(l.ins>=0&&(s.ins<0||a==s.i||s.off==0&&(l.len<s.len||l.len==s.len&&!n))){let u=l.len;for(dr(i,l.ins,-1);u;){let c=Math.min(s.len,u);s.ins>=0&&a<s.i&&s.len<=c&&(dr(i,0,s.ins),o&&es(o,i,s.text),a=s.i),s.forward(c),u-=c}l.next()}else if(s.ins>=0){let u=0,c=s.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);u+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;dr(i,u,a<s.i?s.ins:0),o&&a<s.i&&es(o,i,s.text),a=s.i,s.forward(s.len-c)}else{if(s.done&&l.done)return o?Yn.createSet(i,o):ao.create(i);throw new Error("Mismatched change set lengths")}}function OE(t,e,n=!1){let r=[],i=n?[]:null,o=new Rc(t),s=new Rc(e);for(let l=!1;;){if(o.done&&s.done)return i?Yn.createSet(r,i):ao.create(r);if(o.ins==0)dr(r,o.len,0,l),o.next();else if(s.len==0&&!s.done)dr(r,0,s.ins,l),i&&es(i,r,s.text),s.next();else{if(o.done||s.done)throw new Error("Mismatched change set lengths");{let a=Math.min(o.len2,s.len),u=r.length;if(o.ins==-1){let c=s.ins==-1?-1:s.off?0:s.ins;dr(r,a,c,l),i&&c&&es(i,r,s.text)}else s.ins==-1?(dr(r,o.off?0:o.len,a,l),i&&es(i,r,o.textBit(a))):(dr(r,o.off?0:o.len,s.off?0:s.ins,l),i&&!s.off&&es(i,r,s.text));l=(o.ins>a||s.ins>=0&&s.len>a)&&(l||r.length>u),o.forward2(a),s.forward(a)}}}}class Rc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?Zt.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?Zt.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class el{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new el(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return oe.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return oe.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return oe.range(e.anchor,e.head)}static create(e,n,r){return new el(e,n,r)}}class oe{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:oe.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new oe([this.main],0)}addRange(e,n=!0){return oe.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,oe.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new oe(e.ranges.map(n=>el.fromJSON(n)),e.main)}static single(e,n=e){return new oe([oe.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let o=e[i];if(o.empty?o.from<=r:o.from<r)return oe.normalized(e.slice(),n);r=o.to}return new oe(e,n)}static cursor(e,n=0,r,i){return el.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let o=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?el.create(n,e,48|o):el.create(e,n,(n>e?8:0)|o)}static normalized(e,n=0){let r=e[n];e.sort((i,o)=>i.from-o.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let o=e[i],s=e[i-1];if(o.empty?o.from<=s.to:o.from<s.to){let l=s.from,a=Math.max(o.to,s.to);i<=n&&n--,e.splice(--i,2,o.anchor>o.head?oe.range(a,l):oe.range(l,a))}}return new oe(e,n)}}function vE(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let s0=0;class je{constructor(e,n,r,i,o){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=s0++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new je(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:l0),!!e.static,e.enables)}of(e){return new _d([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _d(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new _d(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function l0(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class _d{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=s0++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,o=this.id,s=e[o]>>1,l=this.type==2,a=!1,u=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?u=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||c.push(e[f.id]);return{create(f){return f.values[s]=r(f),1},update(f,h){if(a&&h.docChanged||u&&(h.docChanged||h.selection)||FO(f,c)){let d=r(f);if(l?!QS(d,f.values[s],i):!i(d,f.values[s]))return f.values[s]=d,1}return 0},reconfigure:(f,h)=>{let d,p=h.config.address[o];if(p!=null){let g=fp(h,p);if(this.dependencies.every(O=>O instanceof je?h.facet(O)===f.facet(O):O instanceof zn?h.field(O,!1)==f.field(O,!1):!0)||(l?QS(d=r(f),g,i):i(d=r(f),g)))return f.values[s]=g,0}else d=r(f);return f.values[s]=d,1}}}}function QS(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function FO(t,e){let n=!1;for(let r of e)lc(t,r)&1&&(n=!0);return n}function BD(t,e,n){let r=n.map(a=>t[a.id]),i=n.map(a=>a.type),o=r.filter(a=>!(a&1)),s=t[e.id]>>1;function l(a){let u=[];for(let c=0;c<r.length;c++){let f=fp(a,r[c]);if(i[c]==2)for(let h of f)u.push(h);else u.push(f)}return e.combine(u)}return{create(a){for(let u of r)lc(a,u);return a.values[s]=l(a),1},update(a,u){if(!FO(a,o))return 0;let c=l(a);return e.compare(c,a.values[s])?0:(a.values[s]=c,1)},reconfigure(a,u){let c=FO(a,r),f=u.config.facets[e.id],h=u.facet(e);if(f&&!c&&l0(n,f))return a.values[s]=h,0;let d=l(a);return e.compare(d,h)?(a.values[s]=h,0):(a.values[s]=d,1)}}}const AS=je.define({static:!0});class zn{constructor(e,n,r,i,o){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=o,this.provides=void 0}static define(e){let n=new zn(s0++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(AS).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let o=r.values[n],s=this.updateF(o,i);return this.compareF(o,s)?0:(r.values[n]=s,1)},reconfigure:(r,i)=>i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}init(e){return[this,AS.of({field:this,create:e})]}get extension(){return this}}const qs={lowest:4,low:3,default:2,high:1,highest:0};function Su(t){return e=>new yE(e,t)}const Cs={highest:Su(qs.highest),high:Su(qs.high),default:Su(qs.default),low:Su(qs.low),lowest:Su(qs.lowest)};class yE{constructor(e,n){this.inner=e,this.prec=n}}class Ia{of(e){return new qO(this,e)}reconfigure(e){return Ia.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class qO{constructor(e,n){this.compartment=e,this.inner=n}}class cp{constructor(e,n,r,i,o,s){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],o=Object.create(null),s=new Map;for(let h of XD(e,n,s))h instanceof zn?i.push(h):(o[h.facet.id]||(o[h.facet.id]=[])).push(h);let l=Object.create(null),a=[],u=[];for(let h of i)l[h.id]=u.length<<1,u.push(d=>h.slot(d));let c=r==null?void 0:r.config.facets;for(let h in o){let d=o[h],p=d[0].facet,g=c&&c[h]||[];if(d.every(O=>O.type==0))if(l[p.id]=a.length<<1|1,l0(g,d))a.push(r.facet(p));else{let O=p.combine(d.map(v=>v.value));a.push(r&&p.compare(O,r.facet(p))?r.facet(p):O)}else{for(let O of d)O.type==0?(l[O.id]=a.length<<1|1,a.push(O.value)):(l[O.id]=u.length<<1,u.push(v=>O.dynamicSlot(v)));l[p.id]=u.length<<1,u.push(O=>BD(O,p,d))}}let f=u.map(h=>h(l));return new cp(e,s,f,l,a,o)}}function XD(t,e,n){let r=[[],[],[],[],[]],i=new Map;function o(s,l){let a=i.get(s);if(a!=null){if(a<=l)return;let u=r[a].indexOf(s);u>-1&&r[a].splice(u,1),s instanceof qO&&n.delete(s.compartment)}if(i.set(s,l),Array.isArray(s))for(let u of s)o(u,l);else if(s instanceof qO){if(n.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(s.compartment)||s.inner;n.set(s.compartment,u),o(u,l)}else if(s instanceof yE)o(s.inner,s.prec);else if(s instanceof zn)r[l].push(s),s.provides&&o(s.provides,l);else if(s instanceof _d)r[l].push(s),s.facet.extensions&&o(s.facet.extensions,qs.default);else{let u=s.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(u,l)}}return o(t,qs.default),r.reduce((s,l)=>s.concat(l))}function lc(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function fp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const SE=je.define(),zO=je.define({combine:t=>t.some(e=>e),static:!0}),bE=je.define({combine:t=>t.length?t[0]:void 0,static:!0}),wE=je.define(),kE=je.define(),xE=je.define(),_E=je.define({combine:t=>t.length?t[0]:!1});class fo{constructor(e,n){this.type=e,this.value=n}static define(){return new YD}}class YD{of(e){return new fo(this,e)}}class UD{constructor(e){this.map=e}of(e){return new Ot(this,e)}}class Ot{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Ot(this.type,n)}is(e){return this.type==e}static define(e={}){return new UD(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let o=i.map(n);o&&r.push(o)}return r}}Ot.reconfigure=Ot.define();Ot.appendConfig=Ot.define();class Nn{constructor(e,n,r,i,o,s){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=s,this._doc=null,this._state=null,r&&vE(r,n.newLength),o.some(l=>l.type==Nn.time)||(this.annotations=o.concat(Nn.time.of(Date.now())))}static create(e,n,r,i,o,s){return new Nn(e,n,r,i,o,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(Nn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}Nn.time=fo.define();Nn.userEvent=fo.define();Nn.addToHistory=fo.define();Nn.remote=fo.define();function FD(t,e){let n=[];for(let r=0,i=0;;){let o,s;if(r<t.length&&(i==e.length||e[i]>=t[r]))o=t[r++],s=t[r++];else if(i<e.length)o=e[i++],s=e[i++];else return n;!n.length||n[n.length-1]<o?n.push(o,s):n[n.length-1]<s&&(n[n.length-1]=s)}}function PE(t,e,n){var r;let i,o,s;return n?(i=e.changes,o=Yn.empty(e.changes.length),s=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),o=t.changes.mapDesc(e.changes,!0),s=t.changes.compose(i)),{changes:s,selection:e.selection?e.selection.map(o):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Ot.mapEffects(t.effects,i).concat(Ot.mapEffects(e.effects,o)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function VO(t,e,n){let r=e.selection,i=ba(e.annotations);return e.userEvent&&(i=i.concat(Nn.userEvent.of(e.userEvent))),{changes:e.changes instanceof Yn?e.changes:Yn.of(e.changes||[],n,t.facet(bE)),selection:r&&(r instanceof oe?r:oe.single(r.anchor,r.head)),effects:ba(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function CE(t,e,n){let r=VO(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(n=!1);let s=!!e[o].sequential;r=PE(r,VO(t,e[o],s?r.changes.newLength:t.doc.length),s)}let i=Nn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return zD(n?qD(i):i)}function qD(t){let e=t.startState,n=!0;for(let i of e.facet(wE)){let o=i(t);if(o===!1){n=!1;break}Array.isArray(o)&&(n=n===!0?o:FD(n,o))}if(n!==!0){let i,o;if(n===!1)o=t.changes.invertedDesc,i=Yn.empty(e.doc.length);else{let s=t.changes.filter(n);i=s.changes,o=s.filtered.mapDesc(s.changes).invertedDesc}t=Nn.create(e,i,t.selection&&t.selection.map(o),Ot.mapEffects(t.effects,o),t.annotations,t.scrollIntoView)}let r=e.facet(kE);for(let i=r.length-1;i>=0;i--){let o=r[i](t);o instanceof Nn?t=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Nn?t=o[0]:t=CE(e,ba(o),!1)}return t}function zD(t){let e=t.startState,n=e.facet(xE),r=t;for(let i=n.length-1;i>=0;i--){let o=n[i](t);o&&Object.keys(o).length&&(r=PE(r,VO(e,o,t.changes.newLength),!0))}return r==t?t:Nn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const VD=[];function ba(t){return t==null?VD:Array.isArray(t)?t:[t]}var mn=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(mn||(mn={}));const GD=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let GO;try{GO=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function HD(t){if(GO)return GO.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||GD.test(n)))return!0}return!1}function KD(t){return e=>{if(!/\S/.test(e))return mn.Space;if(HD(e))return mn.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return mn.Word;return mn.Other}}class Mt{constructor(e,n,r,i,o,s){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=o,s&&(s._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)lc(this,l<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return lc(this,r),fp(this,r)}update(...e){return CE(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let l of e.effects)l.is(Ia.reconfigure)?(n&&(i=new Map,n.compartments.forEach((a,u)=>i.set(u,a)),n=null),i.set(l.value.compartment,l.value.extension)):l.is(Ot.reconfigure)?(n=null,r=l.value):l.is(Ot.appendConfig)&&(n=null,r=ba(r).concat(l.value));let o;n?o=e.startState.values.slice():(n=cp.resolve(r,i,this),o=new Mt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,u)=>u.reconfigure(a,this),null).values);let s=e.startState.facet(zO)?e.newSelection:e.newSelection.asSingle();new Mt(n,e.newDoc,s,o,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:oe.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),o=[r.range],s=ba(r.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),u=this.changes(a.changes),c=u.map(i);for(let h=0;h<l;h++)o[h]=o[h].map(c);let f=i.mapDesc(u,!0);o.push(a.range.map(f)),i=i.compose(c),s=Ot.mapEffects(s,c).concat(Ot.mapEffects(ba(a.effects),f))}return{changes:i,selection:oe.create(o,n.mainIndex),effects:s}}changes(e=[]){return e instanceof Yn?e:Yn.of(e,this.doc.length,this.facet(Mt.lineSeparator))}toText(e){return Zt.of(e.split(this.facet(Mt.lineSeparator)||XO))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(lc(this,n),fp(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof zn&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let o in r)if(Object.prototype.hasOwnProperty.call(e,o)){let s=r[o],l=e[o];i.push(s.init(a=>s.spec.fromJSON(l,a)))}}return Mt.create({doc:e.doc,selection:oe.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=cp.resolve(e.extensions||[],new Map),r=e.doc instanceof Zt?e.doc:Zt.of((e.doc||"").split(n.staticFacet(Mt.lineSeparator)||XO)),i=e.selection?e.selection instanceof oe?e.selection:oe.single(e.selection.anchor,e.selection.head):oe.single(0);return vE(i,r.length),n.staticFacet(zO)||(i=i.asSingle()),new Mt(n,r,i,n.dynamicSlots.map(()=>null),(o,s)=>s.create(o),null)}get tabSize(){return this.facet(Mt.tabSize)}get lineBreak(){return this.facet(Mt.lineSeparator)||`
72
- `}get readOnly(){return this.facet(_E)}phrase(e,...n){for(let r of this.facet(Mt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let o=+(i||1);return!o||o>n.length?r:n[o-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let o of this.facet(SE))for(let s of o(this,n,r))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){return KD(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),o=this.charCategorizer(e),s=e-r,l=e-r;for(;s>0;){let a=mr(n,s,!1);if(o(n.slice(a,s))!=mn.Word)break;s=a}for(;l<i;){let a=mr(n,l);if(o(n.slice(l,a))!=mn.Word)break;l=a}return s==l?null:oe.range(s+r,l+r)}}Mt.allowMultipleSelections=zO;Mt.tabSize=je.define({combine:t=>t.length?t[0]:4});Mt.lineSeparator=bE;Mt.readOnly=_E;Mt.phrases=je.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});Mt.languageData=SE;Mt.changeFilter=wE;Mt.transactionFilter=kE;Mt.transactionExtender=xE;Ia.reconfigure=Ot.define();function Li(t,e,n={}){let r={};for(let i of t)for(let o of Object.keys(i)){let s=i[o],l=r[o];if(l===void 0)r[o]=s;else if(!(l===s||s===void 0))if(Object.hasOwnProperty.call(n,o))r[o]=n[o](l,s);else throw new Error("Config merge conflict for field "+o)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class pl{eq(e){return this==e}range(e,n=e){return HO.create(e,n,this)}}pl.prototype.startSide=pl.prototype.endSide=0;pl.prototype.point=!1;pl.prototype.mapMode=Un.TrackDel;let HO=class EE{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new EE(e,n,r)}};function KO(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class a0{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let o=r?this.to:this.from;for(let s=i,l=o.length;;){if(s==l)return s;let a=s+l>>1,u=o[a]-e||(r?this.value[a].endSide:this.value[a].startSide)-n;if(a==s)return u>=0?s:l;u>=0?l=a:s=a+1}}between(e,n,r,i){for(let o=this.findIndex(n,-1e9,!0),s=this.findIndex(r,1e9,!1,o);o<s;o++)if(i(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,n){let r=[],i=[],o=[],s=-1,l=-1;for(let a=0;a<this.value.length;a++){let u=this.value[a],c=this.from[a]+e,f=this.to[a]+e,h,d;if(c==f){let p=n.mapPos(c,u.startSide,u.mapMode);if(p==null||(h=d=p,u.startSide!=u.endSide&&(d=n.mapPos(c,u.endSide),d<h)))continue}else if(h=n.mapPos(c,u.startSide),d=n.mapPos(f,u.endSide),h>d||h==d&&u.startSide>0&&u.endSide<=0)continue;(d-h||u.endSide-u.startSide)<0||(s<0&&(s=h),u.point&&(l=Math.max(l,d-h)),r.push(u),i.push(h-s),o.push(d-s))}return{mapped:r.length?new a0(i,o,r,l):null,pos:s}}}class Dt{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new Dt(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:o=this.length}=e,s=e.filter;if(n.length==0&&!s)return this;if(r&&(n=n.slice().sort(KO)),this.isEmpty)return n.length?Dt.of(n):this;let l=new TE(this,null,-1).goto(0),a=0,u=[],c=new vs;for(;l.value||a<n.length;)if(a<n.length&&(l.from-n[a].from||l.startSide-n[a].value.startSide)>=0){let f=n[a++];c.addInner(f.from,f.to,f.value)||u.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!s||i>this.chunkEnd(l.chunkIndex)||o<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!s||i>l.to||o<l.from||s(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||u.push(HO.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!u.length?Dt.empty:this.nextLayer.update({add:u,filter:s,filterFrom:i,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let s=0;s<this.chunk.length;s++){let l=this.chunkPos[s],a=this.chunk[s],u=e.touchesRange(l,l+a.length);if(u===!1)i=Math.max(i,a.maxPoint),n.push(a),r.push(e.mapPos(l));else if(u===!0){let{mapped:c,pos:f}=a.map(l,e);c&&(i=Math.max(i,c.maxPoint),n.push(c),r.push(f))}}let o=this.nextLayer.map(e);return n.length==0?o:new Dt(r,n,o||Dt.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let o=this.chunkPos[i],s=this.chunk[i];if(n>=o&&e<=o+s.length&&s.between(o,e-o,n-o,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Qc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Qc.from(e).goto(n)}static compare(e,n,r,i,o=-1){let s=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o),a=MS(s,l,r),u=new bu(s,a,o),c=new bu(l,a,o);r.iterGaps((f,h,d)=>DS(u,f,c,h,d,i)),r.empty&&r.length==0&&DS(u,0,c,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=1e9-1);let o=e.filter(c=>!c.isEmpty&&n.indexOf(c)<0),s=n.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(o.length!=s.length)return!1;if(!o.length)return!0;let l=MS(o,s),a=new bu(o,l,0).goto(r),u=new bu(s,l,0).goto(r);for(;;){if(a.to!=u.to||!JO(a.active,u.active)||a.point&&(!u.point||!a.point.eq(u.point)))return!1;if(a.to>i)return!0;a.next(),u.next()}}static spans(e,n,r,i,o=-1){let s=new bu(e,null,o).goto(n),l=n,a=s.openStart;for(;;){let u=Math.min(s.to,r);if(s.point){let c=s.activeForPoint(s.to),f=s.pointFrom<n?c.length+1:Math.min(c.length,a);i.point(l,u,s.point,c,f,s.pointRank),a=Math.min(s.openEnd(u),c.length)}else u>l&&(i.span(l,u,s.active,a),a=s.openEnd(u));if(s.to>r)return a+(s.point&&s.to>r?1:0);l=s.to,s.next()}}static of(e,n=!1){let r=new vs;for(let i of e instanceof HO?[e]:n?JD(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return Dt.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=Dt.empty;i=i.nextLayer)n=new Dt(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}Dt.empty=new Dt([],[],null,-1);function JD(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(KO(e,r)>0)return t.slice().sort(KO);e=r}return t}Dt.empty.nextLayer=Dt.empty;class vs{finishChunk(e){this.chunks.push(new a0(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new vs)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(Dt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=Dt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function MS(t,e,n){let r=new Map;for(let o of t)for(let s=0;s<o.chunk.length;s++)o.chunk[s].maxPoint<=0&&r.set(o.chunk[s],o.chunkPos[s]);let i=new Set;for(let o of e)for(let s=0;s<o.chunk.length;s++){let l=r.get(o.chunk[s]);l!=null&&(n?n.mapPos(l):l)==o.chunkPos[s]&&!(n!=null&&n.touchesRange(l,l+o.chunk[s].length))&&i.add(o.chunk[s])}return i}class TE{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Qc{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let o=0;o<e.length;o++)for(let s=e[o];!s.isEmpty;s=s.nextLayer)s.maxPoint>=r&&i.push(new TE(s,n,r,o));return i.length==1?i[0]:new Qc(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Hg(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Hg(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Hg(this.heap,0)}}}function Hg(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class bu{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Qc.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){qf(this.active,e),qf(this.activeTo,e),qf(this.activeRank,e),this.minActive=NS(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:o}=this.cursor;for(;n<this.activeRank.length&&(o-this.activeRank[n]||i-this.activeTo[n])>0;)n++;zf(this.active,n,r),zf(this.activeTo,n,i),zf(this.activeRank,n,o),e&&zf(e,n,this.cursor.from),this.minActive=NS(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&qf(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function DS(t,e,n,r,i,o){t.goto(e),n.goto(r);let s=r+i,l=r,a=r-e;for(;;){let u=t.to+a-n.to||t.endSide-n.endSide,c=u<0?t.to+a:n.to,f=Math.min(c,s);if(t.point||n.point?t.point&&n.point&&(t.point==n.point||t.point.eq(n.point))&&JO(t.activeForPoint(t.to),n.activeForPoint(n.to))||o.comparePoint(l,f,t.point,n.point):f>l&&!JO(t.active,n.active)&&o.compareRange(l,f,t.active,n.active),c>s)break;l=c,u<=0&&t.next(),u>=0&&n.next()}}function JO(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].eq(e[n]))return!1;return!0}function qf(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function zf(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function NS(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function Ni(t,e,n=t.length){let r=0;for(let i=0;i<n;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=mr(t,i));return r}function ev(t,e,n,r){for(let i=0,o=0;;){if(o>=e)return i;if(i==t.length)break;o+=t.charCodeAt(i)==9?n-o%n:1,i=mr(t,i)}return r===!0?-1:t.length}const tv="ͼ",jS=typeof Symbol>"u"?"__"+tv:Symbol.for(tv),nv=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),IS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ys{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,l,a,u){let c=[],f=/^@(\w+)\b/.exec(s[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return a.push(s[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))o(d.split(/,\s*/).map(g=>s.map(O=>g.replace(/&/,O))).reduce((g,O)=>g.concat(O)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");o(i(d),p,c,h)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||h)&&a.push((r&&!f&&!u?s.map(r):s).join(", ")+" {"+c.join(" ")+"}")}for(let s in e)o(i(s),e[s],this.rules)}getRules(){return this.rules.join(`
73
- `)}static newName(){let e=IS[jS]||1;return IS[jS]=e+1,tv+e.toString(36)}static mount(e,n,r){let i=e[nv],o=r&&r.nonce;i?o&&i.setNonce(o):i=new eN(e,o),i.mount(Array.isArray(n)?n:[n])}}let LS=new Map;class eN{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let o=LS.get(r);if(o)return e.adoptedStyleSheets=[o.sheet,...e.adoptedStyleSheets],e[nv]=o;this.sheet=new i.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],LS.set(r,this)}else{this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[nv]=this}mount(e){let n=this.sheet,r=0,i=0;for(let o=0;o<e.length;o++){let s=e[o],l=this.modules.indexOf(s);if(l<i&&l>-1&&(this.modules.splice(l,1),i--,l=-1),l==-1){if(this.modules.splice(i++,0,s),n)for(let a=0;a<s.rules.length;a++)n.insertRule(s.rules[a],r++)}else{for(;i<l;)r+=this.modules[i++].rules.length;r+=s.rules.length,i++}}if(!n){let o="";for(let s=0;s<this.modules.length;s++)o+=this.modules[s].getRules()+`
74
- `;this.styleTag.textContent=o}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Ss={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:"'"},Ac={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tN=typeof navigator<"u"&&/Mac/.test(navigator.platform),nN=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var or=0;or<10;or++)Ss[48+or]=Ss[96+or]=String(or);for(var or=1;or<=24;or++)Ss[or+111]="F"+or;for(var or=65;or<=90;or++)Ss[or]=String.fromCharCode(or+32),Ac[or]=String.fromCharCode(or);for(var Kg in Ss)Ac.hasOwnProperty(Kg)||(Ac[Kg]=Ss[Kg]);function rN(t){var e=tN&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||nN&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Ac:Ss)[t.keyCode]||t.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}function hp(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function rv(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function iN(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Pd(t,e){if(!e.anchorNode)return!1;try{return rv(t,e.anchorNode)}catch{return!1}}function Mc(t){return t.nodeType==3?gl(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ac(t,e,n,r){return n?ZS(t,e,n,r,-1)||ZS(t,e,n,r,1):!1}function Dc(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function ZS(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Ro(t))){if(t.nodeName=="DIV")return!1;let o=t.parentNode;if(!o||o.nodeType!=1)return!1;e=Dc(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?Ro(t):0}else return!1}}function Ro(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function u0(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function oN(t){return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function $E(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function sN(t,e,n,r,i,o,s,l){let a=t.ownerDocument,u=a.defaultView||window;for(let c=t,f=!1;c&&!f;)if(c.nodeType==1){let h,d=c==a.body,p=1,g=1;if(d)h=oN(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let m=c.getBoundingClientRect();({scaleX:p,scaleY:g}=$E(c,m)),h={left:m.left,right:m.left+c.clientWidth*p,top:m.top,bottom:m.top+c.clientHeight*g}}let O=0,v=0;if(i=="nearest")e.top<h.top?(v=-(h.top-e.top+s),n>0&&e.bottom>h.bottom+v&&(v=e.bottom-h.bottom+v+s)):e.bottom>h.bottom&&(v=e.bottom-h.bottom+s,n<0&&e.top-v<h.top&&(v=-(h.top+v-e.top+s)));else{let m=e.bottom-e.top,y=h.bottom-h.top;v=(i=="center"&&m<=y?e.top+m/2-y/2:i=="start"||i=="center"&&n<0?e.top-s:e.bottom-y+s)-h.top}if(r=="nearest"?e.left<h.left?(O=-(h.left-e.left+o),n>0&&e.right>h.right+O&&(O=e.right-h.right+O+o)):e.right>h.right&&(O=e.right-h.right+o,n<0&&e.left<h.left+O&&(O=-(h.left+O-e.left+o))):O=(r=="center"?e.left+(e.right-e.left)/2-(h.right-h.left)/2:r=="start"==l?e.left-o:e.right-(h.right-h.left)+o)-h.left,O||v)if(d)u.scrollBy(O,v);else{let m=0,y=0;if(v){let S=c.scrollTop;c.scrollTop+=v/g,y=(c.scrollTop-S)*g}if(O){let S=c.scrollLeft;c.scrollLeft+=O/p,m=(c.scrollLeft-S)*p}e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y},m&&Math.abs(m-O)<1&&(r="nearest"),y&&Math.abs(y-v)<1&&(i="nearest")}if(d)break;c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function lN(t){let e=t.ownerDocument;for(let n=t.parentNode;n&&n!=e.body;)if(n.nodeType==1){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else if(n.nodeType==11)n=n.host;else break;return null}class aN{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?Ro(n):0),r,Math.min(e.focusOffset,r?Ro(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let Dl=null;function RE(t){if(t.setActive)return t.setActive();if(Dl)return t.focus(Dl);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(Dl==null?{get preventScroll(){return Dl={preventScroll:!0},!0}}:void 0),!Dl){Dl=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],o=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=o&&(r.scrollLeft=o)}}}let WS;function gl(t,e,n=e){let r=WS||(WS=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function wa(t,e,n){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,t.dispatchEvent(i);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function uN(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function QE(t){for(;t.attributes.length;)t.removeAttributeNode(t.attributes[0])}function cN(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,Ro(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=Ro(n))}else{if(n==t)return!0;r=Dc(n),n=n.parentNode}}function AE(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}class gr{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new gr(e.parentNode,Dc(e),n)}static after(e,n){return new gr(e.parentNode,Dc(e)+1,n)}}const c0=[];class an{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let n=this.posAtStart;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,n){if(this.flags&2){let r=this.dom,i=null,o;for(let s of this.children){if(s.flags&7){if(!s.dom&&(o=i?i.nextSibling:r.firstChild)){let l=an.get(o);(!l||!l.parent&&l.canReuseDOM(s))&&s.reuseDOM(o)}s.sync(e,n),s.flags&=-8}if(o=i?i.nextSibling:r.firstChild,n&&!n.written&&n.node==r&&o!=s.dom&&(n.written=!0),s.dom.parentNode==r)for(;o&&o!=s.dom;)o=BS(o);else r.insertBefore(s.dom,o);i=s.dom}for(o=i?i.nextSibling:r.firstChild,o&&n&&n.node==r&&(n.written=!0);o;)o=BS(o)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,n),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,n){let r;if(e==this.dom)r=this.dom.childNodes[n];else{let i=Ro(e)==0?0:n==0?-1:1;for(;;){let o=e.parentNode;if(o==this.dom)break;i==0&&o.firstChild!=o.lastChild&&(e==o.firstChild?i=-1:i=1),e=o}i<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!an.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,o=0;;i++){let s=this.children[i];if(s.dom==r)return o;o+=s.length+s.breakAfter}}domBoundsAround(e,n,r=0){let i=-1,o=-1,s=-1,l=-1;for(let a=0,u=r,c=r;a<this.children.length;a++){let f=this.children[a],h=u+f.length;if(u<e&&h>n)return f.domBoundsAround(e,n,u);if(h>=e&&i==-1&&(i=a,o=u),u>n&&f.dom.parentNode==this.dom){s=a,l=c;break}c=h,u=h+f.breakAfter}return{from:o,to:l<0?r+this.length:l,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s<this.children.length&&s>=0?this.children[s].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let n=this.parent;n;n=n.parent){if(e&&(n.flags|=2),n.flags&1)return;n.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let n=e.parent;if(!n)return e;e=n}}replaceChildren(e,n,r=c0){this.markDirty();for(let i=e;i<n;i++){let o=this.children[i];o.parent==this&&r.indexOf(o)<0&&o.destroy()}this.children.splice(e,n-e,...r);for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new ME(this.children,e,this.children.length)}childPos(e,n=1){return this.childCursor().findPos(e,n)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,n,r,i,o,s){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}an.prototype.breakAfter=0;function BS(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class ME{constructor(e,n,r){this.children=e,this.pos=n,this.i=r,this.off=0}findPos(e,n=1){for(;;){if(e>this.pos||e==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function DE(t,e,n,r,i,o,s,l,a){let{children:u}=t,c=u.length?u[e]:null,f=o.length?o[o.length-1]:null,h=f?f.breakAfter:s;if(!(e==r&&c&&!s&&!h&&o.length<2&&c.merge(n,i,o.length?f:null,n==0,l,a))){if(r<u.length){let d=u[r];d&&(i<d.length||d.breakAfter&&(f!=null&&f.breakAfter))?(e==r&&(d=d.split(i),i=0),!h&&f&&d.merge(0,i,f,!0,0,a)?o[o.length-1]=d:((i||d.children.length&&!d.children[0].length)&&d.merge(0,i,null,!1,0,a),o.push(d))):d!=null&&d.breakAfter&&(f?f.breakAfter=1:s=1),r++}for(c&&(c.breakAfter=s,n>0&&(!s&&o.length&&c.merge(n,c.length,o[0],!1,l,0)?c.breakAfter=o.shift().breakAfter:(n<c.length||c.children.length&&c.children[c.children.length-1].length==0)&&c.merge(n,c.length,null,!1,l,0),e++));e<r&&o.length;)if(u[r-1].become(o[o.length-1]))r--,o.pop(),a=o.length?0:l;else if(u[e].become(o[0]))e++,o.shift(),l=o.length?0:a;else break;!o.length&&e&&r<u.length&&!u[e-1].breakAfter&&u[r].merge(0,0,u[e-1],!1,l,a)&&e--,(e<r||o.length)&&t.replaceChildren(e,r,o)}}function NE(t,e,n,r,i,o){let s=t.childCursor(),{i:l,off:a}=s.findPos(n,1),{i:u,off:c}=s.findPos(e,-1),f=e-n;for(let h of r)f+=h.length;t.length+=f,DE(t,u,c,l,a,r,0,i,o)}let zr=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},iv=typeof document<"u"?document:{documentElement:{style:{}}};const ov=/Edge\/(\d+)/.exec(zr.userAgent),jE=/MSIE \d/.test(zr.userAgent),sv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(zr.userAgent),ag=!!(jE||sv||ov),XS=!ag&&/gecko\/(\d+)/i.test(zr.userAgent),Jg=!ag&&/Chrome\/(\d+)/.exec(zr.userAgent),YS="webkitFontSmoothing"in iv.documentElement.style,IE=!ag&&/Apple Computer/.test(zr.vendor),US=IE&&(/Mobile\/\w+/.test(zr.userAgent)||zr.maxTouchPoints>2);var ze={mac:US||/Mac/.test(zr.platform),windows:/Win/.test(zr.platform),linux:/Linux|X11/.test(zr.platform),ie:ag,ie_version:jE?iv.documentMode||6:sv?+sv[1]:ov?+ov[1]:0,gecko:XS,gecko_version:XS?+(/Firefox\/(\d+)/.exec(zr.userAgent)||[0,0])[1]:0,chrome:!!Jg,chrome_version:Jg?+Jg[1]:0,ios:US,android:/Android\b/.test(zr.userAgent),webkit:YS,safari:IE,webkit_version:YS?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:iv.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const fN=256;class Qo extends an{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,n){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(n&&n.node==this.dom&&(n.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,n,r){return this.flags&8||r&&(!(r instanceof Qo)||this.length-(n-e)+r.length>fN||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(n),this.markDirty(),!0)}split(e){let n=new Qo(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),n.flags|=this.flags&8,n}localPosFromDOM(e,n){return e==this.dom?n:n?this.text.length:0}domAtPos(e){return new gr(this.dom,e)}domBoundsAround(e,n,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,n){return hN(this.dom,e,n)}}class Ao extends an{constructor(e,n=[],r=0){super(),this.mark=e,this.children=n,this.length=r;for(let i of n)i.setParent(this)}setAttrs(e){if(QE(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let n in this.mark.attrs)e.setAttribute(n,this.mark.attrs[n]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,n){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,n)}merge(e,n,r,i,o,s){return r&&(!(r instanceof Ao&&r.mark.eq(this.mark))||e&&o<=0||n<this.length&&s<=0)?!1:(NE(this,e,n,r?r.children.slice():[],o-1,s-1),this.markDirty(),!0)}split(e){let n=[],r=0,i=-1,o=0;for(let l of this.children){let a=r+l.length;a>e&&n.push(r<e?l.split(e-r):l),i<0&&r>=e&&(i=o),r=a,o++}let s=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new Ao(this.mark,n,s)}domAtPos(e){return LE(this,e)}coordsAt(e,n){return WE(this,e,n)}}function hN(t,e,n){let r=t.nodeValue.length;e>r&&(e=r);let i=e,o=e,s=0;e==0&&n<0||e==r&&n>=0?ze.chrome||ze.gecko||(e?(i--,s=1):o<r&&(o++,s=-1)):n<0?i--:o<r&&o++;let l=gl(t,i,o).getClientRects();if(!l.length)return null;let a=l[(s?s<0:n>=0)?0:l.length-1];return ze.safari&&!s&&a.width==0&&(a=Array.prototype.find.call(l,u=>u.width)||a),s?u0(a,s<0):a||null}class ts extends an{static create(e,n,r){return new ts(e,n,r)}constructor(e,n,r){super(),this.widget=e,this.length=n,this.side=r,this.prevWidget=null}split(e){let n=ts.create(this.widget,this.length-e,this.side);return this.length-=e,n}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,n,r,i,o,s){return r&&(!(r instanceof ts)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}become(e){return e instanceof ts&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return Zt.empty;let e=this;for(;e.parent;)e=e.parent;let{view:n}=e,r=n&&n.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):Zt.empty}domAtPos(e){return(this.length?e==0:this.side>0)?gr.before(this.dom):gr.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,n){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;let i=this.dom.getClientRects(),o=null;if(!i.length)return null;let s=this.side?this.side<0:e>0;for(let l=s?i.length-1:0;o=i[l],!(e>0?l==0:l==i.length-1||o.top<o.bottom);l+=s?-1:1);return u0(o,!s)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class La extends an{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof La&&e.side==this.side}split(){return new La(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?gr.before(this.dom):gr.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Zt.empty}get isHidden(){return!0}}Qo.prototype.children=ts.prototype.children=La.prototype.children=c0;function LE(t,e){let n=t.dom,{children:r}=t,i=0;for(let o=0;i<r.length;i++){let s=r[i],l=o+s.length;if(!(l==o&&s.getSide()<=0)){if(e>o&&e<l&&s.dom.parentNode==n)return s.domAtPos(e-o);if(e<=o)break;o=l}}for(let o=i;o>0;o--){let s=r[o-1];if(s.dom.parentNode==n)return s.domAtPos(s.length)}for(let o=i;o<r.length;o++){let s=r[o];if(s.dom.parentNode==n)return s.domAtPos(0)}return new gr(n,0)}function ZE(t,e,n){let r,{children:i}=t;n>0&&e instanceof Ao&&i.length&&(r=i[i.length-1])instanceof Ao&&r.mark.eq(e.mark)?ZE(r,e.children[0],n-1):(i.push(e),e.setParent(t)),t.length+=e.length}function WE(t,e,n){let r=null,i=-1,o=null,s=-1;function l(u,c){for(let f=0,h=0;f<u.children.length&&h<=c;f++){let d=u.children[f],p=h+d.length;p>=c&&(d.children.length?l(d,c-h):(!o||o.isHidden&&n>0)&&(p>c||h==p&&d.getSide()>0)?(o=d,s=c-h):(h<c||h==p&&d.getSide()<0&&!d.isHidden)&&(r=d,i=c-h)),h=p}}l(t,e);let a=(n<0?r:o)||r||o;return a?a.coordsAt(Math.max(0,a==r?i:s),n):dN(t)}function dN(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=Mc(e);return n[n.length-1]||null}function lv(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const FS=Object.create(null);function f0(t,e,n){if(t==e)return!0;t||(t=FS),e||(e=FS);let r=Object.keys(t),i=Object.keys(e);if(r.length-(n&&r.indexOf(n)>-1?1:0)!=i.length-(n&&i.indexOf(n)>-1?1:0))return!1;for(let o of r)if(o!=n&&(i.indexOf(o)==-1||t[o]!==e[o]))return!1;return!0}function av(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function pN(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class Bn extends an{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,n,r,i,o,s){if(r){if(!(r instanceof Bn))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),NE(this,e,n,r?r.children.slice():[],o,s),!0}split(e){let n=new Bn;if(n.breakAfter=this.breakAfter,this.length==0)return n;let{i:r,off:i}=this.childPos(e);i&&(n.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let o=r;o<this.children.length;o++)n.append(this.children[o],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,n}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){f0(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,n){ZE(this,e,n)}addLineDeco(e){let n=e.spec.attributes,r=e.spec.class;n&&(this.attrs=lv(n,this.attrs||{})),r&&(this.attrs=lv({class:r},this.attrs||{}))}domAtPos(e){return LE(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,n){var r;this.dom?this.flags&4&&(QE(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(av(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,n);let i=this.dom.lastChild;for(;i&&an.get(i)instanceof Ao;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=an.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!ze.ios||!this.children.some(o=>o instanceof Qo))){let o=document.createElement("BR");o.cmIgnore=!0,this.dom.appendChild(o)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,n;for(let r of this.children){if(!(r instanceof Qo)||/[^ -~]/.test(r.text))return null;let i=Mc(r.dom);if(i.length!=1)return null;e+=i[0].width,n=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:n}:null}coordsAt(e,n){let r=WE(this,e,n);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,o=r.bottom-r.top;if(Math.abs(o-i.lineHeight)<2&&i.textHeight<o){let s=(o-i.textHeight)/2;return{top:r.top+s,bottom:r.bottom-s,left:r.left,right:r.left}}}return r}become(e){return!1}covers(){return!0}static find(e,n){for(let r=0,i=0;r<e.children.length;r++){let o=e.children[r],s=i+o.length;if(s>=n){if(o instanceof Bn)return o;if(s>n)break}i=s+o.breakAfter}return null}}class ds extends an{constructor(e,n,r){super(),this.widget=e,this.length=n,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,n,r,i,o,s){return r&&(!(r instanceof ds)||!this.widget.compare(r.widget)||e>0&&o<=0||n<this.length&&s<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-n),!0)}domAtPos(e){return e==0?gr.before(this.dom):gr.after(this.dom,e==this.length)}split(e){let n=this.length-e;this.length=e;let r=new ds(this.widget,n,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return c0}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):Zt.empty}domBoundsAround(){return null}become(e){return e instanceof ds&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,n){return this.widget.coordsAt(this.dom,e,n)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:n,endSide:r}=this.deco;return n==r?!1:e<0?n<0:r>0}}class yi{eq(e){return!1}updateDOM(e,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Pr=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(Pr||(Pr={}));class Ue extends pl{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new sf(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new bs(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:o,end:s}=BE(e,n);r=(o?n?-3e8:-1:5e8)-1,i=(s?n?2e8:1:-6e8)+1}return new bs(e,r,i,n,e.widget||null,!0)}static line(e){return new lf(e)}static set(e,n=!1){return Dt.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ue.none=Dt.empty;class sf extends Ue{constructor(e){let{start:n,end:r}=BE(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var n,r;return this==e||e instanceof sf&&this.tagName==e.tagName&&(this.class||((n=this.attrs)===null||n===void 0?void 0:n.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&f0(this.attrs,e.attrs,"class")}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}}sf.prototype.point=!1;class lf extends Ue{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof lf&&this.spec.class==e.spec.class&&f0(this.spec.attributes,e.spec.attributes)}range(e,n=e){if(n!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,n)}}lf.prototype.mapMode=Un.TrackBefore;lf.prototype.point=!0;class bs extends Ue{constructor(e,n,r,i,o,s){super(n,r,o,e),this.block=i,this.isReplace=s,this.mapMode=i?n<=0?Un.TrackBefore:Un.TrackAfter:Un.TrackDel}get type(){return this.startSide!=this.endSide?Pr.WidgetRange:this.startSide<=0?Pr.WidgetBefore:Pr.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof bs&&gN(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,n=e){if(this.isReplace&&(e>n||e==n&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&n!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,n)}}bs.prototype.point=!0;function BE(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function gN(t,e){return t==e||!!(t&&e&&t.compare(e))}function uv(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class uc{constructor(e,n,r,i){this.doc=e,this.pos=n,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=n}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof ds&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Bn),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Vf(new La(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof ds)&&this.getLine()}buildText(e,n,r){for(;e>0;){if(this.textOff==this.text.length){let{value:o,lineBreak:s,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(s){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=o,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(Vf(new Qo(this.text.slice(this.textOff,this.textOff+i)),n),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,n,r,i){this.buildText(n-e,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}point(e,n,r,i,o,s){if(this.disallowBlockEffectsFor[s]&&r instanceof bs){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=n-e;if(r instanceof bs)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ds(r.widget||new qS("div"),l,r));else{let a=ts.create(r.widget||new qS("span"),l,l?0:r.startSide),u=this.atCursorPos&&!a.isEditable&&o<=i.length&&(e<n||r.startSide>0),c=!a.isEditable&&(e<n||o>i.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!u&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),u&&(f.append(Vf(new La(1),i),o),o=i.length+Math.max(0,o-i.length)),f.append(Vf(a,i),o),this.atCursorPos=c,this.pendingBuffer=c?e<n||o>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}static build(e,n,r,i,o){let s=new uc(e,n,r,o);return s.openEnd=Dt.spans(i,n,r,s),s.openStart<0&&(s.openStart=s.openEnd),s.finish(s.openEnd),s}}function Vf(t,e){for(let n of e)t=new Ao(n,[t],t.length);return t}class qS extends yi{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}var Sn=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(Sn||(Sn={}));const ml=Sn.LTR,h0=Sn.RTL;function XE(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const mN=XE("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),ON=XE("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),cv=Object.create(null),Bi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);cv[e]=n,cv[n]=-e}function YE(t){return t<=247?mN[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?ON[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const vN=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class ns{get dir(){return this.level%2?h0:ml}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let o=-1;for(let s=0;s<e.length;s++){let l=e[s];if(l.from<=n&&l.to>=n){if(l.level==r)return s;(o<0||(i!=0?i<0?l.from<n:l.to>n:e[o].level>l.level))&&(o=s)}}if(o<0)throw new RangeError("Index out of range");return o}}function UE(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!UE(r.inner,i.inner))return!1}return!0}const Kt=[];function yN(t,e,n,r,i){for(let o=0;o<=r.length;o++){let s=o?r[o-1].to:e,l=o<r.length?r[o].from:n,a=o?256:i;for(let u=s,c=a,f=a;u<l;u++){let h=YE(t.charCodeAt(u));h==512?h=c:h==8&&f==4&&(h=16),Kt[u]=h==4?2:h,h&7&&(f=h),c=h}for(let u=s,c=a,f=a;u<l;u++){let h=Kt[u];if(h==128)u<l-1&&c==Kt[u+1]&&c&24?h=Kt[u]=c:Kt[u]=256;else if(h==64){let d=u+1;for(;d<l&&Kt[d]==64;)d++;let p=u&&c==8||d<n&&Kt[d]==8?f==1?1:8:256;for(let g=u;g<d;g++)Kt[g]=p;u=d-1}else h==8&&f==1&&(Kt[u]=1);c=h,h&7&&(f=h)}}}function SN(t,e,n,r,i){let o=i==1?2:1;for(let s=0,l=0,a=0;s<=r.length;s++){let u=s?r[s-1].to:e,c=s<r.length?r[s].from:n;for(let f=u,h,d,p;f<c;f++)if(d=cv[h=t.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(Bi[g+1]==-d){let O=Bi[g+2],v=O&2?i:O&4?O&1?o:i:0;v&&(Kt[f]=Kt[Bi[g]]=v),l=g;break}}else{if(Bi.length==189)break;Bi[l++]=f,Bi[l++]=h,Bi[l++]=a}else if((p=Kt[f])==2||p==1){let g=p==i;a=g?0:1;for(let O=l-3;O>=0;O-=3){let v=Bi[O+2];if(v&2)break;if(g)Bi[O+2]|=2;else{if(v&4)break;Bi[O+2]|=4}}}}}function bN(t,e,n,r){for(let i=0,o=r;i<=n.length;i++){let s=i?n[i-1].to:t,l=i<n.length?n[i].from:e;for(let a=s;a<l;){let u=Kt[a];if(u==256){let c=a+1;for(;;)if(c==l){if(i==n.length)break;c=n[i++].to,l=i<n.length?n[i].from:e}else if(Kt[c]==256)c++;else break;let f=o==1,h=(c<e?Kt[c]:r)==1,d=f==h?f?1:2:r;for(let p=c,g=i,O=g?n[g-1].to:t;p>a;)p==O&&(p=n[--g].from,O=g?n[g-1].to:t),Kt[--p]=d;a=c}else o=u,a++}}}function fv(t,e,n,r,i,o,s){let l=r%2?2:1;if(r%2==i%2)for(let a=e,u=0;a<n;){let c=!0,f=!1;if(u==o.length||a<o[u].from){let g=Kt[a];g!=l&&(c=!1,f=g==16)}let h=!c&&l==1?[]:null,d=c?r:r+1,p=a;e:for(;;)if(u<o.length&&p==o[u].from){if(f)break e;let g=o[u];if(!c)for(let O=g.to,v=u+1;;){if(O==n)break e;if(v<o.length&&o[v].from==O)O=o[v++].to;else{if(Kt[O]==l)break e;break}}if(u++,h)h.push(g);else{g.from>a&&s.push(new ns(a,g.from,d));let O=g.direction==ml!=!(d%2);hv(t,O?r+1:r,i,g.inner,g.from,g.to,s),a=g.to}p=g.to}else{if(p==n||(c?Kt[p]!=l:Kt[p]==l))break;p++}h?fv(t,a,p,r+1,i,h,s):a<p&&s.push(new ns(a,p,d)),a=p}else for(let a=n,u=o.length;a>e;){let c=!0,f=!1;if(!u||a>o[u-1].to){let g=Kt[a-1];g!=l&&(c=!1,f=g==16)}let h=!c&&l==1?[]:null,d=c?r:r+1,p=a;e:for(;;)if(u&&p==o[u-1].to){if(f)break e;let g=o[--u];if(!c)for(let O=g.from,v=u;;){if(O==e)break e;if(v&&o[v-1].to==O)O=o[--v].from;else{if(Kt[O-1]==l)break e;break}}if(h)h.push(g);else{g.to<a&&s.push(new ns(g.to,a,d));let O=g.direction==ml!=!(d%2);hv(t,O?r+1:r,i,g.inner,g.from,g.to,s),a=g.from}p=g.from}else{if(p==e||(c?Kt[p-1]!=l:Kt[p-1]==l))break;p--}h?fv(t,p,a,r+1,i,h,s):p<a&&s.push(new ns(p,a,d)),a=p}}function hv(t,e,n,r,i,o,s){let l=e%2?2:1;yN(t,i,o,r,l),SN(t,i,o,r,l),bN(i,o,r,l),fv(t,i,o,e,n,r,s)}function wN(t,e,n){if(!t)return[new ns(0,0,e==h0?1:0)];if(e==ml&&!n.length&&!vN.test(t))return FE(t.length);if(n.length)for(;t.length>Kt.length;)Kt[Kt.length]=256;let r=[],i=e==ml?0:1;return hv(t,i,i,n,0,t.length,r),r}function FE(t){return[new ns(0,t,0)]}let qE="";function kN(t,e,n,r,i){var o;let s=r.head-t.from,l=ns.find(e,s,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc),a=e[l],u=a.side(i,n);if(s==u){let h=l+=i?1:-1;if(h<0||h>=e.length)return null;a=e[l=h],s=a.side(!i,n),u=a.side(i,n)}let c=mr(t.text,s,a.forward(i,n));(c<a.from||c>a.to)&&(c=u),qE=t.text.slice(Math.min(s,c),Math.max(s,c));let f=l==(i?e.length-1:0)?null:e[l+(i?1:-1)];return f&&c==u&&f.level+(i?0:1)<a.level?oe.cursor(f.side(!i,n)+t.from,f.forward(i,n)?1:-1,f.level):oe.cursor(c+t.from,a.forward(i,n)?-1:1,a.level)}function xN(t,e,n){for(let r=e;r<n;r++){let i=YE(t.charCodeAt(r));if(i==1)return ml;if(i==2||i==4)return h0}return ml}const zE=je.define(),VE=je.define(),GE=je.define(),HE=je.define(),dv=je.define(),KE=je.define(),JE=je.define(),eT=je.define({combine:t=>t.some(e=>e)}),tT=je.define({combine:t=>t.some(e=>e)});class ka{constructor(e,n="nearest",r="nearest",i=5,o=5,s=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o,this.isSnapshot=s}map(e){return e.empty?this:new ka(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new ka(oe.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Gf=Ot.define({map:(t,e)=>t.map(e)});function Kr(t,e,n){let r=t.facet(HE);r.length?r[0](e):window.onerror?window.onerror(String(e),n,void 0,void 0,e):n?console.error(n+":",e):console.error(e)}const ug=je.define({combine:t=>t.length?t[0]:!0});let _N=0;const Xu=je.define();class Jt{constructor(e,n,r,i,o){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.extension=o(this)}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:o,decorations:s}=n||{};return new Jt(_N++,e,r,i,l=>{let a=[Xu.of(l)];return s&&a.push(Nc.of(u=>{let c=u.plugin(l);return c?s(c):Ue.none})),o&&a.push(o(l)),a})}static fromClass(e,n){return Jt.define(r=>new e(r),n)}}class em{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Kr(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(n){Kr(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Kr(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const nT=je.define(),d0=je.define(),Nc=je.define(),rT=je.define(),p0=je.define(),iT=je.define();function zS(t,e){let n=t.state.facet(iT);if(!n.length)return n;let r=n.map(o=>o instanceof Function?o(t):o),i=[];return Dt.spans(r,e.from,e.to,{point(){},span(o,s,l,a){let u=o-e.from,c=s-e.from,f=i;for(let h=l.length-1;h>=0;h--,a--){let d=l[h].spec.bidiIsolate,p;if(d==null&&(d=xN(e.text,u,c)),a>0&&f.length&&(p=f[f.length-1]).to==u&&p.direction==d)p.to=c,f=p.inner;else{let g={from:u,to:c,direction:d,inner:[]};f.push(g),f=g.inner}}}}),i}const oT=je.define();function sT(t){let e=0,n=0,r=0,i=0;for(let o of t.state.facet(oT)){let s=o(t);s&&(s.left!=null&&(e=Math.max(e,s.left)),s.right!=null&&(n=Math.max(n,s.right)),s.top!=null&&(r=Math.max(r,s.top)),s.bottom!=null&&(i=Math.max(i,s.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Yu=je.define();class gi{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new gi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,o=0,s=0,l=0;;i++){let a=i==e.length?null:e[i],u=s-l,c=a?a.fromB:1e9;for(;o<n.length&&n[o]<c;){let f=n[o],h=n[o+1],d=Math.max(l,f),p=Math.min(c,h);if(d<=p&&new gi(d+u,p+u,d,p).addToSet(r),h>c)break;o+=2}if(!a)return r;new gi(a.fromA,a.toA,a.fromB,a.toB).addToSet(r),s=a.toA,l=a.toB}}}class dp{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Yn.empty(this.startState.doc.length);for(let o of r)this.changes=this.changes.compose(o.changes);let i=[];this.changes.iterChangedRanges((o,s,l,a)=>i.push(new gi(o,s,l,a))),this.changedRanges=i}static create(e,n,r){return new dp(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class VS extends an{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Bn],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new gi(0,0,0,e.state.doc.length)],0,null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:c})=>c<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let i=-1;this.view.inputState.composing>=0&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!QN(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let o=i>-1?CN(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:u,to:c}=this.hasComposition;r=new gi(u,c,e.changes.mapPos(u,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(ze.ie||ze.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let s=this.decorations,l=this.updateDeco(),a=$N(s,l,e.changes);return r=gi.extendWithRanges(r,a),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,n,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=ze.chrome||ze.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,s),this.flags&=-8,s&&(s.written||i.selectionRange.focusNode!=s.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(s=>s.flags&=-9);let o=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.children)s instanceof ds&&s.widget instanceof GS&&o.push(s.dom);i.updateGaps(o)}updateChildren(e,n,r){let i=r?r.range.addToSet(e.slice()):e,o=this.childCursor(n);for(let s=i.length-1;;s--){let l=s>=0?i[s]:null;if(!l)break;let{fromA:a,toA:u,fromB:c,toB:f}=l,h,d,p,g;if(r&&r.range.fromB<f&&r.range.toB>c){let S=uc.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),k=uc.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);d=S.breakAtStart,p=S.openStart,g=k.openEnd;let P=this.compositionView(r);k.breakAtStart?P.breakAfter=1:k.content.length&&P.merge(P.length,P.length,k.content[0],!1,k.openStart,0)&&(P.breakAfter=k.content[0].breakAfter,k.content.shift()),S.content.length&&P.merge(0,0,S.content[S.content.length-1],!0,0,S.openEnd)&&S.content.pop(),h=S.content.concat(P).concat(k.content)}else({content:h,breakAtStart:d,openStart:p,openEnd:g}=uc.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:O,off:v}=o.findPos(u,1),{i:m,off:y}=o.findPos(a,-1);DE(this,m,y,O,v,h,d,p,g)}r&&this.fixCompositionDOM(r)}compositionView(e){let n=new Qo(e.text.nodeValue);n.flags|=8;for(let{deco:i}of e.marks)n=new Ao(i,[n],n.length);let r=new Bn;return r.append(n,0),r}fixCompositionDOM(e){let n=(o,s)=>{s.flags|=8|(s.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(s);let l=an.get(o);l&&l!=s&&(l.dom=null),s.setDOM(o)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];n(e.line,i);for(let o=e.marks.length-1;o>=-1;o--)r=i.childPos(r.off,1),i=i.children[r.i],n(o>=0?e.marks[o].node:e.text,i)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,o=!i&&Pd(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||n||o))return;let s=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),u=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(ze.gecko&&l.empty&&!this.hasComposition&&PN(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=u=new gr(f,0),s=!0}let c=this.view.observer.selectionRange;(s||!c.focusNode||(!ac(a.node,a.offset,c.anchorNode,c.anchorOffset)||!ac(u.node,u.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,l))&&(this.view.observer.ignore(()=>{ze.android&&ze.chrome&&this.dom.contains(c.focusNode)&&RN(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=hp(this.view.root);if(f)if(l.empty){if(ze.gecko){let h=EN(a.node,a.offset);if(h&&h!=3){let d=aT(a.node,a.offset,h==1?1:-1);d&&(a=new gr(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();l.anchor>l.head&&([a,u]=[u,a]),h.setEnd(u.node,u.offset),h.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(h)}o&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(a,u)),this.impreciseAnchor=a.precise?null:new gr(c.anchorNode,c.anchorOffset),this.impreciseHead=u.precise?null:new gr(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ac(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=hp(e.root),{anchorNode:i,anchorOffset:o}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let s=Bn.find(this,n.head);if(!s)return;let l=s.posAtStart;if(n.head==l||n.head==l+s.length)return;let a=this.coordsAt(n.head,-1),u=this.coordsAt(n.head,1);if(!a||!u||a.bottom>u.top)return;let c=this.domAtPos(n.head+n.assoc);r.collapse(c.node,c.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,o)}moveToLine(e){let n=this.dom,r;if(e.node!=n)return e;for(let i=e.offset;!r&&i<n.childNodes.length;i++){let o=an.get(n.childNodes[i]);o instanceof Bn&&(r=o.domAtPos(0))}for(let i=e.offset-1;!r&&i>=0;i--){let o=an.get(n.childNodes[i]);o instanceof Bn&&(r=o.domAtPos(o.length))}return r?new gr(r.node,r.offset,!0):e}nearest(e){for(let n=e;n;){let r=an.get(n);if(r&&r.rootView==this)return r;n=n.parentNode}return null}posFromDOM(e,n){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,n)+r.posAtStart}domAtPos(e){let{i:n,off:r}=this.childCursor().findPos(e,-1);for(;n<this.children.length-1;){let i=this.children[n];if(r<i.length||i instanceof Bn)break;n++,r=0}return this.children[n].domAtPos(r)}coordsAt(e,n){let r=null,i=0;for(let o=this.length,s=this.children.length-1;s>=0;s--){let l=this.children[s],a=o-l.breakAfter,u=a-l.length;if(a<e)break;u<=e&&(u<e||l.covers(-1))&&(a>e||l.covers(1))&&(!r||l instanceof Bn&&!(r instanceof Bn&&n>=0))&&(r=l,i=u),o=u}return r?r.coordsAt(e-i,n):null}coordsForChar(e){let{i:n,off:r}=this.childPos(e,1),i=this.children[n];if(!(i instanceof Bn))return null;for(;i.children.length;){let{i:l,off:a}=i.childPos(r,1);for(;;l++){if(l==i.children.length)return null;if((i=i.children[l]).length)break}r=a}if(!(i instanceof Qo))return null;let o=mr(i.text,r);if(o==r)return null;let s=gl(i.dom,r,o).getClientRects();for(let l=0;l<s.length;l++){let a=s[l];if(l==s.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,o=this.view.contentDOM.clientWidth,s=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Sn.LTR;for(let u=0,c=0;c<this.children.length;c++){let f=this.children[c],h=u+f.length;if(h>i)break;if(u>=r){let d=f.dom.getBoundingClientRect();if(n.push(d.height),s){let p=f.dom.lastChild,g=p?Mc(p):[];if(g.length){let O=g[g.length-1],v=a?O.right-d.left:d.right-O.left;v>l&&(l=v,this.minWidth=o,this.minWidthFrom=u,this.minWidthTo=h)}}}u=h+f.breakAfter}return n}textDirectionAt(e){let{i:n}=this.childPos(e,1);return getComputedStyle(this.children[n].dom).direction=="rtl"?Sn.RTL:Sn.LTR}measureTextSize(){for(let o of this.children)if(o instanceof Bn){let s=o.measureTextSize();if(s)return s}let e=document.createElement("div"),n,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let o=Mc(e.firstChild)[0];n=e.getBoundingClientRect().height,r=o?o.width/27:7,i=o?o.height:n,e.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}childCursor(e=this.length){let n=this.children.length;return n&&(e-=this.children[--n].length),new ME(this.children,e,n)}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let o=i==n.viewports.length?null:n.viewports[i],s=o?o.from-1:this.length;if(s>r){let l=(n.lineBlockAt(s).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(Ue.replace({widget:new GS(l),block:!0,inclusive:!0,isBlockGap:!0}).range(r,s))}if(!o)break;r=o.to+1}return Ue.set(e)}updateDeco(){let e=this.view.state.facet(Nc).map((i,o)=>(this.dynamicDecorationMap[o]=typeof i=="function")?i(this.view):i),n=!1,r=this.view.state.facet(rT).map((i,o)=>{let s=typeof i=="function";return s&&(n=!0),s?i(this.view):i});r.length&&(this.dynamicDecorationMap[e.length]=n,e.push(Dt.join(r)));for(let i=e.length;i<e.length+3;i++)this.dynamicDecorationMap[i]=!1;return this.decorations=[...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}let{range:n}=e,r=this.coordsAt(n.head,n.empty?n.assoc:n.head>n.anchor?-1:1),i;if(!r)return;!n.empty&&(i=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let o=sT(this.view),s={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;sN(this.view.scrollDOM,s,n.head<n.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,a),-a),this.view.textDirection==Sn.LTR)}}function PN(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}class GS extends yi{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}}function lT(t,e){let n=t.observer.selectionRange,r=n.focusNode&&aT(n.focusNode,n.focusOffset,0);if(!r)return null;let i=e-r.offset;return{from:i,to:i+r.node.nodeValue.length,node:r.node}}function CN(t,e,n){let r=lT(t,n);if(!r)return null;let{node:i,from:o,to:s}=r,l=i.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(r.from,r.to)!=l)return null;let a=e.invertedDesc,u=new gi(a.mapPos(o),a.mapPos(s),o,s),c=[];for(let f=i.parentNode;;f=f.parentNode){let h=an.get(f);if(h instanceof Ao)c.push({node:f,deco:h.mark});else{if(h instanceof Bn||f.nodeName=="DIV"&&f.parentNode==t.contentDOM)return{range:u,text:i,marks:c,line:f};if(f!=t.contentDOM)c.push({node:f,deco:new sf({inclusive:!0,attributes:pN(f),tagName:f.tagName.toLowerCase()})});else return null}}}function aT(t,e,n){if(n<=0)for(let r=t,i=e;;){if(r.nodeType==3)return{node:r,offset:i};if(r.nodeType==1&&i>0)r=r.childNodes[i-1],i=Ro(r);else break}if(n>=0)for(let r=t,i=e;;){if(r.nodeType==3)return{node:r,offset:i};if(r.nodeType==1&&i<r.childNodes.length&&n>=0)r=r.childNodes[i],i=0;else break}return null}function EN(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let TN=class{constructor(){this.changes=[]}compareRange(e,n){uv(e,n,this.changes)}comparePoint(e,n){uv(e,n,this.changes)}};function $N(t,e,n){let r=new TN;return Dt.compare(t,e,n,r),r.changes}function RN(t,e){for(let n=t;n&&n!=e;n=n.assignedSlot||n.parentNode)if(n.nodeType==1&&n.contentEditable=="false")return!0;return!1}function QN(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}function AN(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),o=e-i.from;if(i.length==0)return oe.cursor(e);o==0?n=1:o==i.length&&(n=-1);let s=o,l=o;n<0?s=mr(i.text,o,!1):l=mr(i.text,o);let a=r(i.text.slice(s,l));for(;s>0;){let u=mr(i.text,s,!1);if(r(i.text.slice(u,s))!=a)break;s=u}for(;l<i.length;){let u=mr(i.text,l);if(r(i.text.slice(l,u))!=a)break;l=u}return oe.range(s+i.from,l+i.from)}function MN(t,e){return e.left>t?e.left-t:Math.max(0,t-e.right)}function DN(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function tm(t,e){return t.top<e.bottom-1&&t.bottom>e.top+1}function HS(t,e){return e<t.top?{top:e,left:t.left,right:t.right,bottom:t.bottom}:t}function KS(t,e){return e>t.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function pv(t,e,n){let r,i,o,s,l=!1,a,u,c,f;for(let p=t.firstChild;p;p=p.nextSibling){let g=Mc(p);for(let O=0;O<g.length;O++){let v=g[O];i&&tm(i,v)&&(v=HS(KS(v,i.bottom),i.top));let m=MN(e,v),y=DN(n,v);if(m==0&&y==0)return p.nodeType==3?JS(p,e,n):pv(p,e,n);if(!r||s>y||s==y&&o>m){r=p,i=v,o=m,s=y;let S=y?n<v.top?-1:1:m?e<v.left?-1:1:0;l=!S||(S>0?O<g.length-1:O>0)}m==0?n>v.bottom&&(!c||c.bottom<v.bottom)?(a=p,c=v):n<v.top&&(!f||f.top>v.top)&&(u=p,f=v):c&&tm(c,v)?c=KS(c,v.bottom):f&&tm(f,v)&&(f=HS(f,v.top))}}if(c&&c.bottom>=n?(r=a,i=c):f&&f.top<=n&&(r=u,i=f),!r)return{node:t,offset:0};let h=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return JS(r,h,n);if(l&&r.contentEditable!="false")return pv(r,h,n);let d=Array.prototype.indexOf.call(t.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:t,offset:d}}function JS(t,e,n){let r=t.nodeValue.length,i=-1,o=1e9,s=0;for(let l=0;l<r;l++){let a=gl(t,l,l+1).getClientRects();for(let u=0;u<a.length;u++){let c=a[u];if(c.top==c.bottom)continue;s||(s=e-c.left);let f=(c.top>n?c.top-n:n-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f<o){let h=e>=(c.left+c.right)/2,d=h;if((ze.chrome||ze.gecko)&&gl(t,l).getBoundingClientRect().left==c.right&&(d=!h),f<=0)return{node:t,offset:l+(d?1:0)};i=l+(d?1:0),o=f}}}return{node:t,offset:i>-1?i:s>0?t.nodeValue.length:0}}function uT(t,e,n,r=-1){var i,o;let s=t.contentDOM.getBoundingClientRect(),l=s.top+t.viewState.paddingTop,a,{docHeight:u}=t.viewState,{x:c,y:f}=e,h=f-l;if(h<0)return 0;if(h>u)return t.state.doc.length;for(let S=t.viewState.heightOracle.textHeight/2,k=!1;a=t.elementAtHeight(h),a.type!=Pr.Text;)for(;h=r>0?a.bottom+S:a.top-S,!(h>=0&&h<=u);){if(k)return n?null:0;k=!0,r=-r}f=l+h;let d=a.from;if(d<t.viewport.from)return t.viewport.from==0?0:n?null:eb(t,s,a,c,f);if(d>t.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:n?null:eb(t,s,a,c,f);let p=t.dom.ownerDocument,g=t.root.elementFromPoint?t.root:p,O=g.elementFromPoint(c,f);O&&!t.contentDOM.contains(O)&&(O=null),O||(c=Math.max(s.left+1,Math.min(s.right-1,c)),O=g.elementFromPoint(c,f),O&&!t.contentDOM.contains(O)&&(O=null));let v,m=-1;if(O&&((i=t.docView.nearest(O))===null||i===void 0?void 0:i.isEditable)!=!1){if(p.caretPositionFromPoint){let S=p.caretPositionFromPoint(c,f);S&&({offsetNode:v,offset:m}=S)}else if(p.caretRangeFromPoint){let S=p.caretRangeFromPoint(c,f);S&&({startContainer:v,startOffset:m}=S,(!t.contentDOM.contains(v)||ze.safari&&NN(v,m,c)||ze.chrome&&jN(v,m,c))&&(v=void 0))}}if(!v||!t.docView.dom.contains(v)){let S=Bn.find(t.docView,d);if(!S)return h>a.top+a.height/2?a.to:a.from;({node:v,offset:m}=pv(S.dom,c,f))}let y=t.docView.nearest(v);if(!y)return null;if(y.isWidget&&((o=y.dom)===null||o===void 0?void 0:o.nodeType)==1){let S=y.dom.getBoundingClientRect();return e.y<S.top||e.y<=S.bottom&&e.x<=(S.left+S.right)/2?y.posAtStart:y.posAtEnd}else return y.localPosFromDOM(v,m)+y.posAtStart}function eb(t,e,n,r,i){let o=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((i-n.top-(t.defaultLineHeight-l)*.5)/l);o+=a*t.viewState.heightOracle.lineLength}let s=t.state.sliceDoc(n.from,n.to);return n.from+ev(s,o,t.state.tabSize)}function NN(t,e,n){let r;if(t.nodeType!=3||e!=(r=t.nodeValue.length))return!1;for(let i=t.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return gl(t,r-1,r).getBoundingClientRect().left>n}function jN(t,e,n){if(e!=0)return!1;for(let i=t;;){let o=i.parentNode;if(!o||o.nodeType!=1||o.firstChild!=i)return!1;if(o.classList.contains("cm-line"))break;i=o}let r=t.nodeType==1?t.getBoundingClientRect():gl(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return n-r.left>5}function gv(t,e){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){for(let r of n.type)if(r.to>e||r.to==e&&(r.to==n.to||r.type==Pr.Text))return r}return n}function IN(t,e,n,r){let i=gv(t,e.head),o=!r||i.type!=Pr.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(o){let s=t.dom.getBoundingClientRect(),l=t.textDirectionAt(i.from),a=t.posAtCoords({x:n==(l==Sn.LTR)?s.right-1:s.left+1,y:(o.top+o.bottom)/2});if(a!=null)return oe.cursor(a,n?-1:1)}return oe.cursor(n?i.to:i.from,n?-1:1)}function tb(t,e,n,r){let i=t.state.doc.lineAt(e.head),o=t.bidiSpans(i),s=t.textDirectionAt(i.from);for(let l=e,a=null;;){let u=kN(i,o,s,l,n),c=qE;if(!u){if(i.number==(n?t.state.doc.lines:1))return l;c=`
75
- `,i=t.state.doc.line(i.number+(n?1:-1)),o=t.bidiSpans(i),u=t.visualLineSide(i,!n)}if(a){if(!a(c))return l}else{if(!r)return u;a=r(c)}l=u}}function LN(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return o=>{let s=r(o);return i==mn.Space&&(i=s),i==s}}function ZN(t,e,n,r){let i=e.head,o=n?1:-1;if(i==(n?t.state.doc.length:0))return oe.cursor(i,e.assoc);let s=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(i,e.assoc||-1),c=t.documentTop;if(u)s==null&&(s=u.left-a.left),l=o<0?u.top:u.bottom;else{let d=t.viewState.lineBlockAt(i);s==null&&(s=Math.min(a.right-a.left,t.defaultCharacterWidth*(i-d.from))),l=(o<0?d.top:d.bottom)+c}let f=a.left+s,h=r??t.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(h+d)*o,g=uT(t,{x:f,y:p},!1,o);if(p<a.top||p>a.bottom||(o<0?g<i:g>i)){let O=t.docView.coordsForChar(g),v=!O||p<O.top?-1:1;return oe.cursor(g,v,void 0,s)}}}function Cd(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(o,s,l)=>{if(e>o&&e<s){let a=r||n||(e-o<s-e?-1:1);e=a<0?o:s,r=a}});if(!r)return e}}function nm(t,e,n){let r=Cd(t.state.facet(p0).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:oe.cursor(r,r<n.from?1:-1)}class WN{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ze.safari&&e.contentDOM.addEventListener("input",()=>null),ze.gecko&&rj(e.contentDOM.ownerDocument)}handleEvent(e){!VN(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,n){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=BN(e),r=this.handlers,i=this.view.contentDOM;for(let o in n)if(o!="scroll"){let s=!n[o].handlers.length,l=r[o];l&&s!=!l.handlers.length&&(i.removeEventListener(o,this.handleEvent),l=null),l||i.addEventListener(o,this.handleEvent,{passive:s})}for(let o in r)o!="scroll"&&!n[o]&&i.removeEventListener(o,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(e.keyCode!=27&&fT.indexOf(e.keyCode)<0&&(this.view.inputState.lastEscPress=0),ze.android&&ze.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let n;return ze.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((n=cT.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||XN.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=n||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,wa(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:ze.safari&&!ze.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function nb(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Kr(n.state,i)}}}function BN(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec;if(i&&i.domEventHandlers)for(let o in i.domEventHandlers){let s=i.domEventHandlers[o];s&&n(o).handlers.push(nb(r.value,s))}if(i&&i.domEventObservers)for(let o in i.domEventObservers){let s=i.domEventObservers[o];s&&n(o).observers.push(nb(r.value,s))}}for(let r in ji)n(r).handlers.push(ji[r]);for(let r in Ii)n(r).observers.push(Ii[r]);return e}const cT=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],XN="dthko",fT=[16,17,18,20,91,92,224,225],Hf=6;function Kf(t){return Math.max(0,t)*.7+8}function YN(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class UN{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParent=lN(e.contentDOM),this.atoms=e.state.facet(p0).map(s=>s(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Mt.allowMultipleSelections)&&FN(e,n),this.dragging=zN(e,n)&&gT(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var n;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&YN(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let r=0,i=0,o=((n=this.scrollParent)===null||n===void 0?void 0:n.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},s=sT(this.view);e.clientX-s.left<=o.left+Hf?r=-Kf(o.left-e.clientX):e.clientX+s.right>=o.right-Hf&&(r=Kf(e.clientX-o.right)),e.clientY-s.top<=o.top+Hf?i=-Kf(o.top-e.clientY):e.clientY+s.bottom>=o.bottom-Hf&&(i=Kf(e.clientY-o.bottom)),this.setScrollSpeed(r,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,n){this.scrollSpeed={x:e,y:n},e||n?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],o=null;if(i.empty){let s=Cd(this.atoms,i.from,0);s!=i.from&&(o=oe.cursor(s,-1))}else{let s=Cd(this.atoms,i.from,-1),l=Cd(this.atoms,i.to,1);(s!=i.from||l!=i.to)&&(o=oe.range(i.from==i.anchor?s:l,i.from==i.head?s:l))}o&&(n||(n=e.ranges.slice()),n[r]=o)}return n?oe.create(n,e.mainIndex):e}select(e){let{view:n}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function FN(t,e){let n=t.state.facet(zE);return n.length?n[0](e):ze.mac?e.metaKey:e.ctrlKey}function qN(t,e){let n=t.state.facet(VE);return n.length?n[0](e):ze.mac?!e.altKey:!e.ctrlKey}function zN(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=hp(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let o=0;o<i.length;o++){let s=i[o];if(s.left<=e.clientX&&s.right>=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}function VN(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=an.get(n))&&r.ignoreEvent(e))return!1;return!0}const ji=Object.create(null),Ii=Object.create(null),hT=ze.ie&&ze.ie_version<15||ze.ios&&ze.webkit_version<604;function GN(t){let e=t.dom.parentNode;if(!e)return;let n=e.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout(()=>{t.focus(),n.remove(),dT(t,n.value)},50)}function dT(t,e){let{state:n}=t,r,i=1,o=n.toText(e),s=o.lines==n.selection.ranges.length;if(mv!=null&&n.selection.ranges.every(a=>a.empty)&&mv==o.toString()){let a=-1;r=n.changeByRange(u=>{let c=n.doc.lineAt(u.from);if(c.from==a)return{range:u};a=c.from;let f=n.toText((s?o.line(i++).text:e)+n.lineBreak);return{changes:{from:c.from,insert:f},range:oe.cursor(u.from+f.length)}})}else s?r=n.changeByRange(a=>{let u=o.line(i++);return{changes:{from:a.from,to:a.to,insert:u.text},range:oe.cursor(a.from+u.length)}}):r=n.replaceSelection(o);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Ii.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};ji.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&(t.inputState.lastEscPress=Date.now()),!1);Ii.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Ii.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};ji.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(GE))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=JN(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new UN(t,e,n,r)),r&&t.observer.ignore(()=>RE(t.contentDOM));let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function rb(t,e,n,r){if(r==1)return oe.cursor(e,n);if(r==2)return AN(t.state,e,n);{let i=Bn.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e),s=i?i.posAtStart:o.from,l=i?i.posAtEnd:o.to;return l<t.state.doc.length&&l==o.to&&l++,oe.range(s,l)}}let pT=(t,e)=>t>=e.top&&t<=e.bottom,ib=(t,e,n)=>pT(e,n)&&t>=n.left&&t<=n.right;function HN(t,e,n,r){let i=Bn.find(t.docView,e);if(!i)return 1;let o=e-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;let s=i.coordsAt(o,-1);if(s&&ib(n,r,s))return-1;let l=i.coordsAt(o,1);return l&&ib(n,r,l)?1:s&&pT(r,s)?-1:1}function ob(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:n,bias:HN(t,n,e.clientX,e.clientY)}}const KN=ze.ie&&ze.ie_version<=11;let sb=null,lb=0,ab=0;function gT(t){if(!KN)return t.detail;let e=sb,n=ab;return sb=t,ab=Date.now(),lb=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(lb+1)%3:1}function JN(t,e){let n=ob(t,e),r=gT(e),i=t.state.selection;return{update(o){o.docChanged&&(n.pos=o.changes.mapPos(n.pos),i=i.map(o.changes))},get(o,s,l){let a=ob(t,o),u,c=rb(t,a.pos,a.bias,r);if(n.pos!=a.pos&&!s){let f=rb(t,n.pos,n.bias,r),h=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=h<c.from?oe.range(h,d):oe.range(d,h)}return s?i.replaceRange(i.main.extend(c.from,c.to)):l&&r==1&&i.ranges.length>1&&(u=ej(i,a.pos))?u:l?i.addRange(c):oe.create([c])}}}function ej(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return oe.create(t.ranges.slice(0,n).concat(t.ranges.slice(n+1)),t.mainIndex==n?0:t.mainIndex-(t.mainIndex>n?1:0))}return null}ji.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.nearest(e.target);if(i&&i.isWidget){let o=i.posAtStart,s=o+i.length;(o>=n.to||s<=n.from)&&(n=oe.range(o,s))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(n.from,n.to)),e.dataTransfer.effectAllowed="copyMove"),!1};ji.dragend=t=>(t.inputState.draggedContent=null,!1);function ub(t,e,n,r){if(!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=t.inputState,s=r&&o&&qN(t,e)?{from:o.from,to:o.to}:null,l={from:i,insert:n},a=t.state.changes(s?[s,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(i,-1),head:a.mapPos(i,1)},userEvent:s?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ji.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,o=()=>{++i==n.length&&ub(t,e,r.filter(s=>s!=null).join(t.state.lineBreak),!1)};for(let s=0;s<n.length;s++){let l=new FileReader;l.onerror=o,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(r[s]=l.result),o()},l.readAsText(n[s])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return ub(t,e,r,!0),!0}return!1};ji.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=hT?null:e.clipboardData;return n?(dT(t,n.getData("text/plain")||n.getData("text/uri-text")),!0):(GN(t),!1)};function tj(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function nj(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:o}of t.selection.ranges){let s=t.doc.lineAt(o);s.number>i&&(e.push(s.text),n.push({from:s.from,to:Math.min(t.doc.length,s.to+1)})),i=s.number}r=!0}return{text:e.join(t.lineBreak),ranges:n,linewise:r}}let mv=null;ji.copy=ji.cut=(t,e)=>{let{text:n,ranges:r,linewise:i}=nj(t.state);if(!n&&!i)return!1;mv=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let o=hT?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",n),!0):(tj(t,n),!1)};const mT=fo.define();function OT(t,e){let n=[];for(let r of t.facet(JE)){let i=r(t,e);i&&n.push(i)}return n?t.update({effects:n,annotations:mT.of(!0)}):null}function vT(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=OT(t.state,e);n?t.dispatch(n):t.update([])}},10)}Ii.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),vT(t)};Ii.blur=t=>{t.observer.clearSelectionRange(),vT(t)};Ii.compositionstart=Ii.compositionupdate=t=>{t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0)};Ii.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,ze.chrome&&ze.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50)};Ii.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ji.beforeinput=(t,e)=>{var n;let r;if(ze.chrome&&ze.android&&(r=cT.find(i=>i.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let i=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return!1};const cb=new Set;function rj(t){cb.has(t)||(cb.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const fb=["pre-wrap","normal","pre-line","break-spaces"];class ij{constructor(e){this.lineWrapping=e,this.doc=Zt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return fb.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,o,s){let l=fb.indexOf(e)>-1,a=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,a){this.heightSamples={};for(let u=0;u<s.length;u++){let c=s[u];c<0?u++:this.heightSamples[Math.floor(c*10)]=!0}}return a}}class oj{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class ro{constructor(e,n,r,i,o){this.from=e,this.length=n,this.top=r,this.height=i,this._content=o}get type(){return typeof this._content=="number"?Pr.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof bs?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let n=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ro(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var ln=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(ln||(ln={}));const Ed=.001;class Cr{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,n){this.height!=n&&(Math.abs(this.height-n)>Ed&&(e.heightChanged=!0),this.height=n)}replace(e,n,r){return Cr.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let o=this,s=r.doc;for(let l=i.length-1;l>=0;l--){let{fromA:a,toA:u,fromB:c,toB:f}=i[l],h=o.lineAt(a,ln.ByPosNoHeight,r.setDoc(n),0,0),d=h.to>=u?h:o.lineAt(u,ln.ByPosNoHeight,r,0,0);for(f+=d.to-u,u=d.to;l>0&&h.from<=i[l-1].toA;)a=i[l-1].fromA,c=i[l-1].fromB,l--,a<h.from&&(h=o.lineAt(a,ln.ByPosNoHeight,r,0,0));c+=h.from-a,a=h.from;let p=g0.build(r.setDoc(s),e,c,f);o=o.replace(a,u,p)}return o.updateHeight(r,0)}static empty(){return new Fr(0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,o=0;for(;;)if(n==r)if(i>o*2){let l=e[n-1];l.break?e.splice(--n,1,l.left,null,l.right):e.splice(--n,1,l.left,l.right),r+=1+l.break,i-=l.size}else if(o>i*2){let l=e[r];l.break?e.splice(r,1,l.left,null,l.right):e.splice(r,1,l.left,l.right),r+=2+l.break,o-=l.size}else break;else if(i<o){let l=e[n++];l&&(i+=l.size)}else{let l=e[--r];l&&(o+=l.size)}let s=0;return e[n-1]==null?(s=1,n--):e[n]==null&&(s=1,r++),new sj(Cr.of(e.slice(0,n)),s,Cr.of(e.slice(r)))}}Cr.prototype.size=1;class yT extends Cr{constructor(e,n,r){super(e,n),this.deco=r}blockAt(e,n,r,i){return new ro(i,this.length,r,this.height,this.deco||0)}lineAt(e,n,r,i,o){return this.blockAt(0,r,i,o)}forEachLine(e,n,r,i,o,s){e<=o+this.length&&n>=o&&s(this.blockAt(0,r,i,o))}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more&&this.setHeight(e,i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Fr extends yT{constructor(e,n){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,n,r,i){return new ro(i,this.length,r,this.height,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof Fr||i instanceof rr&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof rr?i=new Fr(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):Cr.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setHeight(e,i.heights[i.index++]):(r||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class rr extends Cr{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,o=i-r+1,s,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*o);s=a/o,this.length>o+1&&(l=(this.height-a)/(this.length-o-1))}else s=this.height/o;return{firstLine:r,lastLine:i,perLine:s,perChar:l}}blockAt(e,n,r,i){let{firstLine:o,lastLine:s,perLine:l,perChar:a}=this.heightMetrics(n,i);if(n.lineWrapping){let u=i+Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length),c=n.doc.lineAt(u),f=l+c.length*a,h=Math.max(r,e-f/2);return new ro(c.from,c.length,h,f,0)}else{let u=Math.max(0,Math.min(s-o,Math.floor((e-r)/l))),{from:c,length:f}=n.doc.line(o+u);return new ro(c,f,r+l*u,l,0)}}lineAt(e,n,r,i,o){if(n==ln.ByHeight)return this.blockAt(e,r,i,o);if(n==ln.ByPosNoHeight){let{from:d,to:p}=r.doc.lineAt(e);return new ro(d,p-d,0,0,0)}let{firstLine:s,perLine:l,perChar:a}=this.heightMetrics(r,o),u=r.doc.lineAt(e),c=l+u.length*a,f=u.number-s,h=i+l*f+a*(u.from-o-f);return new ro(u.from,u.length,Math.max(i,Math.min(h,i+this.height-c)),c,0)}forEachLine(e,n,r,i,o,s){e=Math.max(e,o),n=Math.min(n,o+this.length);let{firstLine:l,perLine:a,perChar:u}=this.heightMetrics(r,o);for(let c=e,f=i;c<=n;){let h=r.doc.lineAt(c);if(c==e){let p=h.number-l;f+=a*p+u*(e-o-p)}let d=a+u*h.length;s(new ro(h.from,h.length,f,d,0)),f+=d,c=h.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let o=r[r.length-1];o instanceof rr?r[r.length-1]=new rr(o.length+i):r.push(null,new rr(i-1))}if(e>0){let o=r[0];o instanceof rr?r[0]=new rr(e+o.length):r.unshift(new rr(e-1),null)}return Cr.of(r)}decomposeLeft(e,n){n.push(new rr(e-1),null)}decomposeRight(e,n){n.push(null,new rr(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let o=n+this.length;if(i&&i.from<=n+this.length&&i.more){let s=[],l=Math.max(n,i.from),a=-1;for(i.from>n&&s.push(new rr(i.from-n-1).updateHeight(e,n));l<=o&&i.more;){let c=e.doc.lineAt(l).length;s.length&&s.push(null);let f=i.heights[i.index++];a==-1?a=f:Math.abs(f-a)>=Ed&&(a=-2);let h=new Fr(c,f);h.outdated=!1,s.push(h),l+=c+1}l<=o&&s.push(null,new rr(o-l).updateHeight(e,l));let u=Cr.of(s);return(a<0||Math.abs(u.height-this.height)>=Ed||Math.abs(a-this.heightMetrics(e,n).perLine)>=Ed)&&(e.heightChanged=!0),u}else(r||this.outdated)&&(this.setHeight(e,e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class sj extends Cr{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let o=r+this.left.height;return e<o?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,o,i+this.left.length+this.break)}lineAt(e,n,r,i,o){let s=i+this.left.height,l=o+this.left.length+this.break,a=n==ln.ByHeight?e<s:e<l,u=a?this.left.lineAt(e,n,r,i,o):this.right.lineAt(e,n,r,s,l);if(this.break||(a?u.to<l:u.from>l))return u;let c=n==ln.ByPosNoHeight?ln.ByPosNoHeight:ln.ByPos;return a?u.join(this.right.lineAt(l,c,r,s,l)):this.left.lineAt(l,c,r,i,o).join(u)}forEachLine(e,n,r,i,o,s){let l=i+this.left.height,a=o+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,r,i,o,s),n>=a&&this.right.forEachLine(e,n,r,l,a,s);else{let u=this.lineAt(a,ln.ByPos,r,i,o);e<u.from&&this.left.forEachLine(e,u.from-1,r,i,o,s),u.to>=e&&u.from<=n&&s(u),n>u.to&&this.right.forEachLine(u.to+1,n,r,l,a,s)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let o=[];e>0&&this.decomposeLeft(e,o);let s=o.length;for(let l of r)o.push(l);if(e>0&&hb(o,s-1),n<this.length){let l=o.length;this.decomposeRight(n,o),hb(o,l)}return Cr.of(o)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Cr.of(this.break?[e,null,n]:[e,n]):(this.left=e,this.right=n,this.height=e.height+n.height,this.outdated=e.outdated||n.outdated,this.size=e.size+n.size,this.length=e.length+this.break+n.length,this)}updateHeight(e,n=0,r=!1,i){let{left:o,right:s}=this,l=n+o.length+this.break,a=null;return i&&i.from<=n+o.length&&i.more?a=o=o.updateHeight(e,n,r,i):o.updateHeight(e,n,r),i&&i.from<=l+s.length&&i.more?a=s=s.updateHeight(e,l,r,i):s.updateHeight(e,l,r),a?this.balanced(o,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function hb(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof rr&&(r=t[e+1])instanceof rr&&t.splice(e-1,3,new rr(n.length+1+r.length))}const lj=5;class g0{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Fr?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Fr(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,o=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let s=n-e;r.block?this.addBlock(new yT(s,i,r)):(s||o||i>=lj)&&this.addLineDeco(i,o,s)}else n>e&&this.span(e,n);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:n}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=n,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Fr(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,n){let r=new rr(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Fr)return e;let n=new Fr(0,-1);return this.nodes.push(n),n}addBlock(e){this.enterLine();let n=e.deco;n&&n.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,n&&n.endSide>0&&(this.covering=e)}addLineDeco(e,n,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Fr)&&!this.isCovered?this.nodes.push(new Fr(0,-1)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Fr&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let o=new g0(r,e);return Dt.spans(n,r,i,o,0),o.finish(r)}}function aj(t,e,n){let r=new uj;return Dt.compare(t,e,n,r,0),r.changes}class uj{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&uv(e,n,this.changes,5)}}function cj(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,o=Math.max(0,n.left),s=Math.min(i.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(i.innerHeight,n.bottom);for(let u=t.parentNode;u&&u!=r.body;)if(u.nodeType==1){let c=u,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let h=c.getBoundingClientRect();o=Math.max(o,h.left),s=Math.min(s,h.right),l=Math.max(l,h.top),a=u==t.parentNode?h.bottom:Math.min(a,h.bottom)}u=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:o-n.left,right:Math.max(o,s)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function fj(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class rm{constructor(e,n,r){this.from=e,this.to=n,this.size=r}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],o=n[r];if(i.from!=o.from||i.to!=o.to||i.size!=o.size)return!1}return!0}draw(e,n){return Ue.replace({widget:new hj(this.size*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class hj extends yi{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class db{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=pb,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Sn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let n=e.facet(d0).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new ij(n),this.stateDeco=e.facet(Nc).filter(r=>typeof r!="function"),this.heightMap=Cr.empty().applyChanges(this.stateDeco,Zt.empty,this.heightOracle.setDoc(e.doc),[new gi(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ue.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:o,to:s})=>i>=o&&i<=s)){let{from:o,to:s}=this.lineBlockAt(i);e.push(new Jf(o,s))}}this.viewports=e.sort((r,i)=>r.from-i.from),this.scaler=this.heightMap.height<=7e6?pb:new gj(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Uu(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(Nc).filter(c=>typeof c!="function");let i=e.changedRanges,o=gi.extendWithRanges(i,aj(r,this.stateDeco,e?e.changes:Yn.empty(this.state.doc.length))),s=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=s&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<a.from||n.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,n));let u=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),u&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(tT)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?Sn.RTL:Sn.LTR;let s=this.heightOracle.mustRefreshForWrapping(o),l=n.getBoundingClientRect(),a=s||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,c=0;if(l.width&&l.height){let{scaleX:S,scaleY:k}=$E(n,l);(this.scaleX!=S||this.scaleY!=k)&&(this.scaleX=S,this.scaleY=k,u|=8,s=a=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,h=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,u|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=8);let d=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=AE(e.scrollDOM);let p=(this.printing?fj:cj)(n,this.paddingTop),g=p.top-this.pixelViewport.top,O=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let v=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(v!=this.inView&&(this.inView=v,v&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let m=l.width;if((this.contentDOMWidth!=m||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=8),a){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(s=!0),s||i.lineWrapping&&Math.abs(m-this.contentDOMWidth)>i.charWidth){let{lineHeight:k,charWidth:P,textHeight:C}=e.docView.measureTextSize();s=k>0&&i.refresh(o,k,P,C,m/P,S),s&&(e.docView.minWidth=0,u|=8)}g>0&&O>0?c=Math.max(g,O):g<0&&O<0&&(c=Math.min(g,O)),i.heightChanged=!1;for(let k of this.viewports){let P=k.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(k);this.heightMap=(s?Cr.empty().applyChanges(this.stateDeco,Zt.empty,this.heightOracle,[new gi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,s,new oj(k.from,P))}i.heightChanged&&(u|=2)}let y=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return y&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(u&2||y)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,o=this.heightOracle,{visibleTop:s,visibleBottom:l}=this,a=new Jf(i.lineAt(s-r*1e3,ln.ByHeight,o,0,0).from,i.lineAt(l+(1-r)*1e3,ln.ByHeight,o,0,0).to);if(n){let{head:u}=n.range;if(u<a.from||u>a.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(u,ln.ByPos,o,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-c/2:n.y=="start"||n.y=="nearest"&&u<a.from?h=f.top:h=f.bottom-c,a=new Jf(i.lineAt(h-1e3/2,ln.ByHeight,o,0,0).from,i.lineAt(h+c+1e3/2,ln.ByHeight,o,0,0).to)}}return a}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new Jf(this.heightMap.lineAt(r,ln.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,ln.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,ln.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(n,ln.ByPos,this.heightOracle,0,0),{visibleTop:s,visibleBottom:l}=this;return(e==0||i<=s-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||o>=l+Math.max(10,Math.min(r,250)))&&i>s-2*1e3&&o<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new rm(n.mapPos(i.from),n.mapPos(i.to),i.size));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,o=i>>1,s=i<<1;if(this.defaultTextDirection!=Sn.LTR&&!r)return[];let l=[],a=(u,c,f,h)=>{if(c-u<o)return;let d=this.state.selection.main,p=[d.from];d.empty||p.push(d.to);for(let O of p)if(O>u&&O<c){a(u,O-10,f,h),a(O+10,c,f,h);return}let g=pj(e,O=>O.from>=f.from&&O.to<=f.to&&Math.abs(O.from-u)<o&&Math.abs(O.to-c)<o&&!p.some(v=>O.from<v&&O.to>v));if(!g){if(c<f.to&&n&&r&&n.visibleRanges.some(O=>O.from<=c&&O.to>=c)){let O=n.moveToLineBoundary(oe.cursor(c),!1,!0).head;O>u&&(c=O)}g=new rm(u,c,this.gapSize(f,u,c,h))}l.push(g)};for(let u of this.viewportLines){if(u.length<s)continue;let c=dj(u.from,u.to,this.stateDeco);if(c.total<s)continue;let f=this.scrollTarget?this.scrollTarget.range.head:null,h,d;if(r){let p=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,g,O;if(f!=null){let v=th(c,f),m=((this.visibleBottom-this.visibleTop)/2+p)/u.height;g=v-m,O=v+m}else g=(this.visibleTop-u.top-p)/u.height,O=(this.visibleBottom-u.top+p)/u.height;h=eh(c,g),d=eh(c,O)}else{let p=c.total*this.heightOracle.charWidth,g=i*this.heightOracle.charWidth,O,v;if(f!=null){let m=th(c,f),y=((this.pixelViewport.right-this.pixelViewport.left)/2+g)/p;O=m-y,v=m+y}else O=(this.pixelViewport.left-g)/p,v=(this.pixelViewport.right+g)/p;h=eh(c,O),d=eh(c,v)}h>u.from&&a(u.from,h,u,c),d<u.to&&a(d,u.to,u,c)}return l}gapSize(e,n,r,i){let o=th(i,r)-th(i,n);return this.heightOracle.lineWrapping?e.height*o:i.total*this.heightOracle.charWidth*o}updateLineGaps(e){rm.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Ue.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let n=[];Dt.spans(e,this.viewport.from,this.viewport.to,{span(i,o){n.push({from:i,to:o})},point(){}},20);let r=n.length!=this.visibleRanges.length||this.visibleRanges.some((i,o)=>i.from!=n[o].from||i.to!=n[o].to);return this.visibleRanges=n,r?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Uu(this.heightMap.lineAt(e,ln.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Uu(this.heightMap.lineAt(this.scaler.fromDOM(e),ln.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Uu(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Jf{constructor(e,n){this.from=e,this.to=n}}function dj(t,e,n){let r=[],i=t,o=0;return Dt.spans(n,t,e,{span(){},point(s,l){s>i&&(r.push({from:i,to:s}),o+=s-i),i=l}},20),i<e&&(r.push({from:i,to:e}),o+=e-i),{total:o,ranges:r}}function eh({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:o,to:s}=e[i],l=s-o;if(r<=l)return o+r;r-=l}}function th(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function pj(t,e){for(let n of t)if(e(n))return n}const pb={toDOM(t){return t},fromDOM(t){return t},scale:1};class gj{constructor(e,n,r){let i=0,o=0,s=0;this.viewports=r.map(({from:l,to:a})=>{let u=n.lineAt(l,ln.ByPos,e,0,0).top,c=n.lineAt(a,ln.ByPos,e,0,0).bottom;return i+=c-u,{from:l,to:a,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let l of this.viewports)l.domTop=s+(l.top-o)*this.scale,s=l.domBottom=l.domTop+(l.bottom-l.top),o=l.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.top)return i+(e-r)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);r=o.bottom,i=o.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let o=n<this.viewports.length?this.viewports[n]:null;if(!o||e<o.domTop)return r+(e-i)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);r=o.bottom,i=o.domBottom}}}function Uu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new ro(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Uu(i,e)):t._content)}const nh=je.define({combine:t=>t.join(" ")}),Ov=je.define({combine:t=>t.indexOf(!0)>-1}),vv=ys.newName(),ST=ys.newName(),bT=ys.newName(),wT={"&light":"."+ST,"&dark":"."+bT};function yv(t,e,n){return new ys(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const mj=yv("."+vv,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},wT),Fu="￿";class Oj{constructor(e,n){this.points=e,this.text="",this.lineSeparator=n.facet(Mt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Fu}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let o=this.text.length;this.readNode(i);let s=i.nextSibling;if(s==n)break;let l=an.get(i),a=an.get(s);(l&&a?l.breakAfter:(l?l.breakAfter:gb(i))||gb(s)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>o)&&this.lineBreak(),i=s}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,s=1,l;if(this.lineSeparator?(o=n.indexOf(this.lineSeparator,r),s=this.lineSeparator.length):(l=i.exec(n))&&(o=l.index,s=l[0].length),this.append(n.slice(r,o<0?n.length:o)),o<0)break;if(this.lineBreak(),s>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=s-1);r=o+s}}readNode(e){if(e.cmIgnore)return;let n=an.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(vj(e,r.node,r.offset)?n:0))}}function vj(t,e,n){for(;;){if(!e||n<Ro(e))return!1;if(e==t)return!0;n=Dc(e)+1,e=e.parentNode}}function gb(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}class mb{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class yj{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="";let{impreciseHead:o,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=e.docView.domBoundsAround(n,r,0))){let l=o||s?[]:wj(e),a=new Oj(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=kj(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=o&&o.node==l.focusNode&&o.offset==l.focusOffset||!rv(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!rv(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=e.viewport;if(ze.ios&&e.state.selection.main.empty&&a!=u&&(c.from>0||c.to<e.state.doc.length)){let f=c.from-Math.min(a,u),h=c.to-Math.max(a,u);(f==0||f==1)&&(h==0||h==-1)&&(a=0,u=e.state.doc.length)}this.newSel=oe.single(u,a)}}}function kT(t,e){let n,{newSel:r}=e,i=t.state.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:l}=e.bounds,a=i.from,u=null;(o===8||ze.android&&e.text.length<l-s)&&(a=i.to,u="end");let c=bj(t.state.doc.sliceString(s,l,Fu),e.text,a-s,u);c&&(ze.chrome&&o==13&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==Fu+Fu&&c.toB--,n={from:s+c.from,to:s+c.toA,insert:Zt.of(e.text.slice(c.from,c.toB).split(Fu))})}else r&&(!t.hasFocus&&t.state.facet(ug)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&e.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,i.to)}:n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:t.state.doc.slice(i.from,n.from).append(n.insert).append(t.state.doc.slice(n.to,i.to))}:(ze.mac||ze.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=oe.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Zt.of([" "])}):ze.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==`
76
- `&&t.lineWrapping&&(r&&(r=oe.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Zt.of([" "])}),n){if(ze.ios&&t.inputState.flushIOSKey()||ze.android&&(n.from==i.from&&n.to==i.to&&n.insert.length==1&&n.insert.lines==2&&wa(t.contentDOM,"Enter",13)||(n.from==i.from-1&&n.to==i.to&&n.insert.length==0||o==8&&n.insert.length<n.to-n.from&&n.to>i.head)&&wa(t.contentDOM,"Backspace",8)||n.from==i.from&&n.to==i.to+1&&n.insert.length==0&&wa(t.contentDOM,"Delete",46)))return!0;let s=n.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let l,a=()=>l||(l=Sj(t,n,r));return t.state.facet(KE).some(u=>u(t,n.from,n.to,s,a))||t.dispatch(a()),!0}else if(r&&!r.main.eq(i)){let s=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(s=!0),l=t.inputState.lastSelectionOrigin),t.dispatch({selection:r,scrollIntoView:s,userEvent:l}),!0}else return!1}function Sj(t,e,n){let r,i=t.state,o=i.selection.main;if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let l=o.from<e.from?i.sliceDoc(o.from,e.from):"",a=o.to>e.to?i.sliceDoc(e.to,o.to):"";r=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+a))}else{let l=i.changes(e),a=n&&n.main.to<=l.newLength?n.main:void 0;if(i.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=o.to&&e.to>=o.to-10){let u=t.state.sliceDoc(e.from,e.to),c,f=n&&lT(t,n.main.head);if(f){let p=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-p}}else c=t.state.doc.lineAt(o.head);let h=o.to-e.to,d=o.to-o.from;r=i.changeByRange(p=>{if(p.from==o.from&&p.to==o.to)return{changes:l,range:a||p.map(l)};let g=p.to-h,O=g-u.length;if(p.to-p.from!=d||t.state.sliceDoc(O,g)!=u||p.to>=c.from&&p.from<=c.to)return{range:p};let v=i.changes({from:O,to:g,insert:e.insert}),m=p.to-o.to;return{changes:v,range:a?oe.range(Math.max(0,a.anchor+m),Math.max(0,a.head+m)):p.map(v)}})}else r={changes:l,selection:a&&i.selection.replaceRange(a)}}let s="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,s+=".compose",t.inputState.compositionFirstChange&&(s+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:s,scrollIntoView:!0})}function bj(t,e,n,r){let i=Math.min(t.length,e.length),o=0;for(;o<i&&t.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==i&&t.length==e.length)return null;let s=t.length,l=e.length;for(;s>0&&l>0&&t.charCodeAt(s-1)==e.charCodeAt(l-1);)s--,l--;if(r=="end"){let a=Math.max(0,o-Math.min(s,l));n-=s+a-o}if(s<o&&t.length<e.length){let a=n<=o&&n>=s?o-n:0;o-=a,l=o+(l-s),s=o}else if(l<o){let a=n<=o&&n>=l?o-n:0;o-=a,s=o+(s-l),l=o}return{from:o,toA:s,toB:l}}function wj(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}=t.observer.selectionRange;return n&&(e.push(new mb(n,r)),(i!=n||o!=r)&&e.push(new mb(i,o))),e}function kj(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?oe.single(n+e,r+e):null}const xj={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},im=ze.ie&&ze.ie_version<=11;class _j{constructor(e){this.view=e,this.active=!1,this.selectionRange=new aN,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let r of n)this.queue.push(r);(ze.ie&&ze.ie_version<=11||ze.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),im&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var n;((n=this.view.docView)===null||n===void 0?void 0:n.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(n=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),n.length>0&&n[n.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(n=>{n.length>0&&n[n.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(ug)?r.root.activeElement!=this.dom:!Pd(r.dom,i))return;let o=i.anchorNode&&r.docView.nearest(i.anchorNode);if(o&&o.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ze.ie&&ze.ie_version<=11||ze.android&&ze.chrome)&&!r.state.selection.main.empty&&i.focusNode&&ac(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=ze.safari&&e.root.nodeType==11&&iN(this.dom.ownerDocument)==this.dom&&Pj(this.view)||hp(e.root);if(!n||this.selectionRange.eq(n))return!1;let r=Pd(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&cN(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,xj),im&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),im&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&wa(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let o of e){let s=this.readMutation(o);s&&(s.typeOver&&(i=!0),n==-1?{from:n,to:r}=s:(n=Math.min(s.from,n),r=Math.max(s.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&Pd(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new yj(this.view,e,n,r);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let r=this.view.state,i=kT(this.view,n);return this.view.state==r&&this.view.update([]),i}readMutation(e){let n=this.view.docView.nearest(e.target);if(!n||n.ignoreMutation(e))return null;if(n.markDirty(e.type=="attributes"),e.type=="attributes"&&(n.flags|=4),e.type=="childList"){let r=Ob(n,e.previousSibling||e.target.previousSibling,-1),i=Ob(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function Ob(t,e,n){for(;e;){let r=an.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Pj(t){let e=null;function n(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),!e)return null;let r=e.startContainer,i=e.startOffset,o=e.endContainer,s=e.endOffset,l=t.docView.domAtPos(t.state.selection.main.anchor);return ac(l.node,l.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}class $e{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(i=>n(i,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||uN(e.parent)||document,this.viewState=new db(e.state||Mt.create(e)),e.scrollTo&&e.scrollTo.is(Gf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Xu).map(r=>new em(r));for(let r of this.plugins)r.update(this);this.observer=new _j(this),this.inputState=new WN(this),this.inputState.ensureHandlers(this.plugins),this.docView=new VS(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let n=e.length==1&&e[0]instanceof Nn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,o=this.state;for(let h of e){if(h.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=h.state}if(this.destroyed){this.viewState.state=o;return}let s=this.hasFocus,l=0,a=null;e.some(h=>h.annotation(mT))?(this.inputState.notifiedFocused=s,l=1):s!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=s,a=OT(o,s),a||(l=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(c=null)):this.observer.clear(),o.facet(Mt.phrases)!=this.state.facet(Mt.phrases))return this.setState(o);i=dp.create(this,o,e),i.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let h of e){if(f&&(f=f.map(h.changes)),h.scrollIntoView){let{main:d}=h.state.selection;f=new ka(d.empty?d:oe.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of h.effects)d.is(Gf)&&(f=d.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=pp.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Yu)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(nh)!=i.state.facet(nh)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!i.empty)for(let h of this.state.facet(dv))try{h(i)}catch(d){Kr(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!kT(this,c)&&u.force&&wa(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let n=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new db(e),this.plugins=e.facet(Xu).map(r=>new em(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new VS(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}updatePlugins(e){let n=e.startState.facet(Xu),r=e.state.facet(Xu);if(n!=r){let i=[];for(let o of r){let s=n.indexOf(o);if(s<0)i.push(new em(o));else{let l=this.plugins[s];l.mustUpdate=e,i.push(l)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:o,scrollAnchorHeight:s}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(s=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(s<0)if(AE(r))o=-1,s=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(i);o=d.from,s=d.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];a&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(d=>{try{return d.read(this)}catch(p){return Kr(this.state,p),vb}}),f=dp.create(this,this.state,[]),h=!1;f.flags|=a,n?n.flags|=a:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),h=this.docView.update(f));for(let d=0;d<u.length;d++)if(c[d]!=vb)try{let p=u[d];p.write&&p.write(c[d],this)}catch(p){Kr(this.state,p)}if(h&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,s=-1;continue}else{let p=(o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-s;if(p>1||p<-1){i=i+p,r.scrollTop=i/this.scaleY,s=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(dv))l(n)}get themeClasses(){return vv+" "+(this.state.facet(Ov)?bT:ST)+" "+this.state.facet(nh)}updateAttrs(){let e=yb(this,nT,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(ug)?"true":"false",class:"cm-content",style:`${ze.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),yb(this,d0,n);let r=this.observer.ignore(()=>{let i=av(this.contentDOM,this.contentAttrs,n),o=av(this.dom,this.editorAttrs,e);return i||o});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is($e.announce)){n&&(this.announceDOM.textContent=""),n=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Yu);let e=this.state.facet($e.cspNonce);ys.mount(this.root,this.styleModules.concat(mj).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let n=0;n<this.measureRequests.length;n++)if(this.measureRequests[n].key===e.key){this.measureRequests[n]=e;return}}this.measureRequests.push(e)}}plugin(e){let n=this.pluginMap.get(e);return(n===void 0||n&&n.spec!=e)&&this.pluginMap.set(e,n=this.plugins.find(r=>r.spec==e)||null),n&&n.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,n,r){return nm(this,e,tb(this,e,n,r))}moveByGroup(e,n){return nm(this,e,tb(this,e,n,r=>LN(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),o=r[n?r.length-1:0];return oe.cursor(o.side(n,i)+e.from,o.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return IN(this,e,n,r)}moveVertically(e,n,r){return nm(this,e,ZN(this,e,n,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){return this.readMeasured(),uT(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),o=this.bidiSpans(i),s=o[ns.find(o,e-i.from,-1,n)];return u0(r,s.dir==Sn.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(eT)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Cj)return FE(e.length);let n=this.textDirectionAt(e.from),r;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==n&&(o.fresh||UE(o.isolates,r=zS(this,e))))return o.order;r||(r=zS(this,e));let i=wN(e.text,n,r);return this.bidiCache.push(new pp(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ze.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{RE(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){return Gf.of(new ka(typeof e=="number"?oe.cursor(e):e,n.y,n.x,n.yMargin,n.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Gf.of(new ka(oe.cursor(r.from),"start","start",r.top-e,n,!0))}static domEventHandlers(e){return Jt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Jt.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=ys.newName(),i=[nh.of(r),Yu.of(yv(`.${r}`,e))];return n&&n.dark&&i.push(Ov.of(!0)),i}static baseTheme(e){return Cs.lowest(Yu.of(yv("."+vv,e,wT)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&an.get(r)||an.get(e);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}$e.styleModule=Yu;$e.inputHandler=KE;$e.focusChangeEffect=JE;$e.perLineTextDirection=eT;$e.exceptionSink=HE;$e.updateListener=dv;$e.editable=ug;$e.mouseSelectionStyle=GE;$e.dragMovesSelection=VE;$e.clickAddsSelectionRange=zE;$e.decorations=Nc;$e.outerDecorations=rT;$e.atomicRanges=p0;$e.bidiIsolatedRanges=iT;$e.scrollMargins=oT;$e.darkTheme=Ov;$e.cspNonce=je.define({combine:t=>t.length?t[0]:""});$e.contentAttributes=d0;$e.editorAttributes=nT;$e.lineWrapping=$e.contentAttributes.of({class:"cm-lineWrapping"});$e.announce=Ot.define();const Cj=4096,vb={};class pp{constructor(e,n,r,i,o,s){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=o,this.order=s}static update(e,n){if(n.empty&&!e.some(o=>o.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Sn.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let s=e[o];s.dir==i&&!n.touchesRange(s.from,s.to)&&r.push(new pp(n.mapPos(s.from,1),n.mapPos(s.to,-1),s.dir,s.isolates,!1,s.order))}return r}}function yb(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let o=r[i],s=typeof o=="function"?o(t):o;s&&lv(s,n)}return n}const Ej=ze.mac?"mac":ze.windows?"win":ze.linux?"linux":"key";function Tj(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,o,s,l;for(let a=0;a<n.length-1;++a){const u=n[a];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))i=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))e=="mac"?l=!0:o=!0;else throw new Error("Unrecognized modifier name: "+u)}return i&&(r="Alt-"+r),o&&(r="Ctrl-"+r),l&&(r="Meta-"+r),s&&(r="Shift-"+r),r}function rh(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const $j=Cs.default($e.domEventHandlers({keydown(t,e){return _T(xT(e.state),t,e,"editor")}})),af=je.define({enables:$j}),Sb=new WeakMap;function xT(t){let e=t.facet(af),n=Sb.get(e);return n||Sb.set(e,n=Aj(e.reduce((r,i)=>r.concat(i),[]))),n}function Rj(t,e,n){return _T(xT(t.state),e,t,n)}let Go=null;const Qj=4e3;function Aj(t,e=Ej){let n=Object.create(null),r=Object.create(null),i=(s,l)=>{let a=r[s];if(a==null)r[s]=l;else if(a!=l)throw new Error("Key binding "+s+" is used both as a regular binding and as a multi-stroke prefix")},o=(s,l,a,u,c)=>{var f,h;let d=n[s]||(n[s]=Object.create(null)),p=l.split(/ (?!$)/).map(v=>Tj(v,e));for(let v=1;v<p.length;v++){let m=p.slice(0,v).join(" ");i(m,!0),d[m]||(d[m]={preventDefault:!0,stopPropagation:!1,run:[y=>{let S=Go={view:y,prefix:m,scope:s};return setTimeout(()=>{Go==S&&(Go=null)},Qj),!0}]})}let g=p.join(" ");i(g,!1);let O=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((h=(f=d._any)===null||f===void 0?void 0:f.run)===null||h===void 0?void 0:h.slice())||[]});a&&O.run.push(a),u&&(O.preventDefault=!0),c&&(O.stopPropagation=!0)};for(let s of t){let l=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let u of l){let c=n[u]||(n[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(s.any)}let a=s[e]||s.key;if(a)for(let u of l)o(u,a,s.run,s.preventDefault,s.stopPropagation),s.shift&&o(u,"Shift-"+a,s.shift,s.preventDefault,s.stopPropagation)}return n}function _T(t,e,n,r){let i=rN(e),o=ir(i,0),s=ui(o)==i.length&&i!=" ",l="",a=!1,u=!1,c=!1;Go&&Go.view==n&&Go.scope==r&&(l=Go.prefix+" ",fT.indexOf(e.keyCode)<0&&(u=!0,Go=null));let f=new Set,h=O=>{if(O){for(let v of O.run)if(!f.has(v)&&(f.add(v),v(n,e)))return O.stopPropagation&&(c=!0),!0;O.preventDefault&&(O.stopPropagation&&(c=!0),u=!0)}return!1},d=t[r],p,g;return d&&(h(d[l+rh(i,e,!s)])?a=!0:s&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ze.windows&&e.ctrlKey&&e.altKey)&&(p=Ss[e.keyCode])&&p!=i?(h(d[l+rh(p,e,!0)])||e.shiftKey&&(g=Ac[e.keyCode])!=i&&g!=p&&h(d[l+rh(g,e,!1)]))&&(a=!0):s&&e.shiftKey&&h(d[l+rh(i,e,!0)])&&(a=!0),!a&&h(d._any)&&(a=!0)),u&&(a=!0),a&&c&&e.stopPropagation(),a}class uf{constructor(e,n,r,i,o){this.className=e,this.left=n,this.top=r,this.width=i,this.height=o}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let o=PT(e);return[new uf(n,i.left-o.left,i.top-o.top,null,i.bottom-i.top)]}else return Mj(e,n,r)}}function PT(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Sn.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function bb(t,e,n){let r=oe.cursor(e);return{from:Math.max(n.from,t.moveToLineBoundary(r,!1,!0).from),to:Math.min(n.to,t.moveToLineBoundary(r,!0,!0).from),type:Pr.Text}}function Mj(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),o=t.textDirection==Sn.LTR,s=t.contentDOM,l=s.getBoundingClientRect(),a=PT(t),u=s.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),h=l.right-(c?parseInt(c.paddingRight):0),d=gv(t,r),p=gv(t,i),g=d.type==Pr.Text?d:null,O=p.type==Pr.Text?p:null;if(g&&(t.lineWrapping||d.widgetLineBreaks)&&(g=bb(t,r,g)),O&&(t.lineWrapping||p.widgetLineBreaks)&&(O=bb(t,i,O)),g&&O&&g.from==O.from)return m(y(n.from,n.to,g));{let k=g?y(n.from,null,g):S(d,!1),P=O?y(null,n.to,O):S(p,!0),C=[];return(g||d).to<(O||p).from-(g&&O?1:0)||d.widgetLineBreaks>1&&k.bottom+t.defaultLineHeight/2<P.top?C.push(v(f,k.bottom,h,P.top)):k.bottom<P.top&&t.elementAtHeight((k.bottom+P.top)/2).type==Pr.Text&&(k.bottom=P.top=(k.bottom+P.top)/2),m(k).concat(C).concat(m(P))}function v(k,P,C,w){return new uf(e,k-a.left,P-a.top-.01,C-k,w-P+.01)}function m({top:k,bottom:P,horizontal:C}){let w=[];for(let x=0;x<C.length;x+=2)w.push(v(C[x],k,C[x+1],P));return w}function y(k,P,C){let w=1e9,x=-1e9,_=[];function E(W,G,M,L,N){let Y=t.coordsAtPos(W,W==C.to?-2:2),q=t.coordsAtPos(M,M==C.from?2:-2);!Y||!q||(w=Math.min(Y.top,q.top,w),x=Math.max(Y.bottom,q.bottom,x),N==Sn.LTR?_.push(o&&G?f:Y.left,o&&L?h:q.right):_.push(!o&&L?f:q.left,!o&&G?h:Y.right))}let $=k??C.from,j=P??C.to;for(let W of t.visibleRanges)if(W.to>$&&W.from<j)for(let G=Math.max(W.from,$),M=Math.min(W.to,j);;){let L=t.state.doc.lineAt(G);for(let N of t.bidiSpans(L)){let Y=N.from+L.from,q=N.to+L.from;if(Y>=M)break;q>G&&E(Math.max(Y,G),k==null&&Y<=$,Math.min(q,M),P==null&&q>=j,N.dir)}if(G=L.to+1,G>=M)break}return _.length==0&&E($,k==null,j,P==null,t.textDirection),{top:w,bottom:x,horizontal:_}}function S(k,P){let C=l.top+(P?k.top:k.bottom);return{top:C,bottom:C,horizontal:[]}}}function Dj(t,e){return t.constructor==e.constructor&&t.eq(e)}class Nj{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(Td)!=e.state.facet(Td)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let n=0,r=e.facet(Td);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!Dj(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Td=je.define();function CT(t){return[Jt.define(e=>new Nj(e,t)),Td.of(t)]}const ET=!ze.ios,jc=je.define({combine(t){return Li(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function jj(t={}){return[jc.of(t),Ij,Lj,Zj,tT.of(!0)]}function TT(t){return t.startState.facet(jc)!=t.state.facet(jc)}const Ij=CT({above:!0,markers(t){let{state:e}=t,n=e.facet(jc),r=[];for(let i of e.selection.ranges){let o=i==e.selection.main;if(i.empty?!o||ET:n.drawRangeCursor){let s=o?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=i.empty?i:oe.cursor(i.head,i.head>i.anchor?-1:1);for(let a of uf.forRange(t,s,l))r.push(a)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=TT(t);return n&&wb(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){wb(e.state,t)},class:"cm-cursorLayer"});function wb(t,e){e.style.animationDuration=t.facet(jc).cursorBlinkRate+"ms"}const Lj=CT({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:uf.forRange(t,"cm-selectionBackground",e)).reduce((e,n)=>e.concat(n))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||TT(t)},class:"cm-selectionLayer"}),Sv={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};ET&&(Sv[".cm-line"].caretColor="transparent !important",Sv[".cm-content"]={caretColor:"transparent !important"});const Zj=Cs.highest($e.theme(Sv)),$T=Ot.define({map(t,e){return t==null?null:e.mapPos(t)}}),qu=zn.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is($T)?r.value:n,t)}}),Wj=Jt.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(qu);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(qu)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(qu),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(qu)!=t&&this.view.dispatch({effects:$T.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Bj(){return[qu,Wj]}function kb(t,e,n,r,i){e.lastIndex=0;for(let o=t.iterRange(n,r),s=n,l;!o.next().done;s+=o.value.length)if(!o.lineBreak)for(;l=e.exec(o.value);)i(s+l.index,l)}function Xj(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:o}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),o=Math.min(t.state.doc.lineAt(o).to,o+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=o:r.push({from:i,to:o});return r}class Yj{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:o,maxLength:s=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(l,a,u,c)=>i(c,u,u+l[0].length,l,a);else if(typeof r=="function")this.addMatch=(l,a,u,c)=>{let f=r(l,a,u);f&&c(u,u+l[0].length,f)};else if(r)this.addMatch=(l,a,u,c)=>c(u,u+l[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=o,this.maxLength=s}createDeco(e){let n=new vs,r=n.add.bind(n);for(let{from:i,to:o}of Xj(e,this.maxLength))kb(e.state.doc,this.regexp,i,o,(s,l)=>this.addMatch(l,e,s,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((o,s,l,a)=>{a>e.view.viewport.from&&l<e.view.viewport.to&&(r=Math.min(l,r),i=Math.max(a,i))}),e.viewportChanged||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let o of e.visibleRanges){let s=Math.max(o.from,r),l=Math.min(o.to,i);if(l>s){let a=e.state.doc.lineAt(s),u=a.to<l?e.state.doc.lineAt(l):a,c=Math.max(o.from,a.from),f=Math.min(o.to,u.to);if(this.boundary){for(;s>a.from;s--)if(this.boundary.test(a.text[s-1-a.from])){c=s;break}for(;l<u.to;l++)if(this.boundary.test(u.text[l-u.from])){f=l;break}}let h=[],d,p=(g,O,v)=>h.push(v.range(g,O));if(a==u)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.index<f-a.from;)this.addMatch(d,e,d.index+a.from,p);else kb(e.state.doc,this.regexp,c,f,(g,O)=>this.addMatch(O,e,g,p));n=n.update({filterFrom:c,filterTo:f,filter:(g,O)=>g<c||O>f,add:h})}}return n}}const bv=/x/.unicode!=null?"gu":"g",Uj=new RegExp(`[\0-\b
77
- --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,bv),Fj={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let om=null;function qj(){var t;if(om==null&&typeof document<"u"&&document.body){let e=document.body.style;om=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return om||!1}const $d=je.define({combine(t){let e=Li(t,{render:null,specialChars:Uj,addSpecialChars:null});return(e.replaceTabs=!qj())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,bv)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,bv)),e}});function zj(t={}){return[$d.of(t),Vj()]}let xb=null;function Vj(){return xb||(xb=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=Ue.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet($d)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Yj({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,o=ir(e[0],0);if(o==9){let s=i.lineAt(r),l=n.state.tabSize,a=Ni(s.text,l,r-s.from);return Ue.replace({widget:new Jj((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[o]||(this.decorationCache[o]=Ue.replace({widget:new Kj(t,o)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet($d);t.startState.facet($d)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const Gj="•";function Hj(t){return t>=32?Gj:t==10?"␤":String.fromCharCode(9216+t)}class Kj extends yi{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=Hj(this.code),r=e.state.phrase("Control character")+" "+(Fj[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let o=document.createElement("span");return o.textContent=n,o.title=r,o.setAttribute("aria-label",r),o.className="cm-specialChar",o}ignoreEvent(){return!1}}class Jj extends yi{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function eI(){return nI}const tI=Ue.line({class:"cm-activeLine"}),nI=Jt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(tI.range(i.from)),e=i.from)}return Ue.set(n)}},{decorations:t=>t.decorations}),wv=2e3;function rI(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[];if(e.off>wv||n.off>wv||e.col<0||n.col<0){let s=Math.min(e.off,n.off),l=Math.max(e.off,n.off);for(let a=r;a<=i;a++){let u=t.doc.line(a);u.length<=l&&o.push(oe.range(u.from+s,u.to+l))}}else{let s=Math.min(e.col,n.col),l=Math.max(e.col,n.col);for(let a=r;a<=i;a++){let u=t.doc.line(a),c=ev(u.text,s,t.tabSize,!0);if(c<0)o.push(oe.cursor(u.to));else{let f=ev(u.text,l,t.tabSize);o.push(oe.range(u.from+c,u.from+f))}}}return o}function iI(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function _b(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,o=i>wv?-1:i==r.length?iI(t,e.clientX):Ni(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function oI(t,e){let n=_b(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let o=i.changes.mapPos(i.startState.doc.line(n.line).from),s=i.state.doc.lineAt(o);n={line:s.number,col:n.col,off:Math.min(n.off,s.length)},r=r.map(i.changes)}},get(i,o,s){let l=_b(t,i);if(!l)return r;let a=rI(t.state,n,l);return a.length?s?oe.create(a.concat(r.ranges)):oe.create(a):r}}:null}function sI(t){let e=(t==null?void 0:t.eventFilter)||(n=>n.altKey&&n.button==0);return $e.mouseSelectionStyle.of((n,r)=>e(r)?oI(n,r):null)}const lI={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},aI={style:"cursor: crosshair"};function uI(t={}){let[e,n]=lI[t.key||"Alt"],r=Jt.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,$e.contentAttributes.of(i=>{var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?aI:null})]}const wu="-10000px";class RT{constructor(e,n,r){this.facet=n,this.createTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(i=>i),this.tooltipViews=this.tooltips.map(r)}update(e,n){var r;let i=e.state.facet(this.facet),o=i.filter(a=>a);if(i===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let s=[],l=n?[]:null;for(let a=0;a<o.length;a++){let u=o[a],c=-1;if(u){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==u.create&&(c=f)}if(c<0)s[a]=this.createTooltipView(u),l&&(l[a]=!!u.above);else{let f=s[a]=this.tooltipViews[c];l&&(l[a]=n[c]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)s.indexOf(a)<0&&(a.dom.remove(),(r=a.destroy)===null||r===void 0||r.call(a));return n&&(l.forEach((a,u)=>n[u]=a),n.length=l.length),this.input=i,this.tooltips=o,this.tooltipViews=s,!0}}function cI(t){let{win:e}=t;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const sm=je.define({combine:t=>{var e,n,r;return{position:ze.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||cI}}}),Pb=new WeakMap,m0=Jt.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(sm);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new RT(t,O0,n=>this.createTooltip(n)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(n=>{Date.now()>this.lastTransaction-50&&n.length>0&&n[n.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let n=e||t.geometryChanged,r=t.state.facet(sm);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t){let e=t.create(this.view);if(e.dom.classList.add("cm-tooltip"),t.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let n=document.createElement("div");n.className="cm-tooltip-arrow",e.dom.appendChild(n)}return e.dom.style.position=this.position,e.dom.style.top=wu,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=this.view.dom.getBoundingClientRect(),e=1,n=1,r=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:i}=this.manager.tooltipViews[0];if(ze.gecko)r=i.offsetParent!=this.container.ownerDocument.body;else if(i.style.top==wu&&i.style.left=="0px"){let o=i.getBoundingClientRect();r=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(r||this.position=="absolute")if(this.parent){let i=this.parent.getBoundingClientRect();i.width&&i.height&&(e=i.width/this.parent.offsetWidth,n=i.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:n}=this.view.viewState);return{editor:t,parent:this.parent?this.container.getBoundingClientRect():t,pos:this.manager.tooltips.map((i,o)=>{let s=this.manager.tooltipViews[o];return s.getCoords?s.getCoords(i.pos):this.view.coordsAtPos(i.pos)}),size:this.manager.tooltipViews.map(({dom:i})=>i.getBoundingClientRect()),space:this.view.state.facet(sm).tooltipSpace(this.view),scaleX:e,scaleY:n,makeAbsolute:r}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:n,space:r,scaleX:i,scaleY:o}=t,s=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],u=this.manager.tooltipViews[l],{dom:c}=u,f=t.pos[l],h=t.size[l];if(!f||f.bottom<=Math.max(n.top,r.top)||f.top>=Math.min(n.bottom,r.bottom)||f.right<Math.max(n.left,r.left)-.1||f.left>Math.min(n.right,r.right)+.1){c.style.top=wu;continue}let d=a.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=h.right-h.left,O=(e=Pb.get(u))!==null&&e!==void 0?e:h.bottom-h.top,v=u.offset||hI,m=this.view.textDirection==Sn.LTR,y=h.width>r.right-r.left?m?r.left:r.right-h.width:m?Math.min(f.left-(d?14:0)+v.x,r.right-g):Math.max(r.left,f.left-g+(d?14:0)-v.x),S=this.above[l];!a.strictSide&&(S?f.top-(h.bottom-h.top)-v.y<r.top:f.bottom+(h.bottom-h.top)+v.y>r.bottom)&&S==r.bottom-f.bottom>f.top-r.top&&(S=this.above[l]=!S);let k=(S?f.top-r.top:r.bottom-f.bottom)-p;if(k<O&&u.resize!==!1){if(k<this.view.defaultLineHeight){c.style.top=wu;continue}Pb.set(u,O),c.style.height=(O=k)/o+"px"}else c.style.height&&(c.style.height="");let P=S?f.top-O-p-v.y:f.bottom+p+v.y,C=y+g;if(u.overlap!==!0)for(let w of s)w.left<C&&w.right>y&&w.top<P+O&&w.bottom>P&&(P=S?w.top-O-2-p:w.bottom+p+2);if(this.position=="absolute"?(c.style.top=(P-t.parent.top)/o+"px",c.style.left=(y-t.parent.left)/i+"px"):(c.style.top=P/o+"px",c.style.left=y/i+"px"),d){let w=f.left+(m?v.x:-v.x)-(y+14-7);d.style.left=w/i+"px"}u.overlap!==!0&&s.push({left:y,top:P,right:C,bottom:P+O}),c.classList.toggle("cm-tooltip-above",S),c.classList.toggle("cm-tooltip-below",!S),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=wu}},{eventObservers:{scroll(){this.maybeMeasure()}}}),fI=$e.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),hI={x:0,y:0},O0=je.define({enables:[m0,fI]}),gp=je.define();class cg{static create(e){return new cg(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new RT(e,gp,n=>this.createHostedView(n))}createHostedView(e){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(n.dom),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const dI=O0.compute([gp],t=>{let e=t.facet(gp).filter(n=>n);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:cg.create,above:e[0].above,arrow:e.some(n=>n.arrow)}});class pI{constructor(e,n,r,i,o){this.view=e,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,r=e.docView.nearest(n.target);if(!r)return;let i,o=1;if(r instanceof ts)i=r.posAtStart;else{if(i=e.posAtCoords(n),i==null)return;let l=e.coordsAtPos(i);if(!l||n.y<l.top||n.y>l.bottom||n.x<l.left-e.defaultCharacterWidth||n.x>l.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),u=a&&a.dir==Sn.RTL?-1:1;o=n.x<l.left?-u:u}let s=this.source(e,i,o);if(s!=null&&s.then){let l=this.pending={pos:i};s.then(a=>{this.pending==l&&(this.pending=null,a&&e.dispatch({effects:this.setHover.of(a)}))},a=>Kr(e.state,a,"hover tooltip"))}else s&&e.dispatch({effects:this.setHover.of(s)})}get tooltip(){let e=this.view.plugin(m0),n=e?e.manager.tooltips.findIndex(r=>r.create==cg.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:i}=this;if(r&&i&&!gI(i.dom,e)||this.pending){let{pos:o}=r||this.pending,s=(n=r==null?void 0:r.end)!==null&&n!==void 0?n:o;(o==s?this.view.posAtCoords(this.lastMove)!=o:!mI(this.view,o,s,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of(null)})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n),this.active&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const ih=4;function gI(t,e){let n=t.getBoundingClientRect();return e.clientX>=n.left-ih&&e.clientX<=n.right+ih&&e.clientY>=n.top-ih&&e.clientY<=n.bottom+ih}function mI(t,e,n,r,i,o){let s=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(s.left>r||s.right<r||s.top>i||Math.min(s.bottom,l)<i)return!1;let a=t.posAtCoords({x:r,y:i},!1);return a>=e&&a<=n}function OI(t,e={}){let n=Ot.define(),r=zn.define({create(){return null},update(i,o){if(i&&(e.hideOnChange&&(o.docChanged||o.selection)||e.hideOn&&e.hideOn(o,i)))return null;if(i&&o.docChanged){let s=o.changes.mapPos(i.pos,-1,Un.TrackDel);if(s==null)return null;let l=Object.assign(Object.create(null),i);l.pos=s,i.end!=null&&(l.end=o.changes.mapPos(i.end)),i=l}for(let s of o.effects)s.is(n)&&(i=s.value),s.is(vI)&&(i=null);return i},provide:i=>gp.from(i)});return[r,Jt.define(i=>new pI(i,t,r,n,e.hoverTime||300)),dI]}function QT(t,e){let n=t.plugin(m0);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const vI=Ot.define(),Cb=je.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Ic(t,e){let n=t.plugin(AT),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const AT=Jt.fromClass(class{constructor(t){this.input=t.state.facet(Lc),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(Cb);this.top=new oh(t,!0,e.topContainer),this.bottom=new oh(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(n=>n.top)),this.bottom.sync(this.panels.filter(n=>!n.top));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(t){let e=t.state.facet(Cb);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new oh(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new oh(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Lc);if(n!=this.input){let r=n.filter(a=>a),i=[],o=[],s=[],l=[];for(let a of r){let u=this.specs.indexOf(a),c;u<0?(c=a(t.view),l.push(c)):(c=this.panels[u],c.update&&c.update(t)),i.push(c),(c.top?o:s).push(c)}this.specs=r,this.panels=i,this.top.sync(o),this.bottom.sync(s);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>$e.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class oh{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=Eb(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=Eb(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Eb(t){let e=t.nextSibling;return t.remove(),e}const Lc=je.define({enables:AT});class ws extends pl{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ws.prototype.elementClass="";ws.prototype.toDOM=void 0;ws.prototype.mapMode=Un.TrackBefore;ws.prototype.startSide=ws.prototype.endSide=-1;ws.prototype.point=!0;const Rd=je.define(),Qd=je.define(),kv=je.define({combine:t=>t.some(e=>e)});function yI(t){let e=[SI];return t&&t.fixed===!1&&e.push(kv.of(!0)),e}const SI=Jt.fromClass(class{constructor(t){this.view=t,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Qd).map(e=>new $b(t,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!t.state.facet(kv),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(n.to-n.from)*.8)}t.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(kv)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&this.dom.remove();let n=Dt.iter(this.view.state.facet(Rd),this.view.viewport.from),r=[],i=this.gutters.map(o=>new bI(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(o.type)){let s=!0;for(let l of o.type)if(l.type==Pr.Text&&s){xv(n,r,l.from);for(let a of i)a.line(this.view,l,r);s=!1}else if(l.widget)for(let a of i)a.widget(this.view,l)}else if(o.type==Pr.Text){xv(n,r,o.from);for(let s of i)s.line(this.view,o,r)}else if(o.widget)for(let s of i)s.widget(this.view,o);for(let o of i)o.finish();t&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(t){let e=t.startState.facet(Qd),n=t.state.facet(Qd),r=t.docChanged||t.heightChanged||t.viewportChanged||!Dt.eq(t.startState.facet(Rd),t.state.facet(Rd),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let o of n){let s=e.indexOf(o);s<0?i.push(new $b(this.view,o)):(this.gutters[s].update(t),i.push(this.gutters[s]))}for(let o of this.gutters)o.dom.remove(),i.indexOf(o)<0&&o.destroy();for(let o of i)this.dom.appendChild(o.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove()}},{provide:t=>$e.scrollMargins.of(e=>{let n=e.plugin(t);return!n||n.gutters.length==0||!n.fixed?null:e.textDirection==Sn.LTR?{left:n.dom.offsetWidth*e.scaleX}:{right:n.dom.offsetWidth*e.scaleX}})});function Tb(t){return Array.isArray(t)?t:[t]}function xv(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class bI{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=Dt.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,o=(n.top-this.height)/e.scaleY,s=n.height/e.scaleY;if(this.i==i.elements.length){let l=new MT(e,s,o,r);i.elements.push(l),i.dom.appendChild(l.dom)}else i.elements[this.i].update(e,s,o,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];xv(this.cursor,i,n.from),r.length&&(i=i.concat(r));let o=this.gutter.config.lineMarker(e,n,i);o&&i.unshift(o);let s=this.gutter;i.length==0&&!s.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n);r&&this.addElement(e,n,[r])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class $b{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let o=i.target,s;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let a=o.getBoundingClientRect();s=(a.top+a.bottom)/2}else s=i.clientY;let l=e.lineBlockAtHeight(s-e.documentTop);n.domEventHandlers[r](e,l,i)&&i.preventDefault()});this.markers=Tb(n.markers(e)),n.initialSpacer&&(this.spacer=new MT(e,0,0,[n.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let n=this.markers;if(this.markers=Tb(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!Dt.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class MT{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),wI(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let o=0,s=0;;){let l=s,a=o<n.length?n[o++]:null,u=!1;if(a){let c=a.elementClass;c&&(r+=" "+c);for(let f=s;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,u=!0;break}}else l=this.markers.length;for(;s<l;){let c=this.markers[s++];if(c.toDOM){c.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!a)break;a.toDOM&&(u?i=i.nextSibling:this.dom.insertBefore(a.toDOM(e),i)),u&&s++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function wI(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const kI=je.define(),fa=je.define({combine(t){return Li(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let o=r[i],s=n[i];r[i]=o?(l,a,u)=>o(l,a,u)||s(l,a,u):s}return r}})}});class lm extends ws{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function am(t,e){return t.state.facet(fa).formatNumber(e,t.state)}const xI=Qd.compute([fa],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(kI)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new lm(am(e,e.state.doc.lineAt(n.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(fa)!=e.state.facet(fa),initialSpacer(e){return new lm(am(e,Rb(e.state.doc.lines)))},updateSpacer(e,n){let r=am(n.view,Rb(n.view.state.doc.lines));return r==e.number?e:new lm(r)},domEventHandlers:t.facet(fa).domEventHandlers}));function _I(t={}){return[fa.of(t),yI(),xI]}function Rb(t){let e=9;for(;e<t;)e=e*10+9;return e}const PI=new class extends ws{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},CI=Rd.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(PI.range(i)))}return Dt.of(e)});function EI(){return CI}const DT=1024;let TI=0;class fi{constructor(e,n){this.from=e,this.to=n}}class dt{constructor(e={}){this.id=TI++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=qn.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}dt.closedBy=new dt({deserialize:t=>t.split(" ")});dt.openedBy=new dt({deserialize:t=>t.split(" ")});dt.group=new dt({deserialize:t=>t.split(" ")});dt.isolate=new dt({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});dt.contextHash=new dt({perNode:!0});dt.lookAhead=new dt({perNode:!0});dt.mounted=new dt({perNode:!0});class Zc{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}static get(e){return e&&e.props&&e.props[dt.mounted.id]}}const $I=Object.create(null);class qn{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):$I,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new qn(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(dt.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(dt.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}qn.none=new qn("",Object.create(null),0,8);class cf{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let o of e){let s=o(r);s&&(i||(i=Object.assign({},r.props)),i[s[0].id]=s[1])}n.push(i?new qn(r.name,i,r.id,r.flags):r)}return new cf(n)}}const sh=new WeakMap,Qb=new WeakMap;var nn;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(nn||(nn={}));class qt{constructor(e,n,r,i,o){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,l]of o)this.props[typeof s=="number"?s:s.id]=l}}toString(){let e=Zc.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new mp(this.topNode,e)}cursorAt(e,n=0,r=0){let i=sh.get(this)||this.topNode,o=new mp(i);return o.moveTo(e,n),sh.set(this,o._tree),o}get topNode(){return new Or(this,0,0,null)}resolve(e,n=0){let r=Wc(sh.get(this)||this.topNode,e,n,!1);return sh.set(this,r),r}resolveInner(e,n=0){let r=Wc(Qb.get(this)||this.topNode,e,n,!0);return Qb.set(this,r),r}resolveStack(e,n=0){return AI(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:o=this.length}=e,s=e.mode||0,l=(s&nn.IncludeAnonymous)>0;for(let a=this.cursor(s|nn.IncludeAnonymous);;){let u=!1;if(a.from<=o&&a.to>=i&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;u=!0}for(;u&&r&&(l||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:S0(qn.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new qt(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new qt(qn.none,n,r,i)))}static build(e){return MI(e)}}qt.empty=new qt(qn.none,[],[],0);class v0{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new v0(this.buffer,this.index)}}class ks{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return qn.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,r==e)return o;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,n,r,i,o){let{buffer:s}=this,l=-1;for(let a=e;a!=n&&!(NT(o,i,s[a+1],s[a+2])&&(l=a,r>0));a=s[a+3]);return l}slice(e,n,r){let i=this.buffer,o=new Uint16Array(n-e),s=0;for(let l=e,a=0;l<n;){o[a++]=i[l++],o[a++]=i[l++]-r;let u=o[a++]=i[l++]-r;o[a++]=i[l++]-e,s=Math.max(s,u)}return new ks(o,s,this.set)}}function NT(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function Wc(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Or&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=r?0:nn.IgnoreOverlays;if(r)for(let s=t,l=s.parent;l;s=l,l=s.parent)s instanceof Or&&s.index<0&&((i=l.enter(e,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=l);for(;;){let s=t.enter(e,n,o);if(!s)return t;t=s}}class jT{cursor(e=0){return new mp(this,e)}getChild(e,n=null,r=null){let i=Ab(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return Ab(this,e,n,r)}resolve(e,n=0){return Wc(this,e,n,!1)}resolveInner(e,n=0){return Wc(this,e,n,!0)}matchContext(e){return _v(this,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Or extends jT{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,o=0){for(let s=this;;){for(let{children:l,positions:a}=s._tree,u=n>0?l.length:-1;e!=u;e+=n){let c=l[e],f=a[e]+s.from;if(NT(i,r,f,f+c.length)){if(c instanceof ks){if(o&nn.ExcludeBuffers)continue;let h=c.findChild(0,c.buffer.length,n,r-f,i);if(h>-1)return new io(new RI(s,c,e,f),null,h)}else if(o&nn.IncludeAnonymous||!c.type.isAnonymous||y0(c)){let h;if(!(o&nn.IgnoreMounts)&&(h=Zc.get(c))&&!h.overlay)return new Or(h.tree,f,e,s);let d=new Or(c,f,e,s);return o&nn.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(n<0?c.children.length-1:0,n,r,i)}}}if(o&nn.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&nn.IgnoreOverlays)&&(i=Zc.get(this._tree))&&i.overlay){let o=e-this.from;for(let{from:s,to:l}of i.overlay)if((n>0?s<=o:s<o)&&(n<0?l>=o:l>o))return new Or(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Ab(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(let s=!1;!s;)if(s=i.type.is(n),!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function _v(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class RI{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class io extends jT{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new io(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&nn.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new io(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new io(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new io(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1];e.push(r.slice(i,o,s)),n.push(0)}return new qt(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function IT(t){if(!t.length)return null;let e=0,n=t[0];for(let o=1;o<t.length;o++){let s=t[o];(s.from>n.from||s.to<n.to)&&(n=s,e=o)}let r=n instanceof Or&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new QI(i,n)}class QI{constructor(e,n){this.heads=e,this.node=n}get next(){return IT(this.heads)}}function AI(t,e,n){let r=t.resolveInner(e,n),i=null;for(let o=r instanceof Or?r:r.context.parent;o;o=o.parent)if(o.index<0){let s=o.parent;(i||(i=[r])).push(s.resolve(e,n)),o=s}else{let s=Zc.get(o.tree);if(s&&s.overlay&&s.overlay[0].from<=e&&s.overlay[s.overlay.length-1].to>=e){let l=new Or(s.tree,s.overlay[0].from+o.from,-1,o);(i||(i=[r])).push(Wc(l,e,n,!1))}}return i?IT(i):r}class mp{get name(){return this.type.name}constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Or)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Or?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&nn.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&nn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&nn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let l=r._tree.children[o];if(this.mode&nn.IncludeAnonymous||l instanceof ks||!l.type.isAnonymous||y0(l))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}for(let i=r;i<this.stack.length;i++)n=new io(this.buffer,n,this.stack[i]);return this.bufferNode=new io(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return _v(this.node,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return _v(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function y0(t){return t.children.some(e=>e instanceof ks||!e.type.isAnonymous||y0(e))}function MI(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=DT,reused:o=[],minRepeatType:s=r.types.length}=t,l=Array.isArray(n)?new v0(n,n.length):n,a=r.types,u=0,c=0;function f(k,P,C,w,x,_){let{id:E,start:$,end:j,size:W}=l,G=c;for(;W<0;)if(l.next(),W==-1){let q=o[E];C.push(q),w.push($-k);return}else if(W==-3){u=E;return}else if(W==-4){c=E;return}else throw new RangeError(`Unrecognized record size: ${W}`);let M=a[E],L,N,Y=$-k;if(j-$<=i&&(N=O(l.pos-P,x))){let q=new Uint16Array(N.size-N.skip),ae=l.pos-N.size,pe=q.length;for(;l.pos>ae;)pe=v(N.start,q,pe);L=new ks(q,j-N.start,r),Y=N.start-k}else{let q=l.pos-W;l.next();let ae=[],pe=[],U=E>=s?E:-1,H=0,se=j;for(;l.pos>q;)U>=0&&l.id==U&&l.size>=0?(l.end<=se-i&&(p(ae,pe,$,H,l.end,se,U,G),H=ae.length,se=l.end),l.next()):_>2500?h($,q,ae,pe):f($,q,ae,pe,U,_+1);if(U>=0&&H>0&&H<ae.length&&p(ae,pe,$,H,$,se,U,G),ae.reverse(),pe.reverse(),U>-1&&H>0){let Ie=d(M);L=S0(M,ae,pe,0,ae.length,0,j-$,Ie,Ie)}else L=g(M,ae,pe,j-$,G-j)}C.push(L),w.push(Y)}function h(k,P,C,w){let x=[],_=0,E=-1;for(;l.pos>P;){let{id:$,start:j,end:W,size:G}=l;if(G>4)l.next();else{if(E>-1&&j<E)break;E<0&&(E=W-i),x.push($,j,W),_++,l.next()}}if(_){let $=new Uint16Array(_*4),j=x[x.length-2];for(let W=x.length-3,G=0;W>=0;W-=3)$[G++]=x[W],$[G++]=x[W+1]-j,$[G++]=x[W+2]-j,$[G++]=G;C.push(new ks($,x[2]-j,r)),w.push(j-k)}}function d(k){return(P,C,w)=>{let x=0,_=P.length-1,E,$;if(_>=0&&(E=P[_])instanceof qt){if(!_&&E.type==k&&E.length==w)return E;($=E.prop(dt.lookAhead))&&(x=C[_]+E.length+$)}return g(k,P,C,w,x)}}function p(k,P,C,w,x,_,E,$){let j=[],W=[];for(;k.length>w;)j.push(k.pop()),W.push(P.pop()+C-x);k.push(g(r.types[E],j,W,_-x,$-_)),P.push(x-C)}function g(k,P,C,w,x=0,_){if(u){let E=[dt.contextHash,u];_=_?[E].concat(_):[E]}if(x>25){let E=[dt.lookAhead,x];_=_?[E].concat(_):[E]}return new qt(k,P,C,w,_)}function O(k,P){let C=l.fork(),w=0,x=0,_=0,E=C.end-i,$={size:0,start:0,skip:0};e:for(let j=C.pos-k;C.pos>j;){let W=C.size;if(C.id==P&&W>=0){$.size=w,$.start=x,$.skip=_,_+=4,w+=4,C.next();continue}let G=C.pos-W;if(W<0||G<j||C.start<E)break;let M=C.id>=s?4:0,L=C.start;for(C.next();C.pos>G;){if(C.size<0)if(C.size==-3)M+=4;else break e;else C.id>=s&&(M+=4);C.next()}x=L,w+=W,_+=M}return(P<0||w==k)&&($.size=w,$.start=x,$.skip=_),$.size>4?$:void 0}function v(k,P,C){let{id:w,start:x,end:_,size:E}=l;if(l.next(),E>=0&&w<s){let $=C;if(E>4){let j=l.pos-(E-4);for(;l.pos>j;)C=v(k,P,C)}P[--C]=$,P[--C]=_-k,P[--C]=x-k,P[--C]=w}else E==-3?u=w:E==-4&&(c=w);return C}let m=[],y=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,m,y,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:m.length?y[0]+m[0].length:0;return new qt(a[t.topID],m.reverse(),y.reverse(),S)}const Mb=new WeakMap;function Ad(t,e){if(!t.isAnonymous||e instanceof ks||e.type!=t)return 1;let n=Mb.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof qt)){n=1;break}n+=Ad(t,r)}Mb.set(e,n)}return n}function S0(t,e,n,r,i,o,s,l,a){let u=0;for(let p=r;p<i;p++)u+=Ad(t,e[p]);let c=Math.ceil(u*1.5/8),f=[],h=[];function d(p,g,O,v,m){for(let y=O;y<v;){let S=y,k=g[y],P=Ad(t,p[y]);for(y++;y<v;y++){let C=Ad(t,p[y]);if(P+C>=c)break;P+=C}if(y==S+1){if(P>c){let C=p[S];d(C.children,C.positions,0,C.children.length,g[S]+m);continue}f.push(p[S])}else{let C=g[y-1]+p[y-1].length-k;f.push(S0(t,p,g,S,y,k,C,null,a))}h.push(k+m-o)}}return d(e,n,r,i,0),(l||a)(f,h,s)}class LT{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof io?this.setBuffer(e.context.buffer,e.index,n):e instanceof Or&&this.map.set(e.tree,n)}get(e){return e instanceof io?this.getBuffer(e.context.buffer,e.index):e instanceof Or?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Po{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new Po(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let l=0,a=0,u=0;;l++){let c=l<n.length?n[l]:null,f=c?c.fromA:1e9;if(f-a>=r)for(;s&&s.from<f;){let h=s;if(a>=h.from||f<=h.to||u){let d=Math.max(h.from,a)-u,p=Math.min(h.to,f)-u;h=d>=p?null:new Po(d,p,h.tree,h.offset+u,l>0,!!c)}if(h&&i.push(h),s.to>f)break;s=o<e.length?e[o++]:null}if(!c)break;a=c.toA,u=c.toA-c.toB}return i}}class b0{startParse(e,n,r){return typeof e=="string"&&(e=new DI(e)),r=r?r.length?r.map(i=>new fi(i.from,i.to)):[new fi(0,0)]:[new fi(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class DI{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function ZT(t){return(e,n,r,i)=>new jI(e,t,n,r,i)}class Db{constructor(e,n,r,i,o){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.from=o}}function Nb(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class NI{constructor(e,n,r,i,o,s,l){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=o,this.target=s,this.prev=l,this.depth=0,this.ranges=[]}}const Pv=new dt({perNode:!0});class jI{constructor(e,n,r,i,o){this.nest=n,this.input=r,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new qt(r.type,r.children,r.positions,r.length,r.propValues.concat([[Pv,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[dt.mounted.id]=new Zc(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new ZI(this.fragments),n=null,r=null,i=new mp(new Or(this.baseTree,this.ranges[0].from,0,null),nn.IncludeAnonymous|nn.IgnoreMounts);e:for(let o,s;;){let l=!0,a;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)l=!1;else if(e.hasNode(i)){if(n){let u=n.mounts.find(c=>c.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(u)for(let c of u.mount.overlay){let f=c.from+u.pos,h=c.to+u.pos;f>=i.from&&h<=i.to&&!n.ranges.some(d=>d.from<h&&d.to>f)&&n.ranges.push({from:f,to:h})}}l=!1}else if(r&&(s=II(r.ranges,i.from,i.to)))l=s!=2;else if(!i.type.isAnonymous&&(o=this.nest(i,this.input))&&(i.from<i.to||!o.overlay)){i.tree||LI(i);let u=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")n=new NI(o.parser,o.overlay,u,this.inner.length,i.from,i.tree,n);else{let c=Lb(this.ranges,o.overlay||(i.from<i.to?[new fi(i.from,i.to)]:[]));c.length&&Nb(c),(c.length||!o.overlay)&&this.inner.push(new Db(o.parser,c.length?o.parser.startParse(this.input,Zb(u,c),c):o.parser.startParse(""),o.overlay?o.overlay.map(f=>new fi(f.from-i.from,f.to-i.from)):null,i.tree,c.length?c[0].from:i.from)),o.overlay?c.length&&(r={ranges:c,depth:0,prev:r}):l=!1}}else n&&(a=n.predicate(i))&&(a===!0&&(a=new fi(i.from,i.to)),a.from<a.to&&n.ranges.push(a));if(l&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let u=Lb(this.ranges,n.ranges);u.length&&(Nb(u),this.inner.splice(n.index,0,new Db(n.parser,n.parser.startParse(this.input,Zb(n.mounts,u),u),n.ranges.map(c=>new fi(c.from-n.start,c.to-n.start)),n.target,u[0].from))),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function II(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function jb(t,e,n,r,i,o){if(e<n){let s=t.buffer[e+1];r.push(t.slice(e,n,s)),i.push(s-o)}}function LI(t){let{node:e}=t,n=[],r=e.context.buffer;do n.push(t.index),t.parent();while(!t.tree);let i=t.tree,o=i.children.indexOf(r),s=i.children[o],l=s.buffer,a=[o];function u(c,f,h,d,p,g){let O=n[g],v=[],m=[];jb(s,c,O,v,m,d);let y=l[O+1],S=l[O+2];a.push(v.length);let k=g?u(O+4,l[O+3],s.set.types[l[O]],y,S-y,g-1):e.toTree();return v.push(k),m.push(y-d),jb(s,l[O+3],f,v,m,d),new qt(h,v,m,p)}i.children[o]=u(0,l.length,qn.none,0,s.length,n.length-1);for(let c of a){let f=t.tree.children[c],h=t.tree.positions[c];t.yield(new Or(f,h+t.from,c,t._tree))}}class Ib{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(nn.IncludeAnonymous|nn.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,nn.IgnoreOverlays|nn.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof qt)n=n.children[0];else break}return!1}}let ZI=class{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(Pv))!==null&&n!==void 0?n:r.to,this.inner=new Ib(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(Pv))!==null&&e!==void 0?e:n.to,this.inner=new Ib(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(r=o.tree)===null||r===void 0?void 0:r.prop(dt.mounted);if(s&&s.parser==n)for(let l=this.fragI;l<this.fragments.length;l++){let a=this.fragments[l];if(a.from>=o.to)break;a.tree==this.curFrag.tree&&i.push({frag:a,pos:o.from-a.offset,mount:s})}}}return i}};function Lb(t,e){let n=null,r=e;for(let i=1,o=0;i<t.length;i++){let s=t[i-1].to,l=t[i].from;for(;o<r.length;o++){let a=r[o];if(a.from>=l)break;a.to<=s||(n||(r=n=e.slice()),a.from<s?(n[o]=new fi(a.from,s),a.to>l&&n.splice(o+1,0,new fi(l,a.to))):a.to>l?n[o--]=new fi(l,a.to):n.splice(o--,1))}}return r}function WI(t,e,n,r){let i=0,o=0,s=!1,l=!1,a=-1e9,u=[];for(;;){let c=i==t.length?1e9:s?t[i].to:t[i].from,f=o==e.length?1e9:l?e[o].to:e[o].from;if(s!=l){let h=Math.max(a,n),d=Math.min(c,f,r);h<d&&u.push(new fi(h,d))}if(a=Math.min(c,f),a==1e9)break;c==a&&(s?(s=!1,i++):s=!0),f==a&&(l?(l=!1,o++):l=!0)}return u}function Zb(t,e){let n=[];for(let{pos:r,mount:i,frag:o}of t){let s=r+(i.overlay?i.overlay[0].from:0),l=s+i.tree.length,a=Math.max(o.from,s),u=Math.min(o.to,l);if(i.overlay){let c=i.overlay.map(h=>new fi(h.from+r,h.to+r)),f=WI(e,c,a,u);for(let h=0,d=a;;h++){let p=h==f.length,g=p?u:f[h].from;if(g>d&&n.push(new Po(d,g,i.tree,-s,o.from>=d||o.openStart,o.to<=g||o.openEnd)),p)break;d=f[h].to}}else n.push(new Po(a,u,i.tree,-s,o.from>=s||o.openStart,o.to<=l||o.openEnd))}return n}let BI=0;class $i{constructor(e,n,r){this.set=e,this.base=n,this.modified=r,this.id=BI++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new $i([],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(){let e=new Op;return n=>n.modified.indexOf(e)>-1?n:Op.get(n.base||n,n.modified.concat(e).sort((r,i)=>r.id-i.id))}}let XI=0;class Op{constructor(){this.instances=[],this.id=XI++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(l=>l.base==e&&YI(n,l.modified));if(r)return r;let i=[],o=new $i(i,e,n);for(let l of n)l.instances.push(o);let s=UI(n);for(let l of e.set)if(!l.modified.length)for(let a of s)i.push(Op.get(l,a));return o}}function YI(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function UI(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function bl(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,l=i;for(let f=0;;){if(l=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);l=i.slice(f)}let a=o.length-1,u=o[a];if(!u)throw new RangeError("Invalid path: "+i);let c=new vp(r,s,a>0?o.slice(0,a):null);e[u]=c.sort(e[u])}}return WT.add(e)}const WT=new dt;class vp{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}vp.empty=new vp([],2,null);function BT(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=e||{};return{style:o=>{let s=i;for(let l of o)for(let a of l.set){let u=n[a.id];if(u){s=s?s+" "+u:u;break}}return s},scope:r}}function FI(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function qI(t,e,n,r=0,i=t.length){let o=new zI(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class zI{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:l,to:a}=e;if(l>=r||a<=n)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let u=i,c=VI(e)||vp.empty,f=FI(o,c.tags);if(f&&(u&&(u+=" "),u+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,l),u),c.opaque)return;let h=e.tree&&e.tree.prop(dt.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+l,1),p=this.highlighters.filter(O=>!O.scope||O.scope(h.tree.type)),g=e.firstChild();for(let O=0,v=l;;O++){let m=O<h.overlay.length?h.overlay[O]:null,y=m?m.from+l:a,S=Math.max(n,v),k=Math.min(r,y);if(S<k&&g)for(;e.from<k&&(this.highlightRange(e,S,k,i,o),this.startSpan(Math.min(k,e.to),u),!(e.to>=y||!e.nextSibling())););if(!m||y>r)break;v=m.to+l,v>n&&(this.highlightRange(d.cursor(),Math.max(n,m.from+l),Math.min(r,v),"",p),this.startSpan(Math.min(r,v),u))}g&&e.parent()}else if(e.firstChild()){h&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),u)}while(e.nextSibling());e.parent()}}}function VI(t){let e=t.type.prop(WT);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const Ee=$i.define,lh=Ee(),Yo=Ee(),Wb=Ee(Yo),Bb=Ee(Yo),Uo=Ee(),ah=Ee(Uo),um=Ee(Uo),Ui=Ee(),Is=Ee(Ui),Xi=Ee(),Yi=Ee(),Cv=Ee(),ku=Ee(Cv),uh=Ee(),b={comment:lh,lineComment:Ee(lh),blockComment:Ee(lh),docComment:Ee(lh),name:Yo,variableName:Ee(Yo),typeName:Wb,tagName:Ee(Wb),propertyName:Bb,attributeName:Ee(Bb),className:Ee(Yo),labelName:Ee(Yo),namespace:Ee(Yo),macroName:Ee(Yo),literal:Uo,string:ah,docString:Ee(ah),character:Ee(ah),attributeValue:Ee(ah),number:um,integer:Ee(um),float:Ee(um),bool:Ee(Uo),regexp:Ee(Uo),escape:Ee(Uo),color:Ee(Uo),url:Ee(Uo),keyword:Xi,self:Ee(Xi),null:Ee(Xi),atom:Ee(Xi),unit:Ee(Xi),modifier:Ee(Xi),operatorKeyword:Ee(Xi),controlKeyword:Ee(Xi),definitionKeyword:Ee(Xi),moduleKeyword:Ee(Xi),operator:Yi,derefOperator:Ee(Yi),arithmeticOperator:Ee(Yi),logicOperator:Ee(Yi),bitwiseOperator:Ee(Yi),compareOperator:Ee(Yi),updateOperator:Ee(Yi),definitionOperator:Ee(Yi),typeOperator:Ee(Yi),controlOperator:Ee(Yi),punctuation:Cv,separator:Ee(Cv),bracket:ku,angleBracket:Ee(ku),squareBracket:Ee(ku),paren:Ee(ku),brace:Ee(ku),content:Ui,heading:Is,heading1:Ee(Is),heading2:Ee(Is),heading3:Ee(Is),heading4:Ee(Is),heading5:Ee(Is),heading6:Ee(Is),contentSeparator:Ee(Ui),list:Ee(Ui),quote:Ee(Ui),emphasis:Ee(Ui),strong:Ee(Ui),link:Ee(Ui),monospace:Ee(Ui),strikethrough:Ee(Ui),inserted:Ee(),deleted:Ee(),changed:Ee(),invalid:Ee(),meta:uh,documentMeta:Ee(uh),annotation:Ee(uh),processingInstruction:Ee(uh),definition:$i.defineModifier(),constant:$i.defineModifier(),function:$i.defineModifier(),standard:$i.defineModifier(),local:$i.defineModifier(),special:$i.defineModifier()};BT([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var cm;const tl=new dt;function w0(t){return je.define({combine:t?e=>e.concat(t):void 0})}const k0=new dt;class hi{constructor(e,n,r=[],i=""){this.data=e,this.name=i,Mt.prototype.hasOwnProperty("tree")||Object.defineProperty(Mt.prototype,"tree",{get(){return _n(this)}}),this.parser=n,this.extension=[Wa.of(this),Mt.languageData.of((o,s,l)=>{let a=Xb(o,s,l),u=a.type.prop(tl);if(!u)return[];let c=o.facet(u),f=a.type.prop(k0);if(f){let h=a.resolve(s-a.from,l);for(let d of f)if(d.test(h,o)){let p=o.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(r)}isActiveAt(e,n,r=-1){return Xb(e,n,r).type.prop(tl)==this.data}findRegions(e){let n=e.facet(Wa);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(tl)==this.data){r.push({from:s,to:s+o.length});return}let l=o.prop(dt.mounted);if(l){if(l.tree.prop(tl)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+s,to:a.to+s});else r.push({from:s,to:s+o.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+s),r.length>a)return}}for(let a=0;a<o.children.length;a++){let u=o.children[a];u instanceof qt&&i(u,o.positions[a]+s)}};return i(_n(e),0),r}get allowsNesting(){return!0}}hi.setState=Ot.define();function Xb(t,e,n){let r=t.facet(Wa),i=_n(t).topNode;if(!r||r.allowsNesting)for(let o=i;o;o=o.enter(e,n,nn.ExcludeBuffers))o.type.isTop&&(i=o);return i}class Ol extends hi{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=w0(e.languageData);return new Ol(n,e.parser.configure({props:[tl.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new Ol(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _n(t){let e=t.field(hi.state,!1);return e?e.tree:qt.empty}class GI{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let xu=null;class Bc{constructor(e,n,r=[],i,o,s,l,a){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Bc(e,n,[],qt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new GI(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=qt.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(Po.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(Po.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=xu;xu=this;try{return e()}finally{xu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=Yb(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((u,c,f,h)=>a.push({fromA:u,toA:c,fromB:f,toB:h})),r=Po.applyChanges(r,a),i=qt.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let c=e.mapPos(u.from,1),f=e.mapPos(u.to,-1);c<f&&l.push({from:c,to:f})}}}return new Bc(this.parser,n,r,i,o,s,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<e.to&&o>e.from&&(this.fragments=Yb(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends b0{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let a=xu;if(a){for(let u of i)a.tempSkipped.push(u);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=s,new qt(qn.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return xu}}function Yb(t,e,n){return Po.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class Za{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new Za(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Bc.create(e.facet(Wa).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new Za(r)}}hi.state=zn.define({create:Za.init,update(t,e){for(let n of e.effects)if(n.is(hi.setState))return n.value;return e.startState.facet(Wa)!=e.state.facet(Wa)?Za.init(e.state):t.apply(e)}});let XT=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(XT=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:500-100})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const fm=typeof navigator<"u"&&(!((cm=navigator.scheduling)===null||cm===void 0)&&cm.isInputPending)?()=>navigator.scheduling.isInputPending():null,HI=Jt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field(hi.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field(hi.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=XT(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field(hi.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!fm?Math.max(25,e.timeRemaining()-5):1e9),l=o.context.treeLen<i&&r.doc.length>i+1e3,a=o.context.work(()=>fm&&fm()||Date.now()>s,i+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:hi.setState.of(new Za(o.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Kr(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Wa=je.define({combine(t){return t.length?t[0]:null},enables:t=>[hi.state,HI,$e.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class Ba{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class yp{constructor(e,n,r,i,o,s=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=o,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new yp(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(o=>o==n))return i;if(r)for(let i of e)for(let o of i.alias){let s=n.indexOf(o);if(s>-1&&(o.length>2||!/\w/.test(n[s-1])&&!/\w/.test(n[s+o.length])))return i}return null}}const KI=je.define(),ff=je.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Xa(t){let e=t.facet(ff);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Sp(t,e){let n="",r=t.tabSize,i=t.facet(ff)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o<e;o++)n+=i;return n}function YT(t,e){t instanceof Mt&&(t=new x0(t));for(let r of t.state.facet(KI)){let i=r(t,e);if(i!==void 0)return i}let n=_n(t.state);return n.length>=e?JI(t,n,e):null}class x0{constructor(e,n={}){this.state=e,this.options=n,this.unit=Xa(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.countColumn(r,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return Ni(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ja=new dt;function JI(t,e,n){let r=e.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let o=[];for(let s=i;s!=r.node;s=s.parent)o.push(s);for(let s=o.length-1;s>=0;s--)r={node:o[s],next:r}}return UT(r,t,n)}function UT(t,e,n){for(let r=t;r;r=r.next){let i=t5(r.node);if(i)return i(_0.create(e,n,r))}return 0}function e5(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function t5(t){let e=t.type.prop(Ja);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(dt.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>FT(s,!0,1,void 0,o&&!e5(s)?i.from:void 0)}return t.parent==null?n5:null}function n5(){return 0}class _0 extends x0{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new _0(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(r5(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return UT(this.context.next,this.base,this.pos)}}function r5(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function i5(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped)return a.from<s?n:null;l=a.to}}function o5({closing:t,align:e=!0,units:n=1}){return r=>FT(r,e,n,t)}function FT(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,l=r&&o.slice(s,s+r.length)==r||i==t.pos+s,a=e?i5(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}const s5=t=>t.baseIndent;function xa({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const l5=200;function a5(){return Mt.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+l5)return t;let o=n.sliceString(i.from,r);if(!e.some(u=>u.test(o)))return t;let{state:s}=t,l=-1,a=[];for(let{head:u}of s.selection.ranges){let c=s.doc.lineAt(u);if(c.from==l)continue;l=c.from;let f=YT(s,c.from);if(f==null)continue;let h=/^\s*/.exec(c.text)[0],d=Sp(s,f);h!=d&&a.push({from:c.from,to:c.from+h.length,insert:d})}return a.length?[t,{changes:a,sequential:!0}]:t})}const qT=je.define(),wl=new dt;function P0(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function u5(t,e,n){let r=_n(t);if(r.length<n)return null;let i=r.resolveStack(n,1),o=null;for(let s=i;s;s=s.next){let l=s.node;if(l.to<=n||l.from>n)continue;if(o&&l.from<e)break;let a=l.type.prop(wl);if(a&&(l.to<r.length-50||r.length==t.doc.length||!c5(l))){let u=a(l,t);u&&u.from<=n&&u.from>=e&&u.to>n&&(o=u)}}return o}function c5(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function zT(t,e,n){for(let r of t.facet(qT)){let i=r(t,e,n);if(i)return i}return u5(t,e,n)}function VT(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const C0=Ot.define({map:VT}),fg=Ot.define({map:VT});function GT(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const hf=zn.define({create(){return Ue.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)if(n.is(C0)&&!f5(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(E0),i=r?Ue.replace({widget:new v5(r(e.state,n.value))}):Ub;t=t.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(fg)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{i<r&&o>r&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>$e.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(Ub.range(r,i))}return Ue.set(e,!0)}});function HT(t,e,n){var r;let i=null;return(r=t.field(hf,!1))===null||r===void 0||r.between(e,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function f5(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function KT(t,e){return t.field(hf,!1)?e:e.concat(Ot.appendConfig.of(O5()))}const h5=t=>{for(let e of GT(t)){let n=zT(t.state,e.from,e.to);if(n)return t.dispatch({effects:KT(t.state,[C0.of(n),JT(t,n)])}),!0}return!1},d5=t=>{if(!t.state.field(hf,!1))return!1;let e=[];for(let n of GT(t)){let r=HT(t.state,n.from,n.to);r&&e.push(fg.of(r),JT(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function JT(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return $e.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const p5=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),o=zT(e,i.from,i.to);o&&n.push(C0.of(o)),r=(o?t.lineBlockAt(o.to):i).to+1}return n.length&&t.dispatch({effects:KT(t.state,n)}),!!n.length},g5=t=>{let e=t.state.field(hf,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(fg.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},m5={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},E0=je.define({combine(t){return Li(t,m5)}});function O5(t){let e=[hf,y5];return t&&e.push(E0.of(t)),e}function e$(t,e){let{state:n}=t,r=n.facet(E0),i=s=>{let l=t.lineBlockAt(t.posAtDOM(s.target)),a=HT(t.state,l.from,l.to);a&&t.dispatch({effects:fg.of(a)}),s.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let o=document.createElement("span");return o.textContent=r.placeholderText,o.setAttribute("aria-label",n.phrase("folded code")),o.title=n.phrase("unfold"),o.className="cm-foldPlaceholder",o.onclick=i,o}const Ub=Ue.replace({widget:new class extends yi{toDOM(t){return e$(t,null)}}});class v5 extends yi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return e$(e,this.value)}}const y5=$e.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class eu{constructor(e,n){this.specs=e;let r;function i(l){let a=ys.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof hi?l=>l.prop(tl)==s.data:s?l=>l==s:void 0,this.style=BT(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:o}).style,this.module=r?new ys(r):null,this.themeType=n.themeType}static define(e,n){return new eu(e,n||{})}}const Ev=je.define(),t$=je.define({combine(t){return t.length?[t[0]]:null}});function hm(t){let e=t.facet(Ev);return e.length?e:t.facet(t$)}function T0(t,e){let n=[b5],r;return t instanceof eu&&(t.module&&n.push($e.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(t$.of(t)):r?n.push(Ev.computeN([$e.darkTheme],i=>i.facet($e.darkTheme)==(r=="dark")?[t]:[])):n.push(Ev.of(t)),n}class S5{constructor(e){this.markCache=Object.create(null),this.tree=_n(e.state),this.decorations=this.buildDeco(e,hm(e.state))}update(e){let n=_n(e.state),r=hm(e.state),i=r!=hm(e.startState);n.length<e.view.viewport.to&&!i&&n.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r))}buildDeco(e,n){if(!n||!this.tree.length)return Ue.none;let r=new vs;for(let{from:i,to:o}of e.visibleRanges)qI(this.tree,n,(s,l,a)=>{r.add(s,l,this.markCache[a]||(this.markCache[a]=Ue.mark({class:a})))},i,o);return r.finish()}}const b5=Cs.high(Jt.fromClass(S5,{decorations:t=>t.decorations})),w5=eu.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),k5=$e.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),n$=1e4,r$="()[]{}",i$=je.define({combine(t){return Li(t,{afterCursor:!0,brackets:r$,maxScanDistance:n$,renderMatch:P5})}}),x5=Ue.mark({class:"cm-matchingBracket"}),_5=Ue.mark({class:"cm-nonmatchingBracket"});function P5(t){let e=[],n=t.matched?x5:_5;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const C5=zn.define({create(){return Ue.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(i$);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=rs(e.state,i.head,-1,r)||i.head>0&&rs(e.state,i.head-1,1,r)||r.afterCursor&&(rs(e.state,i.head,1,r)||i.head<e.state.doc.length&&rs(e.state,i.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,e.state)))}return Ue.set(n,!0)},provide:t=>$e.decorations.from(t)}),E5=[C5,k5];function T5(t={}){return[i$.of(t),E5]}const o$=new dt;function Tv(t,e,n){let r=t.prop(e<0?dt.openedBy:dt.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function $v(t){let e=t.type.prop(o$);return e?e(t.node):t}function rs(t,e,n,r={}){let i=r.maxScanDistance||n$,o=r.brackets||r$,s=_n(t),l=s.resolveInner(e,n);for(let a=l;a;a=a.parent){let u=Tv(a.type,n,o);if(u&&a.from<a.to){let c=$v(a);if(c&&(n>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return $5(t,e,n,a,c,u,o)}}return R5(t,e,n,s,l.type,i,o)}function $5(t,e,n,r,i,o,s){let l=r.parent,a={from:i.from,to:i.to},u=0,c=l==null?void 0:l.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(u==0&&o.indexOf(c.type.name)>-1&&c.from<c.to){let f=$v(c);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(Tv(c.type,n,s))u++;else if(Tv(c.type,-n,s)){if(u==0){let f=$v(c);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}u--}}while(n<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function R5(t,e,n,r,i,o,s){let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=s.indexOf(l);if(a<0||a%2==0!=n>0)return null;let u={from:n<0?e-1:e,to:n>0?e+1:e},c=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!c.next().done&&h<=o;){let d=c.value;n<0&&(h+=d.length);let p=e+h*n;for(let g=n>0?0:d.length-1,O=n>0?d.length:-1;g!=O;g+=n){let v=s.indexOf(d[g]);if(!(v<0||r.resolveInner(p+g,1).type!=i))if(v%2==0==n>0)f++;else{if(f==1)return{start:u,end:{from:p+g,to:p+g+1},matched:v>>1==a>>1};f--}}n>0&&(h+=d.length)}return c.done?{start:u,matched:!1}:null}const Q5=Object.create(null),Fb=[qn.none],qb=[],A5=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])A5[t]=M5(Q5,e);function dm(t,e){qb.indexOf(t)>-1||(qb.push(t),console.warn(e))}function M5(t,e){let n=null;for(let o of e.split(".")){let s=t[o]||b[o];s?typeof s=="function"?n?n=s(n):dm(o,`Modifier ${o} used at start of tag`):n?dm(o,`Tag ${o} used as modifier`):n=s:dm(o,`Unknown highlighting tag ${o}`)}if(!n)return 0;let r=e.replace(/ /g,"_"),i=qn.define({id:Fb.length,name:r,props:[bl({[r]:n})]});return Fb.push(i),i.id}const D5="#e5c07b",zb="#e06c75",N5="#56b6c2",j5="#ffffff",Md="#abb2bf",Rv="#7d8799",I5="#61afef",L5="#98c379",Vb="#d19a66",Z5="#c678dd",W5="#21252b",Gb="#2c313a",Hb="#282c34",pm="#353a42",B5="#3E4451",Kb="#528bff",X5=$e.theme({"&":{color:Md,backgroundColor:Hb},".cm-content":{caretColor:Kb},".cm-cursor, .cm-dropCursor":{borderLeftColor:Kb},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:B5},".cm-panels":{backgroundColor:W5,color:Md},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Hb,color:Rv,border:"none"},".cm-activeLineGutter":{backgroundColor:Gb},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:pm},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:pm,borderBottomColor:pm},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Gb,color:Md}}},{dark:!0}),Y5=eu.define([{tag:b.keyword,color:Z5},{tag:[b.name,b.deleted,b.character,b.propertyName,b.macroName],color:zb},{tag:[b.function(b.variableName),b.labelName],color:I5},{tag:[b.color,b.constant(b.name),b.standard(b.name)],color:Vb},{tag:[b.definition(b.name),b.separator],color:Md},{tag:[b.typeName,b.className,b.number,b.changed,b.annotation,b.modifier,b.self,b.namespace],color:D5},{tag:[b.operator,b.operatorKeyword,b.url,b.escape,b.regexp,b.link,b.special(b.string)],color:N5},{tag:[b.meta,b.comment],color:Rv},{tag:b.strong,fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.link,color:Rv,textDecoration:"underline"},{tag:b.heading,fontWeight:"bold",color:zb},{tag:[b.atom,b.bool,b.special(b.variableName)],color:Vb},{tag:[b.processingInstruction,b.string,b.inserted],color:L5},{tag:b.invalid,color:j5}]),U5=[X5,T0(Y5)];function Mn(){return Mn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Mn.apply(this,arguments)}var Si=t=>{var{theme:e,settings:n={},styles:r=[]}=t,i={".cm-gutters":{}},o={};n.background&&(o.backgroundColor=n.background),n.backgroundImage&&(o.backgroundImage=n.backgroundImage),n.foreground&&(o.color=n.foreground),(n.background||n.foreground)&&(i["&"]=o),n.fontFamily&&(i["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(i[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(i[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(i[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(i[".cm-content"]={caretColor:n.caret},i[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var s={};n.gutterActiveForeground&&(s.color=n.gutterActiveForeground),n.lineHighlight&&(i[".cm-activeLine"]={backgroundColor:n.lineHighlight},s.backgroundColor=n.lineHighlight),i[".cm-activeLineGutter"]=s,n.selection&&(i["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(i["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var l=$e.theme(i,{dark:e==="dark"}),a=eu.define(r),u=[l,T0(a)];return u},F5={background:"#272822",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#49483E",selectionMatch:"#49483E",gutterBackground:"#272822",gutterForeground:"#FFFFFF70",lineHighlight:"#0000003b"},q5=t=>{var{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},F5,n),styles:[{tag:[b.comment,b.documentMeta],color:"#8292a2"},{tag:[b.number,b.bool,b.null,b.atom],color:"#ae81ff"},{tag:[b.attributeValue,b.className,b.name],color:"#e6db74"},{tag:[b.propertyName,b.attributeName],color:"#a6e22e"},{tag:[b.variableName],color:"#9effff"},{tag:[b.squareBracket],color:"#bababa"},{tag:[b.string,b.special(b.brace)],color:"#e6db74"},{tag:[b.regexp,b.className,b.typeName,b.definition(b.typeName)],color:"#66d9ef"},{tag:[b.definition(b.variableName),b.definition(b.propertyName),b.function(b.variableName)],color:"#fd971f"},{tag:[b.keyword,b.definitionKeyword,b.modifier,b.tagName,b.angleBracket],color:"#f92672"},...r]})},z5=q5(),V5={background:"#0f0f0f",foreground:"#defdef",caret:"#00FF00",selection:"#515151",selectionMatch:"#515151",gutterBackground:"#555",gutterForeground:"#FFFFFF",lineHighlight:"#0a6bcb3d"},G5=t=>{var{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},V5,n),styles:[{tag:b.keyword,color:"darkgoldenrod",fontWeight:"bold"},{tag:b.atom,color:"#77F"},{tag:b.comment,color:"#7a7b7c",fontStyle:"italic"},{tag:b.number,color:"violet"},{tag:b.definition(b.variableName),color:"#fffabc"},{tag:b.variableName,color:"#abcdef"},{tag:b.function(b.variableName),color:"#fffabc"},{tag:b.typeName,color:"#FFDD44"},{tag:b.tagName,color:"#def"},{tag:b.string,color:"#2b4"},{tag:b.meta,color:"#C9F"},{tag:b.bracket,color:"#8a8a8a"},{tag:b.attributeName,color:"#DDFF00"},{tag:b.heading,color:"aquamarine",fontWeight:"bold"},{tag:b.link,color:"blueviolet",fontWeight:"bold"},...r]})},H5=G5(),K5={background:"#282a36",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"rgba(255, 255, 255, 0.1)",selectionMatch:"rgba(255, 255, 255, 0.2)",gutterBackground:"#282a36",gutterForeground:"#6D8A88",gutterBorder:"transparent",lineHighlight:"rgba(255, 255, 255, 0.1)"},J5=t=>{var{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},K5,n),styles:[{tag:b.comment,color:"#6272a4"},{tag:b.string,color:"#f1fa8c"},{tag:b.atom,color:"#bd93f9"},{tag:b.meta,color:"#f8f8f2"},{tag:[b.keyword,b.operator,b.tagName],color:"#ff79c6"},{tag:[b.function(b.propertyName),b.propertyName],color:"#66d9ef"},{tag:[b.definition(b.variableName),b.function(b.variableName),b.className,b.attributeName],color:"#50fa7b"},{tag:b.atom,color:"#bd93f9"},...r]})},eL=J5(),tL={background:"#fff",foreground:"#000",caret:"#FFFFFF",selection:"#d7d4f0",selectionMatch:"#d7d4f0",gutterBackground:"#f7f7f7",gutterForeground:"#999",lineHighlight:"#006fff1c",gutterBorder:"transparent"},nL=t=>{var{theme:e="light",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},tL,n),styles:[{tag:[b.comment],color:"#3F7F5F"},{tag:[b.documentMeta],color:"#FF1717"},{tag:b.keyword,color:"#7F0055",fontWeight:"bold"},{tag:b.atom,color:"#00f"},{tag:b.number,color:"#164"},{tag:b.propertyName,color:"#164"},{tag:[b.variableName,b.definition(b.variableName)],color:"#0000C0"},{tag:b.function(b.variableName),color:"#0000C0"},{tag:b.string,color:"#2A00FF"},{tag:b.operator,color:"black"},{tag:b.tagName,color:"#170"},{tag:b.attributeName,color:"#00c"},{tag:b.link,color:"#219"},...r]})},rL=nL(),iL={background:"#fff",foreground:"#24292e",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},oL=t=>{var{theme:e="light",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},iL,n),styles:[{tag:[b.standard(b.tagName),b.tagName],color:"#116329"},{tag:[b.comment,b.bracket],color:"#6a737d"},{tag:[b.className,b.propertyName],color:"#6f42c1"},{tag:[b.variableName,b.attributeName,b.number,b.operator],color:"#005cc5"},{tag:[b.keyword,b.typeName,b.typeOperator,b.typeName],color:"#d73a49"},{tag:[b.string,b.meta,b.regexp],color:"#032f62"},{tag:[b.name,b.quote],color:"#22863a"},{tag:[b.heading,b.strong],color:"#24292e",fontWeight:"bold"},{tag:[b.emphasis],color:"#24292e",fontStyle:"italic"},{tag:[b.deleted],color:"#b31d28",backgroundColor:"ffeef0"},{tag:[b.atom,b.bool,b.special(b.variableName)],color:"#e36209"},{tag:[b.url,b.escape,b.regexp,b.link],color:"#032f62"},{tag:b.link,textDecoration:"underline"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.invalid,color:"#cb2431"},...r]})};oL();var sL={background:"#0d1117",foreground:"#c9d1d9",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},lL=t=>{var{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},sL,n),styles:[{tag:[b.standard(b.tagName),b.tagName],color:"#7ee787"},{tag:[b.comment,b.bracket],color:"#8b949e"},{tag:[b.className,b.propertyName],color:"#d2a8ff"},{tag:[b.variableName,b.attributeName,b.number,b.operator],color:"#79c0ff"},{tag:[b.keyword,b.typeName,b.typeOperator,b.typeName],color:"#ff7b72"},{tag:[b.string,b.meta,b.regexp],color:"#a5d6ff"},{tag:[b.name,b.quote],color:"#7ee787"},{tag:[b.heading,b.strong],color:"#d2a8ff",fontWeight:"bold"},{tag:[b.emphasis],color:"#d2a8ff",fontStyle:"italic"},{tag:[b.deleted],color:"#ffdcd7",backgroundColor:"ffeef0"},{tag:[b.atom,b.bool,b.special(b.variableName)],color:"#ffab70"},{tag:b.link,textDecoration:"underline"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.invalid,color:"#f97583"},...r]})},aL=lL(),uL={background:"#2e3235",foreground:"#bdbdbd",caret:"#a0a4ae",selection:"#d7d4f063",selectionMatch:"#d7d4f063",gutterBackground:"#2e3235",gutterForeground:"#999",gutterActiveForeground:"#4f5b66",lineHighlight:"#545b6130"},s$=t=>{var{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},uL,n),styles:[{tag:b.keyword,color:"#cf6edf"},{tag:[b.name,b.deleted,b.character,b.macroName],color:"#56c8d8"},{tag:[b.propertyName],color:"#facf4e"},{tag:[b.variableName],color:"#bdbdbd"},{tag:[b.function(b.variableName)],color:"#56c8d8"},{tag:[b.labelName],color:"#cf6edf"},{tag:[b.color,b.constant(b.name),b.standard(b.name)],color:"#facf4e"},{tag:[b.definition(b.name),b.separator],color:"#fa5788"},{tag:[b.brace],color:"#cf6edf"},{tag:[b.annotation],color:"#ff5f52"},{tag:[b.number,b.changed,b.annotation,b.modifier,b.self,b.namespace],color:"#ffad42"},{tag:[b.typeName,b.className],color:"#ffad42"},{tag:[b.operator,b.operatorKeyword],color:"#7186f0"},{tag:[b.tagName],color:"#99d066"},{tag:[b.squareBracket],color:"#ff5f52"},{tag:[b.angleBracket],color:"#606f7a"},{tag:[b.attributeName],color:"#bdbdbd"},{tag:[b.regexp],color:"#ff5f52"},{tag:[b.quote],color:"#6abf69"},{tag:[b.string],color:"#99d066"},{tag:b.link,color:"#56c8d8",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[b.url,b.escape,b.special(b.string)],color:"#facf4e"},{tag:[b.meta],color:"#707d8b"},{tag:[b.comment],color:"#707d8b",fontStyle:"italic"},{tag:b.monospace,color:"#bdbdbd"},{tag:b.strong,fontWeight:"bold",color:"#ff5f52"},{tag:b.emphasis,fontStyle:"italic",color:"#99d066"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.heading,fontWeight:"bold",color:"#facf4e"},{tag:b.heading1,fontWeight:"bold",color:"#facf4e"},{tag:[b.heading2,b.heading3,b.heading4],fontWeight:"bold",color:"#facf4e"},{tag:[b.heading5,b.heading6],color:"#facf4e"},{tag:[b.atom,b.bool,b.special(b.variableName)],color:"#56c8d8"},{tag:[b.processingInstruction,b.inserted],color:"#ff5f52"},{tag:[b.contentSeparator],color:"#56c8d8"},{tag:b.invalid,color:"#606f7a",borderBottom:"1px dotted #ff5f52"},...r]})};s$();var cL=s$(),fL={background:"#FAFAFA",foreground:"#90A4AE",caret:"#272727",selection:"#80CBC440",selectionMatch:"#80CBC440",gutterBackground:"#FAFAFA",gutterForeground:"#90A4AE",gutterBorder:"transparent",lineHighlight:"#CCD7DA50"},hL=t=>{var{theme:e="light",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},fL,n),styles:[{tag:b.keyword,color:"#39ADB5"},{tag:[b.name,b.deleted,b.character,b.macroName],color:"#90A4AE"},{tag:[b.propertyName],color:"#6182B8"},{tag:[b.processingInstruction,b.string,b.inserted,b.special(b.string)],color:"#91B859"},{tag:[b.function(b.variableName),b.labelName],color:"#6182B8"},{tag:[b.color,b.constant(b.name),b.standard(b.name)],color:"#39ADB5"},{tag:[b.definition(b.name),b.separator],color:"#90A4AE"},{tag:[b.className],color:"#E2931D"},{tag:[b.number,b.changed,b.annotation,b.modifier,b.self,b.namespace],color:"#F76D47"},{tag:[b.typeName],color:"#E2931D",fontStyle:"#E2931D"},{tag:[b.operator,b.operatorKeyword],color:"#39ADB5"},{tag:[b.url,b.escape,b.regexp,b.link],color:"#91B859"},{tag:[b.meta,b.comment],color:"#90A4AE"},{tag:b.strong,fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,fontWeight:"bold",color:"#39ADB5"},{tag:[b.atom,b.bool,b.special(b.variableName)],color:"#90A4AE"},{tag:b.invalid,color:"#E5393570"},{tag:b.strikethrough,textDecoration:"line-through"},...r]})};hL();var dL={background:"#2e3440",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#4b556a",selectionMatch:"#4b556a",gutterBackground:"#2e3440",gutterForeground:"#4c566a",gutterActiveForeground:"#d8dee9",lineHighlight:"#4c566a29"},pL=t=>{var{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},dL,n),styles:[{tag:b.keyword,color:"#5e81ac"},{tag:[b.name,b.deleted,b.character,b.propertyName,b.macroName],color:"#88c0d0"},{tag:[b.variableName],color:"#8fbcbb"},{tag:[b.function(b.variableName)],color:"#8fbcbb"},{tag:[b.labelName],color:"#81a1c1"},{tag:[b.color,b.constant(b.name),b.standard(b.name)],color:"#5e81ac"},{tag:[b.definition(b.name),b.separator],color:"#a3be8c"},{tag:[b.brace],color:"#8fbcbb"},{tag:[b.annotation],color:"#d30102"},{tag:[b.number,b.changed,b.annotation,b.modifier,b.self,b.namespace],color:"#b48ead"},{tag:[b.typeName,b.className],color:"#ebcb8b"},{tag:[b.operator,b.operatorKeyword],color:"#a3be8c"},{tag:[b.tagName],color:"#b48ead"},{tag:[b.squareBracket],color:"#bf616a"},{tag:[b.angleBracket],color:"#d08770"},{tag:[b.attributeName],color:"#ebcb8b"},{tag:[b.regexp],color:"#5e81ac"},{tag:[b.quote],color:"#b48ead"},{tag:[b.string],color:"#a3be8c"},{tag:b.link,color:"#a3be8c",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[b.url,b.escape,b.special(b.string)],color:"#8fbcbb"},{tag:[b.meta],color:"#88c0d0"},{tag:[b.monospace],color:"#d8dee9",fontStyle:"italic"},{tag:[b.comment],color:"#4c566a",fontStyle:"italic"},{tag:b.strong,fontWeight:"bold",color:"#5e81ac"},{tag:b.emphasis,fontStyle:"italic",color:"#5e81ac"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.heading,fontWeight:"bold",color:"#5e81ac"},{tag:b.special(b.heading1),fontWeight:"bold",color:"#5e81ac"},{tag:b.heading1,fontWeight:"bold",color:"#5e81ac"},{tag:[b.heading2,b.heading3,b.heading4],fontWeight:"bold",color:"#5e81ac"},{tag:[b.heading5,b.heading6],color:"#5e81ac"},{tag:[b.atom,b.bool,b.special(b.variableName)],color:"#d08770"},{tag:[b.processingInstruction,b.inserted],color:"#8fbcbb"},{tag:[b.contentSeparator],color:"#ebcb8b"},{tag:b.invalid,color:"#434c5e",borderBottom:"1px dotted #d30102"},...r]})},gL=pL(),mL={background:"#fff",foreground:"#3D3D3D",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#AFAFAF",lineHighlight:"#d5e6ff69"};function OL(t){var{theme:e="light",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},mL,n),styles:[{tag:[b.comment,b.quote],color:"#707F8D"},{tag:[b.typeName,b.typeOperator],color:"#aa0d91"},{tag:[b.keyword],color:"#aa0d91",fontWeight:"bold"},{tag:[b.string,b.meta],color:"#D23423"},{tag:[b.name],color:"#032f62"},{tag:[b.typeName],color:"#522BB2"},{tag:[b.variableName],color:"#23575C"},{tag:[b.definition(b.variableName)],color:"#327A9E"},{tag:[b.regexp,b.link],color:"#0e0eff"},...r]})}var vL=OL(),yL={background:"#292A30",foreground:"#CECFD0",caret:"#fff",selection:"#727377",selectionMatch:"#727377",lineHighlight:"#ffffff0f"},SL=t=>{var{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:Mn({},yL,n),styles:[{tag:[b.comment,b.quote],color:"#7F8C98"},{tag:[b.keyword],color:"#FF7AB2",fontWeight:"bold"},{tag:[b.string,b.meta],color:"#FF8170"},{tag:[b.typeName],color:"#DABAFF"},{tag:[b.definition(b.variableName)],color:"#6BDFFF"},{tag:[b.name],color:"#6BAA9F"},{tag:[b.variableName],color:"#ACF2E4"},{tag:[b.regexp,b.link],color:"#FF8170"},...r]})};SL();const Jb="#202e46",l$="#e2e2e2",bL="#b9c7e6",wL="rgba(255,255,255,0.2)",kL="rgba(255,255,255,0.5)",xL="#000",_L="rgba(0,0,0,0.4)",PL="rgba(0,0,0,0.1)",CL="white",tu=["#77fd8c","#00ffff","#66ecff","#ffb9ff","#ffabb3","#ffdb56"],ew=tu[0],_u=tu[1],EL=tu[2],tw=tu[3],TL=tu[4],nw=tu[5],$L="#ff2222",rw="500",RL={background:Jb,foreground:l$,caret:CL,selection:xL,selectionMatch:_L,lineHighlight:PL,gutterBackground:Jb,gutterForeground:wL,gutterActiveForeground:kL};function QL(t){const{theme:e="dark",settings:n={},styles:r=[]}=t||{};return Si({theme:e,settings:{...RL,...n},styles:[{tag:[b.keyword,b.operatorKeyword,b.modifier,b.color,b.constant(b.name),b.standard(b.name),b.standard(b.tagName),b.special(b.brace),b.atom,b.bool,b.special(b.variableName)],color:ew},{tag:[b.controlKeyword,b.moduleKeyword],color:ew},{tag:[b.name,b.deleted,b.character,b.macroName,b.variableName,b.labelName,b.definition(b.name)],color:_u},{tag:[b.propertyName],color:nw},{tag:b.heading,fontWeight:rw,color:EL},{tag:[b.typeName,b.className,b.tagName,b.number,b.changed,b.annotation,b.self,b.namespace],color:_u},{tag:[b.function(b.variableName),b.function(b.propertyName)],color:_u},{tag:[b.number],color:TL},{tag:[b.operator,b.punctuation,b.separator,b.url,b.escape,b.regexp],color:l$},{tag:[b.regexp],color:tw},{tag:[b.special(b.string),b.string,b.inserted],color:tw},{tag:[b.processingInstruction],color:_u},{tag:[b.angleBracket],color:_u},{tag:b.strong,fontWeight:rw},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:[b.meta,b.comment],color:bL},{tag:b.link,color:nw,textDecoration:"underline"},{tag:b.invalid,color:$L},...r]})}const AL=QL(),a$=[{value:H5,label:"abcdef"},{value:eL,label:"dracula"},{value:rL,label:"eclipse"},{value:cL,label:"material"},{value:gL,label:"nord"},{value:U5,label:"oneDark"},{value:z5,label:"okaidia"},{value:aL,label:"github"},{value:vL,label:"xcode"},{value:AL,label:"vizhub"}],u$=a$.reduce((t,e)=>(t[e.label]=e,t),{}),c$="vizhub",ML=(t,e)=>{const n=Z.useRef(!0);Z.useEffect(()=>{if(n.current)n.current=!1;else for(const r of Array.from(t.values())){const{editor:i,themeCompartment:o}=r;i.dispatch({effects:o.reconfigure([u$[e].value])})}},[e,t])},DL=t=>{const e=Z.useCallback(u=>{t({type:"set_active_file_id",activeFileId:u})},[t]),n=Z.useCallback(u=>{t({type:"open_tab",fileId:u.fileId,isTransient:u.isTransient})},[t]),r=Z.useCallback(u=>{t({type:"close_tabs",fileIdsToClose:u})},[t]),i=Z.useCallback(u=>{t({type:"set_theme",themeLabel:u})},[t]),o=Z.useCallback(u=>{t({type:"set_is_settings_open",value:u})},[t]),s=Z.useCallback(()=>{o(!1)},[o]),l=Z.useCallback(()=>{t({type:"editor_no_longer_wants_focus"})},[t]),a=Z.useCallback(u=>{t({type:"set_username",username:u})},[t]);return{setActiveFileId:e,openTab:n,closeTabs:r,setTheme:i,setIsSettingsOpen:o,closeSettings:s,editorNoLongerWantsFocus:l,setUsername:a}},NL=()=>{const[t,e]=Z.useState(new Set),n=Z.useCallback(i=>t.has(i),[t]),r=Z.useCallback(i=>{const o=new Set(t);n(i)?o.delete(i):o.add(i),e(o)},[t,n]);return{isDirectoryOpen:n,toggleDirectory:r}},jL=8,f$=()=>{let t="";for(let e=0;e<jL;e++)t+=Math.floor(Math.random()*10);return t},IL=({submitOperation:t,closeTabs:e,openTab:n})=>{const r=Z.useCallback(l=>{if(l){const a=f$();t(u=>({...u,files:{...u.files,[a]:{name:l,text:""}}})),n({fileId:a,isTransient:!1})}},[t]),i=Z.useCallback((l,a)=>{t(u=>({...u,files:{...u.files,[l]:{...u.files[l],name:a}}}))},[t]),o=Z.useCallback(l=>{e([l]),t(a=>{const u={...a.files};return delete u[l],{...a,files:u}})},[t,e]),s=Z.useCallback(l=>{const a=[];t(u=>{const c={...u.files};for(const f in c)c[f].name.includes(l)&&(a.push(f),delete c[f]);return{...u,files:c}}),e(a)},[t,e]);return{createFile:r,renameFile:i,deleteFile:o,deleteDirectory:s}},LL=()=>Z.useRef(new Map).current;/**
78
- * @remix-run/router v1.14.2
79
- *
80
- * Copyright (c) Remix Software Inc.
81
- *
82
- * This source code is licensed under the MIT license found in the
83
- * LICENSE.md file in the root directory of this source tree.
84
- *
85
- * @license MIT
86
- */function Xc(){return Xc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Xc.apply(this,arguments)}var nl;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(nl||(nl={}));const iw="popstate";function ZL(t){t===void 0&&(t={});function e(r,i){let{pathname:o,search:s,hash:l}=r.location;return Qv("",{pathname:o,search:s,hash:l},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:h$(i)}return BL(e,n,null,t)}function uo(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function WL(){return Math.random().toString(36).substr(2,8)}function ow(t,e){return{usr:t.state,key:t.key,idx:e}}function Qv(t,e,n,r){return n===void 0&&(n=null),Xc({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?hg(e):e,{state:n,key:e&&e.key||r||WL()})}function h$(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function hg(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function BL(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l=nl.Pop,a=null,u=c();u==null&&(u=0,s.replaceState(Xc({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function f(){l=nl.Pop;let O=c(),v=O==null?null:O-u;u=O,a&&a({action:l,location:g.location,delta:v})}function h(O,v){l=nl.Push;let m=Qv(g.location,O,v);n&&n(m,O),u=c()+1;let y=ow(m,u),S=g.createHref(m);try{s.pushState(y,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(S)}o&&a&&a({action:l,location:g.location,delta:1})}function d(O,v){l=nl.Replace;let m=Qv(g.location,O,v);n&&n(m,O),u=c();let y=ow(m,u),S=g.createHref(m);s.replaceState(y,"",S),o&&a&&a({action:l,location:g.location,delta:0})}function p(O){let v=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof O=="string"?O:h$(O);return uo(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let g={get action(){return l},get location(){return t(i,s)},listen(O){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(iw,f),a=O,()=>{i.removeEventListener(iw,f),a=null}},createHref(O){return e(i,O)},createURL:p,encodeLocation(O){let v=p(O);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:d,go(O){return s.go(O)}};return g}var sw;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(sw||(sw={}));function XL(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function YL(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:i=""}=typeof t=="string"?hg(t):t;return{pathname:n?n.startsWith("/")?n:UL(n,e):e,search:GL(r),hash:HL(i)}}function UL(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function gm(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function FL(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function qL(t,e){let n=FL(t);return e?n.map((r,i)=>i===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function zL(t,e,n,r){r===void 0&&(r=!1);let i;typeof t=="string"?i=hg(t):(i=Xc({},t),uo(!i.pathname||!i.pathname.includes("?"),gm("?","pathname","search",i)),uo(!i.pathname||!i.pathname.includes("#"),gm("#","pathname","hash",i)),uo(!i.search||!i.search.includes("#"),gm("#","search","hash",i)));let o=t===""||i.pathname==="",s=o?"/":i.pathname,l;if(s==null)l=n;else{let f=e.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}l=f>=0?e[f]:"/"}let a=YL(i,l),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const VL=t=>t.join("/").replace(/\/\/+/g,"/"),GL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,HL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,d$=["post","put","patch","delete"];new Set(d$);const KL=["get",...d$];new Set(KL);/**
87
- * React Router v6.21.2
88
- *
89
- * Copyright (c) Remix Software Inc.
90
- *
91
- * This source code is licensed under the MIT license found in the
92
- * LICENSE.md file in the root directory of this source tree.
93
- *
94
- * @license MIT
95
- */function bp(){return bp=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},bp.apply(this,arguments)}const p$=Z.createContext(null),$0=Z.createContext(null),R0=Z.createContext(null),Q0=Z.createContext({outlet:null,matches:[],isDataRoute:!1});function A0(){return Z.useContext(R0)!=null}function g$(){return A0()||uo(!1),Z.useContext(R0).location}function m$(t){Z.useContext($0).static||Z.useLayoutEffect(t)}function JL(){let{isDataRoute:t}=Z.useContext(Q0);return t?iZ():eZ()}function eZ(){A0()||uo(!1);let t=Z.useContext(p$),{basename:e,future:n,navigator:r}=Z.useContext($0),{matches:i}=Z.useContext(Q0),{pathname:o}=g$(),s=JSON.stringify(qL(i,n.v7_relativeSplatPath)),l=Z.useRef(!1);return m$(()=>{l.current=!0}),Z.useCallback(function(u,c){if(c===void 0&&(c={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=zL(u,JSON.parse(s),o,c.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:VL([e,f.pathname])),(c.replace?r.replace:r.push)(f,c.state,c)},[e,r,s,o,t])}var O$=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(O$||{}),v$=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(v$||{});function tZ(t){let e=Z.useContext(p$);return e||uo(!1),e}function nZ(t){let e=Z.useContext(Q0);return e||uo(!1),e}function rZ(t){let e=nZ(),n=e.matches[e.matches.length-1];return n.route.id||uo(!1),n.route.id}function iZ(){let{router:t}=tZ(O$.UseNavigateStable),e=rZ(v$.UseNavigateStable),n=Z.useRef(!1);return m$(()=>{n.current=!0}),Z.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,bp({fromRouteId:e},o)))},[t,e])}function oZ(t){let{basename:e="/",children:n=null,location:r,navigationType:i=nl.Pop,navigator:o,static:s=!1,future:l}=t;A0()&&uo(!1);let a=e.replace(/^\/*/,"/"),u=Z.useMemo(()=>({basename:a,navigator:o,static:s,future:bp({v7_relativeSplatPath:!1},l)}),[a,l,o,s]);typeof r=="string"&&(r=hg(r));let{pathname:c="/",search:f="",hash:h="",state:d=null,key:p="default"}=r,g=Z.useMemo(()=>{let O=XL(c,a);return O==null?null:{location:{pathname:O,search:f,hash:h,state:d,key:p},navigationType:i}},[a,c,f,h,d,p,i]);return g==null?null:Z.createElement($0.Provider,{value:u},Z.createElement(R0.Provider,{children:n,value:g}))}new Promise(()=>{});/**
96
- * React Router DOM v6.21.2
97
- *
98
- * Copyright (c) Remix Software Inc.
99
- *
100
- * This source code is licensed under the MIT license found in the
101
- * LICENSE.md file in the root directory of this source tree.
102
- *
103
- * @license MIT
104
- */function Av(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function sZ(t,e){let n=Av(t);return e&&e.forEach((r,i)=>{n.has(i)||e.getAll(i).forEach(o=>{n.append(i,o)})}),n}const lZ="startTransition",lw=n2[lZ];function aZ(t){let{basename:e,children:n,future:r,window:i}=t,o=Z.useRef();o.current==null&&(o.current=ZL({window:i,v5Compat:!0}));let s=o.current,[l,a]=Z.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=Z.useCallback(f=>{u&&lw?lw(()=>a(f)):a(f)},[a,u]);return Z.useLayoutEffect(()=>s.listen(c),[s,c]),Z.createElement(oZ,{basename:e,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}var aw;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(aw||(aw={}));var uw;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(uw||(uw={}));function uZ(t){let e=Z.useRef(Av(t)),n=Z.useRef(!1),r=g$(),i=Z.useMemo(()=>sZ(r.search,n.current?null:e.current),[r.search]),o=JL(),s=Z.useCallback((l,a)=>{const u=Av(typeof l=="function"?l(i):l);n.current=!0,o("?"+u,a)},[o,i]);return[i,s]}const y$="~",cw=(t,e)=>{if(t&&t.files){for(const n of Object.keys(t.files))if(t.files[n].name===e)return n}return null},fw=(t,e)=>{if(t&&t.files){const n=t.files[e];if(n)return n.name}return null},cZ=({tabStateParams:t,content:e})=>{const{file:n,tabs:r}=t,i=[],o=cw(e,n);return r?r.split(y$).forEach(s=>{const l=cw(e,s);l&&i.push({fileId:l})}):o&&i.push({fileId:o}),{tabList:i,activeFileId:o}},fZ=({tabList:t,activeFileId:e,content:n})=>{const r=fw(n,e),i={};if(r&&(i.file=r,t.length>1)){const o=t.map(s=>fw(n,s.fileId)).join(y$);i.tabs=o}return i},hZ=({content:t,openTab:e,setActiveFileId:n,tabList:r,activeFileId:i})=>{const[o,s]=uZ(),l=Z.useMemo(()=>({file:o.get("file"),tabs:o.get("tabs")}),[o]),a=Z.useRef(!1);Z.useEffect(()=>{if(a.current||!t)return;const{tabList:c,activeFileId:f}=cZ({tabStateParams:l,content:t});a.current=!0,n(f),c.forEach(e)},[t,o,n,e,a]);const u=Z.useRef(t);Z.useEffect(()=>{u.current=t},[t]),Z.useEffect(()=>{if(!u.current)return;const c=fZ({tabList:r,activeFileId:i,content:u.current});(l.file!==c.file||l.tabs!==c.tabs)&&s(f=>{const h=new URLSearchParams(f);return c.file?h.set("file",c.file):h.delete("file"),c.tabs?h.set("tabs",c.tabs):h.delete("tabs"),h})},[o,r,i])},df=Z.createContext(null),dZ=({content:t,shareDBDoc:e,submitOperation:n,localPresence:r,docPresence:i,prettierWorker:o,typeScriptWorker:s,initialUsername:l,children:a,codeError:u=null,enableManualPretter:c=!1})=>{const{prettierError:f}=xD({shareDBDoc:e,submitOperation:n,prettierWorker:o,enableManualPretter:c}),h=f||u;CD({content:t,typeScriptWorker:s});const[d,p]=Z.useReducer(jD,{defaultTheme:c$,initialUsername:l},DD),{tabList:g,activeFileId:O,theme:v,isSettingsOpen:m,editorWantsFocus:y,username:S}=d,{setActiveFileId:k,openTab:P,closeTabs:C,setTheme:w,setIsSettingsOpen:x,closeSettings:_,editorNoLongerWantsFocus:E,setUsername:$}=DL(p);hZ({content:t,openTab:P,setActiveFileId:k,tabList:g,activeFileId:O});const{isDirectoryOpen:j,toggleDirectory:W}=NL(),G=LL();ML(G,v);const{createFile:M,renameFile:L,deleteFile:N,deleteDirectory:Y}=IL({submitOperation:n,closeTabs:C,openTab:P}),q=t?t.files:null,ae={content:t,shareDBDoc:e,submitOperation:n,localPresence:r,docPresence:i,files:q,createFile:M,renameFile:L,deleteFile:N,deleteDirectory:Y,activeFileId:O,setActiveFileId:k,tabList:g,openTab:P,closeTabs:C,isSettingsOpen:m,setIsSettingsOpen:x,closeSettings:_,theme:v,setTheme:w,username:S,setUsername:$,isDirectoryOpen:j,toggleDirectory:W,editorCache:G,editorWantsFocus:y,editorNoLongerWantsFocus:E,errorMessage:h,typeScriptWorker:s};return ee.jsx(df.Provider,{value:ae,children:a})},pZ=20,gZ=200,hw=4,dw=({side:t,isSidebarVisible:e=!0})=>{const{sidebarWidth:n,codeEditorWidth:r,moveSplitPane:i,isDraggingRight:o,isDraggingLeft:s,setIsDragging:l}=Z.useContext(lg),{activeFileId:a}=Z.useContext(df),u=t==="left"||a,c=Z.useRef(0),f=Z.useCallback(v=>{v.preventDefault(),c.current=v.clientX,l(!0,t),document.body.style.cursor="col-resize"},[l,t]),h=Z.useCallback(v=>{v.preventDefault();const m=v.clientX-c.current;c.current=v.clientX,i(m,t)},[i,t]),d=Z.useCallback(()=>{l(!1,t),document.body.style.cursor="default"},[l,t]),p=t==="left"&&s||t==="right"&&o;Z.useEffect(()=>{if(p)return document.addEventListener("mousemove",h),document.addEventListener("mouseup",d),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",d)}},[p,h,d]);const g=p?gZ:pZ,O=(t==="left"?n:e?n+r:r)-g/2;return u?ee.jsx("div",{className:"vz-resizer",onMouseDown:f,style:{left:O,width:g},children:ee.jsx("div",{className:"vz-resizer-thumb",style:{left:g/2-hw/2,width:hw}})}):null},mZ="vzCodeUsername",OZ="Anonymous",vZ=()=>{let t=OZ;if(typeof window<"u"){const e=window.localStorage.getItem(mZ);e!==null&&(t=e)}return t},yZ=t=>{const e=Z.useRef(t);Z.useEffect(()=>{e.current!==t&&(e.current=t,window.localStorage.setItem("vzCodeUsername",t))},[t])};var pw=Object.prototype.toString,S$=function(e){var n=pw.call(e),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&pw.call(e.callee)==="[object Function]"),r},mm,gw;function SZ(){if(gw)return mm;gw=1;var t;if(!Object.keys){var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=S$,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),s=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],a=function(h){var d=h.constructor;return d&&d.prototype===h},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var h in window)try{if(!u["$"+h]&&e.call(window,h)&&window[h]!==null&&typeof window[h]=="object")try{a(window[h])}catch{return!0}}catch{return!0}return!1}(),f=function(h){if(typeof window>"u"||!c)return a(h);try{return a(h)}catch{return!1}};t=function(d){var p=d!==null&&typeof d=="object",g=n.call(d)==="[object Function]",O=r(d),v=p&&n.call(d)==="[object String]",m=[];if(!p&&!g&&!O)throw new TypeError("Object.keys called on a non-object");var y=s&&g;if(v&&d.length>0&&!e.call(d,0))for(var S=0;S<d.length;++S)m.push(String(S));if(O&&d.length>0)for(var k=0;k<d.length;++k)m.push(String(k));else for(var P in d)!(y&&P==="prototype")&&e.call(d,P)&&m.push(String(P));if(o)for(var C=f(d),w=0;w<l.length;++w)!(C&&l[w]==="constructor")&&e.call(d,l[w])&&m.push(l[w]);return m}}return mm=t,mm}var bZ=Array.prototype.slice,wZ=S$,mw=Object.keys,Dd=mw?function(e){return mw(e)}:SZ(),Ow=Object.keys;Dd.shim=function(){if(Object.keys){var e=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);e||(Object.keys=function(r){return wZ(r)?Ow(bZ.call(r)):Ow(r)})}else Object.keys=Dd;return Object.keys||Dd};var b$=Dd,w$=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[n]=i;for(n in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(e,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0},kZ=w$,M0=function(){return kZ()&&!!Symbol.toStringTag},vw=typeof Symbol<"u"&&Symbol,xZ=w$,_Z=function(){return typeof vw!="function"||typeof Symbol!="function"||typeof vw("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:xZ()},yw={foo:{}},PZ=Object,CZ=function(){return{__proto__:yw}.foo===yw.foo&&!({__proto__:null}instanceof PZ)},EZ="Function.prototype.bind called on incompatible ",TZ=Object.prototype.toString,$Z=Math.max,RZ="[object Function]",Sw=function(e,n){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var o=0;o<n.length;o+=1)r[o+e.length]=n[o];return r},QZ=function(e,n){for(var r=[],i=n||0,o=0;i<e.length;i+=1,o+=1)r[o]=e[i];return r},AZ=function(t,e){for(var n="",r=0;r<t.length;r+=1)n+=t[r],r+1<t.length&&(n+=e);return n},MZ=function(e){var n=this;if(typeof n!="function"||TZ.apply(n)!==RZ)throw new TypeError(EZ+n);for(var r=QZ(arguments,1),i,o=function(){if(this instanceof i){var c=n.apply(this,Sw(r,arguments));return Object(c)===c?c:this}return n.apply(e,Sw(r,arguments))},s=$Z(0,n.length-r.length),l=[],a=0;a<s;a++)l[a]="$"+a;if(i=Function("binder","return function ("+AZ(l,",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i},DZ=MZ,k$=Function.prototype.bind||DZ,bw={}.hasOwnProperty,Om=Function.prototype.call,NZ=Om.bind?Om.bind(bw):function(t,e){return Om.call(bw,t,e)},Ct,Ya=SyntaxError,x$=Function,_a=TypeError,vm=function(t){try{return x$('"use strict"; return ('+t+").constructor;")()}catch{}},ll=Object.getOwnPropertyDescriptor;if(ll)try{ll({},"")}catch{ll=null}var ym=function(){throw new _a},jZ=ll?function(){try{return arguments.callee,ym}catch{try{return ll(arguments,"callee").get}catch{return ym}}}():ym,Nl=_Z(),IZ=CZ(),Kn=Object.getPrototypeOf||(IZ?function(t){return t.__proto__}:null),zl={},LZ=typeof Uint8Array>"u"||!Kn?Ct:Kn(Uint8Array),al={"%AggregateError%":typeof AggregateError>"u"?Ct:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Ct:ArrayBuffer,"%ArrayIteratorPrototype%":Nl&&Kn?Kn([][Symbol.iterator]()):Ct,"%AsyncFromSyncIteratorPrototype%":Ct,"%AsyncFunction%":zl,"%AsyncGenerator%":zl,"%AsyncGeneratorFunction%":zl,"%AsyncIteratorPrototype%":zl,"%Atomics%":typeof Atomics>"u"?Ct:Atomics,"%BigInt%":typeof BigInt>"u"?Ct:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Ct:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Ct:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Ct:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Ct:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Ct:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Ct:FinalizationRegistry,"%Function%":x$,"%GeneratorFunction%":zl,"%Int8Array%":typeof Int8Array>"u"?Ct:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Ct:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Ct:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Nl&&Kn?Kn(Kn([][Symbol.iterator]())):Ct,"%JSON%":typeof JSON=="object"?JSON:Ct,"%Map%":typeof Map>"u"?Ct:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Nl||!Kn?Ct:Kn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Ct:Promise,"%Proxy%":typeof Proxy>"u"?Ct:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Ct:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Ct:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Nl||!Kn?Ct:Kn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Ct:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Nl&&Kn?Kn(""[Symbol.iterator]()):Ct,"%Symbol%":Nl?Symbol:Ct,"%SyntaxError%":Ya,"%ThrowTypeError%":jZ,"%TypedArray%":LZ,"%TypeError%":_a,"%Uint8Array%":typeof Uint8Array>"u"?Ct:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Ct:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Ct:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Ct:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Ct:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Ct:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Ct:WeakSet};if(Kn)try{null.error}catch(t){var ZZ=Kn(Kn(t));al["%Error.prototype%"]=ZZ}var WZ=function t(e){var n;if(e==="%AsyncFunction%")n=vm("async function () {}");else if(e==="%GeneratorFunction%")n=vm("function* () {}");else if(e==="%AsyncGeneratorFunction%")n=vm("async function* () {}");else if(e==="%AsyncGenerator%"){var r=t("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Kn&&(n=Kn(i.prototype))}return al[e]=n,n},ww={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},pf=k$,wp=NZ,BZ=pf.call(Function.call,Array.prototype.concat),XZ=pf.call(Function.apply,Array.prototype.splice),kw=pf.call(Function.call,String.prototype.replace),kp=pf.call(Function.call,String.prototype.slice),YZ=pf.call(Function.call,RegExp.prototype.exec),UZ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,FZ=/\\(\\)?/g,qZ=function(e){var n=kp(e,0,1),r=kp(e,-1);if(n==="%"&&r!=="%")throw new Ya("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Ya("invalid intrinsic syntax, expected opening `%`");var i=[];return kw(e,UZ,function(o,s,l,a){i[i.length]=l?kw(a,FZ,"$1"):s||o}),i},zZ=function(e,n){var r=e,i;if(wp(ww,r)&&(i=ww[r],r="%"+i[0]+"%"),wp(al,r)){var o=al[r];if(o===zl&&(o=WZ(r)),typeof o>"u"&&!n)throw new _a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Ya("intrinsic "+e+" does not exist!")},gf=function(e,n){if(typeof e!="string"||e.length===0)throw new _a("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new _a('"allowMissing" argument must be a boolean');if(YZ(/^%?[^%]*%?$/,e)===null)throw new Ya("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=qZ(e),i=r.length>0?r[0]:"",o=zZ("%"+i+"%",n),s=o.name,l=o.value,a=!1,u=o.alias;u&&(i=u[0],XZ(r,BZ([0,1],u)));for(var c=1,f=!0;c<r.length;c+=1){var h=r[c],d=kp(h,0,1),p=kp(h,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new Ya("property names with quotes must have matching quotes");if((h==="constructor"||!f)&&(a=!0),i+="."+h,s="%"+i+"%",wp(al,s))l=al[s];else if(l!=null){if(!(h in l)){if(!n)throw new _a("base intrinsic for "+e+" exists, but the property is not available.");return}if(ll&&c+1>=r.length){var g=ll(l,h);f=!!g,f&&"get"in g&&!("originalValue"in g.get)?l=g.get:l=l[h]}else f=wp(l,h),l=l[h];f&&!a&&(al[s]=l)}}return l},_$={exports:{}};(function(t){var e=k$,n=gf,r=n("%Function.prototype.apply%"),i=n("%Function.prototype.call%"),o=n("%Reflect.apply%",!0)||e.call(i,r),s=n("%Object.getOwnPropertyDescriptor%",!0),l=n("%Object.defineProperty%",!0),a=n("%Math.max%");if(l)try{l({},"a",{value:1})}catch{l=null}t.exports=function(f){var h=o(e,i,arguments);if(s&&l){var d=s(h,"length");d.configurable&&l(h,"length",{value:1+a(0,f.length-(arguments.length-1))})}return h};var u=function(){return o(e,r,arguments)};l?l(t.exports,"apply",{value:u}):t.exports.apply=u})(_$);var D0=_$.exports,P$=gf,C$=D0,VZ=C$(P$("String.prototype.indexOf")),E$=function(e,n){var r=P$(e,!!n);return typeof r=="function"&&VZ(e,".prototype.")>-1?C$(r):r},GZ=M0(),HZ=E$,Mv=HZ("Object.prototype.toString"),dg=function(e){return GZ&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Mv(e)==="[object Arguments]"},T$=function(e){return dg(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Mv(e)!=="[object Array]"&&Mv(e.callee)==="[object Function]"},KZ=function(){return dg(arguments)}();dg.isLegacyArguments=T$;var JZ=KZ?dg:T$,eW=gf,Dv=eW("%Object.defineProperty%",!0),Nv=function(){if(Dv)try{return Dv({},"a",{value:1}),!0}catch{return!1}return!1};Nv.hasArrayLengthDefineBug=function(){if(!Nv())return null;try{return Dv([],"length",{value:1}).length!==1}catch{return!0}};var N0=Nv,Sm,xw;function tW(){if(xw)return Sm;xw=1;var t=gf,e=t("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return Sm=e,Sm}var nW=N0(),j0=gf,cc=nW&&j0("%Object.defineProperty%",!0);if(cc)try{cc({},"a",{value:1})}catch{cc=!1}var rW=j0("%SyntaxError%"),jl=j0("%TypeError%"),_w=tW(),$$=function(e,n,r){if(!e||typeof e!="object"&&typeof e!="function")throw new jl("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new jl("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new jl("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new jl("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new jl("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new jl("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,a=!!_w&&_w(e,n);if(cc)cc(e,n,{configurable:s===null&&a?a.configurable:!s,enumerable:i===null&&a?a.enumerable:!i,value:r,writable:o===null&&a?a.writable:!o});else if(l||!i&&!o&&!s)e[n]=r;else throw new rW("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},iW=b$,oW=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",sW=Object.prototype.toString,lW=Array.prototype.concat,Pw=$$,aW=function(t){return typeof t=="function"&&sW.call(t)==="[object Function]"},R$=N0(),uW=function(t,e,n,r){if(e in t){if(r===!0){if(t[e]===n)return}else if(!aW(r)||!r())return}R$?Pw(t,e,n,!0):Pw(t,e,n)},Q$=function(t,e){var n=arguments.length>2?arguments[2]:{},r=iW(e);oW&&(r=lW.call(r,Object.getOwnPropertySymbols(e)));for(var i=0;i<r.length;i+=1)uW(t,r[i],e[r[i]],n[r[i]])};Q$.supportsDescriptors=!!R$;var mf=Q$,Cw=function(t){return t!==t},A$=function(e,n){return e===0&&n===0?1/e===1/n:!!(e===n||Cw(e)&&Cw(n))},cW=A$,M$=function(){return typeof Object.is=="function"?Object.is:cW},fW=M$,hW=mf,dW=function(){var e=fW();return hW(Object,{is:e},{is:function(){return Object.is!==e}}),e},pW=mf,gW=D0,mW=A$,D$=M$,OW=dW,N$=gW(D$(),Object);pW(N$,{getPolyfill:D$,implementation:mW,shim:OW});var vW=N$,jv=E$,j$=M0(),I$,L$,Iv,Lv;if(j$){I$=jv("Object.prototype.hasOwnProperty"),L$=jv("RegExp.prototype.exec"),Iv={};var bm=function(){throw Iv};Lv={toString:bm,valueOf:bm},typeof Symbol.toPrimitive=="symbol"&&(Lv[Symbol.toPrimitive]=bm)}var yW=jv("Object.prototype.toString"),SW=Object.getOwnPropertyDescriptor,bW="[object RegExp]",wW=j$?function(e){if(!e||typeof e!="object")return!1;var n=SW(e,"lastIndex"),r=n&&I$(n,"value");if(!r)return!1;try{L$(e,Lv)}catch(i){return i===Iv}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:yW(e)===bW},Yc=function(){return typeof(function(){}).name=="string"},fc=Object.getOwnPropertyDescriptor;if(fc)try{fc([],"length")}catch{fc=null}Yc.functionsHaveConfigurableNames=function(){if(!Yc()||!fc)return!1;var e=fc(function(){},"name");return!!e&&!!e.configurable};var kW=Function.prototype.bind;Yc.boundFunctionsHaveNames=function(){return Yc()&&typeof kW=="function"&&(function(){}).bind().name!==""};var xW=Yc,Ew=$$,_W=N0(),PW=xW.functionsHaveConfigurableNames(),CW=TypeError,EW=function(e,n){if(typeof e!="function")throw new CW("`fn` is not a function");var r=arguments.length>2&&!!arguments[2];return(!r||PW)&&(_W?Ew(e,"name",n,!0,!0):Ew(e,"name",n)),e},TW=EW,$W=Object,RW=TypeError,Z$=TW(function(){if(this!=null&&this!==$W(this))throw new RW("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0),QW=Z$,AW=mf.supportsDescriptors,MW=Object.getOwnPropertyDescriptor,W$=function(){if(AW&&/a/mig.flags==="gim"){var e=MW(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),n==="dy")return e.get}}return QW},DW=mf.supportsDescriptors,NW=W$,jW=Object.getOwnPropertyDescriptor,IW=Object.defineProperty,LW=TypeError,Tw=Object.getPrototypeOf,ZW=/a/,WW=function(){if(!DW||!Tw)throw new LW("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=NW(),n=Tw(ZW),r=jW(n,"flags");return(!r||r.get!==e)&&IW(n,"flags",{configurable:!0,enumerable:!1,get:e}),e},BW=mf,XW=D0,YW=Z$,B$=W$,UW=WW,X$=XW(B$());BW(X$,{getPolyfill:B$,implementation:YW,shim:UW});var FW=X$,qW=Date.prototype.getDay,zW=function(e){try{return qW.call(e),!0}catch{return!1}},VW=Object.prototype.toString,GW="[object Date]",HW=M0(),KW=function(e){return typeof e!="object"||e===null?!1:HW?zW(e):VW.call(e)===GW},$w=b$,Rw=JZ,Qw=vW,Aw=wW,Mw=FW,Dw=KW,Nw=Date.prototype.getTime;function Y$(t,e,n){var r=n||{};return(r.strict?Qw(t,e):t===e)?!0:!t||!e||typeof t!="object"&&typeof e!="object"?r.strict?Qw(t,e):t==e:JW(t,e,r)}function jw(t){return t==null}function Iw(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function JW(t,e,n){var r,i;if(typeof t!=typeof e||jw(t)||jw(e)||t.prototype!==e.prototype||Rw(t)!==Rw(e))return!1;var o=Aw(t),s=Aw(e);if(o!==s)return!1;if(o||s)return t.source===e.source&&Mw(t)===Mw(e);if(Dw(t)&&Dw(e))return Nw.call(t)===Nw.call(e);var l=Iw(t),a=Iw(e);if(l!==a)return!1;if(l||a){if(t.length!==e.length)return!1;for(r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}if(typeof t!=typeof e)return!1;try{var u=$w(t),c=$w(e)}catch{return!1}if(u.length!==c.length)return!1;for(u.sort(),c.sort(),r=u.length-1;r>=0;r--)if(u[r]!=c[r])return!1;for(r=u.length-1;r>=0;r--)if(i=u[r],!Y$(t[i],e[i],n))return!1;return!0}var eB=Y$,Zv=eB,Wv;function Lw(t,e,n,r,i){var o;return i?o=i.replaceOp(t,n,r):(o={p:t},o[e?"od":"ld"]=n,o[e?"oi":"li"]=r),[o]}function tB(t,e,n,r,i,o){const s=[];var l=Wv.patch_make(e,n);return Object.keys(l).forEach(function(a){var u=l[a],c=u.start1;u.diffs.forEach(function([f,h]){switch(f){case r.DIFF_DELETE:if(o){var d=o.remove(c,h);s.push(i.editOp(t,o.type,d))}else s.push({sd:h,p:[...t,c]});break;case r.DIFF_INSERT:if(o){var d=o.insert(c,h);s.push(i.editOp(t,o.type,d))}else s.push({si:h,p:[...t,c]});case r.DIFF_EQUAL:c+=h.length;break;default:throw Error(`Unsupported operation type: ${f}`)}})}),s}var nB=function(t,e){if(e&&e.json1){var n=e.json1.type.compose;return t.reduce(n,null)}for(var r=0,i=t.length-1;r<i;++r){var o=t[r],s=t[r+1];Zv(o.p.slice(0,-1),s.p.slice(0,-1))&&o.p[o.p.length-1]+1===s.p[s.p.length-1]&&(!o.li||!s.ld||Zv(o.li,s.ld)&&(delete o.li,delete s.ld))}return t=t.filter(function(l){return Object.keys(l).length>1}),t},zu=function(t,e,n=[],r){var i=r&&r.diffMatchPatch,o=r&&r.json1,s=r&&r.textUnicode,l=typeof n[n.length-1]=="string"||n.length===0;if(Zv(t,e)&&Array.isArray(t)===Array.isArray(e))return[];if(typeof e>"u"){var a;return o?a=o.removeOp(n,t):(a={p:n},a[l?"od":"ld"]=t),[a]}if(typeof t>"u"){var a;return o?a=o.insertOp(n,e):(a={p:n},a[l?"oi":"li"]=e),[a]}if(t===null||e===null){var v=[];if(o)v.push(o.removeOp(n,t)),v.push(o.insertOp(n,e));else{var u={p:n};u[l?"od":"ld"]=t;var c={p:n};c[l?"oi":"li"]=e,v=[u,c]}return v}if(i&&typeof t=="string"&&typeof e=="string")return Wv||(Wv=new i),tB(n,t,e,i,o,s);var f=["string","number","boolean"];if(f.includes(typeof e)||f.includes(typeof t))return Lw(n,l,t,e,o);if(Array.isArray(e)&&Array.isArray(t)){for(var v=[],h=t.length,d=e.length,p=Math.min(h,d),v=[],g=0;g<p;++g){var O=zu(t[g],e[g],[...n,g],r);O.forEach(function(S){v.push(S)})}if(d>h)for(var g=p;g<d;g++){var O=zu(void 0,e[g],[...n,g],r);O.forEach(function(P){v.push(P)})}else if(d<h)for(var g=p;g<h;g++){var O=zu(t[g],void 0,[...n,p],r);O.forEach(function(P){v.push(P)})}return v}else if(Array.isArray(e)||Array.isArray(t))return Lw(n,l,t,e,o);var v=[],m=new Set([...Object.keys(t),...Object.keys(e)]);return m.forEach(function(y){var S=zu(t[y],e[y],[...n,y],r);v=v.concat(S)}),v},rB=function(t,e,n,r,i){var o={diffMatchPatch:n,json1:r,textUnicode:i};return nB(zu(t,e,[],o),o)},iB=rB;const oB=vi(iB);var U$={exports:{}};(function(t){var e=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1,r=1,i=0;e.Diff=function(o,s){return[o,s]},e.prototype.diff_main=function(o,s,l,a){typeof a>"u"&&(this.Diff_Timeout<=0?a=Number.MAX_VALUE:a=new Date().getTime()+this.Diff_Timeout*1e3);var u=a;if(o==null||s==null)throw new Error("Null input. (diff_main)");if(o==s)return o?[new e.Diff(i,o)]:[];typeof l>"u"&&(l=!0);var c=l,f=this.diff_commonPrefix(o,s),h=o.substring(0,f);o=o.substring(f),s=s.substring(f),f=this.diff_commonSuffix(o,s);var d=o.substring(o.length-f);o=o.substring(0,o.length-f),s=s.substring(0,s.length-f);var p=this.diff_compute_(o,s,c,u);return h&&p.unshift(new e.Diff(i,h)),d&&p.push(new e.Diff(i,d)),this.diff_cleanupMerge(p),p},e.prototype.diff_compute_=function(o,s,l,a){var u;if(!o)return[new e.Diff(r,s)];if(!s)return[new e.Diff(n,o)];var c=o.length>s.length?o:s,f=o.length>s.length?s:o,h=c.indexOf(f);if(h!=-1)return u=[new e.Diff(r,c.substring(0,h)),new e.Diff(i,f),new e.Diff(r,c.substring(h+f.length))],o.length>s.length&&(u[0][0]=u[2][0]=n),u;if(f.length==1)return[new e.Diff(n,o),new e.Diff(r,s)];var d=this.diff_halfMatch_(o,s);if(d){var p=d[0],g=d[1],O=d[2],v=d[3],m=d[4],y=this.diff_main(p,O,l,a),S=this.diff_main(g,v,l,a);return y.concat([new e.Diff(i,m)],S)}return l&&o.length>100&&s.length>100?this.diff_lineMode_(o,s,a):this.diff_bisect_(o,s,a)},e.prototype.diff_lineMode_=function(o,s,l){var a=this.diff_linesToChars_(o,s);o=a.chars1,s=a.chars2;var u=a.lineArray,c=this.diff_main(o,s,!1,l);this.diff_charsToLines_(c,u),this.diff_cleanupSemantic(c),c.push(new e.Diff(i,""));for(var f=0,h=0,d=0,p="",g="";f<c.length;){switch(c[f][0]){case r:d++,g+=c[f][1];break;case n:h++,p+=c[f][1];break;case i:if(h>=1&&d>=1){c.splice(f-h-d,h+d),f=f-h-d;for(var O=this.diff_main(p,g,!1,l),v=O.length-1;v>=0;v--)c.splice(f,0,O[v]);f=f+O.length}d=0,h=0,p="",g="";break}f++}return c.pop(),c},e.prototype.diff_bisect_=function(o,s,l){for(var a=o.length,u=s.length,c=Math.ceil((a+u)/2),f=c,h=2*c,d=new Array(h),p=new Array(h),g=0;g<h;g++)d[g]=-1,p[g]=-1;d[f+1]=0,p[f+1]=0;for(var O=a-u,v=O%2!=0,m=0,y=0,S=0,k=0,P=0;P<c&&!(new Date().getTime()>l);P++){for(var C=-P+m;C<=P-y;C+=2){var w=f+C,x;C==-P||C!=P&&d[w-1]<d[w+1]?x=d[w+1]:x=d[w-1]+1;for(var _=x-C;x<a&&_<u&&o.charAt(x)==s.charAt(_);)x++,_++;if(d[w]=x,x>a)y+=2;else if(_>u)m+=2;else if(v){var E=f+O-C;if(E>=0&&E<h&&p[E]!=-1){var $=a-p[E];if(x>=$)return this.diff_bisectSplit_(o,s,x,_,l)}}}for(var j=-P+S;j<=P-k;j+=2){var E=f+j,$;j==-P||j!=P&&p[E-1]<p[E+1]?$=p[E+1]:$=p[E-1]+1;for(var W=$-j;$<a&&W<u&&o.charAt(a-$-1)==s.charAt(u-W-1);)$++,W++;if(p[E]=$,$>a)k+=2;else if(W>u)S+=2;else if(!v){var w=f+O-j;if(w>=0&&w<h&&d[w]!=-1){var x=d[w],_=f+x-w;if($=a-$,x>=$)return this.diff_bisectSplit_(o,s,x,_,l)}}}}return[new e.Diff(n,o),new e.Diff(r,s)]},e.prototype.diff_bisectSplit_=function(o,s,l,a,u){var c=o.substring(0,l),f=s.substring(0,a),h=o.substring(l),d=s.substring(a),p=this.diff_main(c,f,!1,u),g=this.diff_main(h,d,!1,u);return p.concat(g)},e.prototype.diff_linesToChars_=function(o,s){var l=[],a={};l[0]="";function u(d){for(var p="",g=0,O=-1,v=l.length;O<d.length-1;){O=d.indexOf(`
105
- `,g),O==-1&&(O=d.length-1);var m=d.substring(g,O+1);(a.hasOwnProperty?a.hasOwnProperty(m):a[m]!==void 0)?p+=String.fromCharCode(a[m]):(v==c&&(m=d.substring(g),O=d.length),p+=String.fromCharCode(v),a[m]=v,l[v++]=m),g=O+1}return p}var c=4e4,f=u(o);c=65535;var h=u(s);return{chars1:f,chars2:h,lineArray:l}},e.prototype.diff_charsToLines_=function(o,s){for(var l=0;l<o.length;l++){for(var a=o[l][1],u=[],c=0;c<a.length;c++)u[c]=s[a.charCodeAt(c)];o[l][1]=u.join("")}},e.prototype.diff_commonPrefix=function(o,s){if(!o||!s||o.charAt(0)!=s.charAt(0))return 0;for(var l=0,a=Math.min(o.length,s.length),u=a,c=0;l<u;)o.substring(c,u)==s.substring(c,u)?(l=u,c=l):a=u,u=Math.floor((a-l)/2+l);return u},e.prototype.diff_commonSuffix=function(o,s){if(!o||!s||o.charAt(o.length-1)!=s.charAt(s.length-1))return 0;for(var l=0,a=Math.min(o.length,s.length),u=a,c=0;l<u;)o.substring(o.length-u,o.length-c)==s.substring(s.length-u,s.length-c)?(l=u,c=l):a=u,u=Math.floor((a-l)/2+l);return u},e.prototype.diff_commonOverlap_=function(o,s){var l=o.length,a=s.length;if(l==0||a==0)return 0;l>a?o=o.substring(l-a):l<a&&(s=s.substring(0,l));var u=Math.min(l,a);if(o==s)return u;for(var c=0,f=1;;){var h=o.substring(u-f),d=s.indexOf(h);if(d==-1)return c;f+=d,(d==0||o.substring(u-f)==s.substring(0,f))&&(c=f,f++)}},e.prototype.diff_halfMatch_=function(o,s){if(this.Diff_Timeout<=0)return null;var l=o.length>s.length?o:s,a=o.length>s.length?s:o;if(l.length<4||a.length*2<l.length)return null;var u=this;function c(y,S,k){for(var P=y.substring(k,k+Math.floor(y.length/4)),C=-1,w="",x,_,E,$;(C=S.indexOf(P,C+1))!=-1;){var j=u.diff_commonPrefix(y.substring(k),S.substring(C)),W=u.diff_commonSuffix(y.substring(0,k),S.substring(0,C));w.length<W+j&&(w=S.substring(C-W,C)+S.substring(C,C+j),x=y.substring(0,k-W),_=y.substring(k+j),E=S.substring(0,C-W),$=S.substring(C+j))}return w.length*2>=y.length?[x,_,E,$,w]:null}var f=c(l,a,Math.ceil(l.length/4)),h=c(l,a,Math.ceil(l.length/2)),d;if(!f&&!h)return null;h?f?d=f[4].length>h[4].length?f:h:d=h:d=f;var p,g,O,v;o.length>s.length?(p=d[0],g=d[1],O=d[2],v=d[3]):(O=d[0],v=d[1],p=d[2],g=d[3]);var m=d[4];return[p,g,O,v,m]},e.prototype.diff_cleanupSemantic=function(o){for(var s=!1,l=[],a=0,u=null,c=0,f=0,h=0,d=0,p=0;c<o.length;)o[c][0]==i?(l[a++]=c,f=d,h=p,d=0,p=0,u=o[c][1]):(o[c][0]==r?d+=o[c][1].length:p+=o[c][1].length,u&&u.length<=Math.max(f,h)&&u.length<=Math.max(d,p)&&(o.splice(l[a-1],0,new e.Diff(n,u)),o[l[a-1]+1][0]=r,a--,a--,c=a>0?l[a-1]:-1,f=0,h=0,d=0,p=0,u=null,s=!0)),c++;for(s&&this.diff_cleanupMerge(o),this.diff_cleanupSemanticLossless(o),c=1;c<o.length;){if(o[c-1][0]==n&&o[c][0]==r){var g=o[c-1][1],O=o[c][1],v=this.diff_commonOverlap_(g,O),m=this.diff_commonOverlap_(O,g);v>=m?(v>=g.length/2||v>=O.length/2)&&(o.splice(c,0,new e.Diff(i,O.substring(0,v))),o[c-1][1]=g.substring(0,g.length-v),o[c+1][1]=O.substring(v),c++):(m>=g.length/2||m>=O.length/2)&&(o.splice(c,0,new e.Diff(i,g.substring(0,m))),o[c-1][0]=r,o[c-1][1]=O.substring(0,O.length-m),o[c+1][0]=n,o[c+1][1]=g.substring(m),c++),c++}c++}},e.prototype.diff_cleanupSemanticLossless=function(o){function s(m,y){if(!m||!y)return 6;var S=m.charAt(m.length-1),k=y.charAt(0),P=S.match(e.nonAlphaNumericRegex_),C=k.match(e.nonAlphaNumericRegex_),w=P&&S.match(e.whitespaceRegex_),x=C&&k.match(e.whitespaceRegex_),_=w&&S.match(e.linebreakRegex_),E=x&&k.match(e.linebreakRegex_),$=_&&m.match(e.blanklineEndRegex_),j=E&&y.match(e.blanklineStartRegex_);return $||j?5:_||E?4:P&&!w&&x?3:w||x?2:P||C?1:0}for(var l=1;l<o.length-1;){if(o[l-1][0]==i&&o[l+1][0]==i){var a=o[l-1][1],u=o[l][1],c=o[l+1][1],f=this.diff_commonSuffix(a,u);if(f){var h=u.substring(u.length-f);a=a.substring(0,a.length-f),u=h+u.substring(0,u.length-f),c=h+c}for(var d=a,p=u,g=c,O=s(a,u)+s(u,c);u.charAt(0)===c.charAt(0);){a+=u.charAt(0),u=u.substring(1)+c.charAt(0),c=c.substring(1);var v=s(a,u)+s(u,c);v>=O&&(O=v,d=a,p=u,g=c)}o[l-1][1]!=d&&(d?o[l-1][1]=d:(o.splice(l-1,1),l--),o[l][1]=p,g?o[l+1][1]=g:(o.splice(l+1,1),l--))}l++}},e.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,e.whitespaceRegex_=/\s/,e.linebreakRegex_=/[\r\n]/,e.blanklineEndRegex_=/\n\r?\n$/,e.blanklineStartRegex_=/^\r?\n\r?\n/,e.prototype.diff_cleanupEfficiency=function(o){for(var s=!1,l=[],a=0,u=null,c=0,f=!1,h=!1,d=!1,p=!1;c<o.length;)o[c][0]==i?(o[c][1].length<this.Diff_EditCost&&(d||p)?(l[a++]=c,f=d,h=p,u=o[c][1]):(a=0,u=null),d=p=!1):(o[c][0]==n?p=!0:d=!0,u&&(f&&h&&d&&p||u.length<this.Diff_EditCost/2&&f+h+d+p==3)&&(o.splice(l[a-1],0,new e.Diff(n,u)),o[l[a-1]+1][0]=r,a--,u=null,f&&h?(d=p=!0,a=0):(a--,c=a>0?l[a-1]:-1,d=p=!1),s=!0)),c++;s&&this.diff_cleanupMerge(o)},e.prototype.diff_cleanupMerge=function(o){o.push(new e.Diff(i,""));for(var s=0,l=0,a=0,u="",c="",f;s<o.length;)switch(o[s][0]){case r:a++,c+=o[s][1],s++;break;case n:l++,u+=o[s][1],s++;break;case i:l+a>1?(l!==0&&a!==0&&(f=this.diff_commonPrefix(c,u),f!==0&&(s-l-a>0&&o[s-l-a-1][0]==i?o[s-l-a-1][1]+=c.substring(0,f):(o.splice(0,0,new e.Diff(i,c.substring(0,f))),s++),c=c.substring(f),u=u.substring(f)),f=this.diff_commonSuffix(c,u),f!==0&&(o[s][1]=c.substring(c.length-f)+o[s][1],c=c.substring(0,c.length-f),u=u.substring(0,u.length-f))),s-=l+a,o.splice(s,l+a),u.length&&(o.splice(s,0,new e.Diff(n,u)),s++),c.length&&(o.splice(s,0,new e.Diff(r,c)),s++),s++):s!==0&&o[s-1][0]==i?(o[s-1][1]+=o[s][1],o.splice(s,1)):s++,a=0,l=0,u="",c="";break}o[o.length-1][1]===""&&o.pop();var h=!1;for(s=1;s<o.length-1;)o[s-1][0]==i&&o[s+1][0]==i&&(o[s][1].substring(o[s][1].length-o[s-1][1].length)==o[s-1][1]?(o[s][1]=o[s-1][1]+o[s][1].substring(0,o[s][1].length-o[s-1][1].length),o[s+1][1]=o[s-1][1]+o[s+1][1],o.splice(s-1,1),h=!0):o[s][1].substring(0,o[s+1][1].length)==o[s+1][1]&&(o[s-1][1]+=o[s+1][1],o[s][1]=o[s][1].substring(o[s+1][1].length)+o[s+1][1],o.splice(s+1,1),h=!0)),s++;h&&this.diff_cleanupMerge(o)},e.prototype.diff_xIndex=function(o,s){var l=0,a=0,u=0,c=0,f;for(f=0;f<o.length&&(o[f][0]!==r&&(l+=o[f][1].length),o[f][0]!==n&&(a+=o[f][1].length),!(l>s));f++)u=l,c=a;return o.length!=f&&o[f][0]===n?c:c+(s-u)},e.prototype.diff_prettyHtml=function(o){for(var s=[],l=/&/g,a=/</g,u=/>/g,c=/\n/g,f=0;f<o.length;f++){var h=o[f][0],d=o[f][1],p=d.replace(l,"&amp;").replace(a,"&lt;").replace(u,"&gt;").replace(c,"&para;<br>");switch(h){case r:s[f]='<ins style="background:#e6ffe6;">'+p+"</ins>";break;case n:s[f]='<del style="background:#ffe6e6;">'+p+"</del>";break;case i:s[f]="<span>"+p+"</span>";break}}return s.join("")},e.prototype.diff_text1=function(o){for(var s=[],l=0;l<o.length;l++)o[l][0]!==r&&(s[l]=o[l][1]);return s.join("")},e.prototype.diff_text2=function(o){for(var s=[],l=0;l<o.length;l++)o[l][0]!==n&&(s[l]=o[l][1]);return s.join("")},e.prototype.diff_levenshtein=function(o){for(var s=0,l=0,a=0,u=0;u<o.length;u++){var c=o[u][0],f=o[u][1];switch(c){case r:l+=f.length;break;case n:a+=f.length;break;case i:s+=Math.max(l,a),l=0,a=0;break}}return s+=Math.max(l,a),s},e.prototype.diff_toDelta=function(o){for(var s=[],l=0;l<o.length;l++)switch(o[l][0]){case r:s[l]="+"+encodeURI(o[l][1]);break;case n:s[l]="-"+o[l][1].length;break;case i:s[l]="="+o[l][1].length;break}return s.join(" ").replace(/%20/g," ")},e.prototype.diff_fromDelta=function(o,s){for(var l=[],a=0,u=0,c=s.split(/\t/g),f=0;f<c.length;f++){var h=c[f].substring(1);switch(c[f].charAt(0)){case"+":try{l[a++]=new e.Diff(r,decodeURI(h))}catch{throw new Error("Illegal escape in diff_fromDelta: "+h)}break;case"-":case"=":var d=parseInt(h,10);if(isNaN(d)||d<0)throw new Error("Invalid number in diff_fromDelta: "+h);var p=o.substring(u,u+=d);c[f].charAt(0)=="="?l[a++]=new e.Diff(i,p):l[a++]=new e.Diff(n,p);break;default:if(c[f])throw new Error("Invalid diff operation in diff_fromDelta: "+c[f])}}if(u!=o.length)throw new Error("Delta length ("+u+") does not equal source text length ("+o.length+").");return l},e.prototype.match_main=function(o,s,l){if(o==null||s==null||l==null)throw new Error("Null input. (match_main)");return l=Math.max(0,Math.min(l,o.length)),o==s?0:o.length?o.substring(l,l+s.length)==s?l:this.match_bitap_(o,s,l):-1},e.prototype.match_bitap_=function(o,s,l){if(s.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var a=this.match_alphabet_(s),u=this;function c(x,_){var E=x/s.length,$=Math.abs(l-_);return u.Match_Distance?E+$/u.Match_Distance:$?1:E}var f=this.Match_Threshold,h=o.indexOf(s,l);h!=-1&&(f=Math.min(c(0,h),f),h=o.lastIndexOf(s,l+s.length),h!=-1&&(f=Math.min(c(0,h),f)));var d=1<<s.length-1;h=-1;for(var p,g,O=s.length+o.length,v,m=0;m<s.length;m++){for(p=0,g=O;p<g;)c(m,l+g)<=f?p=g:O=g,g=Math.floor((O-p)/2+p);O=g;var y=Math.max(1,l-g+1),S=Math.min(l+g,o.length)+s.length,k=Array(S+2);k[S+1]=(1<<m)-1;for(var P=S;P>=y;P--){var C=a[o.charAt(P-1)];if(m===0?k[P]=(k[P+1]<<1|1)&C:k[P]=(k[P+1]<<1|1)&C|((v[P+1]|v[P])<<1|1)|v[P+1],k[P]&d){var w=c(m,P-1);if(w<=f)if(f=w,h=P-1,h>l)y=Math.max(1,2*l-h);else break}}if(c(m+1,l)>f)break;v=k}return h},e.prototype.match_alphabet_=function(o){for(var s={},l=0;l<o.length;l++)s[o.charAt(l)]=0;for(var l=0;l<o.length;l++)s[o.charAt(l)]|=1<<o.length-l-1;return s},e.prototype.patch_addContext_=function(o,s){if(s.length!=0){if(o.start2===null)throw Error("patch not initialized");for(var l=s.substring(o.start2,o.start2+o.length1),a=0;s.indexOf(l)!=s.lastIndexOf(l)&&l.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)a+=this.Patch_Margin,l=s.substring(o.start2-a,o.start2+o.length1+a);a+=this.Patch_Margin;var u=s.substring(o.start2-a,o.start2);u&&o.diffs.unshift(new e.Diff(i,u));var c=s.substring(o.start2+o.length1,o.start2+o.length1+a);c&&o.diffs.push(new e.Diff(i,c)),o.start1-=u.length,o.start2-=u.length,o.length1+=u.length+c.length,o.length2+=u.length+c.length}},e.prototype.patch_make=function(o,s,l){var a,u;if(typeof o=="string"&&typeof s=="string"&&typeof l>"u")a=o,u=this.diff_main(a,s,!0),u.length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(o&&typeof o=="object"&&typeof s>"u"&&typeof l>"u")u=o,a=this.diff_text1(u);else if(typeof o=="string"&&s&&typeof s=="object"&&typeof l>"u")a=o,u=s;else if(typeof o=="string"&&typeof s=="string"&&l&&typeof l=="object")a=o,u=l;else throw new Error("Unknown call format to patch_make.");if(u.length===0)return[];for(var c=[],f=new e.patch_obj,h=0,d=0,p=0,g=a,O=a,v=0;v<u.length;v++){var m=u[v][0],y=u[v][1];switch(!h&&m!==i&&(f.start1=d,f.start2=p),m){case r:f.diffs[h++]=u[v],f.length2+=y.length,O=O.substring(0,p)+y+O.substring(p);break;case n:f.length1+=y.length,f.diffs[h++]=u[v],O=O.substring(0,p)+O.substring(p+y.length);break;case i:y.length<=2*this.Patch_Margin&&h&&u.length!=v+1?(f.diffs[h++]=u[v],f.length1+=y.length,f.length2+=y.length):y.length>=2*this.Patch_Margin&&h&&(this.patch_addContext_(f,g),c.push(f),f=new e.patch_obj,h=0,g=O,d=p);break}m!==r&&(d+=y.length),m!==n&&(p+=y.length)}return h&&(this.patch_addContext_(f,g),c.push(f)),c},e.prototype.patch_deepCopy=function(o){for(var s=[],l=0;l<o.length;l++){var a=o[l],u=new e.patch_obj;u.diffs=[];for(var c=0;c<a.diffs.length;c++)u.diffs[c]=new e.Diff(a.diffs[c][0],a.diffs[c][1]);u.start1=a.start1,u.start2=a.start2,u.length1=a.length1,u.length2=a.length2,s[l]=u}return s},e.prototype.patch_apply=function(o,s){if(o.length==0)return[s,[]];o=this.patch_deepCopy(o);var l=this.patch_addPadding(o);s=l+s+l,this.patch_splitMax(o);for(var a=0,u=[],c=0;c<o.length;c++){var f=o[c].start2+a,h=this.diff_text1(o[c].diffs),d,p=-1;if(h.length>this.Match_MaxBits?(d=this.match_main(s,h.substring(0,this.Match_MaxBits),f),d!=-1&&(p=this.match_main(s,h.substring(h.length-this.Match_MaxBits),f+h.length-this.Match_MaxBits),(p==-1||d>=p)&&(d=-1))):d=this.match_main(s,h,f),d==-1)u[c]=!1,a-=o[c].length2-o[c].length1;else{u[c]=!0,a=d-f;var g;if(p==-1?g=s.substring(d,d+h.length):g=s.substring(d,p+this.Match_MaxBits),h==g)s=s.substring(0,d)+this.diff_text2(o[c].diffs)+s.substring(d+h.length);else{var O=this.diff_main(h,g,!1);if(h.length>this.Match_MaxBits&&this.diff_levenshtein(O)/h.length>this.Patch_DeleteThreshold)u[c]=!1;else{this.diff_cleanupSemanticLossless(O);for(var v=0,m,y=0;y<o[c].diffs.length;y++){var S=o[c].diffs[y];S[0]!==i&&(m=this.diff_xIndex(O,v)),S[0]===r?s=s.substring(0,d+m)+S[1]+s.substring(d+m):S[0]===n&&(s=s.substring(0,d+m)+s.substring(d+this.diff_xIndex(O,v+S[1].length))),S[0]!==n&&(v+=S[1].length)}}}}}return s=s.substring(l.length,s.length-l.length),[s,u]},e.prototype.patch_addPadding=function(o){for(var s=this.Patch_Margin,l="",a=1;a<=s;a++)l+=String.fromCharCode(a);for(var a=0;a<o.length;a++)o[a].start1+=s,o[a].start2+=s;var u=o[0],c=u.diffs;if(c.length==0||c[0][0]!=i)c.unshift(new e.Diff(i,l)),u.start1-=s,u.start2-=s,u.length1+=s,u.length2+=s;else if(s>c[0][1].length){var f=s-c[0][1].length;c[0][1]=l.substring(c[0][1].length)+c[0][1],u.start1-=f,u.start2-=f,u.length1+=f,u.length2+=f}if(u=o[o.length-1],c=u.diffs,c.length==0||c[c.length-1][0]!=i)c.push(new e.Diff(i,l)),u.length1+=s,u.length2+=s;else if(s>c[c.length-1][1].length){var f=s-c[c.length-1][1].length;c[c.length-1][1]+=l.substring(0,f),u.length1+=f,u.length2+=f}return l},e.prototype.patch_splitMax=function(o){for(var s=this.Match_MaxBits,l=0;l<o.length;l++)if(!(o[l].length1<=s)){var a=o[l];o.splice(l--,1);for(var u=a.start1,c=a.start2,f="";a.diffs.length!==0;){var h=new e.patch_obj,d=!0;for(h.start1=u-f.length,h.start2=c-f.length,f!==""&&(h.length1=h.length2=f.length,h.diffs.push(new e.Diff(i,f)));a.diffs.length!==0&&h.length1<s-this.Patch_Margin;){var p=a.diffs[0][0],g=a.diffs[0][1];p===r?(h.length2+=g.length,c+=g.length,h.diffs.push(a.diffs.shift()),d=!1):p===n&&h.diffs.length==1&&h.diffs[0][0]==i&&g.length>2*s?(h.length1+=g.length,u+=g.length,d=!1,h.diffs.push(new e.Diff(p,g)),a.diffs.shift()):(g=g.substring(0,s-h.length1-this.Patch_Margin),h.length1+=g.length,u+=g.length,p===i?(h.length2+=g.length,c+=g.length):d=!1,h.diffs.push(new e.Diff(p,g)),g==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(g.length))}f=this.diff_text2(h.diffs),f=f.substring(f.length-this.Patch_Margin);var O=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);O!==""&&(h.length1+=O.length,h.length2+=O.length,h.diffs.length!==0&&h.diffs[h.diffs.length-1][0]===i?h.diffs[h.diffs.length-1][1]+=O:h.diffs.push(new e.Diff(i,O))),d||o.splice(++l,0,h)}}},e.prototype.patch_toText=function(o){for(var s=[],l=0;l<o.length;l++)s[l]=o[l];return s.join("")},e.prototype.patch_fromText=function(o){var s=[];if(!o)return s;for(var l=o.split(`
106
- `),a=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;a<l.length;){var c=l[a].match(u);if(!c)throw new Error("Invalid patch string: "+l[a]);var f=new e.patch_obj;for(s.push(f),f.start1=parseInt(c[1],10),c[2]===""?(f.start1--,f.length1=1):c[2]=="0"?f.length1=0:(f.start1--,f.length1=parseInt(c[2],10)),f.start2=parseInt(c[3],10),c[4]===""?(f.start2--,f.length2=1):c[4]=="0"?f.length2=0:(f.start2--,f.length2=parseInt(c[4],10)),a++;a<l.length;){var h=l[a].charAt(0);try{var d=decodeURI(l[a].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+d)}if(h=="-")f.diffs.push(new e.Diff(n,d));else if(h=="+")f.diffs.push(new e.Diff(r,d));else if(h==" ")f.diffs.push(new e.Diff(i,d));else{if(h=="@")break;if(h!=="")throw new Error('Invalid patch mode "'+h+'" in: '+d)}a++}}return s},e.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},e.patch_obj.prototype.toString=function(){var o,s;this.length1===0?o=this.start1+",0":this.length1==1?o=this.start1+1:o=this.start1+1+","+this.length1,this.length2===0?s=this.start2+",0":this.length2==1?s=this.start2+1:s=this.start2+1+","+this.length2;for(var l=["@@ -"+o+" +"+s+` @@
107
- `],a,u=0;u<this.diffs.length;u++){switch(this.diffs[u][0]){case r:a="+";break;case n:a="-";break;case i:a=" ";break}l[u+1]=a+encodeURI(this.diffs[u][1])+`
108
- `}return l.join("").replace(/%20/g," ")},t.exports=e,t.exports.diff_match_patch=e,t.exports.DIFF_DELETE=n,t.exports.DIFF_INSERT=r,t.exports.DIFF_EQUAL=i})(U$);var sB=U$.exports;const lB=vi(sB),aB=(t,e)=>oB(t,e,lB,i0,sE),uB=t=>Z.useCallback(n=>{const r=t.data,i=aB(r,n(r));i&&t&&t.submitOp(i)},[t]),cB=({connection:t})=>{const[e,n]=Z.useState(null),[r,i]=Z.useState(null),[o,s]=Z.useState(null),[l,a]=Z.useState(null);Z.useEffect(()=>{const c="documents",f="1",h=t.get(c,f);return h.subscribe(()=>{n(h),a(h.data),h.on("op",()=>{a(h.data)});const d=t.getDocPresence(c,f);d.subscribe(function(g){if(g)throw g});const p=()=>{const g=Date.now().toString(36),O=f$();return`${g}-${O}`};i(d.create(p())),s(d)}),()=>{}},[]);const u=uB(e);return{shareDBDoc:e,content:l,localPresence:r,docPresence:o,submitOperation:u}};var Bv={exports:{}},F$={exports:{}};(function(t){function e(n){return n&&n.__esModule?n:{default:n}}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports})(F$);var Pt=F$.exports,wm={exports:{}};/*!
109
- Copyright (c) 2018 Jed Watson.
110
- Licensed under the MIT License (MIT), see
111
- http://jedwatson.github.io/classnames
112
- */var Zw;function Ht(){return Zw||(Zw=1,function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var s=typeof o;if(s==="string"||s==="number")r.push(o);else if(Array.isArray(o)){if(o.length){var l=n.apply(null,o);l&&r.push(l)}}else if(s==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var a in o)e.call(o,a)&&o[a]&&r.push(a)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()}(wm)),wm.exports}var km={exports:{}},xm,Ww;function fB(){if(Ww)return xm;Ww=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xm=t,xm}var _m,Bw;function hB(){if(Bw)return _m;Bw=1;var t=fB();function e(){}function n(){}return n.resetWarningCache=e,_m=function(){function r(s,l,a,u,c,f){if(f!==t){var h=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 h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},_m}var Xw;function Of(){return Xw||(Xw=1,km.exports=hB()()),km.exports}var ch={exports:{}},fh={exports:{}},Yw;function q$(){return Yw||(Yw=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=a(Z),o=n(Of()),s=ee;function l(f){if(typeof WeakMap!="function")return null;var h=new WeakMap,d=new WeakMap;return(l=function(p){return p?d:h})(f)}function a(f,h){if(!h&&f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var d=l(h);if(d&&d.has(f))return d.get(f);var p={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in f)if(O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)){var v=g?Object.getOwnPropertyDescriptor(f,O):null;v&&(v.get||v.set)?Object.defineProperty(p,O,v):p[O]=f[O]}return p.default=f,d&&d.set(f,p),p}const u={type:o.default.string,tooltip:o.default.bool,as:o.default.elementType},c=i.forwardRef(({as:f="div",className:h,type:d="valid",tooltip:p=!1,...g},O)=>(0,s.jsx)(f,{...g,ref:O,className:(0,r.default)(h,`${d}-${p?"tooltip":"feedback"}`)}));c.displayName="Feedback",c.propTypes=u,e.default=c,t.exports=e.default}(fh,fh.exports)),fh.exports}var hh={exports:{}},dh={exports:{}},Uw;function Es(){return Uw||(Uw=1,function(t,e){"use client";e.__esModule=!0,e.default=void 0;var n=i(Z);function r(s){if(typeof WeakMap!="function")return null;var l=new WeakMap,a=new WeakMap;return(r=function(u){return u?a:l})(s)}function i(s,l){if(!l&&s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var a=r(l);if(a&&a.has(s))return a.get(s);var u={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var h=c?Object.getOwnPropertyDescriptor(s,f):null;h&&(h.get||h.set)?Object.defineProperty(u,f,h):u[f]=s[f]}return u.default=s,a&&a.set(s,u),u}const o=n.createContext({});e.default=o,t.exports=e.default}(dh,dh.exports)),dh.exports}var hr={},Fw;function kn(){if(Fw)return hr;Fw=1,hr.__esModule=!0,hr.ThemeConsumer=hr.DEFAULT_MIN_BREAKPOINT=hr.DEFAULT_BREAKPOINTS=void 0,hr.createBootstrapComponent=g,hr.default=void 0,hr.useBootstrapBreakpoints=h,hr.useBootstrapMinBreakpoint=d,hr.useBootstrapPrefix=f,hr.useIsRTL=p;var t=i(Z),e=t,n=ee;function r(O){if(typeof WeakMap!="function")return null;var v=new WeakMap,m=new WeakMap;return(r=function(y){return y?m:v})(O)}function i(O,v){if(!v&&O&&O.__esModule)return O;if(O===null||typeof O!="object"&&typeof O!="function")return{default:O};var m=r(v);if(m&&m.has(O))return m.get(O);var y={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in O)if(k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)){var P=S?Object.getOwnPropertyDescriptor(O,k):null;P&&(P.get||P.set)?Object.defineProperty(y,k,P):y[k]=O[k]}return y.default=O,m&&m.set(O,y),y}const o=hr.DEFAULT_BREAKPOINTS=["xxl","xl","lg","md","sm","xs"],s=hr.DEFAULT_MIN_BREAKPOINT="xs",l=e.createContext({prefixes:{},breakpoints:o,minBreakpoint:s}),{Consumer:a,Provider:u}=l;hr.ThemeConsumer=a;function c({prefixes:O={},breakpoints:v=o,minBreakpoint:m=s,dir:y,children:S}){const k=(0,t.useMemo)(()=>({prefixes:{...O},breakpoints:v,minBreakpoint:m,dir:y}),[O,v,m,y]);return(0,n.jsx)(u,{value:k,children:S})}function f(O,v){const{prefixes:m}=(0,t.useContext)(l);return O||m[v]||v}function h(){const{breakpoints:O}=(0,t.useContext)(l);return O}function d(){const{minBreakpoint:O}=(0,t.useContext)(l);return O}function p(){const{dir:O}=(0,t.useContext)(l);return O==="rtl"}function g(O,v){typeof v=="string"&&(v={prefix:v});const m=O.prototype&&O.prototype.isReactComponent,{prefix:y,forwardRefAs:S=m?"ref":"innerRef"}=v,k=e.forwardRef(({...P},C)=>{P[S]=C;const w=f(P.bsPrefix,y);return(0,n.jsx)(O,{...P,bsPrefix:w})});return k.displayName=`Bootstrap(${O.displayName||O.name})`,k}return hr.default=c,hr}var qw;function dB(){return qw||(qw=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=c(Z),o=i,s=n(Es()),l=kn(),a=ee;function u(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(u=function(g){return g?p:d})(h)}function c(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=u(d);if(p&&p.has(h))return p.get(h);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}const f=o.forwardRef(({id:h,bsPrefix:d,className:p,type:g="checkbox",isValid:O=!1,isInvalid:v=!1,as:m="input",...y},S)=>{const{controlId:k}=(0,i.useContext)(s.default);return d=(0,l.useBootstrapPrefix)(d,"form-check-input"),(0,a.jsx)(m,{...y,ref:S,type:g,id:h||k,className:(0,r.default)(p,d,O&&"is-valid",v&&"is-invalid")})});f.displayName="FormCheckInput",e.default=f,t.exports=e.default}(hh,hh.exports)),hh.exports}var ph={exports:{}},zw;function pB(){return zw||(zw=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=c(Z),o=i,s=n(Es()),l=kn(),a=ee;function u(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(u=function(g){return g?p:d})(h)}function c(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=u(d);if(p&&p.has(h))return p.get(h);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}const f=o.forwardRef(({bsPrefix:h,className:d,htmlFor:p,...g},O)=>{const{controlId:v}=(0,i.useContext)(s.default);return h=(0,l.useBootstrapPrefix)(h,"form-check-label"),(0,a.jsx)("label",{...g,ref:O,htmlFor:p||v,className:(0,r.default)(d,h)})});f.displayName="FormCheckLabel",e.default=f,t.exports=e.default}(ph,ph.exports)),ph.exports}var Il={},Vw;function gB(){if(Vw)return Il;Vw=1,Il.__esModule=!0,Il.forEach=i,Il.hasChildOfType=o,Il.map=r;var t=n(Z);function e(s){if(typeof WeakMap!="function")return null;var l=new WeakMap,a=new WeakMap;return(e=function(u){return u?a:l})(s)}function n(s,l){if(!l&&s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var a=e(l);if(a&&a.has(s))return a.get(s);var u={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var h=c?Object.getOwnPropertyDescriptor(s,f):null;h&&(h.get||h.set)?Object.defineProperty(u,f,h):u[f]=s[f]}return u.default=s,a&&a.set(s,u),u}function r(s,l){let a=0;return t.Children.map(s,u=>t.isValidElement(u)?l(u,a++):u)}function i(s,l){let a=0;t.Children.forEach(s,u=>{t.isValidElement(u)&&l(u,a++)})}function o(s,l){return t.Children.toArray(s).some(a=>t.isValidElement(a)&&a.type===l)}return Il}var Gw;function z$(){return Gw||(Gw=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=p(Z),o=i,s=n(q$()),l=n(dB()),a=n(pB()),u=n(Es()),c=kn(),f=gB(),h=ee;function d(O){if(typeof WeakMap!="function")return null;var v=new WeakMap,m=new WeakMap;return(d=function(y){return y?m:v})(O)}function p(O,v){if(!v&&O&&O.__esModule)return O;if(O===null||typeof O!="object"&&typeof O!="function")return{default:O};var m=d(v);if(m&&m.has(O))return m.get(O);var y={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in O)if(k!=="default"&&Object.prototype.hasOwnProperty.call(O,k)){var P=S?Object.getOwnPropertyDescriptor(O,k):null;P&&(P.get||P.set)?Object.defineProperty(y,k,P):y[k]=O[k]}return y.default=O,m&&m.set(O,y),y}const g=o.forwardRef(({id:O,bsPrefix:v,bsSwitchPrefix:m,inline:y=!1,reverse:S=!1,disabled:k=!1,isValid:P=!1,isInvalid:C=!1,feedbackTooltip:w=!1,feedback:x,feedbackType:_,className:E,style:$,title:j="",type:W="checkbox",label:G,children:M,as:L="input",...N},Y)=>{v=(0,c.useBootstrapPrefix)(v,"form-check"),m=(0,c.useBootstrapPrefix)(m,"form-switch");const{controlId:q}=(0,i.useContext)(u.default),ae=(0,i.useMemo)(()=>({controlId:O||q}),[q,O]),pe=!M&&G!=null&&G!==!1||(0,f.hasChildOfType)(M,a.default),U=(0,h.jsx)(l.default,{...N,type:W==="switch"?"checkbox":W,ref:Y,isValid:P,isInvalid:C,disabled:k,as:L});return(0,h.jsx)(u.default.Provider,{value:ae,children:(0,h.jsx)("div",{style:$,className:(0,r.default)(E,pe&&v,y&&`${v}-inline`,S&&`${v}-reverse`,W==="switch"&&m),children:M||(0,h.jsxs)(h.Fragment,{children:[U,pe&&(0,h.jsx)(a.default,{title:j,children:G}),x&&(0,h.jsx)(s.default,{type:_,tooltip:w,children:x})]})})})});g.displayName="FormCheck",e.default=Object.assign(g,{Input:l.default,Label:a.default}),t.exports=e.default}(ch,ch.exports)),ch.exports}var gh={exports:{}},Pm,Hw;function pg(){if(Hw)return Pm;Hw=1;var t=function(){};return Pm=t,Pm}var Kw;function mB(){return Kw||(Kw=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=f(Z),o=i;n(pg());var s=n(q$()),l=n(Es()),a=kn(),u=ee;function c(d){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:p})(d)}function f(d,p){if(!p&&d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var g=c(p);if(g&&g.has(d))return g.get(d);var O={__proto__:null},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in d)if(m!=="default"&&Object.prototype.hasOwnProperty.call(d,m)){var y=v?Object.getOwnPropertyDescriptor(d,m):null;y&&(y.get||y.set)?Object.defineProperty(O,m,y):O[m]=d[m]}return O.default=d,g&&g.set(d,O),O}const h=o.forwardRef(({bsPrefix:d,type:p,size:g,htmlSize:O,id:v,className:m,isValid:y=!1,isInvalid:S=!1,plaintext:k,readOnly:P,as:C="input",...w},x)=>{const{controlId:_}=(0,i.useContext)(l.default);return d=(0,a.useBootstrapPrefix)(d,"form-control"),(0,u.jsx)(C,{...w,type:p,size:O,ref:x,readOnly:P,id:v||_,className:(0,r.default)(m,k?`${d}-plaintext`:d,g&&`${d}-${g}`,p==="color"&&`${d}-color`,y&&"is-valid",S&&"is-invalid")})});h.displayName="FormControl",e.default=Object.assign(h,{Feedback:s.default}),t.exports=e.default}(gh,gh.exports)),gh.exports}var mh={exports:{}},Jw;function OB(){return Jw||(Jw=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=a(Z),i=n(Ht()),o=kn(),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=r.forwardRef(({className:c,bsPrefix:f,as:h="div",...d},p)=>(f=(0,o.useBootstrapPrefix)(f,"form-floating"),(0,s.jsx)(h,{ref:p,className:(0,i.default)(c,f),...d})));u.displayName="FormFloating",e.default=u,t.exports=e.default}(mh,mh.exports)),mh.exports}var Oh={exports:{}},ek;function V$(){return ek||(ek=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=void 0;var r=a(Z),i=r,o=n(Es()),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=i.forwardRef(({controlId:c,as:f="div",...h},d)=>{const p=(0,r.useMemo)(()=>({controlId:c}),[c]);return(0,s.jsx)(o.default.Provider,{value:p,children:(0,s.jsx)(f,{...h,ref:d})})});u.displayName="FormGroup",e.default=u,t.exports=e.default}(Oh,Oh.exports)),Oh.exports}var vh={exports:{}},Ll={},tk;function vB(){if(tk)return Ll;tk=1;var t=Pt;Ll.__esModule=!0,Ll.default=void 0,Ll.useCol=l;var e=t(Ht()),n=s(Z),r=kn(),i=ee;function o(u){if(typeof WeakMap!="function")return null;var c=new WeakMap,f=new WeakMap;return(o=function(h){return h?f:c})(u)}function s(u,c){if(!c&&u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var f=o(c);if(f&&f.has(u))return f.get(u);var h={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in u)if(p!=="default"&&Object.prototype.hasOwnProperty.call(u,p)){var g=d?Object.getOwnPropertyDescriptor(u,p):null;g&&(g.get||g.set)?Object.defineProperty(h,p,g):h[p]=u[p]}return h.default=u,f&&f.set(u,h),h}function l({as:u,bsPrefix:c,className:f,...h}){c=(0,r.useBootstrapPrefix)(c,"col");const d=(0,r.useBootstrapBreakpoints)(),p=(0,r.useBootstrapMinBreakpoint)(),g=[],O=[];return d.forEach(v=>{const m=h[v];delete h[v];let y,S,k;typeof m=="object"&&m!=null?{span:y,offset:S,order:k}=m:y=m;const P=v!==p?`-${v}`:"";y&&g.push(y===!0?`${c}${P}`:`${c}${P}-${y}`),k!=null&&O.push(`order${P}-${k}`),S!=null&&O.push(`offset${P}-${S}`)}),[{...h,className:(0,e.default)(f,...g,...O)},{as:u,bsPrefix:c,spans:g}]}const a=n.forwardRef((u,c)=>{const[{className:f,...h},{as:d="div",bsPrefix:p,spans:g}]=l(u);return(0,i.jsx)(d,{...h,ref:c,className:(0,e.default)(f,!g.length&&p)})});return a.displayName="Col",Ll.default=a,Ll}var nk;function yB(){return nk||(nk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=f(Z),o=i;n(pg());var s=n(vB()),l=n(Es()),a=kn(),u=ee;function c(d){if(typeof WeakMap!="function")return null;var p=new WeakMap,g=new WeakMap;return(c=function(O){return O?g:p})(d)}function f(d,p){if(!p&&d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var g=c(p);if(g&&g.has(d))return g.get(d);var O={__proto__:null},v=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in d)if(m!=="default"&&Object.prototype.hasOwnProperty.call(d,m)){var y=v?Object.getOwnPropertyDescriptor(d,m):null;y&&(y.get||y.set)?Object.defineProperty(O,m,y):O[m]=d[m]}return O.default=d,g&&g.set(d,O),O}const h=o.forwardRef(({as:d="label",bsPrefix:p,column:g=!1,visuallyHidden:O=!1,className:v,htmlFor:m,...y},S)=>{const{controlId:k}=(0,i.useContext)(l.default);p=(0,a.useBootstrapPrefix)(p,"form-label");let P="col-form-label";typeof g=="string"&&(P=`${P} ${P}-${g}`);const C=(0,r.default)(v,p,O&&"visually-hidden",g&&P);return m=m||k,g?(0,u.jsx)(s.default,{ref:S,as:"label",className:C,htmlFor:m,...y}):(0,u.jsx)(d,{ref:S,className:C,htmlFor:m,...y})});h.displayName="FormLabel",e.default=h,t.exports=e.default}(vh,vh.exports)),vh.exports}var yh={exports:{}},rk;function SB(){return rk||(rk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=c(Z),o=i,s=kn(),l=n(Es()),a=ee;function u(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(u=function(g){return g?p:d})(h)}function c(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=u(d);if(p&&p.has(h))return p.get(h);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}const f=o.forwardRef(({bsPrefix:h,className:d,id:p,...g},O)=>{const{controlId:v}=(0,i.useContext)(l.default);return h=(0,s.useBootstrapPrefix)(h,"form-range"),(0,a.jsx)("input",{...g,type:"range",ref:O,className:(0,r.default)(d,h),id:p||v})});f.displayName="FormRange",e.default=f,t.exports=e.default}(yh,yh.exports)),yh.exports}var Sh={exports:{}},ik;function bB(){return ik||(ik=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=c(Z),o=i,s=kn(),l=n(Es()),a=ee;function u(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(u=function(g){return g?p:d})(h)}function c(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=u(d);if(p&&p.has(h))return p.get(h);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}const f=o.forwardRef(({bsPrefix:h,size:d,htmlSize:p,className:g,isValid:O=!1,isInvalid:v=!1,id:m,...y},S)=>{const{controlId:k}=(0,i.useContext)(l.default);return h=(0,s.useBootstrapPrefix)(h,"form-select"),(0,a.jsx)("select",{...y,size:p,ref:S,className:(0,r.default)(g,h,d&&`${h}-${d}`,O&&"is-valid",v&&"is-invalid"),id:m||k})});f.displayName="FormSelect",e.default=f,t.exports=e.default}(Sh,Sh.exports)),Sh.exports}var bh={exports:{}},ok;function wB(){return ok||(ok=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=a(Z),o=kn(),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=i.forwardRef(({bsPrefix:c,className:f,as:h="small",muted:d,...p},g)=>(c=(0,o.useBootstrapPrefix)(c,"form-text"),(0,s.jsx)(h,{...p,ref:g,className:(0,r.default)(f,c,d&&"text-muted")})));u.displayName="FormText",e.default=u,t.exports=e.default}(bh,bh.exports)),bh.exports}var wh={exports:{}},sk;function kB(){return sk||(sk=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=void 0;var r=l(Z),i=n(z$()),o=ee;function s(u){if(typeof WeakMap!="function")return null;var c=new WeakMap,f=new WeakMap;return(s=function(h){return h?f:c})(u)}function l(u,c){if(!c&&u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var f=s(c);if(f&&f.has(u))return f.get(u);var h={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in u)if(p!=="default"&&Object.prototype.hasOwnProperty.call(u,p)){var g=d?Object.getOwnPropertyDescriptor(u,p):null;g&&(g.get||g.set)?Object.defineProperty(h,p,g):h[p]=u[p]}return h.default=u,f&&f.set(u,h),h}const a=r.forwardRef((u,c)=>(0,o.jsx)(i.default,{...u,ref:c,type:"switch"}));a.displayName="Switch",e.default=Object.assign(a,{Input:i.default.Input,Label:i.default.Label}),t.exports=e.default}(wh,wh.exports)),wh.exports}var kh={exports:{}},lk;function xB(){return lk||(lk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=u(Z),o=n(V$()),s=kn(),l=ee;function a(f){if(typeof WeakMap!="function")return null;var h=new WeakMap,d=new WeakMap;return(a=function(p){return p?d:h})(f)}function u(f,h){if(!h&&f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var d=a(h);if(d&&d.has(f))return d.get(f);var p={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in f)if(O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)){var v=g?Object.getOwnPropertyDescriptor(f,O):null;v&&(v.get||v.set)?Object.defineProperty(p,O,v):p[O]=f[O]}return p.default=f,d&&d.set(f,p),p}const c=i.forwardRef(({bsPrefix:f,className:h,children:d,controlId:p,label:g,...O},v)=>(f=(0,s.useBootstrapPrefix)(f,"form-floating"),(0,l.jsxs)(o.default,{ref:v,className:(0,r.default)(h,f),controlId:p,...O,children:[d,(0,l.jsx)("label",{htmlFor:p,children:g})]})));c.displayName="FloatingLabel",e.default=c,t.exports=e.default}(kh,kh.exports)),kh.exports}(function(t,e){var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=n(Of()),o=m(Z),s=n(z$()),l=n(mB()),a=n(OB()),u=n(V$()),c=n(yB()),f=n(SB()),h=n(bB()),d=n(wB()),p=n(kB()),g=n(xB()),O=ee;function v(k){if(typeof WeakMap!="function")return null;var P=new WeakMap,C=new WeakMap;return(v=function(w){return w?C:P})(k)}function m(k,P){if(!P&&k&&k.__esModule)return k;if(k===null||typeof k!="object"&&typeof k!="function")return{default:k};var C=v(P);if(C&&C.has(k))return C.get(k);var w={__proto__:null},x=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _ in k)if(_!=="default"&&Object.prototype.hasOwnProperty.call(k,_)){var E=x?Object.getOwnPropertyDescriptor(k,_):null;E&&(E.get||E.set)?Object.defineProperty(w,_,E):w[_]=k[_]}return w.default=k,C&&C.set(k,w),w}const y={_ref:i.default.any,validated:i.default.bool,as:i.default.elementType},S=o.forwardRef(({className:k,validated:P,as:C="form",...w},x)=>(0,O.jsx)(C,{...w,ref:x,className:(0,r.default)(k,P&&"was-validated")}));S.displayName="Form",S.propTypes=y,e.default=Object.assign(S,{Group:u.default,Control:l.default,Floating:a.default,Check:s.default,Switch:p.default,Label:c.default,Text:d.default,Range:f.default,Select:h.default,FloatingLabel:g.default}),t.exports=e.default})(Bv,Bv.exports);var _B=Bv.exports;const Ei=vi(_B);var Xv={exports:{}},Ls={},ak;function PB(){if(ak)return Ls;ak=1,Ls.__esModule=!0,Ls.isTrivialHref=s,Ls.useButtonProps=l,Ls.default=void 0;var t=i(Z),e=ee;const n=["as","disabled"];function r(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(r=function(d){return d?h:f})(c)}function i(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=r(f);if(h&&h.has(c))return h.get(c);var d={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}function o(c,f){if(c==null)return{};var h={},d=Object.keys(c),p,g;for(g=0;g<d.length;g++)p=d[g],!(f.indexOf(p)>=0)&&(h[p]=c[p]);return h}function s(c){return!c||c.trim()==="#"}function l({tagName:c,disabled:f,href:h,target:d,rel:p,role:g,onClick:O,tabIndex:v=0,type:m}){c||(h!=null||d!=null||p!=null?c="a":c="button");const y={tagName:c};if(c==="button")return[{type:m||"button",disabled:f},y];const S=P=>{if((f||c==="a"&&s(h))&&P.preventDefault(),f){P.stopPropagation();return}O==null||O(P)},k=P=>{P.key===" "&&(P.preventDefault(),S(P))};return c==="a"&&(h||(h="#"),f&&(h=void 0)),[{role:g??"button",disabled:void 0,tabIndex:f?void 0:v,href:h,target:c==="a"?d:void 0,"aria-disabled":f||void 0,rel:c==="a"?p:void 0,onClick:S,onKeyDown:k},y]}const a=t.forwardRef((c,f)=>{let{as:h,disabled:d}=c,p=o(c,n);const[g,{tagName:O}]=l(Object.assign({tagName:h,disabled:d},p));return(0,e.jsx)(O,Object.assign({},p,g,{ref:f}))});a.displayName="Button";var u=a;return Ls.default=u,Ls}(function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=u(Z),o=PB(),s=kn(),l=ee;function a(f){if(typeof WeakMap!="function")return null;var h=new WeakMap,d=new WeakMap;return(a=function(p){return p?d:h})(f)}function u(f,h){if(!h&&f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var d=a(h);if(d&&d.has(f))return d.get(f);var p={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in f)if(O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)){var v=g?Object.getOwnPropertyDescriptor(f,O):null;v&&(v.get||v.set)?Object.defineProperty(p,O,v):p[O]=f[O]}return p.default=f,d&&d.set(f,p),p}const c=i.forwardRef(({as:f,bsPrefix:h,variant:d="primary",size:p,active:g=!1,disabled:O=!1,className:v,...m},y)=>{const S=(0,s.useBootstrapPrefix)(h,"btn"),[k,{tagName:P}]=(0,o.useButtonProps)({tagName:f,disabled:O,...m}),C=P;return(0,l.jsx)(C,{...k,...m,ref:y,disabled:O,className:(0,r.default)(v,S,g&&"active",d&&`${S}-${d}`,p&&`${S}-${p}`,m.href&&O&&"disabled")})});c.displayName="Button",e.default=c,t.exports=e.default})(Xv,Xv.exports);var CB=Xv.exports;const Uc=vi(CB);var Yv={exports:{}};const I0=!!(typeof window<"u"&&window.document&&window.document.createElement),EB=Object.freeze(Object.defineProperty({__proto__:null,default:I0},Symbol.toStringTag,{value:"Module"}));var xp=!1,_p=!1;try{var Cm={get passive(){return xp=!0},get once(){return _p=xp=!0}};I0&&(window.addEventListener("test",Cm,Cm),window.removeEventListener("test",Cm,!0))}catch{}function G$(t,e,n,r){if(r&&typeof r!="boolean"&&!_p){var i=r.once,o=r.capture,s=n;!_p&&i&&(s=n.__once||function l(a){this.removeEventListener(e,l,o),n.call(this,a)},n.__once=s),t.addEventListener(e,s,xp?r:o)}t.addEventListener(e,n,r)}const TB=Object.freeze(Object.defineProperty({__proto__:null,default:G$,get onceSupported(){return _p},get optionsSupported(){return xp}},Symbol.toStringTag,{value:"Module"})),$B=yr(TB),gg=yr(EB);function L0(t){return t&&t.ownerDocument||document}const RB=Object.freeze(Object.defineProperty({__proto__:null,default:L0},Symbol.toStringTag,{value:"Module"})),mg=yr(RB);function H$(t,e,n,r){var i=r&&typeof r!="boolean"?r.capture:r;t.removeEventListener(e,n,i),n.__once&&t.removeEventListener(e,n.__once,i)}const QB=Object.freeze(Object.defineProperty({__proto__:null,default:H$},Symbol.toStringTag,{value:"Module"})),AB=yr(QB);var xh;function MB(t){if((!xh&&xh!==0||t)&&I0){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),xh=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return xh}const DB=Object.freeze(Object.defineProperty({__proto__:null,default:MB},Symbol.toStringTag,{value:"Module"})),NB=yr(DB);var _h={},uk;function K$(){if(uk)return _h;uk=1,_h.__esModule=!0,_h.default=e;var t=Z;function e(){return(0,t.useState)(null)}return _h}var Ph={},Pu={},ck;function jB(){if(ck)return Pu;ck=1,Pu.__esModule=!0,Pu.default=void 0;var t=Z;function e(r){const i=(0,t.useRef)(r);return(0,t.useEffect)(()=>{i.current=r},[r]),i}var n=e;return Pu.default=n,Pu}var fk;function Ts(){if(fk)return Ph;fk=1,Ph.__esModule=!0,Ph.default=r;var t=Z,e=n(jB());function n(i){return i&&i.__esModule?i:{default:i}}function r(i){const o=(0,e.default)(i);return(0,t.useCallback)(function(...s){return o.current&&o.current(...s)},[o])}return Ph}var Zl={},hk;function kl(){if(hk)return Zl;hk=1,Zl.__esModule=!0,Zl.default=void 0,Zl.mergeRefs=n;var t=Z;const e=o=>!o||typeof o=="function"?o:s=>{o.current=s};function n(o,s){const l=e(o),a=e(s);return u=>{l&&l(u),a&&a(u)}}function r(o,s){return(0,t.useMemo)(()=>n(o,s),[o,s])}var i=r;return Zl.default=i,Zl}var Ch={},Eh={},dk;function IB(){if(dk)return Eh;dk=1,Eh.__esModule=!0,Eh.default=e;var t=Z;function e(n){const r=(0,t.useRef)(n);return r.current=n,r}return Eh}var pk;function Z0(){if(pk)return Ch;pk=1,Ch.__esModule=!0,Ch.default=r;var t=n(IB()),e=Z;function n(i){return i&&i.__esModule?i:{default:i}}function r(i){const o=(0,t.default)(i);(0,e.useEffect)(()=>()=>o.current(),[])}return Ch}function LB(t){var e=L0(t);return e&&e.defaultView||window}function ZB(t,e){return LB(t).getComputedStyle(t,e)}var WB=/([A-Z])/g;function BB(t){return t.replace(WB,"-$1").toLowerCase()}var XB=/^ms-/;function Th(t){return BB(t).replace(XB,"-ms-")}var YB=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function UB(t){return!!(t&&YB.test(t))}function J$(t,e){var n="",r="";if(typeof e=="string")return t.style.getPropertyValue(Th(e))||ZB(t).getPropertyValue(Th(e));Object.keys(e).forEach(function(i){var o=e[i];!o&&o!==0?t.style.removeProperty(Th(i)):UB(i)?r+=i+"("+o+") ":n+=Th(i)+": "+o+";"}),r&&(n+="transform: "+r+";"),t.style.cssText+=";"+n}const FB=Object.freeze(Object.defineProperty({__proto__:null,default:J$},Symbol.toStringTag,{value:"Module"}));function W0(t,e,n,r){return G$(t,e,n,r),function(){H$(t,e,n,r)}}const qB=Object.freeze(Object.defineProperty({__proto__:null,default:W0},Symbol.toStringTag,{value:"Module"}));function zB(t,e,n,r){if(n===void 0&&(n=!1),r===void 0&&(r=!0),t){var i=document.createEvent("HTMLEvents");i.initEvent(e,n,r),t.dispatchEvent(i)}}function VB(t){var e=J$(t,"transitionDuration")||"",n=e.indexOf("ms")===-1?1e3:1;return parseFloat(e)*n}function GB(t,e,n){n===void 0&&(n=5);var r=!1,i=setTimeout(function(){r||zB(t,"transitionend",!0)},e+n),o=W0(t,"transitionend",function(){r=!0},{once:!0});return function(){clearTimeout(i),o()}}function HB(t,e,n,r){n==null&&(n=VB(t)||0);var i=GB(t,n,r),o=W0(t,"transitionend",e);return function(){i(),o()}}const KB=Object.freeze(Object.defineProperty({__proto__:null,default:HB},Symbol.toStringTag,{value:"Module"})),eR=yr(KB);var Cu={};function JB(t){t===void 0&&(t=L0());try{var e=t.activeElement;return!e||!e.nodeName?null:e}catch{return t.body}}const eX=Object.freeze(Object.defineProperty({__proto__:null,default:JB},Symbol.toStringTag,{value:"Module"})),tX=yr(eX);function nX(t,e){if(t.contains)return t.contains(e);if(t.compareDocumentPosition)return t===e||!!(t.compareDocumentPosition(e)&16)}const rX=Object.freeze(Object.defineProperty({__proto__:null,default:nX},Symbol.toStringTag,{value:"Module"})),B0=yr(rX),X0=yr(qB);var $h={},gk;function Y0(){if(gk)return $h;gk=1,$h.__esModule=!0,$h.default=e;var t=Z;function e(){const n=(0,t.useRef)(!0),r=(0,t.useRef)(()=>n.current);return(0,t.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]),r.current}return $h}var Rh={},mk;function iX(){if(mk)return Rh;mk=1,Rh.__esModule=!0,Rh.default=e;var t=Z;function e(n){const r=(0,t.useRef)(null);return(0,t.useEffect)(()=>{r.current=n}),r.current}return Rh}var Zs={};const U0=yr(FB);var yo={},Ok;function oX(){if(Ok)return yo;Ok=1,yo.__esModule=!0,yo.dataAttr=n,yo.dataProp=r,yo.PROPERTY_PREFIX=yo.ATTRIBUTE_PREFIX=void 0;const t="data-rr-ui-";yo.ATTRIBUTE_PREFIX=t;const e="rrUi";yo.PROPERTY_PREFIX=e;function n(i){return`${t}${i}`}function r(i){return`${e}${i}`}return yo}var Qh={},vk;function sX(){if(vk)return Qh;vk=1,Qh.__esModule=!0,Qh.default=t;function t(e=document){const n=e.defaultView;return Math.abs(n.innerWidth-e.documentElement.clientWidth)}return Qh}var yk;function tR(){if(yk)return Zs;yk=1,Zs.__esModule=!0,Zs.default=Zs.OPEN_DATA_ATTRIBUTE=void 0;var t=r(U0),e=oX(),n=r(sX());function r(l){return l&&l.__esModule?l:{default:l}}const i=(0,e.dataAttr)("modal-open");Zs.OPEN_DATA_ATTRIBUTE=i;var s=class{constructor({ownerDocument:a,handleContainerOverflow:u=!0,isRTL:c=!1}={}){this.handleContainerOverflow=u,this.isRTL=c,this.modals=[],this.ownerDocument=a}getScrollbarWidth(){return(0,n.default)(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(a){}removeModalAttributes(a){}setContainerStyle(a){const u={overflow:"hidden"},c=this.isRTL?"paddingLeft":"paddingRight",f=this.getElement();a.style={overflow:f.style.overflow,[c]:f.style[c]},a.scrollBarWidth&&(u[c]=`${parseInt((0,t.default)(f,c)||"0",10)+a.scrollBarWidth}px`),f.setAttribute(i,""),(0,t.default)(f,u)}reset(){[...this.modals].forEach(a=>this.remove(a))}removeContainerStyle(a){const u=this.getElement();u.removeAttribute(i),Object.assign(u.style,a.style)}add(a){let u=this.modals.indexOf(a);return u!==-1||(u=this.modals.length,this.modals.push(a),this.setModalAttributes(a),u!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),u}remove(a){const u=this.modals.indexOf(a);u!==-1&&(this.modals.splice(u,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(a))}isTopModal(a){return!!this.modals.length&&this.modals[this.modals.length-1]===a}};return Zs.default=s,Zs}var Wl={},Bl={},Sk;function nR(){if(Sk)return Bl;Sk=1,Bl.__esModule=!0,Bl.default=o,Bl.WindowProvider=void 0;var t=Z,e=n(gg);function n(s){return s&&s.__esModule?s:{default:s}}const r=(0,t.createContext)(e.default?window:void 0),i=r.Provider;Bl.WindowProvider=i;function o(){return(0,t.useContext)(r)}return Bl}var bk;function rR(){if(bk)return Wl;bk=1,Wl.__esModule=!0,Wl.default=s,Wl.resolveContainerRef=void 0;var t=i(mg),e=i(gg),n=Z,r=i(nR());function i(l){return l&&l.__esModule?l:{default:l}}const o=(l,a)=>e.default?l==null?(a||(0,t.default)()).body:(typeof l=="function"&&(l=l()),l&&"current"in l&&(l=l.current),l&&("nodeType"in l||l.getBoundingClientRect)?l:null):null;Wl.resolveContainerRef=o;function s(l,a){const u=(0,r.default)(),[c,f]=(0,n.useState)(()=>o(l,u==null?void 0:u.document));if(!c){const h=o(l);h&&f(h)}return(0,n.useEffect)(()=>{a&&c&&a(c)},[a,c]),(0,n.useEffect)(()=>{const h=o(l);h!==c&&f(h)},[l,c]),c}return Wl}var Xl={},Eu={},wk;function iR(){if(wk)return Eu;wk=1,Eu.__esModule=!0,Eu.default=void 0;var t=Z;const e=typeof Yr<"u"&&Yr.navigator&&Yr.navigator.product==="ReactNative";var r=typeof document<"u"||e?t.useLayoutEffect:t.useEffect;return Eu.default=r,Eu}var Tu={},kk;function lX(){if(kk)return Tu;kk=1,Tu.__esModule=!0,Tu.default=void 0;var t=r(Ts()),e=r(kl()),n=Z;function r(s){return s&&s.__esModule?s:{default:s}}function i({children:s,in:l,onExited:a,mountOnEnter:u,unmountOnExit:c}){const f=(0,n.useRef)(null),h=(0,n.useRef)(l),d=(0,t.default)(a);(0,n.useEffect)(()=>{l?h.current=!0:d(f.current)},[l,d]);const p=(0,e.default)(f,s.ref),g=(0,n.cloneElement)(s,{ref:p});return l?g:c||!h.current&&u?null:g}var o=i;return Tu.default=o,Tu}var xk;function oR(){if(xk)return Xl;xk=1,Xl.__esModule=!0,Xl.useTransition=u,Xl.default=c,Xl.renderTransition=f;var t=a(kl()),e=a(Ts()),n=a(iR()),r=l(Z),i=a(lX()),o=ee;function s(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(s=function(g){return g?p:d})(h)}function l(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=s(d);if(p&&p.has(h))return p.get(h);var g={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}function a(h){return h&&h.__esModule?h:{default:h}}function u({in:h,onTransition:d}){const p=(0,r.useRef)(null),g=(0,r.useRef)(!0),O=(0,e.default)(d);return(0,n.default)(()=>{if(!p.current)return;let v=!1;return O({in:h,element:p.current,initial:g.current,isStale:()=>v}),()=>{v=!0}},[h,O]),(0,n.default)(()=>(g.current=!1,()=>{g.current=!0}),[]),p}function c({children:h,in:d,onExited:p,onEntered:g,transition:O}){const[v,m]=(0,r.useState)(!d);d&&v&&m(!1);const y=u({in:!!d,onTransition:k=>{const P=()=>{k.isStale()||(k.in?g==null||g(k.element,k.initial):(m(!0),p==null||p(k.element)))};Promise.resolve(O(k)).then(P,C=>{throw k.in||m(!0),C})}}),S=(0,t.default)(y,h.ref);return v&&!d?null:(0,r.cloneElement)(h,{ref:S})}function f(h,d,p){return h?(0,o.jsx)(h,Object.assign({},p)):d?(0,o.jsx)(c,Object.assign({},p,{transition:d})):(0,o.jsx)(i.default,Object.assign({},p))}return Xl}var Ah={},_k;function sR(){if(_k)return Ah;_k=1,Ah.__esModule=!0,Ah.isEscKey=t;function t(e){return e.code==="Escape"||e.keyCode===27}return Ah}var Pk;function aX(){if(Pk)return Cu;Pk=1,Cu.__esModule=!0,Cu.default=void 0;var t=y(tX),e=y(B0),n=y(gg),r=y(X0),i=m(Z),o=y(of),s=y(Y0()),l=y(Z0()),a=y(iX()),u=y(Ts()),c=y(tR()),f=y(rR()),h=y(nR()),d=oR(),p=sR(),g=ee;const O=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function v(_){if(typeof WeakMap!="function")return null;var E=new WeakMap,$=new WeakMap;return(v=function(j){return j?$:E})(_)}function m(_,E){if(!E&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var $=v(E);if($&&$.has(_))return $.get(_);var j={},W=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var G in _)if(G!=="default"&&Object.prototype.hasOwnProperty.call(_,G)){var M=W?Object.getOwnPropertyDescriptor(_,G):null;M&&(M.get||M.set)?Object.defineProperty(j,G,M):j[G]=_[G]}return j.default=_,$&&$.set(_,j),j}function y(_){return _&&_.__esModule?_:{default:_}}function S(_,E){if(_==null)return{};var $={},j=Object.keys(_),W,G;for(G=0;G<j.length;G++)W=j[G],!(E.indexOf(W)>=0)&&($[W]=_[W]);return $}let k;function P(_){return k||(k=new c.default({ownerDocument:_==null?void 0:_.document})),k}function C(_){const E=(0,h.default)(),$=_||P(E),j=(0,i.useRef)({dialog:null,backdrop:null});return Object.assign(j.current,{add:()=>$.add(j.current),remove:()=>$.remove(j.current),isTopModal:()=>$.isTopModal(j.current),setDialogRef:(0,i.useCallback)(W=>{j.current.dialog=W},[]),setBackdropRef:(0,i.useCallback)(W=>{j.current.backdrop=W},[])})}const w=(0,i.forwardRef)((_,E)=>{let{show:$=!1,role:j="dialog",className:W,style:G,children:M,backdrop:L=!0,keyboard:N=!0,onBackdropClick:Y,onEscapeKeyDown:q,transition:ae,runTransition:pe,backdropTransition:U,runBackdropTransition:H,autoFocus:se=!0,enforceFocus:Ie=!0,restoreFocus:F=!0,restoreFocusOptions:z,renderDialog:J,renderBackdrop:be=Fe=>(0,g.jsx)("div",Object.assign({},Fe)),manager:Ae,container:Me,onShow:De,onHide:nt=()=>{},onExit:st,onExited:Tt,onExiting:cn,onEnter:tr,onEntering:Pn,onEntered:Qn}=_,wi=S(_,O);const jn=(0,h.default)(),R=(0,f.default)(Me),ne=C(Ae),ce=(0,s.default)(),we=(0,a.default)($),[ye,Pe]=(0,i.useState)(!$),Je=(0,i.useRef)(null);(0,i.useImperativeHandle)(E,()=>ne,[ne]),n.default&&!we&&$&&(Je.current=(0,t.default)(jn==null?void 0:jn.document)),$&&ye&&Pe(!1);const tt=(0,u.default)(()=>{if(ne.add(),Le.current=(0,r.default)(document,"keydown",ke),Qe.current=(0,r.default)(document,"focus",()=>setTimeout(_e),!0),De&&De(),se){var Fe,at;const Rt=(0,t.default)((Fe=(at=ne.dialog)==null?void 0:at.ownerDocument)!=null?Fe:jn==null?void 0:jn.document);ne.dialog&&Rt&&!(0,e.default)(ne.dialog,Rt)&&(Je.current=Rt,ne.dialog.focus())}}),ue=(0,u.default)(()=>{if(ne.remove(),Le.current==null||Le.current(),Qe.current==null||Qe.current(),F){var Fe;(Fe=Je.current)==null||Fe.focus==null||Fe.focus(z),Je.current=null}});(0,i.useEffect)(()=>{!$||!R||tt()},[$,R,tt]),(0,i.useEffect)(()=>{ye&&ue()},[ye,ue]),(0,l.default)(()=>{ue()});const _e=(0,u.default)(()=>{if(!Ie||!ce()||!ne.isTopModal())return;const Fe=(0,t.default)(jn==null?void 0:jn.document);ne.dialog&&Fe&&!(0,e.default)(ne.dialog,Fe)&&ne.dialog.focus()}),Se=(0,u.default)(Fe=>{Fe.target===Fe.currentTarget&&(Y==null||Y(Fe),L===!0&&nt())}),ke=(0,u.default)(Fe=>{N&&(0,p.isEscKey)(Fe)&&ne.isTopModal()&&(q==null||q(Fe),Fe.defaultPrevented||nt())}),Qe=(0,i.useRef)(),Le=(0,i.useRef)(),lt=(...Fe)=>{Pe(!0),Tt==null||Tt(...Fe)};if(!R)return null;const ge=Object.assign({role:j,ref:ne.setDialogRef,"aria-modal":j==="dialog"?!0:void 0},wi,{style:G,className:W,tabIndex:-1});let Be=J?J(ge):(0,g.jsx)("div",Object.assign({},ge,{children:i.cloneElement(M,{role:"document"})}));Be=(0,d.renderTransition)(ae,pe,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!$,onExit:st,onExiting:cn,onExited:lt,onEnter:tr,onEntering:Pn,onEntered:Qn,children:Be});let pt=null;return L&&(pt=be({ref:ne.setBackdropRef,onClick:Se}),pt=(0,d.renderTransition)(U,H,{in:!!$,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:pt})),(0,g.jsx)(g.Fragment,{children:o.default.createPortal((0,g.jsxs)(g.Fragment,{children:[pt,Be]}),R)})});w.displayName="Modal";var x=Object.assign(w,{Manager:c.default});return Cu.default=x,Cu}var Yl={};function lR(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}const uX=Object.freeze(Object.defineProperty({__proto__:null,default:lR},Symbol.toStringTag,{value:"Module"}));function cX(t,e){t.classList?t.classList.add(e):lR(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}const fX=Object.freeze(Object.defineProperty({__proto__:null,default:cX},Symbol.toStringTag,{value:"Module"})),hX=yr(fX);var dX=Function.prototype.bind.call(Function.prototype.call,[].slice);function pX(t,e){return dX(t.querySelectorAll(e))}const gX=Object.freeze(Object.defineProperty({__proto__:null,default:pX},Symbol.toStringTag,{value:"Module"})),mX=yr(gX);function Ck(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function OX(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=Ck(t.className,e):t.setAttribute("class",Ck(t.className&&t.className.baseVal||"",e))}const vX=Object.freeze(Object.defineProperty({__proto__:null,default:OX},Symbol.toStringTag,{value:"Module"})),yX=yr(vX);var Ek;function SX(){if(Ek)return Yl;Ek=1;var t=Pt;Yl.__esModule=!0,Yl.default=void 0,Yl.getSharedManager=u;var e=t(hX),n=t(U0),r=t(mX),i=t(yX),o=t(tR());const s={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};let l=class extends o.default{adjustAndStore(f,h,d){const p=h.style[f];h.dataset[f]=p,(0,n.default)(h,{[f]:`${parseFloat((0,n.default)(h,f))+d}px`})}restore(f,h){const d=h.dataset[f];d!==void 0&&(delete h.dataset[f],(0,n.default)(h,{[f]:d}))}setContainerStyle(f){super.setContainerStyle(f);const h=this.getElement();if((0,e.default)(h,"modal-open"),!f.scrollBarWidth)return;const d=this.isRTL?"paddingLeft":"paddingRight",p=this.isRTL?"marginLeft":"marginRight";(0,r.default)(h,s.FIXED_CONTENT).forEach(g=>this.adjustAndStore(d,g,f.scrollBarWidth)),(0,r.default)(h,s.STICKY_CONTENT).forEach(g=>this.adjustAndStore(p,g,-f.scrollBarWidth)),(0,r.default)(h,s.NAVBAR_TOGGLER).forEach(g=>this.adjustAndStore(p,g,f.scrollBarWidth))}removeContainerStyle(f){super.removeContainerStyle(f);const h=this.getElement();(0,i.default)(h,"modal-open");const d=this.isRTL?"paddingLeft":"paddingRight",p=this.isRTL?"marginLeft":"marginRight";(0,r.default)(h,s.FIXED_CONTENT).forEach(g=>this.restore(d,g)),(0,r.default)(h,s.STICKY_CONTENT).forEach(g=>this.restore(p,g)),(0,r.default)(h,s.NAVBAR_TOGGLER).forEach(g=>this.restore(p,g))}},a;function u(c){return a||(a=new l(c)),a}return Yl.default=l,Yl}var Mh={exports:{}};function F0(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Uv(t,e){return Uv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Uv(t,e)}function aR(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Uv(t,e)}Of();const Tk={disabled:!1},uR=Qi.createContext(null);var bX=function(e){return e.scrollTop},ha="unmounted",Fo="exited",qo="entering",zs="entered",Pp="exiting",Do=function(t){aR(e,t);function e(r,i){var o;o=t.call(this,r,i)||this;var s=i,l=s&&!s.isMounting?r.enter:r.appear,a;return o.appearStatus=null,r.in?l?(a=Fo,o.appearStatus=qo):a=zs:r.unmountOnExit||r.mountOnEnter?a=ha:a=Fo,o.state={status:a},o.nextCallback=null,o}e.getDerivedStateFromProps=function(i,o){var s=i.in;return s&&o.status===ha?{status:Fo}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var o=null;if(i!==this.props){var s=this.state.status;this.props.in?s!==qo&&s!==zs&&(o=qo):(s===qo||s===zs)&&(o=Pp)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,o,s,l;return o=s=l=i,i!=null&&typeof i!="number"&&(o=i.exit,s=i.enter,l=i.appear!==void 0?i.appear:s),{exit:o,enter:s,appear:l}},n.updateStatus=function(i,o){if(i===void 0&&(i=!1),o!==null)if(this.cancelNextCallback(),o===qo){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Ff.findDOMNode(this);s&&bX(s)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Fo&&this.setState({status:ha})},n.performEnter=function(i){var o=this,s=this.props.enter,l=this.context?this.context.isMounting:i,a=this.props.nodeRef?[l]:[Ff.findDOMNode(this),l],u=a[0],c=a[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!i&&!s||Tk.disabled){this.safeSetState({status:zs},function(){o.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:qo},function(){o.props.onEntering(u,c),o.onTransitionEnd(h,function(){o.safeSetState({status:zs},function(){o.props.onEntered(u,c)})})})},n.performExit=function(){var i=this,o=this.props.exit,s=this.getTimeouts(),l=this.props.nodeRef?void 0:Ff.findDOMNode(this);if(!o||Tk.disabled){this.safeSetState({status:Fo},function(){i.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Pp},function(){i.props.onExiting(l),i.onTransitionEnd(s.exit,function(){i.safeSetState({status:Fo},function(){i.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,o){o=this.setNextCallback(o),this.setState(i,o)},n.setNextCallback=function(i){var o=this,s=!0;return this.nextCallback=function(l){s&&(s=!1,o.nextCallback=null,i(l))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(i,o){this.setNextCallback(o);var s=this.props.nodeRef?this.props.nodeRef.current:Ff.findDOMNode(this),l=i==null&&!this.props.addEndListener;if(!s||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=a[0],c=a[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===ha)return null;var o=this.props,s=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var l=F0(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Qi.createElement(uR.Provider,{value:null},typeof s=="function"?s(i,l):Qi.cloneElement(Qi.Children.only(s),l))},e}(Qi.Component);Do.contextType=uR;Do.propTypes={};function Ul(){}Do.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ul,onEntering:Ul,onEntered:Ul,onExit:Ul,onExiting:Ul,onExited:Ul};Do.UNMOUNTED=ha;Do.EXITED=Fo;Do.ENTERING=qo;Do.ENTERED=zs;Do.EXITING=Pp;const wX=Object.freeze(Object.defineProperty({__proto__:null,ENTERED:zs,ENTERING:qo,EXITED:Fo,EXITING:Pp,UNMOUNTED:ha,default:Do},Symbol.toStringTag,{value:"Module"})),cR=yr(wX);var Dh={exports:{}},$k;function kX(){return $k||($k=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=s;var r=n(U0),i=n(eR);function o(l,a){const u=(0,r.default)(l,a)||"",c=u.indexOf("ms")===-1?1e3:1;return parseFloat(u)*c}function s(l,a){const u=o(l,"transitionDuration"),c=o(l,"transitionDelay"),f=(0,i.default)(l,h=>{h.target===l&&(f(),a(h))},u+c)}t.exports=e.default}(Dh,Dh.exports)),Dh.exports}var Nh={exports:{}},Rk;function xX(){return Rk||(Rk=1,function(t,e){e.__esModule=!0,e.default=n;function n(r){r.offsetHeight}t.exports=e.default}(Nh,Nh.exports)),Nh.exports}var jh={exports:{}},Ih={exports:{}},Qk;function q0(){return Qk||(Qk=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=i;var r=n(of);function i(o){return o&&"setState"in o?r.default.findDOMNode(o):o??null}t.exports=e.default}(Ih,Ih.exports)),Ih.exports}var Ak;function _X(){return Ak||(Ak=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=u(Z),i=n(cR),o=n(kl()),s=n(q0()),l=ee;function a(f){if(typeof WeakMap!="function")return null;var h=new WeakMap,d=new WeakMap;return(a=function(p){return p?d:h})(f)}function u(f,h){if(!h&&f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var d=a(h);if(d&&d.has(f))return d.get(f);var p={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in f)if(O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)){var v=g?Object.getOwnPropertyDescriptor(f,O):null;v&&(v.get||v.set)?Object.defineProperty(p,O,v):p[O]=f[O]}return p.default=f,d&&d.set(f,p),p}const c=r.default.forwardRef(({onEnter:f,onEntering:h,onEntered:d,onExit:p,onExiting:g,onExited:O,addEndListener:v,children:m,childRef:y,...S},k)=>{const P=(0,r.useRef)(null),C=(0,o.default)(P,y),w=L=>{C((0,s.default)(L))},x=L=>N=>{L&&P.current&&L(P.current,N)},_=(0,r.useCallback)(x(f),[f]),E=(0,r.useCallback)(x(h),[h]),$=(0,r.useCallback)(x(d),[d]),j=(0,r.useCallback)(x(p),[p]),W=(0,r.useCallback)(x(g),[g]),G=(0,r.useCallback)(x(O),[O]),M=(0,r.useCallback)(x(v),[v]);return(0,l.jsx)(i.default,{ref:k,...S,onEnter:_,onEntered:$,onEntering:E,onExit:j,onExited:G,onExiting:W,addEndListener:M,nodeRef:P,children:typeof m=="function"?(L,N)=>m(L,{...N,ref:w}):r.default.cloneElement(m,{ref:w})})});e.default=c,t.exports=e.default}(jh,jh.exports)),jh.exports}var Mk;function fR(){return Mk||(Mk=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=h(Z),o=i,s=cR,l=n(kX()),a=n(xX()),u=n(_X()),c=ee;function f(g){if(typeof WeakMap!="function")return null;var O=new WeakMap,v=new WeakMap;return(f=function(m){return m?v:O})(g)}function h(g,O){if(!O&&g&&g.__esModule)return g;if(g===null||typeof g!="object"&&typeof g!="function")return{default:g};var v=f(O);if(v&&v.has(g))return v.get(g);var m={__proto__:null},y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var S in g)if(S!=="default"&&Object.prototype.hasOwnProperty.call(g,S)){var k=y?Object.getOwnPropertyDescriptor(g,S):null;k&&(k.get||k.set)?Object.defineProperty(m,S,k):m[S]=g[S]}return m.default=g,v&&v.set(g,m),m}const d={[s.ENTERING]:"show",[s.ENTERED]:"show"},p=o.forwardRef(({className:g,children:O,transitionClasses:v={},onEnter:m,...y},S)=>{const k={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...y},P=(0,i.useCallback)((C,w)=>{(0,a.default)(C),m==null||m(C,w)},[m]);return(0,c.jsx)(u.default,{ref:S,addEndListener:l.default,...k,onEnter:P,childRef:O.ref,children:(C,w)=>o.cloneElement(O,{...w,className:(0,r.default)("fade",g,O.props.className,d[C],v[C])})})});p.displayName="Fade",e.default=p,t.exports=e.default}(Mh,Mh.exports)),Mh.exports}var Lh={exports:{}},Dk;function PX(){return Dk||(Dk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=a(Z),i=n(Ht()),o=kn(),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=r.forwardRef(({className:c,bsPrefix:f,as:h="div",...d},p)=>(f=(0,o.useBootstrapPrefix)(f,"modal-body"),(0,s.jsx)(h,{ref:p,className:(0,i.default)(c,f),...d})));u.displayName="ModalBody",e.default=u,t.exports=e.default}(Lh,Lh.exports)),Lh.exports}var Zh={exports:{}},Nk;function hR(){return Nk||(Nk=1,function(t,e){"use client";e.__esModule=!0,e.default=void 0;var n=i(Z);function r(s){if(typeof WeakMap!="function")return null;var l=new WeakMap,a=new WeakMap;return(r=function(u){return u?a:l})(s)}function i(s,l){if(!l&&s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var a=r(l);if(a&&a.has(s))return a.get(s);var u={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var h=c?Object.getOwnPropertyDescriptor(s,f):null;h&&(h.get||h.set)?Object.defineProperty(u,f,h):u[f]=s[f]}return u.default=s,a&&a.set(s,u),u}const o=n.createContext({onHide(){}});e.default=o,t.exports=e.default}(Zh,Zh.exports)),Zh.exports}var Wh={exports:{}},jk;function CX(){return jk||(jk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=a(Z),o=kn(),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=i.forwardRef(({bsPrefix:c,className:f,contentClassName:h,centered:d,size:p,fullscreen:g,children:O,scrollable:v,...m},y)=>{c=(0,o.useBootstrapPrefix)(c,"modal");const S=`${c}-dialog`,k=typeof g=="string"?`${c}-fullscreen-${g}`:`${c}-fullscreen`;return(0,s.jsx)("div",{...m,ref:y,className:(0,r.default)(S,f,p&&`${c}-${p}`,d&&`${S}-centered`,v&&`${S}-scrollable`,g&&k),children:(0,s.jsx)("div",{className:(0,r.default)(`${c}-content`,h),children:O})})});u.displayName="ModalDialog",e.default=u,t.exports=e.default}(Wh,Wh.exports)),Wh.exports}var Bh={exports:{}},Ik;function EX(){return Ik||(Ik=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=a(Z),i=n(Ht()),o=kn(),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=r.forwardRef(({className:c,bsPrefix:f,as:h="div",...d},p)=>(f=(0,o.useBootstrapPrefix)(f,"modal-footer"),(0,s.jsx)(h,{ref:p,className:(0,i.default)(c,f),...d})));u.displayName="ModalFooter",e.default=u,t.exports=e.default}(Bh,Bh.exports)),Bh.exports}var Xh={exports:{}},Yh={exports:{}},Uh={exports:{}},Lk;function TX(){return Lk||(Lk=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Of()),i=a(Z),o=n(Ht()),s=ee;function l(f){if(typeof WeakMap!="function")return null;var h=new WeakMap,d=new WeakMap;return(l=function(p){return p?d:h})(f)}function a(f,h){if(!h&&f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var d=l(h);if(d&&d.has(f))return d.get(f);var p={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in f)if(O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)){var v=g?Object.getOwnPropertyDescriptor(f,O):null;v&&(v.get||v.set)?Object.defineProperty(p,O,v):p[O]=f[O]}return p.default=f,d&&d.set(f,p),p}const u={"aria-label":r.default.string,onClick:r.default.func,variant:r.default.oneOf(["white"])},c=i.forwardRef(({className:f,variant:h,"aria-label":d="Close",...p},g)=>(0,s.jsx)("button",{ref:g,type:"button",className:(0,o.default)("btn-close",h&&`btn-close-${h}`,f),"aria-label":d,...p}));c.displayName="CloseButton",c.propTypes=u,e.default=c,t.exports=e.default}(Uh,Uh.exports)),Uh.exports}var Zk;function $X(){return Zk||(Zk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=c(Z),i=r,o=n(Ts()),s=n(TX()),l=n(hR()),a=ee;function u(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(u=function(g){return g?p:d})(h)}function c(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=u(d);if(p&&p.has(h))return p.get(h);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}const f=i.forwardRef(({closeLabel:h="Close",closeVariant:d,closeButton:p=!1,onHide:g,children:O,...v},m)=>{const y=(0,r.useContext)(l.default),S=(0,o.default)(()=>{y==null||y.onHide(),g==null||g()});return(0,a.jsxs)("div",{ref:m,...v,children:[O,p&&(0,a.jsx)(s.default,{"aria-label":h,variant:d,onClick:S})]})});e.default=f,t.exports=e.default}(Yh,Yh.exports)),Yh.exports}var Wk;function RX(){return Wk||(Wk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=u(Z),o=kn(),s=n($X()),l=ee;function a(f){if(typeof WeakMap!="function")return null;var h=new WeakMap,d=new WeakMap;return(a=function(p){return p?d:h})(f)}function u(f,h){if(!h&&f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var d=a(h);if(d&&d.has(f))return d.get(f);var p={__proto__:null},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in f)if(O!=="default"&&Object.prototype.hasOwnProperty.call(f,O)){var v=g?Object.getOwnPropertyDescriptor(f,O):null;v&&(v.get||v.set)?Object.defineProperty(p,O,v):p[O]=f[O]}return p.default=f,d&&d.set(f,p),p}const c=i.forwardRef(({bsPrefix:f,className:h,closeLabel:d="Close",closeButton:p=!1,...g},O)=>(f=(0,o.useBootstrapPrefix)(f,"modal-header"),(0,l.jsx)(s.default,{ref:O,...g,className:(0,r.default)(h,f),closeLabel:d,closeButton:p})));c.displayName="ModalHeader",e.default=c,t.exports=e.default}(Xh,Xh.exports)),Xh.exports}var Fh={exports:{}},qh={exports:{}},Bk;function QX(){return Bk||(Bk=1,function(t,e){var n=Pt;e.__esModule=!0,e.default=void 0;var r=l(Z),i=n(Ht()),o=ee;function s(u){if(typeof WeakMap!="function")return null;var c=new WeakMap,f=new WeakMap;return(s=function(h){return h?f:c})(u)}function l(u,c){if(!c&&u&&u.__esModule)return u;if(u===null||typeof u!="object"&&typeof u!="function")return{default:u};var f=s(c);if(f&&f.has(u))return f.get(u);var h={__proto__:null},d=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in u)if(p!=="default"&&Object.prototype.hasOwnProperty.call(u,p)){var g=d?Object.getOwnPropertyDescriptor(u,p):null;g&&(g.get||g.set)?Object.defineProperty(h,p,g):h[p]=u[p]}return h.default=u,f&&f.set(u,h),h}var a=u=>r.forwardRef((c,f)=>(0,o.jsx)("div",{...c,ref:f,className:(0,i.default)(c.className,u)}));e.default=a,t.exports=e.default}(qh,qh.exports)),qh.exports}var Xk;function AX(){return Xk||(Xk=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=u(Z),i=n(Ht()),o=n(QX()),s=kn(),l=ee;function a(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(a=function(g){return g?p:d})(h)}function u(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=a(d);if(p&&p.has(h))return p.get(h);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}const c=(0,o.default)("h4"),f=r.forwardRef(({className:h,bsPrefix:d,as:p=c,...g},O)=>(d=(0,s.useBootstrapPrefix)(d,"modal-title"),(0,l.jsx)(p,{ref:O,className:(0,i.default)(h,d),...g})));f.displayName="ModalTitle",e.default=f,t.exports=e.default}(Fh,Fh.exports)),Fh.exports}(function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=n($B),o=n(gg),s=n(mg),l=n(AB),a=n(NB),u=n(K$()),c=n(Ts()),f=n(kl()),h=n(Z0()),d=n(eR),p=$(Z),g=p,O=n(aX()),v=SX(),m=n(fR()),y=n(PX()),S=n(hR()),k=n(CX()),P=n(EX()),C=n(RX()),w=n(AX()),x=kn(),_=ee;function E(M){if(typeof WeakMap!="function")return null;var L=new WeakMap,N=new WeakMap;return(E=function(Y){return Y?N:L})(M)}function $(M,L){if(!L&&M&&M.__esModule)return M;if(M===null||typeof M!="object"&&typeof M!="function")return{default:M};var N=E(L);if(N&&N.has(M))return N.get(M);var Y={__proto__:null},q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ae in M)if(ae!=="default"&&Object.prototype.hasOwnProperty.call(M,ae)){var pe=q?Object.getOwnPropertyDescriptor(M,ae):null;pe&&(pe.get||pe.set)?Object.defineProperty(Y,ae,pe):Y[ae]=M[ae]}return Y.default=M,N&&N.set(M,Y),Y}function j(M){return(0,_.jsx)(m.default,{...M,timeout:null})}function W(M){return(0,_.jsx)(m.default,{...M,timeout:null})}const G=g.forwardRef(({bsPrefix:M,className:L,style:N,dialogClassName:Y,contentClassName:q,children:ae,dialogAs:pe=k.default,"data-bs-theme":U,"aria-labelledby":H,"aria-describedby":se,"aria-label":Ie,show:F=!1,animation:z=!0,backdrop:J=!0,keyboard:be=!0,onEscapeKeyDown:Ae,onShow:Me,onHide:De,container:nt,autoFocus:st=!0,enforceFocus:Tt=!0,restoreFocus:cn=!0,restoreFocusOptions:tr,onEntered:Pn,onExit:Qn,onExiting:wi,onEnter:jn,onEntering:R,onExited:ne,backdropClassName:ce,manager:we,...ye},Pe)=>{const[Je,tt]=(0,p.useState)({}),[ue,_e]=(0,p.useState)(!1),Se=(0,p.useRef)(!1),ke=(0,p.useRef)(!1),Qe=(0,p.useRef)(null),[Le,lt]=(0,u.default)(),ge=(0,f.default)(Pe,lt),Be=(0,c.default)(De),pt=(0,x.useIsRTL)();M=(0,x.useBootstrapPrefix)(M,"modal");const Fe=(0,p.useMemo)(()=>({onHide:Be}),[Be]);function at(){return we||(0,v.getSharedManager)({isRTL:pt})}function Rt(me){if(!o.default)return;const ct=at().getScrollbarWidth()>0,ht=me.scrollHeight>(0,s.default)(me).documentElement.clientHeight;tt({paddingRight:ct&&!ht?(0,a.default)():void 0,paddingLeft:!ct&&ht?(0,a.default)():void 0})}const zt=(0,c.default)(()=>{Le&&Rt(Le.dialog)});(0,h.default)(()=>{(0,l.default)(window,"resize",zt),Qe.current==null||Qe.current()});const Wt=()=>{Se.current=!0},Ut=me=>{Se.current&&Le&&me.target===Le.dialog&&(ke.current=!0),Se.current=!1},Cn=()=>{_e(!0),Qe.current=(0,d.default)(Le.dialog,()=>{_e(!1)})},On=me=>{me.target===me.currentTarget&&Cn()},$r=me=>{if(J==="static"){On(me);return}if(ke.current||me.target!==me.currentTarget){ke.current=!1;return}De==null||De()},An=me=>{be?Ae==null||Ae(me):(me.preventDefault(),J==="static"&&Cn())},In=(me,ct)=>{me&&Rt(me),jn==null||jn(me,ct)},Ln=me=>{Qe.current==null||Qe.current(),Qn==null||Qn(me)},yt=(me,ct)=>{R==null||R(me,ct),(0,i.default)(window,"resize",zt)},Ze=me=>{me&&(me.style.display=""),ne==null||ne(me),(0,l.default)(window,"resize",zt)},qe=(0,p.useCallback)(me=>(0,_.jsx)("div",{...me,className:(0,r.default)(`${M}-backdrop`,ce,!z&&"show")}),[z,ce,M]),He={...N,...Je};He.display="block";const Te=me=>(0,_.jsx)("div",{role:"dialog",...me,style:He,className:(0,r.default)(L,M,ue&&`${M}-static`,!z&&"show"),onClick:J?$r:void 0,onMouseUp:Ut,"data-bs-theme":U,"aria-label":Ie,"aria-labelledby":H,"aria-describedby":se,children:(0,_.jsx)(pe,{...ye,onMouseDown:Wt,className:Y,contentClassName:q,children:ae})});return(0,_.jsx)(S.default.Provider,{value:Fe,children:(0,_.jsx)(O.default,{show:F,ref:ge,backdrop:J,container:nt,keyboard:!0,autoFocus:st,enforceFocus:Tt,restoreFocus:cn,restoreFocusOptions:tr,onEscapeKeyDown:An,onShow:Me,onHide:De,onEnter:In,onEntering:yt,onEntered:Pn,onExit:Ln,onExiting:wi,onExited:Ze,manager:at(),transition:z?j:void 0,backdropTransition:z?W:void 0,renderBackdrop:qe,renderDialog:Te})})});G.displayName="Modal",e.default=Object.assign(G,{Body:y.default,Header:C.default,Title:w.default,Footer:P.default,Dialog:k.default,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),t.exports=e.default})(Yv,Yv.exports);var MX=Yv.exports;const xr=vi(MX);var Fv={exports:{}},zh={},Yk;function DX(){if(Yk)return zh;Yk=1,zh.__esModule=!0,zh.default=s;var t=Z,e=r(Y0()),n=r(Z0());function r(l){return l&&l.__esModule?l:{default:l}}const i=2**31-1;function o(l,a,u){const c=u-Date.now();l.current=c<=i?setTimeout(a,c):setTimeout(()=>o(l,a,u),i)}function s(){const l=(0,e.default)(),a=(0,t.useRef)();return(0,n.default)(()=>clearTimeout(a.current)),(0,t.useMemo)(()=>{const u=()=>clearTimeout(a.current);function c(f,h=0){l()&&(u(),h<=i?a.current=setTimeout(f,h):o(a,f,Date.now()+h))}return{set:c,clear:u}},[])}return zh}var NX=function(t,e,n,r,i,o,s,l){if(!t){var a;if(e===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,s,l],c=0;a=new Error(e.replace(/%s/g,function(){return u[c++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}},jX=NX;const IX=vi(jX);var LX=function(){};function ZX(t,e){var n={};return Object.keys(t).forEach(function(r){n[Pa(r)]=LX}),n}function Uk(t,e){return t[e]!==void 0}function Pa(t){return"default"+t.charAt(0).toUpperCase()+t.substr(1)}function WX(t){return!!t&&(typeof t!="function"||t.prototype&&t.prototype.isReactComponent)}function BX(t){var e=XX(t,"string");return typeof e=="symbol"?e:String(e)}function XX(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function dR(t,e,n){var r=Z.useRef(t!==void 0),i=Z.useState(e),o=i[0],s=i[1],l=t!==void 0,a=r.current;return r.current=l,!l&&a&&o!==e&&s(e),[l?t:o,Z.useCallback(function(u){for(var c=arguments.length,f=new Array(c>1?c-1:0),h=1;h<c;h++)f[h-1]=arguments[h];n&&n.apply(void 0,[u].concat(f)),s(u)},[n])]}function YX(t,e){return Object.keys(e).reduce(function(n,r){var i,o=n,s=o[Pa(r)],l=o[r],a=F0(o,[Pa(r),r].map(BX)),u=e[r],c=dR(l,s,t[u]),f=c[0],h=c[1];return Mn({},a,(i={},i[r]=f,i[u]=h,i))},t)}function pR(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);t!=null&&this.setState(t)}function gR(t){function e(n){var r=this.constructor.getDerivedStateFromProps(t,n);return r??null}this.setState(e.bind(this))}function mR(t,e){try{var n=this.props,r=this.state;this.props=t,this.state=e,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}pR.__suppressDeprecationWarning=!0;gR.__suppressDeprecationWarning=!0;mR.__suppressDeprecationWarning=!0;function UX(t){var e=t.prototype;if(!e||!e.isReactComponent)throw new Error("Can only polyfill class components");if(typeof t.getDerivedStateFromProps!="function"&&typeof e.getSnapshotBeforeUpdate!="function")return t;var n=null,r=null,i=null;if(typeof e.componentWillMount=="function"?n="componentWillMount":typeof e.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof e.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof e.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof e.componentWillUpdate=="function"?i="componentWillUpdate":typeof e.UNSAFE_componentWillUpdate=="function"&&(i="UNSAFE_componentWillUpdate"),n!==null||r!==null||i!==null){var o=t.displayName||t.name,s=typeof t.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
113
-
114
- `+o+" uses "+s+" but also contains the following legacy lifecycles:"+(n!==null?`
115
- `+n:"")+(r!==null?`
116
- `+r:"")+(i!==null?`
117
- `+i:"")+`
118
-
119
- The above lifecycles should be removed. Learn more about this warning here:
120
- https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof t.getDerivedStateFromProps=="function"&&(e.componentWillMount=pR,e.componentWillReceiveProps=gR),typeof e.getSnapshotBeforeUpdate=="function"){if(typeof e.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");e.componentWillUpdate=mR;var l=e.componentDidUpdate;e.componentDidUpdate=function(u,c,f){var h=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;l.call(this,u,c,h)}}return t}var FX="/Users/jquense/src/uncontrollable/src/uncontrollable.js";function OR(t,e,n){n===void 0&&(n=[]);var r=t.displayName||t.name||"Component",i=WX(t),o=Object.keys(e),s=o.map(Pa);i||!n.length||IX(!1);var l=function(u){aR(c,u);function c(){for(var h,d=arguments.length,p=new Array(d),g=0;g<d;g++)p[g]=arguments[g];h=u.call.apply(u,[this].concat(p))||this,h.handlers=Object.create(null),o.forEach(function(v){var m=e[v],y=function(k){if(h.props[m]){var P;h._notifying=!0;for(var C=arguments.length,w=new Array(C>1?C-1:0),x=1;x<C;x++)w[x-1]=arguments[x];(P=h.props)[m].apply(P,[k].concat(w)),h._notifying=!1}h.unmounted||h.setState(function(_){var E,$=_.values;return{values:Mn(Object.create(null),$,(E={},E[v]=k,E))}})};h.handlers[m]=y}),n.length&&(h.attachRef=function(v){h.inner=v});var O=Object.create(null);return o.forEach(function(v){O[v]=h.props[Pa(v)]}),h.state={values:O,prevProps:{}},h}var f=c.prototype;return f.shouldComponentUpdate=function(){return!this._notifying},c.getDerivedStateFromProps=function(d,p){var g=p.values,O=p.prevProps,v={values:Mn(Object.create(null),g),prevProps:{}};return o.forEach(function(m){v.prevProps[m]=d[m],!Uk(d,m)&&Uk(O,m)&&(v.values[m]=d[Pa(m)])}),v},f.componentWillUnmount=function(){this.unmounted=!0},f.render=function(){var d=this,p=this.props,g=p.innerRef,O=F0(p,["innerRef"]);s.forEach(function(m){delete O[m]});var v={};return o.forEach(function(m){var y=d.props[m];v[m]=y!==void 0?y:d.state.values[m]}),Qi.createElement(t,Mn({},O,v,this.handlers,{ref:g||this.attachRef}))},c}(Qi.Component);UX(l),l.displayName="Uncontrolled("+r+")",l.propTypes=Mn({innerRef:function(){}},ZX(e)),n.forEach(function(u){l.prototype[u]=function(){var f;return(f=this.inner)[u].apply(f,arguments)}});var a=l;return Qi.forwardRef&&(a=Qi.forwardRef(function(u,c){return Qi.createElement(l,Mn({},u,{innerRef:c,__source:{fileName:FX,lineNumber:128},__self:this}))}),a.propTypes=l.propTypes),a.ControlledComponent=t,a.deferControlTo=function(u,c,f){return c===void 0&&(c={}),OR(u,Mn({},e,c),f)},a}const qX=Object.freeze(Object.defineProperty({__proto__:null,uncontrollable:OR,useUncontrolled:YX,useUncontrolledProp:dR},Symbol.toStringTag,{value:"Module"})),zX=yr(qX);var Vh={exports:{}},$u={},Ru={},Em={},Fk;function VX(){if(Fk)return Em;Fk=1;var t=Object.prototype.hasOwnProperty;function e(r,i,o){for(o of r.keys())if(n(o,i))return o}function n(r,i){var o,s,l;if(r===i)return!0;if(r&&i&&(o=r.constructor)===i.constructor){if(o===Date)return r.getTime()===i.getTime();if(o===RegExp)return r.toString()===i.toString();if(o===Array){if((s=r.length)===i.length)for(;s--&&n(r[s],i[s]););return s===-1}if(o===Set){if(r.size!==i.size)return!1;for(s of r)if(l=s,l&&typeof l=="object"&&(l=e(i,l),!l)||!i.has(l))return!1;return!0}if(o===Map){if(r.size!==i.size)return!1;for(s of r)if(l=s[0],l&&typeof l=="object"&&(l=e(i,l),!l)||!n(s[1],i.get(l)))return!1;return!0}if(o===ArrayBuffer)r=new Uint8Array(r),i=new Uint8Array(i);else if(o===DataView){if((s=r.byteLength)===i.byteLength)for(;s--&&r.getInt8(s)===i.getInt8(s););return s===-1}if(ArrayBuffer.isView(r)){if((s=r.byteLength)===i.byteLength)for(;s--&&r[s]===i[s];);return s===-1}if(!o||typeof r=="object"){s=0;for(o in r)if(t.call(r,o)&&++s&&!t.call(i,o)||!(o in i)||!n(r[o],i[o]))return!1;return Object.keys(i).length===s}}return r!==r&&i!==i}return Em.dequal=n,Em}var Qu={},qk;function GX(){if(qk)return Qu;qk=1,Qu.__esModule=!0,Qu.default=void 0;var t=Z,e=n(Y0());function n(o){return o&&o.__esModule?o:{default:o}}function r(o){const s=(0,e.default)();return[o[0],(0,t.useCallback)(l=>{if(s())return o[1](l)},[s,o[1]])]}var i=r;return Qu.default=i,Qu}var Gh={},zk;function HX(){if(zk)return Gh;zk=1;var t="top",e="bottom",n="right",r="left",i="auto",o=[t,e,n,r],s="start",l="end",a="clippingParents",u="viewport",c="popper",f="reference",h=o.reduce(function(D,I){return D.concat([I+"-"+s,I+"-"+l])},[]),d=[].concat(o,[i]).reduce(function(D,I){return D.concat([I,I+"-"+s,I+"-"+l])},[]),p="beforeRead",g="read",O="afterRead",v="beforeMain",m="main",y="afterMain",S="beforeWrite",k="write",P="afterWrite",C=[p,g,O,v,m,y,S,k,P];function w(D){return D.split("-")[0]}function x(D){if(D==null)return window;if(D.toString()!=="[object Window]"){var I=D.ownerDocument;return I&&I.defaultView||window}return D}function _(D){var I=x(D).Element;return D instanceof I||D instanceof Element}function E(D){var I=x(D).HTMLElement;return D instanceof I||D instanceof HTMLElement}function $(D){if(typeof ShadowRoot>"u")return!1;var I=x(D).ShadowRoot;return D instanceof I||D instanceof ShadowRoot}var j=Math.max,W=Math.min,G=Math.round;function M(){var D=navigator.userAgentData;return D!=null&&D.brands?D.brands.map(function(I){return I.brand+"/"+I.version}).join(" "):navigator.userAgent}function L(){return!/^((?!chrome|android).)*safari/i.test(M())}function N(D,I,X){I===void 0&&(I=!1),X===void 0&&(X=!1);var le=D.getBoundingClientRect(),V=1,he=1;I&&E(D)&&(V=D.offsetWidth>0&&G(le.width)/D.offsetWidth||1,he=D.offsetHeight>0&&G(le.height)/D.offsetHeight||1);var Ce=_(D)?x(D):window,de=Ce.visualViewport,ve=!L()&&X,et=(le.left+(ve&&de?de.offsetLeft:0))/V,Re=(le.top+(ve&&de?de.offsetTop:0))/he,_t=le.width/V,Bt=le.height/he;return{width:_t,height:Bt,top:Re,right:et+_t,bottom:Re+Bt,left:et,x:et,y:Re}}function Y(D){var I=N(D),X=D.offsetWidth,le=D.offsetHeight;return Math.abs(I.width-X)<=1&&(X=I.width),Math.abs(I.height-le)<=1&&(le=I.height),{x:D.offsetLeft,y:D.offsetTop,width:X,height:le}}function q(D,I){var X=I.getRootNode&&I.getRootNode();if(D.contains(I))return!0;if(X&&$(X)){var le=I;do{if(le&&D.isSameNode(le))return!0;le=le.parentNode||le.host}while(le)}return!1}function ae(D){return D?(D.nodeName||"").toLowerCase():null}function pe(D){return x(D).getComputedStyle(D)}function U(D){return["table","td","th"].indexOf(ae(D))>=0}function H(D){return((_(D)?D.ownerDocument:D.document)||window.document).documentElement}function se(D){return ae(D)==="html"?D:D.assignedSlot||D.parentNode||($(D)?D.host:null)||H(D)}function Ie(D){return!E(D)||pe(D).position==="fixed"?null:D.offsetParent}function F(D){var I=/firefox/i.test(M()),X=/Trident/i.test(M());if(X&&E(D)){var le=pe(D);if(le.position==="fixed")return null}var V=se(D);for($(V)&&(V=V.host);E(V)&&["html","body"].indexOf(ae(V))<0;){var he=pe(V);if(he.transform!=="none"||he.perspective!=="none"||he.contain==="paint"||["transform","perspective"].indexOf(he.willChange)!==-1||I&&he.willChange==="filter"||I&&he.filter&&he.filter!=="none")return V;V=V.parentNode}return null}function z(D){for(var I=x(D),X=Ie(D);X&&U(X)&&pe(X).position==="static";)X=Ie(X);return X&&(ae(X)==="html"||ae(X)==="body"&&pe(X).position==="static")?I:X||F(D)||I}function J(D){return["top","bottom"].indexOf(D)>=0?"x":"y"}function be(D,I,X){return j(D,W(I,X))}function Ae(D,I,X){var le=be(D,I,X);return le>X?X:le}function Me(){return{top:0,right:0,bottom:0,left:0}}function De(D){return Object.assign({},Me(),D)}function nt(D,I){return I.reduce(function(X,le){return X[le]=D,X},{})}var st=function(I,X){return I=typeof I=="function"?I(Object.assign({},X.rects,{placement:X.placement})):I,De(typeof I!="number"?I:nt(I,o))};function Tt(D){var I,X=D.state,le=D.name,V=D.options,he=X.elements.arrow,Ce=X.modifiersData.popperOffsets,de=w(X.placement),ve=J(de),et=[r,n].indexOf(de)>=0,Re=et?"height":"width";if(!(!he||!Ce)){var _t=st(V.padding,X),Bt=Y(he),rt=ve==="y"?t:r,St=ve==="y"?e:n,vt=X.rects.reference[Re]+X.rects.reference[ve]-Ce[ve]-X.rects.popper[Re],mt=Ce[ve]-X.rects.reference[ve],wt=z(he),hn=wt?ve==="y"?wt.clientHeight||0:wt.clientWidth||0:0,on=vt/2-mt/2,bt=_t[rt],Xt=hn-Bt[Re]-_t[St],jt=hn/2-Bt[Re]/2+on,dn=be(bt,jt,Xt),Zn=ve;X.modifiersData[le]=(I={},I[Zn]=dn,I.centerOffset=dn-jt,I)}}function cn(D){var I=D.state,X=D.options,le=X.element,V=le===void 0?"[data-popper-arrow]":le;V!=null&&(typeof V=="string"&&(V=I.elements.popper.querySelector(V),!V)||q(I.elements.popper,V)&&(I.elements.arrow=V))}var tr={name:"arrow",enabled:!0,phase:"main",fn:Tt,effect:cn,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Pn(D){return D.split("-")[1]}var Qn={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wi(D){var I=D.x,X=D.y,le=window,V=le.devicePixelRatio||1;return{x:G(I*V)/V||0,y:G(X*V)/V||0}}function jn(D){var I,X=D.popper,le=D.popperRect,V=D.placement,he=D.variation,Ce=D.offsets,de=D.position,ve=D.gpuAcceleration,et=D.adaptive,Re=D.roundOffsets,_t=D.isFixed,Bt=Ce.x,rt=Bt===void 0?0:Bt,St=Ce.y,vt=St===void 0?0:St,mt=typeof Re=="function"?Re({x:rt,y:vt}):{x:rt,y:vt};rt=mt.x,vt=mt.y;var wt=Ce.hasOwnProperty("x"),hn=Ce.hasOwnProperty("y"),on=r,bt=t,Xt=window;if(et){var jt=z(X),dn="clientHeight",Zn="clientWidth";if(jt===x(X)&&(jt=H(X),pe(jt).position!=="static"&&de==="absolute"&&(dn="scrollHeight",Zn="scrollWidth")),jt=jt,V===t||(V===r||V===n)&&he===l){bt=e;var Tn=_t&&jt===Xt&&Xt.visualViewport?Xt.visualViewport.height:jt[dn];vt-=Tn-le.height,vt*=ve?1:-1}if(V===r||(V===t||V===e)&&he===l){on=n;var vn=_t&&jt===Xt&&Xt.visualViewport?Xt.visualViewport.width:jt[Zn];rt-=vn-le.width,rt*=ve?1:-1}}var Wn=Object.assign({position:de},et&&Qn),Zr=Re===!0?wi({x:rt,y:vt}):{x:rt,y:vt};if(rt=Zr.x,vt=Zr.y,ve){var Vn;return Object.assign({},Wn,(Vn={},Vn[bt]=hn?"0":"",Vn[on]=wt?"0":"",Vn.transform=(Xt.devicePixelRatio||1)<=1?"translate("+rt+"px, "+vt+"px)":"translate3d("+rt+"px, "+vt+"px, 0)",Vn))}return Object.assign({},Wn,(I={},I[bt]=hn?vt+"px":"",I[on]=wt?rt+"px":"",I.transform="",I))}function R(D){var I=D.state,X=D.options,le=X.gpuAcceleration,V=le===void 0?!0:le,he=X.adaptive,Ce=he===void 0?!0:he,de=X.roundOffsets,ve=de===void 0?!0:de,et={placement:w(I.placement),variation:Pn(I.placement),popper:I.elements.popper,popperRect:I.rects.popper,gpuAcceleration:V,isFixed:I.options.strategy==="fixed"};I.modifiersData.popperOffsets!=null&&(I.styles.popper=Object.assign({},I.styles.popper,jn(Object.assign({},et,{offsets:I.modifiersData.popperOffsets,position:I.options.strategy,adaptive:Ce,roundOffsets:ve})))),I.modifiersData.arrow!=null&&(I.styles.arrow=Object.assign({},I.styles.arrow,jn(Object.assign({},et,{offsets:I.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:ve})))),I.attributes.popper=Object.assign({},I.attributes.popper,{"data-popper-placement":I.placement})}var ne={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:R,data:{}},ce={passive:!0};function we(D){var I=D.state,X=D.instance,le=D.options,V=le.scroll,he=V===void 0?!0:V,Ce=le.resize,de=Ce===void 0?!0:Ce,ve=x(I.elements.popper),et=[].concat(I.scrollParents.reference,I.scrollParents.popper);return he&&et.forEach(function(Re){Re.addEventListener("scroll",X.update,ce)}),de&&ve.addEventListener("resize",X.update,ce),function(){he&&et.forEach(function(Re){Re.removeEventListener("scroll",X.update,ce)}),de&&ve.removeEventListener("resize",X.update,ce)}}var ye={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:we,data:{}},Pe={left:"right",right:"left",bottom:"top",top:"bottom"};function Je(D){return D.replace(/left|right|bottom|top/g,function(I){return Pe[I]})}var tt={start:"end",end:"start"};function ue(D){return D.replace(/start|end/g,function(I){return tt[I]})}function _e(D){var I=x(D),X=I.pageXOffset,le=I.pageYOffset;return{scrollLeft:X,scrollTop:le}}function Se(D){return N(H(D)).left+_e(D).scrollLeft}function ke(D,I){var X=x(D),le=H(D),V=X.visualViewport,he=le.clientWidth,Ce=le.clientHeight,de=0,ve=0;if(V){he=V.width,Ce=V.height;var et=L();(et||!et&&I==="fixed")&&(de=V.offsetLeft,ve=V.offsetTop)}return{width:he,height:Ce,x:de+Se(D),y:ve}}function Qe(D){var I,X=H(D),le=_e(D),V=(I=D.ownerDocument)==null?void 0:I.body,he=j(X.scrollWidth,X.clientWidth,V?V.scrollWidth:0,V?V.clientWidth:0),Ce=j(X.scrollHeight,X.clientHeight,V?V.scrollHeight:0,V?V.clientHeight:0),de=-le.scrollLeft+Se(D),ve=-le.scrollTop;return pe(V||X).direction==="rtl"&&(de+=j(X.clientWidth,V?V.clientWidth:0)-he),{width:he,height:Ce,x:de,y:ve}}function Le(D){var I=pe(D),X=I.overflow,le=I.overflowX,V=I.overflowY;return/auto|scroll|overlay|hidden/.test(X+V+le)}function lt(D){return["html","body","#document"].indexOf(ae(D))>=0?D.ownerDocument.body:E(D)&&Le(D)?D:lt(se(D))}function ge(D,I){var X;I===void 0&&(I=[]);var le=lt(D),V=le===((X=D.ownerDocument)==null?void 0:X.body),he=x(le),Ce=V?[he].concat(he.visualViewport||[],Le(le)?le:[]):le,de=I.concat(Ce);return V?de:de.concat(ge(se(Ce)))}function Be(D){return Object.assign({},D,{left:D.x,top:D.y,right:D.x+D.width,bottom:D.y+D.height})}function pt(D,I){var X=N(D,!1,I==="fixed");return X.top=X.top+D.clientTop,X.left=X.left+D.clientLeft,X.bottom=X.top+D.clientHeight,X.right=X.left+D.clientWidth,X.width=D.clientWidth,X.height=D.clientHeight,X.x=X.left,X.y=X.top,X}function Fe(D,I,X){return I===u?Be(ke(D,X)):_(I)?pt(I,X):Be(Qe(H(D)))}function at(D){var I=ge(se(D)),X=["absolute","fixed"].indexOf(pe(D).position)>=0,le=X&&E(D)?z(D):D;return _(le)?I.filter(function(V){return _(V)&&q(V,le)&&ae(V)!=="body"}):[]}function Rt(D,I,X,le){var V=I==="clippingParents"?at(D):[].concat(I),he=[].concat(V,[X]),Ce=he[0],de=he.reduce(function(ve,et){var Re=Fe(D,et,le);return ve.top=j(Re.top,ve.top),ve.right=W(Re.right,ve.right),ve.bottom=W(Re.bottom,ve.bottom),ve.left=j(Re.left,ve.left),ve},Fe(D,Ce,le));return de.width=de.right-de.left,de.height=de.bottom-de.top,de.x=de.left,de.y=de.top,de}function zt(D){var I=D.reference,X=D.element,le=D.placement,V=le?w(le):null,he=le?Pn(le):null,Ce=I.x+I.width/2-X.width/2,de=I.y+I.height/2-X.height/2,ve;switch(V){case t:ve={x:Ce,y:I.y-X.height};break;case e:ve={x:Ce,y:I.y+I.height};break;case n:ve={x:I.x+I.width,y:de};break;case r:ve={x:I.x-X.width,y:de};break;default:ve={x:I.x,y:I.y}}var et=V?J(V):null;if(et!=null){var Re=et==="y"?"height":"width";switch(he){case s:ve[et]=ve[et]-(I[Re]/2-X[Re]/2);break;case l:ve[et]=ve[et]+(I[Re]/2-X[Re]/2);break}}return ve}function Wt(D,I){I===void 0&&(I={});var X=I,le=X.placement,V=le===void 0?D.placement:le,he=X.strategy,Ce=he===void 0?D.strategy:he,de=X.boundary,ve=de===void 0?a:de,et=X.rootBoundary,Re=et===void 0?u:et,_t=X.elementContext,Bt=_t===void 0?c:_t,rt=X.altBoundary,St=rt===void 0?!1:rt,vt=X.padding,mt=vt===void 0?0:vt,wt=De(typeof mt!="number"?mt:nt(mt,o)),hn=Bt===c?f:c,on=D.rects.popper,bt=D.elements[St?hn:Bt],Xt=Rt(_(bt)?bt:bt.contextElement||H(D.elements.popper),ve,Re,Ce),jt=N(D.elements.reference),dn=zt({reference:jt,element:on,strategy:"absolute",placement:V}),Zn=Be(Object.assign({},on,dn)),Tn=Bt===c?Zn:jt,vn={top:Xt.top-Tn.top+wt.top,bottom:Tn.bottom-Xt.bottom+wt.bottom,left:Xt.left-Tn.left+wt.left,right:Tn.right-Xt.right+wt.right},Wn=D.modifiersData.offset;if(Bt===c&&Wn){var Zr=Wn[V];Object.keys(vn).forEach(function(Vn){var ni=[n,e].indexOf(Vn)>=0?1:-1,ri=[t,e].indexOf(Vn)>=0?"y":"x";vn[Vn]+=Zr[ri]*ni})}return vn}function Ut(D,I){I===void 0&&(I={});var X=I,le=X.placement,V=X.boundary,he=X.rootBoundary,Ce=X.padding,de=X.flipVariations,ve=X.allowedAutoPlacements,et=ve===void 0?d:ve,Re=Pn(le),_t=Re?de?h:h.filter(function(St){return Pn(St)===Re}):o,Bt=_t.filter(function(St){return et.indexOf(St)>=0});Bt.length===0&&(Bt=_t);var rt=Bt.reduce(function(St,vt){return St[vt]=Wt(D,{placement:vt,boundary:V,rootBoundary:he,padding:Ce})[w(vt)],St},{});return Object.keys(rt).sort(function(St,vt){return rt[St]-rt[vt]})}function Cn(D){if(w(D)===i)return[];var I=Je(D);return[ue(D),I,ue(I)]}function On(D){var I=D.state,X=D.options,le=D.name;if(!I.modifiersData[le]._skip){for(var V=X.mainAxis,he=V===void 0?!0:V,Ce=X.altAxis,de=Ce===void 0?!0:Ce,ve=X.fallbackPlacements,et=X.padding,Re=X.boundary,_t=X.rootBoundary,Bt=X.altBoundary,rt=X.flipVariations,St=rt===void 0?!0:rt,vt=X.allowedAutoPlacements,mt=I.options.placement,wt=w(mt),hn=wt===mt,on=ve||(hn||!St?[Je(mt)]:Cn(mt)),bt=[mt].concat(on).reduce(function(po,ii){return po.concat(w(ii)===i?Ut(I,{placement:ii,boundary:Re,rootBoundary:_t,padding:et,flipVariations:St,allowedAutoPlacements:vt}):ii)},[]),Xt=I.rects.reference,jt=I.rects.popper,dn=new Map,Zn=!0,Tn=bt[0],vn=0;vn<bt.length;vn++){var Wn=bt[vn],Zr=w(Wn),Vn=Pn(Wn)===s,ni=[t,e].indexOf(Zr)>=0,ri=ni?"width":"height",ur=Wt(I,{placement:Wn,boundary:Re,rootBoundary:_t,altBoundary:Bt,padding:et}),wr=ni?Vn?n:r:Vn?e:t;Xt[ri]>jt[ri]&&(wr=Je(wr));var _l=Je(wr),Zi=[];if(he&&Zi.push(ur[Zr]<=0),de&&Zi.push(ur[wr]<=0,ur[_l]<=0),Zi.every(function(po){return po})){Tn=Wn,Zn=!1;break}dn.set(Wn,Zi)}if(Zn)for(var Pl=St?3:1,Cl=function(ii){var No=bt.find(function(go){var mo=dn.get(go);if(mo)return mo.slice(0,ii).every(function(El){return El})});if(No)return Tn=No,"break"},As=Pl;As>0;As--){var Ms=Cl(As);if(Ms==="break")break}I.placement!==Tn&&(I.modifiersData[le]._skip=!0,I.placement=Tn,I.reset=!0)}}var $r={name:"flip",enabled:!0,phase:"main",fn:On,requiresIfExists:["offset"],data:{_skip:!1}};function An(D,I,X){return X===void 0&&(X={x:0,y:0}),{top:D.top-I.height-X.y,right:D.right-I.width+X.x,bottom:D.bottom-I.height+X.y,left:D.left-I.width-X.x}}function In(D){return[t,n,e,r].some(function(I){return D[I]>=0})}function Ln(D){var I=D.state,X=D.name,le=I.rects.reference,V=I.rects.popper,he=I.modifiersData.preventOverflow,Ce=Wt(I,{elementContext:"reference"}),de=Wt(I,{altBoundary:!0}),ve=An(Ce,le),et=An(de,V,he),Re=In(ve),_t=In(et);I.modifiersData[X]={referenceClippingOffsets:ve,popperEscapeOffsets:et,isReferenceHidden:Re,hasPopperEscaped:_t},I.attributes.popper=Object.assign({},I.attributes.popper,{"data-popper-reference-hidden":Re,"data-popper-escaped":_t})}var yt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ln};function Ze(D,I,X){var le=w(D),V=[r,t].indexOf(le)>=0?-1:1,he=typeof X=="function"?X(Object.assign({},I,{placement:D})):X,Ce=he[0],de=he[1];return Ce=Ce||0,de=(de||0)*V,[r,n].indexOf(le)>=0?{x:de,y:Ce}:{x:Ce,y:de}}function qe(D){var I=D.state,X=D.options,le=D.name,V=X.offset,he=V===void 0?[0,0]:V,Ce=d.reduce(function(Re,_t){return Re[_t]=Ze(_t,I.rects,he),Re},{}),de=Ce[I.placement],ve=de.x,et=de.y;I.modifiersData.popperOffsets!=null&&(I.modifiersData.popperOffsets.x+=ve,I.modifiersData.popperOffsets.y+=et),I.modifiersData[le]=Ce}var He={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qe};function Te(D){var I=D.state,X=D.name;I.modifiersData[X]=zt({reference:I.rects.reference,element:I.rects.popper,strategy:"absolute",placement:I.placement})}var me={name:"popperOffsets",enabled:!0,phase:"read",fn:Te,data:{}};function ct(D){return D==="x"?"y":"x"}function ht(D){var I=D.state,X=D.options,le=D.name,V=X.mainAxis,he=V===void 0?!0:V,Ce=X.altAxis,de=Ce===void 0?!1:Ce,ve=X.boundary,et=X.rootBoundary,Re=X.altBoundary,_t=X.padding,Bt=X.tether,rt=Bt===void 0?!0:Bt,St=X.tetherOffset,vt=St===void 0?0:St,mt=Wt(I,{boundary:ve,rootBoundary:et,padding:_t,altBoundary:Re}),wt=w(I.placement),hn=Pn(I.placement),on=!hn,bt=J(wt),Xt=ct(bt),jt=I.modifiersData.popperOffsets,dn=I.rects.reference,Zn=I.rects.popper,Tn=typeof vt=="function"?vt(Object.assign({},I.rects,{placement:I.placement})):vt,vn=typeof Tn=="number"?{mainAxis:Tn,altAxis:Tn}:Object.assign({mainAxis:0,altAxis:0},Tn),Wn=I.modifiersData.offset?I.modifiersData.offset[I.placement]:null,Zr={x:0,y:0};if(jt){if(he){var Vn,ni=bt==="y"?t:r,ri=bt==="y"?e:n,ur=bt==="y"?"height":"width",wr=jt[bt],_l=wr+mt[ni],Zi=wr-mt[ri],Pl=rt?-Zn[ur]/2:0,Cl=hn===s?dn[ur]:Zn[ur],As=hn===s?-Zn[ur]:-dn[ur],Ms=I.elements.arrow,po=rt&&Ms?Y(Ms):{width:0,height:0},ii=I.modifiersData["arrow#persistent"]?I.modifiersData["arrow#persistent"].padding:Me(),No=ii[ni],go=ii[ri],mo=be(0,dn[ur],po[ur]),El=on?dn[ur]/2-Pl-mo-No-vn.mainAxis:Cl-mo-No-vn.mainAxis,wf=on?-dn[ur]/2+Pl+mo+go+vn.mainAxis:As+mo+go+vn.mainAxis,iu=I.elements.arrow&&z(I.elements.arrow),Tl=iu?bt==="y"?iu.clientTop||0:iu.clientLeft||0:0,kf=(Vn=Wn==null?void 0:Wn[bt])!=null?Vn:0,$l=wr+El-kf-Tl,xg=wr+wf-kf,Ds=be(rt?W(_l,$l):_l,wr,rt?j(Zi,xg):Zi);jt[bt]=Ds,Zr[bt]=Ds-wr}if(de){var xf,_f=bt==="x"?t:r,Pf=bt==="x"?e:n,Oo=jt[Xt],vo=Xt==="y"?"height":"width",ou=Oo+mt[_f],su=Oo-mt[Pf],Rl=[t,r].indexOf(wt)!==-1,Cf=(xf=Wn==null?void 0:Wn[Xt])!=null?xf:0,lu=Rl?ou:Oo-dn[vo]-Zn[vo]-Cf+vn.altAxis,au=Rl?Oo+dn[vo]+Zn[vo]-Cf-vn.altAxis:su,Ef=rt&&Rl?Ae(lu,Oo,au):be(rt?lu:ou,Oo,rt?au:su);jt[Xt]=Ef,Zr[Xt]=Ef-Oo}I.modifiersData[le]=Zr}}var kt={name:"preventOverflow",enabled:!0,phase:"main",fn:ht,requiresIfExists:["offset"]};function Vt(D){return{scrollLeft:D.scrollLeft,scrollTop:D.scrollTop}}function en(D){return D===x(D)||!E(D)?_e(D):Vt(D)}function Ft(D){var I=D.getBoundingClientRect(),X=G(I.width)/D.offsetWidth||1,le=G(I.height)/D.offsetHeight||1;return X!==1||le!==1}function fn(D,I,X){X===void 0&&(X=!1);var le=E(I),V=E(I)&&Ft(I),he=H(I),Ce=N(D,V,X),de={scrollLeft:0,scrollTop:0},ve={x:0,y:0};return(le||!le&&!X)&&((ae(I)!=="body"||Le(he))&&(de=en(I)),E(I)?(ve=N(I,!0),ve.x+=I.clientLeft,ve.y+=I.clientTop):he&&(ve.x=Se(he))),{x:Ce.left+de.scrollLeft-ve.x,y:Ce.top+de.scrollTop-ve.y,width:Ce.width,height:Ce.height}}function gt(D){var I=new Map,X=new Set,le=[];D.forEach(function(he){I.set(he.name,he)});function V(he){X.add(he.name);var Ce=[].concat(he.requires||[],he.requiresIfExists||[]);Ce.forEach(function(de){if(!X.has(de)){var ve=I.get(de);ve&&V(ve)}}),le.push(he)}return D.forEach(function(he){X.has(he.name)||V(he)}),le}function ut(D){var I=gt(D);return C.reduce(function(X,le){return X.concat(I.filter(function(V){return V.phase===le}))},[])}function Xe(D){var I;return function(){return I||(I=new Promise(function(X){Promise.resolve().then(function(){I=void 0,X(D())})})),I}}function xt(D){var I=D.reduce(function(X,le){var V=X[le.name];return X[le.name]=V?Object.assign({},V,le,{options:Object.assign({},V.options,le.options),data:Object.assign({},V.data,le.data)}):le,X},{});return Object.keys(I).map(function(X){return I[X]})}var En={placement:"bottom",modifiers:[],strategy:"absolute"};function Rr(){for(var D=arguments.length,I=new Array(D),X=0;X<D;X++)I[X]=arguments[X];return!I.some(function(le){return!(le&&typeof le.getBoundingClientRect=="function")})}function Sr(D){D===void 0&&(D={});var I=D,X=I.defaultModifiers,le=X===void 0?[]:X,V=I.defaultOptions,he=V===void 0?En:V;return function(de,ve,et){et===void 0&&(et=he);var Re={placement:"bottom",orderedModifiers:[],options:Object.assign({},En,he),modifiersData:{},elements:{reference:de,popper:ve},attributes:{},styles:{}},_t=[],Bt=!1,rt={state:Re,setOptions:function(wt){var hn=typeof wt=="function"?wt(Re.options):wt;vt(),Re.options=Object.assign({},he,Re.options,hn),Re.scrollParents={reference:_(de)?ge(de):de.contextElement?ge(de.contextElement):[],popper:ge(ve)};var on=ut(xt([].concat(le,Re.options.modifiers)));return Re.orderedModifiers=on.filter(function(bt){return bt.enabled}),St(),rt.update()},forceUpdate:function(){if(!Bt){var wt=Re.elements,hn=wt.reference,on=wt.popper;if(Rr(hn,on)){Re.rects={reference:fn(hn,z(on),Re.options.strategy==="fixed"),popper:Y(on)},Re.reset=!1,Re.placement=Re.options.placement,Re.orderedModifiers.forEach(function(vn){return Re.modifiersData[vn.name]=Object.assign({},vn.data)});for(var bt=0;bt<Re.orderedModifiers.length;bt++){if(Re.reset===!0){Re.reset=!1,bt=-1;continue}var Xt=Re.orderedModifiers[bt],jt=Xt.fn,dn=Xt.options,Zn=dn===void 0?{}:dn,Tn=Xt.name;typeof jt=="function"&&(Re=jt({state:Re,options:Zn,name:Tn,instance:rt})||Re)}}}},update:Xe(function(){return new Promise(function(mt){rt.forceUpdate(),mt(Re)})}),destroy:function(){vt(),Bt=!0}};if(!Rr(de,ve))return rt;rt.setOptions(et).then(function(mt){!Bt&&et.onFirstUpdate&&et.onFirstUpdate(mt)});function St(){Re.orderedModifiers.forEach(function(mt){var wt=mt.name,hn=mt.options,on=hn===void 0?{}:hn,bt=mt.effect;if(typeof bt=="function"){var Xt=bt({state:Re,name:wt,instance:rt,options:on}),jt=function(){};_t.push(Xt||jt)}})}function vt(){_t.forEach(function(mt){return mt()}),_t=[]}return rt}}const br=Sr({defaultModifiers:[yt,me,ne,ye,He,$r,kt,tr]});return Gh.createPopper=br,Gh.placements=d,Gh}var Vk;function KX(){if(Vk)return Ru;Vk=1,Ru.__esModule=!0,Ru.default=void 0;var t=Z,e=VX(),n=o(GX()),r=HX();const i=["enabled","placement","strategy","modifiers"];function o(h){return h&&h.__esModule?h:{default:h}}function s(h,d){if(h==null)return{};var p={},g=Object.keys(h),O,v;for(v=0;v<g.length;v++)O=g[v],!(d.indexOf(O)>=0)&&(p[O]=h[O]);return p}const l={name:"applyStyles",enabled:!1,phase:"afterWrite",fn:()=>{}},a={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:({state:h})=>()=>{const{reference:d,popper:p}=h.elements;if("removeAttribute"in d){const g=(d.getAttribute("aria-describedby")||"").split(",").filter(O=>O.trim()!==p.id);g.length?d.setAttribute("aria-describedby",g.join(",")):d.removeAttribute("aria-describedby")}},fn:({state:h})=>{var d;const{popper:p,reference:g}=h.elements,O=(d=p.getAttribute("role"))==null?void 0:d.toLowerCase();if(p.id&&O==="tooltip"&&"setAttribute"in g){const v=g.getAttribute("aria-describedby");if(v&&v.split(",").indexOf(p.id)!==-1)return;g.setAttribute("aria-describedby",v?`${v},${p.id}`:p.id)}}},u=[];function c(h,d,p={}){let{enabled:g=!0,placement:O="bottom",strategy:v="absolute",modifiers:m=u}=p,y=s(p,i);const S=(0,t.useRef)(m),k=(0,t.useRef)(),P=(0,t.useCallback)(()=>{var $;($=k.current)==null||$.update()},[]),C=(0,t.useCallback)(()=>{var $;($=k.current)==null||$.forceUpdate()},[]),[w,x]=(0,n.default)((0,t.useState)({placement:O,update:P,forceUpdate:C,attributes:{},styles:{popper:{},arrow:{}}})),_=(0,t.useMemo)(()=>({name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:({state:$})=>{const j={},W={};Object.keys($.elements).forEach(G=>{j[G]=$.styles[G],W[G]=$.attributes[G]}),x({state:$,styles:j,attributes:W,update:P,forceUpdate:C,placement:$.placement})}}),[P,C,x]),E=(0,t.useMemo)(()=>((0,e.dequal)(S.current,m)||(S.current=m),S.current),[m]);return(0,t.useEffect)(()=>{!k.current||!g||k.current.setOptions({placement:O,strategy:v,modifiers:[...E,_,l]})},[v,O,_,g,E]),(0,t.useEffect)(()=>{if(!(!g||h==null||d==null))return k.current=(0,r.createPopper)(h,d,Object.assign({},y,{placement:O,strategy:v,modifiers:[...E,a,_]})),()=>{k.current!=null&&(k.current.destroy(),k.current=void 0,x($=>Object.assign({},$,{attributes:{},styles:{popper:{}}})))}},[g,h,d]),w}var f=c;return Ru.default=f,Ru}var Au={},Ws={},Gk;function JX(){if(Gk)return Ws;Gk=1,Ws.__esModule=!0,Ws.default=Ws.getRefTarget=void 0;var t=s(B0),e=s(X0),n=s(mg),r=Z,i=s(Ts()),o=s(pg());function s(p){return p&&p.__esModule?p:{default:p}}const l=()=>{};function a(p){return p.button===0}function u(p){return!!(p.metaKey||p.altKey||p.ctrlKey||p.shiftKey)}const c=p=>p&&("current"in p?p.current:p);Ws.getRefTarget=c;const f={click:"mousedown",mouseup:"mousedown",pointerup:"pointerdown"};function h(p,g=l,{disabled:O,clickTrigger:v="click"}={}){const m=(0,r.useRef)(!1),y=(0,r.useRef)(!1),S=(0,r.useCallback)(C=>{const w=c(p);(0,o.default)(!!w,"ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node"),m.current=!w||u(C)||!a(C)||!!(0,t.default)(w,C.target)||y.current,y.current=!1},[p]),k=(0,i.default)(C=>{const w=c(p);w&&(0,t.default)(w,C.target)&&(y.current=!0)}),P=(0,i.default)(C=>{m.current||g(C)});(0,r.useEffect)(()=>{var C,w;if(O||p==null)return;const x=(0,n.default)(c(p)),_=x.defaultView||window;let E=(C=_.event)!=null?C:(w=_.parent)==null?void 0:w.event,$=null;f[v]&&($=(0,e.default)(x,f[v],k,!0));const j=(0,e.default)(x,v,S,!0),W=(0,e.default)(x,v,M=>{if(M===E){E=void 0;return}P(M)});let G=[];return"ontouchstart"in x.documentElement&&(G=[].slice.call(x.body.children).map(M=>(0,e.default)(M,"mousemove",l))),()=>{$==null||$(),j(),W(),G.forEach(M=>M())}},[p,O,v,S,k,P])}var d=h;return Ws.default=d,Ws}var Hk;function e3(){if(Hk)return Au;Hk=1,Au.__esModule=!0,Au.default=void 0;var t=a(X0),e=a(mg),n=Z,r=a(Ts()),i=l(JX()),o=sR();function s(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(s=function(g){return g?p:d})(h)}function l(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=s(d);if(p&&p.has(h))return p.get(h);var g={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}function a(h){return h&&h.__esModule?h:{default:h}}const u=()=>{};function c(h,d,{disabled:p,clickTrigger:g}={}){const O=d||u;(0,i.default)(h,O,{disabled:p,clickTrigger:g});const v=(0,r.default)(m=>{(0,o.isEscKey)(m)&&O(m)});(0,n.useEffect)(()=>{if(p||h==null)return;const m=(0,e.default)((0,i.getRefTarget)(h));let y=(m.defaultView||window).event;const S=(0,t.default)(m,"keyup",k=>{if(k===y){y=void 0;return}v(k)});return()=>{S()}},[h,p,v])}var f=c;return Au.default=f,Au}var Fl={},Kk;function t3(){if(Kk)return Fl;Kk=1,Fl.__esModule=!0,Fl.toModifierMap=t,Fl.toModifierArray=e,Fl.default=n;function t(r){const i={};return Array.isArray(r)?(r==null||r.forEach(o=>{i[o.name]=o}),i):r||i}function e(r={}){return Array.isArray(r)?r:Object.keys(r).map(i=>(r[i].name=i,r[i]))}function n({enabled:r,enableEvents:i,placement:o,flip:s,offset:l,fixed:a,containerPadding:u,arrowElement:c,popperConfig:f={}}){var h,d,p,g,O;const v=t(f.modifiers);return Object.assign({},f,{placement:o,enabled:r,strategy:a?"fixed":f.strategy,modifiers:e(Object.assign({},v,{eventListeners:{enabled:i,options:(h=v.eventListeners)==null?void 0:h.options},preventOverflow:Object.assign({},v.preventOverflow,{options:u?Object.assign({padding:u},(d=v.preventOverflow)==null?void 0:d.options):(p=v.preventOverflow)==null?void 0:p.options}),offset:{options:Object.assign({offset:l},(g=v.offset)==null?void 0:g.options)},arrow:Object.assign({},v.arrow,{enabled:!!c,options:Object.assign({},(O=v.arrow)==null?void 0:O.options,{element:c})}),flip:Object.assign({enabled:!!s},v.flip)}))})}return Fl}var Jk;function n3(){if(Jk)return $u;Jk=1,$u.__esModule=!0,$u.default=void 0;var t=f(Z),e=u(of),n=u(K$()),r=u(kl()),i=u(KX()),o=u(e3()),s=u(rR()),l=u(t3()),a=oR();function u(p){return p&&p.__esModule?p:{default:p}}function c(p){if(typeof WeakMap!="function")return null;var g=new WeakMap,O=new WeakMap;return(c=function(v){return v?O:g})(p)}function f(p,g){if(!g&&p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var O=c(g);if(O&&O.has(p))return O.get(p);var v={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in p)if(y!=="default"&&Object.prototype.hasOwnProperty.call(p,y)){var S=m?Object.getOwnPropertyDescriptor(p,y):null;S&&(S.get||S.set)?Object.defineProperty(v,y,S):v[y]=p[y]}return v.default=p,O&&O.set(p,v),v}const h=t.forwardRef((p,g)=>{const{flip:O,offset:v,placement:m,containerPadding:y,popperConfig:S={},transition:k,runTransition:P}=p,[C,w]=(0,n.default)(),[x,_]=(0,n.default)(),E=(0,r.default)(w,g),$=(0,s.default)(p.container),j=(0,s.default)(p.target),[W,G]=(0,t.useState)(!p.show),M=(0,i.default)(j,C,(0,l.default)({placement:m,enableEvents:!!p.show,containerPadding:y||5,flip:O,offset:v,arrowElement:x,popperConfig:S}));p.show&&W&&G(!1);const L=(...se)=>{G(!0),p.onExited&&p.onExited(...se)},N=p.show||!W;if((0,o.default)(C,p.onHide,{disabled:!p.rootClose||p.rootCloseDisabled,clickTrigger:p.rootCloseEvent}),!N)return null;const{onExit:Y,onExiting:q,onEnter:ae,onEntering:pe,onEntered:U}=p;let H=p.children(Object.assign({},M.attributes.popper,{style:M.styles.popper,ref:E}),{popper:M,placement:m,show:!!p.show,arrowProps:Object.assign({},M.attributes.arrow,{style:M.styles.arrow,ref:_})});return H=(0,a.renderTransition)(k,P,{in:!!p.show,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:H,onExit:Y,onExiting:q,onExited:L,onEnter:ae,onEntering:pe,onEntered:U}),$?e.default.createPortal(H,$):null});h.displayName="Overlay";var d=h;return $u.default=d,$u}var Hh={exports:{}};const r3=yr(uX);var Kh={exports:{}},Jh={exports:{}},ex;function i3(){return ex||(ex=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=a(Z),i=n(Ht()),o=kn(),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=r.forwardRef(({className:c,bsPrefix:f,as:h="div",...d},p)=>(f=(0,o.useBootstrapPrefix)(f,"popover-header"),(0,s.jsx)(h,{ref:p,className:(0,i.default)(c,f),...d})));u.displayName="PopoverHeader",e.default=u,t.exports=e.default}(Jh,Jh.exports)),Jh.exports}var ed={exports:{}},tx;function o3(){return tx||(tx=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=a(Z),i=n(Ht()),o=kn(),s=ee;function l(c){if(typeof WeakMap!="function")return null;var f=new WeakMap,h=new WeakMap;return(l=function(d){return d?h:f})(c)}function a(c,f){if(!f&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var h=l(f);if(h&&h.has(c))return h.get(c);var d={__proto__:null},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in c)if(g!=="default"&&Object.prototype.hasOwnProperty.call(c,g)){var O=p?Object.getOwnPropertyDescriptor(c,g):null;O&&(O.get||O.set)?Object.defineProperty(d,g,O):d[g]=c[g]}return d.default=c,h&&h.set(c,d),d}const u=r.forwardRef(({className:c,bsPrefix:f,as:h="div",...d},p)=>(f=(0,o.useBootstrapPrefix)(f,"popover-body"),(0,s.jsx)(h,{ref:p,className:(0,i.default)(c,f),...d})));u.displayName="PopoverBody",e.default=u,t.exports=e.default}(ed,ed.exports)),ed.exports}var ql={},nx;function vR(){if(nx)return ql;nx=1,ql.__esModule=!0,ql.BsPrefixComponent=void 0,ql.getOverlayDirection=i;var t=n(Z);function e(o){if(typeof WeakMap!="function")return null;var s=new WeakMap,l=new WeakMap;return(e=function(a){return a?l:s})(o)}function n(o,s){if(!s&&o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var l=e(s);if(l&&l.has(o))return l.get(o);var a={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in o)if(c!=="default"&&Object.prototype.hasOwnProperty.call(o,c)){var f=u?Object.getOwnPropertyDescriptor(o,c):null;f&&(f.get||f.set)?Object.defineProperty(a,c,f):a[c]=o[c]}return a.default=o,l&&l.set(o,a),a}class r extends t.Component{}ql.BsPrefixComponent=r;function i(o,s){let l=o;return o==="left"?l=s?"end":"start":o==="right"&&(l=s?"start":"end"),l}return ql}var td={exports:{}},rx;function yR(){return rx||(rx=1,function(t,e){e.__esModule=!0,e.default=n;function n(r="absolute"){return{position:r,top:"0",left:"0",opacity:"0",pointerEvents:"none"}}t.exports=e.default}(td,td.exports)),td.exports}var ix;function s3(){return ix||(ix=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=h(Z),o=kn(),s=n(i3()),l=n(o3()),a=vR(),u=n(yR()),c=ee;function f(p){if(typeof WeakMap!="function")return null;var g=new WeakMap,O=new WeakMap;return(f=function(v){return v?O:g})(p)}function h(p,g){if(!g&&p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var O=f(g);if(O&&O.has(p))return O.get(p);var v={__proto__:null},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var y in p)if(y!=="default"&&Object.prototype.hasOwnProperty.call(p,y)){var S=m?Object.getOwnPropertyDescriptor(p,y):null;S&&(S.get||S.set)?Object.defineProperty(v,y,S):v[y]=p[y]}return v.default=p,O&&O.set(p,v),v}const d=i.forwardRef(({bsPrefix:p,placement:g="right",className:O,style:v,children:m,body:y,arrowProps:S,hasDoneInitialMeasure:k,popper:P,show:C,...w},x)=>{const _=(0,o.useBootstrapPrefix)(p,"popover"),E=(0,o.useIsRTL)(),[$]=(g==null?void 0:g.split("-"))||[],j=(0,a.getOverlayDirection)($,E);let W=v;return C&&!k&&(W={...v,...(0,u.default)(P==null?void 0:P.strategy)}),(0,c.jsxs)("div",{ref:x,role:"tooltip",style:W,"x-placement":$,className:(0,r.default)(O,_,$&&`bs-popover-${j}`),...w,children:[(0,c.jsx)("div",{className:"popover-arrow",...S}),y?(0,c.jsx)(l.default,{children:m}):m]})});e.default=Object.assign(d,{Header:s.default,Body:l.default,POPPER_OFFSET:[0,8]}),t.exports=e.default}(Kh,Kh.exports)),Kh.exports}var qv={exports:{}};(function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(Ht()),i=c(Z),o=kn(),s=vR(),l=n(yR()),a=ee;function u(h){if(typeof WeakMap!="function")return null;var d=new WeakMap,p=new WeakMap;return(u=function(g){return g?p:d})(h)}function c(h,d){if(!d&&h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var p=u(d);if(p&&p.has(h))return p.get(h);var g={__proto__:null},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var v in h)if(v!=="default"&&Object.prototype.hasOwnProperty.call(h,v)){var m=O?Object.getOwnPropertyDescriptor(h,v):null;m&&(m.get||m.set)?Object.defineProperty(g,v,m):g[v]=h[v]}return g.default=h,p&&p.set(h,g),g}const f=i.forwardRef(({bsPrefix:h,placement:d="right",className:p,style:g,children:O,arrowProps:v,hasDoneInitialMeasure:m,popper:y,show:S,...k},P)=>{h=(0,o.useBootstrapPrefix)(h,"tooltip");const C=(0,o.useIsRTL)(),[w]=(d==null?void 0:d.split("-"))||[],x=(0,s.getOverlayDirection)(w,C);let _=g;return S&&!m&&(_={...g,...(0,l.default)(y==null?void 0:y.strategy)}),(0,a.jsxs)("div",{ref:P,style:_,role:"tooltip","x-placement":w,className:(0,r.default)(p,h,`bs-tooltip-${x}`),...k,children:[(0,a.jsx)("div",{className:"tooltip-arrow",...v}),(0,a.jsx)("div",{className:`${h}-inner`,children:O})]})});f.displayName="Tooltip",e.default=Object.assign(f,{TOOLTIP_OFFSET:[0,6]}),t.exports=e.default})(qv,qv.exports);var SR=qv.exports;const l3=vi(SR);var ox;function a3(){return ox||(ox=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=a;var r=Z,i=n(r3),o=kn(),s=n(s3()),l=n(SR);function a(u){const c=(0,r.useRef)(null),f=(0,o.useBootstrapPrefix)(void 0,"popover"),h=(0,o.useBootstrapPrefix)(void 0,"tooltip"),d=(0,r.useMemo)(()=>({name:"offset",options:{offset:()=>{if(u)return u;if(c.current){if((0,i.default)(c.current,f))return s.default.POPPER_OFFSET;if((0,i.default)(c.current,h))return l.default.TOOLTIP_OFFSET}return[0,0]}}}),[u,f,h]);return[c,[d]]}t.exports=e.default}(Hh,Hh.exports)),Hh.exports}var sx;function u3(){return sx||(sx=1,function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=g(Z),i=r,o=n(Ht()),s=n(n3()),l=n(Ts()),a=n(iR()),u=n(kl()),c=n(a3()),f=n(fR()),h=n(q0()),d=ee;function p(m){if(typeof WeakMap!="function")return null;var y=new WeakMap,S=new WeakMap;return(p=function(k){return k?S:y})(m)}function g(m,y){if(!y&&m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var S=p(y);if(S&&S.has(m))return S.get(m);var k={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in m)if(C!=="default"&&Object.prototype.hasOwnProperty.call(m,C)){var w=P?Object.getOwnPropertyDescriptor(m,C):null;w&&(w.get||w.set)?Object.defineProperty(k,C,w):k[C]=m[C]}return k.default=m,S&&S.set(m,k),k}function O(m,y){const{ref:S}=m,{ref:k}=y;m.ref=S.__wrapped||(S.__wrapped=P=>S((0,h.default)(P))),y.ref=k.__wrapped||(k.__wrapped=P=>k((0,h.default)(P)))}const v=i.forwardRef(({children:m,transition:y=f.default,popperConfig:S={},rootClose:k=!1,placement:P="top",show:C=!1,...w},x)=>{const _=(0,r.useRef)({}),[E,$]=(0,r.useState)(null),[j,W]=(0,c.default)(w.offset),G=(0,u.default)(x,j),M=y===!0?f.default:y||void 0,L=(0,l.default)(N=>{$(N),S==null||S.onFirstUpdate==null||S.onFirstUpdate(N)});return(0,a.default)(()=>{E&&w.target&&(_.current.scheduleUpdate==null||_.current.scheduleUpdate())},[E,w.target]),(0,r.useEffect)(()=>{C||$(null)},[C]),(0,d.jsx)(s.default,{...w,ref:G,popperConfig:{...S,modifiers:W.concat(S.modifiers||[]),onFirstUpdate:L},transition:M,rootClose:k,placement:P,show:C,children:(N,{arrowProps:Y,popper:q,show:ae})=>{var pe,U;O(N,Y);const H=q==null?void 0:q.placement,se=Object.assign(_.current,{state:q==null?void 0:q.state,scheduleUpdate:q==null?void 0:q.update,placement:H,outOfBoundaries:(q==null||(pe=q.state)==null||(U=pe.modifiersData.hide)==null?void 0:U.isReferenceHidden)||!1,strategy:S.strategy}),Ie=!!E;return typeof m=="function"?m({...N,placement:H,show:ae,...!y&&ae&&{className:"show"},popper:se,arrowProps:Y,hasDoneInitialMeasure:Ie}):i.cloneElement(m,{...N,placement:H,arrowProps:Y,popper:se,hasDoneInitialMeasure:Ie,className:(0,o.default)(m.props.className,!y&&ae&&"show"),style:{...m.props.style,...N.style}})}})});v.displayName="Overlay",e.default=v,t.exports=e.default}(Vh,Vh.exports)),Vh.exports}(function(t,e){"use client";var n=Pt;e.__esModule=!0,e.default=void 0;var r=n(B0),i=n(Of()),o=p(Z),s=o,l=n(DX());n(pg());var a=zX,u=n(kl()),c=n(u3()),f=n(q0()),h=ee;function d(m){if(typeof WeakMap!="function")return null;var y=new WeakMap,S=new WeakMap;return(d=function(k){return k?S:y})(m)}function p(m,y){if(!y&&m&&m.__esModule)return m;if(m===null||typeof m!="object"&&typeof m!="function")return{default:m};var S=d(y);if(S&&S.has(m))return S.get(m);var k={__proto__:null},P=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var C in m)if(C!=="default"&&Object.prototype.hasOwnProperty.call(m,C)){var w=P?Object.getOwnPropertyDescriptor(m,C):null;w&&(w.get||w.set)?Object.defineProperty(k,C,w):k[C]=m[C]}return k.default=m,S&&S.set(m,k),k}function g(m){return m&&typeof m=="object"?m:{show:m,hide:m}}function O(m,y,S){const[k]=y,P=k.currentTarget,C=k.relatedTarget||k.nativeEvent[S];(!C||C!==P)&&!(0,r.default)(P,C)&&m(...y)}i.default.oneOf(["click","hover","focus"]);const v=({trigger:m=["hover","focus"],overlay:y,children:S,popperConfig:k={},show:P,defaultShow:C=!1,onToggle:w,delay:x,placement:_,flip:E=_&&_.indexOf("auto")!==-1,...$})=>{const j=(0,o.useRef)(null),W=(0,u.default)(j,S.ref),G=(0,l.default)(),M=(0,o.useRef)(""),[L,N]=(0,a.useUncontrolledProp)(P,C,w),Y=g(x),{onFocus:q,onBlur:ae,onClick:pe}=typeof S!="function"?s.Children.only(S).props:{},U=De=>{W((0,f.default)(De))},H=(0,o.useCallback)(()=>{if(G.clear(),M.current="show",!Y.show){N(!0);return}G.set(()=>{M.current==="show"&&N(!0)},Y.show)},[Y.show,N,G]),se=(0,o.useCallback)(()=>{if(G.clear(),M.current="hide",!Y.hide){N(!1);return}G.set(()=>{M.current==="hide"&&N(!1)},Y.hide)},[Y.hide,N,G]),Ie=(0,o.useCallback)((...De)=>{H(),q==null||q(...De)},[H,q]),F=(0,o.useCallback)((...De)=>{se(),ae==null||ae(...De)},[se,ae]),z=(0,o.useCallback)((...De)=>{N(!L),pe==null||pe(...De)},[pe,N,L]),J=(0,o.useCallback)((...De)=>{O(H,De,"fromElement")},[H]),be=(0,o.useCallback)((...De)=>{O(se,De,"toElement")},[se]),Ae=m==null?[]:[].concat(m),Me={ref:U};return Ae.indexOf("click")!==-1&&(Me.onClick=z),Ae.indexOf("focus")!==-1&&(Me.onFocus=Ie,Me.onBlur=F),Ae.indexOf("hover")!==-1&&(Me.onMouseOver=J,Me.onMouseOut=be),(0,h.jsxs)(h.Fragment,{children:[typeof S=="function"?S(Me):(0,o.cloneElement)(S,Me),(0,h.jsx)(c.default,{...$,show:L,onHide:se,flip:E,placement:_,popperConfig:k,target:j.current,children:y})]})};e.default=v,t.exports=e.default})(Fv,Fv.exports);var c3=Fv.exports;const f3=vi(c3),h3=({show:t,onClose:e,theme:n,setTheme:r,username:i,setUsername:o,enableUsernameField:s=!0})=>{const l=Z.useCallback(c=>{const f=c.target.value;console.log(f),r(f)},[]),a=Z.useRef(null),u=Z.useCallback(()=>{var c;o(((c=a.current)==null?void 0:c.value)||"")},[o]);return t?ee.jsxs(xr,{className:"vz-settings",show:t,onHide:e,animation:!1,children:[ee.jsx(xr.Header,{closeButton:!0,children:ee.jsx(xr.Title,{children:"Editor Settings"})}),ee.jsxs(xr.Body,{children:[s?ee.jsxs(Ei.Group,{className:"mb-3",controlId:"formFork",children:[ee.jsx(Ei.Label,{children:"Username"}),ee.jsx(Ei.Control,{type:"text",ref:a,onChange:u,placeholder:"Enter username",value:i}),ee.jsx(Ei.Text,{className:"text-muted",children:"Enter a username to be displayed on your cursor"})]}):null,ee.jsxs(Ei.Group,{className:"mb-3",controlId:"formFork",children:[ee.jsx(Ei.Label,{children:"Theme"}),ee.jsx("select",{className:"form-select",value:n,onChange:l,children:a$.map(({label:c})=>ee.jsx("option",{value:c,children:c},c))}),ee.jsx(Ei.Text,{className:"text-muted",children:"Select a color theme for the editor"})]})]}),ee.jsx(xr.Footer,{children:ee.jsx(Uc,{variant:"primary",onClick:e,children:"Done"})})]}):null},d3=t=>{const e={name:"files"};for(const n of Object.keys(t)){const r=t[n],i=r.name.split("/"),o=i.length;let s=e;for(let l=0;l<o-1;l++){let a;const u=i[l];if(s.children)for(let c=0;c<s.children.length;c++){const f=s.children[c];if(f.name===u){a=f;break}}a||(a={name:i[l],path:i.slice(0,l+1).join("/")},(s.children||(s.children=[])).push(a)),s=a}r.text!==null&&(s.children||(s.children=[])).push({name:i[o-1],file:r,fileId:n})}return e},bR=t=>(t.children&&(t.children.sort((e,n)=>{const r=e.file?1:0,i=n.file?1:0;return r-i||e.name.localeCompare(n.name)}),t.children.forEach(bR)),t),p3=({show:t,onClose:e,onConfirm:n,isDirectory:r,name:i})=>{const o=Z.useCallback(s=>{s.key==="Enter"&&n()},[n]);return Z.useEffect(()=>(t?window.addEventListener("keydown",o):window.removeEventListener("keydown",o),()=>{window.removeEventListener("keydown",o)}),[t,o]),ee.jsxs(xr,{show:t,onHide:e,centered:!0,children:[ee.jsx(xr.Header,{closeButton:!0,onClick:e,children:ee.jsxs(xr.Title,{children:["Delete ",r?"Directory":"File"]})}),ee.jsx(xr.Body,{children:ee.jsxs("p",{children:["This will delete the"," ",r?"directory":"file"," ",ee.jsx("strong",{children:i}),"."]})}),ee.jsxs(xr.Footer,{children:[ee.jsx(Uc,{variant:"secondary",type:"button",onClick:e,children:"Cancel"}),ee.jsx(Uc,{variant:"primary",onClick:n,children:"Delete"})]})]})},g3=!1,wR=({name:t,children:e,handleClick:n,handleDoubleClick:r,handleRenameClick:i,handleDeleteClick:o,isDirectory:s=!1,isActive:l=!1})=>{const[a,u]=Z.useState(!1),[c,f]=Z.useState(!1),[h,d]=Z.useState(""),[p,g]=Z.useState(!1),O=Z.useRef(null),v=Z.useCallback(_=>{_.key==="Escape"?f(!1):_.key==="Enter"&&O.current.blur()},[]),m=Z.useCallback(()=>{f(!1),O.current.value.trim()===""?g(!0):i(O.current.value)},[i]),y=Z.useCallback(_=>{_.stopPropagation(),f(!c),d(t)},[t,c]);Z.useEffect(()=>{c&&O.current.focus()},[c]);const S=Z.useCallback(_=>{_.stopPropagation(),g(!0)},[]),k=Z.useCallback(()=>{g(!1)},[]),P=Z.useCallback(_=>{_==null||_.stopPropagation(),g(!1),o()},[o]),C=Z.useCallback(()=>{u(!0)},[]),w=Z.useCallback(()=>{u(!1)},[]),x=Z.useCallback(()=>{d(O.current.value)},[]);return ee.jsxs("div",{className:`full-box file-or-directory user-select-none ${l?"active-file":""}`,onClick:c?null:n,onDoubleClick:c||!r?null:r,onMouseEnter:C,onMouseLeave:w,children:[ee.jsx("div",{className:"name",children:c?ee.jsx("input",{ref:O,type:"text","aria-label":"Field name",value:h,onKeyDown:v,onBlur:m,onChange:x}):e}),a&&!c?ee.jsxs("div",{className:"utils",children:[!s||g3?ee.jsx("i",{className:"bx bxs-edit utilities",style:{color:"#9edcff"},onClick:y}):null,ee.jsx("i",{className:"bx bx-trash utilities",style:{color:"#ff006b"},onClick:S})]}):null,ee.jsx(p3,{show:p,onClose:k,onConfirm:P,isDirectory:s,name:t})]})},m3=({height:t=10,fill:e="currentcolor"})=>ee.jsx("svg",{height:t,viewBox:"4 4 16 16",children:ee.jsx("path",{fill:e,d:"M8 17l9-5-9-5v10z"})}),O3=({name:t,path:e,children:n,renameFile:r,deleteFile:i,deleteDirectory:o,handleFileClick:s,handleFileDoubleClick:l,isDirectoryOpen:a,toggleDirectory:u,activeFileId:c})=>{const f=Z.useCallback(()=>{u(e)},[u,e]),h=Z.useCallback(()=>{o(e)},[o,e]),d=Z.useCallback(()=>{console.log("TODO handleRenameDirectoryClick")},[]),p=Z.useMemo(()=>a(e),[a,e]);return ee.jsxs(ee.Fragment,{children:[ee.jsxs(wR,{name:t,handleClick:f,handleDeleteClick:h,handleRenameClick:d,isDirectory:!0,children:[ee.jsx("div",{className:"arrow-wrapper",style:{transform:`rotate(${p?90:0}deg)`},children:ee.jsx(m3,{})}),t]}),n&&p?ee.jsx("div",{className:"indentation",children:n.map(g=>{const{fileId:O}=g,{path:v}=g;return ee.jsx(kR,{entity:g,renameFile:r,deleteFile:i,deleteDirectory:o,handleFileClick:s,handleFileDoubleClick:l,isDirectoryOpen:a,toggleDirectory:u,activeFileId:c},O||v)})}):null]})},v3=({name:t,fileId:e,renameFile:n,deleteFile:r,handleFileClick:i,handleFileDoubleClick:o,isActive:s})=>{const l=Z.useCallback(()=>{i(e)},[e,i]),a=Z.useCallback(()=>{o(e)},[e,o]),u=Z.useCallback(()=>{r(e)},[e,r]),c=Z.useCallback(f=>{n(e,f)},[e,n]);return ee.jsx(wR,{name:t,handleClick:l,handleDoubleClick:a,handleDeleteClick:u,handleRenameClick:c,isActive:s,children:t})},kR=({entity:t,renameFile:e,deleteFile:n,deleteDirectory:r,handleFileClick:i,handleFileDoubleClick:o,isDirectoryOpen:s,toggleDirectory:l,activeFileId:a})=>{const{name:u,file:c,fileId:f}=t,{path:h,children:d}=t;return c?ee.jsx(v3,{fileId:f,name:u,renameFile:e,deleteFile:n,handleFileClick:i,handleFileDoubleClick:o,isActive:f===a}):ee.jsx(O3,{name:u,path:h,children:d,renameFile:e,deleteFile:n,deleteDirectory:r,handleFileClick:i,handleFileDoubleClick:o,isDirectoryOpen:s,toggleDirectory:l,activeFileId:a})},y3=({show:t,onClose:e,onRename:n,initialFileName:r=""})=>{const[i,o]=Z.useState(r),s=Z.useRef(null);Z.useEffect(()=>{t&&s.current&&s.current.focus()},[t]);const l=Z.useCallback(f=>{o(f.target.value)},[]),a=Z.useCallback(()=>{n(i),o("")},[i,n]),u=Z.useCallback(f=>/^[a-zA-Z0-9](?:[a-zA-Z0-9 ./+=_-]*[a-zA-Z0-9])?$/.test(f),[]),c=Z.useCallback(f=>{f.key==="Enter"&&(f.ctrlKey||f.shiftKey||!f.altKey&&!f.metaKey)&&a()},[a]);return t?ee.jsxs(xr,{show:t,onHide:e,animation:!1,onKeyDown:c,children:[ee.jsx(xr.Header,{closeButton:!0,children:ee.jsx(xr.Title,{children:"Create File"})}),ee.jsx(xr.Body,{children:ee.jsxs(Ei.Group,{className:"mb-3",controlId:"fileName",children:[ee.jsx(Ei.Label,{children:"File Name"}),ee.jsx(Ei.Control,{type:"text",value:i,onChange:l,ref:s,spellCheck:"false"}),ee.jsx(Ei.Text,{className:"text-muted",children:"Enter the name for your file"})]})}),ee.jsx(xr.Footer,{children:ee.jsx(Uc,{variant:"primary",onClick:a,disabled:!u(i),children:"Create File"})})]}):null},lx=({handleCreateFile:t})=>ee.jsx("i",{className:"bx bxs-file-plus new-btn",style:{color:"#dbdde1"},onClick:t,title:"Create file"}),S3=({files:t,createFile:e,renameFile:n,deleteFile:r,deleteDirectory:i,openTab:o,closeTabs:s,setIsSettingsOpen:l,isDirectoryOpen:a,toggleDirectory:u,activeFileId:c})=>{const f=Z.useMemo(()=>t?bR(d3(t)):null,[t]),[h,d]=Z.useState(!1),p=Z.useCallback(()=>{d(!0)},[d]),g=Z.useCallback(()=>{d(!1)},[d]),O=Z.useCallback(P=>{e(P),d(!1)},[e,d]),v=Z.useCallback(P=>{P.altKey==!0&&(P.key=="w"&&s([c]),P.key=="n"&&p())},[e,s,c]);Z.useEffect(()=>(document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}),[v]),Z.useCallback(()=>{l(!0)},[]);const{sidebarWidth:m}=Z.useContext(lg),y=Z.useCallback(P=>{o({fileId:P,isTransient:!0})},[o]),S=Z.useCallback(P=>{o({fileId:P,isTransient:!1})},[o]),k=f&&f.children&&f.children.length>0;return ee.jsxs("div",{className:"vz-sidebar",style:{width:m+"px"},children:[ee.jsxs("div",{className:"files",children:[ee.jsxs("div",{className:"full-box",children:[ee.jsx("div",{className:"sidebar-section-hint",children:"Files"}),ee.jsx("div",{children:ee.jsx(lx,{handleCreateFile:p})})]}),k?f.children.map(P=>{const{fileId:C}=P,{path:w}=P,x=C||w;return ee.jsx(kR,{entity:P,renameFile:n,deleteFile:r,deleteDirectory:i,handleFileClick:y,handleFileDoubleClick:S,isDirectoryOpen:a,toggleDirectory:u,activeFileId:c},x)}):ee.jsxs("div",{className:"empty",children:[ee.jsx("div",{className:"empty-text",children:`It looks like you don't have any files yet! Click the "Create file" button below to create your first file.`}),ee.jsx(lx,{handleCreateFile:p})]})]}),null,ee.jsx(y3,{show:h,onClose:g,onRename:O})]})},b3=({enableUsernameField:t=!0})=>{const{files:e,createFile:n,renameFile:r,deleteFile:i,deleteDirectory:o,activeFileId:s,openTab:l,closeTabs:a,isSettingsOpen:u,setIsSettingsOpen:c,closeSettings:f,theme:h,setTheme:d,username:p,setUsername:g,isDirectoryOpen:O,toggleDirectory:v}=Z.useContext(df);return ee.jsxs("div",{className:"left",children:[ee.jsx(S3,{files:e,createFile:n,renameFile:r,deleteFile:i,deleteDirectory:o,openTab:l,closeTabs:a,setIsSettingsOpen:c,isDirectoryOpen:O,toggleDirectory:v,activeFileId:s}),ee.jsx(h3,{show:u,onClose:f,theme:h,setTheme:d,username:p,setUsername:g,enableUsernameField:t})]})},w3=t=>{const e=t.split("/");return e.length===1?e[e.length-1]:e[e.length-2]+"/"+e[e.length-1]},k3=({fileId:t,isTransient:e,isActive:n,setActiveFileId:r,openTab:i,closeTabs:o,fileName:s})=>{const l=Z.useCallback(f=>{f.stopPropagation(),o([t])},[o,t]),a=Z.useMemo(()=>w3(s),[s]),u=Z.useCallback(()=>{r(t)},[t,r]),c=Z.useCallback(()=>{i({fileId:t})},[t,i]);return ee.jsxs("div",{className:`tab user-select-none ${n?"active":""} ${e?"transient":""}`,onClick:u,onDoubleClick:c,children:[a,ee.jsx("div",{className:"bx bx-x tab-close",onClick:l})]})},x3=({files:t,tabList:e,activeFileId:n,setActiveFileId:r,openTab:i,closeTabs:o,createFile:s})=>ee.jsx("div",{className:"vz-tab-list",children:t&&e.filter(l=>l.fileId in t).map(l=>ee.jsx(k3,{fileId:l.fileId,isTransient:l.isTransient,isActive:l.fileId===n,setActiveFileId:r,openTab:i,closeTabs:o,fileName:t[l.fileId].name},l.fileId))}),_3=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=z0(t.state,n.from);return r.line?P3(t):r.block?$3(t):!1};function vf(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const P3=vf(V0,0),C3=vf(V0,1),E3=vf(V0,2),T3=vf(xR,0),$3=vf((t,e)=>xR(t,e,Q3(e)),0);function z0(t,e){let n=t.languageDataAt("commentTokens",e);return n.length?n[0]:{}}const Mu=50;function R3(t,{open:e,close:n},r,i){let o=t.sliceDoc(r-Mu,r),s=t.sliceDoc(i,i+Mu),l=/\s*$/.exec(o)[0].length,a=/^\s*/.exec(s)[0].length,u=o.length-l;if(o.slice(u-e.length,u)==e&&s.slice(a,a+n.length)==n)return{open:{pos:r-l,margin:l&&1},close:{pos:i+a,margin:a&&1}};let c,f;i-r<=2*Mu?c=f=t.sliceDoc(r,i):(c=t.sliceDoc(r,r+Mu),f=t.sliceDoc(i-Mu,i));let h=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-n.length;return c.slice(h,h+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+h+e.length,margin:/\s/.test(c.charAt(h+e.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Q3(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to),o=e.length-1;o>=0&&e[o].to>r.from?e[o].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function xR(t,e,n=e.selection.ranges){let r=n.map(o=>z0(e,o.from).block);if(!r.every(o=>o))return null;let i=n.map((o,s)=>R3(e,r[s],o.from,o.to));if(t!=2&&!i.every(o=>o))return{changes:e.changes(n.map((o,s)=>i[s]?[]:[{from:o.from,insert:r[s].open+" "},{from:o.to,insert:" "+r[s].close}]))};if(t!=1&&i.some(o=>o)){let o=[];for(let s=0,l;s<i.length;s++)if(l=i[s]){let a=r[s],{open:u,close:c}=l;o.push({from:u.pos-a.open.length,to:u.pos+u.margin},{from:c.pos-c.margin,to:c.pos+a.close.length})}return{changes:o}}return null}function V0(t,e,n=e.selection.ranges){let r=[],i=-1;for(let{from:o,to:s}of n){let l=r.length,a=1e9,u=z0(e,o).line;if(u){for(let c=o;c<=s;){let f=e.doc.lineAt(c);if(f.from>i&&(o==s||s>f.from)){i=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,p=f.text.slice(h,h+u.length)==u?h:-1;h<f.text.length&&h<a&&(a=h),r.push({line:f,comment:p,token:u,indent:h,empty:d,single:!1})}c=f.to+1}if(a<1e9)for(let c=l;c<r.length;c++)r[c].indent<r[c].line.text.length&&(r[c].indent=a);r.length==l+1&&(r[l].single=!0)}}if(t!=2&&r.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:l,token:a,indent:u,empty:c,single:f}of r)(f||!c)&&o.push({from:l.from+u,insert:a+" "});let s=e.changes(o);return{changes:s,selection:e.selection.map(s,1)}}else if(t!=1&&r.some(o=>o.comment>=0)){let o=[];for(let{line:s,comment:l,token:a}of r)if(l>=0){let u=s.from+l,c=u+a.length;s.text[c-s.from]==" "&&c++,o.push({from:u,to:c})}return{changes:o}}return null}const zv=fo.define(),A3=fo.define(),M3=je.define(),_R=je.define({combine(t){return Li(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}});function D3(t){let e=0;return t.iterChangedRanges((n,r)=>e=r),e}const PR=zn.define({create(){return oo.empty},update(t,e){let n=e.state.facet(_R),r=e.annotation(zv);if(r){let a=e.docChanged?oe.single(D3(e.changes)):void 0,u=Nr.fromTransaction(e,a),c=r.side,f=c==0?t.undone:t.done;return u?f=Cp(f,f.length,n.minDepth,u):f=TR(f,e.startState.selection),new oo(c==0?r.rest:f,c==0?f:r.rest)}let i=e.annotation(A3);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(Nn.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let o=Nr.fromTransaction(e),s=e.annotation(Nn.time),l=e.annotation(Nn.userEvent);return o?t=t.addChanges(o,s,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,s,l,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new oo(t.done.map(Nr.fromJSON),t.undone.map(Nr.fromJSON))}});function N3(t={}){return[PR,_R.of(t),$e.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?CR:e.inputType=="historyRedo"?Vv:null;return r?(e.preventDefault(),r(n)):!1}})]}function G0(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(PR,!1);if(!i)return!1;let o=i.pop(t,n,e);return o?(r(o),!0):!1}}const CR=G0(0,!1),Vv=G0(1,!1),j3=G0(0,!0);class Nr{constructor(e,n,r,i,o){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=o}setSelAfter(e){return new Nr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Nr(e.changes&&Yn.fromJSON(e.changes),[],e.mapped&&ao.fromJSON(e.mapped),e.startSelection&&oe.fromJSON(e.startSelection),e.selectionsAfter.map(oe.fromJSON))}static fromTransaction(e,n){let r=di;for(let i of e.startState.facet(M3)){let o=i(e);o.length&&(r=r.concat(o))}return!r.length&&e.changes.empty?null:new Nr(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,di)}static selection(e){return new Nr(void 0,di,void 0,void 0,e)}}function Cp(t,e,n,r){let i=e+1>n+20?e-n-1:0,o=t.slice(i,e);return o.push(r),o}function I3(t,e){let n=[],r=!1;return t.iterChangedRanges((i,o)=>n.push(i,o)),e.iterChangedRanges((i,o,s,l)=>{for(let a=0;a<n.length;){let u=n[a++],c=n[a++];l>=u&&s<=c&&(r=!0)}}),r}function L3(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function ER(t,e){return t.length?e.length?t.concat(e):t:e}const di=[],Z3=200;function TR(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Z3));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),Cp(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Nr.selection([e])]}function W3(t){let e=t[t.length-1],n=t.slice();return n[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),n}function Tm(t,e){if(!t.length)return t;let n=t.length,r=di;for(;n;){let i=B3(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let o=t.slice(0,n);return o[n-1]=i,o}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Nr.selection(r)]:di}function B3(t,e,n){let r=ER(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):di,n);if(!t.changes)return Nr.selection(r);let i=t.changes.map(e),o=e.mapDesc(t.changes,!0),s=t.mapped?t.mapped.composeDesc(o):o;return new Nr(i,Ot.mapEffects(t.effects,e),s,t.startSelection.map(o),r)}const X3=/^(input\.type|delete)($|\.)/;class oo{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new oo(this.done,this.undone):this}addChanges(e,n,r,i,o){let s=this.done,l=s[s.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!r||X3.test(r))&&(!l.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(o,I3(l.changes,e.changes))||r=="input.type.compose")?s=Cp(s,s.length-1,i.minDepth,new Nr(e.changes.compose(l.changes),ER(e.effects,l.effects),l.mapped,l.startSelection,di)):s=Cp(s,s.length,i.minDepth,e),new oo(s,di,n,r)}addSelection(e,n,r,i){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:di;return o.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&L3(o[o.length-1],e)?this:new oo(TR(this.done,e),this.undone,n,r)}addMapping(e){return new oo(Tm(this.done,e),Tm(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let o=i[i.length-1];if(r&&o.selectionsAfter.length)return n.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:zv.of({side:e,rest:W3(i)}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let s=i.length==1?di:i.slice(0,i.length-1);return o.mapped&&(s=Tm(s,o.mapped)),n.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:zv.of({side:e,rest:s}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}oo.empty=new oo(di,di);function yf(t,e){return oe.create(t.ranges.map(e),t.mainIndex)}function $s(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function xl({state:t,dispatch:e},n){let r=yf(t.selection,n);return r.eq(t.selection)?!1:(e($s(t,r)),!0)}function Og(t,e){return oe.cursor(e?t.to:t.from)}function $R(t,e){return xl(t,n=>n.empty?t.moveByChar(n,e):Og(n,e))}function Rs(t){return t.textDirectionAt(t.state.selection.main.head)==Sn.LTR}const ax=t=>$R(t,!Rs(t)),ux=t=>$R(t,Rs(t));function RR(t,e){return xl(t,n=>n.empty?t.moveByGroup(n,e):Og(n,e))}const Y3=t=>RR(t,!Rs(t)),U3=t=>RR(t,Rs(t));function QR(t,e){return xl(t,n=>{if(!n.empty)return Og(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const cx=t=>QR(t,!1),fx=t=>QR(t,!0);function AR(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let o of t.state.facet($e.scrollMargins)){let s=o(t);s!=null&&s.top&&(n=Math.max(s==null?void 0:s.top,n)),s!=null&&s.bottom&&(r=Math.max(s==null?void 0:s.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function MR(t,e){let n=AR(t),{state:r}=t,i=yf(r.selection,s=>s.empty?t.moveVertically(s,e,n.height):Og(s,e));if(i.eq(r.selection))return!1;let o;if(n.selfScroll){let s=t.coordsAtPos(r.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,u=l.bottom-n.marginBottom;s&&s.top>a&&s.bottom<u&&(o=$e.scrollIntoView(i.main.head,{y:"start",yMargin:s.top-a}))}return t.dispatch($s(r,i),{effects:o}),!0}const $m=t=>MR(t,!1),Rm=t=>MR(t,!0);function vg(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let o=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;o&&e.head!=r.from+o&&(i=oe.cursor(r.from+o))}return i}const hx=t=>xl(t,e=>vg(t,e,!0)),dx=t=>xl(t,e=>vg(t,e,!1)),F3=t=>xl(t,e=>oe.cursor(t.lineBlockAt(e.head).from,1)),q3=t=>xl(t,e=>oe.cursor(t.lineBlockAt(e.head).to,-1));function z3(t,e,n){let r=!1,i=yf(t.selection,o=>{let s=rs(t,o.head,-1)||rs(t,o.head,1)||o.head>0&&rs(t,o.head-1,1)||o.head<t.doc.length&&rs(t,o.head+1,-1);if(!s||!s.end)return o;r=!0;let l=s.start.from==o.head?s.end.to:s.end.from;return n?oe.range(o.anchor,l):oe.cursor(l)});return r?(e($s(t,i)),!0):!1}const V3=({state:t,dispatch:e})=>z3(t,e,!1);function Qs(t,e){let n=yf(t.state.selection,r=>{let i=e(r);return oe.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return n.eq(t.state.selection)?!1:(t.dispatch($s(t.state,n)),!0)}function DR(t,e){return Qs(t,n=>t.moveByChar(n,e))}const px=t=>DR(t,!Rs(t)),gx=t=>DR(t,Rs(t));function NR(t,e){return Qs(t,n=>t.moveByGroup(n,e))}const G3=t=>NR(t,!Rs(t)),H3=t=>NR(t,Rs(t));function jR(t,e){return Qs(t,n=>t.moveVertically(n,e))}const mx=t=>jR(t,!1),Ox=t=>jR(t,!0);function IR(t,e){return Qs(t,n=>t.moveVertically(n,e,AR(t).height))}const vx=t=>IR(t,!1),yx=t=>IR(t,!0),Sx=t=>Qs(t,e=>vg(t,e,!0)),bx=t=>Qs(t,e=>vg(t,e,!1)),K3=t=>Qs(t,e=>oe.cursor(t.lineBlockAt(e.head).from)),J3=t=>Qs(t,e=>oe.cursor(t.lineBlockAt(e.head).to)),wx=({state:t,dispatch:e})=>(e($s(t,{anchor:0})),!0),kx=({state:t,dispatch:e})=>(e($s(t,{anchor:t.doc.length})),!0),xx=({state:t,dispatch:e})=>(e($s(t,{anchor:t.selection.main.anchor,head:0})),!0),_x=({state:t,dispatch:e})=>(e($s(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),eY=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),tY=({state:t,dispatch:e})=>{let n=Sg(t).map(({from:r,to:i})=>oe.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:oe.create(n),userEvent:"select"})),!0};function yg(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(o=>{let{from:s,to:l}=o;if(s==l){let a=e(o);a<s?(n="delete.backward",a=nd(t,a,!1)):a>s&&(n="delete.forward",a=nd(t,a,!0)),s=Math.min(s,a),l=Math.max(l,a)}else s=nd(t,s,!1),l=nd(t,l,!0);return s==l?{range:o}:{changes:{from:s,to:l},range:oe.cursor(s,s<o.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?$e.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function nd(t,e,n){if(t instanceof $e)for(let r of t.state.facet($e.atomicRanges).map(i=>i(t)))r.between(e,e,(i,o)=>{i<e&&o>e&&(e=n?o:i)});return e}const LR=(t,e)=>yg(t,n=>{let r=n.from,{state:i}=t,o=i.doc.lineAt(r),s,l;if(!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(s=o.text.slice(0,r-o.from))){if(s[s.length-1]==" ")return r-1;let a=Ni(s,i.tabSize),u=a%Xa(i)||Xa(i);for(let c=0;c<u&&s[s.length-1-c]==" ";c++)r--;l=r}else l=mr(o.text,r-o.from,e,e)+o.from,l==r&&o.number!=(e?i.doc.lines:1)&&(l+=e?1:-1);return l}),Qm=t=>LR(t,!1),Px=t=>LR(t,!0),ZR=(t,e)=>yg(t,n=>{let r=n.head,{state:i}=t,o=i.doc.lineAt(r),s=i.charCategorizer(r);for(let l=null;;){if(r==(e?o.to:o.from)){r==n.head&&o.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let a=mr(o.text,r-o.from,e)+o.from,u=o.text.slice(Math.min(r,a)-o.from,Math.max(r,a)-o.from),c=s(u);if(l!=null&&c!=l)break;(u!=" "||r!=n.head)&&(l=c),r=a}return r}),Cx=t=>ZR(t,!1),nY=t=>ZR(t,!0),Ex=t=>yg(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),rY=t=>yg(t,e=>{let n=t.lineBlockAt(e.head).from;return e.head>n?n:Math.max(0,e.head-1)}),iY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Zt.of(["",""])},range:oe.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},oY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,o=t.doc.lineAt(i),s=i==o.from?i-1:mr(o.text,i-o.from,!1)+o.from,l=i==o.to?i+1:mr(o.text,i-o.from,!0)+o.from;return{changes:{from:s,to:l,insert:t.doc.slice(i,l).append(t.doc.slice(s,i))},range:oe.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Sg(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),o=t.doc.lineAt(r.to);if(!r.empty&&r.to==o.from&&(o=t.doc.lineAt(r.to-1)),n>=i.number){let s=e[e.length-1];s.to=o.to,s.ranges.push(r)}else e.push({from:i.from,to:o.to,ranges:[r]});n=o.number+1}return e}function WR(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let o of Sg(t)){if(n?o.to==t.doc.length:o.from==0)continue;let s=t.doc.lineAt(n?o.to+1:o.from-1),l=s.length+1;if(n){r.push({from:o.to,to:s.to},{from:o.from,insert:s.text+t.lineBreak});for(let a of o.ranges)i.push(oe.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{r.push({from:s.from,to:o.from},{from:o.to,insert:t.lineBreak+s.text});for(let a of o.ranges)i.push(oe.range(a.anchor-l,a.head-l))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:oe.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const sY=({state:t,dispatch:e})=>WR(t,e,!1),lY=({state:t,dispatch:e})=>WR(t,e,!0);function BR(t,e,n){if(t.readOnly)return!1;let r=[];for(let i of Sg(t))n?r.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):r.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});return e(t.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const aY=({state:t,dispatch:e})=>BR(t,e,!1),uY=({state:t,dispatch:e})=>BR(t,e,!0),cY=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Sg(e).map(({from:i,to:o})=>(i>0?i--:o<e.doc.length&&o++,{from:i,to:o}))),r=yf(e.selection,i=>t.moveVertically(i,!0)).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function fY(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=_n(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),o;return r&&i&&r.to<=e&&i.from>=e&&(o=r.type.prop(dt.closedBy))&&o.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const Tx=hY(!1);function hY(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:o,to:s}=i,l=e.doc.lineAt(o),a=!t&&o==s&&fY(e,o);t&&(o=s=(s<=l.to?l:e.doc.lineAt(s)).to);let u=new x0(e,{simulateBreak:o,simulateDoubleBreak:!!a}),c=YT(u,o);for(c==null&&(c=Ni(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));s<l.to&&/\s/.test(l.text[s-l.from]);)s++;a?{from:o,to:s}=a:o>l.from&&o<l.from+100&&!/\S/.test(l.text.slice(0,o))&&(o=l.from);let f=["",Sp(e,c)];return a&&f.push(Sp(e,u.lineIndent(l.from,-1))),{changes:{from:o,to:s,insert:Zt.of(f)},range:oe.cursor(o+1+f[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function XR(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let l=t.doc.lineAt(s);l.number>n&&(r.empty||r.to>l.from)&&(e(l,i,r),n=l.number),s=l.to+1}let o=t.changes(i);return{changes:i,range:oe.range(o.mapPos(r.anchor,1),o.mapPos(r.head,1))}})}const $x=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(XR(t,(n,r)=>{r.push({from:n.from,insert:t.facet(ff)})}),{userEvent:"input.indent"})),!0),Rx=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(XR(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let o=Ni(i,t.tabSize),s=0,l=Sp(t,Math.max(0,o-Xa(t)));for(;s<i.length&&s<l.length&&i.charCodeAt(s)==l.charCodeAt(s);)s++;r.push({from:n.from+s,to:n.from+i.length,insert:l.slice(s)})}),{userEvent:"delete.dedent"})),!0);function tn(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)YR(t,arguments[e]);return t}function YR(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var n=0;n<e.length;n++)YR(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}const Qx=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Ua{constructor(e,n,r=0,i=e.length,o,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=o?l=>o(Qx(l)):Qx,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ir(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=o0(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=ui(e);let i=this.normalize(n);for(let o=0,s=r;;o++){let l=i.charCodeAt(o),a=this.match(l,s);if(o==i.length-1){if(a)return this.value=a,this;break}s==r&&o<n.length&&n.charCodeAt(o)==l&&s++}}}match(e,n){let r=null;for(let i=0;i<this.matches.length;i+=2){let o=this.matches[i],s=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[i+1],to:n+1}:(this.matches[i]++,s=!0)),s||(this.matches.splice(i,2),i-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:n,to:n+1}:this.matches.push(1,n)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(Ua.prototype[Symbol.iterator]=function(){return this});const UR={from:-1,to:-1,match:/.*/.exec("")},H0="gm"+(/x/.unicode==null?"":"u");class FR{constructor(e,n,r,i=0,o=e.length){if(this.text=e,this.to=o,this.curLine="",this.done=!1,this.value=UR,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new qR(e,n,r,i,o);this.re=new RegExp(n,H0+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let s=e.lineAt(i);this.curLineStart=s.from,this.matchPos=Ep(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=Ep(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Am=new WeakMap;class Ca{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=Am.get(e);if(!i||i.from>=r||i.to<=n){let l=new Ca(n,e.sliceString(n,r));return Am.set(e,l),l}if(i.from==n&&i.to==r)return i;let{text:o,from:s}=i;return s>n&&(o=e.sliceString(n,s)+o,s=n),i.to<r&&(o+=e.sliceString(i.to,r)),Am.set(e,new Ca(s,o)),new Ca(n,o.slice(n-s,r-s))}}class qR{constructor(e,n,r,i,o){this.text=e,this.to=o,this.done=!1,this.value=UR,this.matchPos=Ep(e,i),this.re=new RegExp(n,H0+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=Ca.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,match:n},this.matchPos=Ep(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ca.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(FR.prototype[Symbol.iterator]=qR.prototype[Symbol.iterator]=function(){return this});function dY(t){try{return new RegExp(t,H0),!0}catch{return!1}}function Ep(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}function Gv(t){let e=String(t.state.doc.lineAt(t.state.selection.main.head).number),n=tn("input",{class:"cm-textfield",name:"line",value:e}),r=tn("form",{class:"cm-gotoLine",onkeydown:o=>{o.keyCode==27?(o.preventDefault(),t.dispatch({effects:Tp.of(!1)}),t.focus()):o.keyCode==13&&(o.preventDefault(),i())},onsubmit:o=>{o.preventDefault(),i()}},tn("label",t.state.phrase("Go to line"),": ",n)," ",tn("button",{class:"cm-button",type:"submit"},t.state.phrase("go")));function i(){let o=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);if(!o)return;let{state:s}=t,l=s.doc.lineAt(s.selection.main.head),[,a,u,c,f]=o,h=c?+c.slice(1):0,d=u?+u:l.number;if(u&&f){let O=d/100;a&&(O=O*(a=="-"?-1:1)+l.number/s.doc.lines),d=Math.round(s.doc.lines*O)}else u&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=s.doc.line(Math.max(1,Math.min(s.doc.lines,d))),g=oe.cursor(p.from+Math.max(0,Math.min(h,p.length)));t.dispatch({effects:[Tp.of(!1),$e.scrollIntoView(g.from,{y:"center"})],selection:g}),t.focus()}return{dom:r}}const Tp=Ot.define(),Ax=zn.define({create(){return!0},update(t,e){for(let n of e.effects)n.is(Tp)&&(t=n.value);return t},provide:t=>Lc.from(t,e=>e?Gv:null)}),pY=t=>{let e=Ic(t,Gv);if(!e){let n=[Tp.of(!0)];t.state.field(Ax,!1)==null&&n.push(Ot.appendConfig.of([Ax,gY])),t.dispatch({effects:n}),e=Ic(t,Gv)}return e&&e.dom.querySelector("input").select(),!0},gY=$e.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),mY={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},zR=je.define({combine(t){return Li(t,mY,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function OY(t){let e=[wY,bY];return t&&e.push(zR.of(t)),e}const vY=Ue.mark({class:"cm-selectionMatch"}),yY=Ue.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Mx(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=mn.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=mn.Word)}function SY(t,e,n,r){return t(e.sliceDoc(n,n+1))==mn.Word&&t(e.sliceDoc(r-1,r))==mn.Word}const bY=Jt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(zR),{state:n}=t,r=n.selection;if(r.ranges.length>1)return Ue.none;let i=r.main,o,s=null;if(i.empty){if(!e.highlightWordAroundCursor)return Ue.none;let a=n.wordAt(i.head);if(!a)return Ue.none;s=n.charCategorizer(i.head),o=n.sliceDoc(a.from,a.to)}else{let a=i.to-i.from;if(a<e.minSelectionLength||a>200)return Ue.none;if(e.wholeWords){if(o=n.sliceDoc(i.from,i.to),s=n.charCategorizer(i.head),!(Mx(s,n,i.from,i.to)&&SY(s,n,i.from,i.to)))return Ue.none}else if(o=n.sliceDoc(i.from,i.to).trim(),!o)return Ue.none}let l=[];for(let a of t.visibleRanges){let u=new Ua(n.doc,o,a.from,a.to);for(;!u.next().done;){let{from:c,to:f}=u.value;if((!s||Mx(s,n,c,f))&&(i.empty&&c<=i.from&&f>=i.to?l.push(yY.range(c,f)):(c>=i.to||f<=i.from)&&l.push(vY.range(c,f)),l.length>e.maxMatches))return Ue.none}}return Ue.set(l)}},{decorations:t=>t.decorations}),wY=$e.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),kY=({state:t,dispatch:e})=>{let{selection:n}=t,r=oe.create(n.ranges.map(i=>t.wordAt(i.head)||oe.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function xY(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),o=i&&i.from==n.from&&i.to==n.to;for(let s=!1,l=new Ua(t.doc,e,r[r.length-1].to);;)if(l.next(),l.done){if(s)return null;l=new Ua(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),s=!0}else{if(s&&r.some(a=>a.from==l.value.from))continue;if(o){let a=t.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const _Y=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(o=>o.from===o.to))return kY({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(o=>t.sliceDoc(o.from,o.to)!=r))return!1;let i=xY(t,r);return i?(e(t.update({selection:t.selection.addRange(oe.range(i.from,i.to),!1),effects:$e.scrollIntoView(i.to)})),!0):!1},nu=je.define({combine(t){return Li(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new MY(e),scrollToMatch:e=>$e.scrollIntoView(e)})}});class VR{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||dY(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
121
- `:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new TY(this):new CY(this)}getCursor(e,n=0,r){let i=e.doc?e:Mt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Gl(this,i,n,r):Vl(this,i,n,r)}}class GR{constructor(e){this.spec=e}}function Vl(t,e,n,r){return new Ua(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:i=>i.toLowerCase(),t.wholeWord?PY(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function PY(t,e){return(n,r,i,o)=>((o>n||o+i.length<r)&&(o=Math.max(0,n-2),i=t.sliceString(o,Math.min(t.length,r+2))),(e($p(i,n-o))!=mn.Word||e(Rp(i,n-o))!=mn.Word)&&(e(Rp(i,r-o))!=mn.Word||e($p(i,r-o))!=mn.Word))}class CY extends GR{constructor(e){super(e)}nextMatch(e,n,r){let i=Vl(this.spec,e,r,e.doc.length).nextOverlapping();return i.done&&(i=Vl(this.spec,e,0,n).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let o=Math.max(n,i-1e4-this.spec.unquoted.length),s=Vl(this.spec,e,o,i),l=null;for(;!s.nextOverlapping().done;)l=s.value;if(l)return l;if(o==n)return null;i-=1e4}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Vl(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Vl(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}function Gl(t,e,n,r){return new FR(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:t.wholeWord?EY(e.charCategorizer(e.selection.main.head)):void 0},n,r)}function $p(t,e){return t.slice(mr(t,e,!1),e)}function Rp(t,e){return t.slice(e,mr(t,e))}function EY(t){return(e,n,r)=>!r[0].length||(t($p(r.input,r.index))!=mn.Word||t(Rp(r.input,r.index))!=mn.Word)&&(t(Rp(r.input,r.index+r[0].length))!=mn.Word||t($p(r.input,r.index+r[0].length))!=mn.Word)}class TY extends GR{nextMatch(e,n,r){let i=Gl(this.spec,e,r,e.doc.length).next();return i.done&&(i=Gl(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let o=Math.max(n,r-i*1e4),s=Gl(this.spec,e,o,r),l=null;for(;!s.next().done;)l=s.value;if(l&&(o==n||l.from>o+10))return l;if(o==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(n,r)=>r=="$"?"$":r=="&"?e.match[0]:r!="0"&&+r<e.match.length?e.match[r]:n))}matchAll(e,n){let r=Gl(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let o=Gl(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!o.next().done;)i(o.value.from,o.value.to)}}const Fc=Ot.define(),K0=Ot.define(),ps=zn.define({create(t){return new Mm(Hv(t).create(),null)},update(t,e){for(let n of e.effects)n.is(Fc)?t=new Mm(n.value.create(),t.panel):n.is(K0)&&(t=new Mm(t.query,n.value?J0:null));return t},provide:t=>Lc.from(t,e=>e.panel)});class Mm{constructor(e,n){this.query=e,this.panel=n}}const $Y=Ue.mark({class:"cm-searchMatch"}),RY=Ue.mark({class:"cm-searchMatch cm-searchMatch-selected"}),QY=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(ps))}update(t){let e=t.state.field(ps);(e!=t.startState.field(ps)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Ue.none;let{view:n}=this,r=new vs;for(let i=0,o=n.visibleRanges,s=o.length;i<s;i++){let{from:l,to:a}=o[i];for(;i<s-1&&a>o[i+1].from-2*250;)a=o[++i].to;t.highlight(n.state,l,a,(u,c)=>{let f=n.state.selection.ranges.some(h=>h.from==u&&h.to==c);r.add(u,c,f?RY:$Y)})}return r.finish()}},{decorations:t=>t.decorations});function Sf(t){return e=>{let n=e.state.field(ps,!1);return n&&n.query.spec.valid?t(e,n):tQ(e)}}const Dx=Sf((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=oe.single(r.from,r.to),o=t.state.facet(nu);return t.dispatch({selection:i,effects:[e1(t,r),o.scrollToMatch(i.main,t)],userEvent:"select.search"}),eQ(t),!0}),Nx=Sf((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let o=oe.single(i.from,i.to),s=t.state.facet(nu);return t.dispatch({selection:o,effects:[e1(t,i),s.scrollToMatch(o.main,t)],userEvent:"select.search"}),eQ(t),!0}),HR=Sf((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:oe.create(n.map(r=>oe.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),AY=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,o=[],s=0;for(let l=new Ua(t.doc,t.sliceDoc(r,i));!l.next().done;){if(o.length>1e3)return!1;l.value.from==r&&(s=o.length),o.push(oe.range(l.value.from,l.value.to))}return e(t.update({selection:oe.create(o,s),userEvent:"select.search.matches"})),!0},jx=Sf((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let o=e.nextMatch(n,r,r);if(!o)return!1;let s=[],l,a,u=[];if(o.from==r&&o.to==i&&(a=n.toText(e.getReplacement(o)),s.push({from:o.from,to:o.to,insert:a}),o=e.nextMatch(n,o.from,o.to),u.push($e.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),o){let c=s.length==0||s[0].from>=o.to?0:o.to-o.from-a.length;l=oe.single(o.from-c,o.to-c),u.push(e1(t,o)),u.push(n.facet(nu).scrollToMatch(l.main,t))}return t.dispatch({changes:s,selection:l,effects:u,userEvent:"input.replace"}),!0}),KR=Sf((t,{query:e})=>{if(t.state.readOnly)return!1;let n=e.matchAll(t.state,1e9).map(i=>{let{from:o,to:s}=i;return{from:o,to:s,insert:e.getReplacement(i)}});if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:$e.announce.of(r),userEvent:"input.replace.all"}),!0});function J0(t){return t.state.facet(nu).createPanel(t)}function Hv(t,e){var n,r,i,o,s;let l=t.selection.main,a=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!a)return e;let u=t.facet(nu);return new VR({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:u.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:u.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal,regexp:(o=e==null?void 0:e.regexp)!==null&&o!==void 0?o:u.regexp,wholeWord:(s=e==null?void 0:e.wholeWord)!==null&&s!==void 0?s:u.wholeWord})}function JR(t){let e=Ic(t,J0);return e&&e.dom.querySelector("[main-field]")}function eQ(t){let e=JR(t);e&&e==t.root.activeElement&&e.select()}const tQ=t=>{let e=t.state.field(ps,!1);if(e&&e.panel){let n=JR(t);if(n&&n!=t.root.activeElement){let r=Hv(t.state,e.query.spec);r.valid&&t.dispatch({effects:Fc.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[K0.of(!0),e?Fc.of(Hv(t.state,e.query.spec)):Ot.appendConfig.of(NY)]});return!0},nQ=t=>{let e=t.state.field(ps,!1);if(!e||!e.panel)return!1;let n=Ic(t,J0);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:K0.of(!1)}),!0};class MY{constructor(e){this.view=e;let n=this.query=e.state.field(ps).query.spec;this.commit=this.commit.bind(this),this.searchField=tn("input",{value:n.search,placeholder:Wr(e,"Find"),"aria-label":Wr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=tn("input",{value:n.replace,placeholder:Wr(e,"Replace"),"aria-label":Wr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=tn("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=tn("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=tn("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,o,s){return tn("button",{class:"cm-button",name:i,onclick:o,type:"button"},s)}this.dom=tn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Dx(e),[Wr(e,"next")]),r("prev",()=>Nx(e),[Wr(e,"previous")]),r("select",()=>HR(e),[Wr(e,"all")]),tn("label",null,[this.caseField,Wr(e,"match case")]),tn("label",null,[this.reField,Wr(e,"regexp")]),tn("label",null,[this.wordField,Wr(e,"by word")]),...e.state.readOnly?[]:[tn("br"),this.replaceField,r("replace",()=>jx(e),[Wr(e,"replace")]),r("replaceAll",()=>KR(e),[Wr(e,"replace all")])],tn("button",{name:"close",onclick:()=>nQ(e),"aria-label":Wr(e,"close"),type:"button"},["×"])])}commit(){let e=new VR({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Fc.of(e)}))}keydown(e){Rj(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Nx:Dx)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),jx(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(Fc)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(nu).top}}function Wr(t,e){return t.state.phrase(e)}const rd=30,id=/[\s\.,:;?!]/;function e1(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,o=Math.max(r.from,e-rd),s=Math.min(i,n+rd),l=t.state.sliceDoc(o,s);if(o!=r.from){for(let a=0;a<rd;a++)if(!id.test(l[a+1])&&id.test(l[a])){l=l.slice(a);break}}if(s!=i){for(let a=l.length-1;a>l.length-rd;a--)if(!id.test(l[a-1])&&id.test(l[a])){l=l.slice(0,a);break}}return $e.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${r.number}.`)}const DY=$e.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),NY=[ps,Cs.low(QY),DY];class t1{constructor(e,n,r){this.state=e,this.pos=n,this.explicit=r,this.abortListeners=[]}tokenBefore(e){let n=_n(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(iQ(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n){e=="abort"&&this.abortListeners&&this.abortListeners.push(n)}}function Ix(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function jY(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=Ix(e)+Ix(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function rQ(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:jY(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function IY(t,e){return n=>{for(let r=_n(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class Lx{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function gs(t){return t.selection.main.from}function iQ(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const oQ=fo.define();function LY(t,e,n,r){let{main:i}=t.selection,o=n-i.from,s=r-i.from;return Object.assign(Object.assign({},t.changeByRange(l=>l!=i&&n!=r&&t.sliceDoc(l.from+o,l.from+s)!=t.sliceDoc(n,r)?{range:l}:{changes:{from:l.from+o,to:r==i.from?l.to:l.from+s,insert:e},range:oe.cursor(l.from+o+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const Zx=new WeakMap;function ZY(t){if(!Array.isArray(t))return t;let e=Zx.get(t);return e||Zx.set(t,e=rQ(t)),e}const Qp=Ot.define(),qc=Ot.define();class WY{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=ir(e,n),i=ui(r);this.chars.push(r);let o=e.slice(n,n+i),s=o.toUpperCase();this.folded.push(ir(s==o?o.toLowerCase():s,0)),n+=i}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,!0}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return!1;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let m=ir(e,0),y=ui(m),S=y==e.length?0:-100;if(m!=n[0])if(m==r[0])S+=-200;else return!1;return this.ret(S,[0,y])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=n.length,u=0;if(l<0){for(let m=0,y=Math.min(e.length,200);m<y&&u<a;){let S=ir(e,m);(S==n[u]||S==r[u])&&(i[u++]=m),m+=ui(S)}if(u<a)return!1}let c=0,f=0,h=!1,d=0,p=-1,g=-1,O=/[a-z]/.test(e),v=!0;for(let m=0,y=Math.min(e.length,200),S=0;m<y&&f<a;){let k=ir(e,m);l<0&&(c<a&&k==n[c]&&(o[c++]=m),d<a&&(k==n[d]||k==r[d]?(d==0&&(p=m),g=m+1,d++):d=0));let P,C=k<255?k>=48&&k<=57||k>=97&&k<=122?2:k>=65&&k<=90?1:0:(P=o0(k))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!m||C==1&&O||S==0&&C!=0)&&(n[f]==k||r[f]==k&&(h=!0)?s[f++]=m:s.length&&(v=!1)),S=C,m+=ui(k)}return f==a&&s[0]==0&&v?this.result(-100+(h?-200:0),s,e):d==a&&p==0?this.ret(-200-e.length+(g==e.length?0:-100),[0,g]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-e.length,[p,g]):f==a?this.result(-100+(h?-200:0)+-700+(v?0:-1100),s,e):n.length==2?!1:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],o=0;for(let s of n){let l=s+(this.astral?ui(ir(r,s)):1);o&&i[o-1]==s?i[o-1]=l:(i[o++]=s,i[o++]=l)}return this.ret(e-r.length,i)}}const sr=je.define({combine(t){return Li(t,{activateOnTyping:!0,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:BY,compareCompletions:(e,n)=>e.label.localeCompare(n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>Wx(e(r),n(r)),optionClass:(e,n)=>r=>Wx(e(r),n(r)),addToOptions:(e,n)=>e.concat(n)})}});function Wx(t,e){return t?e?t+" "+e:t:e}function BY(t,e,n,r,i,o){let s=t.textDirection==Sn.RTL,l=s,a=!1,u="top",c,f,h=e.left-i.left,d=i.right-e.right,p=r.right-r.left,g=r.bottom-r.top;if(l&&h<Math.min(p,d)?l=!1:!l&&d<Math.min(p,h)&&(l=!0),p<=(l?h:d))c=Math.max(i.top,Math.min(n.top,i.bottom-g))-e.top,f=Math.min(400,l?h:d);else{a=!0,f=Math.min(400,(s?e.right:i.right-e.left)-30);let m=i.bottom-e.bottom;m>=g||m>e.top?c=n.bottom-e.top:(u="bottom",c=e.bottom-n.top)}let O=(e.bottom-e.top)/o.offsetHeight,v=(e.right-e.left)/o.offsetWidth;return{style:`${u}: ${c/O}px; max-width: ${f/v}px`,class:"cm-completionInfo-"+(a?s?"left-narrow":"right-narrow":l?"left":"right")}}function XY(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,o){let s=document.createElement("span");s.className="cm-completionLabel";let l=n.displayLabel||n.label,a=0;for(let u=0;u<o.length;){let c=o[u++],f=o[u++];c>a&&s.appendChild(document.createTextNode(l.slice(a,c)));let h=s.appendChild(document.createElement("span"));h.appendChild(document.createTextNode(l.slice(c,f))),h.className="cm-completionMatchedText",a=f}return a<l.length&&s.appendChild(document.createTextNode(l.slice(a))),s},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function Dm(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class YY{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:o,selected:s}=i.open,l=e.state.facet(sr);this.optionContent=XY(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Dm(o.length,s,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:u}=e.state.field(n).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<u.length){this.applyCompletion(e,u[+f[1]]),a.preventDefault();return}}),this.dom.addEventListener("focusout",a=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(sr).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:qc.of(null)})}),this.showOptions(o,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:o,selected:s,disabled:l}=r.open;(!i.open||i.open.options!=o)&&(this.range=Dm(o.length,s,e.state.facet(sr).maxRenderedOptions),this.showOptions(o,r.id)),this.updateSel(),l!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=Dm(n.options.length,n.selected,this.view.state.facet(sr).maxRenderedOptions),this.showOptions(n.options,e.id)),this.updateSelectedOption(n.selected)){this.destroyInfo();let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s,r)}).catch(s=>Kr(this.view.state,s,"completion info")):this.addInfoPane(o,r)}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:o}=e;r.appendChild(i),this.infoDestroy=o||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&FY(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),o=this.space;if(!o){let s=this.dom.ownerDocument.defaultView||window;o={left:0,top:0,right:s.innerWidth,bottom:s.innerHeight}}return i.top>Math.min(o.bottom,n.bottom)-10||i.bottom<Math.max(o.top,n.top)+10?null:this.view.state.facet(sr).positionInfo(this.view,n,i,r,o,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let o=null;for(let s=r.from;s<r.to;s++){let{completion:l,match:a}=e[s],{section:u}=l;if(u){let h=typeof u=="string"?u:u.name;if(h!=o&&(s>r.from||r.from==0))if(o=h,typeof u!="string"&&u.header)i.appendChild(u.header(u));else{let d=i.appendChild(document.createElement("completion-section"));d.textContent=h}}const c=i.appendChild(document.createElement("li"));c.id=n+"-"+s,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let h of this.optionContent){let d=h(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function UY(t,e){return n=>new YY(n,t,e)}function FY(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function Bx(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function qY(t,e){let n=[],r=null,i=a=>{n.push(a);let{section:u}=a.completion;if(u){r||(r=[]);let c=typeof u=="string"?u:u.name;r.some(f=>f.name==c)||r.push(typeof u=="string"?{name:c}:u)}};for(let a of t)if(a.hasResult()){let u=a.result.getMatch;if(a.result.filter===!1)for(let c of a.result.options)i(new Lx(c,a.source,u?u(c):[],1e9-n.length));else{let c=new WY(e.sliceDoc(a.from,a.to));for(let f of a.result.options)if(c.match(f.label)){let h=f.displayLabel?u?u(f,c.matched):[]:c.matched;i(new Lx(f,a.source,h,c.score+(f.boost||0)))}}}if(r){let a=Object.create(null),u=0,c=(f,h)=>{var d,p;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((p=h.rank)!==null&&p!==void 0?p:1e9)||(f.name<h.name?-1:1)};for(let f of r.sort(c))u-=1e5,a[f.name]=u;for(let f of n){let{section:h}=f.completion;h&&(f.score+=a[typeof h=="string"?h:h.name])}}let o=[],s=null,l=e.facet(sr).compareCompletions;for(let a of n.sort((u,c)=>c.score-u.score||l(u.completion,c.completion))){let u=a.completion;!s||s.label!=u.label||s.detail!=u.detail||s.type!=null&&u.type!=null&&s.type!=u.type||s.apply!=u.apply||s.boost!=u.boost?o.push(a):Bx(a.completion)>Bx(s)&&(o[o.length-1]=a),s=a.completion}return o}class da{constructor(e,n,r,i,o,s){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o,this.disabled=s}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new da(this.options,Xx(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,o){let s=qY(e,n);if(!s.length)return i&&e.some(a=>a.state==1)?new da(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let l=n.facet(sr).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let a=i.options[i.selected].completion;for(let u=0;u<s.length;u++)if(s[u].completion==a){l=u;break}}return new da(s,Xx(r,l),{pos:e.reduce((a,u)=>u.hasResult()?Math.min(a,u.from):a,1e8),create:KY,above:o.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new da(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Ap{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Ap(GY,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(sr),o=(r.override||n.languageDataAt("autocomplete",gs(n)).map(ZY)).map(l=>(this.active.find(u=>u.source==l)||new Mr(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((l,a)=>l==this.active[a])&&(o=this.active);let s=this.open;s&&e.docChanged&&(s=s.map(e.changes)),e.selection||o.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!zY(o,this.active)?s=da.build(o,n,this.id,s,r):s&&s.disabled&&!o.some(l=>l.state==1)&&(s=null),!s&&o.every(l=>l.state!=1)&&o.some(l=>l.hasResult())&&(o=o.map(l=>l.hasResult()?new Mr(l.source,0):l));for(let l of e.effects)l.is(lQ)&&(s=s&&s.setSelected(l.value,this.id));return o==this.active&&s==this.open?this:new Ap(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:VY}}function zY(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult;)n++;for(;r<e.length&&!e[r].hasResult;)r++;let i=n==t.length,o=r==e.length;if(i||o)return i==o;if(t[n++].result!=e[r++].result)return!1}}const VY={"aria-autocomplete":"list"};function Xx(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const GY=[];function Kv(t){return t.isUserEvent("input.type")?"input":t.isUserEvent("delete.backward")?"delete":null}class Mr{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=Kv(e),i=this;r?i=i.handleUserEvent(e,r,n):e.docChanged?i=i.handleChange(e):e.selection&&i.state!=0&&(i=new Mr(i.source,0));for(let o of e.effects)if(o.is(Qp))i=new Mr(i.source,1,o.value?gs(e.state):-1);else if(o.is(qc))i=new Mr(i.source,0);else if(o.is(sQ))for(let s of o.value)s.source==i.source&&(i=s);return i}handleUserEvent(e,n,r){return n=="delete"||!r.activateOnTyping?this.map(e.changes):new Mr(this.source,1)}handleChange(e){return e.changes.touchesRange(gs(e.startState))?new Mr(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Mr(this.source,this.state,e.mapPos(this.explicitPos))}}class Ea extends Mr{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}handleUserEvent(e,n,r){var i;let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),l=gs(e.state);if((this.explicitPos<0?l<=o:l<this.from)||l>s||n=="delete"&&gs(e.startState)==this.from)return new Mr(this.source,n=="input"&&r.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),u;return HY(this.result.validFor,e.state,o,s)?new Ea(this.source,a,this.result,o,s):this.result.update&&(u=this.result.update(this.result,o,s,new t1(e.state,l,a>=0)))?new Ea(this.source,a,u,u.from,(i=u.to)!==null&&i!==void 0?i:gs(e.state)):new Mr(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Mr(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Ea(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function HY(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):iQ(t,!0).test(i)}const sQ=Ot.define({map(t,e){return t.map(n=>n.map(e))}}),lQ=Ot.define(),qr=zn.define({create(){return Ap.start()},update(t,e){return t.update(e)},provide:t=>[O0.from(t,e=>e.tooltip),$e.contentAttributes.from(t,e=>e.attrs)]});function aQ(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(qr).active.find(i=>i.source==e.source);return r instanceof Ea?(typeof n=="string"?t.dispatch(Object.assign(Object.assign({},LY(t.state,n,r.from,r.to)),{annotations:oQ.of(e.completion)})):n(t,e.completion,r.from,r.to),!0):!1}const KY=UY(qr,aQ);function is(t,e="option"){return n=>{let r=n.state.field(qr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(sr).interactionDelay)return!1;let i=1,o;e=="page"&&(o=QT(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:s}=r.open.options,l=r.open.selected>-1?r.open.selected+i*(t?1:-1):t?0:s-1;return l<0?l=e=="page"?0:s-1:l>=s&&(l=e=="page"?s-1:0),n.dispatch({effects:lQ.of(l)}),!0}}const Jv=t=>{let e=t.state.field(qr,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(sr).interactionDelay?!1:aQ(t,e.open.options[e.open.selected])},uQ=t=>t.state.field(qr,!1)?(t.dispatch({effects:Qp.of(!0)}),!0):!1,cQ=t=>{let e=t.state.field(qr,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:qc.of(null)}),!0)};class JY{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const eU=50,tU=1e3,nU=Jt.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(qr).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(qr);if(!t.selectionSet&&!t.docChanged&&t.startState.field(qr)==e)return;let n=t.transactions.some(i=>(i.selection||i.docChanged)&&!Kv(i));for(let i=0;i<this.running.length;i++){let o=this.running[i];if(n||o.updates.length+t.transactions.length>eU&&Date.now()-o.time>tU){for(let s of o.context.abortListeners)try{s()}catch(l){Kr(this.view.state,l)}o.context.abortListeners=null,this.running.splice(i--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(i=>i.effects.some(o=>o.is(Qp)))&&(this.pendingStart=!0);let r=this.pendingStart?50:t.state.facet(sr).activateOnTypingDelay;if(this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(o=>o.active.source==i.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let i of t.transactions)Kv(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(qr);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=gs(e),r=new t1(e,n,t.explicitPos==n),i=new JY(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:qc.of(null)}),Kr(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(sr).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(sr);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let s=new Ea(i.active.source,i.active.explicitPos,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:gs(i.updates.length?i.updates[0].startState:this.view.state));for(let l of i.updates)s=s.update(l,n);if(s.hasResult()){e.push(s);continue}}let o=this.view.state.field(qr).active.find(s=>s.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new Mr(i.active.source,0);for(let l of i.updates)s=s.update(l,n);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:sQ.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(qr,!1);if(e&&e.tooltip&&this.view.state.facet(sr).closeOnBlur){let n=e.open&&QT(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qc.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Qp.of(!1)}),20),this.composing=0}}}),fQ=$e.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class rU{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class n1{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,Un.TrackDel),r=e.mapPos(this.to,1,Un.TrackDel);return n==null||r==null?null:new n1(this.field,n,r)}}class r1{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let a of this.lines){if(r.length){let u=s,c=/^\t*/.exec(a)[0].length;for(let f=0;f<c;f++)u+=e.facet(ff);i.push(n+u.length-c),a=u+a.slice(c)}r.push(a),n+=a.length+1}let l=this.fieldPositions.map(a=>new n1(a.field,i[a.line]+a.from,i[a.line]+a.to));return{text:r,ranges:l}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let l=o[1]?+o[1]:null,a=o[2]||o[3]||"",u=-1;for(let c=0;c<n.length;c++)(l!=null?n[c].seq==l:a&&n[c].name==a)&&(u=c);if(u<0){let c=0;for(;c<n.length&&(l==null||n[c].seq!=null&&n[c].seq<l);)c++;n.splice(c,0,{seq:l,name:a}),u=c;for(let f of i)f.field>=u&&f.field++}i.push(new rU(u,r.length,o.index,o.index+a.length)),s=s.slice(0,o.index)+a+s.slice(o.index+o[0].length)}for(let l;l=/\\([{}])/.exec(s);){s=s.slice(0,l.index)+l[1]+s.slice(l.index+l[0].length);for(let a of i)a.line==r.length&&a.from>l.index&&(a.from--,a.to--)}r.push(s)}return new r1(r,i)}}let iU=Ue.widget({widget:new class extends yi{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),oU=Ue.mark({class:"cm-snippetField"});class ru{constructor(e,n){this.ranges=e,this.active=n,this.deco=Ue.set(e.map(r=>(r.from==r.to?iU:oU).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new ru(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const bf=Ot.define({map(t,e){return t&&t.map(e)}}),sU=Ot.define(),zc=zn.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(bf))return n.value;if(n.is(sU)&&t)return new ru(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>$e.decorations.from(t,e=>e?e.deco:Ue.none)});function i1(t,e){return oe.create(t.filter(n=>n.field==e).map(n=>oe.range(n.from,n.to)))}function lU(t){let e=r1.parse(t);return(n,r,i,o)=>{let{text:s,ranges:l}=e.instantiate(n.state,i),a={changes:{from:i,to:o,insert:Zt.of(s)},scrollIntoView:!0,annotations:r?[oQ.of(r),Nn.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=i1(l,0)),l.some(u=>u.field>0)){let u=new ru(l,0),c=a.effects=[bf.of(u)];n.state.field(zc,!1)===void 0&&c.push(Ot.appendConfig.of([zc,hU,dU,fQ]))}n.dispatch(n.state.update(a))}}function hQ(t){return({state:e,dispatch:n})=>{let r=e.field(zc,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:i1(r.ranges,i),effects:bf.of(o?null:new ru(r.ranges,i)),scrollIntoView:!0})),!0}}const aU=({state:t,dispatch:e})=>t.field(zc,!1)?(e(t.update({effects:bf.of(null)})),!0):!1,uU=hQ(1),cU=hQ(-1),fU=[{key:"Tab",run:uU,shift:cU},{key:"Escape",run:aU}],Yx=je.define({combine(t){return t.length?t[0]:fU}}),hU=Cs.highest(af.compute([Yx],t=>t.facet(Yx)));function Qr(t,e){return Object.assign(Object.assign({},e),{apply:lU(t)})}const dU=$e.domEventHandlers({mousedown(t,e){let n=e.state.field(zc,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:i1(n.ranges,i.field),effects:bf.of(n.ranges.some(o=>o.field>i.field)?new ru(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Vc={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},rl=Ot.define({map(t,e){let n=e.mapPos(t,-1,Un.TrackAfter);return n??void 0}}),o1=new class extends pl{};o1.startSide=1;o1.endSide=-1;const dQ=zn.define({create(){return Dt.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(rl)&&(t=t.update({add:[o1.range(n.value,n.value+1)]}));return t}});function pU(){return[mU,dQ]}const Nm="()[]{}<>";function pQ(t){for(let e=0;e<Nm.length;e+=2)if(Nm.charCodeAt(e)==t)return Nm.charAt(e+1);return o0(t<128?t:t+1)}function gQ(t,e){return t.languageDataAt("closeBrackets",e)[0]||Vc}const gU=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),mU=$e.inputHandler.of((t,e,n,r)=>{if((gU?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&ui(ir(r,0))==1||e!=i.from||n!=i.to)return!1;let o=vU(t.state,r);return o?(t.dispatch(o),!0):!1}),OU=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=gQ(t,t.selection.main.head).brackets||Vc.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let l=yU(t.doc,s.head);for(let a of r)if(a==l&&bg(t.doc,s.head)==pQ(ir(a,0)))return{changes:{from:s.head-a.length,to:s.head+a.length},range:oe.cursor(s.head-a.length)}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0,userEvent:"delete.backward"})),!i};function vU(t,e){let n=gQ(t,t.selection.main.head),r=n.brackets||Vc.brackets;for(let i of r){let o=pQ(ir(i,0));if(e==i)return o==i?wU(t,i,r.indexOf(i+i+i)>-1,n):SU(t,i,o,n.before||Vc.before);if(e==o&&mQ(t,t.selection.main.from))return bU(t,i,o)}return null}function mQ(t,e){let n=!1;return t.field(dQ).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function bg(t,e){let n=t.sliceString(e,e+2);return n.slice(0,ui(ir(n,0)))}function yU(t,e){let n=t.sliceString(e-2,e);return ui(ir(n,0))==n.length?n:n.slice(1)}function SU(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:rl.of(s.to+e.length),range:oe.range(s.anchor+e.length,s.head+e.length)};let l=bg(t.doc,s.head);return!l||/\s/.test(l)||r.indexOf(l)>-1?{changes:{insert:e+n,from:s.head},effects:rl.of(s.head+e.length),range:oe.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function bU(t,e,n){let r=null,i=t.changeByRange(o=>o.empty&&bg(t.doc,o.head)==n?{changes:{from:o.head,to:o.head+n.length,insert:n},range:oe.cursor(o.head+n.length)}:r={range:o});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function wU(t,e,n,r){let i=r.stringPrefixes||Vc.stringPrefixes,o=null,s=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:rl.of(l.to+e.length),range:oe.range(l.anchor+e.length,l.head+e.length)};let a=l.head,u=bg(t.doc,a),c;if(u==e){if(Ux(t,a))return{changes:{insert:e+e,from:a},effects:rl.of(a+e.length),range:oe.cursor(a+e.length)};if(mQ(t,a)){let h=n&&t.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+h.length,insert:h},range:oe.cursor(a+h.length)}}}else{if(n&&t.sliceDoc(a-2*e.length,a)==e+e&&(c=Fx(t,a-2*e.length,i))>-1&&Ux(t,c))return{changes:{insert:e+e+e+e,from:a},effects:rl.of(a+e.length),range:oe.cursor(a+e.length)};if(t.charCategorizer(a)(u)!=mn.Word&&Fx(t,a,i)>-1&&!kU(t,a,e,i))return{changes:{insert:e+e,from:a},effects:rl.of(a+e.length),range:oe.cursor(a+e.length)}}return{range:o=l}});return o?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ux(t,e){let n=_n(t).resolveInner(e+1);return n.parent&&n.from==e}function kU(t,e,n,r){let i=_n(t).resolveInner(e,-1),o=r.reduce((s,l)=>Math.max(s,l.length),0);for(let s=0;s<5;s++){let l=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),a=l.indexOf(n);if(!a||a>-1&&r.indexOf(l.slice(0,a))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>n.length+a;){if(t.sliceDoc(c.to-n.length,c.to)==n)return!1;c=c.firstChild}return!0}let u=i.to==e&&i.parent;if(!u)break;i=u}return!1}function Fx(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=mn.Word)return e;for(let i of n){let o=e-i.length;if(t.sliceDoc(o,e)==i&&r(t.sliceDoc(o-1,o))!=mn.Word)return o}return-1}function OQ(t={}){return[qr,sr.of(t),nU,_U,fQ]}const xU=[{key:"Ctrl-Space",run:uQ},{key:"Escape",run:cQ},{key:"ArrowDown",run:is(!0)},{key:"ArrowUp",run:is(!1)},{key:"PageDown",run:is(!0,"page")},{key:"PageUp",run:is(!1,"page")},{key:"Enter",run:Jv}],_U=Cs.highest(af.computeN([sr],t=>t.facet(sr).defaultKeymap?[xU]:[]));class PU{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class Vs{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=e,o=r.facet(il).markerFilter;o&&(i=o(i));let s=Ue.set(i.map(l=>l.from==l.to||l.from==l.to-1&&r.doc.lineAt(l.from).to==l.from?Ue.widget({widget:new NU(l),diagnostic:l}).range(l.from):Ue.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l}).range(l.from,l.to)),!0);return new Vs(s,n,Fa(s))}}function Fa(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,o,{spec:s})=>{if(!(e&&s.diagnostic!=e))return r=new PU(i,o,s.diagnostic),!1}),r}function CU(t,e){let n=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(r=>r.is(s1))||t.changes.touchesRange(n.from,n.to))}function vQ(t,e){return t.field(Gr,!1)?e:e.concat(Ot.appendConfig.of(wQ))}function EU(t,e){return{effects:vQ(t,[s1.of(e)])}}const s1=Ot.define(),l1=Ot.define(),yQ=Ot.define(),Gr=zn.define({create(){return new Vs(Ue.none,null,null)},update(t,e){if(e.docChanged){let n=t.diagnostics.map(e.changes),r=null;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);r=Fa(n,t.selected.diagnostic,i)||Fa(n,null,i)}t=new Vs(n,t.panel,r)}for(let n of e.effects)n.is(s1)?t=Vs.init(n.value,t.panel,e.state):n.is(l1)?t=new Vs(t.diagnostics,n.value?wg.open:null,t.selected):n.is(yQ)&&(t=new Vs(t.diagnostics,t.panel,n.value));return t},provide:t=>[Lc.from(t,e=>e.panel),$e.decorations.from(t,e=>e.diagnostics)]}),TU=Ue.mark({class:"cm-lintRange cm-lintRange-active"});function $U(t,e,n){let{diagnostics:r}=t.state.field(Gr),i=[],o=2e8,s=0;r.between(e-(n<0?1:0),e+(n>0?1:0),(a,u,{spec:c})=>{e>=a&&e<=u&&(a==u||(e>a||n>0)&&(e<u||n<0))&&(i.push(c.diagnostic),o=Math.min(a,o),s=Math.max(u,s))});let l=t.state.facet(il).tooltipFilter;return l&&(i=l(i)),i.length?{pos:o,end:s,above:t.state.doc.lineAt(o).to<s,create(){return{dom:RU(t,i)}}}:null}function RU(t,e){return tn("ul",{class:"cm-tooltip-lint"},e.map(n=>bQ(t,n,!1)))}const QU=t=>{let e=t.state.field(Gr,!1);(!e||!e.panel)&&t.dispatch({effects:vQ(t.state,[l1.of(!0)])});let n=Ic(t,wg.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},qx=t=>{let e=t.state.field(Gr,!1);return!e||!e.panel?!1:(t.dispatch({effects:l1.of(!1)}),!0)},AU=t=>{let e=t.state.field(Gr,!1);if(!e)return!1;let n=t.state.selection.main,r=e.diagnostics.iter(n.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},MU=Jt.fromClass(class{constructor(t){this.view=t,this.timeout=-1,this.set=!0;let{delay:e}=t.state.facet(il);this.lintTime=Date.now()+e,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,e)}run(){let t=Date.now();if(t<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-t);else{this.set=!1;let{state:e}=this.view,{sources:n}=e.facet(il);Promise.all(n.map(r=>Promise.resolve(r(this.view)))).then(r=>{let i=r.reduce((o,s)=>o.concat(s));this.view.state.doc==e.doc&&this.view.dispatch(EU(this.view.state,i))},r=>{Kr(this.view.state,r)})}}update(t){let e=t.state.facet(il);(t.docChanged||e!=t.startState.facet(il)||e.needsRefresh&&e.needsRefresh(t))&&(this.lintTime=Date.now()+e.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,e.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),il=je.define({combine(t){return Object.assign({sources:t.map(e=>e.source)},Li(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n}))}});function DU(t,e={}){return[il.of({source:t,config:e}),MU,wQ]}function SQ(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!e.some(o=>o.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function bQ(t,e,n){var r;let i=n?SQ(e.actions):[];return tn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},tn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(r=e.actions)===null||r===void 0?void 0:r.map((o,s)=>{let l=!1,a=h=>{if(h.preventDefault(),l)return;l=!0;let d=Fa(t.state.field(Gr).diagnostics,e);d&&o.apply(t,d.from,d.to)},{name:u}=o,c=i[s]?u.indexOf(i[s]):-1,f=c<0?u:[u.slice(0,c),tn("u",u.slice(c,c+1)),u.slice(c+1)];return tn("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${u}${c<0?"":` (access key "${i[s]})"`}.`},f)}),e.source&&tn("div",{class:"cm-diagnosticSource"},e.source))}class NU extends yi{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return tn("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class zx{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=bQ(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class wg{constructor(e){this.view=e,this.items=[];let n=i=>{if(i.keyCode==27)qx(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:o}=this.items[this.selectedIndex],s=SQ(o.actions);for(let l=0;l<s.length;l++)if(s[l].toUpperCase().charCodeAt(0)==i.keyCode){let a=Fa(this.view.state.field(Gr).diagnostics,o);a&&o.actions[l].apply(e,a.from,a.to)}}else return;i.preventDefault()},r=i=>{for(let o=0;o<this.items.length;o++)this.items[o].dom.contains(i.target)&&this.moveSelection(o)};this.list=tn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=tn("div",{class:"cm-panel-lint"},this.list,tn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>qx(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Gr).selected;if(!e)return-1;for(let n=0;n<this.items.length;n++)if(this.items[n].diagnostic==e.diagnostic)return n;return-1}update(){let{diagnostics:e,selected:n}=this.view.state.field(Gr),r=0,i=!1,o=null;for(e.between(0,this.view.state.doc.length,(s,l,{spec:a})=>{let u=-1,c;for(let f=r;f<this.items.length;f++)if(this.items[f].diagnostic==a.diagnostic){u=f;break}u<0?(c=new zx(this.view,a.diagnostic),this.items.splice(r,0,c),i=!0):(c=this.items[u],u>r&&(this.items.splice(r,u-r),i=!0)),n&&c.diagnostic==n.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),o=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),r++});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new zx(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),o?(this.list.setAttribute("aria-activedescendant",o.id),this.view.requestMeasure({key:this,read:()=>({sel:o.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:l})=>{let a=l.height/this.list.offsetHeight;s.top<l.top?this.list.scrollTop-=(l.top-s.top)/a:s.bottom>l.bottom&&(this.list.scrollTop+=(s.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(Gr),r=Fa(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:yQ.of(r)})}static open(e){return new wg(e)}}function jU(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function od(t){return jU(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const IU=$e.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:od("#d11")},".cm-lintRange-warning":{backgroundImage:od("orange")},".cm-lintRange-info":{backgroundImage:od("#999")},".cm-lintRange-hint":{backgroundImage:od("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),wQ=[Gr,$e.decorations.compute([Gr],t=>{let{selected:e,panel:n}=t.field(Gr);return!e||!n||e.from==e.to?Ue.none:Ue.set([TU.range(e.from,e.to)])}),OI($U,{hideOn:CU}),IU];var Vx={};class Mp{constructor(e,n,r,i,o,s,l,a,u,c=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=o,this.score=s,this.buffer=l,this.bufferBase=a,this.curContext=u,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((e,n)=>n%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,n,r=0){let i=e.parser.context;return new Mp(e,[],n,r,r,0,[],0,i?new Gx(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:o}=this.p,s=o.dynamicPrecedence(i);if(s&&(this.score+=s),r==0){this.pushState(o.getGoto(this.state,i,!0),this.reducePos),i<o.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),a=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-a;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[i])===null||n===void 0)&&n.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=u));let c=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-c;if(i<o.minRepeatTerm||e&131072){let h=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,a,h,f+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=o.getGoto(h,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,a)}storeNode(e,n,r,i=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let s=this,l=this.buffer.length;if(l==0&&s.parent&&(l=s.bufferBase-s.parent.bufferBase,s=s.parent),l>0&&s.buffer[l-4]==0&&s.buffer[l-1]>-1){if(n==r)return;if(s.buffer[l-2]>=n){s.buffer[l-2]=r;return}}}if(!o||this.pos==r)this.buffer.push(e,n,r,i);else{let s=this.buffer.length;if(s>0&&this.buffer[s-4]!=0)for(;s>0&&this.buffer[s-2]>r;)this.buffer[s]=this.buffer[s-4],this.buffer[s+1]=this.buffer[s-3],this.buffer[s+2]=this.buffer[s-2],this.buffer[s+3]=this.buffer[s-1],s-=4,i>4&&(i-=4);this.buffer[s]=e,this.buffer[s+1]=n,this.buffer[s+2]=r,this.buffer[s+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let o=e,{parser:s}=this.p;(i>this.pos||n<=s.maxNode)&&(this.pos=i,s.stateFlag(o,1)||(this.reducePos=i)),this.pushState(o,r),this.shiftContext(n,r),n<=s.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(;n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new Mp(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new LU(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let o=0,s;o<n.length;o+=2)(s=n[o+1])!=this.state&&this.p.parser.hasAction(s,e)&&i.push(n[o],s);if(this.stack.length<120)for(let o=0;i.length<8&&o<n.length;o+=2){let s=n[o+1];i.some((l,a)=>a&1&&l==s)||i.push(n[o],s)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let o=n[i+1];if(o==this.state)continue;let s=this.split();s.pushState(o,this.pos),s.storeNode(0,s.pos,s.pos,4,!0),s.shiftContext(n[i],this.pos),s.reducePos=this.pos,s.score-=200,r.push(s)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,o=this.stack.length-r*3;if(o<0||e.getGoto(this.stack[o],i,!1)<0){let s=this.findForcedReduction();if(s==null)return!1;n=s}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(n),!0}findForcedReduction(){let{parser:e}=this.p,n=[],r=(i,o)=>{if(!n.includes(i))return n.push(i),e.allActions(i,s=>{if(!(s&393216))if(s&65536){let l=(s>>19)-o;if(l>1){let a=s&65535,u=this.stack.length-l*3;if(u>=0&&e.getGoto(this.stack[u],a,!1)>=0)return l<<19|65536|a}}else{let l=r(s,o+1);if(l!=null)return l}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new Gx(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Gx{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class LU{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Dp{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Dp(e,n,n-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Dp(this.stack,this.pos,this.index)}}function Vu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let o=0;for(;;){let s=t.charCodeAt(r++),l=!1;if(s==126){o=65535;break}s>=92&&s--,s>=34&&s--;let a=s-32;if(a>=46&&(a-=46,l=!0),o+=a,l)break;o*=46}n?n[i++]=o:n=new e(o)}return n}class Nd{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Hx=new Nd;class ZU{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Hx,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,o=this.pos+e;for(;o<r.from;){if(!i)return null;let s=this.ranges[--i];o-=r.from-s.to,r=s}for(;n<0?o>r.to:o>=r.to;){if(i==this.ranges.length-1)return null;let s=this.ranges[++i];o+=s.from-r.to,r=s}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let n of this.ranges)if(n.to>e)return Math.max(e,n.from);return this.end}peek(e){let n=this.chunkOff+e,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(r=o,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let s=this.rangeIndex,l=this.range;for(;l.to<=r;)l=this.ranges[++s];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:n}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=n,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),n=this.pos+e.length;this.chunk=n>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,n){if(n?(this.token=n,n.start=e,n.lookAhead=e+1,n.value=n.extended=-1):this.token=Hx,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class Ta{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;kQ(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}Ta.prototype.contextual=Ta.prototype.fallback=Ta.prototype.extend=!1;class Np{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Vu(e):e}token(e,n){let r=e.pos,i=0;for(;;){let o=e.next<0,s=e.resolveOffset(1,1);if(kQ(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(o||i++,s==null)break;e.reset(s,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}Np.prototype.contextual=Ta.prototype.fallback=Ta.prototype.extend=!1;class ho{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function kQ(t,e,n,r,i,o){let s=0,l=1<<r,{dialect:a}=n.p.parser;e:for(;l&t[s];){let u=t[s+1];for(let d=s+3;d<u;d+=2)if((t[d+1]&l)>0){let p=t[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||WU(p,e.token.value,i,o))){e.acceptToken(p);break}}let c=e.next,f=0,h=t[s+2];if(e.next<0&&h>f&&t[u+h*3-3]==65535&&t[u+h*3-3]==65535){s=t[u+h*3-1];continue e}for(;f<h;){let d=f+h>>1,p=u+d+(d<<1),g=t[p],O=t[p+1]||65536;if(c<g)h=d;else if(c>=O)f=d+1;else{s=t[p+2],e.advance();continue e}}break}}function Kx(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function WU(t,e,n,r){let i=Kx(n,r,e);return i<0||Kx(n,r,t)<i}const Br=typeof process<"u"&&Vx&&/\bparse\b/.test(Vx.LOG);let jm=null;function Jx(t,e,n){let r=t.cursor(nn.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}let BU=class{constructor(e,n){this.fragments=e,this.nodeSet=n,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Jx(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Jx(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[i],s=this.start[n]+r.positions[i];if(s>e)return this.nextStart=s,null;if(o instanceof qt){if(s==e){if(s<this.safeFrom)return null;let l=s+o.length;if(l<=this.safeTo){let a=o.prop(dt.lookAhead);if(!a||l+a<this.fragment.to)return o}}this.index[n]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}};class XU{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new Nd)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:o}=i,s=i.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let u=0;u<o.length;u++){if(!(1<<u&s))continue;let c=o[u],f=this.tokens[u];if(!(r&&!c.fallback)&&((c.contextual||f.start!=e.pos||f.mask!=s||f.context!=l)&&(this.updateCachedToken(f,c,e),f.mask=s,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let h=n;if(f.extended>-1&&(n=this.addActions(e,f.extended,f.end,n)),n=this.addActions(e,f.value,f.end,n),!c.extend&&(r=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!r&&e.pos==this.stream.end&&(r=new Nd,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Nd,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:o}=r.p;for(let s=0;s<o.specialized.length;s++)if(o.specialized[s]==e.value){let l=o.specializers[s](this.stream.read(e.start,e.end),r);if(l>=0&&r.p.parser.dialect.allows(l>>1)){l&1?e.extended=l>>1:e.value=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let o=0;o<i;o+=3)if(this.actions[o]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:o}=e,{parser:s}=e.p,{data:l}=s;for(let a=0;a<2;a++)for(let u=s.stateSlot(o,a?2:1);;u+=3){if(l[u]==65535)if(l[u+1]==1)u=wo(l,u+2);else{i==0&&l[u+1]==2&&(i=this.putAction(wo(l,u+2),n,r,i));break}l[u]==n&&(i=this.putAction(wo(l,u+1),n,r,i))}return i}}class YU{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new ZU(n,i),this.tokens=new XU(e,this.stream),this.topTerm=e.top[1];let{from:o}=i[0];this.stacks=[Mp.start(this,e.top[0],o)],this.fragments=r.length&&this.stream.end-o>e.bufferLength*4?new BU(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,o;if(this.bigReductionCount>300&&e.length==1){let[s]=e;for(;s.forceReduce()&&s.stack.length&&s.stack[s.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<e.length;s++){let l=e[s];for(;;){if(this.tokens.mainToken=null,l.pos>n)r.push(l);else{if(this.advanceStack(l,r,e))continue;{i||(i=[],o=[]),i.push(l);let a=this.tokens.getMainToken(l);o.push(a.value,a.end)}}break}}if(!r.length){let s=i&&FU(i);if(s)return Br&&console.log("Finish with "+this.stackID(s)),this.stackToTree(s);if(this.parser.strict)throw Br&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let s=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,o,r);if(s)return Br&&console.log("Force-finish "+this.stackID(s)),this.stackToTree(s.forceAll())}if(this.recovering){let s=this.recovering==1?1:this.recovering*3;if(r.length>s)for(r.sort((l,a)=>a.score-l.score);r.length>s;)r.pop();r.some(l=>l.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let s=0;s<r.length-1;s++){let l=r[s];for(let a=s+1;a<r.length;a++){let u=r[a];if(l.sameState(u)||l.buffer.length>500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)r.splice(a--,1);else{r.splice(s--,1);continue e}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let s=1;s<r.length;s++)r[s].pos<this.minStackPos&&(this.minStackPos=r[s].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,n,r){let i=e.pos,{parser:o}=this,s=Br?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,c=u?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?o.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!u||(f.prop(dt.contextHash)||0)==c))return e.useNode(f,h),Br&&console.log(s+this.stackID(e)+` (via reuse of ${o.getName(f.type.id)})`),!0;if(!(f instanceof qt)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof qt&&f.positions[0]==0)f=d;else break}}let l=o.stateSlot(e.state,4);if(l>0)return e.reduce(l),Br&&console.log(s+this.stackID(e)+` (via always-reduce ${o.getName(l&65535)})`),!0;if(e.stack.length>=9e3)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let u=0;u<a.length;){let c=a[u++],f=a[u++],h=a[u++],d=u==a.length||!r,p=d?e:e.split(),g=this.tokens.mainToken;if(p.apply(c,f,g?g.start:p.pos,h),Br&&console.log(s+this.stackID(p)+` (via ${c&65536?`reduce of ${o.getName(c&65535)}`:"shift"} for ${o.getName(f)} @ ${i}${p==e?"":", split"})`),d)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return e_(e,n),!0}}runRecovery(e,n,r){let i=null,o=!1;for(let s=0;s<e.length;s++){let l=e[s],a=n[s<<1],u=n[(s<<1)+1],c=Br?this.stackID(l)+" -> ":"";if(l.deadEnd&&(o||(o=!0,l.restart(),Br&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,r))))continue;let f=l.split(),h=c;for(let d=0;f.forceReduce()&&d<10&&(Br&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));d++)Br&&(h=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))Br&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,r);this.stream.end>l.pos?(u==l.pos&&(u++,a=0),l.recoverByDelete(a,u),Br&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),e_(l,r)):(!i||i.score<l.score)&&(i=l)}return i}stackToTree(e){return e.close(),qt.build({buffer:Dp.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let n=(jm||(jm=new WeakMap)).get(e);return n||jm.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function e_(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class UU{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const Im=t=>t;class xQ{constructor(e){this.start=e.start,this.shift=e.shift||Im,this.reduce=e.reduce||Im,this.reuse=e.reuse||Im,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class vl extends b0{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let n=e.nodeNames.split(" ");this.minRepeatTerm=n.length;for(let l=0;l<e.repeatNodeCount;l++)n.push("");let r=Object.keys(e.topRules).map(l=>e.topRules[l][1]),i=[];for(let l=0;l<n.length;l++)i.push([]);function o(l,a,u){i[l].push([a,a.deserialize(String(u))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=dt[a]);for(let u=1;u<l.length;){let c=l[u++];if(c>=0)o(c,a,l[u++]);else{let f=l[u+-c];for(let h=-c;h>0;h--)o(l[u++],a,f);u++}}}this.nodeSet=new cf(n.map((l,a)=>qn.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:i[a],top:r.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=DT;let s=Vu(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(t_),this.states=Vu(e.states,Uint32Array),this.data=Vu(e.stateData),this.goto=Vu(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Ta(s,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new YU(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let o=i[n+1];;){let s=i[o++],l=s&1,a=i[o++];if(l&&r)return a;for(let u=o+(s>>1);o<u;o++)if(i[o]==e)return a;if(l)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let o=this.stateSlot(e,i?2:1),s;;o+=3){if((s=r[o])==65535)if(r[o+1]==1)s=r[o=wo(r,o+2)];else{if(r[o+1]==2)return wo(r,o+2);break}if(s==n||s==0)return wo(r,o+1)}return 0}stateSlot(e,n){return this.states[e*6+n]}stateFlag(e,n){return(this.stateSlot(e,0)&n)>0}validAction(e,n){return!!this.allActions(e,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let o=this.stateSlot(e,1);i==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=wo(this.data,o+2);else break;i=n(wo(this.data,o+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=wo(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((o,s)=>s&1&&o==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(vl.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(o=>o.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let o=e.specializers.find(l=>l.from==r.external);if(!o)return r;let s=Object.assign(Object.assign({},r),{external:o.to});return n.specializers[i]=t_(s),s})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let n=this.dynamicPrecedences;return n==null?0:n[e]||0}parseDialect(e){let n=Object.keys(this.dialects),r=n.map(()=>!1);if(e)for(let o of e.split(" ")){let s=n.indexOf(o);s>=0&&(r[s]=!0)}let i=null;for(let o=0;o<n.length;o++)if(!r[o])for(let s=this.dialects[n[o]],l;(l=this.data[s++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[l]=1;return new UU(e,r,i)}static deserialize(e){return new vl(e)}}function wo(t,e){return t[e]|t[e+1]<<16}function FU(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function t_(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const qU=304,n_=1,zU=2,VU=305,GU=307,HU=308,KU=3,JU=4,e4=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],_Q=125,t4=59,r_=47,n4=42,r4=43,i4=45,o4=new xQ({start:!1,shift(t,e){return e==KU||e==JU||e==GU?t:e==HU},strict:!1}),s4=new ho((t,e)=>{let{next:n}=t;(n==_Q||n==-1||e.context)&&t.acceptToken(VU)},{contextual:!0,fallback:!0}),l4=new ho((t,e)=>{let{next:n}=t,r;e4.indexOf(n)>-1||n==r_&&((r=t.peek(1))==r_||r==n4)||n!=_Q&&n!=t4&&n!=-1&&!e.context&&t.acceptToken(qU)},{contextual:!0}),a4=new ho((t,e)=>{let{next:n}=t;if((n==r4||n==i4)&&(t.advance(),n==t.next)){t.advance();let r=!e.context&&e.canShift(n_);t.acceptToken(r?n_:zU)}},{contextual:!0}),u4=bl({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case":b.controlKeyword,"in of await yield void typeof delete instanceof":b.operatorKeyword,"let var const using function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger as new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,"LineComment Hashbang":b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),c4={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},f4={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},h4={__proto__:null,"<":139},d4=vl.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ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1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:367,context:o4,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[u4],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$<m#p#q$=c#q#r$>s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr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ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[l4,a4,2,3,4,5,6,7,8,9,10,11,12,13,s4,new Np("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOr~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!P~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(V~~",141,328),new Np("j~RQYZXz{^~^O's~~aP!P!Qd~iO't~~",25,310)],topRules:{Script:[0,5],SingleExpression:[1,268],SingleClassItem:[2,269]},dialects:{jsx:12801,ts:12803},dynamicPrecedences:{67:1,77:1,79:1,164:1,192:1},specialized:[{term:314,get:t=>c4[t]||-1},{term:330,get:t=>f4[t]||-1},{term:68,get:t=>h4[t]||-1}],tokenPrec:12827}),PQ=[Qr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Qr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Qr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Qr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Qr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Qr(`try {
122
- \${}
123
- } catch (\${error}) {
124
- \${}
125
- }`,{label:"try",detail:"/ catch block",type:"keyword"}),Qr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Qr(`if (\${}) {
126
- \${}
127
- } else {
128
- \${}
129
- }`,{label:"if",detail:"/ else block",type:"keyword"}),Qr(`class \${name} {
130
- constructor(\${params}) {
131
- \${}
132
- }
133
- }`,{label:"class",detail:"definition",type:"keyword"}),Qr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Qr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],p4=PQ.concat([Qr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Qr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Qr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),i_=new LT,CQ=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Du(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const g4=["FunctionDeclaration"],m4={FunctionDeclaration:Du("function"),ClassDeclaration:Du("class"),ClassExpression:()=>!0,EnumDeclaration:Du("constant"),TypeAliasDeclaration:Du("type"),NamespaceDeclaration:Du("namespace"),VariableDefinition(t,e){t.matchContext(g4)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function EQ(t,e){let n=i_.get(e);if(n)return n;let r=[],i=!0;function o(s,l){let a=t.sliceString(s.from,s.to);r.push({label:a,type:l})}return e.cursor(nn.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let l=m4[s.name];if(l&&l(s,o)||CQ.has(s.name))return!1}else if(s.to-s.from>8192){for(let l of EQ(t,s.node))r.push(l);return!1}}),i_.set(e,r),r}const o_=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,TQ=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function O4(t){let e=_n(t.state).resolveInner(t.pos,-1);if(TQ.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&o_.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)CQ.has(i.name)&&(r=r.concat(EQ(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:o_}}const co=Ol.define({name:"javascript",parser:d4.configure({props:[Ja.add({IfStatement:xa({except:/^\s*({|else\b)/}),TryStatement:xa({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:s5,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:o5({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":xa({except:/^{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),wl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":P0,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),$Q={test:t=>/^JSX/.test(t.name),facet:w0({commentTokens:{block:{open:"{/*",close:"*/}"}}})},RQ=co.configure({dialect:"ts"},"typescript"),QQ=co.configure({dialect:"jsx",props:[k0.add(t=>t.isTop?[$Q]:void 0)]}),AQ=co.configure({dialect:"jsx ts",props:[k0.add(t=>t.isTop?[$Q]:void 0)]},"typescript");let MQ=t=>({label:t,type:"keyword"});const DQ="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(MQ),v4=DQ.concat(["declare","implements","private","protected","public"].map(MQ));function NQ(t={}){let e=t.jsx?t.typescript?AQ:QQ:t.typescript?RQ:co,n=t.typescript?p4.concat(v4):PQ.concat(DQ);return new Ba(e,[co.data.of({autocomplete:IY(TQ,rQ(n))}),co.data.of({autocomplete:O4}),t.jsx?b4:[]])}function y4(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function s_(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const S4=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),b4=$e.inputHandler.of((t,e,n,r,i)=>{if((S4?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!co.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:s}=o,l=s.changeByRange(a=>{var u;let{head:c}=a,f=_n(s).resolveInner(c-1,-1),h;if(f.name=="JSXStartTag"&&(f=f.parent),!(s.doc.sliceString(c-1,c)!=r||f.name=="JSXAttributeValue"&&f.to>c)){if(r==">"&&f.name=="JSXFragmentTag")return{range:a,changes:{from:c,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let d=f.parent,p=d.parent;if(p&&d.from==c-2&&((h=s_(s.doc,p.firstChild,c))||((u=p.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let g=`${h}>`;return{range:oe.cursor(c+g.length,-1),changes:{from:c,insert:g}}}}else if(r==">"){let d=y4(f);if(d&&!/^\/?>|^<\//.test(s.doc.sliceString(c,c+2))&&(h=s_(s.doc,d,c)))return{range:a,changes:{from:c,insert:`</${h}>`}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([o,s.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),w4=bl({String:b.string,Number:b.number,"True False":b.bool,PropertyName:b.propertyName,Null:b.null,",":b.separator,"[ ]":b.squareBracket,"{ }":b.brace}),k4=vl.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[w4],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),x4=Ol.define({name:"json",parser:k4.configure({props:[Ja.add({Object:xa({except:/^\s*\}/}),Array:xa({except:/^\s*\]/})}),wl.add({"Object Array":P0})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function _4(){return new Ba(x4)}class jp{static create(e,n,r,i,o){let s=i+(i<<8)+e+(n<<4)|0;return new jp(e,n,r,s,o,[],[])}constructor(e,n,r,i,o,s,l){this.type=e,this.value=n,this.from=r,this.hash=i,this.end=o,this.children=s,this.positions=l,this.hashProp=[[dt.contextHash,i]]}addChild(e,n){e.prop(dt.contextHash)!=this.hash&&(e=new qt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(n)}toTree(e,n=this.end){let r=this.children.length-1;return r>=0&&(n=Math.max(n,this.positions[r]+this.children[r].length+this.from)),new qt(e.types[this.type],this.children,this.positions,n-this.from).balance({makeTree:(i,o,s)=>new qt(qn.none,i,o,s,this.hashProp)})}}var xe;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.URL=33]="URL",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel"})(xe||(xe={}));class P4{constructor(e,n){this.start=e,this.content=n,this.marks=[],this.parsers=[]}}class C4{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return hc(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,n=0,r=0){for(let i=n;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let n=0;for(let r=0;n<this.text.length&&r<e;n++)r+=this.text.charCodeAt(n)==9?4-r%4:1;return n}scrub(){if(!this.baseIndent)return this.text;let e="";for(let n=0;n<this.basePos;n++)e+=" ";return e+this.text.slice(this.basePos)}}function l_(t,e,n){if(n.pos==n.text.length||t!=e.block&&n.indent>=e.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(t.type==xe.OrderedList?c1:u1)(n,e,!1);return r>0&&(t.type!=xe.BulletList||a1(n,e,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==t.value}const jQ={[xe.Blockquote](t,e,n){return n.next!=62?!1:(n.markers.push(Yt(xe.QuoteMark,e.lineStart+n.pos,e.lineStart+n.pos+1)),n.moveBase(n.pos+(bi(n.text.charCodeAt(n.pos+1))?2:1)),t.end=e.lineStart+n.text.length,!0)},[xe.ListItem](t,e,n){return n.indent<n.baseIndent+t.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+t.value),!0)},[xe.OrderedList]:l_,[xe.BulletList]:l_,[xe.Document](){return!0}};function bi(t){return t==32||t==9||t==10||t==13}function hc(t,e=0){for(;e<t.length&&bi(t.charCodeAt(e));)e++;return e}function a_(t,e,n){for(;e>n&&bi(t.charCodeAt(e-1));)e--;return e}function IQ(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let n=e;n<t.text.length;n++)if(t.text.charCodeAt(n)==96)return-1}return e}function LQ(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function a1(t,e,n){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let r=1;for(let i=t.pos+1;i<t.text.length;i++){let o=t.text.charCodeAt(i);if(o==t.next)r++;else if(!bi(o))return-1}return n&&t.next==45&&BQ(t)>-1&&t.depth==e.stack.length||r<3?-1:1}function ZQ(t,e){for(let n=t.stack.length-1;n>=0;n--)if(t.stack[n].type==e)return!0;return!1}function u1(t,e,n){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||bi(t.text.charCodeAt(t.pos+1)))&&(!n||ZQ(e,xe.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function c1(t,e,n){let r=t.pos,i=t.next;for(;i>=48&&i<=57;){r++;if(r==t.text.length)return-1;i=t.text.charCodeAt(r)}return r==t.pos||r>t.pos+9||i!=46&&i!=41||r<t.text.length-1&&!bi(t.text.charCodeAt(r+1))||n&&!ZQ(e,xe.OrderedList)&&(t.skipSpace(r+1)==t.text.length||r>t.pos+1||t.next!=49)?-1:r+1-t.pos}function WQ(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let n=e-t.pos;return n>6?-1:n}function BQ(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let n=e;for(;e<t.text.length&&bi(t.text.charCodeAt(e));)e++;return e==t.text.length?n:-1}const ey=/^[ \t]*$/,XQ=/-->/,YQ=/\?>/,ty=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,XQ],[/^\s*<\?/,YQ],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,ey],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,ey]];function UQ(t,e,n){if(t.next!=60)return-1;let r=t.text.slice(t.pos);for(let i=0,o=ty.length-(n?1:0);i<o;i++)if(ty[i][0].test(r))return i;return-1}function u_(t,e){let n=t.countIndent(e,t.pos,t.indent),r=t.countIndent(t.skipSpace(e),e,n);return r>=n+5?n+1:r}function Bs(t,e,n){let r=t.length-1;r>=0&&t[r].to==e&&t[r].type==xe.CodeText?t[r].to=n:t.push(Yt(xe.CodeText,e,n))}const sd={LinkReference:void 0,IndentedCode(t,e){let n=e.baseIndent+4;if(e.indent<n)return!1;let r=e.findColumn(n),i=t.lineStart+r,o=t.lineStart+e.text.length,s=[],l=[];for(Bs(s,i,o);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){Bs(l,t.lineStart-1,t.lineStart);for(let a of e.markers)l.push(a)}else{if(e.indent<n)break;{if(l.length){for(let u of l)u.type==xe.CodeText?Bs(s,u.from,u.to):s.push(u);l=[]}Bs(s,t.lineStart-1,t.lineStart);for(let u of e.markers)s.push(u);o=t.lineStart+e.text.length;let a=t.lineStart+e.findColumn(e.baseIndent+4);a<o&&Bs(s,a,o)}}return l.length&&(l=l.filter(a=>a.type!=xe.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(s,-i).finish(xe.CodeBlock,o-i),i),!0},FencedCode(t,e){let n=IQ(e);if(n<0)return!1;let r=t.lineStart+e.pos,i=e.next,o=n-e.pos,s=e.skipSpace(n),l=a_(e.text,e.text.length,s),a=[Yt(xe.CodeMark,r,r+o)];s<l&&a.push(Yt(xe.CodeInfo,t.lineStart+s,t.lineStart+l));for(let u=!0;t.nextLine()&&e.depth>=t.stack.length;u=!1){let c=e.pos;if(e.indent-e.baseIndent<4)for(;c<e.text.length&&e.text.charCodeAt(c)==i;)c++;if(c-e.pos>=o&&e.skipSpace(c)==e.text.length){for(let f of e.markers)a.push(f);a.push(Yt(xe.CodeMark,t.lineStart+e.pos,t.lineStart+c)),t.nextLine();break}else{u||Bs(a,t.lineStart-1,t.lineStart);for(let d of e.markers)a.push(d);let f=t.lineStart+e.basePos,h=t.lineStart+e.text.length;f<h&&Bs(a,f,h)}}return t.addNode(t.buffer.writeElements(a,-r).finish(xe.FencedCode,t.prevLineEnd()-r),r),!0},Blockquote(t,e){let n=LQ(e);return n<0?!1:(t.startContext(xe.Blockquote,e.pos),t.addNode(xe.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+n),null)},HorizontalRule(t,e){if(a1(e,t,!1)<0)return!1;let n=t.lineStart+e.pos;return t.nextLine(),t.addNode(xe.HorizontalRule,n),!0},BulletList(t,e){let n=u1(e,t,!1);if(n<0)return!1;t.block.type!=xe.BulletList&&t.startContext(xe.BulletList,e.basePos,e.next);let r=u_(e,e.pos+1);return t.startContext(xe.ListItem,e.basePos,r-e.baseIndent),t.addNode(xe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},OrderedList(t,e){let n=c1(e,t,!1);if(n<0)return!1;t.block.type!=xe.OrderedList&&t.startContext(xe.OrderedList,e.basePos,e.text.charCodeAt(e.pos+n-1));let r=u_(e,e.pos+n);return t.startContext(xe.ListItem,e.basePos,r-e.baseIndent),t.addNode(xe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+n),e.moveBaseColumn(r),null},ATXHeading(t,e){let n=WQ(e);if(n<0)return!1;let r=e.pos,i=t.lineStart+r,o=a_(e.text,e.text.length,r),s=o;for(;s>r&&e.text.charCodeAt(s-1)==e.next;)s--;(s==o||s==r||!bi(e.text.charCodeAt(s-1)))&&(s=e.text.length);let l=t.buffer.write(xe.HeaderMark,0,n).writeElements(t.parser.parseInline(e.text.slice(r+n+1,s),i+n+1),-i);s<e.text.length&&l.write(xe.HeaderMark,s-r,o-r);let a=l.finish(xe.ATXHeading1-1+n,e.text.length-r);return t.nextLine(),t.addNode(a,i),!0},HTMLBlock(t,e){let n=UQ(e,t,!1);if(n<0)return!1;let r=t.lineStart+e.pos,i=ty[n][1],o=[],s=i!=ey;for(;!i.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){s=!1;break}for(let u of e.markers)o.push(u)}s&&t.nextLine();let l=i==XQ?xe.CommentBlock:i==YQ?xe.ProcessingInstructionBlock:xe.HTMLBlock,a=t.prevLineEnd();return t.addNode(t.buffer.writeElements(o,-r).finish(l,a-r),r),!0},SetextHeading:void 0};class E4{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,n,r){if(this.stage==-1)return!1;let i=r.content+`
134
- `+n.scrub(),o=this.advance(i);return o>-1&&o<i.length?this.complete(e,r,o):!1}finish(e,n){return(this.stage==2||this.stage==3)&&hc(n.content,this.pos)==n.content.length?this.complete(e,n,n.content.length):!1}complete(e,n,r){return e.addLeafElement(n,Yt(xe.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(eA(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Yt(xe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(KQ(e,hc(e,this.pos),this.start)))return-1}else if(this.stage==2){let n=hc(e,this.pos),r=0;if(n>this.pos){let i=JQ(e,n,this.start);if(i){let o=Lm(e,i.to-this.start);o>0&&(this.nextStage(i),r=o)}}return r||(r=Lm(e,this.pos)),r>0&&r<e.length?r:-1}else return Lm(e,this.pos)}}}function Lm(t,e){for(;e<t.length;e++){let n=t.charCodeAt(e);if(n==10)break;if(!bi(n))return-1}return e}class T4{nextLine(e,n,r){let i=n.depth<e.stack.length?-1:BQ(n),o=n.next;if(i<0)return!1;let s=Yt(xe.HeaderMark,e.lineStart+n.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,Yt(o==61?xe.SetextHeading1:xe.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),s])),!0}finish(){return!1}}const $4={LinkReference(t,e){return e.content.charCodeAt(0)==91?new E4(e):null},SetextHeading(){return new T4}},R4=[(t,e)=>WQ(e)>=0,(t,e)=>IQ(e)>=0,(t,e)=>LQ(e)>=0,(t,e)=>u1(e,t,!0)>=0,(t,e)=>c1(e,t,!0)>=0,(t,e)=>a1(e,t,!0)>=0,(t,e)=>UQ(e,t,!0)>=0],Q4={text:"",end:0};class A4{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.line=new C4,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=jp.create(xe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new j4(r,n):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(;e.depth<this.stack.length;)this.finishContext();for(let r of e.markers)this.addNode(r.type,r.from,r.to);if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let n=new P4(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,n);i&&n.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,n))break e}for(let r of n.parsers)if(r.nextLine(this,e,n))return null;n.content+=`
135
- `+e.scrub();for(let r of e.markers)n.marks.push(r)}return this.finishLeaf(n),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let n=this.fragments.takeNodes(this);return n?(this.absoluteLineStart+=n,this.lineStart=tA(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let n=Q4;if(n.end=e,e>=this.to)n.text="";else if(n.text=this.lineChunkAt(e),n.end+=n.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<n.end;){i++;let o=this.ranges[i].from,s=this.lineChunkAt(o);n.end=o+s.length,n.text=n.text.slice(0,this.ranges[i-1].to-r)+s,r=n.end-n.text.length}}return n}readLine(){let{line:e}=this,{text:n,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(n);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],o=this.parser.skipContextMarkup[i.type];if(!o)throw new Error("Unhandled block context "+xe[i.type]);if(!o(i,this,e))break;e.forward()}}lineChunkAt(e){let n=this.input.chunk(e),r;if(this.input.lineChunks)r=n==`
136
- `?"":n;else{let i=n.indexOf(`
137
- `);r=i<0?n:n.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,n,r=0){this.block=jp.create(e,r,this.lineStart+n,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,n,r=0){this.startContext(this.parser.getNodeType(e),n,r)}addNode(e,n,r){typeof e=="number"&&(e=new qt(this.parser.nodeSet.types[e],qa,qa,(r??this.prevLineEnd())-n)),this.block.addChild(e,n-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,n){this.addNode(this.buffer.writeElements(ry(n.children,e.marks),-n.from).finish(n.type,n.to-n.from),n.from)}finishContext(){let e=this.stack.pop(),n=this.stack[this.stack.length-1];n.addChild(e.toTree(this.parser.nodeSet),e.from-n.from),this.block=n}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?FQ(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let n=ry(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(n,-e.start).finish(xe.Paragraph,e.content.length),e.start)}elt(e,n,r,i){return typeof e=="string"?Yt(this.parser.getNodeType(e),n,r,i):new VQ(e,n)}get buffer(){return new zQ(this.parser.nodeSet)}}function FQ(t,e,n,r,i){let o=t[e].to,s=[],l=[],a=n.from+r;function u(c,f){for(;f?c>=o:c>o;){let h=t[e+1].from-o;r+=h,c+=h,e++,o=t[e].to}}for(let c=n.firstChild;c;c=c.nextSibling){u(c.from+r,!0);let f=c.from+r,h,d=i.get(c.tree);d?h=d:c.to+r>o?(h=FQ(t,e,c,r,i),u(c.to+r,!1)):h=c.toTree(),s.push(h),l.push(f-a)}return u(n.to+r,!1),new qt(n.type,s,l,n.to+r-a,n.tree?n.tree.propValues:void 0)}class kg extends b0{constructor(e,n,r,i,o,s,l,a,u){super(),this.nodeSet=e,this.blockParsers=n,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=o,this.skipContextMarkup=s,this.inlineParsers=l,this.inlineNames=a,this.wrappers=u,this.nodeTypes=Object.create(null);for(let c of e.types)this.nodeTypes[c.name]=c.id}createParse(e,n,r){let i=new A4(this,e,n,r);for(let o of this.wrappers)i=o(i,e,n,r);return i}configure(e){let n=ny(e);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,o=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),l=this.blockNames.slice(),a=this.inlineParsers.slice(),u=this.inlineNames.slice(),c=this.endLeafBlock.slice(),f=this.wrappers;if(Nu(n.defineNodes)){i=Object.assign({},i);let h=r.types.slice(),d;for(let p of n.defineNodes){let{name:g,block:O,composite:v,style:m}=typeof p=="string"?{name:p}:p;if(h.some(k=>k.name==g))continue;v&&(i[h.length]=(k,P,C)=>v(P,C,k.value));let y=h.length,S=v?["Block","BlockContext"]:O?y>=xe.ATXHeading1&&y<=xe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;h.push(qn.define({id:y,name:g,props:S&&[[dt.group,S]]})),m&&(d||(d={}),Array.isArray(m)||m instanceof $i?d[g]=m:Object.assign(d,m))}r=new cf(h),d&&(r=r.extend(bl(d)))}if(Nu(n.props)&&(r=r.extend(...n.props)),Nu(n.remove))for(let h of n.remove){let d=this.blockNames.indexOf(h),p=this.inlineNames.indexOf(h);d>-1&&(o[d]=s[d]=void 0),p>-1&&(a[p]=void 0)}if(Nu(n.parseBlock))for(let h of n.parseBlock){let d=l.indexOf(h.name);if(d>-1)o[d]=h.parse,s[d]=h.leaf;else{let p=h.before?ld(l,h.before):h.after?ld(l,h.after)+1:l.length-1;o.splice(p,0,h.parse),s.splice(p,0,h.leaf),l.splice(p,0,h.name)}h.endLeaf&&c.push(h.endLeaf)}if(Nu(n.parseInline))for(let h of n.parseInline){let d=u.indexOf(h.name);if(d>-1)a[d]=h.parse;else{let p=h.before?ld(u,h.before):h.after?ld(u,h.after)+1:u.length-1;a.splice(p,0,h.parse),u.splice(p,0,h.name)}}return n.wrap&&(f=f.concat(n.wrap)),new kg(r,o,s,l,c,i,a,u,f)}getNodeType(e){let n=this.nodeTypes[e];if(n==null)throw new RangeError(`Unknown node type '${e}'`);return n}parseInline(e,n){let r=new D4(this,e,n);e:for(let i=n;i<r.end;){let o=r.char(i);for(let s of this.inlineParsers)if(s){let l=s(r,o,i);if(l>=0){i=l;continue e}}i++}return r.resolveMarkers(0)}}function Nu(t){return t!=null&&t.length>0}function ny(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=ny(t[0]);if(t.length==1)return e;let n=ny(t.slice(1));if(!n||!e)return e||n;let r=(s,l)=>(s||qa).concat(l||qa),i=e.wrap,o=n.wrap;return{props:r(e.props,n.props),defineNodes:r(e.defineNodes,n.defineNodes),parseBlock:r(e.parseBlock,n.parseBlock),parseInline:r(e.parseInline,n.parseInline),remove:r(e.remove,n.remove),wrap:i?o?(s,l,a,u)=>i(o(s,l,a,u),l,a,u):i:o}}function ld(t,e){let n=t.indexOf(e);if(n<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return n}let qQ=[qn.none];for(let t=1,e;e=xe[t];t++)qQ[t]=qn.define({id:t,name:e,props:t>=xe.Escape?[]:[[dt.group,t in jQ?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const qa=[];class zQ{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,n,r,i=0){return this.content.push(e,n,r,4+i*4),this}writeElements(e,n=0){for(let r of e)r.writeTo(this,n);return this}finish(e,n){return qt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:n})}}let Gc=class{constructor(e,n,r,i=qa){this.type=e,this.from=n,this.to=r,this.children=i}writeTo(e,n){let r=e.content.length;e.writeElements(this.children,n),e.content.push(this.type,this.from+n,this.to+n,e.content.length+4-r)}toTree(e){return new zQ(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class VQ{constructor(e,n){this.tree=e,this.from=n}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return qa}writeTo(e,n){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+n,this.to+n,-1)}toTree(){return this.tree}}function Yt(t,e,n,r){return new Gc(t,e,n,r)}const GQ={resolve:"Emphasis",mark:"EmphasisMark"},HQ={resolve:"Emphasis",mark:"EmphasisMark"},ju={},c_={};class Ri{constructor(e,n,r,i){this.type=e,this.from=n,this.to=r,this.side=i}}const f_="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Hc=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Hc=new RegExp("[\\p{Pc}|\\p{Pd}|\\p{Pe}|\\p{Pf}|\\p{Pi}|\\p{Po}|\\p{Ps}]","u")}catch{}const Zm={Escape(t,e,n){if(e!=92||n==t.end-1)return-1;let r=t.char(n+1);for(let i=0;i<f_.length;i++)if(f_.charCodeAt(i)==r)return t.append(Yt(xe.Escape,n,n+2));return-1},Entity(t,e,n){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(n+1,n+31));return r?t.append(Yt(xe.Entity,n,n+1+r[0].length)):-1},InlineCode(t,e,n){if(e!=96||n&&t.char(n-1)==96)return-1;let r=n+1;for(;r<t.end&&t.char(r)==96;)r++;let i=r-n,o=0;for(;r<t.end;r++)if(t.char(r)==96){if(o++,o==i&&t.char(r+1)!=96)return t.append(Yt(xe.InlineCode,n,r+1,[Yt(xe.CodeMark,n,n+i),Yt(xe.CodeMark,r+1-i,r+1)]))}else o=0;return-1},HTMLTag(t,e,n){if(e!=60||n==t.end-1)return-1;let r=t.slice(n+1,t.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return t.append(Yt(xe.URL,n,n+1+i[0].length));let o=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(o)return t.append(Yt(xe.Comment,n,n+1+o[0].length));let s=/^\?[^]*?\?>/.exec(r);if(s)return t.append(Yt(xe.ProcessingInstruction,n,n+1+s[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return l?t.append(Yt(xe.HTMLTag,n,n+1+l[0].length)):-1},Emphasis(t,e,n){if(e!=95&&e!=42)return-1;let r=n+1;for(;t.char(r)==e;)r++;let i=t.slice(n-1,n),o=t.slice(r,r+1),s=Hc.test(i),l=Hc.test(o),a=/\s|^$/.test(i),u=/\s|^$/.test(o),c=!u&&(!l||a||s),f=!a&&(!s||u||l),h=c&&(e==42||!f||s),d=f&&(e==42||!c||l);return t.append(new Ri(e==95?GQ:HQ,n,r,(h?1:0)|(d?2:0)))},HardBreak(t,e,n){if(e==92&&t.char(n+1)==10)return t.append(Yt(xe.HardBreak,n,n+2));if(e==32){let r=n+1;for(;t.char(r)==32;)r++;if(t.char(r)==10&&r>=n+2)return t.append(Yt(xe.HardBreak,n,r+1))}return-1},Link(t,e,n){return e==91?t.append(new Ri(ju,n,n+1,1)):-1},Image(t,e,n){return e==33&&t.char(n+1)==91?t.append(new Ri(c_,n,n+2,1)):-1},LinkEnd(t,e,n){if(e!=93)return-1;for(let r=t.parts.length-1;r>=0;r--){let i=t.parts[r];if(i instanceof Ri&&(i.type==ju||i.type==c_)){if(!i.side||t.skipSpace(i.to)==n&&!/[(\[]/.test(t.slice(n+1,n+2)))return t.parts[r]=null,-1;let o=t.takeContent(r),s=t.parts[r]=M4(t,o,i.type==ju?xe.Link:xe.Image,i.from,n+1);if(i.type==ju)for(let l=0;l<r;l++){let a=t.parts[l];a instanceof Ri&&a.type==ju&&(a.side=0)}return s.to}}return-1}};function M4(t,e,n,r,i){let{text:o}=t,s=t.char(i),l=i;if(e.unshift(Yt(xe.LinkMark,r,r+(n==xe.Image?2:1))),e.push(Yt(xe.LinkMark,i-1,i)),s==40){let a=t.skipSpace(i+1),u=KQ(o,a-t.offset,t.offset),c;u&&(a=t.skipSpace(u.to),c=JQ(o,a-t.offset,t.offset),c&&(a=t.skipSpace(c.to))),t.char(a)==41&&(e.push(Yt(xe.LinkMark,i,i+1)),l=a+1,u&&e.push(u),c&&e.push(c),e.push(Yt(xe.LinkMark,a,l)))}else if(s==91){let a=eA(o,i-t.offset,t.offset,!1);a&&(e.push(a),l=a.to)}return Yt(n,r,l,e)}function KQ(t,e,n){if(t.charCodeAt(e)==60){for(let i=e+1;i<t.length;i++){let o=t.charCodeAt(i);if(o==62)return Yt(xe.URL,e+n,i+1+n);if(o==60||o==10)return!1}return null}else{let i=0,o=e;for(let s=!1;o<t.length;o++){let l=t.charCodeAt(o);if(bi(l))break;if(s)s=!1;else if(l==40)i++;else if(l==41){if(!i)break;i--}else l==92&&(s=!0)}return o>e?Yt(xe.URL,e+n,o+n):o==t.length?null:!1}}function JQ(t,e,n){let r=t.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let o=e+1,s=!1;o<t.length;o++){let l=t.charCodeAt(o);if(s)s=!1;else{if(l==i)return Yt(xe.LinkTitle,e+n,o+1+n);l==92&&(s=!0)}}return null}function eA(t,e,n,r){for(let i=!1,o=e+1,s=Math.min(t.length,o+999);o<s;o++){let l=t.charCodeAt(o);if(i)i=!1;else{if(l==93)return r?!1:Yt(xe.LinkLabel,e+n,o+1+n);if(r&&!bi(l)&&(r=!1),l==91)return!1;l==92&&(i=!0)}}return null}class D4{constructor(e,n,r){this.parser=e,this.text=n,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,n){return this.text.slice(e-this.offset,n-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,n,r,i,o){return this.append(new Ri(e,n,r,(i?1:0)|(o?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof Ri&&i.type.resolve&&i.side&2))continue;let o=i.type==GQ||i.type==HQ,s=i.to-i.from,l,a=r-1;for(;a>=e;a--){let g=this.parts[a];if(g instanceof Ri&&g.side&1&&g.type==i.type&&!(o&&(i.side&1||g.side&2)&&(g.to-g.from+s)%3==0&&((g.to-g.from)%3||s%3))){l=g;break}}if(!l)continue;let u=i.type.resolve,c=[],f=l.from,h=i.to;if(o){let g=Math.min(2,l.to-l.from,s);f=l.to-g,h=i.from+g,u=g==1?"Emphasis":"StrongEmphasis"}l.type.mark&&c.push(this.elt(l.type.mark,f,l.to));for(let g=a+1;g<r;g++)this.parts[g]instanceof Gc&&c.push(this.parts[g]),this.parts[g]=null;i.type.mark&&c.push(this.elt(i.type.mark,i.from,h));let d=this.elt(u,f,h,c);this.parts[a]=o&&l.from!=f?new Ri(l.type,l.from,f,l.side):null,(this.parts[r]=o&&i.to!=h?new Ri(i.type,h,i.to,i.side):null)?this.parts.splice(r,0,d):this.parts[r]=d}let n=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof Gc&&n.push(i)}return n}findOpeningDelimiter(e){for(let n=this.parts.length-1;n>=0;n--){let r=this.parts[n];if(r instanceof Ri&&r.type==e)return n}return null}takeContent(e){let n=this.resolveMarkers(e);return this.parts.length=e,n}skipSpace(e){return hc(this.text,e-this.offset)+this.offset}elt(e,n,r,i){return typeof e=="string"?Yt(this.parser.getNodeType(e),n,r,i):new VQ(e,n)}}function ry(t,e){if(!e.length)return t;if(!t.length)return e;let n=t.slice(),r=0;for(let i of e){for(;r<n.length&&n[r].to<i.to;)r++;if(r<n.length&&n[r].from<i.from){let o=n[r];o instanceof Gc&&(n[r]=new Gc(o.type,o.from,o.to,ry(o.children,[i])))}else n.splice(r++,0,i)}return n}const N4=[xe.CodeBlock,xe.ListItem,xe.OrderedList,xe.BulletList];class j4{constructor(e,n){this.fragments=e,this.input=n,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,n){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let o=this.fragment.to;for(;o>0&&this.input.read(o-1,o)!=`
138
- `;)o--;this.fragmentEnd=o?o-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=n;if(!r.childAfter(i))return!1}}matches(e){let n=this.cursor.tree;return n&&n.prop(dt.contextHash)==e}takeNodes(e){let n=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),o=e.absoluteLineStart,s=o,l=e.block.children.length,a=s,u=l;for(;;){if(n.to-r>i){if(n.type.isAnonymous&&n.firstChild())continue;break}let c=tA(n.from-r,e.ranges);if(n.to-r<=e.ranges[e.rangeI].to)e.addNode(n.tree,c);else{let f=new qt(e.parser.nodeSet.types[xe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,n.tree),e.addNode(f,c)}if(n.type.is("Block")&&(N4.indexOf(n.type.id)<0?(s=n.to-r,l=e.block.children.length):(s=a,l=u,a=n.to-r,u=e.block.children.length)),!n.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return s-o}}function tA(t,e){let n=t;for(let r=1;r<e.length;r++){let i=e[r-1].to,o=e[r].from;i<t&&(n-=o-i)}return n}const I4=bl({"Blockquote/...":b.quote,HorizontalRule:b.contentSeparator,"ATXHeading1/... SetextHeading1/...":b.heading1,"ATXHeading2/... SetextHeading2/...":b.heading2,"ATXHeading3/...":b.heading3,"ATXHeading4/...":b.heading4,"ATXHeading5/...":b.heading5,"ATXHeading6/...":b.heading6,"Comment CommentBlock":b.comment,Escape:b.escape,Entity:b.character,"Emphasis/...":b.emphasis,"StrongEmphasis/...":b.strong,"Link/... Image/...":b.link,"OrderedList/... BulletList/...":b.list,"BlockQuote/...":b.quote,"InlineCode CodeText":b.monospace,URL:b.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":b.processingInstruction,"CodeInfo LinkLabel":b.labelName,LinkTitle:b.string,Paragraph:b.content}),L4=new kg(new cf(qQ).extend(I4),Object.keys(sd).map(t=>sd[t]),Object.keys(sd).map(t=>$4[t]),Object.keys(sd),R4,jQ,Object.keys(Zm).map(t=>Zm[t]),Object.keys(Zm),[]);function Z4(t,e,n){let r=[];for(let i=t.firstChild,o=e;;i=i.nextSibling){let s=i?i.from:n;if(s>o&&r.push({from:o,to:s}),!i)break;o=i.to}return r}function W4(t){let{codeParser:e,htmlParser:n}=t;return{wrap:ZT((i,o)=>{let s=i.type.id;if(e&&(s==xe.CodeBlock||s==xe.FencedCode)){let l="";if(s==xe.FencedCode){let u=i.node.getChild(xe.CodeInfo);u&&(l=o.read(u.from,u.to))}let a=e(l);if(a)return{parser:a,overlay:u=>u.type.id==xe.CodeText}}else if(n&&(s==xe.HTMLBlock||s==xe.HTMLTag))return{parser:n,overlay:Z4(i.node,i.from,i.to)};return null})}}const B4={resolve:"Strikethrough",mark:"StrikethroughMark"},X4={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":b.strikethrough}},{name:"StrikethroughMark",style:b.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,n){if(e!=126||t.char(n+1)!=126||t.char(n+2)==126)return-1;let r=t.slice(n-1,n),i=t.slice(n+2,n+3),o=/\s|^$/.test(r),s=/\s|^$/.test(i),l=Hc.test(r),a=Hc.test(i);return t.addDelimiter(B4,n,n+2,!s&&(!a||o||l),!o&&(!l||s||a))},after:"Emphasis"}]};function dc(t,e,n=0,r,i=0){let o=0,s=!0,l=-1,a=-1,u=!1,c=()=>{r.push(t.elt("TableCell",i+l,i+a,t.parser.parseInline(e.slice(l,a),i+l)))};for(let f=n;f<e.length;f++){let h=e.charCodeAt(f);h==124&&!u?((!s||l>-1)&&o++,s=!1,r&&(l>-1&&c(),r.push(t.elt("TableDelimiter",f+i,f+i+1))),l=a=-1):(u||h!=32&&h!=9)&&(l<0&&(l=f),a=f+1),u=!u&&h==92}return l>-1&&(o++,r&&c()),o}function h_(t,e){for(let n=e;n<t.length;n++){let r=t.charCodeAt(n);if(r==124)return!0;r==92&&n++}return!1}const nA=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class d_{constructor(){this.rows=null}nextLine(e,n,r){if(this.rows==null){this.rows=!1;let i;if((n.next==45||n.next==58||n.next==124)&&nA.test(i=n.text.slice(n.pos))){let o=[];dc(e,r.content,0,o,r.start)==dc(e,i,n.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,o),e.elt("TableDelimiter",e.lineStart+n.pos,e.lineStart+n.text.length)])}}else if(this.rows){let i=[];dc(e,n.text,n.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+n.pos,e.lineStart+n.text.length,i))}return!1}finish(e,n){return this.rows?(e.addLeafElement(n,e.elt("Table",n.start,n.start+n.content.length,this.rows)),!0):!1}}const Y4={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":b.heading}},"TableRow",{name:"TableCell",style:b.content},{name:"TableDelimiter",style:b.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return h_(e.content,0)?new d_:null},endLeaf(t,e,n){if(n.parsers.some(i=>i instanceof d_)||!h_(e.text,e.basePos))return!1;let r=t.scanLine(t.absoluteLineEnd+1).text;return nA.test(r)&&dc(t,e.text,e.basePos)==dc(t,r,e.basePos)},before:"SetextHeading"}]};class U4{nextLine(){return!1}finish(e,n){return e.addLeafElement(n,e.elt("Task",n.start,n.start+n.content.length,[e.elt("TaskMarker",n.start,n.start+3),...e.parser.parseInline(n.content.slice(3),n.start+3)])),!0}}const F4={defineNodes:[{name:"Task",block:!0,style:b.list},{name:"TaskMarker",style:b.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new U4:null},after:"SetextHeading"}]},p_=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy,g_=/[\w-]+(\.\w+(\.\w+)?)(\/[^\s<]*)?/gy,m_=/[\w.+-]+@[\w-]+\.[\w.-]+/gy,O_=/\/[a-zA-Z\d@.]+/gy;function v_(t,e,n,r){let i=0;for(let o=e;o<n;o++)t[o]==r&&i++;return i}function q4(t,e){g_.lastIndex=e;let n=g_.exec(t);if(!n)return-1;let r=e+n[0].length;for(;;){let i=t[r-1],o;if(/[?!.,:*_~]/.test(i)||i==")"&&v_(t,e,r,")")>v_(t,e,r,"("))r--;else if(i==";"&&(o=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,r))))r=e+o.index;else break}return r}function y_(t,e){m_.lastIndex=e;let n=m_.exec(t);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:e+n[0].length-(r=="."?1:0)}const z4={parseInline:[{name:"Autolink",parse(t,e,n){let r=n-t.offset;p_.lastIndex=r;let i=p_.exec(t.text),o=-1;return!i||(i[1]||i[2]?o=q4(t.text,r+i[0].length):i[3]?o=y_(t.text,r):(o=y_(t.text,r+i[0].length),o>-1&&i[0]=="xmpp:"&&(O_.lastIndex=o,i=O_.exec(t.text),i&&(o=i.index+i[0].length))),o<0)?-1:(t.addElement(t.elt("URL",n,o+t.offset)),o+t.offset)}}]},V4=[Y4,F4,X4,z4];function rA(t,e,n){return(r,i,o)=>{if(i!=t||r.char(o+1)==t)return-1;let s=[r.elt(n,o,o+1)];for(let l=o+1;l<r.end;l++){let a=r.char(l);if(a==t)return r.addElement(r.elt(e,o,l+1,s.concat(r.elt(n,l,l+1))));if(a==92&&s.push(r.elt("Escape",l,l+++2)),bi(a))break}return-1}}const G4={defineNodes:[{name:"Superscript",style:b.special(b.content)},{name:"SuperscriptMark",style:b.processingInstruction}],parseInline:[{name:"Superscript",parse:rA(94,"Superscript","SuperscriptMark")}]},H4={defineNodes:[{name:"Subscript",style:b.special(b.content)},{name:"SubscriptMark",style:b.processingInstruction}],parseInline:[{name:"Subscript",parse:rA(126,"Subscript","SubscriptMark")}]},K4={defineNodes:[{name:"Emoji",style:b.character}],parseInline:[{name:"Emoji",parse(t,e,n){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(t.slice(n+1,t.end)))?-1:t.addElement(t.elt("Emoji",n,n+1+r[0].length))}}]},J4=54,eF=1,tF=55,nF=2,rF=56,iF=3,S_=4,oF=5,Ip=6,iA=7,oA=8,sA=9,lA=10,sF=11,lF=12,aF=13,Wm=57,uF=14,b_=58,aA=20,cF=22,uA=23,fF=24,iy=26,cA=27,hF=28,dF=31,pF=34,gF=36,mF=37,OF=0,vF=1,yF={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},SF={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},w_={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function bF(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}function fA(t){return t==9||t==10||t==13||t==32}let k_=null,x_=null,__=0;function oy(t,e){let n=t.pos+e;if(__==n&&x_==t)return k_;let r=t.peek(e);for(;fA(r);)r=t.peek(++e);let i="";for(;bF(r);)i+=String.fromCharCode(r),r=t.peek(++e);return x_=t,__=n,k_=i?i.toLowerCase():r==wF||r==kF?void 0:null}const hA=60,Lp=62,f1=47,wF=63,kF=33,xF=45;function P_(t,e){this.name=t,this.parent=e,this.hash=e?e.hash:0;for(let n=0;n<t.length;n++)this.hash+=(this.hash<<4)+t.charCodeAt(n)+(t.charCodeAt(n)<<8)}const _F=[Ip,lA,iA,oA,sA],PF=new xQ({start:null,shift(t,e,n,r){return _F.indexOf(e)>-1?new P_(oy(r,1)||"",t):t},reduce(t,e){return e==aA&&t?t.parent:t},reuse(t,e,n,r){let i=e.type.id;return i==Ip||i==gF?new P_(oy(r,1)||"",t):t},hash(t){return t?t.hash:0},strict:!1}),CF=new ho((t,e)=>{if(t.next!=hA){t.next<0&&e.context&&t.acceptToken(Wm);return}t.advance();let n=t.next==f1;n&&t.advance();let r=oy(t,0);if(r===void 0)return;if(!r)return t.acceptToken(n?uF:Ip);let i=e.context?e.context.name:null;if(n){if(r==i)return t.acceptToken(sF);if(i&&SF[i])return t.acceptToken(Wm,-2);if(e.dialectEnabled(OF))return t.acceptToken(lF);for(let o=e.context;o;o=o.parent)if(o.name==r)return;t.acceptToken(aF)}else{if(r=="script")return t.acceptToken(iA);if(r=="style")return t.acceptToken(oA);if(r=="textarea")return t.acceptToken(sA);if(yF.hasOwnProperty(r))return t.acceptToken(lA);i&&w_[i]&&w_[i][r]?t.acceptToken(Wm,-1):t.acceptToken(Ip)}},{contextual:!0}),EF=new ho(t=>{for(let e=0,n=0;;n++){if(t.next<0){n&&t.acceptToken(b_);break}if(t.next==xF)e++;else if(t.next==Lp&&e>=2){n>3&&t.acceptToken(b_,-2);break}else e=0;t.advance()}});function TF(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const $F=new ho((t,e)=>{if(t.next==f1&&t.peek(1)==Lp){let n=e.dialectEnabled(vF)||TF(e.context);t.acceptToken(n?oF:S_,2)}else t.next==Lp&&t.acceptToken(S_,1)});function h1(t,e,n){let r=2+t.length;return new ho(i=>{for(let o=0,s=0,l=0;;l++){if(i.next<0){l&&i.acceptToken(e);break}if(o==0&&i.next==hA||o==1&&i.next==f1||o>=2&&o<r&&i.next==t.charCodeAt(o-2))o++,s++;else if((o==2||o==r)&&fA(i.next))s++;else if(o==r&&i.next==Lp){l>s?i.acceptToken(e,-s):i.acceptToken(n,-(s-2));break}else if((i.next==10||i.next==13)&&l){i.acceptToken(e,1);break}else o=s=0;i.advance()}})}const RF=h1("script",J4,eF),QF=h1("style",tF,nF),AF=h1("textarea",rF,iF),MF=bl({"Text RawText":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),DF=vl.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#X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cO~OfdO~OfeO~O!WfOPlP!ZlP~O!XiOQoP!ZoP~O!YlORrP!ZrP~OUSOVPOWQOXROYTOZqO[]O][O^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OhyO~OS!OOhyO~OS!QOhyO~OS!SOT!TOhyO~OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:PF,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[MF],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bX`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UV`P!cpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pT`POv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!cpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({W`P!a`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!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5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[RF,QF,AF,$F,CF,EF,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:485},tokenPrec:487});function dA(t,e){let n=Object.create(null);for(let r of t.getChildren(uA)){let i=r.getChild(fF),o=r.getChild(iy)||r.getChild(cA);i&&(n[e.read(i.from,i.to)]=o?o.type.id==iy?e.read(o.from+1,o.to-1):e.read(o.from,o.to):"")}return n}function C_(t,e){let n=t.getChild(cF);return n?e.read(n.from,n.to):" "}function Bm(t,e,n){let r;for(let i of n)if(!i.attrs||i.attrs(r||(r=dA(t.node.parent.firstChild,e))))return{parser:i.parser};return null}function pA(t=[],e=[]){let n=[],r=[],i=[],o=[];for(let l of t)(l.tag=="script"?n:l.tag=="style"?r:l.tag=="textarea"?i:o).push(l);let s=e.length?Object.create(null):null;for(let l of e)(s[l.name]||(s[l.name]=[])).push(l);return ZT((l,a)=>{let u=l.type.id;if(u==hF)return Bm(l,a,n);if(u==dF)return Bm(l,a,r);if(u==pF)return Bm(l,a,i);if(u==aA&&o.length){let c=l.node,f=c.firstChild,h=f&&C_(f,a),d;if(h){for(let p of o)if(p.tag==h&&(!p.attrs||p.attrs(d||(d=dA(c,a))))){let g=c.lastChild;return{parser:p.parser,overlay:[{from:f.to,to:g.type.id==mF?g.from:c.to}]}}}}if(s&&u==uA){let c=l.node,f;if(f=c.firstChild){let h=s[a.read(f.from,f.to)];if(h)for(let d of h){if(d.tagName&&d.tagName!=C_(c.parent,a))continue;let p=c.lastChild;if(p.type.id==iy){let g=p.from+1,O=p.lastChild,v=p.to-(O&&O.isError?0:1);if(v>g)return{parser:d.parser,overlay:[{from:g,to:v}]}}else if(p.type.id==cA)return{parser:d.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const NF=96,E_=1,jF=97,IF=98,T_=2,gA=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],LF=58,ZF=40,mA=95,WF=91,jd=45,BF=46,XF=35,YF=37;function Zp(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function UF(t){return t>=48&&t<=57}const FF=new ho((t,e)=>{for(let n=!1,r=0,i=0;;i++){let{next:o}=t;if(Zp(o)||o==jd||o==mA||n&&UF(o))!n&&(o!=jd||i>0)&&(n=!0),r===i&&o==jd&&r++,t.advance();else{n&&t.acceptToken(o==ZF?jF:r==2&&e.canShift(T_)?T_:IF);break}}}),qF=new ho(t=>{if(gA.includes(t.peek(-1))){let{next:e}=t;(Zp(e)||e==mA||e==XF||e==BF||e==WF||e==LF||e==jd)&&t.acceptToken(NF)}}),zF=new ho(t=>{if(!gA.includes(t.peek(-1))){let{next:e}=t;if(e==YF&&(t.advance(),t.acceptToken(E_)),Zp(e)){do t.advance();while(Zp(t.next));t.acceptToken(E_)}}}),VF=bl({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),GF={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},HF={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},KF={__proto__:null,not:128,only:128},JF=vl.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ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ZQ!c]Q#U!TQ#l!l[#y#R#z$R$j$o${Q#|#TQ$O#WS$a#l$cQ$f#uR$w$bR#x#QQiPR#PwQ!b[Q!jaR#X!VU!^[a!VQ!i`Q#^!]Q#b!_Q$T#_R$U#`",nodeNames:"⚠ Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent , PseudoClassName ArgList IdSelector # IdName ] AttributeSelector [ AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:114,nodeProps:[["openedBy",17,"(",48,"{"],["closedBy",18,")",49,"}"]],propSources:[VF],skippedNodes:[0,3,85],repeatNodeCount:10,tokenData:"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;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^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!RUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[qF,zF,FF,1,2,3,4,new Np("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:t=>GF[t]||-1},{term:56,get:t=>HF[t]||-1},{term:98,get:t=>KF[t]||-1}],tokenPrec:1169});let Xm=null;function Ym(){if(!Xm&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],n=new Set;for(let r in t)r!="cssText"&&r!="cssFloat"&&typeof t[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),n.has(r)||(e.push(r),n.add(r)));Xm=e.sort().map(r=>({type:"property",label:r}))}return Xm||[]}const $_=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),R_=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),eq=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Io=/^(\w[\w-]*|-\w[\w-]*|)$/,tq=/^-(-[\w-]*)?$/;function nq(t,e){var n;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let r=(n=t.parent)===null||n===void 0?void 0:n.firstChild;return(r==null?void 0:r.name)!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const Q_=new LT,rq=["Declaration"];function iq(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function OA(t,e,n){if(e.to-e.from>4096){let r=Q_.get(e);if(r)return r;let i=[],o=new Set,s=e.cursor(nn.IncludeAnonymous);if(s.firstChild())do for(let l of OA(t,s.node,n))o.has(l.label)||(o.add(l.label),i.push(l));while(s.nextSibling());return Q_.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(o=>{var s;if(n(o)&&o.matchContext(rq)&&((s=o.node.nextSibling)===null||s===void 0?void 0:s.name)==":"){let l=t.sliceString(o.from,o.to);i.has(l)||(i.add(l),r.push({label:l,type:"variable"}))}}),r}}const oq=t=>e=>{let{state:n,pos:r}=e,i=_n(n).resolveInner(r,-1),o=i.type.isError&&i.from==i.to-1&&n.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(o||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:Ym(),validFor:Io};if(i.name=="ValueName")return{from:i.from,options:R_,validFor:Io};if(i.name=="PseudoClassName")return{from:i.from,options:$_,validFor:Io};if(t(i)||(e.explicit||o)&&nq(i,n.doc))return{from:t(i)||o?i.from:r,options:OA(n.doc,iq(i),t),validFor:tq};if(i.name=="TagName"){for(let{parent:a}=i;a;a=a.parent)if(a.name=="Block")return{from:i.from,options:Ym(),validFor:Io};return{from:i.from,options:eq,validFor:Io}}if(!e.explicit)return null;let s=i.resolve(r),l=s.childBefore(r);return l&&l.name==":"&&s.name=="PseudoClassSelector"?{from:r,options:$_,validFor:Io}:l&&l.name==":"&&s.name=="Declaration"||s.name=="ArgList"?{from:r,options:R_,validFor:Io}:s.name=="Block"||s.name=="Styles"?{from:r,options:Ym(),validFor:Io}:null},sq=oq(t=>t.name=="VariableName"),Wp=Ol.define({name:"css",parser:JF.configure({props:[Ja.add({Declaration:xa()}),wl.add({"Block KeyframeList":P0})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function vA(){return new Ba(Wp,Wp.data.of({autocomplete:sq}))}const Iu=["_blank","_self","_top","_parent"],Um=["ascii","utf-8","utf-16","latin1","latin1"],Fm=["get","post","put","delete"],qm=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Xr=["true","false"],Ke={},lq={a:{attrs:{href:null,ping:null,type:null,media:null,target:Iu,hreflang:null}},abbr:Ke,address:Ke,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ke,aside:Ke,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ke,base:{attrs:{href:null,target:Iu}},bdi:Ke,bdo:Ke,blockquote:{attrs:{cite:null}},body:Ke,br:Ke,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:qm,formmethod:Fm,formnovalidate:["novalidate"],formtarget:Iu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ke,center:Ke,cite:Ke,code:Ke,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ke,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ke,div:Ke,dl:Ke,dt:Ke,em:Ke,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ke,figure:Ke,footer:Ke,form:{attrs:{action:null,name:null,"accept-charset":Um,autocomplete:["on","off"],enctype:qm,method:Fm,novalidate:["novalidate"],target:Iu}},h1:Ke,h2:Ke,h3:Ke,h4:Ke,h5:Ke,h6:Ke,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ke,hgroup:Ke,hr:Ke,html:{attrs:{manifest:null}},i:Ke,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:qm,formmethod:Fm,formnovalidate:["novalidate"],formtarget:Iu,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ke,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ke,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ke,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Um,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ke,noscript:Ke,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ke,param:{attrs:{name:null,value:null}},pre:Ke,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ke,rt:Ke,ruby:Ke,samp:Ke,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Um}},section:Ke,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ke,source:{attrs:{src:null,type:null,media:null}},span:Ke,strong:Ke,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ke,summary:Ke,sup:Ke,table:Ke,tbody:Ke,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ke,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ke,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ke,time:{attrs:{datetime:null}},title:Ke,tr:Ke,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ke,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ke},yA={accesskey:null,class:null,contenteditable:Xr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:Xr,autocorrect:Xr,autocapitalize:Xr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":Xr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Xr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Xr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Xr,"aria-hidden":Xr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Xr,"aria-multiselectable":Xr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Xr,"aria-relevant":null,"aria-required":Xr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},SA="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of SA)yA[t]=null;class Kc{constructor(e,n){this.tags=Object.assign(Object.assign({},lq),e),this.globalAttrs=Object.assign(Object.assign({},yA),n),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Kc.default=new Kc;function za(t,e,n=t.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?t.sliceString(i.from,Math.min(i.to,n)):""}function Va(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function bA(t,e,n){let r=n.tags[za(t,Va(e))];return(r==null?void 0:r.children)||n.allTags}function d1(t,e){let n=[];for(let r=Va(e);r&&!r.type.isTop;r=Va(r.parent)){let i=za(t,r);if(i&&r.lastChild.name=="CloseTag")break;i&&n.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&n.push(i)}return n}const wA=/^[:\-\.\w\u00b7-\uffff]*$/;function A_(t,e,n,r,i){let o=/\s*>/.test(t.sliceDoc(i,i+5))?"":">",s=Va(n,!0);return{from:r,to:i,options:bA(t.doc,s,e).map(l=>({label:l,type:"type"})).concat(d1(t.doc,n).map((l,a)=>({label:"/"+l,apply:"/"+l+o,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function M_(t,e,n,r){let i=/\s*>/.test(t.sliceDoc(r,r+5))?"":">";return{from:n,to:r,options:d1(t.doc,e).map((o,s)=>({label:o,apply:o+i,type:"type",boost:99-s})),validFor:wA}}function aq(t,e,n,r){let i=[],o=0;for(let s of bA(t.doc,n,e))i.push({label:"<"+s,type:"type"});for(let s of d1(t.doc,n))i.push({label:"</"+s+">",type:"type",boost:99-o++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function uq(t,e,n,r,i){let o=Va(n),s=o?e.tags[za(t.doc,o)]:null,l=s&&s.attrs?Object.keys(s.attrs):[],a=s&&s.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:a.map(u=>({label:u,type:"property"})),validFor:wA}}function cq(t,e,n,r,i){var o;let s=(o=n.parent)===null||o===void 0?void 0:o.getChild("AttributeName"),l=[],a;if(s){let u=t.sliceDoc(s.from,s.to),c=e.globalAttrs[u];if(!c){let f=Va(n),h=f?e.tags[za(t.doc,f)]:null;c=(h==null?void 0:h.attrs)&&h.attrs[u]}if(c){let f=t.sliceDoc(r,i).toLowerCase(),h='"',d='"';/^['"]/.test(f)?(a=f[0]=='"'?/^[^"]*$/:/^[^']*$/,h="",d=t.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):a=/^[^\s<>='"]*$/;for(let p of c)l.push({label:p,apply:h+p+d,type:"constant"})}}return{from:r,to:i,options:l,validFor:a}}function kA(t,e){let{state:n,pos:r}=e,i=_n(n).resolveInner(r,-1),o=i.resolve(r);for(let s=r,l;o==i&&(l=i.childBefore(s));){let a=l.lastChild;if(!a||!a.type.isError||a.from<a.to)break;o=i=l,s=a.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?M_(n,i,i.from,r):A_(n,t,i,i.from,r):i.name=="StartTag"?A_(n,t,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?M_(n,i,r,r):e.explicit&&(i.name=="OpenTag"||i.name=="SelfClosingTag")||i.name=="AttributeName"?uq(n,t,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?cq(n,t,i,i.name=="Is"?r:i.from,r):e.explicit&&(o.name=="Element"||o.name=="Text"||o.name=="Document")?aq(n,t,i,r):null}function fq(t){return kA(Kc.default,t)}function hq(t){let{extraTags:e,extraGlobalAttributes:n}=t,r=n||e?new Kc(e,n):Kc.default;return i=>kA(r,i)}const dq=co.parser.configure({top:"SingleExpression"}),xA=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:RQ.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:QQ.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:AQ.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:dq},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:co.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:Wp.parser}],_A=[{name:"style",parser:Wp.parser.configure({top:"Styles"})}].concat(SA.map(t=>({name:t,parser:co.parser}))),PA=Ol.define({name:"html",parser:DF.configure({props:[Ja.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].length<t.node.to)return t.continue();let e=null,n;for(let r=t.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((n=e.lastChild)&&(n.name=="CloseTag"||n.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),wl.add({Element(t){let e=t.firstChild,n=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:n.name=="CloseTag"?n.from:t.to}}}),o$.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Id=PA.configure({wrap:pA(xA,_A)});function CA(t={}){let e="",n;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(n=pA((t.nestedLanguages||[]).concat(xA),(t.nestedAttributes||[]).concat(_A)));let r=n?PA.configure({wrap:n,dialect:e}):e?Id.configure({dialect:e}):Id;return new Ba(r,[Id.data.of({autocomplete:hq(t)}),t.autoCloseTags!==!1?pq:[],NQ().support,vA().support])}const D_=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),pq=$e.inputHandler.of((t,e,n,r,i)=>{if(t.composing||t.state.readOnly||e!=n||r!=">"&&r!="/"||!Id.isActiveAt(t.state,e,-1))return!1;let o=i(),{state:s}=o,l=s.changeByRange(a=>{var u,c,f;let h=s.doc.sliceString(a.from-1,a.to)==r,{head:d}=a,p=_n(s).resolveInner(d-1,-1),g;if((p.name=="TagName"||p.name=="StartTag")&&(p=p.parent),h&&r==">"&&p.name=="OpenTag"){if(((c=(u=p.parent)===null||u===void 0?void 0:u.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(g=za(s.doc,p.parent,d))&&!D_.has(g)){let O=d+(s.doc.sliceString(d,d+1)===">"?1:0),v=`</${g}>`;return{range:a,changes:{from:d,to:O,insert:v}}}}else if(h&&r=="/"&&p.name=="IncompleteCloseTag"){let O=p.parent;if(p.from==d-2&&((f=O.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(g=za(s.doc,O,d))&&!D_.has(g)){let v=d+(s.doc.sliceString(d,d+1)===">"?1:0),m=`${g}>`;return{range:oe.cursor(d+m.length,-1),changes:{from:d,to:v,insert:m}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([o,s.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),EA=w0({commentTokens:{block:{open:"<!--",close:"-->"}}}),TA=new dt,$A=L4.configure({props:[wl.add(t=>!t.is("Block")||t.is("Document")||sy(t)!=null?void 0:(e,n)=>({from:n.doc.lineAt(e.from).to,to:e.to})),TA.add(sy),Ja.add({Document:()=>null}),tl.add({Document:EA})]});function sy(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function gq(t,e){let n=t;for(;;){let r=n.nextSibling,i;if(!r||(i=sy(r.type))!=null&&i<=e)break;n=r}return n.to}const mq=qT.of((t,e,n)=>{for(let r=_n(t).resolveInner(n,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(TA);if(i==null)continue;let o=gq(r,i);if(o>n)return{from:n,to:o}}return null});function p1(t){return new hi(EA,t,[mq],"markdown")}const Oq=p1($A),vq=$A.configure([V4,H4,G4,K4,{props:[wl.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),RA=p1(vq);function yq(t,e){return n=>{if(n&&t){let r=null;if(n=/\S*/.exec(n)[0],typeof t=="function"?r=t(n):r=yp.matchLanguageName(t,n,!0),r instanceof yp)return r.support?r.support.language.parser:Bc.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}class ad{constructor(e,n,r,i,o,s,l){this.node=e,this.from=n,this.to=r,this.spaceBefore=i,this.spaceAfter=o,this.type=s,this.item=l}blank(e,n=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(n?this.spaceAfter:"")}}marker(e,n){let r=this.node.name=="OrderedList"?String(+AA(this.item,e)[2]+n):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function QA(t,e){let n=[];for(let i=t;i&&i.name!="Document";i=i.parent)(i.name=="ListItem"||i.name=="Blockquote"||i.name=="FencedCode")&&n.push(i);let r=[];for(let i=n.length-1;i>=0;i--){let o=n[i],s,l=e.lineAt(o.from),a=o.from-l.from;if(o.name=="FencedCode")r.push(new ad(o,a,a,"","","",null));else if(o.name=="Blockquote"&&(s=/^ *>( ?)/.exec(l.text.slice(a))))r.push(new ad(o,a,a+s[0].length,"",s[1],">",null));else if(o.name=="ListItem"&&o.parent.name=="OrderedList"&&(s=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let u=s[3],c=s[0].length;u.length>=4&&(u=u.slice(0,u.length-4),c-=4),r.push(new ad(o.parent,a,a+c,s[1],u,s[2],o))}else if(o.name=="ListItem"&&o.parent.name=="BulletList"&&(s=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let u=s[4],c=s[0].length;u.length>4&&(u=u.slice(0,u.length-4),c-=4);let f=s[2];s[3]&&(f+=s[3].replace(/[xX]/," ")),r.push(new ad(o.parent,a,a+c,s[1],u,f,o))}}return r}function AA(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function zm(t,e,n,r=0){for(let i=-1,o=t;;){if(o.name=="ListItem"){let l=AA(o,e),a=+l[2];if(i>=0){if(a!=i+1)return;n.push({from:o.from+l[1].length,to:o.from+l[0].length,insert:String(i+2+r)})}i=a}let s=o.nextSibling;if(!s)break;o=s}}function g1(t,e){let n=/^[ \t]*/.exec(t)[0].length;if(!n||e.facet(ff)!=" ")return t;let r=Ni(t,4,n),i="";for(let o=r;o>0;)o>=4?(i+=" ",o-=4):(i+=" ",o--);return i+t.slice(n)}const Sq=({state:t,dispatch:e})=>{let n=_n(t),{doc:r}=t,i=null,o=t.changeByRange(s=>{if(!s.empty||!RA.isActiveAt(t,s.from))return i={range:s};let l=s.from,a=r.lineAt(l),u=QA(n.resolveInner(l,-1),r);for(;u.length&&u[u.length-1].from>l-a.from;)u.pop();if(!u.length)return i={range:s};let c=u[u.length-1];if(c.to-c.spaceAfter.length>l-a.from)return i={range:s};let f=l>=c.to-c.spaceAfter.length&&!/\S/.test(a.text.slice(c.to));if(c.item&&f){let O=c.node.firstChild,v=c.node.getChild("ListItem","ListItem");if(O.to>=l||v&&v.to<l||a.from>0&&!/[^\s>]/.test(r.lineAt(a.from-1).text)){let m=u.length>1?u[u.length-2]:null,y,S="";m&&m.item?(y=a.from+m.from,S=m.marker(r,1)):y=a.from+(m?m.to:0);let k=[{from:y,to:l,insert:S}];return c.node.name=="OrderedList"&&zm(c.item,r,k,-2),m&&m.node.name=="OrderedList"&&zm(m.item,r,k),{range:oe.cursor(y+S.length),changes:k}}else{let m=j_(u,t,a);return{range:oe.cursor(l+m.length+1),changes:{from:a.from,insert:m+t.lineBreak}}}}if(c.node.name=="Blockquote"&&f&&a.from){let O=r.lineAt(a.from-1),v=/>\s*$/.exec(O.text);if(v&&v.index==c.from){let m=t.changes([{from:O.from+v.index,to:O.to},{from:a.from+c.from,to:a.to}]);return{range:s.map(m),changes:m}}}let h=[];c.node.name=="OrderedList"&&zm(c.item,r,h);let d=c.item&&c.item.from<a.from,p="";if(!d||/^[\s\d.)\-+*>]*/.exec(a.text)[0].length>=c.to)for(let O=0,v=u.length-1;O<=v;O++)p+=O==v&&!d?u[O].marker(r,1):u[O].blank(O<v?Ni(a.text,4,u[O+1].from)-p.length:null);let g=l;for(;g>a.from&&/\s/.test(a.text.charAt(g-a.from-1));)g--;return p=g1(p,t),bq(c.node,t.doc)&&(p=j_(u,t,a)+t.lineBreak+p),h.push({from:g,to:l,insert:t.lineBreak+p}),{range:oe.cursor(g+p.length+1),changes:h}});return i?!1:(e(t.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)};function N_(t){return t.name=="QuoteMark"||t.name=="ListMark"}function bq(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let n=t.firstChild,r=t.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(n.to),o=e.lineAt(r.from),s=/^[\s>]*$/.test(i.text);return i.number+(s?0:1)<o.number}function j_(t,e,n){let r="";for(let i=0,o=t.length-2;i<=o;i++)r+=t[i].blank(i<o?Ni(n.text,4,t[i+1].from)-r.length:null,i<o);return g1(r,e)}function wq(t,e){let n=t.resolveInner(e,-1),r=e;N_(n)&&(r=n.from,n=n.parent);for(let i;i=n.childBefore(r);)if(N_(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")n=i.lastChild,r=n.to;else break;return n}const kq=({state:t,dispatch:e})=>{let n=_n(t),r=null,i=t.changeByRange(o=>{let s=o.from,{doc:l}=t;if(o.empty&&RA.isActiveAt(t,o.from)){let a=l.lineAt(s),u=QA(wq(n,s),l);if(u.length){let c=u[u.length-1],f=c.to-c.spaceAfter.length+(c.spaceAfter?1:0);if(s-a.from>f&&!/\S/.test(a.text.slice(f,s-a.from)))return{range:oe.cursor(a.from+f),changes:{from:a.from+f,to:s}};if(s-a.from==f&&(!c.item||a.from<=c.item.from||!/\S/.test(a.text.slice(0,c.to)))){let h=a.from+c.from;if(c.item&&c.node.from<c.item.from&&/\S/.test(a.text.slice(c.from,c.to))){let d=c.blank(Ni(a.text,4,c.to)-Ni(a.text,4,c.from));return h==a.from&&(d=g1(d,t)),{range:oe.cursor(h+d.length),changes:{from:h,to:a.from+c.to,insert:d}}}if(h<s)return{range:oe.cursor(h),changes:{from:h,to:s}}}}}return r={range:o}});return r?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},xq=[{key:"Enter",run:Sq},{key:"Backspace",run:kq}],ly=CA({matchClosingTags:!1});function _q(t={}){let{codeLanguages:e,defaultCodeLanguage:n,addKeymap:r=!0,base:{parser:i}=Oq,completeHTMLTags:o=!0}=t;if(!(i instanceof kg))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let s=t.extensions?[t.extensions]:[],l=[ly.support],a;n instanceof Ba?(l.push(n.support),a=n.language):n&&(a=n);let u=e||a?yq(e,a):void 0;s.push(W4({codeParser:u,htmlParser:ly.language.parser})),r&&l.push(Cs.high(af.of(xq)));let c=p1(i.configure(s));return o&&l.push(c.data.of({autocomplete:Pq})),new Ba(c,l)}function Pq(t){let{state:e,pos:n}=t,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(n-25,n));if(!r)return null;let i=_n(e).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:n-r[0].length,to:n,options:Cq(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Vm=null;function Cq(){if(Vm)return Vm;let t=fq(new t1(Mt.create({extensions:ly}),0,!0));return Vm=t?t.options:[]}const I_=(t,e,n,r,i)=>{let o=[],s=0;return e.iterChanges((l,a,u,c,f)=>{const h=n.sliceString(l,a,`
139
- `),d=f.sliceString(0,f.length,`
140
- `);h&&o.push(i.remove(l+s,h)),d&&o.push(i.insert(l+s,d)),s+=d.length,s-=h.length}),o=o.reduce(i.type.compose),r.editOp(t,"text-unicode",o)},L_=t=>{const e=[];for(const n of t){const{es:r}=n;if(r!==void 0){let i=0;for(let o=0;o<r.length;o++){const s=r[o];if(typeof s=="number")i+=s;else if(typeof s=="string")if(r[o+1]&&typeof r[o+1]=="object"&&r[o+1].d!==void 0){let l=typeof r[o+1].d=="number"?r[o+1].d:r[o+1].d.length;e.push({from:i,to:i+l,insert:s}),i+=l,o++}else e.push({from:i,to:i,insert:s});else s&&s.d!==void 0&&(typeof s.d=="number"?(e.push({from:i,to:i+s.d}),i+=s.d):typeof s.d=="string"&&(e.push({from:i,to:i+s.d.length}),i+=s.d.length))}}}return e},Eq=(t,e)=>{if(!t||!e)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},Tq=({shareDBDoc:t,path:e=[],json1:n,textUnicode:r,debug:i=!1})=>Jt.fromClass(class{constructor(o){this.view=o,this.handleOp=s=>{!this.lock&&Eq(s,e)&&(this.lock=!0,i&&(console.log("Received op from ShareDB"),console.log(" op: "+JSON.stringify(s)),console.log(" generated changes: "+JSON.stringify(L_(s)))),o.dispatch({changes:L_(s)}),this.lock=!1)},t.on("op",this.handleOp)}update(o){!this.lock&&o.docChanged&&(this.lock=!0,i&&(console.log("Received change from CodeMirror"),console.log(" changes:"+JSON.stringify(o.changes.toJSON())),console.log(" iterChanges:"),o.changes.iterChanges((s,l,a,u,c)=>{console.log(" "+JSON.stringify({fromA:s,toA:l,fromB:a,toB:u,inserted:c.sliceString(0,c.length,`
141
- `)}))}),console.log(" generated json1 op: "+JSON.stringify(I_(e,o.changes,o.startState.doc,n,r)))),t.submitOp(I_(e,o.changes,o.startState.doc,n,r)),this.lock=!1)}destroy(){t.off("op",this.handleOp)}});function $q(t,e=t.state){const n=new Set;for(const{from:r,to:i}of t.visibleRanges){let o=r;for(;o<=i;){const s=e.doc.lineAt(o);n.has(s)||n.add(s),o=s.to+1}}return n}function ay(t){const e=t.selection.main.head;return t.doc.lineAt(e)}function Z_(t,e){let n=0;e:for(let r=0;r<t.length;r++)switch(t[r]){case" ":{n+=1;continue e}case" ":{n+=e-n%e;continue e}case"\r":continue e;default:break e}return n}const Bp=je.define({combine(t){return Li(t,{highlightActiveBlock:!0,hideFirstIndent:!1,markerType:"fullScope",thickness:1})}});class Rq{constructor(e,n,r,i){this.lines=e,this.state=n,this.map=new Map,this.unitWidth=r,this.markerType=i;for(const o of this.lines)this.add(o);this.state.facet(Bp).highlightActiveBlock&&this.findAndSetActiveLines()}has(e){return this.map.has(typeof e=="number"?e:e.number)}get(e){const n=this.map.get(typeof e=="number"?e:e.number);if(!n)throw new Error("Line not found in indentation map");return n}set(e,n,r){const i=!e.text.trim().length,o={line:e,col:n,level:r,empty:i};return this.map.set(o.line.number,o),o}add(e){if(this.has(e))return this.get(e);if(!e.length||!e.text.trim().length){if(e.number===1)return this.set(e,0,0);if(e.number===this.state.doc.lines){const s=this.closestNonEmpty(e,-1);return this.set(e,0,s.level)}const i=this.closestNonEmpty(e,-1),o=this.closestNonEmpty(e,1);return i.level>=o.level&&this.markerType!=="codeOnly"?this.set(e,0,i.level):i.empty&&i.level===0&&o.level!==0?this.set(e,0,0):o.level>i.level?this.set(e,0,i.level+1):this.set(e,0,o.level)}const n=Z_(e.text,this.state.tabSize),r=Math.floor(n/this.unitWidth);return this.set(e,n,r)}closestNonEmpty(e,n){let r=e.number+n;for(;n===-1?r>=1:r<=this.state.doc.lines;){if(this.has(r)){const s=this.get(r);if(!s.empty)return s}const o=this.state.doc.line(r);if(o.text.trim().length){const s=Z_(o.text,this.state.tabSize),l=Math.floor(s/this.unitWidth);return this.set(o,s,l)}r+=n}const i=this.state.doc.line(n===-1?1:this.state.doc.lines);return this.set(i,0,0)}findAndSetActiveLines(){const e=ay(this.state);if(!this.has(e))return;let n=this.get(e);if(this.has(n.line.number+1)){const o=this.get(n.line.number+1);o.level>n.level&&(n=o)}if(this.has(n.line.number-1)){const o=this.get(n.line.number-1);o.level>n.level&&(n=o)}if(n.level===0)return;n.active=n.level;let r,i;for(r=n.line.number;r>1;r--){if(!this.has(r-1))continue;const o=this.get(r-1);if(o.level<n.level)break;o.active=n.level}for(i=n.line.number;i<this.state.doc.lines;i++){if(!this.has(i+1))continue;const o=this.get(i+1);if(o.level<n.level)break;o.active=n.level}}}function Qq(t){const e={light:"#F0F1F2",dark:"#2B3245",activeLight:"#E4E5E6",activeDark:"#3C445C"};let n=e;return t&&(n=Object.assign(Object.assign({},e),t)),$e.baseTheme({"&light":{"--indent-marker-bg-color":n.light,"--indent-marker-active-bg-color":n.activeLight},"&dark":{"--indent-marker-bg-color":n.dark,"--indent-marker-active-bg-color":n.activeDark},".cm-line":{position:"relative"},".cm-indent-markers::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,background:"var(--indent-markers)",pointerEvents:"none",zIndex:"-1"}})}function ud(t,e,n,r,i){return`${`repeating-linear-gradient(to right, var(${t}) 0 ${e}px, transparent ${e}px ${n}ch)`} ${r*n}.5ch/calc(${n*i}ch - 1px) no-repeat`}function Aq(t,e,n,r){const{level:i,active:o}=t;if(n&&i===0)return[];const s=n?1:0,l=[];if(o!==void 0){const a=o-s-1;a>0&&l.push(ud("--indent-marker-bg-color",r,e,s,a)),l.push(ud("--indent-marker-active-bg-color",r,e,o-1,1)),o!==i&&l.push(ud("--indent-marker-bg-color",r,e,o,i-o))}else l.push(ud("--indent-marker-bg-color",r,e,s,i-s));return l.join(",")}class Mq{constructor(e){this.view=e,this.unitWidth=Xa(e.state),this.currentLineNumber=ay(e.state).number,this.generate(e.state)}update(e){const n=Xa(e.state),r=n!==this.unitWidth;r&&(this.unitWidth=n);const i=ay(e.state).number,o=i!==this.currentLineNumber;this.currentLineNumber=i;const s=e.state.facet(Bp).highlightActiveBlock&&o;(e.docChanged||e.viewportChanged||r||s)&&this.generate(e.state)}generate(e){const n=new vs,r=$q(this.view,e),{hideFirstIndent:i,markerType:o,thickness:s}=e.facet(Bp),l=new Rq(r,e,this.unitWidth,o);for(const a of r){const u=l.get(a.number);if(!(u!=null&&u.level))continue;const c=Aq(u,this.unitWidth,i,s);n.add(a.from,a.from,Ue.line({class:"cm-indent-markers",attributes:{style:`--indent-markers: ${c}`}}))}this.decorations=n.finish()}}function Dq(t={}){return[Bp.of(t),Qq(t.colors),Jt.fromClass(Mq,{decorations:e=>e.decorations})]}const MA=t=>e=>{const n=t==="down";let r=e.state.selection;for(const i of r.ranges)r=r.addRange(e.moveVertically(i,n));return e.dispatch({selection:r}),!0},Nq=MA("up"),jq=MA("down"),Iq=t=>{let e=null;for(const n of t.state.selection.ranges)if(!n.empty)for(let r=n.from;r<=n.to;){const i=t.state.doc.lineAt(r),o=Math.min(i.to,n.to);e?e=e.addRange(oe.range(o,o)):e=oe.single(o),r=i.to+1}return e?(t.dispatch({selection:e}),!0):!1},Lq=[{key:"Ctrl-Space",run:uQ},{key:"Escape",run:cQ},{key:"ArrowDown",run:is(!0)},{key:"ArrowUp",run:is(!1)},{key:"PageDown",run:is(!0,"page")},{key:"PageUp",run:is(!1,"page")},{key:"Enter",run:Jv},{key:"Tab",run:Jv},{key:"Mod-f",run:tQ,scope:"editor search-panel"},{key:"Escape",run:nQ,scope:"editor search-panel"},{key:"Alt-Enter",run:HR,scope:"editor search-panel"},{key:"Mod-Alt-Enter",run:KR,scope:"editor search-panel"},{key:"Ctrl-g",run:pY},{key:"Mod-d",run:_Y,preventDefault:!0},{key:"Shift-Mod-l",run:AY},{key:"Enter",run:Tx,shift:Tx},{key:"ArrowLeft",run:ax,shift:px,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Y3,shift:G3},{key:"ArrowRight",run:ux,shift:gx,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:U3,shift:H3},{key:"ArrowUp",run:cx,shift:mx,preventDefault:!0},{key:"ArrowDown",run:fx,shift:Ox,preventDefault:!0},{key:"Home",run:dx,shift:bx},{mac:"Cmd-ArrowLeft",run:dx,shift:bx},{key:"Mod-Home",run:wx,shift:xx},{mac:"Cmd-ArrowUp",run:wx,shift:xx},{key:"PageUp",run:$m,shift:vx},{mac:"Ctrl-ArrowUp",run:$m,shift:vx},{key:"PageDown",run:Rm,shift:yx},{mac:"Ctrl-ArrowDown",run:Rm,shift:yx},{key:"End",run:hx,shift:Sx},{mac:"Cmd-ArrowRight",run:hx,shift:Sx},{key:"Mod-Alt-ArrowUp",linux:"Shift-Alt-ArrowUp",run:Nq,preventDefault:!0},{key:"Mod-Alt-ArrowDown",linux:"Shift-Alt-ArrowDown",run:jq,preventDefault:!0},{key:"Shift-Alt-i",run:Iq},{key:"Mod-End",run:kx,shift:_x},{mac:"Cmd-ArrowDown",run:kx,shift:_x},{key:"Mod-a",run:eY},{key:"Backspace",run:OU},{key:"Backspace",run:Qm,shift:Qm},{key:"Delete",run:Px},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Cx},{key:"Mod-Delete",mac:"Alt-Delete",run:nY},{mac:"Mod-Backspace",run:rY},{mac:"Mod-Delete",run:Ex},{mac:"Ctrl-b",run:ax,shift:px,preventDefault:!0},{mac:"Ctrl-f",run:ux,shift:gx},{mac:"Ctrl-p",run:cx,shift:mx},{mac:"Ctrl-n",run:fx,shift:Ox},{mac:"Ctrl-a",run:F3,shift:K3},{mac:"Ctrl-e",run:q3,shift:J3},{mac:"Ctrl-d",run:Px},{mac:"Ctrl-h",run:Qm},{mac:"Ctrl-k",run:Ex},{mac:"Ctrl-Alt-h",run:Cx},{mac:"Ctrl-o",run:iY},{mac:"Ctrl-t",run:oY},{mac:"Ctrl-v",run:Rm},{mac:"Alt-v",run:$m},{key:"Shift-Mod-k",run:cY},{key:"Alt-ArrowDown",run:lY},{key:"Alt-ArrowUp",run:sY},{win:"Shift-Alt-ArrowDown",mac:"Shift-Alt-ArrowDown",run:uY},{win:"Shift-Alt-ArrowUp",mac:"Shift-Alt-ArrowUp",run:aY},{key:"Mod-l",run:tY,preventDefault:!0},{key:"Shift-Mod-\\",run:V3},{key:"Tab",run:$x,shift:Rx,preventDefault:!0},{key:"Mod-[",run:Rx},{key:"Mod-]",run:$x},{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:h5},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:d5},{key:"Mod-k Mod-0",run:p5},{key:"Mod-k Mod-j",run:g5},{key:"Mod-k Mod-c",run:C3},{key:"Mod-k Mod-u",run:E3},{key:"Mod-/",run:_3},{key:"Shift-Alt-a",run:T3},{key:"Mod-z",run:CR,preventDefault:!0},{key:"Mod-y",run:Vv,preventDefault:!0},{key:"Mod-Shift-z",run:Vv,preventDefault:!0},{key:"Mod-u",run:j3,preventDefault:!0},{key:"Mod-Shift-m",run:QU},{key:"F8",run:AU}],Zq=({path:t,localPresence:e,usernameRef:n})=>$e.updateListener.of(r=>{if(r.selectionSet){const i=r.state.selection.ranges[0],{from:o,to:s}=i,l={start:[...t,o],end:[...t,s],username:n.current};e.submit(l,a=>{if(a)throw a})}});var ft=function(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n},Ne=function(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)},Lo,Us,_i,Hl,Gu,Fi,qi,zi,Vi,Gi,Hi,Ki,Ji,Fs,Kl,Zo,Ld,Wo;const Wq=function(t){var e=131,n=137,r=0;t+="x";var i=Math.floor(9007199254740991/n);for(let o=0;o<t.length;o++)r>i&&(r=Math.floor(r/n)),r=r*e+t.charCodeAt(o);return r},Ye="0123456789abcdef".split(""),Bq=[-2147483648,8388608,32768,128],xi=[24,16,8,0],cd=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Hn=[];class Xq{constructor(e=!1,n=!1){Lo.set(this,void 0),Us.set(this,void 0),_i.set(this,void 0),Hl.set(this,void 0),Gu.set(this,void 0),Fi.set(this,void 0),qi.set(this,void 0),zi.set(this,void 0),Vi.set(this,void 0),Gi.set(this,void 0),Hi.set(this,void 0),Ki.set(this,void 0),Ji.set(this,void 0),Fs.set(this,void 0),Kl.set(this,void 0),Zo.set(this,void 0),Ld.set(this,0),Wo.set(this,void 0),this.init(e,n)}init(e,n){n?(Hn[0]=Hn[16]=Hn[1]=Hn[2]=Hn[3]=Hn[4]=Hn[5]=Hn[6]=Hn[7]=Hn[8]=Hn[9]=Hn[10]=Hn[11]=Hn[12]=Hn[13]=Hn[14]=Hn[15]=0,ft(this,Us,Hn)):ft(this,Us,[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),e?(ft(this,Fi,3238371032),ft(this,qi,914150663),ft(this,zi,812702999),ft(this,Vi,4144912697),ft(this,Gi,4290775857),ft(this,Hi,1750603025),ft(this,Ki,1694076839),ft(this,Ji,3204075428)):(ft(this,Fi,1779033703),ft(this,qi,3144134277),ft(this,zi,1013904242),ft(this,Vi,2773480762),ft(this,Gi,1359893119),ft(this,Hi,2600822924),ft(this,Ki,528734635),ft(this,Ji,1541459225)),ft(this,Lo,ft(this,Wo,ft(this,_i,ft(this,Kl,0)))),ft(this,Hl,ft(this,Fs,!1)),ft(this,Gu,!0),ft(this,Zo,e)}update(e){if(Ne(this,Hl))return this;let n;e instanceof ArrayBuffer?n=new Uint8Array(e):n=e;let r=0;const i=n.length,o=Ne(this,Us);for(;r<i;){let s;if(Ne(this,Fs)&&(ft(this,Fs,!1),o[0]=Ne(this,Lo),o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0),typeof n!="string")for(s=Ne(this,Wo);r<i&&s<64;++r)o[s>>2]|=n[r]<<xi[s++&3];else for(s=Ne(this,Wo);r<i&&s<64;++r){let l=n.charCodeAt(r);l<128?o[s>>2]|=l<<xi[s++&3]:l<2048?(o[s>>2]|=(192|l>>6)<<xi[s++&3],o[s>>2]|=(128|l&63)<<xi[s++&3]):l<55296||l>=57344?(o[s>>2]|=(224|l>>12)<<xi[s++&3],o[s>>2]|=(128|l>>6&63)<<xi[s++&3],o[s>>2]|=(128|l&63)<<xi[s++&3]):(l=65536+((l&1023)<<10|n.charCodeAt(++r)&1023),o[s>>2]|=(240|l>>18)<<xi[s++&3],o[s>>2]|=(128|l>>12&63)<<xi[s++&3],o[s>>2]|=(128|l>>6&63)<<xi[s++&3],o[s>>2]|=(128|l&63)<<xi[s++&3])}ft(this,Ld,s),ft(this,_i,Ne(this,_i)+(s-Ne(this,Wo))),s>=64?(ft(this,Lo,o[16]),ft(this,Wo,s-64),this.hash(),ft(this,Fs,!0)):ft(this,Wo,s)}return Ne(this,_i)>4294967295&&(ft(this,Kl,Ne(this,Kl)+(Ne(this,_i)/4294967296<<0)),ft(this,_i,Ne(this,_i)%4294967296)),this}finalize(){if(Ne(this,Hl))return;ft(this,Hl,!0);const e=Ne(this,Us),n=Ne(this,Ld);e[16]=Ne(this,Lo),e[n>>2]|=Bq[n&3],ft(this,Lo,e[16]),n>=56&&(Ne(this,Fs)||this.hash(),e[0]=Ne(this,Lo),e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=Ne(this,Kl)<<3|Ne(this,_i)>>>29,e[15]=Ne(this,_i)<<3,this.hash()}hash(){let e=Ne(this,Fi),n=Ne(this,qi),r=Ne(this,zi),i=Ne(this,Vi),o=Ne(this,Gi),s=Ne(this,Hi),l=Ne(this,Ki),a=Ne(this,Ji);const u=Ne(this,Us);let c,f,h,d,p,g,O,v,m,y;for(let S=16;S<64;++S)d=u[S-15],c=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,d=u[S-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,u[S]=u[S-16]+c+u[S-7]+f<<0;y=n&r;for(let S=0;S<64;S+=4)Ne(this,Gu)?(Ne(this,Zo)?(O=300032,d=u[0]-1413257819,a=d-150054599<<0,i=d+24177077<<0):(O=704751109,d=u[0]-210244248,a=d-1521486534<<0,i=d+143694565<<0),ft(this,Gu,!1)):(c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),f=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),O=e&n,h=O^e&r^y,g=o&s^~o&l,d=a+f+g+cd[S]+u[S],p=c+h,a=i+d<<0,i=d+p<<0),c=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),f=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),v=i&e,h=v^i&n^O,g=a&o^~a&s,d=l+f+g+cd[S+1]+u[S+1],p=c+h,l=r+d<<0,r=d+p<<0,c=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),f=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),m=r&i,h=m^r&e^v,g=l&a^~l&o,d=s+f+g+cd[S+2]+u[S+2],p=c+h,s=n+d<<0,n=d+p<<0,c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),f=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=n&r,h=y^n&i^m,g=s&l^~s&a,d=o+f+g+cd[S+3]+u[S+3],p=c+h,o=e+d<<0,e=d+p<<0;ft(this,Fi,Ne(this,Fi)+e<<0),ft(this,qi,Ne(this,qi)+n<<0),ft(this,zi,Ne(this,zi)+r<<0),ft(this,Vi,Ne(this,Vi)+i<<0),ft(this,Gi,Ne(this,Gi)+o<<0),ft(this,Hi,Ne(this,Hi)+s<<0),ft(this,Ki,Ne(this,Ki)+l<<0),ft(this,Ji,Ne(this,Ji)+a<<0)}hex(){this.finalize();const e=Ne(this,Fi),n=Ne(this,qi),r=Ne(this,zi),i=Ne(this,Vi),o=Ne(this,Gi),s=Ne(this,Hi),l=Ne(this,Ki),a=Ne(this,Ji);let u=Ye[e>>28&15]+Ye[e>>24&15]+Ye[e>>20&15]+Ye[e>>16&15]+Ye[e>>12&15]+Ye[e>>8&15]+Ye[e>>4&15]+Ye[e&15]+Ye[n>>28&15]+Ye[n>>24&15]+Ye[n>>20&15]+Ye[n>>16&15]+Ye[n>>12&15]+Ye[n>>8&15]+Ye[n>>4&15]+Ye[n&15]+Ye[r>>28&15]+Ye[r>>24&15]+Ye[r>>20&15]+Ye[r>>16&15]+Ye[r>>12&15]+Ye[r>>8&15]+Ye[r>>4&15]+Ye[r&15]+Ye[i>>28&15]+Ye[i>>24&15]+Ye[i>>20&15]+Ye[i>>16&15]+Ye[i>>12&15]+Ye[i>>8&15]+Ye[i>>4&15]+Ye[i&15]+Ye[o>>28&15]+Ye[o>>24&15]+Ye[o>>20&15]+Ye[o>>16&15]+Ye[o>>12&15]+Ye[o>>8&15]+Ye[o>>4&15]+Ye[o&15]+Ye[s>>28&15]+Ye[s>>24&15]+Ye[s>>20&15]+Ye[s>>16&15]+Ye[s>>12&15]+Ye[s>>8&15]+Ye[s>>4&15]+Ye[s&15]+Ye[l>>28&15]+Ye[l>>24&15]+Ye[l>>20&15]+Ye[l>>16&15]+Ye[l>>12&15]+Ye[l>>8&15]+Ye[l>>4&15]+Ye[l&15];return Ne(this,Zo)||(u+=Ye[a>>28&15]+Ye[a>>24&15]+Ye[a>>20&15]+Ye[a>>16&15]+Ye[a>>12&15]+Ye[a>>8&15]+Ye[a>>4&15]+Ye[a&15]),u}toString(){return this.hex()}digest(){this.finalize();const e=Ne(this,Fi),n=Ne(this,qi),r=Ne(this,zi),i=Ne(this,Vi),o=Ne(this,Gi),s=Ne(this,Hi),l=Ne(this,Ki),a=Ne(this,Ji),u=[e>>24&255,e>>16&255,e>>8&255,e&255,n>>24&255,n>>16&255,n>>8&255,n&255,r>>24&255,r>>16&255,r>>8&255,r&255,i>>24&255,i>>16&255,i>>8&255,i&255,o>>24&255,o>>16&255,o>>8&255,o&255,s>>24&255,s>>16&255,s>>8&255,s&255,l>>24&255,l>>16&255,l>>8&255,l&255];return Ne(this,Zo)||u.push(a>>24&255,a>>16&255,a>>8&255,a&255),u}array(){return this.digest()}arrayBuffer(){this.finalize();const e=new ArrayBuffer(Ne(this,Zo)?28:32),n=new DataView(e);return n.setUint32(0,Ne(this,Fi)),n.setUint32(4,Ne(this,qi)),n.setUint32(8,Ne(this,zi)),n.setUint32(12,Ne(this,Vi)),n.setUint32(16,Ne(this,Gi)),n.setUint32(20,Ne(this,Hi)),n.setUint32(24,Ne(this,Ki)),Ne(this,Zo)||n.setUint32(28,Ne(this,Ji)),e}}Lo=new WeakMap,Us=new WeakMap,_i=new WeakMap,Hl=new WeakMap,Gu=new WeakMap,Fi=new WeakMap,qi=new WeakMap,zi=new WeakMap,Vi=new WeakMap,Gi=new WeakMap,Hi=new WeakMap,Ki=new WeakMap,Ji=new WeakMap,Fs=new WeakMap,Kl=new WeakMap,Zo=new WeakMap,Ld=new WeakMap,Wo=new WeakMap;function Yq(t){const e=new Xq;return e.update(t),parseInt(e.hex().substring(0,8),16)}const Uq=function(t){var e="#";return t.forEach(function(n){n<16&&(e+=0),e+=n.toString(16)}),e},Fq=function(t,e,n){t/=360;var r=n<.5?n*(1+e):n+e-n*e,i=2*n-r;return[t+1/3,t,t-1/3].map(function(o){return o<0&&o++,o>1&&o--,o<1/6?o=i+(r-i)*6*o:o<.5?o=r:o<2/3?o=i+(r-i)*6*(2/3-o):o=i,Math.round(o*255)})};class qq{constructor(e={}){const[n,r]=[e.lightness,e.saturation].map(function(i){return i=i!==void 0?i:[.35,.5,.65],Array.isArray(i)?i.concat():[i]});this.L=n,this.S=r,typeof e.hue=="number"&&(e.hue={min:e.hue,max:e.hue}),typeof e.hue=="object"&&!Array.isArray(e.hue)&&(e.hue=[e.hue]),typeof e.hue>"u"&&(e.hue=[]),this.hueRanges=e.hue.map(function(i){return{min:typeof i.min>"u"?0:i.min,max:typeof i.max>"u"?360:i.max}}),this.hash=Yq,typeof e.hash=="function"&&(this.hash=e.hash),e.hash==="bkdr"&&(this.hash=Wq)}hsl(e){var n,r,i,o=this.hash(e),s=727;if(this.hueRanges.length){const l=this.hueRanges[o%this.hueRanges.length];n=o/this.hueRanges.length%s*(l.max-l.min)/s+l.min}else n=o%359;return o=Math.ceil(o/360),r=this.S[o%this.S.length],o=Math.ceil(o/this.S.length),i=this.L[o%this.L.length],[n,r,i]}rgb(e){var n=this.hsl(e);return Fq.apply(this,n)}hex(e){var n=this.rgb(e);return Uq(n)}}const zq=({path:t,docPresence:e})=>[Jt.fromClass(class{constructor(n){this.decorations=Dt.of([]);const r={};e.on("receive",(i,o)=>{o&&Gq(t,o)?r[i]=o:delete r[i];const s=[];for(const l of Object.keys(r)){const a=r[l],{start:u,end:c}=a,f=u[u.length-1],h=c[c.length-1],d=new qq().rgb(l),{username:p}=a;s.push({from:f,to:f,value:Ue.widget({side:-1,block:!1,widget:new Hq(""+Math.random(),d,p)})}),f!==h&&s.push({from:f,to:h,value:Ue.mark({class:"cm-json1-presence",attributes:{style:`
142
- background-color: rgba(${d}, 0.75);
143
- mix-blend-mode: luminosity;
144
- `}})})}this.decorations=Ue.set(s,!0),setTimeout(()=>{n.dispatch({annotations:[Vq.of(!0)]})},0)})}},{decorations:n=>n.decorations}),Kq],Vq=fo.define(),Gq=(t,e)=>{for(let n=0;n<t.length;n++)if(t[n]!==e.start[n])return!1;return!0};class Hq extends yi{constructor(e,n,r){super(),this.id=e,this.color=n,this.username=r}eq(e){return e.id===this.id}toDOM(){const e=document.createElement("span");e.setAttribute("aria-hidden","true"),e.className="cm-json1-presence";const n=document.createElement("div");e.appendChild(n),n.style.borderLeft=`1px solid rgba(${this.color})`;const r=document.createElement("div");return r.className="remote-cursor-username",r.style.top="-20px",r.style.height="20px",r.style.width=`${this.username.length*12}px`,r.style.backgroundColor=`rgba(${this.color})`,r.style.color="black",r.appendChild(document.createTextNode(this.username)),e.appendChild(r),this.timeout=window.setTimeout(()=>{r.style.opacity="0.3"},2e3),e}ignoreEvent(){return!1}}const Kq=$e.baseTheme({".cm-json1-presence":{position:"relative"},".cm-json1-presence > div":{position:"absolute",top:"0",bottom:"0",left:"0",right:"0"}}),DA=zn.define({create:()=>null,update:(t,e)=>{for(const n of e.effects)if(n.is(uy))return n.value;if(!t)return null;if(!e.changes.empty){const n=e.changes.mapPos(t.pos,-1,Un.TrackDel),r=e.changes.mapPos(t.pos+t.text.length,-1,Un.TrackDel);return n===null||r===null||e.newDoc.sliceString(n,r)!==t.text?null:Object.assign(Object.assign({},t),{pos:n})}return t},provide:t=>[$e.decorations.from(t,e=>{if(!e)return Ue.none;const n=e.pos,r=e.pos+e.text.length,i=e.rule.className;return Ue.set(Jq({className:i}).range(n,r))}),$e.contentAttributes.from(t,e=>!e||!e.rule.cursor?{style:""}:{style:`cursor: ${e.rule.cursor}`})]}),uy=Ot.define(),Jq=t=>{var e;return Ue.mark({class:`cm-interact ${(e=t==null?void 0:t.className)!==null&&e!==void 0?e:""}`})},e8=$e.theme({".cm-interact":{background:"rgba(128, 128, 255, 0.2)",borderRadius:"4px"}}),NA=je.define(),jA=je.define({combine:t=>t[t.length-1]}),t8=Jt.define(t=>({target:null,dragging:!1,mouseX:0,mouseY:0,getMatch(){const e=t.state.facet(NA),n=t.posAtCoords({x:this.mouseX,y:this.mouseY});if(!n)return null;const r=t.state.doc.lineAt(n),i=n-r.from;let o=null;for(const s of e)for(const l of r.text.matchAll(s.regexp)){if(l.index===void 0)continue;const a=l[0];if(!a)continue;const u=l.index,c=l.index+a.length;i<u||i>c||(!o||a.length<o.text.length)&&(o={rule:s,pos:r.from+u,text:a})}return o},updateText(e){return n=>{t.dispatch({effects:uy.of(Object.assign(Object.assign({},e),{text:n})),changes:{from:e.pos,to:e.pos+e.text.length,insert:n}})}},setTarget(e){this.target=e,t.dispatch({effects:uy.of(e)})},isModKeyDown(e){const n=t.state.facet(jA),r=!!window.navigator&&window.navigator.userAgent.includes("Macintosh");switch(n){case"alt":return e.altKey;case"shift":return e.shiftKey;case"ctrl":return e.ctrlKey;case"meta":return e.metaKey;case"mod":return r?e.metaKey:e.ctrlKey}throw new Error(`Invalid mod key: ${n}`)},update(e){const n=e.state.field(DA,!1);n!==void 0&&this.target!==n&&(this.target=n,n===null&&this.endDrag())},startDrag(e){this.dragging||this.target&&(this.dragging=!0,this.target.rule.onDragStart&&this.target.rule.onDragStart(this.target.text,this.updateText(this.target),e))},endDrag(){var e;this.dragging&&(this.dragging=!1,!((e=this.target)===null||e===void 0)&&e.rule.onDragEnd&&this.target.rule.onDragEnd(this.target.text,this.updateText(this.target)))}}),{eventHandlers:{mousedown(t,e){this.isModKeyDown(t)&&this.target&&(t.preventDefault(),this.target.rule.onClick&&this.target.rule.onClick(this.target.text,this.updateText(this.target),t),this.target.rule.onDrag&&this.startDrag(t))},mousemove(t,e){if(this.mouseX=t.clientX,this.mouseY=t.clientY,!this.isModKeyDown(t)){this.target&&this.setTarget(null);return}this.target&&this.dragging?this.target.rule.onDrag&&this.target.rule.onDrag(this.target.text,this.updateText(this.target),t):this.setTarget(this.getMatch())},mouseup(t,e){this.endDrag(),this.target&&!this.isModKeyDown(t)&&this.setTarget(null),this.isModKeyDown(t)&&this.setTarget(this.getMatch())},mouseleave(t,e){this.endDrag(),this.target&&this.setTarget(null)},keydown(t,e){!this.target&&this.isModKeyDown(t)&&this.setTarget(this.getMatch())},keyup(t,e){this.target&&!this.isModKeyDown(t)&&(this.endDrag(),this.setTarget(null))}}}),n8=(t={})=>{var e,n;return[DA,e8,t8,jA.of((e=t.key)!==null&&e!==void 0?e:"alt"),((n=t.rules)!==null&&n!==void 0?n:[]).map(r=>NA.of(r))]},r8=({onInteract:t})=>n8({rules:[{regexp:/["']\#([0-9]|[A-F]|[a-f]){6}["']/g,cursor:"pointer",onClick(e,n,r){var c,f;const i=/(?<quote>["'])(?<hex>\#([0-9]|[A-F]|[a-f]){6})\k<quote>/.exec(e),o=(c=i.groups)==null?void 0:c.hex,s=(f=i.groups)==null?void 0:f.quote,l=document.createElement("input");l.type="color",l.value=o.toLowerCase();const a=o.toUpperCase()===o,u=h=>{const d=h.target;t&&t(),d.value&&n(`${s}${a?d.value.toUpperCase():d.value}${s}`)};l.addEventListener("input",u),l.click()}},{regexp:new RegExp("(?<!\\#)-?\\b\\d+\\.?\\d*\\b","g"),cursor:"ew-resize",onDrag:(e,n,r)=>{t&&t();const i=Number(e)+r.movementX;isNaN(i)||n(i.toString())}},{regexp:/true|false/g,cursor:"pointer",onClick:(e,n)=>{switch(t&&t(),e){case"true":return n("false");case"false":return n("true")}}},{regexp:/vec2\(-?\b\d+\.?\d*\b\s*(,\s*-?\b\d+\.?\d*\b)?\)/g,cursor:"move",onDrag:(e,n,r)=>{var l,a;const i=/vec2\((?<x>-?\b\d+\.?\d*\b)\s*(,\s*(?<y>-?\b\d+\.?\d*\b))?\)/.exec(e),o=Number((l=i==null?void 0:i.groups)==null?void 0:l.x);let s=Number((a=i==null?void 0:i.groups)==null?void 0:a.y);isNaN(o)||(isNaN(s)&&(s=o),n(`vec2(${o+r.movementX}, ${s-r.movementY})`))}},{regexp:/rgb\(.*\)/g,cursor:"pointer",onClick:(e,n,r)=>{var c,f,h;const i=/rgb\((?<r>\d+)\s*,\s*(?<g>\d+)\s*,\s*(?<b>\d+)\)/.exec(e),o=Number((c=i==null?void 0:i.groups)==null?void 0:c.r),s=Number((f=i==null?void 0:i.groups)==null?void 0:f.g),l=Number((h=i==null?void 0:i.groups)==null?void 0:h.b),a=document.createElement("input");a.type="color",isNaN(o+s+l)||(a.value=o8(o,s,l));const u=d=>{const p=d.target;if(t&&t(),p.value){const[g,O,v]=i8(p.value);n(`rgb(${g}, ${O}, ${v})`)}a.removeEventListener("change",u)};a.addEventListener("change",u),a.click()}},{regexp:/https?:\/\/[^ "]+/g,cursor:"pointer",onClick:e=>{window.open(e)}},{regexp:/rotate\(-?\d*\.?\d*\)/g,cursor:"move",onDragStart(e,n,r){Gs={x:r.clientX,y:r.clientY}},onDrag(e,n,r){if(Gs==null)return;const i=Math.round(Math.atan2(Gs.y-r.clientY,r.clientX-Gs.x)*180/Math.PI);n(`rotate(${i})`);const o=new CustomEvent("updateRotateDrag",{detail:i});document.dispatchEvent(o)},onDragEnd(e,n){Gs=null}}]});let Gs=null;const i8=t=>{const e=parseInt(t.substring(1),16);return[e>>16&255,e>>8&255,e&255]},o8=(t,e,n)=>"#"+t.toString(16)+e.toString(16)+n.toString(16),s8=$e.baseTheme({".color-circle-parent":{display:"inline-block",cursor:"inherit"}}),l8=[Jt.fromClass(class{constructor(t){this.decorations=Dt.of([]),this.view=t}},{decorations:t=>{const e=[],n=t.view.state.doc.iter();let r=n.next(),i=0;for(;!r.done;){if(r.value===`
145
- `){i++,r=n.next();continue}const o=r.value.matchAll(/["']\#([0-9]|[A-F]|[a-f]){6}["']/g);let s=o.next();for(;!s.done;){const l=s.value;l.index+=i,e.push(l),s=o.next()}i+=r.value.length,r=n.next()}return Ue.set(e.map(o=>({from:o.index+9,to:o.index+9,value:Ue.widget({side:-1,widget:new a8(o[0])})})))}}),s8];class a8 extends yi{constructor(e){super(),this.color=e}eq(e){return e.color===this.color}toDOM(e){const n=document.createElement("div"),r=20,i=16;n.setAttribute("style",`width:${r}px;height:${r}px`),n.className="color-circle-parent";const o=document.createElementNS("http://www.w3.org/2000/svg","svg"),s=document.createElementNS("http://www.w3.org/2000/svg","circle");return s.setAttributeNS(null,"fill",this.color.replace(/["']/g,"")),s.setAttributeNS(null,"stroke","black"),s.setAttributeNS(null,"r",""+i/2),s.setAttributeNS(null,"cx",""+r/2),s.setAttributeNS(null,"cy",""+(r/2-1)),o.setAttributeNS(null,"width",""+r),o.setAttributeNS(null,"height",""+r),o.appendChild(s),n.appendChild(o),n}ignoreEvent(){return!1}}const u8=Jt.fromClass(class{constructor(t){this.showHighlight=!1,this.view=t}},{decorations:t=>{if(!t.showHighlight)return Ue.none;const e=[],n=t.view.state.doc.iter();let r=n.next(),i=0;for(;!r.done;){if(r.value===`
146
- `){i++,r=n.next();continue}const o=r.value.matchAll(new RegExp('\\"\\#([0-9]|[A-F]|[a-f]){6}\\"|rotate\\(-?\\d*\\.?\\d*\\)|https?:\\/\\/[^ "]+|vec2\\(-?\\b\\d+\\.?\\d*\\b\\s*(,\\s*-?\\b\\d+\\.?\\d*\\b)?\\)|true|false|(?<!\\#)-?\\b\\d+\\.?\\d*\\b|rgb\\(.*\\)',"dg"));let s=o.next();for(;!s.done;){const l=s.value;l.indices[0][0]+=i,l.indices[0][1]+=i,e.push(l),s=o.next()}i+=r.value.length,r=n.next()}return Ue.set(e.map(o=>({from:o.indices[0][0],to:o.indices[0][1],value:Ue.mark({class:"cm-interact "})})))},eventHandlers:{keydown(t,e){t.key=="Alt"&&(this.showHighlight=!0)},keyup(t,e){t.key=="Alt"&&(this.showHighlight=!1)}}}),c8=Jt.fromClass(class{constructor(t){this.view=t,this.textPosition=null,this.rotation=0,document.addEventListener("updateRotateDrag",e=>{this.textPosition=this.view.posAtCoords(Gs,!1),this.rotation=e.detail})}},{decorations:t=>Gs===null?Ue.none:Ue.set([{from:t.textPosition,to:t.textPosition,value:Ue.widget({side:-1,widget:new f8(t.rotation)})}])});class f8 extends yi{constructor(e){super(),this.angle=e}toDOM(e){const n=document.createElement("div");n.setAttribute("style","width:20px;height:20px"),n.className="color-circle-parent";const r=document.createElementNS("http://www.w3.org/2000/svg","svg"),i=document.createElementNS("http://www.w3.org/2000/svg","circle");i.setAttributeNS(null,"fill","#808080"),i.setAttributeNS(null,"r","5"),i.setAttributeNS(null,"cx","5"),i.setAttributeNS(null,"cy","5");const o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttributeNS(null,"x1","10"),o.setAttributeNS(null,"x2","5"),o.setAttributeNS(null,"y1","5"),o.setAttributeNS(null,"y2","5"),o.setAttributeNS(null,"stroke","black"),o.setAttributeNS(null,"transform",`rotate(${360-this.angle},5,5)`),r.setAttributeNS(null,"viewBox","0 0 10 10"),r.setAttributeNS(null,"width","20"),r.setAttributeNS(null,"height","20"),r.appendChild(i),r.appendChild(o),n.appendChild(r),n}ignoreEvent(){return!1}}const m1=()=>(Math.random()+"").slice(2),h8=({typeScriptWorker:t,fileName:e})=>async r=>{const i=m1(),o=r.state.doc.toString(),s={event:"autocomplete-request",fileName:e,fileContent:o,position:r.pos,requestId:i};if(o[r.pos-1]==='"'||o[r.pos-1]==="'"||o[r.pos-1]===";"||o[r.pos-1]==="("||o[r.pos-1]===")")return{from:r.pos,options:[]};t.postMessage(s);const l=await new Promise(c=>{t.onmessage=f=>{const h=f.data,{event:d,requestId:p,completions:g}=h;d==="post-completions"&&p===p&&c(g)}});if(!l)return{from:r.pos,options:[]};const a=r.matchBefore(/\w*/).from,u=r.matchBefore(/\w*/).text;return u&&(l.entries=l.entries.filter(c=>c.name.startsWith(u))),{from:r.pos,options:l.entries.map(c=>({label:c.name,apply:f=>{const h=r.pos+c.name.length-u.length;f.dispatch({changes:{from:a,to:r.pos,insert:c.name},selection:{anchor:h,head:h}})}}))}},d8=({typeScriptWorker:t,fileName:e,shareDBDoc:n,fileId:r})=>async()=>{const i=m1(),o=n.data.files[r].text,s={event:"lint-request",fileName:e,fileContent:o,requestId:i};return t.postMessage(s),await new Promise(a=>{t.onmessage=u=>{const c=u.data,{event:f,requestId:h,tsErrors:d}=c;f==="post-error-linter"&&h===h&&a(d)}})},p8=(()=>[_I(),EI(),zj(),N3(),jj(),Bj(),Mt.allowMultipleSelections.of(!0),a5(),T0(w5,{fallback:!0}),T5(),pU(),OQ({defaultKeymap:!1}),sI(),uI(),eI(),OY()])(),fd=()=>NQ({jsx:!0,typescript:!0}),g8={json:_4,tsx:fd,js:fd,jsx:fd,ts:fd,html:CA,css:vA,md:_q},W_=(t,e)=>{let n=t;for(const r of e){if(!n)return;n=n[r]}return n},m8=({fileId:t,shareDBDoc:e,filesPath:n,localPresence:r,docPresence:i,theme:o,onInteract:s,editorCache:l,usernameRef:a,typeScriptWorker:u})=>{if(l.has(t))return l.get(t);const c=e.data,f=[...n,t,"text"],h=[...n,t,"name"],d=W_(c,f),p=W_(c,h),g=p.split(".").pop();let O=new Ia;const v=[];v.push(Tq({shareDBDoc:e,path:f,json1:i0,textUnicode:sE})),r&&v.push(Zq({path:f,localPresence:r,usernameRef:a})),i&&v.push(zq({path:f,docPresence:i})),v.push(l8),v.push(p8),v.push(O.of(u$[o].value));const m=new Ia,S=(C=>{const w=g8[C];return w?w():void 0})(g);S?v.push(m.of(S)):(console.warn(`No language extension for file extension: ${g}`),v.push(m.of([]))),v.push(r8({onInteract:s})),v.push(u8),v.push(c8),v.push(OQ({override:[h8({typeScriptWorker:u,fileName:p})]})),v.push(DU(d8({typeScriptWorker:u,fileName:p,shareDBDoc:e,fileId:t}))),v.push(Dq({colors:{light:"#4d586b",dark:"#4d586b",activeLight:"#8e949f",activeDark:"#8e949f"}})),v.push(af.of(Lq.map(C=>(C.key==="Enter"&&delete C.shift,C))));const P={editor:new $e({state:Mt.create({doc:d,extensions:v})}),themeCompartment:O};return l.set(t,P),P},O8=({activeFileId:t,shareDBDoc:e,submitOperation:n,localPresence:r,docPresence:i,theme:o=c$,filesPath:s=["files"],editorCache:l,editorWantsFocus:a,editorNoLongerWantsFocus:u,username:c,typeScriptWorker:f})=>{const h=Z.useRef(null),d=Z.useRef(null),p=Z.useCallback(()=>{d.current?clearTimeout(d.current):n(v=>({...v,isInteracting:!0})),d.current=setTimeout(()=>{d.current=null,n(v=>({...v,isInteracting:!1}))},800)},[n]),g=Z.useRef(c);g.current=c;const O=Z.useMemo(()=>m8({fileId:t,shareDBDoc:e,filesPath:s,localPresence:r,docPresence:i,theme:o,onInteract:p,editorCache:l,usernameRef:g,typeScriptWorker:f}),[t,e,s,r,i,o,p,l,g,f]);return Z.useLayoutEffect(()=>{if(h.current&&e)return h.current.appendChild(O.editor.dom),()=>{h.current.removeChild(O.editor.dom)}},[e,O]),Z.useLayoutEffect(()=>{a&&(O.editor.focus(),u())},[a,O,u]),ee.jsx("div",{className:"vz-code-editor",ref:h})},v8=({errorMessage:t,content:e})=>{const[n,r]=Z.useState(!0);Z.useEffect(()=>{t!==null&&r(!0)},[t]),Z.useEffect(()=>{r(!1)},[e]);const i=Z.useCallback(()=>{r(!1)},[]);return Z.useEffect(()=>{const o=s=>{s.key==="Escape"&&i()};return document.addEventListener("keydown",o,!0),()=>{document.removeEventListener("keydown",o,!0)}},[i]),n&&t!==null?ee.jsxs("div",{className:"vz-code-error-overlay",children:[ee.jsx("pre",{children:t}),ee.jsx("div",{className:"bx bx-x error-dismiss-button",onClick:i})]}):null},B_=t=>{const[e]=t.split("-");return parseInt(e,36)},y8=(t,e)=>{const n=B_(t),r=B_(e);return n>r},S8=(t,e,n,r)=>{n.current.has(t)?n.current.set(t,e):(n.current.set(t,e),r(i=>[...i,{user:e,join:!0,presenceId:t}]))},b8=(t,e,n)=>{const r=e.current.get(t);r&&(e.current.delete(t),n(i=>[...i,{user:r,join:!1,presenceId:t}]))},w8=({docPresence:t,localPresence:e})=>{const[n,r]=Z.useState([]),i=Z.useRef(new Map);return Z.useEffect(()=>{if(t){const o=(s,l)=>{var u;const a=l!==null;if(y8(s,e.presenceId)){if(a){const f=(u=t.remotePresences[s])==null?void 0:u.username;S8(s,f,i,r)}else b8(s,i,r);const c=setTimeout(()=>{r(f=>f.slice(1))},5e3);return()=>{clearTimeout(c)}}};return t.on("receive",o),()=>{t.off("receive",o)}}},[t,e]),n.length>0?ee.jsx("div",{className:"vz-notification",children:n.map(({user:o,join:s,presenceId:l})=>ee.jsx("div",{className:"vz-notification-item",children:s?`${o} has joined the session.`:`${o} has left the session.`},l))}):null},k8=()=>ee.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[ee.jsx("path",{d:"M9.8132 15.9038L9 18.75L8.1868 15.9038C7.75968 14.4089 6.59112 13.2403 5.09619 12.8132L2.25 12L5.09619 11.1868C6.59113 10.7597 7.75968 9.59112 8.1868 8.09619L9 5.25L9.8132 8.09619C10.2403 9.59113 11.4089 10.7597 12.9038 11.1868L15.75 12L12.9038 12.8132C11.4089 13.2403 10.2403 14.4089 9.8132 15.9038Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),ee.jsx("path",{d:"M18.2589 8.71454L18 9.75L17.7411 8.71454C17.4388 7.50533 16.4947 6.56117 15.2855 6.25887L14.25 6L15.2855 5.74113C16.4947 5.43883 17.4388 4.49467 17.7411 3.28546L18 2.25L18.2589 3.28546C18.5612 4.49467 19.5053 5.43883 20.7145 5.74113L21.75 6L20.7145 6.25887C19.5053 6.56117 18.5612 7.50533 18.2589 8.71454Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),ee.jsx("path",{d:"M16.8942 20.5673L16.5 21.75L16.1058 20.5673C15.8818 19.8954 15.3546 19.3682 14.6827 19.1442L13.5 18.75L14.6827 18.3558C15.3546 18.1318 15.8818 17.6046 16.1058 16.9327L16.5 15.75L16.8942 16.9327C17.1182 17.6046 17.6454 18.1318 18.3173 18.3558L19.5 18.75L18.3173 19.1442C17.6454 19.3682 17.1182 19.8954 16.8942 20.5673Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),x8=100,_8=2e3,P8=(t,e=!0)=>{var i,o;const n=(i=t.name)==null?void 0:i.substring(0,x8).trim(),r=(e?(o=t.text)==null?void 0:o.substring(0,_8):t.text).trim();return["`"+n+"`:","```",r,"```"].join(`
147
- `)},C8="/ai-assist",E8=async({view:t,shareDBDoc:e,fileId:n,tabList:r,aiAssistEndpoint:i=C8,aiAssistOptions:o={},aiStreamId:s})=>{const l=e.data.files[n].name,a=t.state.sliceDoc(0,t.state.selection.main.from),u=t.state.sliceDoc(t.state.selection.main.to),c=a+"<FILL_ME>"+u,f={name:l,text:c},h=t.state.selection.main.to;let d=P8(f,!1);const g=await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...o,inputText:d,fileId:n,insertionCursor:h,aiStreamId:s})})).json();g.error&&console.error("[startAIAssist] error from server:",g.error)},T8=({activeFileId:t,shareDBDoc:e,editorCache:n,tabList:r,aiAssistEndpoint:i,aiAssistOptions:o,aiAssistTooltipText:s="Start AI Assist",aiAssistClickOverride:l})=>{const[a,u]=Z.useState(null),c=Z.useCallback(async()=>{if(!(a!==null)){const d=m1();u(d),await E8({view:n.get(t).editor,shareDBDoc:e,fileId:t,tabList:r,aiStreamId:d,aiAssistEndpoint:i,aiAssistOptions:o}),u(p=>p===d?null:p)}},[t,a]);return a===null&&ee.jsx("div",{className:"vz-code-ai-assist-widget",children:ee.jsx(f3,{placement:"top",overlay:ee.jsx(l3,{id:"ai-assist-widget-tooltip",children:s}),children:ee.jsx(Uc,{onClick:l||c,children:a?null:ee.jsx(k8,{})})})})},$8=({enableAIAssist:t=!0,aiAssistEndpoint:e,aiAssistOptions:n,aiAssistTooltipText:r,aiAssistClickOverride:i})=>{const{codeEditorWidth:o}=Z.useContext(lg),{content:s,shareDBDoc:l,submitOperation:a,localPresence:u,docPresence:c,files:f,createFile:h,activeFileId:d,setActiveFileId:p,tabList:g,openTab:O,closeTabs:v,theme:m,username:y,editorCache:S,editorWantsFocus:k,editorNoLongerWantsFocus:P,errorMessage:C,typeScriptWorker:w}=Z.useContext(df),[x,_]=Z.useState(!1);return Z.useEffect(()=>{_(!0)},[]),d!==null?ee.jsxs("div",{className:"middle",style:{width:o+"px"},children:[ee.jsx(x3,{files:f,tabList:g,activeFileId:d,setActiveFileId:p,openTab:O,closeTabs:v,createFile:h}),x&&s&&d&&ee.jsx(O8,{shareDBDoc:l,submitOperation:a,localPresence:u,docPresence:c,activeFileId:d,theme:m,editorCache:S,editorWantsFocus:k,editorNoLongerWantsFocus:P,username:y,typeScriptWorker:w}),x&&t&&s&&d?ee.jsx(T8,{activeFileId:d,shareDBDoc:l,editorCache:S,tabList:g,aiAssistEndpoint:e,aiAssistOptions:n,aiAssistTooltipText:r,aiAssistClickOverride:i}):null,ee.jsx(v8,{errorMessage:C,content:s}),ee.jsx(w8,{docPresence:c,localPresence:u})]}):null},R8=()=>ee.jsx("div",{className:"right",children:null}),Q8=new gD,A8=new mD;iE.types.register(i0.type);const{Connection:M8}=iE,D8=window.location.protocol==="https:"?"wss://":"ws://",N8=new WebSocket(D8+window.location.host+"/ws"),j8=new M8(N8),I8=()=>{const{username:t}=Z.useContext(df);return yZ(t),null};function L8(){const{shareDBDoc:t,content:e,localPresence:n,docPresence:r,submitOperation:i}=cB({connection:j8}),o=vZ();return ee.jsx(bD,{children:ee.jsxs(dZ,{content:e,shareDBDoc:t,submitOperation:i,localPresence:n,docPresence:r,prettierWorker:Q8,typeScriptWorker:A8,initialUsername:o,children:[ee.jsxs("div",{className:"app",children:[ee.jsx(b3,{}),ee.jsx($8,{}),ee.jsx(R8,{}),ee.jsx(dw,{side:"left"}),ee.jsx(dw,{side:"right"})]}),ee.jsx(I8,{})]})})}nE(document.getElementById("root")).render(ee.jsx(aZ,{children:ee.jsx(L8,{})}));