spytial-core 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/integrated-demo-components.css +1 -1
- package/dist/components/integrated-demo-components.css.map +1 -1
- package/dist/components/integrated-demo-components.global.js +131 -131
- package/dist/components/integrated-demo-components.global.js.map +1 -1
- package/dist/components/react-component-integration.css +1 -1
- package/dist/components/react-component-integration.css.map +1 -1
- package/dist/components/react-component-integration.global.js +145 -145
- package/dist/components/react-component-integration.global.js.map +1 -1
- package/dist/components/spec-editor-demo-components.css +1 -1
- package/dist/components/spec-editor-demo-components.css.map +1 -1
- package/dist/components/spec-editor-demo-components.global.js +137 -137
- package/dist/components/spec-editor-demo-components.global.js.map +1 -1
- package/dist/react.css +141 -0
- package/dist/react.mjs +149 -21
- package/dist/react.mjs.map +1 -1
- package/dist/types/components/CndLayoutInterface.d.ts +7 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/spec-editor/domain/layout-assistant.d.ts +63 -0
- package/dist/types/spec-editor/index.d.ts +3 -0
- package/dist/types/spec-editor/ui/SpecEditor.d.ts +11 -0
- package/dist/types/spec-editor/ui/SuggestionsPanel.d.ts +18 -0
- package/dist/types/spec-editor/ui/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,206 +1,206 @@
|
|
|
1
|
-
"use strict";var IntegratedDemo=(()=>{var _4=Object.create;var Tf=Object.defineProperty;var L4=Object.getOwnPropertyDescriptor;var I4=Object.getOwnPropertyNames;var B4=Object.getPrototypeOf,q4=Object.prototype.hasOwnProperty;var xx=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),P4=(t,e)=>{for(var n in e)Tf(t,n,{get:e[n],enumerable:!0})},wx=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of I4(e))!q4.call(t,r)&&r!==n&&Tf(t,r,{get:()=>e[r],enumerable:!(i=L4(e,r))||i.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?_4(B4(t)):{},wx(e||!t||!t.__esModule?Tf(n,"default",{value:t,enumerable:!0}):n,t)),z4=t=>wx(Tf({},"__esModule",{value:!0}),t);var Lx=x(X=>{"use strict";var Zm=Symbol.for("react.transitional.element"),H4=Symbol.for("react.portal"),U4=Symbol.for("react.fragment"),F4=Symbol.for("react.strict_mode"),j4=Symbol.for("react.profiler"),V4=Symbol.for("react.consumer"),$4=Symbol.for("react.context"),Y4=Symbol.for("react.forward_ref"),K4=Symbol.for("react.suspense"),G4=Symbol.for("react.memo"),Ex=Symbol.for("react.lazy"),kx=Symbol.iterator;function Q4(t){return t===null||typeof t!="object"?null:(t=kx&&t[kx]||t["@@iterator"],typeof t=="function"?t:null)}var Dx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mx=Object.assign,Rx={};function _o(t,e,n){this.props=t,this.context=e,this.refs=Rx,this.updater=n||Dx}_o.prototype.isReactComponent={};_o.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};_o.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Nx(){}Nx.prototype=_o.prototype;function Jm(t,e,n){this.props=t,this.context=e,this.refs=Rx,this.updater=n||Dx}var eg=Jm.prototype=new Nx;eg.constructor=Jm;Mx(eg,_o.prototype);eg.isPureReactComponent=!0;var Ax=Array.isArray,Ie={H:null,A:null,T:null,S:null,V:null},_x=Object.prototype.hasOwnProperty;function tg(t,e,n,i,r,s){return n=s.ref,{$$typeof:Zm,type:t,key:e,ref:n!==void 0?n:null,props:s}}function X4(t,e){return tg(t.type,e,void 0,void 0,void 0,t.props)}function ng(t){return typeof t=="object"&&t!==null&&t.$$typeof===Zm}function W4(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Ox=/\/+/g;function Wm(t,e){return typeof t=="object"&&t!==null&&t.key!=null?W4(""+t.key):e.toString(36)}function Tx(){}function Z4(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(Tx,Tx):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function No(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Zm:case H4:o=!0;break;case Ex:return o=t._init,No(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+Wm(t,0):i,Ax(r)?(n="",o!=null&&(n=o.replace(Ox,"$&/")+"/"),No(r,e,n,"",function(c){return c})):r!=null&&(ng(r)&&(r=X4(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(Ox,"$&/")+"/")+o)),e.push(r)),1;o=0;var l=i===""?".":i+":";if(Ax(t))for(var a=0;a<t.length;a++)i=t[a],s=l+Wm(i,a),o+=No(i,e,n,s,r);else if(a=Q4(t),typeof a=="function")for(t=a.call(t),a=0;!(i=t.next()).done;)i=i.value,s=l+Wm(i,a++),o+=No(i,e,n,s,r);else if(s==="object"){if(typeof t.then=="function")return No(Z4(t),e,n,i,r);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 o}function Cf(t,e,n){if(t==null)return t;var i=[],r=0;return No(t,i,"","",function(s){return e.call(n,s,r++)}),i}function J4(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 Cx=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function e5(){}X.Children={map:Cf,forEach:function(t,e,n){Cf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Cf(t,function(){e++}),e},toArray:function(t){return Cf(t,function(e){return e})||[]},only:function(t){if(!ng(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};X.Component=_o;X.Fragment=U4;X.Profiler=j4;X.PureComponent=Jm;X.StrictMode=F4;X.Suspense=K4;X.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ie;X.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Ie.H.useMemoCache(t)}};X.cache=function(t){return function(){return t.apply(null,arguments)}};X.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=Mx({},t.props),r=t.key,s=void 0;if(e!=null)for(o in e.ref!==void 0&&(s=void 0),e.key!==void 0&&(r=""+e.key),e)!_x.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];i.children=l}return tg(t.type,r,void 0,void 0,s,i)};X.createContext=function(t){return t={$$typeof:$4,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:V4,_context:t},t};X.createElement=function(t,e,n){var i,r={},s=null;if(e!=null)for(i in e.key!==void 0&&(s=""+e.key),e)_x.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];r.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return tg(t,s,void 0,void 0,null,r)};X.createRef=function(){return{current:null}};X.forwardRef=function(t){return{$$typeof:Y4,render:t}};X.isValidElement=ng;X.lazy=function(t){return{$$typeof:Ex,_payload:{_status:-1,_result:t},_init:J4}};X.memo=function(t,e){return{$$typeof:G4,type:t,compare:e===void 0?null:e}};X.startTransition=function(t){var e=Ie.T,n={};Ie.T=n;try{var i=t(),r=Ie.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(e5,Cx)}catch(s){Cx(s)}finally{Ie.T=e}};X.unstable_useCacheRefresh=function(){return Ie.H.useCacheRefresh()};X.use=function(t){return Ie.H.use(t)};X.useActionState=function(t,e,n){return Ie.H.useActionState(t,e,n)};X.useCallback=function(t,e){return Ie.H.useCallback(t,e)};X.useContext=function(t){return Ie.H.useContext(t)};X.useDebugValue=function(){};X.useDeferredValue=function(t,e){return Ie.H.useDeferredValue(t,e)};X.useEffect=function(t,e,n){var i=Ie.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};X.useId=function(){return Ie.H.useId()};X.useImperativeHandle=function(t,e,n){return Ie.H.useImperativeHandle(t,e,n)};X.useInsertionEffect=function(t,e){return Ie.H.useInsertionEffect(t,e)};X.useLayoutEffect=function(t,e){return Ie.H.useLayoutEffect(t,e)};X.useMemo=function(t,e){return Ie.H.useMemo(t,e)};X.useOptimistic=function(t,e){return Ie.H.useOptimistic(t,e)};X.useReducer=function(t,e,n){return Ie.H.useReducer(t,e,n)};X.useRef=function(t){return Ie.H.useRef(t)};X.useState=function(t){return Ie.H.useState(t)};X.useSyncExternalStore=function(t,e,n){return Ie.H.useSyncExternalStore(t,e,n)};X.useTransition=function(){return Ie.H.useTransition()};X.version="19.1.0"});var On=x((Yre,Ix)=>{"use strict";Ix.exports=Lx()});var $x=x(Be=>{"use strict";function og(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<Ef(r,e))t[i]=e,t[n]=r,n=i;else break e}}function yi(t){return t.length===0?null:t[0]}function Mf(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,s=r>>>1;i<s;){var o=2*(i+1)-1,l=t[o],a=o+1,c=t[a];if(0>Ef(l,n))a<r&&0>Ef(c,l)?(t[i]=c,t[a]=n,i=a):(t[i]=l,t[o]=n,i=o);else if(a<r&&0>Ef(c,n))t[i]=c,t[a]=n,i=a;else break e}}return e}function Ef(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Be.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(Bx=performance,Be.unstable_now=function(){return Bx.now()}):(ig=Date,qx=ig.now(),Be.unstable_now=function(){return ig.now()-qx});var Bx,ig,qx,Ki=[],Tr=[],t5=1,Tn=null,kt=3,lg=!1,Na=!1,_a=!1,ag=!1,Hx=typeof setTimeout=="function"?setTimeout:null,Ux=typeof clearTimeout=="function"?clearTimeout:null,Px=typeof setImmediate<"u"?setImmediate:null;function Df(t){for(var e=yi(Tr);e!==null;){if(e.callback===null)Mf(Tr);else if(e.startTime<=t)Mf(Tr),e.sortIndex=e.expirationTime,og(Ki,e);else break;e=yi(Tr)}}function cg(t){if(_a=!1,Df(t),!Na)if(yi(Ki)!==null)Na=!0,Io||(Io=!0,Lo());else{var e=yi(Tr);e!==null&&ug(cg,e.startTime-t)}}var Io=!1,La=-1,Fx=5,jx=-1;function Vx(){return ag?!0:!(Be.unstable_now()-jx<Fx)}function rg(){if(ag=!1,Io){var t=Be.unstable_now();jx=t;var e=!0;try{e:{Na=!1,_a&&(_a=!1,Ux(La),La=-1),lg=!0;var n=kt;try{t:{for(Df(t),Tn=yi(Ki);Tn!==null&&!(Tn.expirationTime>t&&Vx());){var i=Tn.callback;if(typeof i=="function"){Tn.callback=null,kt=Tn.priorityLevel;var r=i(Tn.expirationTime<=t);if(t=Be.unstable_now(),typeof r=="function"){Tn.callback=r,Df(t),e=!0;break t}Tn===yi(Ki)&&Mf(Ki),Df(t)}else Mf(Ki);Tn=yi(Ki)}if(Tn!==null)e=!0;else{var s=yi(Tr);s!==null&&ug(cg,s.startTime-t),e=!1}}break e}finally{Tn=null,kt=n,lg=!1}e=void 0}}finally{e?Lo():Io=!1}}}var Lo;typeof Px=="function"?Lo=function(){Px(rg)}:typeof MessageChannel<"u"?(sg=new MessageChannel,zx=sg.port2,sg.port1.onmessage=rg,Lo=function(){zx.postMessage(null)}):Lo=function(){Hx(rg,0)};var sg,zx;function ug(t,e){La=Hx(function(){t(Be.unstable_now())},e)}Be.unstable_IdlePriority=5;Be.unstable_ImmediatePriority=1;Be.unstable_LowPriority=4;Be.unstable_NormalPriority=3;Be.unstable_Profiling=null;Be.unstable_UserBlockingPriority=2;Be.unstable_cancelCallback=function(t){t.callback=null};Be.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Fx=0<t?Math.floor(1e3/t):5};Be.unstable_getCurrentPriorityLevel=function(){return kt};Be.unstable_next=function(t){switch(kt){case 1:case 2:case 3:var e=3;break;default:e=kt}var n=kt;kt=e;try{return t()}finally{kt=n}};Be.unstable_requestPaint=function(){ag=!0};Be.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=kt;kt=t;try{return e()}finally{kt=n}};Be.unstable_scheduleCallback=function(t,e,n){var i=Be.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:t5++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,og(Tr,t),yi(Ki)===null&&t===yi(Tr)&&(_a?(Ux(La),La=-1):_a=!0,ug(cg,n-i))):(t.sortIndex=r,og(Ki,t),Na||lg||(Na=!0,Io||(Io=!0,Lo()))),t};Be.unstable_shouldYield=Vx;Be.unstable_wrapCallback=function(t){var e=kt;return function(){var n=kt;kt=e;try{return t.apply(this,arguments)}finally{kt=n}}}});var Kx=x((Gre,Yx)=>{"use strict";Yx.exports=$x()});var Qx=x(Bt=>{"use strict";var n5=On();function Gx(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function Cr(){}var It={d:{f:Cr,r:function(){throw Error(Gx(522))},D:Cr,C:Cr,L:Cr,m:Cr,X:Cr,S:Cr,M:Cr},p:0,findDOMNode:null},i5=Symbol.for("react.portal");function r5(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i5,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Ia=n5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Rf(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}Bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=It;Bt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(Gx(299));return r5(t,e,null,n)};Bt.flushSync=function(t){var e=Ia.T,n=It.p;try{if(Ia.T=null,It.p=2,t)return t()}finally{Ia.T=e,It.p=n,It.d.f()}};Bt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,It.d.C(t,e))};Bt.prefetchDNS=function(t){typeof t=="string"&&It.d.D(t)};Bt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Rf(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?It.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:s}):n==="script"&&It.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};Bt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Rf(e.as,e.crossOrigin);It.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&It.d.M(t)};Bt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Rf(n,e.crossOrigin);It.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};Bt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Rf(e.as,e.crossOrigin);It.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else It.d.m(t)};Bt.requestFormReset=function(t){It.d.r(t)};Bt.unstable_batchedUpdates=function(t,e){return t(e)};Bt.useFormState=function(t,e,n){return Ia.H.useFormState(t,e,n)};Bt.useFormStatus=function(){return Ia.H.useHostTransitionStatus()};Bt.version="19.1.0"});var Zx=x((Xre,Wx)=>{"use strict";function Xx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Xx)}catch(t){console.error(t)}}Xx(),Wx.exports=Qx()});var eT=x(Jh=>{"use strict";var st=Kx(),Sk=On(),s5=Zx();function D(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function xk(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function wc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function wk(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 Jx(t){if(wc(t)!==t)throw Error(D(188))}function o5(t){var e=t.alternate;if(!e){if(e=wc(t),e===null)throw Error(D(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Jx(r),t;if(s===i)return Jx(r),e;s=s.sibling}throw Error(D(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(D(189))}}if(n.alternate!==i)throw Error(D(190))}if(n.tag!==3)throw Error(D(188));return n.stateNode.current===n?t:e}function kk(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=kk(t),e!==null)return e;t=t.sibling}return null}var Ne=Object.assign,l5=Symbol.for("react.element"),Nf=Symbol.for("react.transitional.element"),Va=Symbol.for("react.portal"),Fo=Symbol.for("react.fragment"),Ak=Symbol.for("react.strict_mode"),Fg=Symbol.for("react.profiler"),a5=Symbol.for("react.provider"),Ok=Symbol.for("react.consumer"),Zi=Symbol.for("react.context"),qy=Symbol.for("react.forward_ref"),jg=Symbol.for("react.suspense"),Vg=Symbol.for("react.suspense_list"),Py=Symbol.for("react.memo"),Mr=Symbol.for("react.lazy"),$g=Symbol.for("react.activity"),c5=Symbol.for("react.memo_cache_sentinel"),ew=Symbol.iterator;function Ba(t){return t===null||typeof t!="object"?null:(t=ew&&t[ew]||t["@@iterator"],typeof t=="function"?t:null)}var u5=Symbol.for("react.client.reference");function Yg(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===u5?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Fo:return"Fragment";case Fg:return"Profiler";case Ak:return"StrictMode";case jg:return"Suspense";case Vg:return"SuspenseList";case $g:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Va:return"Portal";case Zi:return(t.displayName||"Context")+".Provider";case Ok:return(t._context.displayName||"Context")+".Consumer";case qy:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Py:return e=t.displayName||null,e!==null?e:Yg(t.type)||"Memo";case Mr:e=t._payload,t=t._init;try{return Yg(t(e))}catch{}}return null}var $a=Array.isArray,V=Sk.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me=s5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ls={pending:!1,data:null,method:null,action:null},Kg=[],jo=-1;function Ai(t){return{current:t}}function dt(t){0>jo||(t.current=Kg[jo],Kg[jo]=null,jo--)}function Pe(t,e){jo++,Kg[jo]=t.current,t.current=e}var xi=Ai(null),ac=Ai(null),Hr=Ai(null),ah=Ai(null);function ch(t,e){switch(Pe(Hr,e),Pe(ac,t),Pe(xi,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?ok(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=ok(e),t=FO(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}dt(xi),Pe(xi,t)}function al(){dt(xi),dt(ac),dt(Hr)}function Gg(t){t.memoizedState!==null&&Pe(ah,t);var e=xi.current,n=FO(e,t.type);e!==n&&(Pe(ac,t),Pe(xi,n))}function uh(t){ac.current===t&&(dt(xi),dt(ac)),ah.current===t&&(dt(ah),bc._currentValue=Ls)}var Qg=Object.prototype.hasOwnProperty,zy=st.unstable_scheduleCallback,fg=st.unstable_cancelCallback,f5=st.unstable_shouldYield,h5=st.unstable_requestPaint,wi=st.unstable_now,d5=st.unstable_getCurrentPriorityLevel,Tk=st.unstable_ImmediatePriority,Ck=st.unstable_UserBlockingPriority,fh=st.unstable_NormalPriority,p5=st.unstable_LowPriority,Ek=st.unstable_IdlePriority,m5=st.log,g5=st.unstable_setDisableYieldValue,kc=null,un=null;function Br(t){if(typeof m5=="function"&&g5(t),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(kc,t)}catch{}}var fn=Math.clz32?Math.clz32:v5,y5=Math.log,b5=Math.LN2;function v5(t){return t>>>=0,t===0?32:31-(y5(t)/b5|0)|0}var _f=256,Lf=4194304;function Rs(t){var e=t&42;if(e!==0)return e;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Ph(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,s=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=Rs(i):(o&=l,o!==0?r=Rs(o):n||(n=l&~t,n!==0&&(r=Rs(n))))):(l=i&~s,l!==0?r=Rs(l):o!==0?r=Rs(o):n||(n=i&~t,n!==0&&(r=Rs(n)))),r===0?0:e!==0&&e!==r&&(e&s)===0&&(s=r&-r,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:r}function Ac(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function S5(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dk(){var t=_f;return _f<<=1,(_f&4194048)===0&&(_f=256),t}function Mk(){var t=Lf;return Lf<<=1,(Lf&62914560)===0&&(Lf=4194304),t}function hg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Oc(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function x5(t,e,n,i,r,s){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var l=t.entanglements,a=t.expirationTimes,c=t.hiddenUpdates;for(n=o&~n;0<n;){var u=31-fn(n),f=1<<u;l[u]=0,a[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var d=h[u];d!==null&&(d.lane&=-536870913)}n&=~f}i!==0&&Rk(t,i,0),s!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=s&~(o&~e))}function Rk(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-fn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function Nk(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-fn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function Hy(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Uy(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function _k(){var t=me.p;return t!==0?t:(t=window.event,t===void 0?32:ZO(t.type))}function w5(t,e){var n=me.p;try{return me.p=t,e()}finally{me.p=n}}var Wr=Math.random().toString(36).slice(2),At="__reactFiber$"+Wr,Zt="__reactProps$"+Wr,vl="__reactContainer$"+Wr,Xg="__reactEvents$"+Wr,k5="__reactListeners$"+Wr,A5="__reactHandles$"+Wr,tw="__reactResources$"+Wr,Tc="__reactMarker$"+Wr;function Fy(t){delete t[At],delete t[Zt],delete t[Xg],delete t[k5],delete t[A5]}function Vo(t){var e=t[At];if(e)return e;for(var n=t.parentNode;n;){if(e=n[vl]||n[At]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=ck(t);t!==null;){if(n=t[At])return n;t=ck(t)}return e}t=n,n=t.parentNode}return null}function Sl(t){if(t=t[At]||t[vl]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function Ya(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(D(33))}function el(t){var e=t[tw];return e||(e=t[tw]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ft(t){t[Tc]=!0}var Lk=new Set,Ik={};function $s(t,e){cl(t,e),cl(t+"Capture",e)}function cl(t,e){for(Ik[t]=e,t=0;t<e.length;t++)Lk.add(e[t])}var O5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),nw={},iw={};function T5(t){return Qg.call(iw,t)?!0:Qg.call(nw,t)?!1:O5.test(t)?iw[t]=!0:(nw[t]=!0,!1)}function Qf(t,e,n){if(T5(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function If(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function Gi(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var dg,rw;function zo(t){if(dg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);dg=e&&e[1]||"",rw=-1<n.stack.indexOf(`
|
|
1
|
+
"use strict";var IntegratedDemo=(()=>{var F4=Object.create;var Rf=Object.defineProperty;var j4=Object.getOwnPropertyDescriptor;var V4=Object.getOwnPropertyNames;var $4=Object.getPrototypeOf,Y4=Object.prototype.hasOwnProperty;var Ex=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),K4=(t,e)=>{for(var n in e)Rf(t,n,{get:e[n],enumerable:!0})},Dx=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of V4(e))!Y4.call(t,r)&&r!==n&&Rf(t,r,{get:()=>e[r],enumerable:!(i=j4(e,r))||i.enumerable});return t};var be=(t,e,n)=>(n=t!=null?F4($4(t)):{},Dx(e||!t||!t.__esModule?Rf(n,"default",{value:t,enumerable:!0}):n,t)),G4=t=>Dx(Rf({},"__esModule",{value:!0}),t);var Ux=x(W=>{"use strict";var ng=Symbol.for("react.transitional.element"),Q4=Symbol.for("react.portal"),X4=Symbol.for("react.fragment"),W4=Symbol.for("react.strict_mode"),Z4=Symbol.for("react.profiler"),J4=Symbol.for("react.consumer"),e5=Symbol.for("react.context"),t5=Symbol.for("react.forward_ref"),n5=Symbol.for("react.suspense"),i5=Symbol.for("react.memo"),Ix=Symbol.for("react.lazy"),Mx=Symbol.iterator;function r5(t){return t===null||typeof t!="object"?null:(t=Mx&&t[Mx]||t["@@iterator"],typeof t=="function"?t:null)}var Bx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qx=Object.assign,Px={};function Ho(t,e,n){this.props=t,this.context=e,this.refs=Px,this.updater=n||Bx}Ho.prototype.isReactComponent={};Ho.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Ho.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function zx(){}zx.prototype=Ho.prototype;function ig(t,e,n){this.props=t,this.context=e,this.refs=Px,this.updater=n||Bx}var rg=ig.prototype=new zx;rg.constructor=ig;qx(rg,Ho.prototype);rg.isPureReactComponent=!0;var Rx=Array.isArray,Ie={H:null,A:null,T:null,S:null,V:null},Hx=Object.prototype.hasOwnProperty;function sg(t,e,n,i,r,s){return n=s.ref,{$$typeof:ng,type:t,key:e,ref:n!==void 0?n:null,props:s}}function s5(t,e){return sg(t.type,e,void 0,void 0,void 0,t.props)}function og(t){return typeof t=="object"&&t!==null&&t.$$typeof===ng}function o5(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Nx=/\/+/g;function tg(t,e){return typeof t=="object"&&t!==null&&t.key!=null?o5(""+t.key):e.toString(36)}function _x(){}function l5(t){switch(t.status){case"fulfilled":return t.value;case"rejected":throw t.reason;default:switch(typeof t.status=="string"?t.then(_x,_x):(t.status="pending",t.then(function(e){t.status==="pending"&&(t.status="fulfilled",t.value=e)},function(e){t.status==="pending"&&(t.status="rejected",t.reason=e)})),t.status){case"fulfilled":return t.value;case"rejected":throw t.reason}}throw t}function zo(t,e,n,i,r){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"bigint":case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case ng:case Q4:o=!0;break;case Ix:return o=t._init,zo(o(t._payload),e,n,i,r)}}if(o)return r=r(t),o=i===""?"."+tg(t,0):i,Rx(r)?(n="",o!=null&&(n=o.replace(Nx,"$&/")+"/"),zo(r,e,n,"",function(c){return c})):r!=null&&(og(r)&&(r=s5(r,n+(r.key==null||t&&t.key===r.key?"":(""+r.key).replace(Nx,"$&/")+"/")+o)),e.push(r)),1;o=0;var l=i===""?".":i+":";if(Rx(t))for(var a=0;a<t.length;a++)i=t[a],s=l+tg(i,a),o+=zo(i,e,n,s,r);else if(a=r5(t),typeof a=="function")for(t=a.call(t),a=0;!(i=t.next()).done;)i=i.value,s=l+tg(i,a++),o+=zo(i,e,n,s,r);else if(s==="object"){if(typeof t.then=="function")return zo(l5(t),e,n,i,r);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 o}function Nf(t,e,n){if(t==null)return t;var i=[],r=0;return zo(t,i,"","",function(s){return e.call(n,s,r++)}),i}function a5(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 Lx=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function c5(){}W.Children={map:Nf,forEach:function(t,e,n){Nf(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return Nf(t,function(){e++}),e},toArray:function(t){return Nf(t,function(e){return e})||[]},only:function(t){if(!og(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};W.Component=Ho;W.Fragment=X4;W.Profiler=Z4;W.PureComponent=ig;W.StrictMode=W4;W.Suspense=n5;W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ie;W.__COMPILER_RUNTIME={__proto__:null,c:function(t){return Ie.H.useMemoCache(t)}};W.cache=function(t){return function(){return t.apply(null,arguments)}};W.cloneElement=function(t,e,n){if(t==null)throw Error("The argument must be a React element, but you passed "+t+".");var i=qx({},t.props),r=t.key,s=void 0;if(e!=null)for(o in e.ref!==void 0&&(s=void 0),e.key!==void 0&&(r=""+e.key),e)!Hx.call(e,o)||o==="key"||o==="__self"||o==="__source"||o==="ref"&&e.ref===void 0||(i[o]=e[o]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];i.children=l}return sg(t.type,r,void 0,void 0,s,i)};W.createContext=function(t){return t={$$typeof:e5,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null},t.Provider=t,t.Consumer={$$typeof:J4,_context:t},t};W.createElement=function(t,e,n){var i,r={},s=null;if(e!=null)for(i in e.key!==void 0&&(s=""+e.key),e)Hx.call(e,i)&&i!=="key"&&i!=="__self"&&i!=="__source"&&(r[i]=e[i]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var l=Array(o),a=0;a<o;a++)l[a]=arguments[a+2];r.children=l}if(t&&t.defaultProps)for(i in o=t.defaultProps,o)r[i]===void 0&&(r[i]=o[i]);return sg(t,s,void 0,void 0,null,r)};W.createRef=function(){return{current:null}};W.forwardRef=function(t){return{$$typeof:t5,render:t}};W.isValidElement=og;W.lazy=function(t){return{$$typeof:Ix,_payload:{_status:-1,_result:t},_init:a5}};W.memo=function(t,e){return{$$typeof:i5,type:t,compare:e===void 0?null:e}};W.startTransition=function(t){var e=Ie.T,n={};Ie.T=n;try{var i=t(),r=Ie.S;r!==null&&r(n,i),typeof i=="object"&&i!==null&&typeof i.then=="function"&&i.then(c5,Lx)}catch(s){Lx(s)}finally{Ie.T=e}};W.unstable_useCacheRefresh=function(){return Ie.H.useCacheRefresh()};W.use=function(t){return Ie.H.use(t)};W.useActionState=function(t,e,n){return Ie.H.useActionState(t,e,n)};W.useCallback=function(t,e){return Ie.H.useCallback(t,e)};W.useContext=function(t){return Ie.H.useContext(t)};W.useDebugValue=function(){};W.useDeferredValue=function(t,e){return Ie.H.useDeferredValue(t,e)};W.useEffect=function(t,e,n){var i=Ie.H;if(typeof n=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return i.useEffect(t,e)};W.useId=function(){return Ie.H.useId()};W.useImperativeHandle=function(t,e,n){return Ie.H.useImperativeHandle(t,e,n)};W.useInsertionEffect=function(t,e){return Ie.H.useInsertionEffect(t,e)};W.useLayoutEffect=function(t,e){return Ie.H.useLayoutEffect(t,e)};W.useMemo=function(t,e){return Ie.H.useMemo(t,e)};W.useOptimistic=function(t,e){return Ie.H.useOptimistic(t,e)};W.useReducer=function(t,e,n){return Ie.H.useReducer(t,e,n)};W.useRef=function(t){return Ie.H.useRef(t)};W.useState=function(t){return Ie.H.useState(t)};W.useSyncExternalStore=function(t,e,n){return Ie.H.useSyncExternalStore(t,e,n)};W.useTransition=function(){return Ie.H.useTransition()};W.version="19.1.0"});var Cn=x((nse,Fx)=>{"use strict";Fx.exports=Ux()});var Zx=x(Be=>{"use strict";function ug(t,e){var n=t.length;t.push(e);e:for(;0<n;){var i=n-1>>>1,r=t[i];if(0<_f(r,e))t[i]=e,t[n]=r,n=i;else break e}}function xi(t){return t.length===0?null:t[0]}function If(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var i=0,r=t.length,s=r>>>1;i<s;){var o=2*(i+1)-1,l=t[o],a=o+1,c=t[a];if(0>_f(l,n))a<r&&0>_f(c,l)?(t[i]=c,t[a]=n,i=a):(t[i]=l,t[o]=n,i=o);else if(a<r&&0>_f(c,n))t[i]=c,t[a]=n,i=a;else break e}}return e}function _f(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}Be.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(jx=performance,Be.unstable_now=function(){return jx.now()}):(lg=Date,Vx=lg.now(),Be.unstable_now=function(){return lg.now()-Vx});var jx,lg,Vx,Zi=[],Nr=[],u5=1,En=null,Tt=3,fg=!1,qa=!1,Pa=!1,hg=!1,Kx=typeof setTimeout=="function"?setTimeout:null,Gx=typeof clearTimeout=="function"?clearTimeout:null,$x=typeof setImmediate<"u"?setImmediate:null;function Lf(t){for(var e=xi(Nr);e!==null;){if(e.callback===null)If(Nr);else if(e.startTime<=t)If(Nr),e.sortIndex=e.expirationTime,ug(Zi,e);else break;e=xi(Nr)}}function dg(t){if(Pa=!1,Lf(t),!qa)if(xi(Zi)!==null)qa=!0,Fo||(Fo=!0,Uo());else{var e=xi(Nr);e!==null&&pg(dg,e.startTime-t)}}var Fo=!1,za=-1,Qx=5,Xx=-1;function Wx(){return hg?!0:!(Be.unstable_now()-Xx<Qx)}function ag(){if(hg=!1,Fo){var t=Be.unstable_now();Xx=t;var e=!0;try{e:{qa=!1,Pa&&(Pa=!1,Gx(za),za=-1),fg=!0;var n=Tt;try{t:{for(Lf(t),En=xi(Zi);En!==null&&!(En.expirationTime>t&&Wx());){var i=En.callback;if(typeof i=="function"){En.callback=null,Tt=En.priorityLevel;var r=i(En.expirationTime<=t);if(t=Be.unstable_now(),typeof r=="function"){En.callback=r,Lf(t),e=!0;break t}En===xi(Zi)&&If(Zi),Lf(t)}else If(Zi);En=xi(Zi)}if(En!==null)e=!0;else{var s=xi(Nr);s!==null&&pg(dg,s.startTime-t),e=!1}}break e}finally{En=null,Tt=n,fg=!1}e=void 0}}finally{e?Uo():Fo=!1}}}var Uo;typeof $x=="function"?Uo=function(){$x(ag)}:typeof MessageChannel<"u"?(cg=new MessageChannel,Yx=cg.port2,cg.port1.onmessage=ag,Uo=function(){Yx.postMessage(null)}):Uo=function(){Kx(ag,0)};var cg,Yx;function pg(t,e){za=Kx(function(){t(Be.unstable_now())},e)}Be.unstable_IdlePriority=5;Be.unstable_ImmediatePriority=1;Be.unstable_LowPriority=4;Be.unstable_NormalPriority=3;Be.unstable_Profiling=null;Be.unstable_UserBlockingPriority=2;Be.unstable_cancelCallback=function(t){t.callback=null};Be.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Qx=0<t?Math.floor(1e3/t):5};Be.unstable_getCurrentPriorityLevel=function(){return Tt};Be.unstable_next=function(t){switch(Tt){case 1:case 2:case 3:var e=3;break;default:e=Tt}var n=Tt;Tt=e;try{return t()}finally{Tt=n}};Be.unstable_requestPaint=function(){hg=!0};Be.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=Tt;Tt=t;try{return e()}finally{Tt=n}};Be.unstable_scheduleCallback=function(t,e,n){var i=Be.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?i+n:i):n=i,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,t={id:u5++,callback:e,priorityLevel:t,startTime:n,expirationTime:r,sortIndex:-1},n>i?(t.sortIndex=n,ug(Nr,t),xi(Zi)===null&&t===xi(Nr)&&(Pa?(Gx(za),za=-1):Pa=!0,pg(dg,n-i))):(t.sortIndex=r,ug(Zi,t),qa||fg||(qa=!0,Fo||(Fo=!0,Uo()))),t};Be.unstable_shouldYield=Wx;Be.unstable_wrapCallback=function(t){var e=Tt;return function(){var n=Tt;Tt=e;try{return t.apply(this,arguments)}finally{Tt=n}}}});var ew=x((rse,Jx)=>{"use strict";Jx.exports=Zx()});var nw=x(qt=>{"use strict";var f5=Cn();function tw(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function _r(){}var Bt={d:{f:_r,r:function(){throw Error(tw(522))},D:_r,C:_r,L:_r,m:_r,X:_r,S:_r,M:_r},p:0,findDOMNode:null},h5=Symbol.for("react.portal");function d5(t,e,n){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h5,key:i==null?null:""+i,children:t,containerInfo:e,implementation:n}}var Ha=f5.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function Bf(t,e){if(t==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}qt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Bt;qt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(tw(299));return d5(t,e,null,n)};qt.flushSync=function(t){var e=Ha.T,n=Bt.p;try{if(Ha.T=null,Bt.p=2,t)return t()}finally{Ha.T=e,Bt.p=n,Bt.d.f()}};qt.preconnect=function(t,e){typeof t=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,Bt.d.C(t,e))};qt.prefetchDNS=function(t){typeof t=="string"&&Bt.d.D(t)};qt.preinit=function(t,e){if(typeof t=="string"&&e&&typeof e.as=="string"){var n=e.as,i=Bf(n,e.crossOrigin),r=typeof e.integrity=="string"?e.integrity:void 0,s=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;n==="style"?Bt.d.S(t,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:i,integrity:r,fetchPriority:s}):n==="script"&&Bt.d.X(t,{crossOrigin:i,integrity:r,fetchPriority:s,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};qt.preinitModule=function(t,e){if(typeof t=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var n=Bf(e.as,e.crossOrigin);Bt.d.M(t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&Bt.d.M(t)};qt.preload=function(t,e){if(typeof t=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var n=e.as,i=Bf(n,e.crossOrigin);Bt.d.L(t,n,{crossOrigin:i,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};qt.preloadModule=function(t,e){if(typeof t=="string")if(e){var n=Bf(e.as,e.crossOrigin);Bt.d.m(t,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else Bt.d.m(t)};qt.requestFormReset=function(t){Bt.d.r(t)};qt.unstable_batchedUpdates=function(t,e){return t(e)};qt.useFormState=function(t,e,n){return Ha.H.useFormState(t,e,n)};qt.useFormStatus=function(){return Ha.H.useHostTransitionStatus()};qt.version="19.1.0"});var sw=x((ose,rw)=>{"use strict";function iw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(iw)}catch(t){console.error(t)}}iw(),rw.exports=nw()});var lT=x(rd=>{"use strict";var it=ew(),Ck=Cn(),p5=sw();function D(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;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."}function Ek(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Cc(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function Dk(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 ow(t){if(Cc(t)!==t)throw Error(D(188))}function m5(t){var e=t.alternate;if(!e){if(e=Cc(t),e===null)throw Error(D(188));return e!==t?null:t}for(var n=t,i=e;;){var r=n.return;if(r===null)break;var s=r.alternate;if(s===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return ow(r),t;if(s===i)return ow(r),e;s=s.sibling}throw Error(D(188))}if(n.return!==i.return)n=r,i=s;else{for(var o=!1,l=r.child;l;){if(l===n){o=!0,n=r,i=s;break}if(l===i){o=!0,i=r,n=s;break}l=l.sibling}if(!o){for(l=s.child;l;){if(l===n){o=!0,n=s,i=r;break}if(l===i){o=!0,i=s,n=r;break}l=l.sibling}if(!o)throw Error(D(189))}}if(n.alternate!==i)throw Error(D(190))}if(n.tag!==3)throw Error(D(188));return n.stateNode.current===n?t:e}function Mk(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=Mk(t),e!==null)return e;t=t.sibling}return null}var Ne=Object.assign,g5=Symbol.for("react.element"),qf=Symbol.for("react.transitional.element"),Qa=Symbol.for("react.portal"),Qo=Symbol.for("react.fragment"),Rk=Symbol.for("react.strict_mode"),Yg=Symbol.for("react.profiler"),y5=Symbol.for("react.provider"),Nk=Symbol.for("react.consumer"),ir=Symbol.for("react.context"),Uy=Symbol.for("react.forward_ref"),Kg=Symbol.for("react.suspense"),Gg=Symbol.for("react.suspense_list"),Fy=Symbol.for("react.memo"),Br=Symbol.for("react.lazy"),Qg=Symbol.for("react.activity"),b5=Symbol.for("react.memo_cache_sentinel"),lw=Symbol.iterator;function Ua(t){return t===null||typeof t!="object"?null:(t=lw&&t[lw]||t["@@iterator"],typeof t=="function"?t:null)}var v5=Symbol.for("react.client.reference");function Xg(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===v5?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Qo:return"Fragment";case Yg:return"Profiler";case Rk:return"StrictMode";case Kg:return"Suspense";case Gg:return"SuspenseList";case Qg:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case Qa:return"Portal";case ir:return(t.displayName||"Context")+".Provider";case Nk:return(t._context.displayName||"Context")+".Consumer";case Uy:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Fy:return e=t.displayName||null,e!==null?e:Xg(t.type)||"Memo";case Br:e=t._payload,t=t._init;try{return Xg(t(e))}catch{}}return null}var Xa=Array.isArray,Y=Ck.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,me=p5.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,zs={pending:!1,data:null,method:null,action:null},Wg=[],Xo=-1;function Ei(t){return{current:t}}function ht(t){0>Xo||(t.current=Wg[Xo],Wg[Xo]=null,Xo--)}function Pe(t,e){Xo++,Wg[Xo]=t.current,t.current=e}var Oi=Ei(null),dc=Ei(null),Yr=Ei(null),dh=Ei(null);function ph(t,e){switch(Pe(Yr,e),Pe(dc,t),Pe(Oi,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?dk(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=dk(e),t=QO(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}ht(Oi),Pe(Oi,t)}function ml(){ht(Oi),ht(dc),ht(Yr)}function Zg(t){t.memoizedState!==null&&Pe(dh,t);var e=Oi.current,n=QO(e,t.type);e!==n&&(Pe(dc,t),Pe(Oi,n))}function mh(t){dc.current===t&&(ht(Oi),ht(dc)),dh.current===t&&(ht(dh),kc._currentValue=zs)}var Jg=Object.prototype.hasOwnProperty,jy=it.unstable_scheduleCallback,mg=it.unstable_cancelCallback,S5=it.unstable_shouldYield,x5=it.unstable_requestPaint,Ti=it.unstable_now,w5=it.unstable_getCurrentPriorityLevel,_k=it.unstable_ImmediatePriority,Lk=it.unstable_UserBlockingPriority,gh=it.unstable_NormalPriority,k5=it.unstable_LowPriority,Ik=it.unstable_IdlePriority,A5=it.log,O5=it.unstable_setDisableYieldValue,Ec=null,hn=null;function Fr(t){if(typeof A5=="function"&&O5(t),hn&&typeof hn.setStrictMode=="function")try{hn.setStrictMode(Ec,t)}catch{}}var dn=Math.clz32?Math.clz32:E5,T5=Math.log,C5=Math.LN2;function E5(t){return t>>>=0,t===0?32:31-(T5(t)/C5|0)|0}var Pf=256,zf=4194304;function Bs(t){var e=t&42;if(e!==0)return e;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function jh(t,e,n){var i=t.pendingLanes;if(i===0)return 0;var r=0,s=t.suspendedLanes,o=t.pingedLanes;t=t.warmLanes;var l=i&134217727;return l!==0?(i=l&~s,i!==0?r=Bs(i):(o&=l,o!==0?r=Bs(o):n||(n=l&~t,n!==0&&(r=Bs(n))))):(l=i&~s,l!==0?r=Bs(l):o!==0?r=Bs(o):n||(n=i&~t,n!==0&&(r=Bs(n)))),r===0?0:e!==0&&e!==r&&(e&s)===0&&(s=r&-r,n=e&-e,s>=n||s===32&&(n&4194048)!==0)?e:r}function Dc(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function D5(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Bk(){var t=Pf;return Pf<<=1,(Pf&4194048)===0&&(Pf=256),t}function qk(){var t=zf;return zf<<=1,(zf&62914560)===0&&(zf=4194304),t}function gg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Mc(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function M5(t,e,n,i,r,s){var o=t.pendingLanes;t.pendingLanes=n,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=n,t.entangledLanes&=n,t.errorRecoveryDisabledLanes&=n,t.shellSuspendCounter=0;var l=t.entanglements,a=t.expirationTimes,c=t.hiddenUpdates;for(n=o&~n;0<n;){var u=31-dn(n),f=1<<u;l[u]=0,a[u]=-1;var h=c[u];if(h!==null)for(c[u]=null,u=0;u<h.length;u++){var d=h[u];d!==null&&(d.lane&=-536870913)}n&=~f}i!==0&&Pk(t,i,0),s!==0&&r===0&&t.tag!==0&&(t.suspendedLanes|=s&~(o&~e))}function Pk(t,e,n){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-dn(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|n&4194090}function zk(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var i=31-dn(n),r=1<<i;r&e|t[i]&e&&(t[i]|=e),n&=~r}}function Vy(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function $y(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Hk(){var t=me.p;return t!==0?t:(t=window.event,t===void 0?32:sT(t.type))}function R5(t,e){var n=me.p;try{return me.p=t,e()}finally{me.p=n}}var is=Math.random().toString(36).slice(2),Ct="__reactFiber$"+is,Zt="__reactProps$"+is,Tl="__reactContainer$"+is,ey="__reactEvents$"+is,N5="__reactListeners$"+is,_5="__reactHandles$"+is,aw="__reactResources$"+is,Rc="__reactMarker$"+is;function Yy(t){delete t[Ct],delete t[Zt],delete t[ey],delete t[N5],delete t[_5]}function Wo(t){var e=t[Ct];if(e)return e;for(var n=t.parentNode;n;){if(e=n[Tl]||n[Ct]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=gk(t);t!==null;){if(n=t[Ct])return n;t=gk(t)}return e}t=n,n=t.parentNode}return null}function Cl(t){if(t=t[Ct]||t[Tl]){var e=t.tag;if(e===5||e===6||e===13||e===26||e===27||e===3)return t}return null}function Wa(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(D(33))}function ll(t){var e=t[aw];return e||(e=t[aw]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function ut(t){t[Rc]=!0}var Uk=new Set,Fk={};function Xs(t,e){gl(t,e),gl(t+"Capture",e)}function gl(t,e){for(Fk[t]=e,t=0;t<e.length;t++)Uk.add(e[t])}var L5=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),cw={},uw={};function I5(t){return Jg.call(uw,t)?!0:Jg.call(cw,t)?!1:L5.test(t)?uw[t]=!0:(cw[t]=!0,!1)}function eh(t,e,n){if(I5(e))if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+n)}}function Hf(t,e,n){if(n===null)t.removeAttribute(e);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+n)}}function Ji(t,e,n,i){if(i===null)t.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttributeNS(e,n,""+i)}}var yg,fw;function Yo(t){if(yg===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);yg=e&&e[1]||"",fw=-1<n.stack.indexOf(`
|
|
2
2
|
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+
|
|
3
|
+
`+yg+t+fw}var bg=!1;function vg(t,e){if(!t||bg)return"";bg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var f=function(){throw Error()};if(Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(d){var h=d}Reflect.construct(t,[],f)}else{try{f.call()}catch(d){h=d}t.call(f.prototype)}}else{try{throw Error()}catch(d){h=d}(f=t())&&typeof f.catch=="function"&&f.catch(function(){})}}catch(d){if(d&&h&&typeof d.stack=="string")return[d.stack,h.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=i.DetermineComponentFrameRoot(),o=s[0],l=s[1];if(o&&l){var a=o.split(`
|
|
4
4
|
`),c=l.split(`
|
|
5
5
|
`);for(r=i=0;i<a.length&&!a[i].includes("DetermineComponentFrameRoot");)i++;for(;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;if(i===a.length||r===c.length)for(i=a.length-1,r=c.length-1;1<=i&&0<=r&&a[i]!==c[r];)r--;for(;1<=i&&0<=r;i--,r--)if(a[i]!==c[r]){if(i!==1||r!==1)do if(i--,r--,0>r||a[i]!==c[r]){var u=`
|
|
6
|
-
`+a[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{
|
|
6
|
+
`+a[i].replace(" at new "," at ");return t.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",t.displayName)),u}while(1<=i&&0<=r);break}}}finally{bg=!1,Error.prepareStackTrace=n}return(n=t?t.displayName||t.name:"")?Yo(n):""}function B5(t){switch(t.tag){case 26:case 27:case 5:return Yo(t.type);case 16:return Yo("Lazy");case 13:return Yo("Suspense");case 19:return Yo("SuspenseList");case 0:case 15:return vg(t.type,!1);case 11:return vg(t.type.render,!1);case 1:return vg(t.type,!0);case 31:return Yo("Activity");default:return""}}function hw(t){try{var e="";do e+=B5(t),t=t.return;while(t);return e}catch(n){return`
|
|
7
7
|
Error generating stack: `+n.message+`
|
|
8
|
-
`+n.stack}}function En(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Bk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function E5(t){var e=Bk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function hh(t){t._valueTracker||(t._valueTracker=E5(t))}function qk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=Bk(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function dh(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}}var D5=/[\n"\\]/g;function Rn(t){return t.replace(D5,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Wg(t,e,n,i,r,s,o,l){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+En(e)):t.value!==""+En(e)&&(t.value=""+En(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?Zg(t,o,En(e)):n!=null?Zg(t,o,En(n)):i!=null&&t.removeAttribute("value"),r==null&&s!=null&&(t.defaultChecked=!!s),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?t.name=""+En(l):t.removeAttribute("name")}function Pk(t,e,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;n=n!=null?""+En(n):"",e=e!=null?""+En(e):n,l||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=l?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o)}function Zg(t,e,n){e==="number"&&dh(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function tl(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+En(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function zk(t,e,n){if(e!=null&&(e=""+En(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+En(n):""}function Hk(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(D(92));if($a(i)){if(1<i.length)throw Error(D(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=En(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function ul(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var M5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ow(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||M5.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function Uk(t,e,n){if(e!=null&&typeof e!="object")throw Error(D(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&ow(t,r,i)}else for(var s in e)e.hasOwnProperty(s)&&ow(t,s,e[s])}function jy(t){if(t.indexOf("-")===-1)return!1;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 R5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),N5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xf(t){return N5.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var Jg=null;function Vy(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var $o=null,nl=null;function lw(t){var e=Sl(t);if(e&&(t=e.stateNode)){var n=t[Zt]||null;e:switch(t=e.stateNode,e.type){case"input":if(Wg(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Rn(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Zt]||null;if(!r)throw Error(D(90));Wg(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&qk(i)}break e;case"textarea":zk(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&tl(t,!!n.multiple,e,!1)}}}var gg=!1;function Fk(t,e,n){if(gg)return t(e,n);gg=!0;try{var i=t(e);return i}finally{if(gg=!1,($o!==null||nl!==null)&&(Gh(),$o&&(e=$o,t=nl,nl=$o=null,lw(e),t)))for(e=0;e<t.length;e++)lw(t[e])}}function cc(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Zt]||null;if(i===null)return null;n=i[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":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(D(231,e,typeof n));return n}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ey=!1;if(sr)try{Bo={},Object.defineProperty(Bo,"passive",{get:function(){ey=!0}}),window.addEventListener("test",Bo,Bo),window.removeEventListener("test",Bo,Bo)}catch{ey=!1}var Bo,qr=null,$y=null,Wf=null;function jk(){if(Wf)return Wf;var t,e=$y,n=e.length,i,r="value"in qr?qr.value:qr.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[s-i];i++);return Wf=r.slice(t,1<i?1-i:void 0)}function Zf(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 Bf(){return!0}function aw(){return!1}function Jt(t){function e(n,i,r,s,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Bf:aw,this.isPropagationStopped=aw,this}return Ne(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=Bf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Bf)},persist:function(){},isPersistent:Bf}),e}var Ys={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zh=Jt(Ys),Cc=Ne({},Ys,{view:0,detail:0}),_5=Jt(Cc),yg,bg,qa,Hh=Ne({},Cc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yy,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!==qa&&(qa&&t.type==="mousemove"?(yg=t.screenX-qa.screenX,bg=t.screenY-qa.screenY):bg=yg=0,qa=t),yg)},movementY:function(t){return"movementY"in t?t.movementY:bg}}),cw=Jt(Hh),L5=Ne({},Hh,{dataTransfer:0}),I5=Jt(L5),B5=Ne({},Cc,{relatedTarget:0}),vg=Jt(B5),q5=Ne({},Ys,{animationName:0,elapsedTime:0,pseudoElement:0}),P5=Jt(q5),z5=Ne({},Ys,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),H5=Jt(z5),U5=Ne({},Ys,{data:0}),uw=Jt(U5),F5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j5={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"},V5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $5(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=V5[t])?!!e[t]:!1}function Yy(){return $5}var Y5=Ne({},Cc,{key:function(t){if(t.key){var e=F5[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Zf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?j5[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yy,charCode:function(t){return t.type==="keypress"?Zf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Zf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),K5=Jt(Y5),G5=Ne({},Hh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fw=Jt(G5),Q5=Ne({},Cc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yy}),X5=Jt(Q5),W5=Ne({},Ys,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z5=Jt(W5),J5=Ne({},Hh,{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}),eP=Jt(J5),tP=Ne({},Ys,{newState:0,oldState:0}),nP=Jt(tP),iP=[9,13,27,32],Ky=sr&&"CompositionEvent"in window,Ga=null;sr&&"documentMode"in document&&(Ga=document.documentMode);var rP=sr&&"TextEvent"in window&&!Ga,Vk=sr&&(!Ky||Ga&&8<Ga&&11>=Ga),hw=" ",dw=!1;function $k(t,e){switch(t){case"keyup":return iP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yk(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Yo=!1;function sP(t,e){switch(t){case"compositionend":return Yk(e);case"keypress":return e.which!==32?null:(dw=!0,hw);case"textInput":return t=e.data,t===hw&&dw?null:t;default:return null}}function oP(t,e){if(Yo)return t==="compositionend"||!Ky&&$k(t,e)?(t=jk(),Wf=$y=qr=null,Yo=!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 Vk&&e.locale!=="ko"?null:e.data;default:return null}}var lP={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 pw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!lP[t.type]:e==="textarea"}function Kk(t,e,n,i){$o?nl?nl.push(i):nl=[i]:$o=i,e=Rh(e,"onChange"),0<e.length&&(n=new zh("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var Qa=null,uc=null;function aP(t){zO(t,0)}function Uh(t){var e=Ya(t);if(qk(e))return t}function mw(t,e){if(t==="change")return e}var Gk=!1;sr&&(sr?(Pf="oninput"in document,Pf||(Sg=document.createElement("div"),Sg.setAttribute("oninput","return;"),Pf=typeof Sg.oninput=="function"),qf=Pf):qf=!1,Gk=qf&&(!document.documentMode||9<document.documentMode));var qf,Pf,Sg;function gw(){Qa&&(Qa.detachEvent("onpropertychange",Qk),uc=Qa=null)}function Qk(t){if(t.propertyName==="value"&&Uh(uc)){var e=[];Kk(e,uc,t,Vy(t)),Fk(aP,e)}}function cP(t,e,n){t==="focusin"?(gw(),Qa=e,uc=n,Qa.attachEvent("onpropertychange",Qk)):t==="focusout"&&gw()}function uP(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Uh(uc)}function fP(t,e){if(t==="click")return Uh(e)}function hP(t,e){if(t==="input"||t==="change")return Uh(e)}function dP(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pn=typeof Object.is=="function"?Object.is:dP;function fc(t,e){if(pn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Qg.call(e,r)||!pn(t[r],e[r]))return!1}return!0}function yw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function bw(t,e){var n=yw(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=yw(n)}}function Xk(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Xk(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Wk(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=dh(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=dh(t.document)}return e}function Gy(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")}var pP=sr&&"documentMode"in document&&11>=document.documentMode,Ko=null,ty=null,Xa=null,ny=!1;function vw(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ny||Ko==null||Ko!==dh(i)||(i=Ko,"selectionStart"in i&&Gy(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Xa&&fc(Xa,i)||(Xa=i,i=Rh(ty,"onSelect"),0<i.length&&(e=new zh("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=Ko)))}function Ms(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Go={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},xg={},Zk={};sr&&(Zk=document.createElement("div").style,"AnimationEvent"in window||(delete Go.animationend.animation,delete Go.animationiteration.animation,delete Go.animationstart.animation),"TransitionEvent"in window||delete Go.transitionend.transition);function Ks(t){if(xg[t])return xg[t];if(!Go[t])return t;var e=Go[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Zk)return xg[t]=e[n];return t}var Jk=Ks("animationend"),eA=Ks("animationiteration"),tA=Ks("animationstart"),mP=Ks("transitionrun"),gP=Ks("transitionstart"),yP=Ks("transitioncancel"),nA=Ks("transitionend"),iA=new Map,iy="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");iy.push("scrollEnd");function Zn(t,e){iA.set(t,e),$s(e,[t])}var Sw=new WeakMap;function Nn(t,e){if(typeof t=="object"&&t!==null){var n=Sw.get(t);return n!==void 0?n:(e={value:t,source:e,stack:sw(e)},Sw.set(t,e),e)}return{value:t,source:e,stack:sw(e)}}var Cn=[],Qo=0,Qy=0;function Fh(){for(var t=Qo,e=Qy=Qo=0;e<t;){var n=Cn[e];Cn[e++]=null;var i=Cn[e];Cn[e++]=null;var r=Cn[e];Cn[e++]=null;var s=Cn[e];if(Cn[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}s!==0&&rA(n,r,s)}}function jh(t,e,n,i){Cn[Qo++]=t,Cn[Qo++]=e,Cn[Qo++]=n,Cn[Qo++]=i,Qy|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function Xy(t,e,n,i){return jh(t,e,n,i),ph(t)}function xl(t,e){return jh(t,null,null,e),ph(t)}function rA(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,s=t.return;s!==null;)s.childLanes|=n,i=s.alternate,i!==null&&(i.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(r=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,r&&e!==null&&(r=31-fn(n),t=s.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),s):null}function ph(t){if(50<oc)throw oc=0,Ay=null,Error(D(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var Xo={};function bP(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(t,e,n,i){return new bP(t,e,n,i)}function Wy(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ir(t,e){var n=t.alternate;return n===null?(n=cn(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&65011712,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.refCleanup=t.refCleanup,n}function sA(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Jf(t,e,n,i,r,s){var o=0;if(i=t,typeof t=="function")Wy(t)&&(o=1);else if(typeof t=="string")o=bz(t,n,xi.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case $g:return t=cn(31,n,e,r),t.elementType=$g,t.lanes=s,t;case Fo:return Is(n.children,r,s,e);case Ak:o=8,r|=24;break;case Fg:return t=cn(12,n,e,r|2),t.elementType=Fg,t.lanes=s,t;case jg:return t=cn(13,n,e,r),t.elementType=jg,t.lanes=s,t;case Vg:return t=cn(19,n,e,r),t.elementType=Vg,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case a5:case Zi:o=10;break e;case Ok:o=9;break e;case qy:o=11;break e;case Py:o=14;break e;case Mr:o=16,i=null;break e}o=29,n=Error(D(130,t===null?"null":typeof t,"")),i=null}return e=cn(o,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function Is(t,e,n,i){return t=cn(7,t,i,e),t.lanes=n,t}function wg(t,e,n){return t=cn(6,t,null,e),t.lanes=n,t}function kg(t,e,n){return e=cn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var Wo=[],Zo=0,mh=null,gh=0,Dn=[],Mn=0,Bs=null,Ji=1,er="";function Ns(t,e){Wo[Zo++]=gh,Wo[Zo++]=mh,mh=t,gh=e}function oA(t,e,n){Dn[Mn++]=Ji,Dn[Mn++]=er,Dn[Mn++]=Bs,Bs=t;var i=Ji;t=er;var r=32-fn(i)-1;i&=~(1<<r),n+=1;var s=32-fn(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,Ji=1<<32-fn(e)+r|n<<r|i,er=s+t}else Ji=1<<s|n<<r|i,er=t}function Zy(t){t.return!==null&&(Ns(t,1),oA(t,1,0))}function Jy(t){for(;t===mh;)mh=Wo[--Zo],Wo[Zo]=null,gh=Wo[--Zo],Wo[Zo]=null;for(;t===Bs;)Bs=Dn[--Mn],Dn[Mn]=null,er=Dn[--Mn],Dn[Mn]=null,Ji=Dn[--Mn],Dn[Mn]=null}var qt=null,je=null,pe=!1,qs=null,vi=!1,ry=Error(D(519));function Us(t){var e=Error(D(418,""));throw hc(Nn(e,t)),ry}function xw(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[At]=t,e[Zt]=i,n){case"dialog":ne("cancel",e),ne("close",e);break;case"iframe":case"object":case"embed":ne("load",e);break;case"video":case"audio":for(n=0;n<mc.length;n++)ne(mc[n],e);break;case"source":ne("error",e);break;case"img":case"image":case"link":ne("error",e),ne("load",e);break;case"details":ne("toggle",e);break;case"input":ne("invalid",e),Pk(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),hh(e);break;case"select":ne("invalid",e);break;case"textarea":ne("invalid",e),Hk(e,i.value,i.defaultValue,i.children),hh(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||UO(e.textContent,n)?(i.popover!=null&&(ne("beforetoggle",e),ne("toggle",e)),i.onScroll!=null&&ne("scroll",e),i.onScrollEnd!=null&&ne("scrollend",e),i.onClick!=null&&(e.onclick=Wh),e=!0):e=!1,e||Us(t)}function ww(t){for(qt=t.return;qt;)switch(qt.tag){case 5:case 13:vi=!1;return;case 27:case 3:vi=!0;return;default:qt=qt.return}}function Pa(t){if(t!==qt)return!1;if(!pe)return ww(t),pe=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||My(t.type,t.memoizedProps)),n=!n),n&&je&&Us(t),ww(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){je=Wn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}je=null}}else e===27?(e=je,Zr(t.type)?(t=_y,_y=null,je=t):je=e):je=qt?Wn(t.stateNode.nextSibling):null;return!0}function Ec(){je=qt=null,pe=!1}function kw(){var t=qs;return t!==null&&(Wt===null?Wt=t:Wt.push.apply(Wt,t),qs=null),t}function hc(t){qs===null?qs=[t]:qs.push(t)}var sy=Ai(null),Gs=null,tr=null;function Nr(t,e,n){Pe(sy,e._currentValue),e._currentValue=n}function rr(t){t._currentValue=sy.current,dt(sy)}function oy(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function ly(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var s=r.dependencies;if(s!==null){var o=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var a=0;a<e.length;a++)if(l.context===e[a]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),oy(s.return,n,t),i||(o=null);break e}s=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(D(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),oy(o,n,t),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function Dc(t,e,n,i){t=null;for(var r=e,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(D(387));if(o=o.memoizedProps,o!==null){var l=r.type;pn(r.pendingProps.value,o.value)||(t!==null?t.push(l):t=[l])}}else if(r===ah.current){if(o=r.alternate,o===null)throw Error(D(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(bc):t=[bc])}r=r.return}t!==null&&ly(e,t,n,i),e.flags|=262144}function yh(t){for(t=t.firstContext;t!==null;){if(!pn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Fs(t){Gs=t,tr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ot(t){return lA(Gs,t)}function zf(t,e){return Gs===null&&Fs(t),lA(t,e)}function lA(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},tr===null){if(t===null)throw Error(D(308));tr=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else tr=tr.next=e;return n}var vP=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},SP=st.unstable_scheduleCallback,xP=st.unstable_NormalPriority,it={$$typeof:Zi,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function e0(){return{controller:new vP,data:new Map,refCount:0}}function Mc(t){t.refCount--,t.refCount===0&&SP(xP,function(){t.controller.abort()})}var Wa=null,ay=0,fl=0,il=null;function wP(t,e){if(Wa===null){var n=Wa=[];ay=0,fl=k0(),il={status:"pending",value:void 0,then:function(i){n.push(i)}}}return ay++,e.then(Aw,Aw),e}function Aw(){if(--ay===0&&Wa!==null){il!==null&&(il.status="fulfilled");var t=Wa;Wa=null,fl=0,il=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function kP(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var Ow=V.S;V.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&wP(t,e),Ow!==null&&Ow(t,e)};var Ps=Ai(null);function t0(){var t=Ps.current;return t!==null?t:Ce.pooledCache}function eh(t,e){e===null?Pe(Ps,Ps.current):Pe(Ps,e.pool)}function aA(){var t=t0();return t===null?null:{parent:it._currentValue,pool:t}}var Rc=Error(D(460)),cA=Error(D(474)),Vh=Error(D(542)),cy={then:function(){}};function Tw(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Hf(){}function uA(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then(Hf,Hf),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Ew(t),t;default:if(typeof e.status=="string")e.then(Hf,Hf);else{if(t=Ce,t!==null&&100<t.shellSuspendCounter)throw Error(D(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Ew(t),t}throw Za=e,Rc}}var Za=null;function Cw(){if(Za===null)throw Error(D(459));var t=Za;return Za=null,t}function Ew(t){if(t===Rc||t===Vh)throw Error(D(483))}var Rr=!1;function n0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uy(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ur(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Fr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(ve&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=ph(t),rA(t,null,n),e}return jh(t,i,e,n),ph(t)}function Ja(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Nk(t,n)}}function Ag(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var fy=!1;function ec(){if(fy){var t=il;if(t!==null)throw t}}function tc(t,e,n,i){fy=!1;var r=t.updateQueue;Rr=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var f=r.baseState;o=0,u=c=a=null,l=s;do{var h=l.lane&-536870913,d=h!==l.lane;if(d?(fe&h)===h:(i&h)===h){h!==0&&h===fl&&(fy=!0),u!==null&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var p=t,m=l;h=e;var b=n;switch(m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(b,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,h=typeof p=="function"?p.call(b,f,h):p,h==null)break e;f=Ne({},f,h);break e;case 2:Rr=!0}}h=l.callback,h!==null&&(t.flags|=64,d&&(t.flags|=8192),d=r.callbacks,d===null?r.callbacks=[h]:d.push(h))}else d={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=d,a=f):u=u.next=d,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;d=l,l=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);u===null&&(a=f),r.baseState=a,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),Xr|=o,t.lanes=o,t.memoizedState=f}}function fA(t,e){if(typeof t!="function")throw Error(D(191,t));t.call(e)}function hA(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)fA(n[t],e)}var hl=Ai(null),bh=Ai(0);function Dw(t,e){t=ar,Pe(bh,t),Pe(hl,e),ar=t|e.baseLanes}function hy(){Pe(bh,ar),Pe(hl,hl.current)}function i0(){ar=bh.current,dt(hl),dt(bh)}var Gr=0,W=null,we=null,Xe=null,vh=!1,rl=!1,js=!1,Sh=0,dc=0,sl=null,AP=0;function Ke(){throw Error(D(321))}function r0(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!pn(t[n],e[n]))return!1;return!0}function s0(t,e,n,i,r,s){return Gr=s,W=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,V.H=t===null||t.memoizedState===null?jA:VA,js=!1,s=n(i,r),js=!1,rl&&(s=pA(e,n,i,r)),dA(t),s}function dA(t){V.H=xh;var e=we!==null&&we.next!==null;if(Gr=0,Xe=we=W=null,vh=!1,dc=0,sl=null,e)throw Error(D(300));t===null||ht||(t=t.dependencies,t!==null&&yh(t)&&(ht=!0))}function pA(t,e,n,i){W=t;var r=0;do{if(rl&&(sl=null),dc=0,rl=!1,25<=r)throw Error(D(301));if(r+=1,Xe=we=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}V.H=RP,s=e(n,i)}while(rl);return s}function OP(){var t=V.H,e=t.useState()[0];return e=typeof e.then=="function"?Nc(e):e,t=t.useState()[0],(we!==null?we.memoizedState:null)!==t&&(W.flags|=1024),e}function o0(){var t=Sh!==0;return Sh=0,t}function l0(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function a0(t){if(vh){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}vh=!1}Gr=0,Xe=we=W=null,rl=!1,dc=Sh=0,sl=null}function Qt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xe===null?W.memoizedState=Xe=t:Xe=Xe.next=t,Xe}function We(){if(we===null){var t=W.alternate;t=t!==null?t.memoizedState:null}else t=we.next;var e=Xe===null?W.memoizedState:Xe.next;if(e!==null)Xe=e,we=t;else{if(t===null)throw W.alternate===null?Error(D(467)):Error(D(310));we=t,t={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Xe===null?W.memoizedState=Xe=t:Xe=Xe.next=t}return Xe}function c0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Nc(t){var e=dc;return dc+=1,sl===null&&(sl=[]),t=uA(sl,t,e),e=W,(Xe===null?e.memoizedState:Xe.next)===null&&(e=e.alternate,V.H=e===null||e.memoizedState===null?jA:VA),t}function $h(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Nc(t);if(t.$$typeof===Zi)return Ot(t)}throw Error(D(438,String(t)))}function u0(t){var e=null,n=W.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=W.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=c0(),W.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=c5;return e.index++,n}function or(t,e){return typeof e=="function"?e(t):e}function th(t){var e=We();return f0(e,we,t)}function f0(t,e,n){var i=t.queue;if(i===null)throw Error(D(311));i.lastRenderedReducer=n;var r=t.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}e.baseQueue=r=s,i.pending=null}if(s=t.baseState,r===null)t.memoizedState=s;else{e=r.next;var l=o=null,a=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(fe&f)===f:(Gr&f)===f){var h=c.revertLane;if(h===0)a!==null&&(a=a.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===fl&&(u=!0);else if((Gr&h)===h){c=c.next,h===fl&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=f,o=s):a=a.next=f,W.lanes|=h,Xr|=h;f=c.action,js&&n(s,f),s=c.hasEagerState?c.eagerState:n(s,f)}else h={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=h,o=s):a=a.next=h,W.lanes|=f,Xr|=f;c=c.next}while(c!==null&&c!==e);if(a===null?o=s:a.next=l,!pn(s,t.memoizedState)&&(ht=!0,u&&(n=il,n!==null)))throw n;t.memoizedState=s,t.baseState=o,t.baseQueue=a,i.lastRenderedState=s}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Og(t){var e=We(),n=e.queue;if(n===null)throw Error(D(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do s=t(s,o.action),o=o.next;while(o!==r);pn(s,e.memoizedState)||(ht=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function mA(t,e,n){var i=W,r=We(),s=pe;if(s){if(n===void 0)throw Error(D(407));n=n()}else n=e();var o=!pn((we||r).memoizedState,n);o&&(r.memoizedState=n,ht=!0),r=r.queue;var l=bA.bind(null,i,r,t);if(_c(2048,8,l,[t]),r.getSnapshot!==e||o||Xe!==null&&Xe.memoizedState.tag&1){if(i.flags|=2048,dl(9,Yh(),yA.bind(null,i,r,n,e),null),Ce===null)throw Error(D(349));s||(Gr&124)!==0||gA(i,e,n)}return n}function gA(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=W.updateQueue,e===null?(e=c0(),W.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function yA(t,e,n,i){e.value=n,e.getSnapshot=i,vA(e)&&SA(t)}function bA(t,e,n){return n(function(){vA(e)&&SA(t)})}function vA(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!pn(t,n)}catch{return!0}}function SA(t){var e=xl(t,2);e!==null&&dn(e,t,2)}function dy(t){var e=Qt();if(typeof t=="function"){var n=t;if(t=n(),js){Br(!0);try{n()}finally{Br(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:t},e}function xA(t,e,n,i){return t.baseState=n,f0(t,we,typeof i=="function"?i:or)}function TP(t,e,n,i,r){if(Kh(t))throw Error(D(485));if(t=e.action,t!==null){var s={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){s.listeners.push(o)}};V.T!==null?n(!0):s.isTransition=!1,i(s),n=e.pending,n===null?(s.next=e.pending=s,wA(e,s)):(s.next=n.next,e.pending=n.next=s)}}function wA(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var s=V.T,o={};V.T=o;try{var l=n(r,i),a=V.S;a!==null&&a(o,l),Mw(t,e,l)}catch(c){py(t,e,c)}finally{V.T=s}}else try{s=n(r,i),Mw(t,e,s)}catch(c){py(t,e,c)}}function Mw(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Rw(t,e,i)},function(i){return py(t,e,i)}):Rw(t,e,n)}function Rw(t,e,n){e.status="fulfilled",e.value=n,kA(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,wA(t,n)))}function py(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,kA(e),e=e.next;while(e!==i)}t.action=null}function kA(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function AA(t,e){return e}function Nw(t,e){if(pe){var n=Ce.formState;if(n!==null){e:{var i=W;if(pe){if(je){t:{for(var r=je,s=vi;r.nodeType!==8;){if(!s){r=null;break t}if(r=Wn(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){je=Wn(r.nextSibling),i=r.data==="F!";break e}}Us(i)}i=!1}i&&(e=n[0])}}return n=Qt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:AA,lastRenderedState:e},n.queue=i,n=HA.bind(null,W,i),i.dispatch=n,i=dy(!1),s=m0.bind(null,W,!1,i.queue),i=Qt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=TP.bind(null,W,r,s,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function _w(t){var e=We();return OA(e,we,t)}function OA(t,e,n){if(e=f0(t,e,AA)[0],t=th(or)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=Nc(e)}catch(o){throw o===Rc?Vh:o}else i=e;e=We();var r=e.queue,s=r.dispatch;return n!==e.memoizedState&&(W.flags|=2048,dl(9,Yh(),CP.bind(null,r,n),null)),[i,s,t]}function CP(t,e){t.action=e}function Lw(t){var e=We(),n=we;if(n!==null)return OA(e,n,t);We(),e=e.memoizedState,n=We();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function dl(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=W.updateQueue,e===null&&(e=c0(),W.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Yh(){return{destroy:void 0,resource:void 0}}function TA(){return We().memoizedState}function nh(t,e,n,i){var r=Qt();i=i===void 0?null:i,W.flags|=t,r.memoizedState=dl(1|e,Yh(),n,i)}function _c(t,e,n,i){var r=We();i=i===void 0?null:i;var s=r.memoizedState.inst;we!==null&&i!==null&&r0(i,we.memoizedState.deps)?r.memoizedState=dl(e,s,n,i):(W.flags|=t,r.memoizedState=dl(1|e,s,n,i))}function Iw(t,e){nh(8390656,8,t,e)}function CA(t,e){_c(2048,8,t,e)}function EA(t,e){return _c(4,2,t,e)}function DA(t,e){return _c(4,4,t,e)}function MA(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function RA(t,e,n){n=n!=null?n.concat([t]):null,_c(4,4,MA.bind(null,e,t),n)}function h0(){}function NA(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&r0(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function _A(t,e){var n=We();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&r0(e,i[1]))return i[0];if(i=t(),js){Br(!0);try{t()}finally{Br(!1)}}return n.memoizedState=[i,e],i}function d0(t,e,n){return n===void 0||(Gr&1073741824)!==0?t.memoizedState=e:(t.memoizedState=n,t=kO(),W.lanes|=t,Xr|=t,n)}function LA(t,e,n,i){return pn(n,e)?n:hl.current!==null?(t=d0(t,n,i),pn(t,e)||(ht=!0),t):(Gr&42)===0?(ht=!0,t.memoizedState=n):(t=kO(),W.lanes|=t,Xr|=t,e)}function IA(t,e,n,i,r){var s=me.p;me.p=s!==0&&8>s?s:8;var o=V.T,l={};V.T=l,m0(t,!1,e,n);try{var a=r(),c=V.S;if(c!==null&&c(l,a),a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=kP(a,i);nc(t,e,u,hn(t))}else nc(t,e,i,hn(t))}catch(f){nc(t,e,{then:function(){},status:"rejected",reason:f},hn())}finally{me.p=s,V.T=o}}function EP(){}function my(t,e,n,i){if(t.tag!==5)throw Error(D(476));var r=BA(t).queue;IA(t,r,e,Ls,n===null?EP:function(){return qA(t),n(i)})}function BA(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:Ls,baseState:Ls,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:Ls},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:or,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function qA(t){var e=BA(t).next.queue;nc(t,e,{},hn())}function p0(){return Ot(bc)}function PA(){return We().memoizedState}function zA(){return We().memoizedState}function DP(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=hn();t=Ur(n);var i=Fr(e,t,n);i!==null&&(dn(i,e,n),Ja(i,e,n)),e={cache:e0()},t.payload=e;return}e=e.return}}function MP(t,e,n){var i=hn();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Kh(t)?UA(e,n):(n=Xy(t,e,n,i),n!==null&&(dn(n,t,i),FA(n,e,i)))}function HA(t,e,n){var i=hn();nc(t,e,n,i)}function nc(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Kh(t))UA(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,pn(l,o))return jh(t,e,r,0),Ce===null&&Fh(),!1}catch{}if(n=Xy(t,e,r,i),n!==null)return dn(n,t,i),FA(n,e,i),!0}return!1}function m0(t,e,n,i){if(i={lane:2,revertLane:k0(),action:i,hasEagerState:!1,eagerState:null,next:null},Kh(t)){if(e)throw Error(D(479))}else e=Xy(t,n,i,2),e!==null&&dn(e,t,2)}function Kh(t){var e=t.alternate;return t===W||e!==null&&e===W}function UA(t,e){rl=vh=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function FA(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,Nk(t,n)}}var xh={readContext:Ot,use:$h,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useLayoutEffect:Ke,useInsertionEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useSyncExternalStore:Ke,useId:Ke,useHostTransitionStatus:Ke,useFormState:Ke,useActionState:Ke,useOptimistic:Ke,useMemoCache:Ke,useCacheRefresh:Ke},jA={readContext:Ot,use:$h,useCallback:function(t,e){return Qt().memoizedState=[t,e===void 0?null:e],t},useContext:Ot,useEffect:Iw,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,nh(4194308,4,MA.bind(null,e,t),n)},useLayoutEffect:function(t,e){return nh(4194308,4,t,e)},useInsertionEffect:function(t,e){nh(4,2,t,e)},useMemo:function(t,e){var n=Qt();e=e===void 0?null:e;var i=t();if(js){Br(!0);try{t()}finally{Br(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Qt();if(n!==void 0){var r=n(e);if(js){Br(!0);try{n(e)}finally{Br(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=MP.bind(null,W,t),[i.memoizedState,t]},useRef:function(t){var e=Qt();return t={current:t},e.memoizedState=t},useState:function(t){t=dy(t);var e=t.queue,n=HA.bind(null,W,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:h0,useDeferredValue:function(t,e){var n=Qt();return d0(n,t,e)},useTransition:function(){var t=dy(!1);return t=IA.bind(null,W,t.queue,!0,!1),Qt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=W,r=Qt();if(pe){if(n===void 0)throw Error(D(407));n=n()}else{if(n=e(),Ce===null)throw Error(D(349));(fe&124)!==0||gA(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Iw(bA.bind(null,i,s,t),[t]),i.flags|=2048,dl(9,Yh(),yA.bind(null,i,s,n,e),null),n},useId:function(){var t=Qt(),e=Ce.identifierPrefix;if(pe){var n=er,i=Ji;n=(i&~(1<<32-fn(i)-1)).toString(32)+n,e="\xAB"+e+"R"+n,n=Sh++,0<n&&(e+="H"+n.toString(32)),e+="\xBB"}else n=AP++,e="\xAB"+e+"r"+n.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:p0,useFormState:Nw,useActionState:Nw,useOptimistic:function(t){var e=Qt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=m0.bind(null,W,!0,n),n.dispatch=e,[t,e]},useMemoCache:u0,useCacheRefresh:function(){return Qt().memoizedState=DP.bind(null,W)}},VA={readContext:Ot,use:$h,useCallback:NA,useContext:Ot,useEffect:CA,useImperativeHandle:RA,useInsertionEffect:EA,useLayoutEffect:DA,useMemo:_A,useReducer:th,useRef:TA,useState:function(){return th(or)},useDebugValue:h0,useDeferredValue:function(t,e){var n=We();return LA(n,we.memoizedState,t,e)},useTransition:function(){var t=th(or)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Nc(t),e]},useSyncExternalStore:mA,useId:PA,useHostTransitionStatus:p0,useFormState:_w,useActionState:_w,useOptimistic:function(t,e){var n=We();return xA(n,we,t,e)},useMemoCache:u0,useCacheRefresh:zA},RP={readContext:Ot,use:$h,useCallback:NA,useContext:Ot,useEffect:CA,useImperativeHandle:RA,useInsertionEffect:EA,useLayoutEffect:DA,useMemo:_A,useReducer:Og,useRef:TA,useState:function(){return Og(or)},useDebugValue:h0,useDeferredValue:function(t,e){var n=We();return we===null?d0(n,t,e):LA(n,we.memoizedState,t,e)},useTransition:function(){var t=Og(or)[0],e=We().memoizedState;return[typeof t=="boolean"?t:Nc(t),e]},useSyncExternalStore:mA,useId:PA,useHostTransitionStatus:p0,useFormState:Lw,useActionState:Lw,useOptimistic:function(t,e){var n=We();return we!==null?xA(n,we,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:u0,useCacheRefresh:zA},ol=null,pc=0;function Uf(t){var e=pc;return pc+=1,ol===null&&(ol=[]),uA(ol,t,e)}function za(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Ff(t,e){throw e.$$typeof===l5?Error(D(525)):(t=Object.prototype.toString.call(e),Error(D(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Bw(t){var e=t._init;return e(t._payload)}function $A(t){function e(y,g){if(t){var v=y.deletions;v===null?(y.deletions=[g],y.flags|=16):v.push(g)}}function n(y,g){if(!t)return null;for(;g!==null;)e(y,g),g=g.sibling;return null}function i(y){for(var g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function r(y,g){return y=ir(y,g),y.index=0,y.sibling=null,y}function s(y,g,v){return y.index=v,t?(v=y.alternate,v!==null?(v=v.index,v<g?(y.flags|=67108866,g):v):(y.flags|=67108866,g)):(y.flags|=1048576,g)}function o(y){return t&&y.alternate===null&&(y.flags|=67108866),y}function l(y,g,v,S){return g===null||g.tag!==6?(g=wg(v,y.mode,S),g.return=y,g):(g=r(g,v),g.return=y,g)}function a(y,g,v,S){var w=v.type;return w===Fo?u(y,g,v.props.children,S,v.key):g!==null&&(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Mr&&Bw(w)===g.type)?(g=r(g,v.props),za(g,v),g.return=y,g):(g=Jf(v.type,v.key,v.props,null,y.mode,S),za(g,v),g.return=y,g)}function c(y,g,v,S){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=kg(v,y.mode,S),g.return=y,g):(g=r(g,v.children||[]),g.return=y,g)}function u(y,g,v,S,w){return g===null||g.tag!==7?(g=Is(v,y.mode,S,w),g.return=y,g):(g=r(g,v),g.return=y,g)}function f(y,g,v){if(typeof g=="string"&&g!==""||typeof g=="number"||typeof g=="bigint")return g=wg(""+g,y.mode,v),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Nf:return v=Jf(g.type,g.key,g.props,null,y.mode,v),za(v,g),v.return=y,v;case Va:return g=kg(g,y.mode,v),g.return=y,g;case Mr:var S=g._init;return g=S(g._payload),f(y,g,v)}if($a(g)||Ba(g))return g=Is(g,y.mode,v,null),g.return=y,g;if(typeof g.then=="function")return f(y,Uf(g),v);if(g.$$typeof===Zi)return f(y,zf(y,g),v);Ff(y,g)}return null}function h(y,g,v,S){var w=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:l(y,g,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Nf:return v.key===w?a(y,g,v,S):null;case Va:return v.key===w?c(y,g,v,S):null;case Mr:return w=v._init,v=w(v._payload),h(y,g,v,S)}if($a(v)||Ba(v))return w!==null?null:u(y,g,v,S,null);if(typeof v.then=="function")return h(y,g,Uf(v),S);if(v.$$typeof===Zi)return h(y,g,zf(y,v),S);Ff(y,v)}return null}function d(y,g,v,S,w){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return y=y.get(v)||null,l(g,y,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Nf:return y=y.get(S.key===null?v:S.key)||null,a(g,y,S,w);case Va:return y=y.get(S.key===null?v:S.key)||null,c(g,y,S,w);case Mr:var O=S._init;return S=O(S._payload),d(y,g,v,S,w)}if($a(S)||Ba(S))return y=y.get(v)||null,u(g,y,S,w,null);if(typeof S.then=="function")return d(y,g,v,Uf(S),w);if(S.$$typeof===Zi)return d(y,g,v,zf(g,S),w);Ff(g,S)}return null}function p(y,g,v,S){for(var w=null,O=null,k=g,A=g=0,R=null;k!==null&&A<v.length;A++){k.index>A?(R=k,k=null):R=k.sibling;var T=h(y,k,v[A],S);if(T===null){k===null&&(k=R);break}t&&k&&T.alternate===null&&e(y,k),g=s(T,g,A),O===null?w=T:O.sibling=T,O=T,k=R}if(A===v.length)return n(y,k),pe&&Ns(y,A),w;if(k===null){for(;A<v.length;A++)k=f(y,v[A],S),k!==null&&(g=s(k,g,A),O===null?w=k:O.sibling=k,O=k);return pe&&Ns(y,A),w}for(k=i(k);A<v.length;A++)R=d(k,y,A,v[A],S),R!==null&&(t&&R.alternate!==null&&k.delete(R.key===null?A:R.key),g=s(R,g,A),O===null?w=R:O.sibling=R,O=R);return t&&k.forEach(function(M){return e(y,M)}),pe&&Ns(y,A),w}function m(y,g,v,S){if(v==null)throw Error(D(151));for(var w=null,O=null,k=g,A=g=0,R=null,T=v.next();k!==null&&!T.done;A++,T=v.next()){k.index>A?(R=k,k=null):R=k.sibling;var M=h(y,k,T.value,S);if(M===null){k===null&&(k=R);break}t&&k&&M.alternate===null&&e(y,k),g=s(M,g,A),O===null?w=M:O.sibling=M,O=M,k=R}if(T.done)return n(y,k),pe&&Ns(y,A),w;if(k===null){for(;!T.done;A++,T=v.next())T=f(y,T.value,S),T!==null&&(g=s(T,g,A),O===null?w=T:O.sibling=T,O=T);return pe&&Ns(y,A),w}for(k=i(k);!T.done;A++,T=v.next())T=d(k,y,A,T.value,S),T!==null&&(t&&T.alternate!==null&&k.delete(T.key===null?A:T.key),g=s(T,g,A),O===null?w=T:O.sibling=T,O=T);return t&&k.forEach(function(C){return e(y,C)}),pe&&Ns(y,A),w}function b(y,g,v,S){if(typeof v=="object"&&v!==null&&v.type===Fo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Nf:e:{for(var w=v.key;g!==null;){if(g.key===w){if(w=v.type,w===Fo){if(g.tag===7){n(y,g.sibling),S=r(g,v.props.children),S.return=y,y=S;break e}}else if(g.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Mr&&Bw(w)===g.type){n(y,g.sibling),S=r(g,v.props),za(S,v),S.return=y,y=S;break e}n(y,g);break}else e(y,g);g=g.sibling}v.type===Fo?(S=Is(v.props.children,y.mode,S,v.key),S.return=y,y=S):(S=Jf(v.type,v.key,v.props,null,y.mode,S),za(S,v),S.return=y,y=S)}return o(y);case Va:e:{for(w=v.key;g!==null;){if(g.key===w)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(y,g.sibling),S=r(g,v.children||[]),S.return=y,y=S;break e}else{n(y,g);break}else e(y,g);g=g.sibling}S=kg(v,y.mode,S),S.return=y,y=S}return o(y);case Mr:return w=v._init,v=w(v._payload),b(y,g,v,S)}if($a(v))return p(y,g,v,S);if(Ba(v)){if(w=Ba(v),typeof w!="function")throw Error(D(150));return v=w.call(v),m(y,g,v,S)}if(typeof v.then=="function")return b(y,g,Uf(v),S);if(v.$$typeof===Zi)return b(y,g,zf(y,v),S);Ff(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,g!==null&&g.tag===6?(n(y,g.sibling),S=r(g,v),S.return=y,y=S):(n(y,g),S=wg(v,y.mode,S),S.return=y,y=S),o(y)):n(y,g)}return function(y,g,v,S){try{pc=0;var w=b(y,g,v,S);return ol=null,w}catch(k){if(k===Rc||k===Vh)throw k;var O=cn(29,k,null,y.mode);return O.lanes=S,O.return=y,O}}}var pl=$A(!0),YA=$A(!1),Ln=Ai(null),ki=null;function _r(t){var e=t.alternate;Pe(rt,rt.current&1),Pe(Ln,t),ki===null&&(e===null||hl.current!==null||e.memoizedState!==null)&&(ki=t)}function KA(t){if(t.tag===22){if(Pe(rt,rt.current),Pe(Ln,t),ki===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(ki=t)}}else Lr(t)}function Lr(){Pe(rt,rt.current),Pe(Ln,Ln.current)}function nr(t){dt(Ln),ki===t&&(ki=null),dt(rt)}var rt=Ai(0);function wh(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==="$?"||Ny(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)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}function Tg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Ne({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var gy={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=hn(),r=Ur(i);r.payload=e,n!=null&&(r.callback=n),e=Fr(t,r,i),e!==null&&(dn(e,t,i),Ja(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=hn(),r=Ur(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Fr(t,r,i),e!==null&&(dn(e,t,i),Ja(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=hn(),i=Ur(n);i.tag=2,e!=null&&(i.callback=e),e=Fr(t,i,n),e!==null&&(dn(e,t,n),Ja(e,t,n))}};function qw(t,e,n,i,r,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!fc(n,i)||!fc(r,s):!0}function Pw(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&gy.enqueueReplaceState(e,e.state,null)}function Vs(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=Ne({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var kh=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function GA(t){kh(t)}function QA(t){console.error(t)}function XA(t){kh(t)}function Ah(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function zw(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function yy(t,e,n){return n=Ur(n),n.tag=3,n.payload={element:null},n.callback=function(){Ah(t,e)},n}function WA(t){return t=Ur(t),t.tag=3,t}function ZA(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=i.value;t.payload=function(){return r(s)},t.callback=function(){zw(e,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){zw(e,n,i),typeof r!="function"&&(jr===null?jr=new Set([this]):jr.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function NP(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Dc(e,n,r,!0),n=Ln.current,n!==null){switch(n.tag){case 13:return ki===null?Oy():n.alternate===null&&Ve===0&&(Ve=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===cy?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),qg(t,i,r)),!1;case 22:return n.flags|=65536,i===cy?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),qg(t,i,r)),!1}throw Error(D(435,n.tag))}return qg(t,i,r),Oy(),!1}if(pe)return e=Ln.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==ry&&(t=Error(D(422),{cause:i}),hc(Nn(t,n)))):(i!==ry&&(e=Error(D(423),{cause:i}),hc(Nn(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=Nn(i,n),r=yy(t.stateNode,i,r),Ag(t,r),Ve!==4&&(Ve=2)),!1;var s=Error(D(520),{cause:i});if(s=Nn(s,n),sc===null?sc=[s]:sc.push(s),Ve!==4&&(Ve=2),e===null)return!0;i=Nn(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=yy(n.stateNode,i,t),Ag(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(jr===null||!jr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=WA(r),ZA(r,t,n,i),Ag(n,r),!1}n=n.return}while(n!==null);return!1}var JA=Error(D(461)),ht=!1;function gt(t,e,n,i){e.child=t===null?YA(e,null,n,i):pl(e,t.child,n,i)}function Hw(t,e,n,i,r){n=n.render;var s=e.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;return Fs(e),i=s0(t,e,n,o,s,r),l=o0(),t!==null&&!ht?(l0(t,e,r),lr(t,e,r)):(pe&&l&&Zy(e),e.flags|=1,gt(t,e,i,r),e.child)}function Uw(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!Wy(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,eO(t,e,s,i,r)):(t=Jf(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!g0(t,r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:fc,n(o,i)&&t.ref===e.ref)return lr(t,e,r)}return e.flags|=1,t=ir(s,i),t.ref=e.ref,t.return=e,e.child=t}function eO(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(fc(s,i)&&t.ref===e.ref)if(ht=!1,e.pendingProps=i=s,g0(t,r))(t.flags&131072)!==0&&(ht=!0);else return e.lanes=t.lanes,lr(t,e,r)}return by(t,e,n,i,r)}function tO(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if((e.flags&128)!==0){if(i=s!==null?s.baseLanes|n:n,t!==null){for(r=e.child=t.child,s=0;r!==null;)s=s|r.lanes|r.childLanes,r=r.sibling;e.childLanes=s&~i}else e.childLanes=0,e.child=null;return Fw(t,e,i,n)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&eh(e,s!==null?s.cachePool:null),s!==null?Dw(e,s):hy(),KA(e);else return e.lanes=e.childLanes=536870912,Fw(t,e,s!==null?s.baseLanes|n:n,n)}else s!==null?(eh(e,s.cachePool),Dw(e,s),Lr(e),e.memoizedState=null):(t!==null&&eh(e,null),hy(),Lr(e));return gt(t,e,r,n),e.child}function Fw(t,e,n,i){var r=t0();return r=r===null?null:{parent:it._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&eh(e,null),hy(),KA(e),t!==null&&Dc(t,e,i,!0),null}function ih(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(D(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function by(t,e,n,i,r){return Fs(e),n=s0(t,e,n,i,void 0,r),i=o0(),t!==null&&!ht?(l0(t,e,r),lr(t,e,r)):(pe&&i&&Zy(e),e.flags|=1,gt(t,e,n,r),e.child)}function jw(t,e,n,i,r,s){return Fs(e),e.updateQueue=null,n=pA(e,i,n,r),dA(t),i=o0(),t!==null&&!ht?(l0(t,e,s),lr(t,e,s)):(pe&&i&&Zy(e),e.flags|=1,gt(t,e,n,s),e.child)}function Vw(t,e,n,i,r){if(Fs(e),e.stateNode===null){var s=Xo,o=n.contextType;typeof o=="object"&&o!==null&&(s=Ot(o)),s=new n(i,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=gy,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=i,s.state=e.memoizedState,s.refs={},n0(e),o=n.contextType,s.context=typeof o=="object"&&o!==null?Ot(o):Xo,s.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Tg(e,n,o,i),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(o=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),o!==s.state&&gy.enqueueReplaceState(s,s.state,null),tc(e,i,s,r),ec(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){s=e.stateNode;var l=e.memoizedProps,a=Vs(n,l);s.props=a;var c=s.context,u=n.contextType;o=Xo,typeof u=="object"&&u!==null&&(o=Ot(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=e.pendingProps!==l,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||c!==o)&&Pw(e,s,i,o),Rr=!1;var h=e.memoizedState;s.state=h,tc(e,i,s,r),ec(),c=e.memoizedState,l||h!==c||Rr?(typeof f=="function"&&(Tg(e,n,f,i),c=e.memoizedState),(a=Rr||qw(e,n,a,i,h,c,o))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),s.props=i,s.state=c,s.context=o,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,uy(t,e),o=e.memoizedProps,u=Vs(n,o),s.props=u,f=e.pendingProps,h=s.context,c=n.contextType,a=Xo,typeof c=="object"&&c!==null&&(a=Ot(c)),l=n.getDerivedStateFromProps,(c=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==a)&&Pw(e,s,i,a),Rr=!1,h=e.memoizedState,s.state=h,tc(e,i,s,r),ec();var d=e.memoizedState;o!==f||h!==d||Rr||t!==null&&t.dependencies!==null&&yh(t.dependencies)?(typeof l=="function"&&(Tg(e,n,l,i),d=e.memoizedState),(u=Rr||qw(e,n,u,i,h,d,a)||t!==null&&t.dependencies!==null&&yh(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,d,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,d,a)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=d),s.props=i,s.state=d,s.context=a,i=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return s=i,ih(t,e),i=(e.flags&128)!==0,s||i?(s=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&i?(e.child=pl(e,t.child,null,r),e.child=pl(e,null,n,r)):gt(t,e,n,r),e.memoizedState=s.state,t=e.child):t=lr(t,e,r),t}function $w(t,e,n,i){return Ec(),e.flags|=256,gt(t,e,n,i),e.child}var Cg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Eg(t){return{baseLanes:t,cachePool:aA()}}function Dg(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=_n),t}function nO(t,e,n){var i=e.pendingProps,r=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(rt.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(pe){if(r?_r(e):Lr(e),pe){var l=je,a;if(a=l){e:{for(a=l,l=vi;a.nodeType!==8;){if(!l){l=null;break e}if(a=Wn(a.nextSibling),a===null){l=null;break e}}l=a}l!==null?(e.memoizedState={dehydrated:l,treeContext:Bs!==null?{id:Ji,overflow:er}:null,retryLane:536870912,hydrationErrors:null},a=cn(18,null,null,0),a.stateNode=l,a.return=e,e.child=a,qt=e,je=null,a=!0):a=!1}a||Us(e)}if(l=e.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return Ny(l)?e.lanes=32:e.lanes=536870912,null;nr(e)}return l=i.children,i=i.fallback,r?(Lr(e),r=e.mode,l=Oh({mode:"hidden",children:l},r),i=Is(i,r,n,null),l.return=e,i.return=e,l.sibling=i,e.child=l,r=e.child,r.memoizedState=Eg(n),r.childLanes=Dg(t,o,n),e.memoizedState=Cg,i):(_r(e),vy(e,l))}if(a=t.memoizedState,a!==null&&(l=a.dehydrated,l!==null)){if(s)e.flags&256?(_r(e),e.flags&=-257,e=Mg(t,e,n)):e.memoizedState!==null?(Lr(e),e.child=t.child,e.flags|=128,e=null):(Lr(e),r=i.fallback,l=e.mode,i=Oh({mode:"visible",children:i.children},l),r=Is(r,l,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,pl(e,t.child,null,n),i=e.child,i.memoizedState=Eg(n),i.childLanes=Dg(t,o,n),e.memoizedState=Cg,e=r);else if(_r(e),Ny(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var c=o.dgst;o=c,i=Error(D(419)),i.stack="",i.digest=o,hc({value:i,source:null,stack:null}),e=Mg(t,e,n)}else if(ht||Dc(t,e,n,!1),o=(n&t.childLanes)!==0,ht||o){if(o=Ce,o!==null&&(i=n&-n,i=(i&42)!==0?1:Hy(i),i=(i&(o.suspendedLanes|n))!==0?0:i,i!==0&&i!==a.retryLane))throw a.retryLane=i,xl(t,i),dn(o,t,i),JA;l.data==="$?"||Oy(),e=Mg(t,e,n)}else l.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=a.treeContext,je=Wn(l.nextSibling),qt=e,pe=!0,qs=null,vi=!1,t!==null&&(Dn[Mn++]=Ji,Dn[Mn++]=er,Dn[Mn++]=Bs,Ji=t.id,er=t.overflow,Bs=e),e=vy(e,i.children),e.flags|=4096);return e}return r?(Lr(e),r=i.fallback,l=e.mode,a=t.child,c=a.sibling,i=ir(a,{mode:"hidden",children:i.children}),i.subtreeFlags=a.subtreeFlags&65011712,c!==null?r=ir(c,r):(r=Is(r,l,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,l=t.child.memoizedState,l===null?l=Eg(n):(a=l.cachePool,a!==null?(c=it._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=aA(),l={baseLanes:l.baseLanes|n,cachePool:a}),r.memoizedState=l,r.childLanes=Dg(t,o,n),e.memoizedState=Cg,i):(_r(e),n=t.child,t=n.sibling,n=ir(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function vy(t,e){return e=Oh({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Oh(t,e){return t=cn(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Mg(t,e,n){return pl(e,t.child,null,n),t=vy(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Yw(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),oy(t.return,e,n)}function Rg(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function iO(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(gt(t,e,i.children,n),i=rt.current,(i&2)!==0)i=i&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Yw(t,n,e);else if(t.tag===19)Yw(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}i&=1}switch(Pe(rt,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&wh(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Rg(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&wh(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Rg(e,!0,n,null,s);break;case"together":Rg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function lr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Xr|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Dc(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(D(153));if(e.child!==null){for(t=e.child,n=ir(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ir(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function g0(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&yh(t)))}function _P(t,e,n){switch(e.tag){case 3:ch(e,e.stateNode.containerInfo),Nr(e,it,t.memoizedState.cache),Ec();break;case 27:case 5:Gg(e);break;case 4:ch(e,e.stateNode.containerInfo);break;case 10:Nr(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(_r(e),e.flags|=128,null):(n&e.child.childLanes)!==0?nO(t,e,n):(_r(e),t=lr(t,e,n),t!==null?t.sibling:null);_r(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Dc(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return iO(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Pe(rt,rt.current),i)break;return null;case 22:case 23:return e.lanes=0,tO(t,e,n);case 24:Nr(e,it,t.memoizedState.cache)}return lr(t,e,n)}function rO(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ht=!0;else{if(!g0(t,n)&&(e.flags&128)===0)return ht=!1,_P(t,e,n);ht=(t.flags&131072)!==0}else ht=!1,pe&&(e.flags&1048576)!==0&&oA(e,gh,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")Wy(i)?(t=Vs(i,t),e.tag=1,e=Vw(null,e,i,t,n)):(e.tag=0,e=by(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===qy){e.tag=11,e=Hw(null,e,i,t,n);break e}else if(r===Py){e.tag=14,e=Uw(null,e,i,t,n);break e}}throw e=Yg(i)||i,Error(D(306,e,""))}}return e;case 0:return by(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Vs(i,e.pendingProps),Vw(t,e,i,r,n);case 3:e:{if(ch(e,e.stateNode.containerInfo),t===null)throw Error(D(387));i=e.pendingProps;var s=e.memoizedState;r=s.element,uy(t,e),tc(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Nr(e,it,i),i!==s.cache&&ly(e,[it],n,!0),ec(),i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=$w(t,e,i,n);break e}else if(i!==r){r=Nn(Error(D(424)),e),hc(r),e=$w(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,je=Wn(t.firstChild),qt=e,pe=!0,qs=null,vi=!0,n=YA(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ec(),i===r){e=lr(t,e,n);break e}gt(t,e,i,n)}e=e.child}return e;case 26:return ih(t,e),t===null?(n=fk(e.type,null,e.pendingProps,null))?e.memoizedState=n:pe||(n=e.type,t=e.pendingProps,i=Nh(Hr.current).createElement(n),i[At]=e,i[Zt]=t,bt(i,n,t),ft(i),e.stateNode=i):e.memoizedState=fk(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Gg(e),t===null&&pe&&(i=e.stateNode=VO(e.type,e.pendingProps,Hr.current),qt=e,vi=!0,r=je,Zr(e.type)?(_y=r,je=Wn(i.firstChild)):je=r),gt(t,e,e.pendingProps.children,n),ih(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&pe&&((r=i=je)&&(i=sz(i,e.type,e.pendingProps,vi),i!==null?(e.stateNode=i,qt=e,je=Wn(i.firstChild),vi=!1,r=!0):r=!1),r||Us(e)),Gg(e),r=e.type,s=e.pendingProps,o=t!==null?t.memoizedProps:null,i=s.children,My(r,s)?i=null:o!==null&&My(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=s0(t,e,OP,null,null,n),bc._currentValue=r),ih(t,e),gt(t,e,i,n),e.child;case 6:return t===null&&pe&&((t=n=je)&&(n=oz(n,e.pendingProps,vi),n!==null?(e.stateNode=n,qt=e,je=null,t=!0):t=!1),t||Us(e)),null;case 13:return nO(t,e,n);case 4:return ch(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=pl(e,null,i,n):gt(t,e,i,n),e.child;case 11:return Hw(t,e,e.type,e.pendingProps,n);case 7:return gt(t,e,e.pendingProps,n),e.child;case 8:return gt(t,e,e.pendingProps.children,n),e.child;case 12:return gt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Nr(e,e.type,i.value),gt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,Fs(e),r=Ot(r),i=i(r),e.flags|=1,gt(t,e,i,n),e.child;case 14:return Uw(t,e,e.type,e.pendingProps,n);case 15:return eO(t,e,e.type,e.pendingProps,n);case 19:return iO(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=Oh(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=ir(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return tO(t,e,n);case 24:return Fs(e),i=Ot(it),t===null?(r=t0(),r===null&&(r=Ce,s=e0(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),e.memoizedState={parent:i,cache:r},n0(e),Nr(e,it,r)):((t.lanes&n)!==0&&(uy(t,e),tc(e,null,null,n),ec()),r=t.memoizedState,s=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Nr(e,it,i)):(i=s.cache,Nr(e,it,i),i!==r.cache&&ly(e,[it],n,!0))),gt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(D(156,e.tag))}function Qi(t){t.flags|=4}function Kw(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!KO(e)){if(e=Ln.current,e!==null&&((fe&4194048)===fe?ki!==null:(fe&62914560)!==fe&&(fe&536870912)===0||e!==ki))throw Za=cy,cA;t.flags|=8192}}function jf(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?Mk():536870912,t.lanes|=e,ml|=e)}function Ha(t,e){if(!pe)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 i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Ue(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function LP(t,e,n){var i=e.pendingProps;switch(Jy(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(e),null;case 1:return Ue(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),rr(it),al(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Pa(e)?Qi(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,kw())),Ue(e),null;case 26:return n=e.memoizedState,t===null?(Qi(e),n!==null?(Ue(e),Kw(e,n)):(Ue(e),e.flags&=-16777217)):n?n!==t.memoizedState?(Qi(e),Ue(e),Kw(e,n)):(Ue(e),e.flags&=-16777217):(t.memoizedProps!==i&&Qi(e),Ue(e),e.flags&=-16777217),null;case 27:uh(e),n=Hr.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Qi(e);else{if(!i){if(e.stateNode===null)throw Error(D(166));return Ue(e),null}t=xi.current,Pa(e)?xw(e,t):(t=VO(r,i,n),e.stateNode=t,Qi(e))}return Ue(e),null;case 5:if(uh(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Qi(e);else{if(!i){if(e.stateNode===null)throw Error(D(166));return Ue(e),null}if(t=xi.current,Pa(e))xw(e,t);else{switch(r=Nh(Hr.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[At]=e,t[Zt]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(bt(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Qi(e)}}return Ue(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Qi(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(D(166));if(t=Hr.current,Pa(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=qt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[At]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||UO(t.nodeValue,n)),t||Us(e)}else t=Nh(t).createTextNode(i),t[At]=e,e.stateNode=t}return Ue(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=Pa(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(D(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(D(317));r[At]=e}else Ec(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ue(e),r=!1}else r=kw(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(nr(e),e):(nr(e),null)}if(nr(e),(e.flags&128)!==0)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var s=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),jf(e,e.updateQueue),Ue(e),null;case 4:return al(),t===null&&A0(e.stateNode.containerInfo),Ue(e),null;case 10:return rr(e.type),Ue(e),null;case 19:if(dt(rt),r=e.memoizedState,r===null)return Ue(e),null;if(i=(e.flags&128)!==0,s=r.rendering,s===null)if(i)Ha(r,!1);else{if(Ve!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=wh(t),s!==null){for(e.flags|=128,Ha(r,!1),t=s.updateQueue,e.updateQueue=t,jf(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)sA(n,t),n=n.sibling;return Pe(rt,rt.current&1|2),e.child}t=t.sibling}r.tail!==null&&wi()>Ch&&(e.flags|=128,i=!0,Ha(r,!1),e.lanes=4194304)}else{if(!i)if(t=wh(s),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,jf(e,t),Ha(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!pe)return Ue(e),null}else 2*wi()-r.renderingStartTime>Ch&&n!==536870912&&(e.flags|=128,i=!0,Ha(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(t=r.last,t!==null?t.sibling=s:e.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=wi(),e.sibling=null,t=rt.current,Pe(rt,i?t&1|2:t&1),e):(Ue(e),null);case 22:case 23:return nr(e),i0(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Ue(e),e.subtreeFlags&6&&(e.flags|=8192)):Ue(e),n=e.updateQueue,n!==null&&jf(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&dt(Ps),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),rr(it),Ue(e),null;case 25:return null;case 30:return null}throw Error(D(156,e.tag))}function IP(t,e){switch(Jy(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return rr(it),al(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return uh(e),null;case 13:if(nr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(D(340));Ec()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return dt(rt),null;case 4:return al(),null;case 10:return rr(e.type),null;case 22:case 23:return nr(e),i0(),t!==null&&dt(Ps),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return rr(it),null;case 25:return null;default:return null}}function sO(t,e){switch(Jy(e),e.tag){case 3:rr(it),al();break;case 26:case 27:case 5:uh(e);break;case 4:al();break;case 13:nr(e);break;case 19:dt(rt);break;case 10:rr(e.type);break;case 22:case 23:nr(e),i0(),t!==null&&dt(Ps);break;case 24:rr(it)}}function Lc(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Oe(e,e.return,l)}}function Qr(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&t)===t){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=e;var a=n,c=l;try{c()}catch(u){Oe(r,a,u)}}}i=i.next}while(i!==s)}}catch(u){Oe(e,e.return,u)}}function oO(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{hA(e,n)}catch(i){Oe(t,t.return,i)}}}function lO(t,e,n){n.props=Vs(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){Oe(t,e,i)}}function ic(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){Oe(t,e,r)}}function Si(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Oe(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Oe(t,e,r)}else n.current=null}function aO(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Oe(t,t.return,r)}}function Ng(t,e,n){try{var i=t.stateNode;ez(i,t.type,n,e),i[Zt]=e}catch(r){Oe(t,t.return,r)}}function cO(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Zr(t.type)||t.tag===4}function _g(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||cO(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.tag===27&&Zr(t.type)||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 Sy(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Wh));else if(i!==4&&(i===27&&Zr(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Sy(t,e,n),t=t.sibling;t!==null;)Sy(t,e,n),t=t.sibling}function Th(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&Zr(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Th(t,e,n),t=t.sibling;t!==null;)Th(t,e,n),t=t.sibling}function uO(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);bt(e,i,n),e[At]=t,e[Zt]=n}catch(s){Oe(t,t.return,s)}}var Wi=!1,Ge=!1,Lg=!1,Gw=typeof WeakSet=="function"?WeakSet:Set,ut=null;function BP(t,e){if(t=t.containerInfo,Ey=Bh,t=Wk(t),Gy(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(a=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===r&&(l=o),h===s&&++u===i&&(a=o),(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(Dy={focusedElem:t,selectionRange:n},Bh=!1,ut=e;ut!==null;)if(e=ut,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,ut=t;else for(;ut!==null;){switch(e=ut,s=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,r=s.memoizedProps,s=s.memoizedState,i=n.stateNode;try{var p=Vs(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(p,s),i.__reactInternalSnapshotBeforeUpdate=t}catch(m){Oe(n,n.return,m)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Ry(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ry(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(D(163))}if(t=e.sibling,t!==null){t.return=e.return,ut=t;break}ut=e.return}}function fO(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Er(t,n),i&4&&Lc(5,n);break;case 1:if(Er(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(o){Oe(n,n.return,o)}else{var r=Vs(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){Oe(n,n.return,o)}}i&64&&oO(n),i&512&&ic(n,n.return);break;case 3:if(Er(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{hA(t,e)}catch(o){Oe(n,n.return,o)}}break;case 27:e===null&&i&4&&uO(n);case 26:case 5:Er(t,n),e===null&&i&4&&aO(n),i&512&&ic(n,n.return);break;case 12:Er(t,n);break;case 13:Er(t,n),i&4&&pO(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=$P.bind(null,n),lz(t,n))));break;case 22:if(i=n.memoizedState!==null||Wi,!i){e=e!==null&&e.memoizedState!==null||Ge,r=Wi;var s=Ge;Wi=i,(Ge=e)&&!s?Dr(t,n,(n.subtreeFlags&8772)!==0):Er(t,n),Wi=r,Ge=s}break;case 30:break;default:Er(t,n)}}function hO(t){var e=t.alternate;e!==null&&(t.alternate=null,hO(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Fy(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var qe=null,Xt=!1;function Xi(t,e,n){for(n=n.child;n!==null;)dO(t,e,n),n=n.sibling}function dO(t,e,n){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(kc,n)}catch{}switch(n.tag){case 26:Ge||Si(n,e),Xi(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ge||Si(n,e);var i=qe,r=Xt;Zr(n.type)&&(qe=n.stateNode,Xt=!1),Xi(t,e,n),lc(n.stateNode),qe=i,Xt=r;break;case 5:Ge||Si(n,e);case 6:if(i=qe,r=Xt,qe=null,Xi(t,e,n),qe=i,Xt=r,qe!==null)if(Xt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(s){Oe(n,e,s)}else try{qe.removeChild(n.stateNode)}catch(s){Oe(n,e,s)}break;case 18:qe!==null&&(Xt?(t=qe,ak(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),xc(t)):ak(qe,n.stateNode));break;case 4:i=qe,r=Xt,qe=n.stateNode.containerInfo,Xt=!0,Xi(t,e,n),qe=i,Xt=r;break;case 0:case 11:case 14:case 15:Ge||Qr(2,n,e),Ge||Qr(4,n,e),Xi(t,e,n);break;case 1:Ge||(Si(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&lO(n,e,i)),Xi(t,e,n);break;case 21:Xi(t,e,n);break;case 22:Ge=(i=Ge)||n.memoizedState!==null,Xi(t,e,n),Ge=i;break;default:Xi(t,e,n)}}function pO(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{xc(t)}catch(n){Oe(e,e.return,n)}}function qP(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new Gw),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new Gw),e;default:throw Error(D(435,t.tag))}}function Ig(t,e){var n=qP(t);e.forEach(function(i){var r=YP.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function on(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(Zr(l.type)){qe=l.stateNode,Xt=!1;break e}break;case 5:qe=l.stateNode,Xt=!1;break e;case 3:case 4:qe=l.stateNode.containerInfo,Xt=!0;break e}l=l.return}if(qe===null)throw Error(D(160));dO(s,o,r),qe=null,Xt=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)mO(e,t),e=e.sibling}var Xn=null;function mO(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:on(e,t),ln(t),i&4&&(Qr(3,t,t.return),Lc(3,t),Qr(5,t,t.return));break;case 1:on(e,t),ln(t),i&512&&(Ge||n===null||Si(n,n.return)),i&64&&Wi&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Xn;if(on(e,t),ln(t),i&512&&(Ge||n===null||Si(n,n.return)),i&4){var s=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Tc]||s[At]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(i),r.head.insertBefore(s,r.querySelector("head > title"))),bt(s,i,n),s[At]=t,ft(s),i=s;break e;case"link":var o=dk("link","href",r).get(i+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(s=o[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}s=r.createElement(i),bt(s,i,n),r.head.appendChild(s);break;case"meta":if(o=dk("meta","content",r).get(i+(n.content||""))){for(l=0;l<o.length;l++)if(s=o[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}s=r.createElement(i),bt(s,i,n),r.head.appendChild(s);break;default:throw Error(D(468,i))}s[At]=t,ft(s),i=s}t.stateNode=i}else pk(r,t.type,t.stateNode);else t.stateNode=hk(r,i,t.memoizedProps);else s!==i?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,i===null?pk(r,t.type,t.stateNode):hk(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Ng(t,t.memoizedProps,n.memoizedProps)}break;case 27:on(e,t),ln(t),i&512&&(Ge||n===null||Si(n,n.return)),n!==null&&i&4&&Ng(t,t.memoizedProps,n.memoizedProps);break;case 5:if(on(e,t),ln(t),i&512&&(Ge||n===null||Si(n,n.return)),t.flags&32){r=t.stateNode;try{ul(r,"")}catch(d){Oe(t,t.return,d)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Ng(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Lg=!0);break;case 6:if(on(e,t),ln(t),i&4){if(t.stateNode===null)throw Error(D(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(d){Oe(t,t.return,d)}}break;case 3:if(oh=null,r=Xn,Xn=_h(e.containerInfo),on(e,t),Xn=r,ln(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{xc(e.containerInfo)}catch(d){Oe(t,t.return,d)}Lg&&(Lg=!1,gO(t));break;case 4:i=Xn,Xn=_h(t.stateNode.containerInfo),on(e,t),ln(t),Xn=i;break;case 12:on(e,t),ln(t);break;case 13:on(e,t),ln(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(x0=wi()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Ig(t,i)));break;case 22:r=t.memoizedState!==null;var a=n!==null&&n.memoizedState!==null,c=Wi,u=Ge;if(Wi=c||r,Ge=u||a,on(e,t),Ge=u,Wi=c,ln(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||a||Wi||Ge||_s(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){a=n=e;try{if(s=a.stateNode,r)o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=a.stateNode;var f=a.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(d){Oe(a,a.return,d)}}}else if(e.tag===6){if(n===null){a=e;try{a.stateNode.nodeValue=r?"":a.memoizedProps}catch(d){Oe(a,a.return,d)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Ig(t,n))));break;case 19:on(e,t),ln(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,Ig(t,i)));break;case 30:break;case 21:break;default:on(e,t),ln(t)}}function ln(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(cO(i)){n=i;break}i=i.return}if(n==null)throw Error(D(160));switch(n.tag){case 27:var r=n.stateNode,s=_g(t);Th(t,s,r);break;case 5:var o=n.stateNode;n.flags&32&&(ul(o,""),n.flags&=-33);var l=_g(t);Th(t,l,o);break;case 3:case 4:var a=n.stateNode.containerInfo,c=_g(t);Sy(t,c,a);break;default:throw Error(D(161))}}catch(u){Oe(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function gO(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;gO(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Er(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)fO(t,e.alternate,e),e=e.sibling}function _s(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:Qr(4,e,e.return),_s(e);break;case 1:Si(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&lO(e,e.return,n),_s(e);break;case 27:lc(e.stateNode);case 26:case 5:Si(e,e.return),_s(e);break;case 22:e.memoizedState===null&&_s(e);break;case 30:_s(e);break;default:_s(e)}t=t.sibling}}function Dr(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,s=e,o=s.flags;switch(s.tag){case 0:case 11:case 15:Dr(r,s,n),Lc(4,s);break;case 1:if(Dr(r,s,n),i=s,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Oe(i,i.return,c)}if(i=s,r=i.updateQueue,r!==null){var l=i.stateNode;try{var a=r.shared.hiddenCallbacks;if(a!==null)for(r.shared.hiddenCallbacks=null,r=0;r<a.length;r++)fA(a[r],l)}catch(c){Oe(i,i.return,c)}}n&&o&64&&oO(s),ic(s,s.return);break;case 27:uO(s);case 26:case 5:Dr(r,s,n),n&&i===null&&o&4&&aO(s),ic(s,s.return);break;case 12:Dr(r,s,n);break;case 13:Dr(r,s,n),n&&o&4&&pO(r,s);break;case 22:s.memoizedState===null&&Dr(r,s,n),ic(s,s.return);break;case 30:break;default:Dr(r,s,n)}e=e.sibling}}function y0(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Mc(n))}function b0(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Mc(t))}function bi(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)yO(t,e,n,i),e=e.sibling}function yO(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:bi(t,e,n,i),r&2048&&Lc(9,e);break;case 1:bi(t,e,n,i);break;case 3:bi(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Mc(t)));break;case 12:if(r&2048){bi(t,e,n,i),t=e.stateNode;try{var s=e.memoizedProps,o=s.id,l=s.onPostCommit;typeof l=="function"&&l(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(a){Oe(e,e.return,a)}}else bi(t,e,n,i);break;case 13:bi(t,e,n,i);break;case 23:break;case 22:s=e.stateNode,o=e.alternate,e.memoizedState!==null?s._visibility&2?bi(t,e,n,i):rc(t,e):s._visibility&2?bi(t,e,n,i):(s._visibility|=2,Ho(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&y0(o,e);break;case 24:bi(t,e,n,i),r&2048&&b0(e.alternate,e);break;default:bi(t,e,n,i)}}function Ho(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var s=t,o=e,l=n,a=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:Ho(s,o,l,a,r),Lc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?Ho(s,o,l,a,r):rc(s,o):(u._visibility|=2,Ho(s,o,l,a,r)),r&&c&2048&&y0(o.alternate,o);break;case 24:Ho(s,o,l,a,r),r&&c&2048&&b0(o.alternate,o);break;default:Ho(s,o,l,a,r)}e=e.sibling}}function rc(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:rc(n,i),r&2048&&y0(i.alternate,i);break;case 24:rc(n,i),r&2048&&b0(i.alternate,i);break;default:rc(n,i)}e=e.sibling}}var Ka=8192;function qo(t){if(t.subtreeFlags&Ka)for(t=t.child;t!==null;)bO(t),t=t.sibling}function bO(t){switch(t.tag){case 26:qo(t),t.flags&Ka&&t.memoizedState!==null&&Sz(Xn,t.memoizedState,t.memoizedProps);break;case 5:qo(t);break;case 3:case 4:var e=Xn;Xn=_h(t.stateNode.containerInfo),qo(t),Xn=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=Ka,Ka=16777216,qo(t),Ka=e):qo(t));break;default:qo(t)}}function vO(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Ua(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,xO(i,t)}vO(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)SO(t),t=t.sibling}function SO(t){switch(t.tag){case 0:case 11:case 15:Ua(t),t.flags&2048&&Qr(9,t,t.return);break;case 3:Ua(t);break;case 12:Ua(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,rh(t)):Ua(t);break;default:Ua(t)}}function rh(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ut=i,xO(i,t)}vO(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:Qr(8,e,e.return),rh(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,rh(e));break;default:rh(e)}t=t.sibling}}function xO(t,e){for(;ut!==null;){var n=ut;switch(n.tag){case 0:case 11:case 15:Qr(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Mc(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ut=i;else e:for(n=t;ut!==null;){i=ut;var r=i.sibling,s=i.return;if(hO(i),i===n){ut=null;break e}if(r!==null){r.return=s,ut=r;break e}ut=s}}}var PP={getCacheForType:function(t){var e=Ot(it),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},zP=typeof WeakMap=="function"?WeakMap:Map,ve=0,Ce=null,ie=null,fe=0,be=0,an=null,Pr=!1,wl=!1,v0=!1,ar=0,Ve=0,Xr=0,zs=0,S0=0,_n=0,ml=0,sc=null,Wt=null,xy=!1,x0=0,Ch=1/0,Eh=null,jr=null,yt=0,Vr=null,gl=null,ll=0,wy=0,ky=null,wO=null,oc=0,Ay=null;function hn(){if((ve&2)!==0&&fe!==0)return fe&-fe;if(V.T!==null){var t=fl;return t!==0?t:k0()}return _k()}function kO(){_n===0&&(_n=(fe&536870912)===0||pe?Dk():536870912);var t=Ln.current;return t!==null&&(t.flags|=32),_n}function dn(t,e,n){(t===Ce&&(be===2||be===9)||t.cancelPendingCommit!==null)&&(yl(t,0),zr(t,fe,_n,!1)),Oc(t,n),((ve&2)===0||t!==Ce)&&(t===Ce&&((ve&2)===0&&(zs|=n),Ve===4&&zr(t,fe,_n,!1)),Oi(t))}function AO(t,e,n){if((ve&6)!==0)throw Error(D(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||Ac(t,e),r=i?FP(t,e):Bg(t,e,!0),s=i;do{if(r===0){wl&&!i&&zr(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!HP(n)){r=Bg(t,e,!1),s=!1;continue}if(r===2){if(s=e,t.errorRecoveryDisabledLanes&s)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var l=t;r=sc;var a=l.current.memoizedState.isDehydrated;if(a&&(yl(l,o).flags|=256),o=Bg(l,o,!1),o!==2){if(v0&&!a){l.errorRecoveryDisabledLanes|=s,zs|=s,r=4;break e}s=Wt,Wt=r,s!==null&&(Wt===null?Wt=s:Wt.push.apply(Wt,s))}r=o}if(s=!1,r!==2)continue}}if(r===1){yl(t,0),zr(t,e,0,!0);break}e:{switch(i=t,s=r,s){case 0:case 1:throw Error(D(345));case 4:if((e&4194048)!==e)break;case 6:zr(i,e,_n,!Pr);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(D(329))}if((e&62914560)===e&&(r=x0+300-wi(),10<r)){if(zr(i,e,_n,!Pr),Ph(i,0,!0)!==0)break e;i.timeoutHandle=jO(Qw.bind(null,i,n,Wt,Eh,xy,e,_n,zs,ml,Pr,s,2,-0,0),r);break e}Qw(i,n,Wt,Eh,xy,e,_n,zs,ml,Pr,s,0,-0,0)}}break}while(!0);Oi(t)}function Qw(t,e,n,i,r,s,o,l,a,c,u,f,h,d){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(yc={stylesheets:null,count:0,unsuspend:vz},bO(e),f=xz(),f!==null)){t.cancelPendingCommit=f(Ww.bind(null,t,e,s,n,i,r,o,l,a,u,1,h,d)),zr(t,s,o,!c);return}Ww(t,e,s,n,i,r,o,l,a)}function HP(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!pn(s(),r))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 zr(t,e,n,i){e&=~S0,e&=~zs,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var s=31-fn(r),o=1<<s;i[s]=-1,r&=~o}n!==0&&Rk(t,n,e)}function Gh(){return(ve&6)===0?(Ic(0,!1),!1):!0}function w0(){if(ie!==null){if(be===0)var t=ie.return;else t=ie,tr=Gs=null,a0(t),ol=null,pc=0,t=ie;for(;t!==null;)sO(t.alternate,t),t=t.return;ie=null}}function yl(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,nz(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),w0(),Ce=t,ie=n=ir(t.current,null),fe=e,be=0,an=null,Pr=!1,wl=Ac(t,e),v0=!1,ml=_n=S0=zs=Xr=Ve=0,Wt=sc=null,xy=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-fn(i),s=1<<r;e|=t[r],i&=~s}return ar=e,Fh(),n}function OO(t,e){W=null,V.H=xh,e===Rc||e===Vh?(e=Cw(),be=3):e===cA?(e=Cw(),be=4):be=e===JA?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,an=e,ie===null&&(Ve=1,Ah(t,Nn(e,t.current)))}function TO(){var t=V.H;return V.H=xh,t===null?xh:t}function CO(){var t=V.A;return V.A=PP,t}function Oy(){Ve=4,Pr||(fe&4194048)!==fe&&Ln.current!==null||(wl=!0),(Xr&134217727)===0&&(zs&134217727)===0||Ce===null||zr(Ce,fe,_n,!1)}function Bg(t,e,n){var i=ve;ve|=2;var r=TO(),s=CO();(Ce!==t||fe!==e)&&(Eh=null,yl(t,e)),e=!1;var o=Ve;e:do try{if(be!==0&&ie!==null){var l=ie,a=an;switch(be){case 8:w0(),o=6;break e;case 3:case 2:case 9:case 6:Ln.current===null&&(e=!0);var c=be;if(be=0,an=null,Jo(t,l,a,c),n&&wl){o=0;break e}break;default:c=be,be=0,an=null,Jo(t,l,a,c)}}UP(),o=Ve;break}catch(u){OO(t,u)}while(!0);return e&&t.shellSuspendCounter++,tr=Gs=null,ve=i,V.H=r,V.A=s,ie===null&&(Ce=null,fe=0,Fh()),o}function UP(){for(;ie!==null;)EO(ie)}function FP(t,e){var n=ve;ve|=2;var i=TO(),r=CO();Ce!==t||fe!==e?(Eh=null,Ch=wi()+500,yl(t,e)):wl=Ac(t,e);e:do try{if(be!==0&&ie!==null){e=ie;var s=an;t:switch(be){case 1:be=0,an=null,Jo(t,e,s,1);break;case 2:case 9:if(Tw(s)){be=0,an=null,Xw(e);break}e=function(){be!==2&&be!==9||Ce!==t||(be=7),Oi(t)},s.then(e,e);break e;case 3:be=7;break e;case 4:be=5;break e;case 7:Tw(s)?(be=0,an=null,Xw(e)):(be=0,an=null,Jo(t,e,s,7));break;case 5:var o=null;switch(ie.tag){case 26:o=ie.memoizedState;case 5:case 27:var l=ie;if(!o||KO(o)){be=0,an=null;var a=l.sibling;if(a!==null)ie=a;else{var c=l.return;c!==null?(ie=c,Qh(c)):ie=null}break t}}be=0,an=null,Jo(t,e,s,5);break;case 6:be=0,an=null,Jo(t,e,s,6);break;case 8:w0(),Ve=6;break e;default:throw Error(D(462))}}jP();break}catch(u){OO(t,u)}while(!0);return tr=Gs=null,V.H=i,V.A=r,ve=n,ie!==null?0:(Ce=null,fe=0,Fh(),Ve)}function jP(){for(;ie!==null&&!f5();)EO(ie)}function EO(t){var e=rO(t.alternate,t,ar);t.memoizedProps=t.pendingProps,e===null?Qh(t):ie=e}function Xw(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=jw(n,e,e.pendingProps,e.type,void 0,fe);break;case 11:e=jw(n,e,e.pendingProps,e.type.render,e.ref,fe);break;case 5:a0(e);default:sO(n,e),e=ie=sA(e,ar),e=rO(n,e,ar)}t.memoizedProps=t.pendingProps,e===null?Qh(t):ie=e}function Jo(t,e,n,i){tr=Gs=null,a0(e),ol=null,pc=0;var r=e.return;try{if(NP(t,r,e,n,fe)){Ve=1,Ah(t,Nn(n,t.current)),ie=null;return}}catch(s){if(r!==null)throw ie=r,s;Ve=1,Ah(t,Nn(n,t.current)),ie=null;return}e.flags&32768?(pe||i===1?t=!0:wl||(fe&536870912)!==0?t=!1:(Pr=t=!0,(i===2||i===9||i===3||i===6)&&(i=Ln.current,i!==null&&i.tag===13&&(i.flags|=16384))),DO(e,t)):Qh(e)}function Qh(t){var e=t;do{if((e.flags&32768)!==0){DO(e,Pr);return}t=e.return;var n=LP(e.alternate,e,ar);if(n!==null){ie=n;return}if(e=e.sibling,e!==null){ie=e;return}ie=e=t}while(e!==null);Ve===0&&(Ve=5)}function DO(t,e){do{var n=IP(t.alternate,t);if(n!==null){n.flags&=32767,ie=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){ie=t;return}ie=t=n}while(t!==null);Ve=6,ie=null}function Ww(t,e,n,i,r,s,o,l,a){t.cancelPendingCommit=null;do Xh();while(yt!==0);if((ve&6)!==0)throw Error(D(327));if(e!==null){if(e===t.current)throw Error(D(177));if(s=e.lanes|e.childLanes,s|=Qy,x5(t,n,s,o,l,a),t===Ce&&(ie=Ce=null,fe=0),gl=e,Vr=t,ll=n,wy=s,ky=r,wO=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,KP(fh,function(){return LO(!0),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=V.T,V.T=null,r=me.p,me.p=2,o=ve,ve|=4;try{BP(t,e,n)}finally{ve=o,me.p=r,V.T=i}}yt=1,MO(),RO(),NO()}}function MO(){if(yt===1){yt=0;var t=Vr,e=gl,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=V.T,V.T=null;var i=me.p;me.p=2;var r=ve;ve|=4;try{mO(e,t);var s=Dy,o=Wk(t.containerInfo),l=s.focusedElem,a=s.selectionRange;if(o!==l&&l&&l.ownerDocument&&Xk(l.ownerDocument.documentElement,l)){if(a!==null&&Gy(l)){var c=a.start,u=a.end;if(u===void 0&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var f=l.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var d=h.getSelection(),p=l.textContent.length,m=Math.min(a.start,p),b=a.end===void 0?m:Math.min(a.end,p);!d.extend&&m>b&&(o=b,b=m,m=o);var y=bw(l,m),g=bw(l,b);if(y&&g&&(d.rangeCount!==1||d.anchorNode!==y.node||d.anchorOffset!==y.offset||d.focusNode!==g.node||d.focusOffset!==g.offset)){var v=f.createRange();v.setStart(y.node,y.offset),d.removeAllRanges(),m>b?(d.addRange(v),d.extend(g.node,g.offset)):(v.setEnd(g.node,g.offset),d.addRange(v))}}}}for(f=[],d=l;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Bh=!!Ey,Dy=Ey=null}finally{ve=r,me.p=i,V.T=n}}t.current=e,yt=2}}function RO(){if(yt===2){yt=0;var t=Vr,e=gl,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=V.T,V.T=null;var i=me.p;me.p=2;var r=ve;ve|=4;try{fO(t,e.alternate,e)}finally{ve=r,me.p=i,V.T=n}}yt=3}}function NO(){if(yt===4||yt===3){yt=0,h5();var t=Vr,e=gl,n=ll,i=wO;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?yt=5:(yt=0,gl=Vr=null,_O(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(jr=null),Uy(n),e=e.stateNode,un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(kc,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=V.T,r=me.p,me.p=2,V.T=null;try{for(var s=t.onRecoverableError,o=0;o<i.length;o++){var l=i[o];s(l.value,{componentStack:l.stack})}}finally{V.T=e,me.p=r}}(ll&3)!==0&&Xh(),Oi(t),r=t.pendingLanes,(n&4194090)!==0&&(r&42)!==0?t===Ay?oc++:(oc=0,Ay=t):oc=0,Ic(0,!1)}}function _O(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Mc(e)))}function Xh(t){return MO(),RO(),NO(),LO(t)}function LO(){if(yt!==5)return!1;var t=Vr,e=wy;wy=0;var n=Uy(ll),i=V.T,r=me.p;try{me.p=32>n?32:n,V.T=null,n=ky,ky=null;var s=Vr,o=ll;if(yt=0,gl=Vr=null,ll=0,(ve&6)!==0)throw Error(D(331));var l=ve;if(ve|=4,SO(s.current),yO(s,s.current,o,n),ve=l,Ic(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(kc,s)}catch{}return!0}finally{me.p=r,V.T=i,_O(t,e)}}function Zw(t,e,n){e=Nn(n,e),e=yy(t.stateNode,e,2),t=Fr(t,e,2),t!==null&&(Oc(t,2),Oi(t))}function Oe(t,e,n){if(t.tag===3)Zw(t,t,n);else for(;e!==null;){if(e.tag===3){Zw(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(jr===null||!jr.has(i))){t=Nn(n,t),n=WA(2),i=Fr(e,n,2),i!==null&&(ZA(n,i,e,t),Oc(i,2),Oi(i));break}}e=e.return}}function qg(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new zP;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(v0=!0,r.add(n),t=VP.bind(null,t,e,n),e.then(t,t))}function VP(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ce===t&&(fe&n)===n&&(Ve===4||Ve===3&&(fe&62914560)===fe&&300>wi()-x0?(ve&2)===0&&yl(t,0):S0|=n,ml===fe&&(ml=0)),Oi(t)}function IO(t,e){e===0&&(e=Mk()),t=xl(t,e),t!==null&&(Oc(t,e),Oi(t))}function $P(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),IO(t,n)}function YP(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(D(314))}i!==null&&i.delete(e),IO(t,n)}function KP(t,e){return zy(t,e)}var Dh=null,Uo=null,Ty=!1,Mh=!1,Pg=!1,Hs=0;function Oi(t){t!==Uo&&t.next===null&&(Uo===null?Dh=Uo=t:Uo=Uo.next=t),Mh=!0,Ty||(Ty=!0,QP())}function Ic(t,e){if(!Pg&&Mh){Pg=!0;do for(var n=!1,i=Dh;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-fn(42|t)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,Jw(i,s))}else s=fe,s=Ph(i,i===Ce?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(s&3)===0||Ac(i,s)||(n=!0,Jw(i,s));i=i.next}while(n);Pg=!1}}function GP(){BO()}function BO(){Mh=Ty=!1;var t=0;Hs!==0&&(tz()&&(t=Hs),Hs=0);for(var e=wi(),n=null,i=Dh;i!==null;){var r=i.next,s=qO(i,e);s===0?(i.next=null,n===null?Dh=r:n.next=r,r===null&&(Uo=n)):(n=i,(t!==0||(s&3)!==0)&&(Mh=!0)),i=r}Ic(t,!1)}function qO(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var o=31-fn(s),l=1<<o,a=r[o];a===-1?((l&n)===0||(l&i)!==0)&&(r[o]=S5(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}if(e=Ce,n=fe,n=Ph(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(be===2||be===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&fg(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Ac(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&fg(i),Uy(n)){case 2:case 8:n=Ck;break;case 32:n=fh;break;case 268435456:n=Ek;break;default:n=fh}return i=PO.bind(null,t),n=zy(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&fg(i),t.callbackPriority=2,t.callbackNode=null,2}function PO(t,e){if(yt!==0&&yt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(Xh(!0)&&t.callbackNode!==n)return null;var i=fe;return i=Ph(t,t===Ce?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(AO(t,i,e),qO(t,wi()),t.callbackNode!=null&&t.callbackNode===n?PO.bind(null,t):null)}function Jw(t,e){if(Xh())return null;AO(t,e,!0)}function QP(){iz(function(){(ve&6)!==0?zy(Tk,GP):BO()})}function k0(){return Hs===0&&(Hs=Dk()),Hs}function ek(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Xf(""+t)}function tk(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function XP(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var s=ek((r[Zt]||null).action),o=i.submitter;o&&(e=(e=o[Zt]||null)?ek(e.formAction):o.getAttribute("formAction"),e!==null&&(s=e,o=null));var l=new zh("action","action",null,i,r);t.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Hs!==0){var a=o?tk(r,o):new FormData(r);my(n,{pending:!0,data:a,method:r.method,action:s},null,a)}}else typeof s=="function"&&(l.preventDefault(),a=o?tk(r,o):new FormData(r),my(n,{pending:!0,data:a,method:r.method,action:s},s,a))},currentTarget:r}]})}}for(Vf=0;Vf<iy.length;Vf++)$f=iy[Vf],nk=$f.toLowerCase(),ik=$f[0].toUpperCase()+$f.slice(1),Zn(nk,"on"+ik);var $f,nk,ik,Vf;Zn(Jk,"onAnimationEnd");Zn(eA,"onAnimationIteration");Zn(tA,"onAnimationStart");Zn("dblclick","onDoubleClick");Zn("focusin","onFocus");Zn("focusout","onBlur");Zn(mP,"onTransitionRun");Zn(gP,"onTransitionStart");Zn(yP,"onTransitionCancel");Zn(nA,"onTransitionEnd");cl("onMouseEnter",["mouseout","mouseover"]);cl("onMouseLeave",["mouseout","mouseover"]);cl("onPointerEnter",["pointerout","pointerover"]);cl("onPointerLeave",["pointerout","pointerover"]);$s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));$s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));$s("onBeforeInput",["compositionend","keypress","textInput","paste"]);$s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));$s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));$s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mc="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(" "),WP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(mc));function zO(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var l=i[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){kh(u)}r.currentTarget=null,s=a}else for(o=0;o<i.length;o++){if(l=i[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){kh(u)}r.currentTarget=null,s=a}}}}function ne(t,e){var n=e[Xg];n===void 0&&(n=e[Xg]=new Set);var i=t+"__bubble";n.has(i)||(HO(e,t,2,!1),n.add(i))}function zg(t,e,n){var i=0;e&&(i|=4),HO(n,t,i,e)}var Yf="_reactListening"+Math.random().toString(36).slice(2);function A0(t){if(!t[Yf]){t[Yf]=!0,Lk.forEach(function(n){n!=="selectionchange"&&(WP.has(n)||zg(n,!1,t),zg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Yf]||(e[Yf]=!0,zg("selectionchange",!1,e))}}function HO(t,e,n,i){switch(ZO(e)){case 2:var r=Az;break;case 8:r=Oz;break;default:r=E0}n=r.bind(null,e,n,t),r=void 0,!ey||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function Hg(t,e,n,i,r){var s=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=i.return;o!==null;){var a=o.tag;if((a===3||a===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=Vo(l),o===null)return;if(a=o.tag,a===5||a===6||a===26||a===27){i=s=o;continue e}l=l.parentNode}}i=i.return}Fk(function(){var c=s,u=Vy(n),f=[];e:{var h=iA.get(t);if(h!==void 0){var d=zh,p=t;switch(t){case"keypress":if(Zf(n)===0)break e;case"keydown":case"keyup":d=K5;break;case"focusin":p="focus",d=vg;break;case"focusout":p="blur",d=vg;break;case"beforeblur":case"afterblur":d=vg;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=cw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=I5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=X5;break;case Jk:case eA:case tA:d=P5;break;case nA:d=Z5;break;case"scroll":case"scrollend":d=_5;break;case"wheel":d=eP;break;case"copy":case"cut":case"paste":d=H5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=fw;break;case"toggle":case"beforetoggle":d=nP}var m=(e&4)!==0,b=!m&&(t==="scroll"||t==="scrollend"),y=m?h!==null?h+"Capture":null:h;m=[];for(var g=c,v;g!==null;){var S=g;if(v=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||v===null||y===null||(S=cc(g,y),S!=null&&m.push(gc(g,S,v))),b)break;g=g.return}0<m.length&&(h=new d(h,p,null,n,u),f.push({event:h,listeners:m}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",h&&n!==Jg&&(p=n.relatedTarget||n.fromElement)&&(Vo(p)||p[vl]))break e;if((d||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,d?(p=n.relatedTarget||n.toElement,d=c,p=p?Vo(p):null,p!==null&&(b=wc(p),m=p.tag,p!==b||m!==5&&m!==27&&m!==6)&&(p=null)):(d=null,p=c),d!==p)){if(m=cw,S="onMouseLeave",y="onMouseEnter",g="mouse",(t==="pointerout"||t==="pointerover")&&(m=fw,S="onPointerLeave",y="onPointerEnter",g="pointer"),b=d==null?h:Ya(d),v=p==null?h:Ya(p),h=new m(S,g+"leave",d,n,u),h.target=b,h.relatedTarget=v,S=null,Vo(u)===c&&(m=new m(y,g+"enter",p,n,u),m.target=v,m.relatedTarget=b,S=m),b=S,d&&p)t:{for(m=d,y=p,g=0,v=m;v;v=Po(v))g++;for(v=0,S=y;S;S=Po(S))v++;for(;0<g-v;)m=Po(m),g--;for(;0<v-g;)y=Po(y),v--;for(;g--;){if(m===y||y!==null&&m===y.alternate)break t;m=Po(m),y=Po(y)}m=null}else m=null;d!==null&&rk(f,h,d,m,!1),p!==null&&b!==null&&rk(f,b,p,m,!0)}}e:{if(h=c?Ya(c):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var w=mw;else if(pw(h))if(Gk)w=hP;else{w=uP;var O=cP}else d=h.nodeName,!d||d.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&jy(c.elementType)&&(w=mw):w=fP;if(w&&(w=w(t,c))){Kk(f,w,n,u);break e}O&&O(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&Zg(h,"number",h.value)}switch(O=c?Ya(c):window,t){case"focusin":(pw(O)||O.contentEditable==="true")&&(Ko=O,ty=c,Xa=null);break;case"focusout":Xa=ty=Ko=null;break;case"mousedown":ny=!0;break;case"contextmenu":case"mouseup":case"dragend":ny=!1,vw(f,n,u);break;case"selectionchange":if(pP)break;case"keydown":case"keyup":vw(f,n,u)}var k;if(Ky)e:{switch(t){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Yo?$k(t,n)&&(A="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Vk&&n.locale!=="ko"&&(Yo||A!=="onCompositionStart"?A==="onCompositionEnd"&&Yo&&(k=jk()):(qr=u,$y="value"in qr?qr.value:qr.textContent,Yo=!0)),O=Rh(c,A),0<O.length&&(A=new uw(A,t,null,n,u),f.push({event:A,listeners:O}),k?A.data=k:(k=Yk(n),k!==null&&(A.data=k)))),(k=rP?sP(t,n):oP(t,n))&&(A=Rh(c,"onBeforeInput"),0<A.length&&(O=new uw("onBeforeInput","beforeinput",null,n,u),f.push({event:O,listeners:A}),O.data=k)),XP(f,t,c,n,u)}zO(f,e)})}function gc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Rh(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=cc(t,n),r!=null&&i.unshift(gc(t,r,s)),r=cc(t,e),r!=null&&i.push(gc(t,r,s))),t.tag===3)return i;t=t.return}return[]}function Po(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function rk(t,e,n,i,r){for(var s=e._reactName,o=[];n!==null&&n!==i;){var l=n,a=l.alternate,c=l.stateNode;if(l=l.tag,a!==null&&a===i)break;l!==5&&l!==26&&l!==27||c===null||(a=c,r?(c=cc(n,s),c!=null&&o.unshift(gc(n,c,a))):r||(c=cc(n,s),c!=null&&o.push(gc(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var ZP=/\r\n?/g,JP=/\u0000|\uFFFD/g;function sk(t){return(typeof t=="string"?t:""+t).replace(ZP,`
|
|
9
|
-
`).replace(JP,"")}function UO(t,e){return e=sk(e),sk(t)===e}function Wh(){}function xe(t,e,n,i,r,s){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||ul(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&ul(t,""+i);break;case"className":If(t,"class",i);break;case"tabIndex":If(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":If(t,n,i);break;case"style":Uk(t,i,s);break;case"data":if(e!=="object"){If(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Xf(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&xe(t,e,"name",r.name,r,null),xe(t,e,"formEncType",r.formEncType,r,null),xe(t,e,"formMethod",r.formMethod,r,null),xe(t,e,"formTarget",r.formTarget,r,null)):(xe(t,e,"encType",r.encType,r,null),xe(t,e,"method",r.method,r,null),xe(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=Xf(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=Wh);break;case"onScroll":i!=null&&ne("scroll",t);break;case"onScrollEnd":i!=null&&ne("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(D(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(D(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=Xf(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":ne("beforetoggle",t),ne("toggle",t),Qf(t,"popover",i);break;case"xlinkActuate":Gi(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Gi(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Gi(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Gi(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Gi(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Gi(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Gi(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Gi(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Gi(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Qf(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=R5.get(n)||n,Qf(t,n,i))}}function Cy(t,e,n,i,r,s){switch(n){case"style":Uk(t,i,s);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(D(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(D(60));t.innerHTML=n}}break;case"children":typeof i=="string"?ul(t,i):(typeof i=="number"||typeof i=="bigint")&&ul(t,""+i);break;case"onScroll":i!=null&&ne("scroll",t);break;case"onScrollEnd":i!=null&&ne("scrollend",t);break;case"onClick":i!=null&&(t.onclick=Wh);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ik.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),s=t[Zt]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,r),typeof i=="function")){typeof s!="function"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):Qf(t,n,i)}}}function bt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ne("error",t),ne("load",t);var i=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var o=n[s];if(o!=null)switch(s){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:xe(t,e,s,o,n,null)}}r&&xe(t,e,"srcSet",n.srcSet,n,null),i&&xe(t,e,"src",n.src,n,null);return;case"input":ne("invalid",t);var l=s=o=r=null,a=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":o=u;break;case"checked":a=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(D(137,e));break;default:xe(t,e,i,u,n,null)}}Pk(t,s,l,a,c,o,r,!1),hh(t);return;case"select":ne("invalid",t),i=o=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:xe(t,e,r,l,n,null)}e=s,n=o,t.multiple=!!i,e!=null?tl(t,!!i,e,!1):n!=null&&tl(t,!!i,n,!0);return;case"textarea":ne("invalid",t),s=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(D(91));break;default:xe(t,e,o,l,n,null)}Hk(t,i,r,s),hh(t);return;case"option":for(a in n)n.hasOwnProperty(a)&&(i=n[a],i!=null)&&(a==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":xe(t,e,a,i,n,null));return;case"dialog":ne("beforetoggle",t),ne("toggle",t),ne("cancel",t),ne("close",t);break;case"iframe":case"object":ne("load",t);break;case"video":case"audio":for(i=0;i<mc.length;i++)ne(mc[i],t);break;case"image":ne("error",t),ne("load",t);break;case"details":ne("toggle",t);break;case"embed":case"source":case"link":ne("error",t),ne("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:xe(t,e,c,i,n,null)}return;default:if(jy(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Cy(t,e,u,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null&&xe(t,e,l,i,n,null))}function ez(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,o=null,l=null,a=null,c=null,u=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&f!=null)switch(d){case"checked":break;case"value":break;case"defaultValue":a=f;default:i.hasOwnProperty(d)||xe(t,e,d,null,i,f)}}for(var h in i){var d=i[h];if(f=n[h],i.hasOwnProperty(h)&&(d!=null||f!=null))switch(h){case"type":s=d;break;case"name":r=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":o=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(D(137,e));break;default:d!==f&&xe(t,e,h,d,i,f)}}Wg(t,o,l,a,c,u,s,r);return;case"select":d=o=l=h=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null)switch(s){case"value":break;case"multiple":d=a;default:i.hasOwnProperty(s)||xe(t,e,s,null,i,a)}for(r in i)if(s=i[r],a=n[r],i.hasOwnProperty(r)&&(s!=null||a!=null))switch(r){case"value":h=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==a&&xe(t,e,r,s,i,a)}e=l,n=o,i=d,h!=null?tl(t,!!n,h,!1):!!i!=!!n&&(e!=null?tl(t,!!n,e,!0):tl(t,!!n,n?[]:"",!1));return;case"textarea":d=h=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:xe(t,e,l,null,i,r)}for(o in i)if(r=i[o],s=n[o],i.hasOwnProperty(o)&&(r!=null||s!=null))switch(o){case"value":h=r;break;case"defaultValue":d=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(D(91));break;default:r!==s&&xe(t,e,o,r,i,s)}zk(t,h,d);return;case"option":for(var p in n)h=n[p],n.hasOwnProperty(p)&&h!=null&&!i.hasOwnProperty(p)&&(p==="selected"?t.selected=!1:xe(t,e,p,null,i,h));for(a in i)h=i[a],d=n[a],i.hasOwnProperty(a)&&h!==d&&(h!=null||d!=null)&&(a==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":xe(t,e,a,h,i,d));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var m in n)h=n[m],n.hasOwnProperty(m)&&h!=null&&!i.hasOwnProperty(m)&&xe(t,e,m,null,i,h);for(c in i)if(h=i[c],d=n[c],i.hasOwnProperty(c)&&h!==d&&(h!=null||d!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,e));break;default:xe(t,e,c,h,i,d)}return;default:if(jy(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&Cy(t,e,b,void 0,i,h);for(u in i)h=i[u],d=n[u],!i.hasOwnProperty(u)||h===d||h===void 0&&d===void 0||Cy(t,e,u,h,i,d);return}}for(var y in n)h=n[y],n.hasOwnProperty(y)&&h!=null&&!i.hasOwnProperty(y)&&xe(t,e,y,null,i,h);for(f in i)h=i[f],d=n[f],!i.hasOwnProperty(f)||h===d||h==null&&d==null||xe(t,e,f,h,i,d)}var Ey=null,Dy=null;function Nh(t){return t.nodeType===9?t:t.ownerDocument}function ok(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function FO(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function My(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Ug=null;function tz(){var t=window.event;return t&&t.type==="popstate"?t===Ug?!1:(Ug=t,!0):(Ug=null,!1)}var jO=typeof setTimeout=="function"?setTimeout:void 0,nz=typeof clearTimeout=="function"?clearTimeout:void 0,lk=typeof Promise=="function"?Promise:void 0,iz=typeof queueMicrotask=="function"?queueMicrotask:typeof lk<"u"?function(t){return lk.resolve(null).then(t).catch(rz)}:jO;function rz(t){setTimeout(function(){throw t})}function Zr(t){return t==="head"}function ak(t,e){var n=e,i=0,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(0<i&&8>i){n=i;var o=t.ownerDocument;if(n&1&&lc(o.documentElement),n&2&&lc(o.body),n&4)for(n=o.head,lc(n),o=n.firstChild;o;){var l=o.nextSibling,a=o.nodeName;o[Tc]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){t.removeChild(s),xc(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=s}while(n);xc(e)}function Ry(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Ry(n),Fy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function sz(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Tc])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=Wn(t.nextSibling),t===null)break}return null}function oz(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Wn(t.nextSibling),t===null))return null;return t}function Ny(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function lz(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Wn(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==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var _y=null;function ck(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}function VO(t,e,n){switch(e=Nh(n),t){case"html":if(t=e.documentElement,!t)throw Error(D(452));return t;case"head":if(t=e.head,!t)throw Error(D(453));return t;case"body":if(t=e.body,!t)throw Error(D(454));return t;default:throw Error(D(451))}}function lc(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Fy(t)}var In=new Map,uk=new Set;function _h(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var cr=me.d;me.d={f:az,r:cz,D:uz,C:fz,L:hz,m:dz,X:mz,S:pz,M:gz};function az(){var t=cr.f(),e=Gh();return t||e}function cz(t){var e=Sl(t);e!==null&&e.tag===5&&e.type==="form"?qA(e):cr.r(t)}var kl=typeof document>"u"?null:document;function $O(t,e,n){var i=kl;if(i&&typeof e=="string"&&e){var r=Rn(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),uk.has(r)||(uk.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),bt(e,"link",t),ft(e),i.head.appendChild(e)))}}function uz(t){cr.D(t),$O("dns-prefetch",t,null)}function fz(t,e){cr.C(t,e),$O("preconnect",t,e)}function hz(t,e,n){cr.L(t,e,n);var i=kl;if(i&&t&&e){var r='link[rel="preload"][as="'+Rn(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+Rn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+Rn(n.imageSizes)+'"]')):r+='[href="'+Rn(t)+'"]';var s=r;switch(e){case"style":s=bl(t);break;case"script":s=Al(t)}In.has(s)||(t=Ne({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),In.set(s,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Bc(s))||e==="script"&&i.querySelector(qc(s))||(e=i.createElement("link"),bt(e,"link",t),ft(e),i.head.appendChild(e)))}}function dz(t,e){cr.m(t,e);var n=kl;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+Rn(i)+'"][href="'+Rn(t)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Al(t)}if(!In.has(s)&&(t=Ne({rel:"modulepreload",href:t},e),In.set(s,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(qc(s)))return}i=n.createElement("link"),bt(i,"link",t),ft(i),n.head.appendChild(i)}}}function pz(t,e,n){cr.S(t,e,n);var i=kl;if(i&&t){var r=el(i).hoistableStyles,s=bl(t);e=e||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(Bc(s)))l.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},n),(n=In.get(s))&&O0(t,n);var a=o=i.createElement("link");ft(a),bt(a,"link",t),a._p=new Promise(function(c,u){a.onload=c,a.onerror=u}),a.addEventListener("load",function(){l.loading|=1}),a.addEventListener("error",function(){l.loading|=2}),l.loading|=4,sh(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function mz(t,e){cr.X(t,e);var n=kl;if(n&&t){var i=el(n).hoistableScripts,r=Al(t),s=i.get(r);s||(s=n.querySelector(qc(r)),s||(t=Ne({src:t,async:!0},e),(e=In.get(r))&&T0(t,e),s=n.createElement("script"),ft(s),bt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function gz(t,e){cr.M(t,e);var n=kl;if(n&&t){var i=el(n).hoistableScripts,r=Al(t),s=i.get(r);s||(s=n.querySelector(qc(r)),s||(t=Ne({src:t,async:!0,type:"module"},e),(e=In.get(r))&&T0(t,e),s=n.createElement("script"),ft(s),bt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function fk(t,e,n,i){var r=(r=Hr.current)?_h(r):null;if(!r)throw Error(D(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=bl(n.href),n=el(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=bl(n.href);var s=el(r).hoistableStyles,o=s.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,o),(s=r.querySelector(Bc(t)))&&!s._p&&(o.instance=s,o.state.loading=5),In.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},In.set(t,n),s||yz(r,t,n,o.state))),e&&i===null)throw Error(D(528,""));return o}if(e&&i!==null)throw Error(D(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Al(n),n=el(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,t))}}function bl(t){return'href="'+Rn(t)+'"'}function Bc(t){return'link[rel="stylesheet"]['+t+"]"}function YO(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function yz(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),bt(e,"link",n),ft(e),t.head.appendChild(e))}function Al(t){return'[src="'+Rn(t)+'"]'}function qc(t){return"script[async]"+t}function hk(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+Rn(n.href)+'"]');if(i)return e.instance=i,ft(i),i;var r=Ne({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ft(i),bt(i,"style",r),sh(i,n.precedence,t),e.instance=i;case"stylesheet":r=bl(n.href);var s=t.querySelector(Bc(r));if(s)return e.state.loading|=4,e.instance=s,ft(s),s;i=YO(n),(r=In.get(r))&&O0(i,r),s=(t.ownerDocument||t).createElement("link"),ft(s);var o=s;return o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),bt(s,"link",i),e.state.loading|=4,sh(s,n.precedence,t),e.instance=s;case"script":return s=Al(n.src),(r=t.querySelector(qc(s)))?(e.instance=r,ft(r),r):(i=n,(r=In.get(s))&&(i=Ne({},n),T0(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ft(r),bt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(D(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,sh(i,n.precedence,t));return e.instance}function sh(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===e)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function O0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function T0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var oh=null;function dk(t,e,n){if(oh===null){var i=new Map,r=oh=new Map;r.set(n,i)}else r=oh,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var s=n[r];if(!(s[Tc]||s[At]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var o=s.getAttribute(e)||"";o=t+o;var l=i.get(o);l?l.push(s):i.set(o,[s])}}return i}function pk(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function bz(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function KO(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var yc=null;function vz(){}function Sz(t,e,n){if(yc===null)throw Error(D(475));var i=yc;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var r=bl(n.href),s=t.querySelector(Bc(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=Lh.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=s,ft(s);return}s=t.ownerDocument||t,n=YO(n),(r=In.get(r))&&O0(n,r),s=s.createElement("link"),ft(s);var o=s;o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),bt(s,"link",n),e.instance=s}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(i.count++,e=Lh.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function xz(){if(yc===null)throw Error(D(475));var t=yc;return t.stylesheets&&t.count===0&&Ly(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&Ly(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function Lh(){if(this.count--,this.count===0){if(this.stylesheets)Ly(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ih=null;function Ly(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ih=new Map,e.forEach(wz,t),Ih=null,Lh.call(t))}function wz(t,e){if(!(e.state.loading&4)){var n=Ih.get(t);if(n)var i=n.get(null);else{n=new Map,Ih.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var o=r[s];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),s=n.get(o)||i,s===i&&n.set(null,r),n.set(o,r),this.count++,i=Lh.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),s?s.parentNode.insertBefore(r,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var bc={$$typeof:Zi,Provider:null,Consumer:null,_currentValue:Ls,_currentValue2:Ls,_threadCount:0};function kz(t,e,n,i,r,s,o,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=hg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hg(0),this.hiddenUpdates=hg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function GO(t,e,n,i,r,s,o,l,a,c,u,f){return t=new kz(t,e,n,o,l,a,c,f),e=1,s===!0&&(e|=24),s=cn(3,null,null,e),t.current=s,s.stateNode=t,e=e0(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:i,isDehydrated:n,cache:e},n0(s),t}function QO(t){return t?(t=Xo,t):Xo}function XO(t,e,n,i,r,s){r=QO(r),i.context===null?i.context=r:i.pendingContext=r,i=Ur(e),i.payload={element:n},s=s===void 0?null:s,s!==null&&(i.callback=s),n=Fr(t,i,e),n!==null&&(dn(n,t,e),Ja(n,t,e))}function mk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function C0(t,e){mk(t,e),(t=t.alternate)&&mk(t,e)}function WO(t){if(t.tag===13){var e=xl(t,67108864);e!==null&&dn(e,t,67108864),C0(t,67108864)}}var Bh=!0;function Az(t,e,n,i){var r=V.T;V.T=null;var s=me.p;try{me.p=2,E0(t,e,n,i)}finally{me.p=s,V.T=r}}function Oz(t,e,n,i){var r=V.T;V.T=null;var s=me.p;try{me.p=8,E0(t,e,n,i)}finally{me.p=s,V.T=r}}function E0(t,e,n,i){if(Bh){var r=Iy(i);if(r===null)Hg(t,e,i,qh,n),gk(t,i);else if(Cz(r,t,e,n,i))i.stopPropagation();else if(gk(t,i),e&4&&-1<Tz.indexOf(t)){for(;r!==null;){var s=Sl(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var o=Rs(s.pendingLanes);if(o!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var a=1<<31-fn(o);l.entanglements[1]|=a,o&=~a}Oi(s),(ve&6)===0&&(Ch=wi()+500,Ic(0,!1))}}break;case 13:l=xl(s,2),l!==null&&dn(l,s,2),Gh(),C0(s,2)}if(s=Iy(i),s===null&&Hg(t,e,i,qh,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else Hg(t,e,i,null,n)}}function Iy(t){return t=Vy(t),D0(t)}var qh=null;function D0(t){if(qh=null,t=Vo(t),t!==null){var e=wc(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=wk(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 qh=t,null}function ZO(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(d5()){case Tk:return 2;case Ck:return 8;case fh:case p5:return 32;case Ek:return 268435456;default:return 32}default:return 32}}var By=!1,$r=null,Yr=null,Kr=null,vc=new Map,Sc=new Map,Ir=[],Tz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function gk(t,e){switch(t){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":Yr=null;break;case"mouseover":case"mouseout":Kr=null;break;case"pointerover":case"pointerout":vc.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Sc.delete(e.pointerId)}}function Fa(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=Sl(e),e!==null&&WO(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function Cz(t,e,n,i,r){switch(e){case"focusin":return $r=Fa($r,t,e,n,i,r),!0;case"dragenter":return Yr=Fa(Yr,t,e,n,i,r),!0;case"mouseover":return Kr=Fa(Kr,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return vc.set(s,Fa(vc.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,Sc.set(s,Fa(Sc.get(s)||null,t,e,n,i,r)),!0}return!1}function JO(t){var e=Vo(t.target);if(e!==null){var n=wc(e);if(n!==null){if(e=n.tag,e===13){if(e=wk(n),e!==null){t.blockedOn=e,w5(t.priority,function(){if(n.tag===13){var i=hn();i=Hy(i);var r=xl(n,i);r!==null&&dn(r,n,i),C0(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function lh(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Iy(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);Jg=i,n.target.dispatchEvent(i),Jg=null}else return e=Sl(n),e!==null&&WO(e),t.blockedOn=n,!1;e.shift()}return!0}function yk(t,e,n){lh(t)&&n.delete(e)}function Ez(){By=!1,$r!==null&&lh($r)&&($r=null),Yr!==null&&lh(Yr)&&(Yr=null),Kr!==null&&lh(Kr)&&(Kr=null),vc.forEach(yk),Sc.forEach(yk)}function Kf(t,e){t.blockedOn===e&&(t.blockedOn=null,By||(By=!0,st.unstable_scheduleCallback(st.unstable_NormalPriority,Ez)))}var Gf=null;function bk(t){Gf!==t&&(Gf=t,st.unstable_scheduleCallback(st.unstable_NormalPriority,function(){Gf===t&&(Gf=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(D0(i||n)===null)continue;break}var s=Sl(n);s!==null&&(t.splice(e,3),e-=3,my(s,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function xc(t){function e(a){return Kf(a,t)}$r!==null&&Kf($r,t),Yr!==null&&Kf(Yr,t),Kr!==null&&Kf(Kr,t),vc.forEach(e),Sc.forEach(e);for(var n=0;n<Ir.length;n++){var i=Ir[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<Ir.length&&(n=Ir[0],n.blockedOn===null);)JO(n),n.blockedOn===null&&Ir.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],s=n[i+1],o=r[Zt]||null;if(typeof s=="function")o||bk(n);else if(o){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,o=s[Zt]||null)l=o.formAction;else if(D0(r)!==null)continue}else l=o.action;typeof l=="function"?n[i+1]=l:(n.splice(i,3),i-=3),bk(n)}}}function M0(t){this._internalRoot=t}Zh.prototype.render=M0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(D(409));var n=e.current,i=hn();XO(n,i,t,e,null,null)};Zh.prototype.unmount=M0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;XO(t.current,2,null,t,null,null),Gh(),e[vl]=null}};function Zh(t){this._internalRoot=t}Zh.prototype.unstable_scheduleHydration=function(t){if(t){var e=_k();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Ir.length&&e!==0&&e<Ir[n].priority;n++);Ir.splice(n,0,t),n===0&&JO(t)}};var vk=Sk.version;if(vk!=="19.1.0")throw Error(D(527,vk,"19.1.0"));me.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(D(188)):(t=Object.keys(t).join(","),Error(D(268,t)));return t=o5(e),t=t!==null?kk(t):null,t=t===null?null:t.stateNode,t};var Dz={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ja=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ja.isDisabled&&ja.supportsFiber))try{kc=ja.inject(Dz),un=ja}catch{}var ja;Jh.createRoot=function(t,e){if(!xk(t))throw Error(D(299));var n=!1,i="",r=GA,s=QA,o=XA,l=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(l=e.unstable_transitionCallbacks)),e=GO(t,1,!1,null,null,n,i,r,s,o,l,null),t[vl]=e.current,A0(t),new M0(e)};Jh.hydrateRoot=function(t,e,n){if(!xk(t))throw Error(D(299));var i=!1,r="",s=GA,o=QA,l=XA,a=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(a=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=GO(t,1,!0,e,n??null,i,r,s,o,l,a,c),e.context=QO(null),n=e.current,i=hn(),i=Hy(i),r=Ur(i),r.callback=null,Fr(n,r,i),n=i,e.current.lanes=n,Oc(e,n),Oi(e),t[vl]=e.current,A0(t),new Zh(e)};Jh.version="19.1.0"});var iT=x((Zre,nT)=>{"use strict";function tT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tT)}catch(t){console.error(t)}}tT(),nT.exports=eT()});var sT=x(ed=>{"use strict";var Mz=Symbol.for("react.transitional.element"),Rz=Symbol.for("react.fragment");function rT(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:Mz,type:t,key:i,ref:e!==void 0?e:null,props:n}}ed.Fragment=Rz;ed.jsx=rT;ed.jsxs=rT});var vt=x((nse,oT)=>{"use strict";oT.exports=sT()});var BR=x((mme,IR)=>{"use strict";function J$(){this.__data__=[],this.size=0}IR.exports=J$});var gm=x((gme,qR)=>{"use strict";function e7(t,e){return t===e||t!==t&&e!==e}qR.exports=e7});var rf=x((yme,PR)=>{"use strict";var t7=gm();function n7(t,e){for(var n=t.length;n--;)if(t7(t[n][0],e))return n;return-1}PR.exports=n7});var HR=x((bme,zR)=>{"use strict";var i7=rf(),r7=Array.prototype,s7=r7.splice;function o7(t){var e=this.__data__,n=i7(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():s7.call(e,n,1),--this.size,!0}zR.exports=o7});var FR=x((vme,UR)=>{"use strict";var l7=rf();function a7(t){var e=this.__data__,n=l7(e,t);return n<0?void 0:e[n][1]}UR.exports=a7});var VR=x((Sme,jR)=>{"use strict";var c7=rf();function u7(t){return c7(this.__data__,t)>-1}jR.exports=u7});var YR=x((xme,$R)=>{"use strict";var f7=rf();function h7(t,e){var n=this.__data__,i=f7(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}$R.exports=h7});var sf=x((wme,KR)=>{"use strict";var d7=BR(),p7=HR(),m7=FR(),g7=VR(),y7=YR();function va(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}va.prototype.clear=d7;va.prototype.delete=p7;va.prototype.get=m7;va.prototype.has=g7;va.prototype.set=y7;KR.exports=va});var QR=x((kme,GR)=>{"use strict";var b7=sf();function v7(){this.__data__=new b7,this.size=0}GR.exports=v7});var WR=x((Ame,XR)=>{"use strict";function S7(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}XR.exports=S7});var JR=x((Ome,ZR)=>{"use strict";function x7(t){return this.__data__.get(t)}ZR.exports=x7});var tN=x((Tme,eN)=>{"use strict";function w7(t){return this.__data__.has(t)}eN.exports=w7});var CS=x((Cme,nN)=>{"use strict";var k7=typeof global=="object"&&global&&global.Object===Object&&global;nN.exports=k7});var gi=x((Eme,iN)=>{"use strict";var A7=CS(),O7=typeof self=="object"&&self&&self.Object===Object&&self,T7=A7||O7||Function("return this")();iN.exports=T7});var Oo=x((Dme,rN)=>{"use strict";var C7=gi(),E7=C7.Symbol;rN.exports=E7});var aN=x((Mme,lN)=>{"use strict";var sN=Oo(),oN=Object.prototype,D7=oN.hasOwnProperty,M7=oN.toString,of=sN?sN.toStringTag:void 0;function R7(t){var e=D7.call(t,of),n=t[of];try{t[of]=void 0;var i=!0}catch{}var r=M7.call(t);return i&&(e?t[of]=n:delete t[of]),r}lN.exports=R7});var uN=x((Rme,cN)=>{"use strict";var N7=Object.prototype,_7=N7.toString;function L7(t){return _7.call(t)}cN.exports=L7});var To=x((Nme,dN)=>{"use strict";var fN=Oo(),I7=aN(),B7=uN(),q7="[object Null]",P7="[object Undefined]",hN=fN?fN.toStringTag:void 0;function z7(t){return t==null?t===void 0?P7:q7:hN&&hN in Object(t)?I7(t):B7(t)}dN.exports=z7});var As=x((_me,pN)=>{"use strict";function H7(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}pN.exports=H7});var lf=x((Lme,mN)=>{"use strict";var U7=To(),F7=As(),j7="[object AsyncFunction]",V7="[object Function]",$7="[object GeneratorFunction]",Y7="[object Proxy]";function K7(t){if(!F7(t))return!1;var e=U7(t);return e==V7||e==$7||e==j7||e==Y7}mN.exports=K7});var yN=x((Ime,gN)=>{"use strict";var G7=gi(),Q7=G7["__core-js_shared__"];gN.exports=Q7});var SN=x((Bme,vN)=>{"use strict";var ES=yN(),bN=(function(){var t=/[^.]+$/.exec(ES&&ES.keys&&ES.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function X7(t){return!!bN&&bN in t}vN.exports=X7});var DS=x((qme,xN)=>{"use strict";var W7=Function.prototype,Z7=W7.toString;function J7(t){if(t!=null){try{return Z7.call(t)}catch{}try{return t+""}catch{}}return""}xN.exports=J7});var kN=x((Pme,wN)=>{"use strict";var eY=lf(),tY=SN(),nY=As(),iY=DS(),rY=/[\\^$.*+?()[\]{}|]/g,sY=/^\[object .+?Constructor\]$/,oY=Function.prototype,lY=Object.prototype,aY=oY.toString,cY=lY.hasOwnProperty,uY=RegExp("^"+aY.call(cY).replace(rY,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fY(t){if(!nY(t)||tY(t))return!1;var e=eY(t)?uY:sY;return e.test(iY(t))}wN.exports=fY});var ON=x((zme,AN)=>{"use strict";function hY(t,e){return t?.[e]}AN.exports=hY});var Os=x((Hme,TN)=>{"use strict";var dY=kN(),pY=ON();function mY(t,e){var n=pY(t,e);return dY(n)?n:void 0}TN.exports=mY});var ym=x((Ume,CN)=>{"use strict";var gY=Os(),yY=gi(),bY=gY(yY,"Map");CN.exports=bY});var af=x((Fme,EN)=>{"use strict";var vY=Os(),SY=vY(Object,"create");EN.exports=SY});var RN=x((jme,MN)=>{"use strict";var DN=af();function xY(){this.__data__=DN?DN(null):{},this.size=0}MN.exports=xY});var _N=x((Vme,NN)=>{"use strict";function wY(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}NN.exports=wY});var IN=x(($me,LN)=>{"use strict";var kY=af(),AY="__lodash_hash_undefined__",OY=Object.prototype,TY=OY.hasOwnProperty;function CY(t){var e=this.__data__;if(kY){var n=e[t];return n===AY?void 0:n}return TY.call(e,t)?e[t]:void 0}LN.exports=CY});var qN=x((Yme,BN)=>{"use strict";var EY=af(),DY=Object.prototype,MY=DY.hasOwnProperty;function RY(t){var e=this.__data__;return EY?e[t]!==void 0:MY.call(e,t)}BN.exports=RY});var zN=x((Kme,PN)=>{"use strict";var NY=af(),_Y="__lodash_hash_undefined__";function LY(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=NY&&e===void 0?_Y:e,this}PN.exports=LY});var UN=x((Gme,HN)=>{"use strict";var IY=RN(),BY=_N(),qY=IN(),PY=qN(),zY=zN();function Sa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Sa.prototype.clear=IY;Sa.prototype.delete=BY;Sa.prototype.get=qY;Sa.prototype.has=PY;Sa.prototype.set=zY;HN.exports=Sa});var VN=x((Qme,jN)=>{"use strict";var FN=UN(),HY=sf(),UY=ym();function FY(){this.size=0,this.__data__={hash:new FN,map:new(UY||HY),string:new FN}}jN.exports=FY});var YN=x((Xme,$N)=>{"use strict";function jY(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}$N.exports=jY});var cf=x((Wme,KN)=>{"use strict";var VY=YN();function $Y(t,e){var n=t.__data__;return VY(e)?n[typeof e=="string"?"string":"hash"]:n.map}KN.exports=$Y});var QN=x((Zme,GN)=>{"use strict";var YY=cf();function KY(t){var e=YY(this,t).delete(t);return this.size-=e?1:0,e}GN.exports=KY});var WN=x((Jme,XN)=>{"use strict";var GY=cf();function QY(t){return GY(this,t).get(t)}XN.exports=QY});var JN=x((ege,ZN)=>{"use strict";var XY=cf();function WY(t){return XY(this,t).has(t)}ZN.exports=WY});var t_=x((tge,e_)=>{"use strict";var ZY=cf();function JY(t,e){var n=ZY(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}e_.exports=JY});var bm=x((nge,n_)=>{"use strict";var eK=VN(),tK=QN(),nK=WN(),iK=JN(),rK=t_();function xa(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}xa.prototype.clear=eK;xa.prototype.delete=tK;xa.prototype.get=nK;xa.prototype.has=iK;xa.prototype.set=rK;n_.exports=xa});var r_=x((ige,i_)=>{"use strict";var sK=sf(),oK=ym(),lK=bm(),aK=200;function cK(t,e){var n=this.__data__;if(n instanceof sK){var i=n.__data__;if(!oK||i.length<aK-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new lK(i)}return n.set(t,e),this.size=n.size,this}i_.exports=cK});var vm=x((rge,s_)=>{"use strict";var uK=sf(),fK=QR(),hK=WR(),dK=JR(),pK=tN(),mK=r_();function wa(t){var e=this.__data__=new uK(t);this.size=e.size}wa.prototype.clear=fK;wa.prototype.delete=hK;wa.prototype.get=dK;wa.prototype.has=pK;wa.prototype.set=mK;s_.exports=wa});var Sm=x((sge,o_)=>{"use strict";function gK(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}o_.exports=gK});var MS=x((oge,l_)=>{"use strict";var yK=Os(),bK=(function(){try{var t=yK(Object,"defineProperty");return t({},"",{}),t}catch{}})();l_.exports=bK});var RS=x((lge,c_)=>{"use strict";var a_=MS();function vK(t,e,n){e=="__proto__"&&a_?a_(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}c_.exports=vK});var NS=x((age,u_)=>{"use strict";var SK=RS(),xK=gm(),wK=Object.prototype,kK=wK.hasOwnProperty;function AK(t,e,n){var i=t[e];(!(kK.call(t,e)&&xK(i,n))||n===void 0&&!(e in t))&&SK(t,e,n)}u_.exports=AK});var uf=x((cge,f_)=>{"use strict";var OK=NS(),TK=RS();function CK(t,e,n,i){var r=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var l=e[s],a=i?i(n[l],t[l],l,n,t):void 0;a===void 0&&(a=t[l]),r?TK(n,l,a):OK(n,l,a)}return n}f_.exports=CK});var d_=x((uge,h_)=>{"use strict";function EK(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}h_.exports=EK});var ji=x((fge,p_)=>{"use strict";function DK(t){return t!=null&&typeof t=="object"}p_.exports=DK});var g_=x((hge,m_)=>{"use strict";var MK=To(),RK=ji(),NK="[object Arguments]";function _K(t){return RK(t)&&MK(t)==NK}m_.exports=_K});var ff=x((dge,v_)=>{"use strict";var y_=g_(),LK=ji(),b_=Object.prototype,IK=b_.hasOwnProperty,BK=b_.propertyIsEnumerable,qK=y_((function(){return arguments})())?y_:function(t){return LK(t)&&IK.call(t,"callee")&&!BK.call(t,"callee")};v_.exports=qK});var at=x((pge,S_)=>{"use strict";var PK=Array.isArray;S_.exports=PK});var w_=x((mge,x_)=>{"use strict";function zK(){return!1}x_.exports=zK});var Aa=x((hf,ka)=>{"use strict";var HK=gi(),UK=w_(),O_=typeof hf=="object"&&hf&&!hf.nodeType&&hf,k_=O_&&typeof ka=="object"&&ka&&!ka.nodeType&&ka,FK=k_&&k_.exports===O_,A_=FK?HK.Buffer:void 0,jK=A_?A_.isBuffer:void 0,VK=jK||UK;ka.exports=VK});var _S=x((gge,T_)=>{"use strict";var $K=9007199254740991,YK=/^(?:0|[1-9]\d*)$/;function KK(t,e){var n=typeof t;return e=e??$K,!!e&&(n=="number"||n!="symbol"&&YK.test(t))&&t>-1&&t%1==0&&t<e}T_.exports=KK});var xm=x((yge,C_)=>{"use strict";var GK=9007199254740991;function QK(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=GK}C_.exports=QK});var D_=x((bge,E_)=>{"use strict";var XK=To(),WK=xm(),ZK=ji(),JK="[object Arguments]",eG="[object Array]",tG="[object Boolean]",nG="[object Date]",iG="[object Error]",rG="[object Function]",sG="[object Map]",oG="[object Number]",lG="[object Object]",aG="[object RegExp]",cG="[object Set]",uG="[object String]",fG="[object WeakMap]",hG="[object ArrayBuffer]",dG="[object DataView]",pG="[object Float32Array]",mG="[object Float64Array]",gG="[object Int8Array]",yG="[object Int16Array]",bG="[object Int32Array]",vG="[object Uint8Array]",SG="[object Uint8ClampedArray]",xG="[object Uint16Array]",wG="[object Uint32Array]",Le={};Le[pG]=Le[mG]=Le[gG]=Le[yG]=Le[bG]=Le[vG]=Le[SG]=Le[xG]=Le[wG]=!0;Le[JK]=Le[eG]=Le[hG]=Le[tG]=Le[dG]=Le[nG]=Le[iG]=Le[rG]=Le[sG]=Le[oG]=Le[lG]=Le[aG]=Le[cG]=Le[uG]=Le[fG]=!1;function kG(t){return ZK(t)&&WK(t.length)&&!!Le[XK(t)]}E_.exports=kG});var wm=x((vge,M_)=>{"use strict";function AG(t){return function(e){return t(e)}}M_.exports=AG});var km=x((df,Oa)=>{"use strict";var OG=CS(),R_=typeof df=="object"&&df&&!df.nodeType&&df,pf=R_&&typeof Oa=="object"&&Oa&&!Oa.nodeType&&Oa,TG=pf&&pf.exports===R_,LS=TG&&OG.process,CG=(function(){try{var t=pf&&pf.require&&pf.require("util").types;return t||LS&&LS.binding&&LS.binding("util")}catch{}})();Oa.exports=CG});var mf=x((Sge,L_)=>{"use strict";var EG=D_(),DG=wm(),N_=km(),__=N_&&N_.isTypedArray,MG=__?DG(__):EG;L_.exports=MG});var IS=x((xge,I_)=>{"use strict";var RG=d_(),NG=ff(),_G=at(),LG=Aa(),IG=_S(),BG=mf(),qG=Object.prototype,PG=qG.hasOwnProperty;function zG(t,e){var n=_G(t),i=!n&&NG(t),r=!n&&!i&&LG(t),s=!n&&!i&&!r&&BG(t),o=n||i||r||s,l=o?RG(t.length,String):[],a=l.length;for(var c in t)(e||PG.call(t,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||IG(c,a)))&&l.push(c);return l}I_.exports=zG});var gf=x((wge,B_)=>{"use strict";var HG=Object.prototype;function UG(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||HG;return t===n}B_.exports=UG});var BS=x((kge,q_)=>{"use strict";function FG(t,e){return function(n){return t(e(n))}}q_.exports=FG});var z_=x((Age,P_)=>{"use strict";var jG=BS(),VG=jG(Object.keys,Object);P_.exports=VG});var Am=x((Oge,H_)=>{"use strict";var $G=gf(),YG=z_(),KG=Object.prototype,GG=KG.hasOwnProperty;function QG(t){if(!$G(t))return YG(t);var e=[];for(var n in Object(t))GG.call(t,n)&&n!="constructor"&&e.push(n);return e}H_.exports=QG});var Ts=x((Tge,U_)=>{"use strict";var XG=lf(),WG=xm();function ZG(t){return t!=null&&WG(t.length)&&!XG(t)}U_.exports=ZG});var Cs=x((Cge,F_)=>{"use strict";var JG=IS(),eQ=Am(),tQ=Ts();function nQ(t){return tQ(t)?JG(t):eQ(t)}F_.exports=nQ});var V_=x((Ege,j_)=>{"use strict";var iQ=uf(),rQ=Cs();function sQ(t,e){return t&&iQ(e,rQ(e),t)}j_.exports=sQ});var Y_=x((Dge,$_)=>{"use strict";function oQ(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}$_.exports=oQ});var G_=x((Mge,K_)=>{"use strict";var lQ=As(),aQ=gf(),cQ=Y_(),uQ=Object.prototype,fQ=uQ.hasOwnProperty;function hQ(t){if(!lQ(t))return cQ(t);var e=aQ(t),n=[];for(var i in t)i=="constructor"&&(e||!fQ.call(t,i))||n.push(i);return n}K_.exports=hQ});var Om=x((Rge,Q_)=>{"use strict";var dQ=IS(),pQ=G_(),mQ=Ts();function gQ(t){return mQ(t)?dQ(t,!0):pQ(t)}Q_.exports=gQ});var W_=x((Nge,X_)=>{"use strict";var yQ=uf(),bQ=Om();function vQ(t,e){return t&&yQ(e,bQ(e),t)}X_.exports=vQ});var nL=x((yf,Ta)=>{"use strict";var SQ=gi(),tL=typeof yf=="object"&&yf&&!yf.nodeType&&yf,Z_=tL&&typeof Ta=="object"&&Ta&&!Ta.nodeType&&Ta,xQ=Z_&&Z_.exports===tL,J_=xQ?SQ.Buffer:void 0,eL=J_?J_.allocUnsafe:void 0;function wQ(t,e){if(e)return t.slice();var n=t.length,i=eL?eL(n):new t.constructor(n);return t.copy(i),i}Ta.exports=wQ});var rL=x((_ge,iL)=>{"use strict";function kQ(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}iL.exports=kQ});var qS=x((Lge,sL)=>{"use strict";function AQ(t,e){for(var n=-1,i=t==null?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}sL.exports=AQ});var PS=x((Ige,oL)=>{"use strict";function OQ(){return[]}oL.exports=OQ});var Tm=x((Bge,aL)=>{"use strict";var TQ=qS(),CQ=PS(),EQ=Object.prototype,DQ=EQ.propertyIsEnumerable,lL=Object.getOwnPropertySymbols,MQ=lL?function(t){return t==null?[]:(t=Object(t),TQ(lL(t),function(e){return DQ.call(t,e)}))}:CQ;aL.exports=MQ});var uL=x((qge,cL)=>{"use strict";var RQ=uf(),NQ=Tm();function _Q(t,e){return RQ(t,NQ(t),e)}cL.exports=_Q});var Cm=x((Pge,fL)=>{"use strict";function LQ(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}fL.exports=LQ});var Em=x((zge,hL)=>{"use strict";var IQ=BS(),BQ=IQ(Object.getPrototypeOf,Object);hL.exports=BQ});var zS=x((Hge,dL)=>{"use strict";var qQ=Cm(),PQ=Em(),zQ=Tm(),HQ=PS(),UQ=Object.getOwnPropertySymbols,FQ=UQ?function(t){for(var e=[];t;)qQ(e,zQ(t)),t=PQ(t);return e}:HQ;dL.exports=FQ});var mL=x((Uge,pL)=>{"use strict";var jQ=uf(),VQ=zS();function $Q(t,e){return jQ(t,VQ(t),e)}pL.exports=$Q});var HS=x((Fge,gL)=>{"use strict";var YQ=Cm(),KQ=at();function GQ(t,e,n){var i=e(t);return KQ(t)?i:YQ(i,n(t))}gL.exports=GQ});var US=x((jge,yL)=>{"use strict";var QQ=HS(),XQ=Tm(),WQ=Cs();function ZQ(t){return QQ(t,WQ,XQ)}yL.exports=ZQ});var vL=x((Vge,bL)=>{"use strict";var JQ=HS(),eX=zS(),tX=Om();function nX(t){return JQ(t,tX,eX)}bL.exports=nX});var xL=x(($ge,SL)=>{"use strict";var iX=Os(),rX=gi(),sX=iX(rX,"DataView");SL.exports=sX});var kL=x((Yge,wL)=>{"use strict";var oX=Os(),lX=gi(),aX=oX(lX,"Promise");wL.exports=aX});var FS=x((Kge,AL)=>{"use strict";var cX=Os(),uX=gi(),fX=cX(uX,"Set");AL.exports=fX});var TL=x((Gge,OL)=>{"use strict";var hX=Os(),dX=gi(),pX=hX(dX,"WeakMap");OL.exports=pX});var Eo=x((Qge,_L)=>{"use strict";var jS=xL(),VS=ym(),$S=kL(),YS=FS(),KS=TL(),NL=To(),Ca=DS(),CL="[object Map]",mX="[object Object]",EL="[object Promise]",DL="[object Set]",ML="[object WeakMap]",RL="[object DataView]",gX=Ca(jS),yX=Ca(VS),bX=Ca($S),vX=Ca(YS),SX=Ca(KS),Co=NL;(jS&&Co(new jS(new ArrayBuffer(1)))!=RL||VS&&Co(new VS)!=CL||$S&&Co($S.resolve())!=EL||YS&&Co(new YS)!=DL||KS&&Co(new KS)!=ML)&&(Co=function(t){var e=NL(t),n=e==mX?t.constructor:void 0,i=n?Ca(n):"";if(i)switch(i){case gX:return RL;case yX:return CL;case bX:return EL;case vX:return DL;case SX:return ML}return e});_L.exports=Co});var IL=x((Xge,LL)=>{"use strict";var xX=Object.prototype,wX=xX.hasOwnProperty;function kX(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&wX.call(t,"index")&&(n.index=t.index,n.input=t.input),n}LL.exports=kX});var GS=x((Wge,BL)=>{"use strict";var AX=gi(),OX=AX.Uint8Array;BL.exports=OX});var Dm=x((Zge,PL)=>{"use strict";var qL=GS();function TX(t){var e=new t.constructor(t.byteLength);return new qL(e).set(new qL(t)),e}PL.exports=TX});var HL=x((Jge,zL)=>{"use strict";var CX=Dm();function EX(t,e){var n=e?CX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}zL.exports=EX});var FL=x((eye,UL)=>{"use strict";var DX=/\w*$/;function MX(t){var e=new t.constructor(t.source,DX.exec(t));return e.lastIndex=t.lastIndex,e}UL.exports=MX});var KL=x((tye,YL)=>{"use strict";var jL=Oo(),VL=jL?jL.prototype:void 0,$L=VL?VL.valueOf:void 0;function RX(t){return $L?Object($L.call(t)):{}}YL.exports=RX});var QL=x((nye,GL)=>{"use strict";var NX=Dm();function _X(t,e){var n=e?NX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}GL.exports=_X});var WL=x((iye,XL)=>{"use strict";var LX=Dm(),IX=HL(),BX=FL(),qX=KL(),PX=QL(),zX="[object Boolean]",HX="[object Date]",UX="[object Map]",FX="[object Number]",jX="[object RegExp]",VX="[object Set]",$X="[object String]",YX="[object Symbol]",KX="[object ArrayBuffer]",GX="[object DataView]",QX="[object Float32Array]",XX="[object Float64Array]",WX="[object Int8Array]",ZX="[object Int16Array]",JX="[object Int32Array]",eW="[object Uint8Array]",tW="[object Uint8ClampedArray]",nW="[object Uint16Array]",iW="[object Uint32Array]";function rW(t,e,n){var i=t.constructor;switch(e){case KX:return LX(t);case zX:case HX:return new i(+t);case GX:return IX(t,n);case QX:case XX:case WX:case ZX:case JX:case eW:case tW:case nW:case iW:return PX(t,n);case UX:return new i;case FX:case $X:return new i(t);case jX:return BX(t);case VX:return new i;case YX:return qX(t)}}XL.exports=rW});var QS=x((rye,JL)=>{"use strict";var sW=As(),ZL=Object.create,oW=(function(){function t(){}return function(e){if(!sW(e))return{};if(ZL)return ZL(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();JL.exports=oW});var tI=x((sye,eI)=>{"use strict";var lW=QS(),aW=Em(),cW=gf();function uW(t){return typeof t.constructor=="function"&&!cW(t)?lW(aW(t)):{}}eI.exports=uW});var iI=x((oye,nI)=>{"use strict";var fW=Eo(),hW=ji(),dW="[object Map]";function pW(t){return hW(t)&&fW(t)==dW}nI.exports=pW});var lI=x((lye,oI)=>{"use strict";var mW=iI(),gW=wm(),rI=km(),sI=rI&&rI.isMap,yW=sI?gW(sI):mW;oI.exports=yW});var cI=x((aye,aI)=>{"use strict";var bW=Eo(),vW=ji(),SW="[object Set]";function xW(t){return vW(t)&&bW(t)==SW}aI.exports=xW});var dI=x((cye,hI)=>{"use strict";var wW=cI(),kW=wm(),uI=km(),fI=uI&&uI.isSet,AW=fI?kW(fI):wW;hI.exports=AW});var bI=x((uye,yI)=>{"use strict";var OW=vm(),TW=Sm(),CW=NS(),EW=V_(),DW=W_(),MW=nL(),RW=rL(),NW=uL(),_W=mL(),LW=US(),IW=vL(),BW=Eo(),qW=IL(),PW=WL(),zW=tI(),HW=at(),UW=Aa(),FW=lI(),jW=As(),VW=dI(),$W=Cs(),YW=Om(),KW=1,GW=2,QW=4,pI="[object Arguments]",XW="[object Array]",WW="[object Boolean]",ZW="[object Date]",JW="[object Error]",mI="[object Function]",eZ="[object GeneratorFunction]",tZ="[object Map]",nZ="[object Number]",gI="[object Object]",iZ="[object RegExp]",rZ="[object Set]",sZ="[object String]",oZ="[object Symbol]",lZ="[object WeakMap]",aZ="[object ArrayBuffer]",cZ="[object DataView]",uZ="[object Float32Array]",fZ="[object Float64Array]",hZ="[object Int8Array]",dZ="[object Int16Array]",pZ="[object Int32Array]",mZ="[object Uint8Array]",gZ="[object Uint8ClampedArray]",yZ="[object Uint16Array]",bZ="[object Uint32Array]",Me={};Me[pI]=Me[XW]=Me[aZ]=Me[cZ]=Me[WW]=Me[ZW]=Me[uZ]=Me[fZ]=Me[hZ]=Me[dZ]=Me[pZ]=Me[tZ]=Me[nZ]=Me[gI]=Me[iZ]=Me[rZ]=Me[sZ]=Me[oZ]=Me[mZ]=Me[gZ]=Me[yZ]=Me[bZ]=!0;Me[JW]=Me[mI]=Me[lZ]=!1;function Mm(t,e,n,i,r,s){var o,l=e&KW,a=e&GW,c=e&QW;if(n&&(o=r?n(t,i,r,s):n(t)),o!==void 0)return o;if(!jW(t))return t;var u=HW(t);if(u){if(o=qW(t),!l)return RW(t,o)}else{var f=BW(t),h=f==mI||f==eZ;if(UW(t))return MW(t,l);if(f==gI||f==pI||h&&!r){if(o=a||h?{}:zW(t),!l)return a?_W(t,DW(o,t)):NW(t,EW(o,t))}else{if(!Me[f])return r?t:{};o=PW(t,f,l)}}s||(s=new OW);var d=s.get(t);if(d)return d;s.set(t,o),VW(t)?t.forEach(function(b){o.add(Mm(b,e,n,b,t,s))}):FW(t)&&t.forEach(function(b,y){o.set(y,Mm(b,e,n,y,t,s))});var p=c?a?IW:LW:a?YW:$W,m=u?void 0:p(t);return TW(m||t,function(b,y){m&&(y=b,b=t[y]),CW(o,y,Mm(b,e,n,y,t,s))}),o}yI.exports=Mm});var SI=x((fye,vI)=>{"use strict";var vZ=bI(),SZ=4;function xZ(t){return vZ(t,SZ)}vI.exports=xZ});var XS=x((hye,xI)=>{"use strict";function wZ(t){return function(){return t}}xI.exports=wZ});var kI=x((dye,wI)=>{"use strict";function kZ(t){return function(e,n,i){for(var r=-1,s=Object(e),o=i(e),l=o.length;l--;){var a=o[t?l:++r];if(n(s[a],a,s)===!1)break}return e}}wI.exports=kZ});var OI=x((pye,AI)=>{"use strict";var AZ=kI(),OZ=AZ();AI.exports=OZ});var WS=x((mye,TI)=>{"use strict";var TZ=OI(),CZ=Cs();function EZ(t,e){return t&&TZ(t,e,CZ)}TI.exports=EZ});var EI=x((gye,CI)=>{"use strict";var DZ=Ts();function MZ(t,e){return function(n,i){if(n==null)return n;if(!DZ(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=Object(n);(e?s--:++s<r)&&i(o[s],s,o)!==!1;);return n}}CI.exports=MZ});var bf=x((yye,DI)=>{"use strict";var RZ=WS(),NZ=EI(),_Z=NZ(RZ);DI.exports=_Z});var vf=x((bye,MI)=>{"use strict";function LZ(t){return t}MI.exports=LZ});var NI=x((vye,RI)=>{"use strict";var IZ=vf();function BZ(t){return typeof t=="function"?t:IZ}RI.exports=BZ});var LI=x((Sye,_I)=>{"use strict";var qZ=Sm(),PZ=bf(),zZ=NI(),HZ=at();function UZ(t,e){var n=HZ(t)?qZ:PZ;return n(t,zZ(e))}_I.exports=UZ});var BI=x((xye,II)=>{"use strict";II.exports=LI()});var PI=x((wye,qI)=>{"use strict";var FZ=bf();function jZ(t,e){var n=[];return FZ(t,function(i,r,s){e(i,r,s)&&n.push(i)}),n}qI.exports=jZ});var HI=x((kye,zI)=>{"use strict";var VZ="__lodash_hash_undefined__";function $Z(t){return this.__data__.set(t,VZ),this}zI.exports=$Z});var FI=x((Aye,UI)=>{"use strict";function YZ(t){return this.__data__.has(t)}UI.exports=YZ});var ZS=x((Oye,jI)=>{"use strict";var KZ=bm(),GZ=HI(),QZ=FI();function Rm(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new KZ;++e<n;)this.add(t[e])}Rm.prototype.add=Rm.prototype.push=GZ;Rm.prototype.has=QZ;jI.exports=Rm});var $I=x((Tye,VI)=>{"use strict";function XZ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}VI.exports=XZ});var JS=x((Cye,YI)=>{"use strict";function WZ(t,e){return t.has(e)}YI.exports=WZ});var ex=x((Eye,KI)=>{"use strict";var ZZ=ZS(),JZ=$I(),eJ=JS(),tJ=1,nJ=2;function iJ(t,e,n,i,r,s){var o=n&tJ,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&nJ?new ZZ:void 0;for(s.set(t,e),s.set(e,t);++f<l;){var p=t[f],m=e[f];if(i)var b=o?i(m,p,f,e,t,s):i(p,m,f,t,e,s);if(b!==void 0){if(b)continue;h=!1;break}if(d){if(!JZ(e,function(y,g){if(!eJ(d,g)&&(p===y||r(p,y,n,i,s)))return d.push(g)})){h=!1;break}}else if(!(p===m||r(p,m,n,i,s))){h=!1;break}}return s.delete(t),s.delete(e),h}KI.exports=iJ});var QI=x((Dye,GI)=>{"use strict";function rJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i,r){n[++e]=[r,i]}),n}GI.exports=rJ});var Nm=x((Mye,XI)=>{"use strict";function sJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}XI.exports=sJ});var tB=x((Rye,eB)=>{"use strict";var WI=Oo(),ZI=GS(),oJ=gm(),lJ=ex(),aJ=QI(),cJ=Nm(),uJ=1,fJ=2,hJ="[object Boolean]",dJ="[object Date]",pJ="[object Error]",mJ="[object Map]",gJ="[object Number]",yJ="[object RegExp]",bJ="[object Set]",vJ="[object String]",SJ="[object Symbol]",xJ="[object ArrayBuffer]",wJ="[object DataView]",JI=WI?WI.prototype:void 0,tx=JI?JI.valueOf:void 0;function kJ(t,e,n,i,r,s,o){switch(n){case wJ:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case xJ:return!(t.byteLength!=e.byteLength||!s(new ZI(t),new ZI(e)));case hJ:case dJ:case gJ:return oJ(+t,+e);case pJ:return t.name==e.name&&t.message==e.message;case yJ:case vJ:return t==e+"";case mJ:var l=aJ;case bJ:var a=i&uJ;if(l||(l=cJ),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;i|=fJ,o.set(t,e);var u=lJ(l(t),l(e),i,r,s,o);return o.delete(t),u;case SJ:if(tx)return tx.call(t)==tx.call(e)}return!1}eB.exports=kJ});var rB=x((Nye,iB)=>{"use strict";var nB=US(),AJ=1,OJ=Object.prototype,TJ=OJ.hasOwnProperty;function CJ(t,e,n,i,r,s){var o=n&AJ,l=nB(t),a=l.length,c=nB(e),u=c.length;if(a!=u&&!o)return!1;for(var f=a;f--;){var h=l[f];if(!(o?h in e:TJ.call(e,h)))return!1}var d=s.get(t),p=s.get(e);if(d&&p)return d==e&&p==t;var m=!0;s.set(t,e),s.set(e,t);for(var b=o;++f<a;){h=l[f];var y=t[h],g=e[h];if(i)var v=o?i(g,y,h,e,t,s):i(y,g,h,t,e,s);if(!(v===void 0?y===g||r(y,g,n,i,s):v)){m=!1;break}b||(b=h=="constructor")}if(m&&!b){var S=t.constructor,w=e.constructor;S!=w&&"constructor"in t&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof w=="function"&&w instanceof w)&&(m=!1)}return s.delete(t),s.delete(e),m}iB.exports=CJ});var hB=x((_ye,fB)=>{"use strict";var nx=vm(),EJ=ex(),DJ=tB(),MJ=rB(),sB=Eo(),oB=at(),lB=Aa(),RJ=mf(),NJ=1,aB="[object Arguments]",cB="[object Array]",_m="[object Object]",_J=Object.prototype,uB=_J.hasOwnProperty;function LJ(t,e,n,i,r,s){var o=oB(t),l=oB(e),a=o?cB:sB(t),c=l?cB:sB(e);a=a==aB?_m:a,c=c==aB?_m:c;var u=a==_m,f=c==_m,h=a==c;if(h&&lB(t)){if(!lB(e))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new nx),o||RJ(t)?EJ(t,e,n,i,r,s):DJ(t,e,a,n,i,r,s);if(!(n&NJ)){var d=u&&uB.call(t,"__wrapped__"),p=f&&uB.call(e,"__wrapped__");if(d||p){var m=d?t.value():t,b=p?e.value():e;return s||(s=new nx),r(m,b,n,i,s)}}return h?(s||(s=new nx),MJ(t,e,n,i,r,s)):!1}fB.exports=LJ});var ix=x((Lye,mB)=>{"use strict";var IJ=hB(),dB=ji();function pB(t,e,n,i,r){return t===e?!0:t==null||e==null||!dB(t)&&!dB(e)?t!==t&&e!==e:IJ(t,e,n,i,pB,r)}mB.exports=pB});var yB=x((Iye,gB)=>{"use strict";var BJ=vm(),qJ=ix(),PJ=1,zJ=2;function HJ(t,e,n,i){var r=n.length,s=r,o=!i;if(t==null)return!s;for(t=Object(t);r--;){var l=n[r];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++r<s;){l=n[r];var a=l[0],c=t[a],u=l[1];if(o&&l[2]){if(c===void 0&&!(a in t))return!1}else{var f=new BJ;if(i)var h=i(c,u,a,t,e,f);if(!(h===void 0?qJ(u,c,PJ|zJ,i,f):h))return!1}}return!0}gB.exports=HJ});var rx=x((Bye,bB)=>{"use strict";var UJ=As();function FJ(t){return t===t&&!UJ(t)}bB.exports=FJ});var SB=x((qye,vB)=>{"use strict";var jJ=rx(),VJ=Cs();function $J(t){for(var e=VJ(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,jJ(r)]}return e}vB.exports=$J});var sx=x((Pye,xB)=>{"use strict";function YJ(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}xB.exports=YJ});var kB=x((zye,wB)=>{"use strict";var KJ=yB(),GJ=SB(),QJ=sx();function XJ(t){var e=GJ(t);return e.length==1&&e[0][2]?QJ(e[0][0],e[0][1]):function(n){return n===t||KJ(n,t,e)}}wB.exports=XJ});var Lm=x((Hye,AB)=>{"use strict";var WJ=To(),ZJ=ji(),JJ="[object Symbol]";function eee(t){return typeof t=="symbol"||ZJ(t)&&WJ(t)==JJ}AB.exports=eee});var Im=x((Uye,OB)=>{"use strict";var tee=at(),nee=Lm(),iee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ree=/^\w*$/;function see(t,e){if(tee(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||nee(t)?!0:ree.test(t)||!iee.test(t)||e!=null&&t in Object(e)}OB.exports=see});var EB=x((Fye,CB)=>{"use strict";var TB=bm(),oee="Expected a function";function ox(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(oee);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(ox.Cache||TB),n}ox.Cache=TB;CB.exports=ox});var MB=x((jye,DB)=>{"use strict";var lee=EB(),aee=500;function cee(t){var e=lee(t,function(i){return n.size===aee&&n.clear(),i}),n=e.cache;return e}DB.exports=cee});var NB=x((Vye,RB)=>{"use strict";var uee=MB(),fee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hee=/\\(\\)?/g,dee=uee(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(fee,function(n,i,r,s){e.push(r?s.replace(hee,"$1"):i||n)}),e});RB.exports=dee});var Bm=x(($ye,_B)=>{"use strict";function pee(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}_B.exports=pee});var zB=x((Yye,PB)=>{"use strict";var LB=Oo(),mee=Bm(),gee=at(),yee=Lm(),bee=1/0,IB=LB?LB.prototype:void 0,BB=IB?IB.toString:void 0;function qB(t){if(typeof t=="string")return t;if(gee(t))return mee(t,qB)+"";if(yee(t))return BB?BB.call(t):"";var e=t+"";return e=="0"&&1/t==-bee?"-0":e}PB.exports=qB});var UB=x((Kye,HB)=>{"use strict";var vee=zB();function See(t){return t==null?"":vee(t)}HB.exports=See});var lx=x((Gye,FB)=>{"use strict";var xee=at(),wee=Im(),kee=NB(),Aee=UB();function Oee(t,e){return xee(t)?t:wee(t,e)?[t]:kee(Aee(t))}FB.exports=Oee});var Sf=x((Qye,jB)=>{"use strict";var Tee=Lm(),Cee=1/0;function Eee(t){if(typeof t=="string"||Tee(t))return t;var e=t+"";return e=="0"&&1/t==-Cee?"-0":e}jB.exports=Eee});var ax=x((Xye,VB)=>{"use strict";var Dee=lx(),Mee=Sf();function Ree(t,e){e=Dee(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[Mee(e[n++])];return n&&n==i?t:void 0}VB.exports=Ree});var YB=x((Wye,$B)=>{"use strict";var Nee=ax();function _ee(t,e,n){var i=t==null?void 0:Nee(t,e);return i===void 0?n:i}$B.exports=_ee});var GB=x((Zye,KB)=>{"use strict";function Lee(t,e){return t!=null&&e in Object(t)}KB.exports=Lee});var cx=x((Jye,QB)=>{"use strict";var Iee=lx(),Bee=ff(),qee=at(),Pee=_S(),zee=xm(),Hee=Sf();function Uee(t,e,n){e=Iee(e,t);for(var i=-1,r=e.length,s=!1;++i<r;){var o=Hee(e[i]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=t==null?0:t.length,!!r&&zee(r)&&Pee(o,r)&&(qee(t)||Bee(t)))}QB.exports=Uee});var WB=x((e0e,XB)=>{"use strict";var Fee=GB(),jee=cx();function Vee(t,e){return t!=null&&jee(t,e,Fee)}XB.exports=Vee});var JB=x((t0e,ZB)=>{"use strict";var $ee=ix(),Yee=YB(),Kee=WB(),Gee=Im(),Qee=rx(),Xee=sx(),Wee=Sf(),Zee=1,Jee=2;function ete(t,e){return Gee(t)&&Qee(e)?Xee(Wee(t),e):function(n){var i=Yee(n,t);return i===void 0&&i===e?Kee(n,t):$ee(e,i,Zee|Jee)}}ZB.exports=ete});var ux=x((n0e,e3)=>{"use strict";function tte(t){return function(e){return e?.[t]}}e3.exports=tte});var n3=x((i0e,t3)=>{"use strict";var nte=ax();function ite(t){return function(e){return nte(e,t)}}t3.exports=ite});var r3=x((r0e,i3)=>{"use strict";var rte=ux(),ste=n3(),ote=Im(),lte=Sf();function ate(t){return ote(t)?rte(lte(t)):ste(t)}i3.exports=ate});var xf=x((s0e,s3)=>{"use strict";var cte=kB(),ute=JB(),fte=vf(),hte=at(),dte=r3();function pte(t){return typeof t=="function"?t:t==null?fte:typeof t=="object"?hte(t)?ute(t[0],t[1]):cte(t):dte(t)}s3.exports=pte});var l3=x((o0e,o3)=>{"use strict";var mte=qS(),gte=PI(),yte=xf(),bte=at();function vte(t,e){var n=bte(t)?mte:gte;return n(t,yte(e,3))}o3.exports=vte});var c3=x((l0e,a3)=>{"use strict";var Ste=Object.prototype,xte=Ste.hasOwnProperty;function wte(t,e){return t!=null&&xte.call(t,e)}a3.exports=wte});var f3=x((a0e,u3)=>{"use strict";var kte=c3(),Ate=cx();function Ote(t,e){return t!=null&&Ate(t,e,kte)}u3.exports=Ote});var d3=x((c0e,h3)=>{"use strict";var Tte=Am(),Cte=Eo(),Ete=ff(),Dte=at(),Mte=Ts(),Rte=Aa(),Nte=gf(),_te=mf(),Lte="[object Map]",Ite="[object Set]",Bte=Object.prototype,qte=Bte.hasOwnProperty;function Pte(t){if(t==null)return!0;if(Mte(t)&&(Dte(t)||typeof t=="string"||typeof t.splice=="function"||Rte(t)||_te(t)||Ete(t)))return!t.length;var e=Cte(t);if(e==Lte||e==Ite)return!t.size;if(Nte(t))return!Tte(t).length;for(var n in t)if(qte.call(t,n))return!1;return!0}h3.exports=Pte});var m3=x((u0e,p3)=>{"use strict";function zte(t){return t===void 0}p3.exports=zte});var y3=x((f0e,g3)=>{"use strict";var Hte=bf(),Ute=Ts();function Fte(t,e){var n=-1,i=Ute(t)?Array(t.length):[];return Hte(t,function(r,s,o){i[++n]=e(r,s,o)}),i}g3.exports=Fte});var v3=x((h0e,b3)=>{"use strict";var jte=Bm(),Vte=xf(),$te=y3(),Yte=at();function Kte(t,e){var n=Yte(t)?jte:$te;return n(t,Vte(e,3))}b3.exports=Kte});var x3=x((d0e,S3)=>{"use strict";function Gte(t,e,n,i){var r=-1,s=t==null?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}S3.exports=Gte});var k3=x((p0e,w3)=>{"use strict";function Qte(t,e,n,i,r){return r(t,function(s,o,l){n=i?(i=!1,s):e(n,s,o,l)}),n}w3.exports=Qte});var O3=x((m0e,A3)=>{"use strict";var Xte=x3(),Wte=bf(),Zte=xf(),Jte=k3(),ene=at();function tne(t,e,n){var i=ene(t)?Xte:Jte,r=arguments.length<3;return i(t,Zte(e,4),n,r,Wte)}A3.exports=tne});var C3=x((g0e,T3)=>{"use strict";var nne=To(),ine=at(),rne=ji(),sne="[object String]";function one(t){return typeof t=="string"||!ine(t)&&rne(t)&&nne(t)==sne}T3.exports=one});var D3=x((y0e,E3)=>{"use strict";var lne=ux(),ane=lne("length");E3.exports=ane});var R3=x((b0e,M3)=>{"use strict";var cne="\\ud800-\\udfff",une="\\u0300-\\u036f",fne="\\ufe20-\\ufe2f",hne="\\u20d0-\\u20ff",dne=une+fne+hne,pne="\\ufe0e\\ufe0f",mne="\\u200d",gne=RegExp("["+mne+cne+dne+pne+"]");function yne(t){return gne.test(t)}M3.exports=yne});var H3=x((v0e,z3)=>{"use strict";var _3="\\ud800-\\udfff",bne="\\u0300-\\u036f",vne="\\ufe20-\\ufe2f",Sne="\\u20d0-\\u20ff",xne=bne+vne+Sne,wne="\\ufe0e\\ufe0f",kne="["+_3+"]",fx="["+xne+"]",hx="\\ud83c[\\udffb-\\udfff]",Ane="(?:"+fx+"|"+hx+")",L3="[^"+_3+"]",I3="(?:\\ud83c[\\udde6-\\uddff]){2}",B3="[\\ud800-\\udbff][\\udc00-\\udfff]",One="\\u200d",q3=Ane+"?",P3="["+wne+"]?",Tne="(?:"+One+"(?:"+[L3,I3,B3].join("|")+")"+P3+q3+")*",Cne=P3+q3+Tne,Ene="(?:"+[L3+fx+"?",fx,I3,B3,kne].join("|")+")",N3=RegExp(hx+"(?="+hx+")|"+Ene+Cne,"g");function Dne(t){for(var e=N3.lastIndex=0;N3.test(t);)++e;return e}z3.exports=Dne});var F3=x((S0e,U3)=>{"use strict";var Mne=D3(),Rne=R3(),Nne=H3();function _ne(t){return Rne(t)?Nne(t):Mne(t)}U3.exports=_ne});var V3=x((x0e,j3)=>{"use strict";var Lne=Am(),Ine=Eo(),Bne=Ts(),qne=C3(),Pne=F3(),zne="[object Map]",Hne="[object Set]";function Une(t){if(t==null)return 0;if(Bne(t))return qne(t)?Pne(t):t.length;var e=Ine(t);return e==zne||e==Hne?t.size:Lne(t).length}j3.exports=Une});var Y3=x((w0e,$3)=>{"use strict";var Fne=Sm(),jne=QS(),Vne=WS(),$ne=xf(),Yne=Em(),Kne=at(),Gne=Aa(),Qne=lf(),Xne=As(),Wne=mf();function Zne(t,e,n){var i=Kne(t),r=i||Gne(t)||Wne(t);if(e=$ne(e,4),n==null){var s=t&&t.constructor;r?n=i?new s:[]:Xne(t)?n=Qne(s)?jne(Yne(t)):{}:n={}}return(r?Fne:Vne)(t,function(o,l,a){return e(n,o,l,a)}),n}$3.exports=Zne});var X3=x((k0e,Q3)=>{"use strict";var K3=Oo(),Jne=ff(),eie=at(),G3=K3?K3.isConcatSpreadable:void 0;function tie(t){return eie(t)||Jne(t)||!!(G3&&t&&t[G3])}Q3.exports=tie});var J3=x((A0e,Z3)=>{"use strict";var nie=Cm(),iie=X3();function W3(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=iie),r||(r=[]);++s<o;){var l=t[s];e>0&&n(l)?e>1?W3(l,e-1,n,i,r):nie(r,l):i||(r[r.length]=l)}return r}Z3.exports=W3});var tq=x((O0e,eq)=>{"use strict";function rie(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}eq.exports=rie});var rq=x((T0e,iq)=>{"use strict";var sie=tq(),nq=Math.max;function oie(t,e,n){return e=nq(e===void 0?t.length-1:e,0),function(){for(var i=arguments,r=-1,s=nq(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=n(o),sie(t,this,l)}}iq.exports=oie});var lq=x((C0e,oq)=>{"use strict";var lie=XS(),sq=MS(),aie=vf(),cie=sq?function(t,e){return sq(t,"toString",{configurable:!0,enumerable:!1,value:lie(e),writable:!0})}:aie;oq.exports=cie});var cq=x((E0e,aq)=>{"use strict";var uie=800,fie=16,hie=Date.now;function die(t){var e=0,n=0;return function(){var i=hie(),r=fie-(i-n);if(n=i,r>0){if(++e>=uie)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}aq.exports=die});var fq=x((D0e,uq)=>{"use strict";var pie=lq(),mie=cq(),gie=mie(pie);uq.exports=gie});var dq=x((M0e,hq)=>{"use strict";var yie=vf(),bie=rq(),vie=fq();function Sie(t,e){return vie(bie(t,e,yie),t+"")}hq.exports=Sie});var mq=x((R0e,pq)=>{"use strict";function xie(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}pq.exports=xie});var yq=x((N0e,gq)=>{"use strict";function wie(t){return t!==t}gq.exports=wie});var vq=x((_0e,bq)=>{"use strict";function kie(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}bq.exports=kie});var xq=x((L0e,Sq)=>{"use strict";var Aie=mq(),Oie=yq(),Tie=vq();function Cie(t,e,n){return e===e?Tie(t,e,n):Aie(t,Oie,n)}Sq.exports=Cie});var kq=x((I0e,wq)=>{"use strict";var Eie=xq();function Die(t,e){var n=t==null?0:t.length;return!!n&&Eie(t,e,0)>-1}wq.exports=Die});var Oq=x((B0e,Aq)=>{"use strict";function Mie(t,e,n){for(var i=-1,r=t==null?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}Aq.exports=Mie});var Cq=x((q0e,Tq)=>{"use strict";function Rie(){}Tq.exports=Rie});var Dq=x((P0e,Eq)=>{"use strict";var dx=FS(),Nie=Cq(),_ie=Nm(),Lie=1/0,Iie=dx&&1/_ie(new dx([,-0]))[1]==Lie?function(t){return new dx(t)}:Nie;Eq.exports=Iie});var Rq=x((z0e,Mq)=>{"use strict";var Bie=ZS(),qie=kq(),Pie=Oq(),zie=JS(),Hie=Dq(),Uie=Nm(),Fie=200;function jie(t,e,n){var i=-1,r=qie,s=t.length,o=!0,l=[],a=l;if(n)o=!1,r=Pie;else if(s>=Fie){var c=e?null:Hie(t);if(c)return Uie(c);o=!1,r=zie,a=new Bie}else a=e?[]:l;e:for(;++i<s;){var u=t[i],f=e?e(u):u;if(u=n||u!==0?u:0,o&&f===f){for(var h=a.length;h--;)if(a[h]===f)continue e;e&&a.push(f),l.push(u)}else r(a,f,n)||(a!==l&&a.push(f),l.push(u))}return l}Mq.exports=jie});var _q=x((H0e,Nq)=>{"use strict";var Vie=Ts(),$ie=ji();function Yie(t){return $ie(t)&&Vie(t)}Nq.exports=Yie});var Iq=x((U0e,Lq)=>{"use strict";var Kie=J3(),Gie=dq(),Qie=Rq(),Xie=_q(),Wie=Gie(function(t){return Qie(Kie(t,1,Xie,!0))});Lq.exports=Wie});var qq=x((F0e,Bq)=>{"use strict";var Zie=Bm();function Jie(t,e){return Zie(e,function(n){return t[n]})}Bq.exports=Jie});var zq=x((j0e,Pq)=>{"use strict";var ere=qq(),tre=Cs();function nre(t){return t==null?[]:ere(t,tre(t))}Pq.exports=nre});var wn=x((V0e,Hq)=>{"use strict";var qm;if(typeof xx=="function")try{qm={clone:SI(),constant:XS(),each:BI(),filter:l3(),has:f3(),isArray:at(),isEmpty:d3(),isFunction:lf(),isUndefined:m3(),keys:Cs(),map:v3(),reduce:O3(),size:V3(),transform:Y3(),union:Iq(),values:zq()}}catch{}qm||(qm=window._);Hq.exports=qm});var Pm=x((Y0e,Vq)=>{"use strict";var Q=wn();Vq.exports=ee;var ire="\0",Do="\0",Uq="";function ee(t){this._isDirected=Q.has(t,"directed")?t.directed:!0,this._isMultigraph=Q.has(t,"multigraph")?t.multigraph:!1,this._isCompound=Q.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=Q.constant(void 0),this._defaultEdgeLabelFn=Q.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Do]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}ee.prototype._nodeCount=0;ee.prototype._edgeCount=0;ee.prototype.isDirected=function(){return this._isDirected};ee.prototype.isMultigraph=function(){return this._isMultigraph};ee.prototype.isCompound=function(){return this._isCompound};ee.prototype.setGraph=function(t){return this._label=t,this};ee.prototype.graph=function(){return this._label};ee.prototype.setDefaultNodeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultNodeLabelFn=t,this};ee.prototype.nodeCount=function(){return this._nodeCount};ee.prototype.nodes=function(){return Q.keys(this._nodes)};ee.prototype.sources=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._in[e])})};ee.prototype.sinks=function(){var t=this;return Q.filter(this.nodes(),function(e){return Q.isEmpty(t._out[e])})};ee.prototype.setNodes=function(t,e){var n=arguments,i=this;return Q.each(t,function(r){n.length>1?i.setNode(r,e):i.setNode(r)}),this};ee.prototype.setNode=function(t,e){return Q.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Do,this._children[t]={},this._children[Do][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};ee.prototype.node=function(t){return this._nodes[t]};ee.prototype.hasNode=function(t){return Q.has(this._nodes,t)};ee.prototype.removeNode=function(t){var e=this;if(Q.has(this._nodes,t)){var n=function(i){e.removeEdge(e._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],Q.each(this.children(t),function(i){e.setParent(i)}),delete this._children[t]),Q.each(Q.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],Q.each(Q.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};ee.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Q.isUndefined(e))e=Do;else{e+="";for(var n=e;!Q.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};ee.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};ee.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==Do)return e}};ee.prototype.children=function(t){if(Q.isUndefined(t)&&(t=Do),this._isCompound){var e=this._children[t];if(e)return Q.keys(e)}else{if(t===Do)return this.nodes();if(this.hasNode(t))return[]}};ee.prototype.predecessors=function(t){var e=this._preds[t];if(e)return Q.keys(e)};ee.prototype.successors=function(t){var e=this._sucs[t];if(e)return Q.keys(e)};ee.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return Q.union(e,this.successors(t))};ee.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};ee.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;Q.each(this._nodes,function(s,o){t(o)&&e.setNode(o,s)}),Q.each(this._edgeObjs,function(s){e.hasNode(s.v)&&e.hasNode(s.w)&&e.setEdge(s,n.edge(s))});var i={};function r(s){var o=n.parent(s);return o===void 0||e.hasNode(o)?(i[s]=o,o):o in i?i[o]:r(o)}return this._isCompound&&Q.each(e.nodes(),function(s){e.setParent(s,r(s))}),e};ee.prototype.setDefaultEdgeLabel=function(t){return Q.isFunction(t)||(t=Q.constant(t)),this._defaultEdgeLabelFn=t,this};ee.prototype.edgeCount=function(){return this._edgeCount};ee.prototype.edges=function(){return Q.values(this._edgeObjs)};ee.prototype.setPath=function(t,e){var n=this,i=arguments;return Q.reduce(t,function(r,s){return i.length>1?n.setEdge(r,s,e):n.setEdge(r,s),s}),this};ee.prototype.setEdge=function(){var t,e,n,i,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,e=s.w,n=s.name,arguments.length===2&&(i=arguments[1],r=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,Q.isUndefined(n)||(n=""+n);var o=wf(this._isDirected,t,e,n);if(Q.has(this._edgeLabels,o))return r&&(this._edgeLabels[o]=i),this;if(!Q.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=r?i:this._defaultEdgeLabelFn(t,e,n);var l=rre(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[o]=l,Fq(this._preds[e],t),Fq(this._sucs[t],e),this._in[e][o]=l,this._out[t][o]=l,this._edgeCount++,this};ee.prototype.edge=function(t,e,n){var i=arguments.length===1?px(this._isDirected,arguments[0]):wf(this._isDirected,t,e,n);return this._edgeLabels[i]};ee.prototype.hasEdge=function(t,e,n){var i=arguments.length===1?px(this._isDirected,arguments[0]):wf(this._isDirected,t,e,n);return Q.has(this._edgeLabels,i)};ee.prototype.removeEdge=function(t,e,n){var i=arguments.length===1?px(this._isDirected,arguments[0]):wf(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],jq(this._preds[e],t),jq(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this};ee.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.v===e}):i}};ee.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=Q.values(n);return e?Q.filter(i,function(r){return r.w===e}):i}};ee.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};function Fq(t,e){t[e]?t[e]++:t[e]=1}function jq(t,e){--t[e]||delete t[e]}function wf(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}return r+Uq+s+Uq+(Q.isUndefined(i)?ire:i)}function rre(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}var l={v:r,w:s};return i&&(l.name=i),l}function px(t,e){return wf(t,e.v,e.w,e.name)}});var Yq=x((K0e,$q)=>{"use strict";$q.exports="2.1.8"});var Gq=x((G0e,Kq)=>{"use strict";Kq.exports={Graph:Pm(),version:Yq()}});var Xq=x((Q0e,Qq)=>{"use strict";var Vi=wn(),sre=Pm();Qq.exports={write:ore,read:cre};function ore(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:lre(t),edges:are(t)};return Vi.isUndefined(t.graph())||(e.value=Vi.clone(t.graph())),e}function lre(t){return Vi.map(t.nodes(),function(e){var n=t.node(e),i=t.parent(e),r={v:e};return Vi.isUndefined(n)||(r.value=n),Vi.isUndefined(i)||(r.parent=i),r})}function are(t){return Vi.map(t.edges(),function(e){var n=t.edge(e),i={v:e.v,w:e.w};return Vi.isUndefined(e.name)||(i.name=e.name),Vi.isUndefined(n)||(i.value=n),i})}function cre(t){var e=new sre(t.options).setGraph(t.value);return Vi.each(t.nodes,function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),Vi.each(t.edges,function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}});var Zq=x((X0e,Wq)=>{"use strict";var zm=wn();Wq.exports=ure;function ure(t){var e={},n=[],i;function r(s){zm.has(e,s)||(e[s]=!0,i.push(s),zm.each(t.successors(s),r),zm.each(t.predecessors(s),r))}return zm.each(t.nodes(),function(s){i=[],r(s),i.length&&n.push(i)}),n}});var mx=x((W0e,e4)=>{"use strict";var Jq=wn();e4.exports=Yn;function Yn(){this._arr=[],this._keyIndices={}}Yn.prototype.size=function(){return this._arr.length};Yn.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Yn.prototype.has=function(t){return Jq.has(this._keyIndices,t)};Yn.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};Yn.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Yn.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!Jq.has(n,t)){var i=this._arr,r=i.length;return n[t]=r,i.push({key:t,priority:e}),this._decrease(r),!0}return!1};Yn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Yn.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)};Yn.prototype._heapify=function(t){var e=this._arr,n=2*t,i=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,i<e.length&&(r=e[i].priority<e[r].priority?i:r),r!==t&&(this._swap(t,r),this._heapify(r)))};Yn.prototype._decrease=function(t){for(var e=this._arr,n=e[t].priority,i;t!==0&&(i=t>>1,!(e[i].priority<n));)this._swap(t,i),t=i};Yn.prototype._swap=function(t,e){var n=this._arr,i=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,i[s.key]=t,i[r.key]=e}});var gx=x((Z0e,t4)=>{"use strict";var fre=wn(),hre=mx();t4.exports=pre;var dre=fre.constant(1);function pre(t,e,n,i){return mre(t,String(e),n||dre,i||function(r){return t.outEdges(r)})}function mre(t,e,n,i){var r={},s=new hre,o,l,a=function(c){var u=c.v!==o?c.v:c.w,f=r[u],h=n(c),d=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);d<f.distance&&(f.distance=d,f.predecessor=o,s.decrease(u,d))};for(t.nodes().forEach(function(c){var u=c===e?0:Number.POSITIVE_INFINITY;r[c]={distance:u},s.add(c,u)});s.size()>0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(a);return r}});var i4=x((J0e,n4)=>{"use strict";var gre=gx(),yre=wn();n4.exports=bre;function bre(t,e,n){return yre.transform(t.nodes(),function(i,r){i[r]=gre(t,r,e,n)},{})}});var yx=x((ebe,s4)=>{"use strict";var r4=wn();s4.exports=vre;function vre(t){var e=0,n=[],i={},r=[];function s(o){var l=i[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach(function(u){r4.has(i,u)?i[u].onStack&&(l.lowlink=Math.min(l.lowlink,i[u].index)):(s(u),l.lowlink=Math.min(l.lowlink,i[u].lowlink))}),l.lowlink===l.index){var a=[],c;do c=n.pop(),i[c].onStack=!1,a.push(c);while(o!==c);r.push(a)}}return t.nodes().forEach(function(o){r4.has(i,o)||s(o)}),r}});var l4=x((tbe,o4)=>{"use strict";var Sre=wn(),xre=yx();o4.exports=wre;function wre(t){return Sre.filter(xre(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var c4=x((nbe,a4)=>{"use strict";var kre=wn();a4.exports=Ore;var Are=kre.constant(1);function Ore(t,e,n){return Tre(t,e||Are,n||function(i){return t.outEdges(i)})}function Tre(t,e,n){var i={},r=t.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(o){var l=o.v===s?o.w:o.v,a=e(o);i[s][l]={distance:a,predecessor:s}})}),r.forEach(function(s){var o=i[s];r.forEach(function(l){var a=i[l];r.forEach(function(c){var u=a[s],f=o[c],h=a[c],d=u.distance+f.distance;d<h.distance&&(h.distance=d,h.predecessor=f.predecessor)})})}),i}});var bx=x((ibe,f4)=>{"use strict";var kf=wn();f4.exports=u4;u4.CycleException=Hm;function u4(t){var e={},n={},i=[];function r(s){if(kf.has(n,s))throw new Hm;kf.has(e,s)||(n[s]=!0,e[s]=!0,kf.each(t.predecessors(s),r),delete n[s],i.push(s))}if(kf.each(t.sinks(),r),kf.size(e)!==t.nodeCount())throw new Hm;return i}function Hm(){}Hm.prototype=new Error});var p4=x((rbe,d4)=>{"use strict";var h4=bx();d4.exports=Cre;function Cre(t){try{h4(t)}catch(e){if(e instanceof h4.CycleException)return!1;throw e}return!0}});var vx=x((sbe,g4)=>{"use strict";var Um=wn();g4.exports=Ere;function Ere(t,e,n){Um.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],s={};return Um.each(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);m4(t,o,n==="post",s,i,r)}),r}function m4(t,e,n,i,r,s){Um.has(i,e)||(i[e]=!0,n||s.push(e),Um.each(r(e),function(o){m4(t,o,n,i,r,s)}),n&&s.push(e))}});var b4=x((obe,y4)=>{"use strict";var Dre=vx();y4.exports=Mre;function Mre(t,e){return Dre(t,e,"post")}});var S4=x((lbe,v4)=>{"use strict";var Rre=vx();v4.exports=Nre;function Nre(t,e){return Rre(t,e,"pre")}});var k4=x((abe,w4)=>{"use strict";var x4=wn(),_re=Pm(),Lre=mx();w4.exports=Ire;function Ire(t,e){var n=new _re,i={},r=new Lre,s;function o(a){var c=a.v===s?a.w:a.v,u=r.priority(c);if(u!==void 0){var f=e(a);f<u&&(i[c]=s,r.decrease(c,f))}}if(t.nodeCount()===0)return n;x4.each(t.nodes(),function(a){r.add(a,Number.POSITIVE_INFINITY),n.setNode(a)}),r.decrease(t.nodes()[0],0);for(var l=!1;r.size()>0;){if(s=r.removeMin(),x4.has(i,s))n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(o)}return n}});var O4=x((cbe,A4)=>{"use strict";A4.exports={components:Zq(),dijkstra:gx(),dijkstraAll:i4(),findCycles:l4(),floydWarshall:c4(),isAcyclic:p4(),postorder:b4(),preorder:S4(),prim:k4(),tarjan:yx(),topsort:bx()}});var E4=x((ube,C4)=>{"use strict";var T4=Gq();C4.exports={Graph:T4.Graph,json:Xq(),alg:O4(),version:T4.version}});var jre={};P4(jre,{FullIntegratedDemo:()=>Fre,mountIntegratedDemo:()=>R4});var kn=Ae(On()),Sx=Ae(iT());var St=Ae(On());var z=Ae(vt());function lT(t,e){let n=t.getAtoms(),i=new Set(n.map(o=>o.id)),r=1,s=`${e}-${r}`;for(;i.has(s);)r++,s=`${e}-${r}`;return s}var R0=({instance:t,onChange:e,disabled:n=!1,className:i=""})=>{let[r,s]=(0,St.useState)({id:"",label:"",type:"Entity"}),o=lT(t,r.type.trim()||"Entity"),[l,a]=(0,St.useState)({name:"",atomIds:["",""]}),[c,u]=(0,St.useState)(""),f=t.getAtoms(),h=t.getRelations(),d=(0,St.useCallback)(()=>{e&&e(t)},[t,e]),p=(0,St.useCallback)(T=>{if(T.preventDefault(),!r.label.trim()){u("Atom label is required");return}let M=r.type.trim()||"Entity",C=r.id.trim()||lT(t,M);if(!C){u("Atom ID could not be generated");return}if(t.getAtoms().some(H=>H.id===C)){u("Atom ID already exists");return}try{let H={id:C,label:r.label.trim(),type:M};t.addAtom(H),s({id:"",label:"",type:"Entity"}),u(""),d()}catch(H){u(H instanceof Error?H.message:"Failed to add atom")}},[r,t,d]),m=(0,St.useCallback)(T=>{try{t.removeAtom(T),u(""),d()}catch(M){u(M instanceof Error?M.message:"Failed to remove atom")}},[t,d]),b=(0,St.useCallback)(()=>{a(T=>({...T,atomIds:[...T.atomIds,""]}))},[]),y=(0,St.useCallback)(()=>{a(T=>({...T,atomIds:T.atomIds.length>2?T.atomIds.slice(0,-1):T.atomIds}))},[]),g=(0,St.useCallback)((T,M)=>{a(C=>({...C,atomIds:C.atomIds.map((H,le)=>le===T?M:H)}))},[]),v=(0,St.useCallback)(T=>{if(T.preventDefault(),!l.name.trim()){u("Relation name is required");return}let M=l.atomIds.map(C=>C.trim()).filter(C=>C!=="");if(M.length<2){u("At least 2 atoms are required for a relation");return}if(M.length!==l.atomIds.length){u("All atom positions must be selected");return}try{let C={atoms:M,types:M.map(()=>"unknown")};t.addRelationTuple(l.name.trim(),C),a({name:"",atomIds:["",""]}),u(""),d()}catch(C){u(C instanceof Error?C.message:"Failed to add relation")}},[l,t,d]),S=(0,St.useCallback)((T,M)=>{try{t.removeRelationTuple(T,M),u(""),d()}catch(C){u(C instanceof Error?C.message:"Failed to remove relation")}},[t,d]),w=(0,St.useCallback)(()=>{try{t.getAtoms().map(C=>C.id).forEach(C=>t.removeAtom(C)),t.getRelations().map(C=>C.id).forEach(C=>{let H=t.getRelations().find(le=>le.id===C);H&&H.tuples.forEach(le=>t.removeRelationTuple(C,le))}),u(""),d()}catch(T){u(T instanceof Error?T.message:"Failed to clear instance")}},[t,d]),[O,k]=(0,St.useState)(null),A=(0,St.useCallback)(()=>{if(console.log("Instance in handleReify:",t),console.log("typeof instance.reify:",typeof t.reify),typeof t.reify=="function")try{let T=t.reify();k(T)}catch(T){k("Re-ify failed: "+(T instanceof Error?T.message:String(T)))}else k("Re-ify not supported on this instance.")},[t]),R=(0,St.useCallback)(T=>T.atoms.length===2?`${T.atoms[0]} \u2192 ${T.atoms[1]}`:`(${T.atoms.join(", ")})`,[]);return(0,z.jsxs)("div",{className:`instance-builder ${i}`,children:[(0,z.jsxs)("div",{className:"instance-builder__header",children:[(0,z.jsx)("h2",{children:"Instance Builder"}),(0,z.jsxs)("div",{className:"instance-builder__stats",children:[(0,z.jsxs)("span",{children:[f.length," atoms"]}),(0,z.jsxs)("span",{children:[h.reduce((T,M)=>T+M.tuples.length,0)," relations"]})]})]}),c&&(0,z.jsxs)("div",{className:"instance-builder__error",children:[c,(0,z.jsx)("button",{type:"button",onClick:()=>u(""),"aria-label":"Clear error",children:"\xD7"})]}),(0,z.jsxs)("div",{className:"instance-builder__content",children:[(0,z.jsxs)("section",{className:"instance-builder__section",children:[(0,z.jsx)("h3",{children:"Atoms"}),(0,z.jsxs)("form",{onSubmit:p,className:"instance-builder__form",children:[(0,z.jsxs)("div",{className:"form-row",children:[(0,z.jsx)("input",{type:"text",placeholder:`ID (suggested: ${o})`,value:r.id,onChange:T=>s(M=>({...M,id:T.target.value})),disabled:n,"aria-label":"Atom ID"}),(0,z.jsx)("input",{type:"text",placeholder:"Label",value:r.label,onChange:T=>s(M=>({...M,label:T.target.value})),disabled:n,required:!0}),(0,z.jsx)("input",{type:"text",placeholder:"Type",value:r.type,onChange:T=>s(M=>({...M,type:T.target.value})),disabled:n}),(0,z.jsx)("button",{type:"submit",disabled:n,children:"Add Atom"})]}),r.id===""&&(0,z.jsxs)("div",{style:{fontSize:"0.85em",color:"#888",marginTop:2},children:["Suggested ID: ",(0,z.jsx)("code",{children:o})]})]}),(0,z.jsx)("div",{className:"instance-builder__list",children:f.length===0?(0,z.jsx)("p",{className:"empty-state",children:"No atoms yet. Add one above."}):f.map(T=>(0,z.jsxs)("div",{className:"list-item",children:[(0,z.jsxs)("div",{className:"item-info",children:[(0,z.jsx)("strong",{children:T.id}),(0,z.jsx)("span",{className:"item-label",children:T.label}),(0,z.jsx)("span",{className:"item-type",children:T.type})]}),(0,z.jsx)("button",{type:"button",onClick:()=>m(T.id),disabled:n,className:"remove-button","aria-label":`Remove atom ${T.id}`,children:"Remove"})]},T.id))})]}),(0,z.jsxs)("section",{className:"instance-builder__section",children:[(0,z.jsx)("h3",{children:"Relations (N-ary Support)"}),(0,z.jsxs)("form",{onSubmit:v,className:"instance-builder__form",children:[(0,z.jsx)("div",{className:"form-row",children:(0,z.jsx)("input",{type:"text",placeholder:"Relation Name",value:l.name,onChange:T=>a(M=>({...M,name:T.target.value})),disabled:n,required:!0})}),(0,z.jsxs)("div",{className:"relation-atoms",children:[(0,z.jsxs)("div",{style:{fontSize:"0.9em",color:"#666",marginBottom:8},children:["Atoms (arity: ",l.atomIds.length,"):"]}),l.atomIds.map((T,M)=>(0,z.jsxs)("div",{className:"atom-selector",children:[(0,z.jsxs)("label",{style:{fontSize:"0.85em",color:"#666"},children:["Position ",M+1,":"]}),(0,z.jsxs)("select",{value:T,onChange:C=>g(M,C.target.value),disabled:n,required:!0,children:[(0,z.jsx)("option",{value:"",children:"Select Atom"}),f.map(C=>(0,z.jsxs)("option",{value:C.id,children:[C.id," (",C.label,")"]},C.id))]})]},M)),(0,z.jsxs)("div",{className:"arity-controls",style:{marginTop:8},children:[(0,z.jsx)("button",{type:"button",onClick:b,disabled:n,style:{marginRight:8},children:"+ Add Position"}),l.atomIds.length>2&&(0,z.jsx)("button",{type:"button",onClick:y,disabled:n,children:"- Remove Position"})]})]}),(0,z.jsx)("div",{className:"form-row",style:{marginTop:12},children:(0,z.jsx)("button",{type:"submit",disabled:n||l.atomIds.some(T=>!T.trim()),children:"Add Relation"})})]}),(0,z.jsx)("div",{className:"instance-builder__list",children:h.length===0?(0,z.jsx)("p",{className:"empty-state",children:"No relations yet. Add one above."}):h.map(T=>(0,z.jsxs)("div",{className:"relation-group",children:[(0,z.jsx)("h4",{children:T.name}),T.tuples.map((M,C)=>(0,z.jsxs)("div",{className:"list-item",children:[(0,z.jsxs)("div",{className:"item-info",children:[(0,z.jsx)("span",{children:R(M)}),(0,z.jsxs)("span",{className:"item-type",style:{fontSize:"0.8em",color:"#666"},children:["arity: ",M.atoms.length]})]}),(0,z.jsx)("button",{type:"button",onClick:()=>S(T.id,M),disabled:n,className:"remove-button","aria-label":`Remove relation ${T.name} tuple`,children:"Remove"})]},C))]},T.id))})]}),(0,z.jsxs)("section",{className:"instance-builder__actions",children:[(0,z.jsx)("button",{type:"button",onClick:w,disabled:n,className:"clear-button",children:"Clear All"}),(0,z.jsx)("button",{type:"button",onClick:A,disabled:n,className:"reify-button",style:{marginLeft:8},children:"Re-ify"})]}),O!==null&&(0,z.jsxs)("section",{className:"instance-builder__reify-result",style:{marginTop:12,background:"#f8f8f8",border:"1px solid #eee",borderRadius:4,padding:10},children:[(0,z.jsx)("strong",{children:"Re-ify Result:"}),(0,z.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:typeof O=="string"?O:JSON.stringify(O,null,2)})]})]})]})};var Ju=Ae(On());var uT="#000000";function Jr(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function $(t){return t==null?"":String(t)}function aT(t){return Array.isArray(t)?t.map(e=>$(e)).filter(e=>e.length>0):t==null||t===""?[]:[$(t)]}function td(t){return t==null||t===""}function N0(t,e,n="error"){return{severity:n,message:e,fieldKey:t,source:"structure"}}var fT=["above","below","left","right","directlyAbove","directlyBelow","directlyLeft","directlyRight"],hT=["clockwise","counterclockwise"],dT=["horizontal","vertical"],_0=["solid","dashed","dotted"],Nz=["small","normal","large"],Pc=[{key:"size",kind:"enum",options:Nz,label:"Size"},{key:"color",kind:"color",label:"Color"}],_z=["none","togroup","fromgroup"];function cT(t){return t&&typeof t=="object"&&(t=t.points),t===!0||t==="togroup"?"togroup":t==="fromgroup"?"fromgroup":"none"}var Lz=["hideDisconnected","hideDisconnectedBuiltIns"],Iz={kind:"constraint",type:"orientation",label:"Orientation",description:"Specify the relative positioning of elements.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary",placeholder:"e.g. parent",help:"Binary selector; orientation applies from the source end to the target end of each tuple."},{key:"directions",kind:"enum",label:"Directions",required:!0,multiple:!0,options:fT,help:"Where the target sits relative to the source."}],summary(t){let e=aT(t.directions),n=$(t.selector),i=e.length>0?e.join(", "):"no directions";return n?`target ${i} of source \xB7 ${n}`:`target ${i} of source`},validate(t){let e=[],n=aT(t.directions),i=r=>n.includes(r);return i("above")&&i("below")&&e.push(N0("directions","Cannot be both above and below.")),i("left")&&i("right")&&e.push(N0("directions","Cannot be both left and right.")),e}},Bz={kind:"constraint",type:"cyclic",label:"Cyclic",description:"Arrange elements along the perimeter of a circle.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",options:hT,default:"clockwise"}],summary(t){let e=$(t.direction)||"clockwise",n=$(t.selector);return n?`${e} \xB7 ${n}`:e}},qz={kind:"constraint",type:"align",label:"Align",description:"Ensure elements are aligned horizontally or vertically.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",required:!0,options:dT,default:"horizontal"}],summary(t){let e=$(t.direction)||"horizontal",n=$(t.selector);return n?`${e} \xB7 ${n}`:e}},Pz={kind:"constraint",type:"groupselector",label:"Group (by selector)",description:"Group elements based on a selector.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"name",kind:"text",label:"Group name",placeholder:"e.g. cluster"},{key:"addEdge",kind:"enum",label:"Add edge",options:_z,default:"none",help:'Draw an edge between the group key and the group: "togroup" points key \u2192 group, "fromgroup" points group \u2192 key, "none" draws nothing. (To style that connector, author addEdge as a block \u2014 { points, lineStyle, textStyle } \u2014 in YAML.)'},{key:"textStyle",kind:"group",label:"Label text style",children:[{key:"color",kind:"color",label:"Color"}]}],summary(t){let e=$(t.selector),n=$(t.name),i=n?`group "${n}"`:"group";return e?`${i} \xB7 ${e}`:i},toYamlNode(t){let e={selector:$(t.selector)};td(t.name)||(e.name=$(t.name));let n=cT(t.addEdge);if(n!=="none"&&(e.addEdge=n),Jr(t.textStyle)){let i={};for(let[r,s]of Object.entries(t.textStyle))s!=null&&s!==""&&(i[r]=s);Object.keys(i).length>0&&(e.textStyle=i)}return t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!Jr(t))return null;let e=t.group;if(!Jr(e)||e.field!==void 0)return null;let n={selector:$(e.selector),addEdge:cT(e.addEdge)};return e.name!==void 0&&(n.name=$(e.name)),Jr(e.textStyle)&&(n.textStyle={...e.textStyle}),e.hold!==void 0&&(n.hold=e.hold),n}},zz={kind:"constraint",type:"groupfield",label:"Group (by field)",description:"Group elements based on a field. Deprecated \u2014 prefer Group (by selector).",deprecated:!0,deprecatedInFavorOf:"groupselector",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"groupOn",kind:"number",label:"Group on (index)",required:!0,default:0},{key:"addToGroup",kind:"number",label:"Add to group (index)",required:!0,default:1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=$(t.field),n=e?`group on "${e}"`:"group on field",i=$(t.selector);return i?`${n} \xB7 ${i}`:n},toYamlNode(t){let e={field:$(t.field),groupOn:typeof t.groupOn=="number"?t.groupOn:Number(t.groupOn??0),addToGroup:typeof t.addToGroup=="number"?t.addToGroup:Number(t.addToGroup??1)};return td(t.selector)||(e.selector=$(t.selector)),t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!Jr(t))return null;let e=t.group;if(!Jr(e)||e.field===void 0)return null;let n={field:$(e.field),groupOn:typeof e.groupOn=="number"?e.groupOn:Number(e.groupOn??0),addToGroup:typeof e.addToGroup=="number"?e.addToGroup:Number(e.addToGroup??1)};return e.selector!==void 0&&(n.selector=$(e.selector)),e.hold!==void 0&&(n.hold=e.hold),n}},Hz={kind:"constraint",type:"size",label:"Size",description:"Set the width and height of elements matching the selector.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"width",kind:"number",label:"Width",required:!0,default:100},{key:"height",kind:"number",label:"Height",required:!0,default:60}],summary(t){let e=td(t.width)?"?":$(t.width),n=td(t.height)?"?":$(t.height),i=$(t.selector);return i?`${e}\xD7${n} \xB7 ${i}`:`${e}\xD7${n}`},validate(t){let e=[];for(let n of["width","height"]){let i=t[n];typeof i=="number"&&(Number.isNaN(i)||i<=0)&&e.push(N0(n,`${n} must be greater than 0.`))}return e}},Uz={kind:"constraint",type:"hideAtom",label:"Hide atom",description:"Hide elements matching the selector from the visualization.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"unary"}],summary(t){let e=$(t.selector);return e?`hide \xB7 ${e}`:"hide"}},Fz={kind:"directive",type:"flag",label:"Flag",description:"Toggle a built-in rendering flag, e.g. hideDisconnectedBuiltIns.",fields:[{key:"flag",kind:"enum",options:Lz,label:"Flag",required:!0,default:"hideDisconnected",help:"hideDisconnected hides disconnected atoms; hideDisconnectedBuiltIns hides only disconnected built-in atoms."}],summary(t){return $(t.flag)||"(no flag)"},toYamlNode(t){return{flag:$(t.flag)}},fromYamlNode(t){if(!Jr(t))return null;let e=t.flag;return typeof e=="string"?{flag:e}:Jr(e)&&typeof e.flag=="string"?{flag:e.flag}:null}},jz={kind:"directive",type:"attribute",label:"Attribute",description:"Render a field as an inline attribute on its source atom.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 apply only to matching (source, target) tuples."},{key:"textStyle",kind:"group",label:"Text style",children:Pc}],summary(t){let e=$(t.field),n=$(t.selector),i=e||"(no field)";return n?`${i} \xB7 ${n}`:i}},Vz={kind:"directive",type:"hideField",label:"Hide field",description:"Hide a relation/field from the visualization.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 hide only matching (source, target) tuples."}],summary(t){let e=$(t.field),n=$(t.selector),i=e?`hide ${e}`:"hide field";return n?`${i} \xB7 ${n}`:i}},$z={kind:"directive",type:"icon",label:"Icon",description:"Render matching atoms with an icon.",fields:[{key:"path",kind:"text",label:"Path / URL",required:!0,placeholder:"e.g. https://\u2026 or assets/foo.svg"},{key:"showLabels",kind:"boolean",label:"Show labels",default:!1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=$(t.path),n=$(t.selector),i=e||"(no path)";return n?`${i} \xB7 ${n}`:i}},Yz={kind:"directive",type:"atomColor",label:"Atom color",description:"Deprecated \u2014 use Atom style (atomStyle). Still parsed/rendered for back-compat (value \u2192 border color).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"value",kind:"color",label:"Color",required:!0,default:uT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=$(t.value),n=$(t.selector),i=e||"(no color)";return n?`${i} \xB7 ${n}`:i}},pT=[{key:"color",kind:"color",label:"Color"},{key:"pattern",kind:"enum",options:_0,label:"Pattern"},{key:"weight",kind:"number",label:"Weight"},{key:"highlight",kind:"color",label:"Highlight"}],Kz=[{key:"color",kind:"color",label:"Color"}],Gz=[{key:"color",kind:"color",label:"Color"},{key:"width",kind:"number",label:"Width"}],Qz={kind:"directive",type:"edgeStyle",label:"Edge style",description:"Style the edges of a field/relation \u2014 line and label.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary"},{key:"lineStyle",kind:"group",label:"Line style",children:pT},{key:"textStyle",kind:"group",label:"Text style",children:Pc},{key:"showLabel",kind:"boolean",label:"Show label"},{key:"hidden",kind:"boolean",label:"Hidden"}],summary(t){let e=$(t.field),n=t.lineStyle??{},i=$(n.color),r=e?i?`${e}: ${i}`:e:i||"edge",s=$(t.selector);return s?`${r} \xB7 ${s}`:r}},Xz={kind:"directive",type:"atomStyle",label:"Atom style",description:"Style matching atoms \u2014 fill, border, and label.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"fillStyle",kind:"group",label:"Fill style",children:Kz},{key:"borderStyle",kind:"group",label:"Border style",children:Gz},{key:"textStyle",kind:"group",label:"Text style",children:Pc}],summary(t){let e=t.fillStyle??{},n=t.borderStyle??{},i=$(e.color)||$(n.color),r=$(t.selector),s=i||"atom";return r?`${s} \xB7 ${r}`:s}},Wz={kind:"directive",type:"edgeColor",label:"Edge color",description:"Deprecated \u2014 use Edge style (edgeStyle). Still parsed/rendered for back-compat.",deprecated:!0,deprecatedInFavorOf:"edgeStyle",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"value",kind:"color",label:"Color",required:!0,default:uT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"style",kind:"enum",label:"Style",options:_0},{key:"weight",kind:"number",label:"Weight"}],summary(t){let e=$(t.field),n=$(t.value),i=e?`${e}: ${n||"edge"}`:n||"edge",r=$(t.selector);return r?`${i} \xB7 ${r}`:i}},Zz={kind:"directive",type:"inferredEdge",label:"Inferred edge",description:"Draw an inferred edge from a selector \u2014 line and label.",fields:[{key:"name",kind:"text",label:"Name",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"binary"},{key:"draw",kind:"text",label:"Draw",help:"Endpoint interpretation: '<end> -> <end>', each end '_' (the atom itself) or a group constraint name (attach to that group's hull \u2014 a keyed group picks by the end's atom; a unary group is a single group and attaches directly). E.g. 'regions -> regions' or '_ -> regions'."},{key:"lineStyle",kind:"group",label:"Line style",children:pT},{key:"textStyle",kind:"group",label:"Text style",children:Pc}],summary(t){let e=$(t.name),n=$(t.selector),i=t.lineStyle??{},r=$(i.color),s=e||"(no name)",o=r?`${s}: ${r}`:s;return n?`${o} \xB7 ${n}`:o}},Jz={kind:"directive",type:"tag",label:"Tag",description:"Add computed attributes to nodes based on selector evaluation.",fields:[{key:"toTag",kind:"selector",label:"To tag (selector)",required:!0,selectorArity:"unary",help:"Selects which atoms get the tag."},{key:"name",kind:"text",label:"Name",required:!0,help:"The attribute name to display."},{key:"value",kind:"selector",label:"Value (selector)",required:!0,help:"Selector whose result becomes the attribute value."},{key:"textStyle",kind:"group",label:"Text style",children:Pc}],summary(t){let e=$(t.name),n=$(t.toTag),i=e||"(no name)";return n?`${i} \xB7 ${n}`:i}},L0=[Iz,Bz,qz,Pz,zz,Hz,Uz,Fz,jz,Vz,$z,Xz,Yz,Qz,Wz,Zz,Jz],mT=new Map(L0.map(t=>[t.type,t])),e6={groupselector:"group",groupfield:"group"};function t6(t){return e6[t]??t}var I0=(()=>{let t=new Map;for(let e of L0){let n=t6(e.type),i=t.get(n);i?i.push(e):t.set(n,[e])}return t})();function B0(t){return I0.get(t)??[]}function nd(t){return I0.has(t)}function id(t){let e=[];for(let[n,i]of I0)(!t||i.some(r=>r.kind===t))&&e.push(n);return e}function Pt(t){return mT.get(t)}function q0(t,e={}){let n=e.includeDeprecated??!1;return L0.filter(i=>i.kind===t&&(n||!i.deprecated))}function P0(t){let e=mT.get(t);if(!e)return{};let n={};for(let i of e.fields)i.default!==void 0&&(n[i.key]=i.default);return n}function RT(t){return typeof t>"u"||t===null}function n6(t){return typeof t=="object"&&t!==null}function i6(t){return Array.isArray(t)?t:RT(t)?[]:[t]}function r6(t,e){var n,i,r,s;if(e)for(s=Object.keys(e),n=0,i=s.length;n<i;n+=1)r=s[n],t[r]=e[r];return t}function s6(t,e){var n="",i;for(i=0;i<e;i+=1)n+=t;return n}function o6(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var l6=RT,a6=n6,c6=i6,u6=s6,f6=o6,h6=r6,ot={isNothing:l6,isObject:a6,toArray:c6,repeat:u6,isNegativeZero:f6,extend:h6};function NT(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
|
|
8
|
+
`+n.stack}}function Mn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function jk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function q5(t){var e=jk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),i=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return r.call(this)},set:function(o){i=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(o){i=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function yh(t){t._valueTracker||(t._valueTracker=q5(t))}function Vk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),i="";return t&&(i=jk(t)?t.checked?"true":"false":t.value),t=i,t!==n?(e.setValue(t),!0):!1}function bh(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}}var P5=/[\n"\\]/g;function _n(t){return t.replace(P5,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function ty(t,e,n,i,r,s,o,l){t.name="",o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?t.type=o:t.removeAttribute("type"),e!=null?o==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+Mn(e)):t.value!==""+Mn(e)&&(t.value=""+Mn(e)):o!=="submit"&&o!=="reset"||t.removeAttribute("value"),e!=null?ny(t,o,Mn(e)):n!=null?ny(t,o,Mn(n)):i!=null&&t.removeAttribute("value"),r==null&&s!=null&&(t.defaultChecked=!!s),r!=null&&(t.checked=r&&typeof r!="function"&&typeof r!="symbol"),l!=null&&typeof l!="function"&&typeof l!="symbol"&&typeof l!="boolean"?t.name=""+Mn(l):t.removeAttribute("name")}function $k(t,e,n,i,r,s,o,l){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(t.type=s),e!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||e!=null))return;n=n!=null?""+Mn(n):"",e=e!=null?""+Mn(e):n,l||e===t.value||(t.value=e),t.defaultValue=e}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=l?t.checked:!!i,t.defaultChecked=!!i,o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(t.name=o)}function ny(t,e,n){e==="number"&&bh(t.ownerDocument)===t||t.defaultValue===""+n||(t.defaultValue=""+n)}function al(t,e,n,i){if(t=t.options,e){e={};for(var r=0;r<n.length;r++)e["$"+n[r]]=!0;for(n=0;n<t.length;n++)r=e.hasOwnProperty("$"+t[n].value),t[n].selected!==r&&(t[n].selected=r),r&&i&&(t[n].defaultSelected=!0)}else{for(n=""+Mn(n),e=null,r=0;r<t.length;r++){if(t[r].value===n){t[r].selected=!0,i&&(t[r].defaultSelected=!0);return}e!==null||t[r].disabled||(e=t[r])}e!==null&&(e.selected=!0)}}function Yk(t,e,n){if(e!=null&&(e=""+Mn(e),e!==t.value&&(t.value=e),n==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=n!=null?""+Mn(n):""}function Kk(t,e,n,i){if(e==null){if(i!=null){if(n!=null)throw Error(D(92));if(Xa(i)){if(1<i.length)throw Error(D(93));i=i[0]}n=i}n==null&&(n=""),e=n}n=Mn(e),t.defaultValue=n,i=t.textContent,i===n&&i!==""&&i!==null&&(t.value=i)}function yl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var z5=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dw(t,e,n){var i=e.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,n):typeof n!="number"||n===0||z5.has(e)?e==="float"?t.cssFloat=n:t[e]=(""+n).trim():t[e]=n+"px"}function Gk(t,e,n){if(e!=null&&typeof e!="object")throw Error(D(62));if(t=t.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var r in e)i=e[r],e.hasOwnProperty(r)&&n[r]!==i&&dw(t,r,i)}else for(var s in e)e.hasOwnProperty(s)&&dw(t,s,e[s])}function Ky(t){if(t.indexOf("-")===-1)return!1;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 H5=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),U5=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function th(t){return U5.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var iy=null;function Gy(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zo=null,cl=null;function pw(t){var e=Cl(t);if(e&&(t=e.stateNode)){var n=t[Zt]||null;e:switch(t=e.stateNode,e.type){case"input":if(ty(t,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+_n(""+e)+'"][type="radio"]'),e=0;e<n.length;e++){var i=n[e];if(i!==t&&i.form===t.form){var r=i[Zt]||null;if(!r)throw Error(D(90));ty(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(e=0;e<n.length;e++)i=n[e],i.form===t.form&&Vk(i)}break e;case"textarea":Yk(t,n.value,n.defaultValue);break e;case"select":e=n.value,e!=null&&al(t,!!n.multiple,e,!1)}}}var Sg=!1;function Qk(t,e,n){if(Sg)return t(e,n);Sg=!0;try{var i=t(e);return i}finally{if(Sg=!1,(Zo!==null||cl!==null)&&(Jh(),Zo&&(e=Zo,t=cl,cl=Zo=null,pw(e),t)))for(e=0;e<t.length;e++)pw(t[e])}}function pc(t,e){var n=t.stateNode;if(n===null)return null;var i=n[Zt]||null;if(i===null)return null;n=i[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":(i=!i.disabled)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(D(231,e,typeof n));return n}var ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ry=!1;if(ur)try{jo={},Object.defineProperty(jo,"passive",{get:function(){ry=!0}}),window.addEventListener("test",jo,jo),window.removeEventListener("test",jo,jo)}catch{ry=!1}var jo,jr=null,Qy=null,nh=null;function Xk(){if(nh)return nh;var t,e=Qy,n=e.length,i,r="value"in jr?jr.value:jr.textContent,s=r.length;for(t=0;t<n&&e[t]===r[t];t++);var o=n-t;for(i=1;i<=o&&e[n-i]===r[s-i];i++);return nh=r.slice(t,1<i?1-i:void 0)}function ih(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 Uf(){return!0}function mw(){return!1}function Jt(t){function e(n,i,r,s,o){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(n=t[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Uf:mw,this.isPropagationStopped=mw,this}return Ne(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=Uf)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Uf)},persist:function(){},isPersistent:Uf}),e}var Ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vh=Jt(Ws),Nc=Ne({},Ws,{view:0,detail:0}),F5=Jt(Nc),xg,wg,Fa,$h=Ne({},Nc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Xy,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!==Fa&&(Fa&&t.type==="mousemove"?(xg=t.screenX-Fa.screenX,wg=t.screenY-Fa.screenY):wg=xg=0,Fa=t),xg)},movementY:function(t){return"movementY"in t?t.movementY:wg}}),gw=Jt($h),j5=Ne({},$h,{dataTransfer:0}),V5=Jt(j5),$5=Ne({},Nc,{relatedTarget:0}),kg=Jt($5),Y5=Ne({},Ws,{animationName:0,elapsedTime:0,pseudoElement:0}),K5=Jt(Y5),G5=Ne({},Ws,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Q5=Jt(G5),X5=Ne({},Ws,{data:0}),yw=Jt(X5),W5={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Z5={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},J5={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eP(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=J5[t])?!!e[t]:!1}function Xy(){return eP}var tP=Ne({},Nc,{key:function(t){if(t.key){var e=W5[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ih(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Z5[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Xy,charCode:function(t){return t.type==="keypress"?ih(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ih(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),nP=Jt(tP),iP=Ne({},$h,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bw=Jt(iP),rP=Ne({},Nc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xy}),sP=Jt(rP),oP=Ne({},Ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),lP=Jt(oP),aP=Ne({},$h,{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}),cP=Jt(aP),uP=Ne({},Ws,{newState:0,oldState:0}),fP=Jt(uP),hP=[9,13,27,32],Wy=ur&&"CompositionEvent"in window,Ja=null;ur&&"documentMode"in document&&(Ja=document.documentMode);var dP=ur&&"TextEvent"in window&&!Ja,Wk=ur&&(!Wy||Ja&&8<Ja&&11>=Ja),vw=" ",Sw=!1;function Zk(t,e){switch(t){case"keyup":return hP.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jk(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jo=!1;function pP(t,e){switch(t){case"compositionend":return Jk(e);case"keypress":return e.which!==32?null:(Sw=!0,vw);case"textInput":return t=e.data,t===vw&&Sw?null:t;default:return null}}function mP(t,e){if(Jo)return t==="compositionend"||!Wy&&Zk(t,e)?(t=Xk(),nh=Qy=jr=null,Jo=!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 Wk&&e.locale!=="ko"?null:e.data;default:return null}}var gP={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 xw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!gP[t.type]:e==="textarea"}function eA(t,e,n,i){Zo?cl?cl.push(i):cl=[i]:Zo=i,e=Bh(e,"onChange"),0<e.length&&(n=new Vh("onChange","change",null,n,i),t.push({event:n,listeners:e}))}var ec=null,mc=null;function yP(t){YO(t,0)}function Yh(t){var e=Wa(t);if(Vk(e))return t}function ww(t,e){if(t==="change")return e}var tA=!1;ur&&(ur?(jf="oninput"in document,jf||(Ag=document.createElement("div"),Ag.setAttribute("oninput","return;"),jf=typeof Ag.oninput=="function"),Ff=jf):Ff=!1,tA=Ff&&(!document.documentMode||9<document.documentMode));var Ff,jf,Ag;function kw(){ec&&(ec.detachEvent("onpropertychange",nA),mc=ec=null)}function nA(t){if(t.propertyName==="value"&&Yh(mc)){var e=[];eA(e,mc,t,Gy(t)),Qk(yP,e)}}function bP(t,e,n){t==="focusin"?(kw(),ec=e,mc=n,ec.attachEvent("onpropertychange",nA)):t==="focusout"&&kw()}function vP(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Yh(mc)}function SP(t,e){if(t==="click")return Yh(e)}function xP(t,e){if(t==="input"||t==="change")return Yh(e)}function wP(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var gn=typeof Object.is=="function"?Object.is:wP;function gc(t,e){if(gn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Jg.call(e,r)||!gn(t[r],e[r]))return!1}return!0}function Aw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Ow(t,e){var n=Aw(t);t=0;for(var i;n;){if(n.nodeType===3){if(i=t+n.textContent.length,t<=e&&i>=e)return{node:n,offset:e-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Aw(n)}}function iA(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?iA(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function rA(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=bh(t.document);e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=bh(t.document)}return e}function Zy(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")}var kP=ur&&"documentMode"in document&&11>=document.documentMode,el=null,sy=null,tc=null,oy=!1;function Tw(t,e,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oy||el==null||el!==bh(i)||(i=el,"selectionStart"in i&&Zy(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),tc&&gc(tc,i)||(tc=i,i=Bh(sy,"onSelect"),0<i.length&&(e=new Vh("onSelect","select",null,e,n),t.push({event:e,listeners:i}),e.target=el)))}function Is(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var tl={animationend:Is("Animation","AnimationEnd"),animationiteration:Is("Animation","AnimationIteration"),animationstart:Is("Animation","AnimationStart"),transitionrun:Is("Transition","TransitionRun"),transitionstart:Is("Transition","TransitionStart"),transitioncancel:Is("Transition","TransitionCancel"),transitionend:Is("Transition","TransitionEnd")},Og={},sA={};ur&&(sA=document.createElement("div").style,"AnimationEvent"in window||(delete tl.animationend.animation,delete tl.animationiteration.animation,delete tl.animationstart.animation),"TransitionEvent"in window||delete tl.transitionend.transition);function Zs(t){if(Og[t])return Og[t];if(!tl[t])return t;var e=tl[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in sA)return Og[t]=e[n];return t}var oA=Zs("animationend"),lA=Zs("animationiteration"),aA=Zs("animationstart"),AP=Zs("transitionrun"),OP=Zs("transitionstart"),TP=Zs("transitioncancel"),cA=Zs("transitionend"),uA=new Map,ly="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ly.push("scrollEnd");function ei(t,e){uA.set(t,e),Xs(e,[t])}var Cw=new WeakMap;function Ln(t,e){if(typeof t=="object"&&t!==null){var n=Cw.get(t);return n!==void 0?n:(e={value:t,source:e,stack:hw(e)},Cw.set(t,e),e)}return{value:t,source:e,stack:hw(e)}}var Dn=[],nl=0,Jy=0;function Kh(){for(var t=nl,e=Jy=nl=0;e<t;){var n=Dn[e];Dn[e++]=null;var i=Dn[e];Dn[e++]=null;var r=Dn[e];Dn[e++]=null;var s=Dn[e];if(Dn[e++]=null,i!==null&&r!==null){var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}s!==0&&fA(n,r,s)}}function Gh(t,e,n,i){Dn[nl++]=t,Dn[nl++]=e,Dn[nl++]=n,Dn[nl++]=i,Jy|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function e0(t,e,n,i){return Gh(t,e,n,i),vh(t)}function El(t,e){return Gh(t,null,null,e),vh(t)}function fA(t,e,n){t.lanes|=n;var i=t.alternate;i!==null&&(i.lanes|=n);for(var r=!1,s=t.return;s!==null;)s.childLanes|=n,i=s.alternate,i!==null&&(i.childLanes|=n),s.tag===22&&(t=s.stateNode,t===null||t._visibility&1||(r=!0)),t=s,s=s.return;return t.tag===3?(s=t.stateNode,r&&e!==null&&(r=31-dn(n),t=s.hiddenUpdates,i=t[r],i===null?t[r]=[e]:i.push(e),e.lane=n|536870912),s):null}function vh(t){if(50<fc)throw fc=0,Ey=null,Error(D(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var il={};function CP(t,e,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(t,e,n,i){return new CP(t,e,n,i)}function t0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ar(t,e){var n=t.alternate;return n===null?(n=fn(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&65011712,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.refCleanup=t.refCleanup,n}function hA(t,e){t.flags&=65011714;var n=t.alternate;return n===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,t.type=n.type,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function rh(t,e,n,i,r,s){var o=0;if(i=t,typeof t=="function")t0(t)&&(o=1);else if(typeof t=="string")o=Cz(t,n,Oi.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Qg:return t=fn(31,n,e,r),t.elementType=Qg,t.lanes=s,t;case Qo:return Hs(n.children,r,s,e);case Rk:o=8,r|=24;break;case Yg:return t=fn(12,n,e,r|2),t.elementType=Yg,t.lanes=s,t;case Kg:return t=fn(13,n,e,r),t.elementType=Kg,t.lanes=s,t;case Gg:return t=fn(19,n,e,r),t.elementType=Gg,t.lanes=s,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case y5:case ir:o=10;break e;case Nk:o=9;break e;case Uy:o=11;break e;case Fy:o=14;break e;case Br:o=16,i=null;break e}o=29,n=Error(D(130,t===null?"null":typeof t,"")),i=null}return e=fn(o,n,e,r),e.elementType=t,e.type=i,e.lanes=s,e}function Hs(t,e,n,i){return t=fn(7,t,i,e),t.lanes=n,t}function Tg(t,e,n){return t=fn(6,t,null,e),t.lanes=n,t}function Cg(t,e,n){return e=fn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var rl=[],sl=0,Sh=null,xh=0,Rn=[],Nn=0,Us=null,rr=1,sr="";function qs(t,e){rl[sl++]=xh,rl[sl++]=Sh,Sh=t,xh=e}function dA(t,e,n){Rn[Nn++]=rr,Rn[Nn++]=sr,Rn[Nn++]=Us,Us=t;var i=rr;t=sr;var r=32-dn(i)-1;i&=~(1<<r),n+=1;var s=32-dn(e)+r;if(30<s){var o=r-r%5;s=(i&(1<<o)-1).toString(32),i>>=o,r-=o,rr=1<<32-dn(e)+r|n<<r|i,sr=s+t}else rr=1<<s|n<<r|i,sr=t}function n0(t){t.return!==null&&(qs(t,1),dA(t,1,0))}function i0(t){for(;t===Sh;)Sh=rl[--sl],rl[sl]=null,xh=rl[--sl],rl[sl]=null;for(;t===Us;)Us=Rn[--Nn],Rn[Nn]=null,sr=Rn[--Nn],Rn[Nn]=null,rr=Rn[--Nn],Rn[Nn]=null}var Pt=null,je=null,pe=!1,Fs=null,ki=!1,ay=Error(D(519));function Ys(t){var e=Error(D(418,""));throw yc(Ln(e,t)),ay}function Ew(t){var e=t.stateNode,n=t.type,i=t.memoizedProps;switch(e[Ct]=t,e[Zt]=i,n){case"dialog":ie("cancel",e),ie("close",e);break;case"iframe":case"object":case"embed":ie("load",e);break;case"video":case"audio":for(n=0;n<Sc.length;n++)ie(Sc[n],e);break;case"source":ie("error",e);break;case"img":case"image":case"link":ie("error",e),ie("load",e);break;case"details":ie("toggle",e);break;case"input":ie("invalid",e),$k(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0),yh(e);break;case"select":ie("invalid",e);break;case"textarea":ie("invalid",e),Kk(e,i.value,i.defaultValue,i.children),yh(e)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||e.textContent===""+n||i.suppressHydrationWarning===!0||GO(e.textContent,n)?(i.popover!=null&&(ie("beforetoggle",e),ie("toggle",e)),i.onScroll!=null&&ie("scroll",e),i.onScrollEnd!=null&&ie("scrollend",e),i.onClick!=null&&(e.onclick=nd),e=!0):e=!1,e||Ys(t)}function Dw(t){for(Pt=t.return;Pt;)switch(Pt.tag){case 5:case 13:ki=!1;return;case 27:case 3:ki=!0;return;default:Pt=Pt.return}}function ja(t){if(t!==Pt)return!1;if(!pe)return Dw(t),pe=!0,!1;var e=t.tag,n;if((n=e!==3&&e!==27)&&((n=e===5)&&(n=t.type,n=!(n!=="form"&&n!=="button")||Ly(t.type,t.memoizedProps)),n=!n),n&&je&&Ys(t),Dw(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(D(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8)if(n=t.data,n==="/$"){if(e===0){je=Jn(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++;t=t.nextSibling}je=null}}else e===27?(e=je,rs(t.type)?(t=qy,qy=null,je=t):je=e):je=Pt?Jn(t.stateNode.nextSibling):null;return!0}function _c(){je=Pt=null,pe=!1}function Mw(){var t=Fs;return t!==null&&(Wt===null?Wt=t:Wt.push.apply(Wt,t),Fs=null),t}function yc(t){Fs===null?Fs=[t]:Fs.push(t)}var cy=Ei(null),Js=null,or=null;function Pr(t,e,n){Pe(cy,e._currentValue),e._currentValue=n}function cr(t){t._currentValue=cy.current,ht(cy)}function uy(t,e,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===n)break;t=t.return}}function fy(t,e,n,i){var r=t.child;for(r!==null&&(r.return=t);r!==null;){var s=r.dependencies;if(s!==null){var o=r.child;s=s.firstContext;e:for(;s!==null;){var l=s;s=r;for(var a=0;a<e.length;a++)if(l.context===e[a]){s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),uy(s.return,n,t),i||(o=null);break e}s=l.next}}else if(r.tag===18){if(o=r.return,o===null)throw Error(D(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),uy(o,n,t),o=null}else o=r.child;if(o!==null)o.return=r;else for(o=r;o!==null;){if(o===t){o=null;break}if(r=o.sibling,r!==null){r.return=o.return,o=r;break}o=o.return}r=o}}function Lc(t,e,n,i){t=null;for(var r=e,s=!1;r!==null;){if(!s){if((r.flags&524288)!==0)s=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var o=r.alternate;if(o===null)throw Error(D(387));if(o=o.memoizedProps,o!==null){var l=r.type;gn(r.pendingProps.value,o.value)||(t!==null?t.push(l):t=[l])}}else if(r===dh.current){if(o=r.alternate,o===null)throw Error(D(387));o.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(t!==null?t.push(kc):t=[kc])}r=r.return}t!==null&&fy(e,t,n,i),e.flags|=262144}function wh(t){for(t=t.firstContext;t!==null;){if(!gn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ks(t){Js=t,or=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Et(t){return pA(Js,t)}function Vf(t,e){return Js===null&&Ks(t),pA(t,e)}function pA(t,e){var n=e._currentValue;if(e={context:e,memoizedValue:n,next:null},or===null){if(t===null)throw Error(D(308));or=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else or=or.next=e;return n}var EP=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(n,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(n){return n()})}},DP=it.unstable_scheduleCallback,MP=it.unstable_NormalPriority,tt={$$typeof:ir,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function r0(){return{controller:new EP,data:new Map,refCount:0}}function Ic(t){t.refCount--,t.refCount===0&&DP(MP,function(){t.controller.abort()})}var nc=null,hy=0,bl=0,ul=null;function RP(t,e){if(nc===null){var n=nc=[];hy=0,bl=C0(),ul={status:"pending",value:void 0,then:function(i){n.push(i)}}}return hy++,e.then(Rw,Rw),e}function Rw(){if(--hy===0&&nc!==null){ul!==null&&(ul.status="fulfilled");var t=nc;nc=null,bl=0,ul=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function NP(t,e){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var r=0;r<n.length;r++)(0,n[r])(e)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var Nw=Y.S;Y.S=function(t,e){typeof e=="object"&&e!==null&&typeof e.then=="function"&&RP(t,e),Nw!==null&&Nw(t,e)};var js=Ei(null);function s0(){var t=js.current;return t!==null?t:Ee.pooledCache}function sh(t,e){e===null?Pe(js,js.current):Pe(js,e.pool)}function mA(){var t=s0();return t===null?null:{parent:tt._currentValue,pool:t}}var Bc=Error(D(460)),gA=Error(D(474)),Qh=Error(D(542)),dy={then:function(){}};function _w(t){return t=t.status,t==="fulfilled"||t==="rejected"}function $f(){}function yA(t,e,n){switch(n=t[n],n===void 0?t.push(e):n!==e&&(e.then($f,$f),e=n),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Iw(t),t;default:if(typeof e.status=="string")e.then($f,$f);else{if(t=Ee,t!==null&&100<t.shellSuspendCounter)throw Error(D(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var r=e;r.status="fulfilled",r.value=i}},function(i){if(e.status==="pending"){var r=e;r.status="rejected",r.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,Iw(t),t}throw ic=e,Bc}}var ic=null;function Lw(){if(ic===null)throw Error(D(459));var t=ic;return ic=null,t}function Iw(t){if(t===Bc||t===Qh)throw Error(D(483))}var qr=!1;function o0(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function py(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Kr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Gr(t,e,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Se&2)!==0){var r=i.pending;return r===null?e.next=e:(e.next=r.next,r.next=e),i.pending=e,e=vh(t),fA(t,null,n),e}return Gh(t,i,e,n),vh(t)}function rc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,zk(t,n)}}function Eg(t,e){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?r=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?r=s=e:s=s.next=e}else r=s=e;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:s,shared:i.shared,callbacks:i.callbacks},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}var my=!1;function sc(){if(my){var t=ul;if(t!==null)throw t}}function oc(t,e,n,i){my=!1;var r=t.updateQueue;qr=!1;var s=r.firstBaseUpdate,o=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var a=l,c=a.next;a.next=null,o===null?s=c:o.next=c,o=a;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var f=r.baseState;o=0,u=c=a=null,l=s;do{var h=l.lane&-536870913,d=h!==l.lane;if(d?(fe&h)===h:(i&h)===h){h!==0&&h===bl&&(my=!0),u!==null&&(u=u.next={lane:0,tag:l.tag,payload:l.payload,callback:null,next:null});e:{var m=t,g=l;h=e;var b=n;switch(g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(b,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,h=typeof m=="function"?m.call(b,f,h):m,h==null)break e;f=Ne({},f,h);break e;case 2:qr=!0}}h=l.callback,h!==null&&(t.flags|=64,d&&(t.flags|=8192),d=r.callbacks,d===null?r.callbacks=[h]:d.push(h))}else d={lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(c=u=d,a=f):u=u.next=d,o|=h;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;d=l,l=d.next,d.next=null,r.lastBaseUpdate=d,r.shared.pending=null}}while(!0);u===null&&(a=f),r.baseState=a,r.firstBaseUpdate=c,r.lastBaseUpdate=u,s===null&&(r.shared.lanes=0),ns|=o,t.lanes=o,t.memoizedState=f}}function bA(t,e){if(typeof t!="function")throw Error(D(191,t));t.call(e)}function vA(t,e){var n=t.callbacks;if(n!==null)for(t.callbacks=null,t=0;t<n.length;t++)bA(n[t],e)}var vl=Ei(null),kh=Ei(0);function Bw(t,e){t=dr,Pe(kh,t),Pe(vl,e),dr=t|e.baseLanes}function gy(){Pe(kh,dr),Pe(vl,vl.current)}function l0(){dr=kh.current,ht(vl),ht(kh)}var es=0,Z=null,ke=null,We=null,Ah=!1,fl=!1,Gs=!1,Oh=0,bc=0,hl=null,_P=0;function Ke(){throw Error(D(321))}function a0(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!gn(t[n],e[n]))return!1;return!0}function c0(t,e,n,i,r,s){return es=s,Z=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Y.H=t===null||t.memoizedState===null?XA:WA,Gs=!1,s=n(i,r),Gs=!1,fl&&(s=xA(e,n,i,r)),SA(t),s}function SA(t){Y.H=Th;var e=ke!==null&&ke.next!==null;if(es=0,We=ke=Z=null,Ah=!1,bc=0,hl=null,e)throw Error(D(300));t===null||ft||(t=t.dependencies,t!==null&&wh(t)&&(ft=!0))}function xA(t,e,n,i){Z=t;var r=0;do{if(fl&&(hl=null),bc=0,fl=!1,25<=r)throw Error(D(301));if(r+=1,We=ke=null,t.updateQueue!=null){var s=t.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}Y.H=HP,s=e(n,i)}while(fl);return s}function LP(){var t=Y.H,e=t.useState()[0];return e=typeof e.then=="function"?qc(e):e,t=t.useState()[0],(ke!==null?ke.memoizedState:null)!==t&&(Z.flags|=1024),e}function u0(){var t=Oh!==0;return Oh=0,t}function f0(t,e,n){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~n}function h0(t){if(Ah){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}Ah=!1}es=0,We=ke=Z=null,fl=!1,bc=Oh=0,hl=null}function Qt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Z.memoizedState=We=t:We=We.next=t,We}function Ze(){if(ke===null){var t=Z.alternate;t=t!==null?t.memoizedState:null}else t=ke.next;var e=We===null?Z.memoizedState:We.next;if(e!==null)We=e,ke=t;else{if(t===null)throw Z.alternate===null?Error(D(467)):Error(D(310));ke=t,t={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},We===null?Z.memoizedState=We=t:We=We.next=t}return We}function d0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qc(t){var e=bc;return bc+=1,hl===null&&(hl=[]),t=yA(hl,t,e),e=Z,(We===null?e.memoizedState:We.next)===null&&(e=e.alternate,Y.H=e===null||e.memoizedState===null?XA:WA),t}function Xh(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return qc(t);if(t.$$typeof===ir)return Et(t)}throw Error(D(438,String(t)))}function p0(t){var e=null,n=Z.updateQueue;if(n!==null&&(e=n.memoCache),e==null){var i=Z.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(r){return r.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),n===null&&(n=d0(),Z.updateQueue=n),n.memoCache=e,n=e.data[e.index],n===void 0)for(n=e.data[e.index]=Array(t),i=0;i<t;i++)n[i]=b5;return e.index++,n}function fr(t,e){return typeof e=="function"?e(t):e}function oh(t){var e=Ze();return m0(e,ke,t)}function m0(t,e,n){var i=t.queue;if(i===null)throw Error(D(311));i.lastRenderedReducer=n;var r=t.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}e.baseQueue=r=s,i.pending=null}if(s=t.baseState,r===null)t.memoizedState=s;else{e=r.next;var l=o=null,a=null,c=e,u=!1;do{var f=c.lane&-536870913;if(f!==c.lane?(fe&f)===f:(es&f)===f){var h=c.revertLane;if(h===0)a!==null&&(a=a.next={lane:0,revertLane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),f===bl&&(u=!0);else if((es&h)===h){c=c.next,h===bl&&(u=!0);continue}else f={lane:0,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=f,o=s):a=a.next=f,Z.lanes|=h,ns|=h;f=c.action,Gs&&n(s,f),s=c.hasEagerState?c.eagerState:n(s,f)}else h={lane:f,revertLane:c.revertLane,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null},a===null?(l=a=h,o=s):a=a.next=h,Z.lanes|=f,ns|=f;c=c.next}while(c!==null&&c!==e);if(a===null?o=s:a.next=l,!gn(s,t.memoizedState)&&(ft=!0,u&&(n=ul,n!==null)))throw n;t.memoizedState=s,t.baseState=o,t.baseQueue=a,i.lastRenderedState=s}return r===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Dg(t){var e=Ze(),n=e.queue;if(n===null)throw Error(D(311));n.lastRenderedReducer=t;var i=n.dispatch,r=n.pending,s=e.memoizedState;if(r!==null){n.pending=null;var o=r=r.next;do s=t(s,o.action),o=o.next;while(o!==r);gn(s,e.memoizedState)||(ft=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,i]}function wA(t,e,n){var i=Z,r=Ze(),s=pe;if(s){if(n===void 0)throw Error(D(407));n=n()}else n=e();var o=!gn((ke||r).memoizedState,n);o&&(r.memoizedState=n,ft=!0),r=r.queue;var l=OA.bind(null,i,r,t);if(Pc(2048,8,l,[t]),r.getSnapshot!==e||o||We!==null&&We.memoizedState.tag&1){if(i.flags|=2048,Sl(9,Wh(),AA.bind(null,i,r,n,e),null),Ee===null)throw Error(D(349));s||(es&124)!==0||kA(i,e,n)}return n}function kA(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Z.updateQueue,e===null?(e=d0(),Z.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function AA(t,e,n,i){e.value=n,e.getSnapshot=i,TA(e)&&CA(t)}function OA(t,e,n){return n(function(){TA(e)&&CA(t)})}function TA(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!gn(t,n)}catch{return!0}}function CA(t){var e=El(t,2);e!==null&&mn(e,t,2)}function yy(t){var e=Qt();if(typeof t=="function"){var n=t;if(t=n(),Gs){Fr(!0);try{n()}finally{Fr(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fr,lastRenderedState:t},e}function EA(t,e,n,i){return t.baseState=n,m0(t,ke,typeof i=="function"?i:fr)}function IP(t,e,n,i,r){if(Zh(t))throw Error(D(485));if(t=e.action,t!==null){var s={payload:r,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(o){s.listeners.push(o)}};Y.T!==null?n(!0):s.isTransition=!1,i(s),n=e.pending,n===null?(s.next=e.pending=s,DA(e,s)):(s.next=n.next,e.pending=n.next=s)}}function DA(t,e){var n=e.action,i=e.payload,r=t.state;if(e.isTransition){var s=Y.T,o={};Y.T=o;try{var l=n(r,i),a=Y.S;a!==null&&a(o,l),qw(t,e,l)}catch(c){by(t,e,c)}finally{Y.T=s}}else try{s=n(r,i),qw(t,e,s)}catch(c){by(t,e,c)}}function qw(t,e,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Pw(t,e,i)},function(i){return by(t,e,i)}):Pw(t,e,n)}function Pw(t,e,n){e.status="fulfilled",e.value=n,MA(e),t.state=n,e=t.pending,e!==null&&(n=e.next,n===e?t.pending=null:(n=n.next,e.next=n,DA(t,n)))}function by(t,e,n){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=n,MA(e),e=e.next;while(e!==i)}t.action=null}function MA(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function RA(t,e){return e}function zw(t,e){if(pe){var n=Ee.formState;if(n!==null){e:{var i=Z;if(pe){if(je){t:{for(var r=je,s=ki;r.nodeType!==8;){if(!s){r=null;break t}if(r=Jn(r.nextSibling),r===null){r=null;break t}}s=r.data,r=s==="F!"||s==="F"?r:null}if(r){je=Jn(r.nextSibling),i=r.data==="F!";break e}}Ys(i)}i=!1}i&&(e=n[0])}}return n=Qt(),n.memoizedState=n.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:RA,lastRenderedState:e},n.queue=i,n=KA.bind(null,Z,i),i.dispatch=n,i=yy(!1),s=v0.bind(null,Z,!1,i.queue),i=Qt(),r={state:e,dispatch:null,action:t,pending:null},i.queue=r,n=IP.bind(null,Z,r,s,n),r.dispatch=n,i.memoizedState=t,[e,n,!1]}function Hw(t){var e=Ze();return NA(e,ke,t)}function NA(t,e,n){if(e=m0(t,e,RA)[0],t=oh(fr)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=qc(e)}catch(o){throw o===Bc?Qh:o}else i=e;e=Ze();var r=e.queue,s=r.dispatch;return n!==e.memoizedState&&(Z.flags|=2048,Sl(9,Wh(),BP.bind(null,r,n),null)),[i,s,t]}function BP(t,e){t.action=e}function Uw(t){var e=Ze(),n=ke;if(n!==null)return NA(e,n,t);Ze(),e=e.memoizedState,n=Ze();var i=n.queue.dispatch;return n.memoizedState=t,[e,i,!1]}function Sl(t,e,n,i){return t={tag:t,create:n,deps:i,inst:e,next:null},e=Z.updateQueue,e===null&&(e=d0(),Z.updateQueue=e),n=e.lastEffect,n===null?e.lastEffect=t.next=t:(i=n.next,n.next=t,t.next=i,e.lastEffect=t),t}function Wh(){return{destroy:void 0,resource:void 0}}function _A(){return Ze().memoizedState}function lh(t,e,n,i){var r=Qt();i=i===void 0?null:i,Z.flags|=t,r.memoizedState=Sl(1|e,Wh(),n,i)}function Pc(t,e,n,i){var r=Ze();i=i===void 0?null:i;var s=r.memoizedState.inst;ke!==null&&i!==null&&a0(i,ke.memoizedState.deps)?r.memoizedState=Sl(e,s,n,i):(Z.flags|=t,r.memoizedState=Sl(1|e,s,n,i))}function Fw(t,e){lh(8390656,8,t,e)}function LA(t,e){Pc(2048,8,t,e)}function IA(t,e){return Pc(4,2,t,e)}function BA(t,e){return Pc(4,4,t,e)}function qA(t,e){if(typeof e=="function"){t=t();var n=e(t);return function(){typeof n=="function"?n():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function PA(t,e,n){n=n!=null?n.concat([t]):null,Pc(4,4,qA.bind(null,e,t),n)}function g0(){}function zA(t,e){var n=Ze();e=e===void 0?null:e;var i=n.memoizedState;return e!==null&&a0(e,i[1])?i[0]:(n.memoizedState=[t,e],t)}function HA(t,e){var n=Ze();e=e===void 0?null:e;var i=n.memoizedState;if(e!==null&&a0(e,i[1]))return i[0];if(i=t(),Gs){Fr(!0);try{t()}finally{Fr(!1)}}return n.memoizedState=[i,e],i}function y0(t,e,n){return n===void 0||(es&1073741824)!==0?t.memoizedState=e:(t.memoizedState=n,t=MO(),Z.lanes|=t,ns|=t,n)}function UA(t,e,n,i){return gn(n,e)?n:vl.current!==null?(t=y0(t,n,i),gn(t,e)||(ft=!0),t):(es&42)===0?(ft=!0,t.memoizedState=n):(t=MO(),Z.lanes|=t,ns|=t,e)}function FA(t,e,n,i,r){var s=me.p;me.p=s!==0&&8>s?s:8;var o=Y.T,l={};Y.T=l,v0(t,!1,e,n);try{var a=r(),c=Y.S;if(c!==null&&c(l,a),a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=NP(a,i);lc(t,e,u,pn(t))}else lc(t,e,i,pn(t))}catch(f){lc(t,e,{then:function(){},status:"rejected",reason:f},pn())}finally{me.p=s,Y.T=o}}function qP(){}function vy(t,e,n,i){if(t.tag!==5)throw Error(D(476));var r=jA(t).queue;FA(t,r,e,zs,n===null?qP:function(){return VA(t),n(i)})}function jA(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:zs,baseState:zs,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fr,lastRenderedState:zs},next:null};var n={};return e.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fr,lastRenderedState:n},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function VA(t){var e=jA(t).next.queue;lc(t,e,{},pn())}function b0(){return Et(kc)}function $A(){return Ze().memoizedState}function YA(){return Ze().memoizedState}function PP(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var n=pn();t=Kr(n);var i=Gr(e,t,n);i!==null&&(mn(i,e,n),rc(i,e,n)),e={cache:r0()},t.payload=e;return}e=e.return}}function zP(t,e,n){var i=pn();n={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},Zh(t)?GA(e,n):(n=e0(t,e,n,i),n!==null&&(mn(n,t,i),QA(n,e,i)))}function KA(t,e,n){var i=pn();lc(t,e,n,i)}function lc(t,e,n,i){var r={lane:i,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(Zh(t))GA(e,r);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,l=s(o,n);if(r.hasEagerState=!0,r.eagerState=l,gn(l,o))return Gh(t,e,r,0),Ee===null&&Kh(),!1}catch{}if(n=e0(t,e,r,i),n!==null)return mn(n,t,i),QA(n,e,i),!0}return!1}function v0(t,e,n,i){if(i={lane:2,revertLane:C0(),action:i,hasEagerState:!1,eagerState:null,next:null},Zh(t)){if(e)throw Error(D(479))}else e=e0(t,n,i,2),e!==null&&mn(e,t,2)}function Zh(t){var e=t.alternate;return t===Z||e!==null&&e===Z}function GA(t,e){fl=Ah=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function QA(t,e,n){if((n&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,n|=i,e.lanes=n,zk(t,n)}}var Th={readContext:Et,use:Xh,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useLayoutEffect:Ke,useInsertionEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useSyncExternalStore:Ke,useId:Ke,useHostTransitionStatus:Ke,useFormState:Ke,useActionState:Ke,useOptimistic:Ke,useMemoCache:Ke,useCacheRefresh:Ke},XA={readContext:Et,use:Xh,useCallback:function(t,e){return Qt().memoizedState=[t,e===void 0?null:e],t},useContext:Et,useEffect:Fw,useImperativeHandle:function(t,e,n){n=n!=null?n.concat([t]):null,lh(4194308,4,qA.bind(null,e,t),n)},useLayoutEffect:function(t,e){return lh(4194308,4,t,e)},useInsertionEffect:function(t,e){lh(4,2,t,e)},useMemo:function(t,e){var n=Qt();e=e===void 0?null:e;var i=t();if(Gs){Fr(!0);try{t()}finally{Fr(!1)}}return n.memoizedState=[i,e],i},useReducer:function(t,e,n){var i=Qt();if(n!==void 0){var r=n(e);if(Gs){Fr(!0);try{n(e)}finally{Fr(!1)}}}else r=e;return i.memoizedState=i.baseState=r,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=zP.bind(null,Z,t),[i.memoizedState,t]},useRef:function(t){var e=Qt();return t={current:t},e.memoizedState=t},useState:function(t){t=yy(t);var e=t.queue,n=KA.bind(null,Z,e);return e.dispatch=n,[t.memoizedState,n]},useDebugValue:g0,useDeferredValue:function(t,e){var n=Qt();return y0(n,t,e)},useTransition:function(){var t=yy(!1);return t=FA.bind(null,Z,t.queue,!0,!1),Qt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,n){var i=Z,r=Qt();if(pe){if(n===void 0)throw Error(D(407));n=n()}else{if(n=e(),Ee===null)throw Error(D(349));(fe&124)!==0||kA(i,e,n)}r.memoizedState=n;var s={value:n,getSnapshot:e};return r.queue=s,Fw(OA.bind(null,i,s,t),[t]),i.flags|=2048,Sl(9,Wh(),AA.bind(null,i,s,n,e),null),n},useId:function(){var t=Qt(),e=Ee.identifierPrefix;if(pe){var n=sr,i=rr;n=(i&~(1<<32-dn(i)-1)).toString(32)+n,e="\xAB"+e+"R"+n,n=Oh++,0<n&&(e+="H"+n.toString(32)),e+="\xBB"}else n=_P++,e="\xAB"+e+"r"+n.toString(32)+"\xBB";return t.memoizedState=e},useHostTransitionStatus:b0,useFormState:zw,useActionState:zw,useOptimistic:function(t){var e=Qt();e.memoizedState=e.baseState=t;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=n,e=v0.bind(null,Z,!0,n),n.dispatch=e,[t,e]},useMemoCache:p0,useCacheRefresh:function(){return Qt().memoizedState=PP.bind(null,Z)}},WA={readContext:Et,use:Xh,useCallback:zA,useContext:Et,useEffect:LA,useImperativeHandle:PA,useInsertionEffect:IA,useLayoutEffect:BA,useMemo:HA,useReducer:oh,useRef:_A,useState:function(){return oh(fr)},useDebugValue:g0,useDeferredValue:function(t,e){var n=Ze();return UA(n,ke.memoizedState,t,e)},useTransition:function(){var t=oh(fr)[0],e=Ze().memoizedState;return[typeof t=="boolean"?t:qc(t),e]},useSyncExternalStore:wA,useId:$A,useHostTransitionStatus:b0,useFormState:Hw,useActionState:Hw,useOptimistic:function(t,e){var n=Ze();return EA(n,ke,t,e)},useMemoCache:p0,useCacheRefresh:YA},HP={readContext:Et,use:Xh,useCallback:zA,useContext:Et,useEffect:LA,useImperativeHandle:PA,useInsertionEffect:IA,useLayoutEffect:BA,useMemo:HA,useReducer:Dg,useRef:_A,useState:function(){return Dg(fr)},useDebugValue:g0,useDeferredValue:function(t,e){var n=Ze();return ke===null?y0(n,t,e):UA(n,ke.memoizedState,t,e)},useTransition:function(){var t=Dg(fr)[0],e=Ze().memoizedState;return[typeof t=="boolean"?t:qc(t),e]},useSyncExternalStore:wA,useId:$A,useHostTransitionStatus:b0,useFormState:Uw,useActionState:Uw,useOptimistic:function(t,e){var n=Ze();return ke!==null?EA(n,ke,t,e):(n.baseState=t,[t,n.queue.dispatch])},useMemoCache:p0,useCacheRefresh:YA},dl=null,vc=0;function Yf(t){var e=vc;return vc+=1,dl===null&&(dl=[]),yA(dl,t,e)}function Va(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function Kf(t,e){throw e.$$typeof===g5?Error(D(525)):(t=Object.prototype.toString.call(e),Error(D(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function jw(t){var e=t._init;return e(t._payload)}function ZA(t){function e(p,y){if(t){var v=p.deletions;v===null?(p.deletions=[y],p.flags|=16):v.push(y)}}function n(p,y){if(!t)return null;for(;y!==null;)e(p,y),y=y.sibling;return null}function i(p){for(var y=new Map;p!==null;)p.key!==null?y.set(p.key,p):y.set(p.index,p),p=p.sibling;return y}function r(p,y){return p=ar(p,y),p.index=0,p.sibling=null,p}function s(p,y,v){return p.index=v,t?(v=p.alternate,v!==null?(v=v.index,v<y?(p.flags|=67108866,y):v):(p.flags|=67108866,y)):(p.flags|=1048576,y)}function o(p){return t&&p.alternate===null&&(p.flags|=67108866),p}function l(p,y,v,S){return y===null||y.tag!==6?(y=Tg(v,p.mode,S),y.return=p,y):(y=r(y,v),y.return=p,y)}function a(p,y,v,S){var w=v.type;return w===Qo?u(p,y,v.props.children,S,v.key):y!==null&&(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Br&&jw(w)===y.type)?(y=r(y,v.props),Va(y,v),y.return=p,y):(y=rh(v.type,v.key,v.props,null,p.mode,S),Va(y,v),y.return=p,y)}function c(p,y,v,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==v.containerInfo||y.stateNode.implementation!==v.implementation?(y=Cg(v,p.mode,S),y.return=p,y):(y=r(y,v.children||[]),y.return=p,y)}function u(p,y,v,S,w){return y===null||y.tag!==7?(y=Hs(v,p.mode,S,w),y.return=p,y):(y=r(y,v),y.return=p,y)}function f(p,y,v){if(typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint")return y=Tg(""+y,p.mode,v),y.return=p,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case qf:return v=rh(y.type,y.key,y.props,null,p.mode,v),Va(v,y),v.return=p,v;case Qa:return y=Cg(y,p.mode,v),y.return=p,y;case Br:var S=y._init;return y=S(y._payload),f(p,y,v)}if(Xa(y)||Ua(y))return y=Hs(y,p.mode,v,null),y.return=p,y;if(typeof y.then=="function")return f(p,Yf(y),v);if(y.$$typeof===ir)return f(p,Vf(p,y),v);Kf(p,y)}return null}function h(p,y,v,S){var w=y!==null?y.key:null;if(typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint")return w!==null?null:l(p,y,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case qf:return v.key===w?a(p,y,v,S):null;case Qa:return v.key===w?c(p,y,v,S):null;case Br:return w=v._init,v=w(v._payload),h(p,y,v,S)}if(Xa(v)||Ua(v))return w!==null?null:u(p,y,v,S,null);if(typeof v.then=="function")return h(p,y,Yf(v),S);if(v.$$typeof===ir)return h(p,y,Vf(p,v),S);Kf(p,v)}return null}function d(p,y,v,S,w){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return p=p.get(v)||null,l(y,p,""+S,w);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case qf:return p=p.get(S.key===null?v:S.key)||null,a(y,p,S,w);case Qa:return p=p.get(S.key===null?v:S.key)||null,c(y,p,S,w);case Br:var O=S._init;return S=O(S._payload),d(p,y,v,S,w)}if(Xa(S)||Ua(S))return p=p.get(v)||null,u(y,p,S,w,null);if(typeof S.then=="function")return d(p,y,v,Yf(S),w);if(S.$$typeof===ir)return d(p,y,v,Vf(y,S),w);Kf(y,S)}return null}function m(p,y,v,S){for(var w=null,O=null,k=y,A=y=0,M=null;k!==null&&A<v.length;A++){k.index>A?(M=k,k=null):M=k.sibling;var T=h(p,k,v[A],S);if(T===null){k===null&&(k=M);break}t&&k&&T.alternate===null&&e(p,k),y=s(T,y,A),O===null?w=T:O.sibling=T,O=T,k=M}if(A===v.length)return n(p,k),pe&&qs(p,A),w;if(k===null){for(;A<v.length;A++)k=f(p,v[A],S),k!==null&&(y=s(k,y,A),O===null?w=k:O.sibling=k,O=k);return pe&&qs(p,A),w}for(k=i(k);A<v.length;A++)M=d(k,p,A,v[A],S),M!==null&&(t&&M.alternate!==null&&k.delete(M.key===null?A:M.key),y=s(M,y,A),O===null?w=M:O.sibling=M,O=M);return t&&k.forEach(function(R){return e(p,R)}),pe&&qs(p,A),w}function g(p,y,v,S){if(v==null)throw Error(D(151));for(var w=null,O=null,k=y,A=y=0,M=null,T=v.next();k!==null&&!T.done;A++,T=v.next()){k.index>A?(M=k,k=null):M=k.sibling;var R=h(p,k,T.value,S);if(R===null){k===null&&(k=M);break}t&&k&&R.alternate===null&&e(p,k),y=s(R,y,A),O===null?w=R:O.sibling=R,O=R,k=M}if(T.done)return n(p,k),pe&&qs(p,A),w;if(k===null){for(;!T.done;A++,T=v.next())T=f(p,T.value,S),T!==null&&(y=s(T,y,A),O===null?w=T:O.sibling=T,O=T);return pe&&qs(p,A),w}for(k=i(k);!T.done;A++,T=v.next())T=d(k,p,A,T.value,S),T!==null&&(t&&T.alternate!==null&&k.delete(T.key===null?A:T.key),y=s(T,y,A),O===null?w=T:O.sibling=T,O=T);return t&&k.forEach(function(C){return e(p,C)}),pe&&qs(p,A),w}function b(p,y,v,S){if(typeof v=="object"&&v!==null&&v.type===Qo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case qf:e:{for(var w=v.key;y!==null;){if(y.key===w){if(w=v.type,w===Qo){if(y.tag===7){n(p,y.sibling),S=r(y,v.props.children),S.return=p,p=S;break e}}else if(y.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Br&&jw(w)===y.type){n(p,y.sibling),S=r(y,v.props),Va(S,v),S.return=p,p=S;break e}n(p,y);break}else e(p,y);y=y.sibling}v.type===Qo?(S=Hs(v.props.children,p.mode,S,v.key),S.return=p,p=S):(S=rh(v.type,v.key,v.props,null,p.mode,S),Va(S,v),S.return=p,p=S)}return o(p);case Qa:e:{for(w=v.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===v.containerInfo&&y.stateNode.implementation===v.implementation){n(p,y.sibling),S=r(y,v.children||[]),S.return=p,p=S;break e}else{n(p,y);break}else e(p,y);y=y.sibling}S=Cg(v,p.mode,S),S.return=p,p=S}return o(p);case Br:return w=v._init,v=w(v._payload),b(p,y,v,S)}if(Xa(v))return m(p,y,v,S);if(Ua(v)){if(w=Ua(v),typeof w!="function")throw Error(D(150));return v=w.call(v),g(p,y,v,S)}if(typeof v.then=="function")return b(p,y,Yf(v),S);if(v.$$typeof===ir)return b(p,y,Vf(p,v),S);Kf(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"||typeof v=="bigint"?(v=""+v,y!==null&&y.tag===6?(n(p,y.sibling),S=r(y,v),S.return=p,p=S):(n(p,y),S=Tg(v,p.mode,S),S.return=p,p=S),o(p)):n(p,y)}return function(p,y,v,S){try{vc=0;var w=b(p,y,v,S);return dl=null,w}catch(k){if(k===Bc||k===Qh)throw k;var O=fn(29,k,null,p.mode);return O.lanes=S,O.return=p,O}}}var xl=ZA(!0),JA=ZA(!1),Bn=Ei(null),Ci=null;function zr(t){var e=t.alternate;Pe(nt,nt.current&1),Pe(Bn,t),Ci===null&&(e===null||vl.current!==null||e.memoizedState!==null)&&(Ci=t)}function eO(t){if(t.tag===22){if(Pe(nt,nt.current),Pe(Bn,t),Ci===null){var e=t.alternate;e!==null&&e.memoizedState!==null&&(Ci=t)}}else Hr(t)}function Hr(){Pe(nt,nt.current),Pe(Bn,Bn.current)}function lr(t){ht(Bn),Ci===t&&(Ci=null),ht(nt)}var nt=Ei(0);function Ch(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==="$?"||By(n)))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)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}function Mg(t,e,n,i){e=t.memoizedState,n=n(i,e),n=n==null?e:Ne({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Sy={enqueueSetState:function(t,e,n){t=t._reactInternals;var i=pn(),r=Kr(i);r.payload=e,n!=null&&(r.callback=n),e=Gr(t,r,i),e!==null&&(mn(e,t,i),rc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var i=pn(),r=Kr(i);r.tag=1,r.payload=e,n!=null&&(r.callback=n),e=Gr(t,r,i),e!==null&&(mn(e,t,i),rc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=pn(),i=Kr(n);i.tag=2,e!=null&&(i.callback=e),e=Gr(t,i,n),e!==null&&(mn(e,t,n),rc(e,t,n))}};function Vw(t,e,n,i,r,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,s,o):e.prototype&&e.prototype.isPureReactComponent?!gc(n,i)||!gc(r,s):!0}function $w(t,e,n,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,i),e.state!==t&&Sy.enqueueReplaceState(e,e.state,null)}function Qs(t,e){var n=e;if("ref"in e){n={};for(var i in e)i!=="ref"&&(n[i]=e[i])}if(t=t.defaultProps){n===e&&(n=Ne({},n));for(var r in t)n[r]===void 0&&(n[r]=t[r])}return n}var Eh=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function tO(t){Eh(t)}function nO(t){console.error(t)}function iO(t){Eh(t)}function Dh(t,e){try{var n=t.onUncaughtError;n(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function Yw(t,e,n){try{var i=t.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function xy(t,e,n){return n=Kr(n),n.tag=3,n.payload={element:null},n.callback=function(){Dh(t,e)},n}function rO(t){return t=Kr(t),t.tag=3,t}function sO(t,e,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var s=i.value;t.payload=function(){return r(s)},t.callback=function(){Yw(e,n,i)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){Yw(e,n,i),typeof r!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var l=i.stack;this.componentDidCatch(i.value,{componentStack:l!==null?l:""})})}function UP(t,e,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=n.alternate,e!==null&&Lc(e,n,r,!0),n=Bn.current,n!==null){switch(n.tag){case 13:return Ci===null?Dy():n.alternate===null&&Ve===0&&(Ve=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===dy?n.flags|=16384:(e=n.updateQueue,e===null?n.updateQueue=new Set([i]):e.add(i),Ug(t,i,r)),!1;case 22:return n.flags|=65536,i===dy?n.flags|=16384:(e=n.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=e):(n=e.retryQueue,n===null?e.retryQueue=new Set([i]):n.add(i)),Ug(t,i,r)),!1}throw Error(D(435,n.tag))}return Ug(t,i,r),Dy(),!1}if(pe)return e=Bn.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=r,i!==ay&&(t=Error(D(422),{cause:i}),yc(Ln(t,n)))):(i!==ay&&(e=Error(D(423),{cause:i}),yc(Ln(e,n))),t=t.current.alternate,t.flags|=65536,r&=-r,t.lanes|=r,i=Ln(i,n),r=xy(t.stateNode,i,r),Eg(t,r),Ve!==4&&(Ve=2)),!1;var s=Error(D(520),{cause:i});if(s=Ln(s,n),uc===null?uc=[s]:uc.push(s),Ve!==4&&(Ve=2),e===null)return!0;i=Ln(i,n),n=e;do{switch(n.tag){case 3:return n.flags|=65536,t=r&-r,n.lanes|=t,t=xy(n.stateNode,i,t),Eg(n,t),!1;case 1:if(e=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Qr===null||!Qr.has(s))))return n.flags|=65536,r&=-r,n.lanes|=r,r=rO(r),sO(r,t,n,i),Eg(n,r),!1}n=n.return}while(n!==null);return!1}var oO=Error(D(461)),ft=!1;function yt(t,e,n,i){e.child=t===null?JA(e,null,n,i):xl(e,t.child,n,i)}function Kw(t,e,n,i,r){n=n.render;var s=e.ref;if("ref"in i){var o={};for(var l in i)l!=="ref"&&(o[l]=i[l])}else o=i;return Ks(e),i=c0(t,e,n,o,s,r),l=u0(),t!==null&&!ft?(f0(t,e,r),hr(t,e,r)):(pe&&l&&n0(e),e.flags|=1,yt(t,e,i,r),e.child)}function Gw(t,e,n,i,r){if(t===null){var s=n.type;return typeof s=="function"&&!t0(s)&&s.defaultProps===void 0&&n.compare===null?(e.tag=15,e.type=s,lO(t,e,s,i,r)):(t=rh(n.type,null,i,e,e.mode,r),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!S0(t,r)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:gc,n(o,i)&&t.ref===e.ref)return hr(t,e,r)}return e.flags|=1,t=ar(s,i),t.ref=e.ref,t.return=e,e.child=t}function lO(t,e,n,i,r){if(t!==null){var s=t.memoizedProps;if(gc(s,i)&&t.ref===e.ref)if(ft=!1,e.pendingProps=i=s,S0(t,r))(t.flags&131072)!==0&&(ft=!0);else return e.lanes=t.lanes,hr(t,e,r)}return wy(t,e,n,i,r)}function aO(t,e,n){var i=e.pendingProps,r=i.children,s=t!==null?t.memoizedState:null;if(i.mode==="hidden"){if((e.flags&128)!==0){if(i=s!==null?s.baseLanes|n:n,t!==null){for(r=e.child=t.child,s=0;r!==null;)s=s|r.lanes|r.childLanes,r=r.sibling;e.childLanes=s&~i}else e.childLanes=0,e.child=null;return Qw(t,e,i,n)}if((n&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&sh(e,s!==null?s.cachePool:null),s!==null?Bw(e,s):gy(),eO(e);else return e.lanes=e.childLanes=536870912,Qw(t,e,s!==null?s.baseLanes|n:n,n)}else s!==null?(sh(e,s.cachePool),Bw(e,s),Hr(e),e.memoizedState=null):(t!==null&&sh(e,null),gy(),Hr(e));return yt(t,e,r,n),e.child}function Qw(t,e,n,i){var r=s0();return r=r===null?null:{parent:tt._currentValue,pool:r},e.memoizedState={baseLanes:n,cachePool:r},t!==null&&sh(e,null),gy(),eO(e),t!==null&&Lc(t,e,i,!0),null}function ah(t,e){var n=e.ref;if(n===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(D(284));(t===null||t.ref!==n)&&(e.flags|=4194816)}}function wy(t,e,n,i,r){return Ks(e),n=c0(t,e,n,i,void 0,r),i=u0(),t!==null&&!ft?(f0(t,e,r),hr(t,e,r)):(pe&&i&&n0(e),e.flags|=1,yt(t,e,n,r),e.child)}function Xw(t,e,n,i,r,s){return Ks(e),e.updateQueue=null,n=xA(e,i,n,r),SA(t),i=u0(),t!==null&&!ft?(f0(t,e,s),hr(t,e,s)):(pe&&i&&n0(e),e.flags|=1,yt(t,e,n,s),e.child)}function Ww(t,e,n,i,r){if(Ks(e),e.stateNode===null){var s=il,o=n.contextType;typeof o=="object"&&o!==null&&(s=Et(o)),s=new n(i,s),e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Sy,e.stateNode=s,s._reactInternals=e,s=e.stateNode,s.props=i,s.state=e.memoizedState,s.refs={},o0(e),o=n.contextType,s.context=typeof o=="object"&&o!==null?Et(o):il,s.state=e.memoizedState,o=n.getDerivedStateFromProps,typeof o=="function"&&(Mg(e,n,o,i),s.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(o=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),o!==s.state&&Sy.enqueueReplaceState(s,s.state,null),oc(e,i,s,r),sc(),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){s=e.stateNode;var l=e.memoizedProps,a=Qs(n,l);s.props=a;var c=s.context,u=n.contextType;o=il,typeof u=="object"&&u!==null&&(o=Et(u));var f=n.getDerivedStateFromProps;u=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function",l=e.pendingProps!==l,u||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l||c!==o)&&$w(e,s,i,o),qr=!1;var h=e.memoizedState;s.state=h,oc(e,i,s,r),sc(),c=e.memoizedState,l||h!==c||qr?(typeof f=="function"&&(Mg(e,n,f,i),c=e.memoizedState),(a=qr||Vw(e,n,a,i,h,c,o))?(u||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=c),s.props=i,s.state=c,s.context=o,i=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{s=e.stateNode,py(t,e),o=e.memoizedProps,u=Qs(n,o),s.props=u,f=e.pendingProps,h=s.context,c=n.contextType,a=il,typeof c=="object"&&c!==null&&(a=Et(c)),l=n.getDerivedStateFromProps,(c=typeof l=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==a)&&$w(e,s,i,a),qr=!1,h=e.memoizedState,s.state=h,oc(e,i,s,r),sc();var d=e.memoizedState;o!==f||h!==d||qr||t!==null&&t.dependencies!==null&&wh(t.dependencies)?(typeof l=="function"&&(Mg(e,n,l,i),d=e.memoizedState),(u=qr||Vw(e,n,u,i,h,d,a)||t!==null&&t.dependencies!==null&&wh(t.dependencies))?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(i,d,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(i,d,a)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=d),s.props=i,s.state=d,s.context=a,i=u):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),i=!1)}return s=i,ah(t,e),i=(e.flags&128)!==0,s||i?(s=e.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:s.render(),e.flags|=1,t!==null&&i?(e.child=xl(e,t.child,null,r),e.child=xl(e,null,n,r)):yt(t,e,n,r),e.memoizedState=s.state,t=e.child):t=hr(t,e,r),t}function Zw(t,e,n,i){return _c(),e.flags|=256,yt(t,e,n,i),e.child}var Rg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ng(t){return{baseLanes:t,cachePool:mA()}}function _g(t,e,n){return t=t!==null?t.childLanes&~n:0,e&&(t|=In),t}function cO(t,e,n){var i=e.pendingProps,r=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(nt.current&2)!==0),o&&(r=!0,e.flags&=-129),o=(e.flags&32)!==0,e.flags&=-33,t===null){if(pe){if(r?zr(e):Hr(e),pe){var l=je,a;if(a=l){e:{for(a=l,l=ki;a.nodeType!==8;){if(!l){l=null;break e}if(a=Jn(a.nextSibling),a===null){l=null;break e}}l=a}l!==null?(e.memoizedState={dehydrated:l,treeContext:Us!==null?{id:rr,overflow:sr}:null,retryLane:536870912,hydrationErrors:null},a=fn(18,null,null,0),a.stateNode=l,a.return=e,e.child=a,Pt=e,je=null,a=!0):a=!1}a||Ys(e)}if(l=e.memoizedState,l!==null&&(l=l.dehydrated,l!==null))return By(l)?e.lanes=32:e.lanes=536870912,null;lr(e)}return l=i.children,i=i.fallback,r?(Hr(e),r=e.mode,l=Mh({mode:"hidden",children:l},r),i=Hs(i,r,n,null),l.return=e,i.return=e,l.sibling=i,e.child=l,r=e.child,r.memoizedState=Ng(n),r.childLanes=_g(t,o,n),e.memoizedState=Rg,i):(zr(e),ky(e,l))}if(a=t.memoizedState,a!==null&&(l=a.dehydrated,l!==null)){if(s)e.flags&256?(zr(e),e.flags&=-257,e=Lg(t,e,n)):e.memoizedState!==null?(Hr(e),e.child=t.child,e.flags|=128,e=null):(Hr(e),r=i.fallback,l=e.mode,i=Mh({mode:"visible",children:i.children},l),r=Hs(r,l,n,null),r.flags|=2,i.return=e,r.return=e,i.sibling=r,e.child=i,xl(e,t.child,null,n),i=e.child,i.memoizedState=Ng(n),i.childLanes=_g(t,o,n),e.memoizedState=Rg,e=r);else if(zr(e),By(l)){if(o=l.nextSibling&&l.nextSibling.dataset,o)var c=o.dgst;o=c,i=Error(D(419)),i.stack="",i.digest=o,yc({value:i,source:null,stack:null}),e=Lg(t,e,n)}else if(ft||Lc(t,e,n,!1),o=(n&t.childLanes)!==0,ft||o){if(o=Ee,o!==null&&(i=n&-n,i=(i&42)!==0?1:Vy(i),i=(i&(o.suspendedLanes|n))!==0?0:i,i!==0&&i!==a.retryLane))throw a.retryLane=i,El(t,i),mn(o,t,i),oO;l.data==="$?"||Dy(),e=Lg(t,e,n)}else l.data==="$?"?(e.flags|=192,e.child=t.child,e=null):(t=a.treeContext,je=Jn(l.nextSibling),Pt=e,pe=!0,Fs=null,ki=!1,t!==null&&(Rn[Nn++]=rr,Rn[Nn++]=sr,Rn[Nn++]=Us,rr=t.id,sr=t.overflow,Us=e),e=ky(e,i.children),e.flags|=4096);return e}return r?(Hr(e),r=i.fallback,l=e.mode,a=t.child,c=a.sibling,i=ar(a,{mode:"hidden",children:i.children}),i.subtreeFlags=a.subtreeFlags&65011712,c!==null?r=ar(c,r):(r=Hs(r,l,n,null),r.flags|=2),r.return=e,i.return=e,i.sibling=r,e.child=i,i=r,r=e.child,l=t.child.memoizedState,l===null?l=Ng(n):(a=l.cachePool,a!==null?(c=tt._currentValue,a=a.parent!==c?{parent:c,pool:c}:a):a=mA(),l={baseLanes:l.baseLanes|n,cachePool:a}),r.memoizedState=l,r.childLanes=_g(t,o,n),e.memoizedState=Rg,i):(zr(e),n=t.child,t=n.sibling,n=ar(n,{mode:"visible",children:i.children}),n.return=e,n.sibling=null,t!==null&&(o=e.deletions,o===null?(e.deletions=[t],e.flags|=16):o.push(t)),e.child=n,e.memoizedState=null,n)}function ky(t,e){return e=Mh({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function Mh(t,e){return t=fn(22,t,null,e),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function Lg(t,e,n){return xl(e,t.child,null,n),t=ky(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Jw(t,e,n){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),uy(t.return,e,n)}function Ig(t,e,n,i,r){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=i,s.tail=n,s.tailMode=r)}function uO(t,e,n){var i=e.pendingProps,r=i.revealOrder,s=i.tail;if(yt(t,e,i.children,n),i=nt.current,(i&2)!==0)i=i&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Jw(t,n,e);else if(t.tag===19)Jw(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}i&=1}switch(Pe(nt,i),r){case"forwards":for(n=e.child,r=null;n!==null;)t=n.alternate,t!==null&&Ch(t)===null&&(r=n),n=n.sibling;n=r,n===null?(r=e.child,e.child=null):(r=n.sibling,n.sibling=null),Ig(e,!1,r,n,s);break;case"backwards":for(n=null,r=e.child,e.child=null;r!==null;){if(t=r.alternate,t!==null&&Ch(t)===null){e.child=r;break}t=r.sibling,r.sibling=n,n=r,r=t}Ig(e,!0,n,null,s);break;case"together":Ig(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function hr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),ns|=e.lanes,(n&e.childLanes)===0)if(t!==null){if(Lc(t,e,n,!1),(n&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(D(153));if(e.child!==null){for(t=e.child,n=ar(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=ar(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function S0(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&wh(t)))}function FP(t,e,n){switch(e.tag){case 3:ph(e,e.stateNode.containerInfo),Pr(e,tt,t.memoizedState.cache),_c();break;case 27:case 5:Zg(e);break;case 4:ph(e,e.stateNode.containerInfo);break;case 10:Pr(e,e.type,e.memoizedProps.value);break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(zr(e),e.flags|=128,null):(n&e.child.childLanes)!==0?cO(t,e,n):(zr(e),t=hr(t,e,n),t!==null?t.sibling:null);zr(e);break;case 19:var r=(t.flags&128)!==0;if(i=(n&e.childLanes)!==0,i||(Lc(t,e,n,!1),i=(n&e.childLanes)!==0),r){if(i)return uO(t,e,n);e.flags|=128}if(r=e.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Pe(nt,nt.current),i)break;return null;case 22:case 23:return e.lanes=0,aO(t,e,n);case 24:Pr(e,tt,t.memoizedState.cache)}return hr(t,e,n)}function fO(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps)ft=!0;else{if(!S0(t,n)&&(e.flags&128)===0)return ft=!1,FP(t,e,n);ft=(t.flags&131072)!==0}else ft=!1,pe&&(e.flags&1048576)!==0&&dA(e,xh,e.index);switch(e.lanes=0,e.tag){case 16:e:{t=e.pendingProps;var i=e.elementType,r=i._init;if(i=r(i._payload),e.type=i,typeof i=="function")t0(i)?(t=Qs(i,t),e.tag=1,e=Ww(null,e,i,t,n)):(e.tag=0,e=wy(null,e,i,t,n));else{if(i!=null){if(r=i.$$typeof,r===Uy){e.tag=11,e=Kw(null,e,i,t,n);break e}else if(r===Fy){e.tag=14,e=Gw(null,e,i,t,n);break e}}throw e=Xg(i)||i,Error(D(306,e,""))}}return e;case 0:return wy(t,e,e.type,e.pendingProps,n);case 1:return i=e.type,r=Qs(i,e.pendingProps),Ww(t,e,i,r,n);case 3:e:{if(ph(e,e.stateNode.containerInfo),t===null)throw Error(D(387));i=e.pendingProps;var s=e.memoizedState;r=s.element,py(t,e),oc(e,i,null,n);var o=e.memoizedState;if(i=o.cache,Pr(e,tt,i),i!==s.cache&&fy(e,[tt],n,!0),sc(),i=o.element,s.isDehydrated)if(s={element:i,isDehydrated:!1,cache:o.cache},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){e=Zw(t,e,i,n);break e}else if(i!==r){r=Ln(Error(D(424)),e),yc(r),e=Zw(t,e,i,n);break e}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,je=Jn(t.firstChild),Pt=e,pe=!0,Fs=null,ki=!0,n=JA(e,null,i,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_c(),i===r){e=hr(t,e,n);break e}yt(t,e,i,n)}e=e.child}return e;case 26:return ah(t,e),t===null?(n=bk(e.type,null,e.pendingProps,null))?e.memoizedState=n:pe||(n=e.type,t=e.pendingProps,i=qh(Yr.current).createElement(n),i[Ct]=e,i[Zt]=t,vt(i,n,t),ut(i),e.stateNode=i):e.memoizedState=bk(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Zg(e),t===null&&pe&&(i=e.stateNode=WO(e.type,e.pendingProps,Yr.current),Pt=e,ki=!0,r=je,rs(e.type)?(qy=r,je=Jn(i.firstChild)):je=r),yt(t,e,e.pendingProps.children,n),ah(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&pe&&((r=i=je)&&(i=pz(i,e.type,e.pendingProps,ki),i!==null?(e.stateNode=i,Pt=e,je=Jn(i.firstChild),ki=!1,r=!0):r=!1),r||Ys(e)),Zg(e),r=e.type,s=e.pendingProps,o=t!==null?t.memoizedProps:null,i=s.children,Ly(r,s)?i=null:o!==null&&Ly(r,o)&&(e.flags|=32),e.memoizedState!==null&&(r=c0(t,e,LP,null,null,n),kc._currentValue=r),ah(t,e),yt(t,e,i,n),e.child;case 6:return t===null&&pe&&((t=n=je)&&(n=mz(n,e.pendingProps,ki),n!==null?(e.stateNode=n,Pt=e,je=null,t=!0):t=!1),t||Ys(e)),null;case 13:return cO(t,e,n);case 4:return ph(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=xl(e,null,i,n):yt(t,e,i,n),e.child;case 11:return Kw(t,e,e.type,e.pendingProps,n);case 7:return yt(t,e,e.pendingProps,n),e.child;case 8:return yt(t,e,e.pendingProps.children,n),e.child;case 12:return yt(t,e,e.pendingProps.children,n),e.child;case 10:return i=e.pendingProps,Pr(e,e.type,i.value),yt(t,e,i.children,n),e.child;case 9:return r=e.type._context,i=e.pendingProps.children,Ks(e),r=Et(r),i=i(r),e.flags|=1,yt(t,e,i,n),e.child;case 14:return Gw(t,e,e.type,e.pendingProps,n);case 15:return lO(t,e,e.type,e.pendingProps,n);case 19:return uO(t,e,n);case 31:return i=e.pendingProps,n=e.mode,i={mode:i.mode,children:i.children},t===null?(n=Mh(i,n),n.ref=e.ref,e.child=n,n.return=e,e=n):(n=ar(t.child,i),n.ref=e.ref,e.child=n,n.return=e,e=n),e;case 22:return aO(t,e,n);case 24:return Ks(e),i=Et(tt),t===null?(r=s0(),r===null&&(r=Ee,s=r0(),r.pooledCache=s,s.refCount++,s!==null&&(r.pooledCacheLanes|=n),r=s),e.memoizedState={parent:i,cache:r},o0(e),Pr(e,tt,r)):((t.lanes&n)!==0&&(py(t,e),oc(e,null,null,n),sc()),r=t.memoizedState,s=e.memoizedState,r.parent!==i?(r={parent:i,cache:i},e.memoizedState=r,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=r),Pr(e,tt,i)):(i=s.cache,Pr(e,tt,i),i!==r.cache&&fy(e,[tt],n,!0))),yt(t,e,e.pendingProps.children,n),e.child;case 29:throw e.pendingProps}throw Error(D(156,e.tag))}function er(t){t.flags|=4}function ek(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!eT(e)){if(e=Bn.current,e!==null&&((fe&4194048)===fe?Ci!==null:(fe&62914560)!==fe&&(fe&536870912)===0||e!==Ci))throw ic=dy,gA;t.flags|=8192}}function Gf(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?qk():536870912,t.lanes|=e,wl|=e)}function $a(t,e){if(!pe)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 i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Ue(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,i=0;if(e)for(var r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&65011712,i|=r.flags&65011712,r.return=t,r=r.sibling;else for(r=t.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=t,r=r.sibling;return t.subtreeFlags|=i,t.childLanes=n,e}function jP(t,e,n){var i=e.pendingProps;switch(i0(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ue(e),null;case 1:return Ue(e),null;case 3:return n=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),cr(tt),ml(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ja(e)?er(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,Mw())),Ue(e),null;case 26:return n=e.memoizedState,t===null?(er(e),n!==null?(Ue(e),ek(e,n)):(Ue(e),e.flags&=-16777217)):n?n!==t.memoizedState?(er(e),Ue(e),ek(e,n)):(Ue(e),e.flags&=-16777217):(t.memoizedProps!==i&&er(e),Ue(e),e.flags&=-16777217),null;case 27:mh(e),n=Yr.current;var r=e.type;if(t!==null&&e.stateNode!=null)t.memoizedProps!==i&&er(e);else{if(!i){if(e.stateNode===null)throw Error(D(166));return Ue(e),null}t=Oi.current,ja(e)?Ew(e,t):(t=WO(r,i,n),e.stateNode=t,er(e))}return Ue(e),null;case 5:if(mh(e),n=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&er(e);else{if(!i){if(e.stateNode===null)throw Error(D(166));return Ue(e),null}if(t=Oi.current,ja(e))Ew(e,t);else{switch(r=qh(Yr.current),t){case 1:t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":t=r.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":t=r.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":t=r.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof i.is=="string"?r.createElement("select",{is:i.is}):r.createElement("select"),i.multiple?t.multiple=!0:i.size&&(t.size=i.size);break;default:t=typeof i.is=="string"?r.createElement(n,{is:i.is}):r.createElement(n)}}t[Ct]=e,t[Zt]=i;e:for(r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}e.stateNode=t;e:switch(vt(t,n,i),n){case"button":case"input":case"select":case"textarea":t=!!i.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&er(e)}}return Ue(e),e.flags&=-16777217,null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&er(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(D(166));if(t=Yr.current,ja(e)){if(t=e.stateNode,n=e.memoizedProps,i=null,r=Pt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}t[Ct]=e,t=!!(t.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||GO(t.nodeValue,n)),t||Ys(e)}else t=qh(t).createTextNode(i),t[Ct]=e,e.stateNode=t}return Ue(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(r=ja(e),i!==null&&i.dehydrated!==null){if(t===null){if(!r)throw Error(D(318));if(r=e.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(D(317));r[Ct]=e}else _c(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Ue(e),r=!1}else r=Mw(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=r),r=!0;if(!r)return e.flags&256?(lr(e),e):(lr(e),null)}if(lr(e),(e.flags&128)!==0)return e.lanes=n,e;if(n=i!==null,t=t!==null&&t.memoizedState!==null,n){i=e.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool);var s=null;i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==r&&(i.flags|=2048)}return n!==t&&n&&(e.child.flags|=8192),Gf(e,e.updateQueue),Ue(e),null;case 4:return ml(),t===null&&E0(e.stateNode.containerInfo),Ue(e),null;case 10:return cr(e.type),Ue(e),null;case 19:if(ht(nt),r=e.memoizedState,r===null)return Ue(e),null;if(i=(e.flags&128)!==0,s=r.rendering,s===null)if(i)$a(r,!1);else{if(Ve!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=Ch(t),s!==null){for(e.flags|=128,$a(r,!1),t=s.updateQueue,e.updateQueue=t,Gf(e,t),e.subtreeFlags=0,t=n,n=e.child;n!==null;)hA(n,t),n=n.sibling;return Pe(nt,nt.current&1|2),e.child}t=t.sibling}r.tail!==null&&Ti()>Nh&&(e.flags|=128,i=!0,$a(r,!1),e.lanes=4194304)}else{if(!i)if(t=Ch(s),t!==null){if(e.flags|=128,i=!0,t=t.updateQueue,e.updateQueue=t,Gf(e,t),$a(r,!0),r.tail===null&&r.tailMode==="hidden"&&!s.alternate&&!pe)return Ue(e),null}else 2*Ti()-r.renderingStartTime>Nh&&n!==536870912&&(e.flags|=128,i=!0,$a(r,!1),e.lanes=4194304);r.isBackwards?(s.sibling=e.child,e.child=s):(t=r.last,t!==null?t.sibling=s:e.child=s,r.last=s)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ti(),e.sibling=null,t=nt.current,Pe(nt,i?t&1|2:t&1),e):(Ue(e),null);case 22:case 23:return lr(e),l0(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(n&536870912)!==0&&(e.flags&128)===0&&(Ue(e),e.subtreeFlags&6&&(e.flags|=8192)):Ue(e),n=e.updateQueue,n!==null&&Gf(e,n.retryQueue),n=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==n&&(e.flags|=2048),t!==null&&ht(js),null;case 24:return n=null,t!==null&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),cr(tt),Ue(e),null;case 25:return null;case 30:return null}throw Error(D(156,e.tag))}function VP(t,e){switch(i0(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return cr(tt),ml(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return mh(e),null;case 13:if(lr(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(D(340));_c()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ht(nt),null;case 4:return ml(),null;case 10:return cr(e.type),null;case 22:case 23:return lr(e),l0(),t!==null&&ht(js),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return cr(tt),null;case 25:return null;default:return null}}function hO(t,e){switch(i0(e),e.tag){case 3:cr(tt),ml();break;case 26:case 27:case 5:mh(e);break;case 4:ml();break;case 13:lr(e);break;case 19:ht(nt);break;case 10:cr(e.type);break;case 22:case 23:lr(e),l0(),t!==null&&ht(js);break;case 24:cr(tt)}}function zc(t,e){try{var n=e.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&t)===t){i=void 0;var s=n.create,o=n.inst;i=s(),o.destroy=i}n=n.next}while(n!==r)}}catch(l){Ae(e,e.return,l)}}function ts(t,e,n){try{var i=e.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var s=r.next;i=s;do{if((i.tag&t)===t){var o=i.inst,l=o.destroy;if(l!==void 0){o.destroy=void 0,r=e;var a=n,c=l;try{c()}catch(u){Ae(r,a,u)}}}i=i.next}while(i!==s)}}catch(u){Ae(e,e.return,u)}}function dO(t){var e=t.updateQueue;if(e!==null){var n=t.stateNode;try{vA(e,n)}catch(i){Ae(t,t.return,i)}}}function pO(t,e,n){n.props=Qs(t.type,t.memoizedProps),n.state=t.memoizedState;try{n.componentWillUnmount()}catch(i){Ae(t,e,i)}}function ac(t,e){try{var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof n=="function"?t.refCleanup=n(i):n.current=i}}catch(r){Ae(t,e,r)}}function Ai(t,e){var n=t.ref,i=t.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){Ae(t,e,r)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){Ae(t,e,r)}else n.current=null}function mO(t){var e=t.type,n=t.memoizedProps,i=t.stateNode;try{e:switch(e){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){Ae(t,t.return,r)}}function Bg(t,e,n){try{var i=t.stateNode;cz(i,t.type,n,e),i[Zt]=e}catch(r){Ae(t,t.return,r)}}function gO(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&rs(t.type)||t.tag===4}function qg(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||gO(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.tag===27&&rs(t.type)||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 Ay(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(t,e):(e=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,e.appendChild(t),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=nd));else if(i!==4&&(i===27&&rs(t.type)&&(n=t.stateNode,e=null),t=t.child,t!==null))for(Ay(t,e,n),t=t.sibling;t!==null;)Ay(t,e,n),t=t.sibling}function Rh(t,e,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(i!==4&&(i===27&&rs(t.type)&&(n=t.stateNode),t=t.child,t!==null))for(Rh(t,e,n),t=t.sibling;t!==null;)Rh(t,e,n),t=t.sibling}function yO(t){var e=t.stateNode,n=t.memoizedProps;try{for(var i=t.type,r=e.attributes;r.length;)e.removeAttributeNode(r[0]);vt(e,i,n),e[Ct]=t,e[Zt]=n}catch(s){Ae(t,t.return,s)}}var nr=!1,Ge=!1,Pg=!1,tk=typeof WeakSet=="function"?WeakSet:Set,ct=null;function $P(t,e){if(t=t.containerInfo,Ny=Uh,t=rA(t),Zy(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var r=i.anchorOffset,s=i.focusNode;i=i.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,l=-1,a=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var d;f!==n||r!==0&&f.nodeType!==3||(l=o+r),f!==s||i!==0&&f.nodeType!==3||(a=o+i),f.nodeType===3&&(o+=f.nodeValue.length),(d=f.firstChild)!==null;)h=f,f=d;for(;;){if(f===t)break t;if(h===n&&++c===r&&(l=o),h===s&&++u===i&&(a=o),(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(_y={focusedElem:t,selectionRange:n},Uh=!1,ct=e;ct!==null;)if(e=ct,t=e.child,(e.subtreeFlags&1024)!==0&&t!==null)t.return=e,ct=t;else for(;ct!==null;){switch(e=ct,s=e.alternate,t=e.flags,e.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&s!==null){t=void 0,n=e,r=s.memoizedProps,s=s.memoizedState,i=n.stateNode;try{var m=Qs(n.type,r,n.elementType===n.type);t=i.getSnapshotBeforeUpdate(m,s),i.__reactInternalSnapshotBeforeUpdate=t}catch(g){Ae(n,n.return,g)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,n=t.nodeType,n===9)Iy(t);else if(n===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Iy(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(D(163))}if(t=e.sibling,t!==null){t.return=e.return,ct=t;break}ct=e.return}}function bO(t,e,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Lr(t,n),i&4&&zc(5,n);break;case 1:if(Lr(t,n),i&4)if(t=n.stateNode,e===null)try{t.componentDidMount()}catch(o){Ae(n,n.return,o)}else{var r=Qs(n.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(r,e,t.__reactInternalSnapshotBeforeUpdate)}catch(o){Ae(n,n.return,o)}}i&64&&dO(n),i&512&&ac(n,n.return);break;case 3:if(Lr(t,n),i&64&&(t=n.updateQueue,t!==null)){if(e=null,n.child!==null)switch(n.child.tag){case 27:case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}try{vA(t,e)}catch(o){Ae(n,n.return,o)}}break;case 27:e===null&&i&4&&yO(n);case 26:case 5:Lr(t,n),e===null&&i&4&&mO(n),i&512&&ac(n,n.return);break;case 12:Lr(t,n);break;case 13:Lr(t,n),i&4&&xO(t,n),i&64&&(t=n.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(n=ez.bind(null,n),gz(t,n))));break;case 22:if(i=n.memoizedState!==null||nr,!i){e=e!==null&&e.memoizedState!==null||Ge,r=nr;var s=Ge;nr=i,(Ge=e)&&!s?Ir(t,n,(n.subtreeFlags&8772)!==0):Lr(t,n),nr=r,Ge=s}break;case 30:break;default:Lr(t,n)}}function vO(t){var e=t.alternate;e!==null&&(t.alternate=null,vO(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&Yy(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var qe=null,Xt=!1;function tr(t,e,n){for(n=n.child;n!==null;)SO(t,e,n),n=n.sibling}function SO(t,e,n){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(Ec,n)}catch{}switch(n.tag){case 26:Ge||Ai(n,e),tr(t,e,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ge||Ai(n,e);var i=qe,r=Xt;rs(n.type)&&(qe=n.stateNode,Xt=!1),tr(t,e,n),hc(n.stateNode),qe=i,Xt=r;break;case 5:Ge||Ai(n,e);case 6:if(i=qe,r=Xt,qe=null,tr(t,e,n),qe=i,Xt=r,qe!==null)if(Xt)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(s){Ae(n,e,s)}else try{qe.removeChild(n.stateNode)}catch(s){Ae(n,e,s)}break;case 18:qe!==null&&(Xt?(t=qe,mk(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,n.stateNode),Tc(t)):mk(qe,n.stateNode));break;case 4:i=qe,r=Xt,qe=n.stateNode.containerInfo,Xt=!0,tr(t,e,n),qe=i,Xt=r;break;case 0:case 11:case 14:case 15:Ge||ts(2,n,e),Ge||ts(4,n,e),tr(t,e,n);break;case 1:Ge||(Ai(n,e),i=n.stateNode,typeof i.componentWillUnmount=="function"&&pO(n,e,i)),tr(t,e,n);break;case 21:tr(t,e,n);break;case 22:Ge=(i=Ge)||n.memoizedState!==null,tr(t,e,n),Ge=i;break;default:tr(t,e,n)}}function xO(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Tc(t)}catch(n){Ae(e,e.return,n)}}function YP(t){switch(t.tag){case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new tk),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new tk),e;default:throw Error(D(435,t.tag))}}function zg(t,e){var n=YP(t);e.forEach(function(i){var r=tz.bind(null,t,i);n.has(i)||(n.add(i),i.then(r,r))})}function an(t,e){var n=e.deletions;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i],s=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 27:if(rs(l.type)){qe=l.stateNode,Xt=!1;break e}break;case 5:qe=l.stateNode,Xt=!1;break e;case 3:case 4:qe=l.stateNode.containerInfo,Xt=!0;break e}l=l.return}if(qe===null)throw Error(D(160));SO(s,o,r),qe=null,Xt=!1,s=r.alternate,s!==null&&(s.return=null),r.return=null}if(e.subtreeFlags&13878)for(e=e.child;e!==null;)wO(e,t),e=e.sibling}var Zn=null;function wO(t,e){var n=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:an(e,t),cn(t),i&4&&(ts(3,t,t.return),zc(3,t),ts(5,t,t.return));break;case 1:an(e,t),cn(t),i&512&&(Ge||n===null||Ai(n,n.return)),i&64&&nr&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(n=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var r=Zn;if(an(e,t),cn(t),i&512&&(Ge||n===null||Ai(n,n.return)),i&4){var s=n!==null?n.memoizedState:null;if(i=t.memoizedState,n===null)if(i===null)if(t.stateNode===null){e:{i=t.type,n=t.memoizedProps,r=r.ownerDocument||r;t:switch(i){case"title":s=r.getElementsByTagName("title")[0],(!s||s[Rc]||s[Ct]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=r.createElement(i),r.head.insertBefore(s,r.querySelector("head > title"))),vt(s,i,n),s[Ct]=t,ut(s),i=s;break e;case"link":var o=Sk("link","href",r).get(i+(n.href||""));if(o){for(var l=0;l<o.length;l++)if(s=o[l],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(l,1);break t}}s=r.createElement(i),vt(s,i,n),r.head.appendChild(s);break;case"meta":if(o=Sk("meta","content",r).get(i+(n.content||""))){for(l=0;l<o.length;l++)if(s=o[l],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){o.splice(l,1);break t}}s=r.createElement(i),vt(s,i,n),r.head.appendChild(s);break;default:throw Error(D(468,i))}s[Ct]=t,ut(s),i=s}t.stateNode=i}else xk(r,t.type,t.stateNode);else t.stateNode=vk(r,i,t.memoizedProps);else s!==i?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,i===null?xk(r,t.type,t.stateNode):vk(r,i,t.memoizedProps)):i===null&&t.stateNode!==null&&Bg(t,t.memoizedProps,n.memoizedProps)}break;case 27:an(e,t),cn(t),i&512&&(Ge||n===null||Ai(n,n.return)),n!==null&&i&4&&Bg(t,t.memoizedProps,n.memoizedProps);break;case 5:if(an(e,t),cn(t),i&512&&(Ge||n===null||Ai(n,n.return)),t.flags&32){r=t.stateNode;try{yl(r,"")}catch(d){Ae(t,t.return,d)}}i&4&&t.stateNode!=null&&(r=t.memoizedProps,Bg(t,r,n!==null?n.memoizedProps:r)),i&1024&&(Pg=!0);break;case 6:if(an(e,t),cn(t),i&4){if(t.stateNode===null)throw Error(D(162));i=t.memoizedProps,n=t.stateNode;try{n.nodeValue=i}catch(d){Ae(t,t.return,d)}}break;case 3:if(fh=null,r=Zn,Zn=Ph(e.containerInfo),an(e,t),Zn=r,cn(t),i&4&&n!==null&&n.memoizedState.isDehydrated)try{Tc(e.containerInfo)}catch(d){Ae(t,t.return,d)}Pg&&(Pg=!1,kO(t));break;case 4:i=Zn,Zn=Ph(t.stateNode.containerInfo),an(e,t),cn(t),Zn=i;break;case 12:an(e,t),cn(t);break;case 13:an(e,t),cn(t),t.child.flags&8192&&t.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(O0=Ti()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,zg(t,i)));break;case 22:r=t.memoizedState!==null;var a=n!==null&&n.memoizedState!==null,c=nr,u=Ge;if(nr=c||r,Ge=u||a,an(e,t),Ge=u,nr=c,cn(t),i&8192)e:for(e=t.stateNode,e._visibility=r?e._visibility&-2:e._visibility|1,r&&(n===null||a||nr||Ge||Ps(t)),n=null,e=t;;){if(e.tag===5||e.tag===26){if(n===null){a=n=e;try{if(s=a.stateNode,r)o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{l=a.stateNode;var f=a.memoizedProps.style,h=f!=null&&f.hasOwnProperty("display")?f.display:null;l.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(d){Ae(a,a.return,d)}}}else if(e.tag===6){if(n===null){a=e;try{a.stateNode.nodeValue=r?"":a.memoizedProps}catch(d){Ae(a,a.return,d)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;n===e&&(n=null),e=e.return}n===e&&(n=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,zg(t,n))));break;case 19:an(e,t),cn(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,zg(t,i)));break;case 30:break;case 21:break;default:an(e,t),cn(t)}}function cn(t){var e=t.flags;if(e&2){try{for(var n,i=t.return;i!==null;){if(gO(i)){n=i;break}i=i.return}if(n==null)throw Error(D(160));switch(n.tag){case 27:var r=n.stateNode,s=qg(t);Rh(t,s,r);break;case 5:var o=n.stateNode;n.flags&32&&(yl(o,""),n.flags&=-33);var l=qg(t);Rh(t,l,o);break;case 3:case 4:var a=n.stateNode.containerInfo,c=qg(t);Ay(t,c,a);break;default:throw Error(D(161))}}catch(u){Ae(t,t.return,u)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function kO(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;kO(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Lr(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)bO(t,e.alternate,e),e=e.sibling}function Ps(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ts(4,e,e.return),Ps(e);break;case 1:Ai(e,e.return);var n=e.stateNode;typeof n.componentWillUnmount=="function"&&pO(e,e.return,n),Ps(e);break;case 27:hc(e.stateNode);case 26:case 5:Ai(e,e.return),Ps(e);break;case 22:e.memoizedState===null&&Ps(e);break;case 30:Ps(e);break;default:Ps(e)}t=t.sibling}}function Ir(t,e,n){for(n=n&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,r=t,s=e,o=s.flags;switch(s.tag){case 0:case 11:case 15:Ir(r,s,n),zc(4,s);break;case 1:if(Ir(r,s,n),i=s,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(c){Ae(i,i.return,c)}if(i=s,r=i.updateQueue,r!==null){var l=i.stateNode;try{var a=r.shared.hiddenCallbacks;if(a!==null)for(r.shared.hiddenCallbacks=null,r=0;r<a.length;r++)bA(a[r],l)}catch(c){Ae(i,i.return,c)}}n&&o&64&&dO(s),ac(s,s.return);break;case 27:yO(s);case 26:case 5:Ir(r,s,n),n&&i===null&&o&4&&mO(s),ac(s,s.return);break;case 12:Ir(r,s,n);break;case 13:Ir(r,s,n),n&&o&4&&xO(r,s);break;case 22:s.memoizedState===null&&Ir(r,s,n),ac(s,s.return);break;case 30:break;default:Ir(r,s,n)}e=e.sibling}}function x0(t,e){var n=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==n&&(t!=null&&t.refCount++,n!=null&&Ic(n))}function w0(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Ic(t))}function wi(t,e,n,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)AO(t,e,n,i),e=e.sibling}function AO(t,e,n,i){var r=e.flags;switch(e.tag){case 0:case 11:case 15:wi(t,e,n,i),r&2048&&zc(9,e);break;case 1:wi(t,e,n,i);break;case 3:wi(t,e,n,i),r&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&Ic(t)));break;case 12:if(r&2048){wi(t,e,n,i),t=e.stateNode;try{var s=e.memoizedProps,o=s.id,l=s.onPostCommit;typeof l=="function"&&l(o,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(a){Ae(e,e.return,a)}}else wi(t,e,n,i);break;case 13:wi(t,e,n,i);break;case 23:break;case 22:s=e.stateNode,o=e.alternate,e.memoizedState!==null?s._visibility&2?wi(t,e,n,i):cc(t,e):s._visibility&2?wi(t,e,n,i):(s._visibility|=2,Ko(t,e,n,i,(e.subtreeFlags&10256)!==0)),r&2048&&x0(o,e);break;case 24:wi(t,e,n,i),r&2048&&w0(e.alternate,e);break;default:wi(t,e,n,i)}}function Ko(t,e,n,i,r){for(r=r&&(e.subtreeFlags&10256)!==0,e=e.child;e!==null;){var s=t,o=e,l=n,a=i,c=o.flags;switch(o.tag){case 0:case 11:case 15:Ko(s,o,l,a,r),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState!==null?u._visibility&2?Ko(s,o,l,a,r):cc(s,o):(u._visibility|=2,Ko(s,o,l,a,r)),r&&c&2048&&x0(o.alternate,o);break;case 24:Ko(s,o,l,a,r),r&&c&2048&&w0(o.alternate,o);break;default:Ko(s,o,l,a,r)}e=e.sibling}}function cc(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var n=t,i=e,r=i.flags;switch(i.tag){case 22:cc(n,i),r&2048&&x0(i.alternate,i);break;case 24:cc(n,i),r&2048&&w0(i.alternate,i);break;default:cc(n,i)}e=e.sibling}}var Za=8192;function Vo(t){if(t.subtreeFlags&Za)for(t=t.child;t!==null;)OO(t),t=t.sibling}function OO(t){switch(t.tag){case 26:Vo(t),t.flags&Za&&t.memoizedState!==null&&Dz(Zn,t.memoizedState,t.memoizedProps);break;case 5:Vo(t);break;case 3:case 4:var e=Zn;Zn=Ph(t.stateNode.containerInfo),Vo(t),Zn=e;break;case 22:t.memoizedState===null&&(e=t.alternate,e!==null&&e.memoizedState!==null?(e=Za,Za=16777216,Vo(t),Za=e):Vo(t));break;default:Vo(t)}}function TO(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function Ya(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ct=i,EO(i,t)}TO(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)CO(t),t=t.sibling}function CO(t){switch(t.tag){case 0:case 11:case 15:Ya(t),t.flags&2048&&ts(9,t,t.return);break;case 3:Ya(t);break;case 12:Ya(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,ch(t)):Ya(t);break;default:Ya(t)}}function ch(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var n=0;n<e.length;n++){var i=e[n];ct=i,EO(i,t)}TO(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ts(8,e,e.return),ch(e);break;case 22:n=e.stateNode,n._visibility&2&&(n._visibility&=-3,ch(e));break;default:ch(e)}t=t.sibling}}function EO(t,e){for(;ct!==null;){var n=ct;switch(n.tag){case 0:case 11:case 15:ts(8,n,e);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ic(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,ct=i;else e:for(n=t;ct!==null;){i=ct;var r=i.sibling,s=i.return;if(vO(i),i===n){ct=null;break e}if(r!==null){r.return=s,ct=r;break e}ct=s}}}var KP={getCacheForType:function(t){var e=Et(tt),n=e.data.get(t);return n===void 0&&(n=t(),e.data.set(t,n)),n}},GP=typeof WeakMap=="function"?WeakMap:Map,Se=0,Ee=null,re=null,fe=0,ve=0,un=null,Vr=!1,Dl=!1,k0=!1,dr=0,Ve=0,ns=0,Vs=0,A0=0,In=0,wl=0,uc=null,Wt=null,Oy=!1,O0=0,Nh=1/0,_h=null,Qr=null,bt=0,Xr=null,kl=null,pl=0,Ty=0,Cy=null,DO=null,fc=0,Ey=null;function pn(){if((Se&2)!==0&&fe!==0)return fe&-fe;if(Y.T!==null){var t=bl;return t!==0?t:C0()}return Hk()}function MO(){In===0&&(In=(fe&536870912)===0||pe?Bk():536870912);var t=Bn.current;return t!==null&&(t.flags|=32),In}function mn(t,e,n){(t===Ee&&(ve===2||ve===9)||t.cancelPendingCommit!==null)&&(Al(t,0),$r(t,fe,In,!1)),Mc(t,n),((Se&2)===0||t!==Ee)&&(t===Ee&&((Se&2)===0&&(Vs|=n),Ve===4&&$r(t,fe,In,!1)),Di(t))}function RO(t,e,n){if((Se&6)!==0)throw Error(D(327));var i=!n&&(e&124)===0&&(e&t.expiredLanes)===0||Dc(t,e),r=i?WP(t,e):Hg(t,e,!0),s=i;do{if(r===0){Dl&&!i&&$r(t,e,0,!1);break}else{if(n=t.current.alternate,s&&!QP(n)){r=Hg(t,e,!1),s=!1;continue}if(r===2){if(s=e,t.errorRecoveryDisabledLanes&s)var o=0;else o=t.pendingLanes&-536870913,o=o!==0?o:o&536870912?536870912:0;if(o!==0){e=o;e:{var l=t;r=uc;var a=l.current.memoizedState.isDehydrated;if(a&&(Al(l,o).flags|=256),o=Hg(l,o,!1),o!==2){if(k0&&!a){l.errorRecoveryDisabledLanes|=s,Vs|=s,r=4;break e}s=Wt,Wt=r,s!==null&&(Wt===null?Wt=s:Wt.push.apply(Wt,s))}r=o}if(s=!1,r!==2)continue}}if(r===1){Al(t,0),$r(t,e,0,!0);break}e:{switch(i=t,s=r,s){case 0:case 1:throw Error(D(345));case 4:if((e&4194048)!==e)break;case 6:$r(i,e,In,!Vr);break e;case 2:Wt=null;break;case 3:case 5:break;default:throw Error(D(329))}if((e&62914560)===e&&(r=O0+300-Ti(),10<r)){if($r(i,e,In,!Vr),jh(i,0,!0)!==0)break e;i.timeoutHandle=XO(nk.bind(null,i,n,Wt,_h,Oy,e,In,Vs,wl,Vr,s,2,-0,0),r);break e}nk(i,n,Wt,_h,Oy,e,In,Vs,wl,Vr,s,0,-0,0)}}break}while(!0);Di(t)}function nk(t,e,n,i,r,s,o,l,a,c,u,f,h,d){if(t.timeoutHandle=-1,f=e.subtreeFlags,(f&8192||(f&16785408)===16785408)&&(wc={stylesheets:null,count:0,unsuspend:Ez},OO(e),f=Mz(),f!==null)){t.cancelPendingCommit=f(rk.bind(null,t,e,s,n,i,r,o,l,a,u,1,h,d)),$r(t,s,o,!c);return}rk(t,e,s,n,i,r,o,l,a)}function QP(t){for(var e=t;;){var n=e.tag;if((n===0||n===11||n===15)&&e.flags&16384&&(n=e.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var r=n[i],s=r.getSnapshot;r=r.value;try{if(!gn(s(),r))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 $r(t,e,n,i){e&=~A0,e&=~Vs,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var r=e;0<r;){var s=31-dn(r),o=1<<s;i[s]=-1,r&=~o}n!==0&&Pk(t,n,e)}function Jh(){return(Se&6)===0?(Hc(0,!1),!1):!0}function T0(){if(re!==null){if(ve===0)var t=re.return;else t=re,or=Js=null,h0(t),dl=null,vc=0,t=re;for(;t!==null;)hO(t.alternate,t),t=t.return;re=null}}function Al(t,e){var n=t.timeoutHandle;n!==-1&&(t.timeoutHandle=-1,fz(n)),n=t.cancelPendingCommit,n!==null&&(t.cancelPendingCommit=null,n()),T0(),Ee=t,re=n=ar(t.current,null),fe=e,ve=0,un=null,Vr=!1,Dl=Dc(t,e),k0=!1,wl=In=A0=Vs=ns=Ve=0,Wt=uc=null,Oy=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var r=31-dn(i),s=1<<r;e|=t[r],i&=~s}return dr=e,Kh(),n}function NO(t,e){Z=null,Y.H=Th,e===Bc||e===Qh?(e=Lw(),ve=3):e===gA?(e=Lw(),ve=4):ve=e===oO?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,un=e,re===null&&(Ve=1,Dh(t,Ln(e,t.current)))}function _O(){var t=Y.H;return Y.H=Th,t===null?Th:t}function LO(){var t=Y.A;return Y.A=KP,t}function Dy(){Ve=4,Vr||(fe&4194048)!==fe&&Bn.current!==null||(Dl=!0),(ns&134217727)===0&&(Vs&134217727)===0||Ee===null||$r(Ee,fe,In,!1)}function Hg(t,e,n){var i=Se;Se|=2;var r=_O(),s=LO();(Ee!==t||fe!==e)&&(_h=null,Al(t,e)),e=!1;var o=Ve;e:do try{if(ve!==0&&re!==null){var l=re,a=un;switch(ve){case 8:T0(),o=6;break e;case 3:case 2:case 9:case 6:Bn.current===null&&(e=!0);var c=ve;if(ve=0,un=null,ol(t,l,a,c),n&&Dl){o=0;break e}break;default:c=ve,ve=0,un=null,ol(t,l,a,c)}}XP(),o=Ve;break}catch(u){NO(t,u)}while(!0);return e&&t.shellSuspendCounter++,or=Js=null,Se=i,Y.H=r,Y.A=s,re===null&&(Ee=null,fe=0,Kh()),o}function XP(){for(;re!==null;)IO(re)}function WP(t,e){var n=Se;Se|=2;var i=_O(),r=LO();Ee!==t||fe!==e?(_h=null,Nh=Ti()+500,Al(t,e)):Dl=Dc(t,e);e:do try{if(ve!==0&&re!==null){e=re;var s=un;t:switch(ve){case 1:ve=0,un=null,ol(t,e,s,1);break;case 2:case 9:if(_w(s)){ve=0,un=null,ik(e);break}e=function(){ve!==2&&ve!==9||Ee!==t||(ve=7),Di(t)},s.then(e,e);break e;case 3:ve=7;break e;case 4:ve=5;break e;case 7:_w(s)?(ve=0,un=null,ik(e)):(ve=0,un=null,ol(t,e,s,7));break;case 5:var o=null;switch(re.tag){case 26:o=re.memoizedState;case 5:case 27:var l=re;if(!o||eT(o)){ve=0,un=null;var a=l.sibling;if(a!==null)re=a;else{var c=l.return;c!==null?(re=c,ed(c)):re=null}break t}}ve=0,un=null,ol(t,e,s,5);break;case 6:ve=0,un=null,ol(t,e,s,6);break;case 8:T0(),Ve=6;break e;default:throw Error(D(462))}}ZP();break}catch(u){NO(t,u)}while(!0);return or=Js=null,Y.H=i,Y.A=r,Se=n,re!==null?0:(Ee=null,fe=0,Kh(),Ve)}function ZP(){for(;re!==null&&!S5();)IO(re)}function IO(t){var e=fO(t.alternate,t,dr);t.memoizedProps=t.pendingProps,e===null?ed(t):re=e}function ik(t){var e=t,n=e.alternate;switch(e.tag){case 15:case 0:e=Xw(n,e,e.pendingProps,e.type,void 0,fe);break;case 11:e=Xw(n,e,e.pendingProps,e.type.render,e.ref,fe);break;case 5:h0(e);default:hO(n,e),e=re=hA(e,dr),e=fO(n,e,dr)}t.memoizedProps=t.pendingProps,e===null?ed(t):re=e}function ol(t,e,n,i){or=Js=null,h0(e),dl=null,vc=0;var r=e.return;try{if(UP(t,r,e,n,fe)){Ve=1,Dh(t,Ln(n,t.current)),re=null;return}}catch(s){if(r!==null)throw re=r,s;Ve=1,Dh(t,Ln(n,t.current)),re=null;return}e.flags&32768?(pe||i===1?t=!0:Dl||(fe&536870912)!==0?t=!1:(Vr=t=!0,(i===2||i===9||i===3||i===6)&&(i=Bn.current,i!==null&&i.tag===13&&(i.flags|=16384))),BO(e,t)):ed(e)}function ed(t){var e=t;do{if((e.flags&32768)!==0){BO(e,Vr);return}t=e.return;var n=jP(e.alternate,e,dr);if(n!==null){re=n;return}if(e=e.sibling,e!==null){re=e;return}re=e=t}while(e!==null);Ve===0&&(Ve=5)}function BO(t,e){do{var n=VP(t.alternate,t);if(n!==null){n.flags&=32767,re=n;return}if(n=t.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!e&&(t=t.sibling,t!==null)){re=t;return}re=t=n}while(t!==null);Ve=6,re=null}function rk(t,e,n,i,r,s,o,l,a){t.cancelPendingCommit=null;do td();while(bt!==0);if((Se&6)!==0)throw Error(D(327));if(e!==null){if(e===t.current)throw Error(D(177));if(s=e.lanes|e.childLanes,s|=Jy,M5(t,n,s,o,l,a),t===Ee&&(re=Ee=null,fe=0),kl=e,Xr=t,pl=n,Ty=s,Cy=r,DO=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,nz(gh,function(){return UO(!0),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=Y.T,Y.T=null,r=me.p,me.p=2,o=Se,Se|=4;try{$P(t,e,n)}finally{Se=o,me.p=r,Y.T=i}}bt=1,qO(),PO(),zO()}}function qO(){if(bt===1){bt=0;var t=Xr,e=kl,n=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||n){n=Y.T,Y.T=null;var i=me.p;me.p=2;var r=Se;Se|=4;try{wO(e,t);var s=_y,o=rA(t.containerInfo),l=s.focusedElem,a=s.selectionRange;if(o!==l&&l&&l.ownerDocument&&iA(l.ownerDocument.documentElement,l)){if(a!==null&&Zy(l)){var c=a.start,u=a.end;if(u===void 0&&(u=c),"selectionStart"in l)l.selectionStart=c,l.selectionEnd=Math.min(u,l.value.length);else{var f=l.ownerDocument||document,h=f&&f.defaultView||window;if(h.getSelection){var d=h.getSelection(),m=l.textContent.length,g=Math.min(a.start,m),b=a.end===void 0?g:Math.min(a.end,m);!d.extend&&g>b&&(o=b,b=g,g=o);var p=Ow(l,g),y=Ow(l,b);if(p&&y&&(d.rangeCount!==1||d.anchorNode!==p.node||d.anchorOffset!==p.offset||d.focusNode!==y.node||d.focusOffset!==y.offset)){var v=f.createRange();v.setStart(p.node,p.offset),d.removeAllRanges(),g>b?(d.addRange(v),d.extend(y.node,y.offset)):(v.setEnd(y.node,y.offset),d.addRange(v))}}}}for(f=[],d=l;d=d.parentNode;)d.nodeType===1&&f.push({element:d,left:d.scrollLeft,top:d.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<f.length;l++){var S=f[l];S.element.scrollLeft=S.left,S.element.scrollTop=S.top}}Uh=!!Ny,_y=Ny=null}finally{Se=r,me.p=i,Y.T=n}}t.current=e,bt=2}}function PO(){if(bt===2){bt=0;var t=Xr,e=kl,n=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||n){n=Y.T,Y.T=null;var i=me.p;me.p=2;var r=Se;Se|=4;try{bO(t,e.alternate,e)}finally{Se=r,me.p=i,Y.T=n}}bt=3}}function zO(){if(bt===4||bt===3){bt=0,x5();var t=Xr,e=kl,n=pl,i=DO;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?bt=5:(bt=0,kl=Xr=null,HO(t,t.pendingLanes));var r=t.pendingLanes;if(r===0&&(Qr=null),$y(n),e=e.stateNode,hn&&typeof hn.onCommitFiberRoot=="function")try{hn.onCommitFiberRoot(Ec,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=Y.T,r=me.p,me.p=2,Y.T=null;try{for(var s=t.onRecoverableError,o=0;o<i.length;o++){var l=i[o];s(l.value,{componentStack:l.stack})}}finally{Y.T=e,me.p=r}}(pl&3)!==0&&td(),Di(t),r=t.pendingLanes,(n&4194090)!==0&&(r&42)!==0?t===Ey?fc++:(fc=0,Ey=t):fc=0,Hc(0,!1)}}function HO(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,Ic(e)))}function td(t){return qO(),PO(),zO(),UO(t)}function UO(){if(bt!==5)return!1;var t=Xr,e=Ty;Ty=0;var n=$y(pl),i=Y.T,r=me.p;try{me.p=32>n?32:n,Y.T=null,n=Cy,Cy=null;var s=Xr,o=pl;if(bt=0,kl=Xr=null,pl=0,(Se&6)!==0)throw Error(D(331));var l=Se;if(Se|=4,CO(s.current),AO(s,s.current,o,n),Se=l,Hc(0,!1),hn&&typeof hn.onPostCommitFiberRoot=="function")try{hn.onPostCommitFiberRoot(Ec,s)}catch{}return!0}finally{me.p=r,Y.T=i,HO(t,e)}}function sk(t,e,n){e=Ln(n,e),e=xy(t.stateNode,e,2),t=Gr(t,e,2),t!==null&&(Mc(t,2),Di(t))}function Ae(t,e,n){if(t.tag===3)sk(t,t,n);else for(;e!==null;){if(e.tag===3){sk(e,t,n);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Qr===null||!Qr.has(i))){t=Ln(n,t),n=rO(2),i=Gr(e,n,2),i!==null&&(sO(n,i,e,t),Mc(i,2),Di(i));break}}e=e.return}}function Ug(t,e,n){var i=t.pingCache;if(i===null){i=t.pingCache=new GP;var r=new Set;i.set(e,r)}else r=i.get(e),r===void 0&&(r=new Set,i.set(e,r));r.has(n)||(k0=!0,r.add(n),t=JP.bind(null,t,e,n),e.then(t,t))}function JP(t,e,n){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&n,t.warmLanes&=~n,Ee===t&&(fe&n)===n&&(Ve===4||Ve===3&&(fe&62914560)===fe&&300>Ti()-O0?(Se&2)===0&&Al(t,0):A0|=n,wl===fe&&(wl=0)),Di(t)}function FO(t,e){e===0&&(e=qk()),t=El(t,e),t!==null&&(Mc(t,e),Di(t))}function ez(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),FO(t,n)}function tz(t,e){var n=0;switch(t.tag){case 13:var i=t.stateNode,r=t.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(D(314))}i!==null&&i.delete(e),FO(t,n)}function nz(t,e){return jy(t,e)}var Lh=null,Go=null,My=!1,Ih=!1,Fg=!1,$s=0;function Di(t){t!==Go&&t.next===null&&(Go===null?Lh=Go=t:Go=Go.next=t),Ih=!0,My||(My=!0,rz())}function Hc(t,e){if(!Fg&&Ih){Fg=!0;do for(var n=!1,i=Lh;i!==null;){if(!e)if(t!==0){var r=i.pendingLanes;if(r===0)var s=0;else{var o=i.suspendedLanes,l=i.pingedLanes;s=(1<<31-dn(42|t)+1)-1,s&=r&~(o&~l),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,ok(i,s))}else s=fe,s=jh(i,i===Ee?s:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(s&3)===0||Dc(i,s)||(n=!0,ok(i,s));i=i.next}while(n);Fg=!1}}function iz(){jO()}function jO(){Ih=My=!1;var t=0;$s!==0&&(uz()&&(t=$s),$s=0);for(var e=Ti(),n=null,i=Lh;i!==null;){var r=i.next,s=VO(i,e);s===0?(i.next=null,n===null?Lh=r:n.next=r,r===null&&(Go=n)):(n=i,(t!==0||(s&3)!==0)&&(Ih=!0)),i=r}Hc(t,!1)}function VO(t,e){for(var n=t.suspendedLanes,i=t.pingedLanes,r=t.expirationTimes,s=t.pendingLanes&-62914561;0<s;){var o=31-dn(s),l=1<<o,a=r[o];a===-1?((l&n)===0||(l&i)!==0)&&(r[o]=D5(l,e)):a<=e&&(t.expiredLanes|=l),s&=~l}if(e=Ee,n=fe,n=jh(t,t===e?n:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,n===0||t===e&&(ve===2||ve===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&mg(i),t.callbackNode=null,t.callbackPriority=0;if((n&3)===0||Dc(t,n)){if(e=n&-n,e===t.callbackPriority)return e;switch(i!==null&&mg(i),$y(n)){case 2:case 8:n=Lk;break;case 32:n=gh;break;case 268435456:n=Ik;break;default:n=gh}return i=$O.bind(null,t),n=jy(n,i),t.callbackPriority=e,t.callbackNode=n,e}return i!==null&&i!==null&&mg(i),t.callbackPriority=2,t.callbackNode=null,2}function $O(t,e){if(bt!==0&&bt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var n=t.callbackNode;if(td(!0)&&t.callbackNode!==n)return null;var i=fe;return i=jh(t,t===Ee?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(RO(t,i,e),VO(t,Ti()),t.callbackNode!=null&&t.callbackNode===n?$O.bind(null,t):null)}function ok(t,e){if(td())return null;RO(t,e,!0)}function rz(){hz(function(){(Se&6)!==0?jy(_k,iz):jO()})}function C0(){return $s===0&&($s=Bk()),$s}function lk(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:th(""+t)}function ak(t,e){var n=e.ownerDocument.createElement("input");return n.name=e.name,n.value=e.value,t.id&&n.setAttribute("form",t.id),e.parentNode.insertBefore(n,e),t=new FormData(t),n.parentNode.removeChild(n),t}function sz(t,e,n,i,r){if(e==="submit"&&n&&n.stateNode===r){var s=lk((r[Zt]||null).action),o=i.submitter;o&&(e=(e=o[Zt]||null)?lk(e.formAction):o.getAttribute("formAction"),e!==null&&(s=e,o=null));var l=new Vh("action","action",null,i,r);t.push({event:l,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if($s!==0){var a=o?ak(r,o):new FormData(r);vy(n,{pending:!0,data:a,method:r.method,action:s},null,a)}}else typeof s=="function"&&(l.preventDefault(),a=o?ak(r,o):new FormData(r),vy(n,{pending:!0,data:a,method:r.method,action:s},s,a))},currentTarget:r}]})}}for(Qf=0;Qf<ly.length;Qf++)Xf=ly[Qf],ck=Xf.toLowerCase(),uk=Xf[0].toUpperCase()+Xf.slice(1),ei(ck,"on"+uk);var Xf,ck,uk,Qf;ei(oA,"onAnimationEnd");ei(lA,"onAnimationIteration");ei(aA,"onAnimationStart");ei("dblclick","onDoubleClick");ei("focusin","onFocus");ei("focusout","onBlur");ei(AP,"onTransitionRun");ei(OP,"onTransitionStart");ei(TP,"onTransitionCancel");ei(cA,"onTransitionEnd");gl("onMouseEnter",["mouseout","mouseover"]);gl("onMouseLeave",["mouseout","mouseover"]);gl("onPointerEnter",["pointerout","pointerover"]);gl("onPointerLeave",["pointerout","pointerover"]);Xs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Xs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Xs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Xs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Xs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Xs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Sc="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(" "),oz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Sc));function YO(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var i=t[n],r=i.event;i=i.listeners;e:{var s=void 0;if(e)for(var o=i.length-1;0<=o;o--){var l=i[o],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Eh(u)}r.currentTarget=null,s=a}else for(o=0;o<i.length;o++){if(l=i[o],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&r.isPropagationStopped())break e;s=l,r.currentTarget=c;try{s(r)}catch(u){Eh(u)}r.currentTarget=null,s=a}}}}function ie(t,e){var n=e[ey];n===void 0&&(n=e[ey]=new Set);var i=t+"__bubble";n.has(i)||(KO(e,t,2,!1),n.add(i))}function jg(t,e,n){var i=0;e&&(i|=4),KO(n,t,i,e)}var Wf="_reactListening"+Math.random().toString(36).slice(2);function E0(t){if(!t[Wf]){t[Wf]=!0,Uk.forEach(function(n){n!=="selectionchange"&&(oz.has(n)||jg(n,!1,t),jg(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Wf]||(e[Wf]=!0,jg("selectionchange",!1,e))}}function KO(t,e,n,i){switch(sT(e)){case 2:var r=_z;break;case 8:r=Lz;break;default:r=N0}n=r.bind(null,e,n,t),r=void 0,!ry||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(r=!0),i?r!==void 0?t.addEventListener(e,n,{capture:!0,passive:r}):t.addEventListener(e,n,!0):r!==void 0?t.addEventListener(e,n,{passive:r}):t.addEventListener(e,n,!1)}function Vg(t,e,n,i,r){var s=i;if((e&1)===0&&(e&2)===0&&i!==null)e:for(;;){if(i===null)return;var o=i.tag;if(o===3||o===4){var l=i.stateNode.containerInfo;if(l===r)break;if(o===4)for(o=i.return;o!==null;){var a=o.tag;if((a===3||a===4)&&o.stateNode.containerInfo===r)return;o=o.return}for(;l!==null;){if(o=Wo(l),o===null)return;if(a=o.tag,a===5||a===6||a===26||a===27){i=s=o;continue e}l=l.parentNode}}i=i.return}Qk(function(){var c=s,u=Gy(n),f=[];e:{var h=uA.get(t);if(h!==void 0){var d=Vh,m=t;switch(t){case"keypress":if(ih(n)===0)break e;case"keydown":case"keyup":d=nP;break;case"focusin":m="focus",d=kg;break;case"focusout":m="blur",d=kg;break;case"beforeblur":case"afterblur":d=kg;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=gw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=V5;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=sP;break;case oA:case lA:case aA:d=K5;break;case cA:d=lP;break;case"scroll":case"scrollend":d=F5;break;case"wheel":d=cP;break;case"copy":case"cut":case"paste":d=Q5;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=bw;break;case"toggle":case"beforetoggle":d=fP}var g=(e&4)!==0,b=!g&&(t==="scroll"||t==="scrollend"),p=g?h!==null?h+"Capture":null:h;g=[];for(var y=c,v;y!==null;){var S=y;if(v=S.stateNode,S=S.tag,S!==5&&S!==26&&S!==27||v===null||p===null||(S=pc(y,p),S!=null&&g.push(xc(y,S,v))),b)break;y=y.return}0<g.length&&(h=new d(h,m,null,n,u),f.push({event:h,listeners:g}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",h&&n!==iy&&(m=n.relatedTarget||n.fromElement)&&(Wo(m)||m[Tl]))break e;if((d||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,d?(m=n.relatedTarget||n.toElement,d=c,m=m?Wo(m):null,m!==null&&(b=Cc(m),g=m.tag,m!==b||g!==5&&g!==27&&g!==6)&&(m=null)):(d=null,m=c),d!==m)){if(g=gw,S="onMouseLeave",p="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(g=bw,S="onPointerLeave",p="onPointerEnter",y="pointer"),b=d==null?h:Wa(d),v=m==null?h:Wa(m),h=new g(S,y+"leave",d,n,u),h.target=b,h.relatedTarget=v,S=null,Wo(u)===c&&(g=new g(p,y+"enter",m,n,u),g.target=v,g.relatedTarget=b,S=g),b=S,d&&m)t:{for(g=d,p=m,y=0,v=g;v;v=$o(v))y++;for(v=0,S=p;S;S=$o(S))v++;for(;0<y-v;)g=$o(g),y--;for(;0<v-y;)p=$o(p),v--;for(;y--;){if(g===p||p!==null&&g===p.alternate)break t;g=$o(g),p=$o(p)}g=null}else g=null;d!==null&&fk(f,h,d,g,!1),m!==null&&b!==null&&fk(f,b,m,g,!0)}}e:{if(h=c?Wa(c):window,d=h.nodeName&&h.nodeName.toLowerCase(),d==="select"||d==="input"&&h.type==="file")var w=ww;else if(xw(h))if(tA)w=xP;else{w=vP;var O=bP}else d=h.nodeName,!d||d.toLowerCase()!=="input"||h.type!=="checkbox"&&h.type!=="radio"?c&&Ky(c.elementType)&&(w=ww):w=SP;if(w&&(w=w(t,c))){eA(f,w,n,u);break e}O&&O(t,h,c),t==="focusout"&&c&&h.type==="number"&&c.memoizedProps.value!=null&&ny(h,"number",h.value)}switch(O=c?Wa(c):window,t){case"focusin":(xw(O)||O.contentEditable==="true")&&(el=O,sy=c,tc=null);break;case"focusout":tc=sy=el=null;break;case"mousedown":oy=!0;break;case"contextmenu":case"mouseup":case"dragend":oy=!1,Tw(f,n,u);break;case"selectionchange":if(kP)break;case"keydown":case"keyup":Tw(f,n,u)}var k;if(Wy)e:{switch(t){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Jo?Zk(t,n)&&(A="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(Wk&&n.locale!=="ko"&&(Jo||A!=="onCompositionStart"?A==="onCompositionEnd"&&Jo&&(k=Xk()):(jr=u,Qy="value"in jr?jr.value:jr.textContent,Jo=!0)),O=Bh(c,A),0<O.length&&(A=new yw(A,t,null,n,u),f.push({event:A,listeners:O}),k?A.data=k:(k=Jk(n),k!==null&&(A.data=k)))),(k=dP?pP(t,n):mP(t,n))&&(A=Bh(c,"onBeforeInput"),0<A.length&&(O=new yw("onBeforeInput","beforeinput",null,n,u),f.push({event:O,listeners:A}),O.data=k)),sz(f,t,c,n,u)}YO(f,e)})}function xc(t,e,n){return{instance:t,listener:e,currentTarget:n}}function Bh(t,e){for(var n=e+"Capture",i=[];t!==null;){var r=t,s=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||s===null||(r=pc(t,n),r!=null&&i.unshift(xc(t,r,s)),r=pc(t,e),r!=null&&i.push(xc(t,r,s))),t.tag===3)return i;t=t.return}return[]}function $o(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function fk(t,e,n,i,r){for(var s=e._reactName,o=[];n!==null&&n!==i;){var l=n,a=l.alternate,c=l.stateNode;if(l=l.tag,a!==null&&a===i)break;l!==5&&l!==26&&l!==27||c===null||(a=c,r?(c=pc(n,s),c!=null&&o.unshift(xc(n,c,a))):r||(c=pc(n,s),c!=null&&o.push(xc(n,c,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var lz=/\r\n?/g,az=/\u0000|\uFFFD/g;function hk(t){return(typeof t=="string"?t:""+t).replace(lz,`
|
|
9
|
+
`).replace(az,"")}function GO(t,e){return e=hk(e),hk(t)===e}function nd(){}function we(t,e,n,i,r,s){switch(n){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||yl(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&yl(t,""+i);break;case"className":Hf(t,"class",i);break;case"tabIndex":Hf(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Hf(t,n,i);break;case"style":Gk(t,i,s);break;case"data":if(e!=="object"){Hf(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||n!=="href")){t.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=th(""+i),t.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof s=="function"&&(n==="formAction"?(e!=="input"&&we(t,e,"name",r.name,r,null),we(t,e,"formEncType",r.formEncType,r,null),we(t,e,"formMethod",r.formMethod,r,null),we(t,e,"formTarget",r.formTarget,r,null)):(we(t,e,"encType",r.encType,r,null),we(t,e,"method",r.method,r,null),we(t,e,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(n);break}i=th(""+i),t.setAttribute(n,i);break;case"onClick":i!=null&&(t.onclick=nd);break;case"onScroll":i!=null&&ie("scroll",t);break;case"onScrollEnd":i!=null&&ie("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(D(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(D(60));t.innerHTML=n}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){t.removeAttribute("xlink:href");break}n=th(""+i),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""+i):t.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,""):t.removeAttribute(n);break;case"capture":case"download":i===!0?t.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(n,i):t.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(n,i):t.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(n):t.setAttribute(n,i);break;case"popover":ie("beforetoggle",t),ie("toggle",t),eh(t,"popover",i);break;case"xlinkActuate":Ji(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ji(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ji(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ji(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ji(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ji(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ji(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ji(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ji(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":eh(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=H5.get(n)||n,eh(t,n,i))}}function Ry(t,e,n,i,r,s){switch(n){case"style":Gk(t,i,s);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(D(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(D(60));t.innerHTML=n}}break;case"children":typeof i=="string"?yl(t,i):(typeof i=="number"||typeof i=="bigint")&&yl(t,""+i);break;case"onScroll":i!=null&&ie("scroll",t);break;case"onScrollEnd":i!=null&&ie("scrollend",t);break;case"onClick":i!=null&&(t.onclick=nd);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Fk.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),e=n.slice(2,r?n.length-7:void 0),s=t[Zt]||null,s=s!=null?s[n]:null,typeof s=="function"&&t.removeEventListener(e,s,r),typeof i=="function")){typeof s!="function"&&s!==null&&(n in t?t[n]=null:t.hasAttribute(n)&&t.removeAttribute(n)),t.addEventListener(e,i,r);break e}n in t?t[n]=i:i===!0?t.setAttribute(n,""):eh(t,n,i)}}}function vt(t,e,n){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ie("error",t),ie("load",t);var i=!1,r=!1,s;for(s in n)if(n.hasOwnProperty(s)){var o=n[s];if(o!=null)switch(s){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:we(t,e,s,o,n,null)}}r&&we(t,e,"srcSet",n.srcSet,n,null),i&&we(t,e,"src",n.src,n,null);return;case"input":ie("invalid",t);var l=s=o=r=null,a=null,c=null;for(i in n)if(n.hasOwnProperty(i)){var u=n[i];if(u!=null)switch(i){case"name":r=u;break;case"type":o=u;break;case"checked":a=u;break;case"defaultChecked":c=u;break;case"value":s=u;break;case"defaultValue":l=u;break;case"children":case"dangerouslySetInnerHTML":if(u!=null)throw Error(D(137,e));break;default:we(t,e,i,u,n,null)}}$k(t,s,l,a,c,o,r,!1),yh(t);return;case"select":ie("invalid",t),i=o=s=null;for(r in n)if(n.hasOwnProperty(r)&&(l=n[r],l!=null))switch(r){case"value":s=l;break;case"defaultValue":o=l;break;case"multiple":i=l;default:we(t,e,r,l,n,null)}e=s,n=o,t.multiple=!!i,e!=null?al(t,!!i,e,!1):n!=null&&al(t,!!i,n,!0);return;case"textarea":ie("invalid",t),s=r=i=null;for(o in n)if(n.hasOwnProperty(o)&&(l=n[o],l!=null))switch(o){case"value":i=l;break;case"defaultValue":r=l;break;case"children":s=l;break;case"dangerouslySetInnerHTML":if(l!=null)throw Error(D(91));break;default:we(t,e,o,l,n,null)}Kk(t,i,r,s),yh(t);return;case"option":for(a in n)n.hasOwnProperty(a)&&(i=n[a],i!=null)&&(a==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":we(t,e,a,i,n,null));return;case"dialog":ie("beforetoggle",t),ie("toggle",t),ie("cancel",t),ie("close",t);break;case"iframe":case"object":ie("load",t);break;case"video":case"audio":for(i=0;i<Sc.length;i++)ie(Sc[i],t);break;case"image":ie("error",t),ie("load",t);break;case"details":ie("toggle",t);break;case"embed":case"source":case"link":ie("error",t),ie("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(c in n)if(n.hasOwnProperty(c)&&(i=n[c],i!=null))switch(c){case"children":case"dangerouslySetInnerHTML":throw Error(D(137,e));default:we(t,e,c,i,n,null)}return;default:if(Ky(e)){for(u in n)n.hasOwnProperty(u)&&(i=n[u],i!==void 0&&Ry(t,e,u,i,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(i=n[l],i!=null&&we(t,e,l,i,n,null))}function cz(t,e,n,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,s=null,o=null,l=null,a=null,c=null,u=null;for(d in n){var f=n[d];if(n.hasOwnProperty(d)&&f!=null)switch(d){case"checked":break;case"value":break;case"defaultValue":a=f;default:i.hasOwnProperty(d)||we(t,e,d,null,i,f)}}for(var h in i){var d=i[h];if(f=n[h],i.hasOwnProperty(h)&&(d!=null||f!=null))switch(h){case"type":s=d;break;case"name":r=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":o=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(d!=null)throw Error(D(137,e));break;default:d!==f&&we(t,e,h,d,i,f)}}ty(t,o,l,a,c,u,s,r);return;case"select":d=o=l=h=null;for(s in n)if(a=n[s],n.hasOwnProperty(s)&&a!=null)switch(s){case"value":break;case"multiple":d=a;default:i.hasOwnProperty(s)||we(t,e,s,null,i,a)}for(r in i)if(s=i[r],a=n[r],i.hasOwnProperty(r)&&(s!=null||a!=null))switch(r){case"value":h=s;break;case"defaultValue":l=s;break;case"multiple":o=s;default:s!==a&&we(t,e,r,s,i,a)}e=l,n=o,i=d,h!=null?al(t,!!n,h,!1):!!i!=!!n&&(e!=null?al(t,!!n,e,!0):al(t,!!n,n?[]:"",!1));return;case"textarea":d=h=null;for(l in n)if(r=n[l],n.hasOwnProperty(l)&&r!=null&&!i.hasOwnProperty(l))switch(l){case"value":break;case"children":break;default:we(t,e,l,null,i,r)}for(o in i)if(r=i[o],s=n[o],i.hasOwnProperty(o)&&(r!=null||s!=null))switch(o){case"value":h=r;break;case"defaultValue":d=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(D(91));break;default:r!==s&&we(t,e,o,r,i,s)}Yk(t,h,d);return;case"option":for(var m in n)h=n[m],n.hasOwnProperty(m)&&h!=null&&!i.hasOwnProperty(m)&&(m==="selected"?t.selected=!1:we(t,e,m,null,i,h));for(a in i)h=i[a],d=n[a],i.hasOwnProperty(a)&&h!==d&&(h!=null||d!=null)&&(a==="selected"?t.selected=h&&typeof h!="function"&&typeof h!="symbol":we(t,e,a,h,i,d));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)h=n[g],n.hasOwnProperty(g)&&h!=null&&!i.hasOwnProperty(g)&&we(t,e,g,null,i,h);for(c in i)if(h=i[c],d=n[c],i.hasOwnProperty(c)&&h!==d&&(h!=null||d!=null))switch(c){case"children":case"dangerouslySetInnerHTML":if(h!=null)throw Error(D(137,e));break;default:we(t,e,c,h,i,d)}return;default:if(Ky(e)){for(var b in n)h=n[b],n.hasOwnProperty(b)&&h!==void 0&&!i.hasOwnProperty(b)&&Ry(t,e,b,void 0,i,h);for(u in i)h=i[u],d=n[u],!i.hasOwnProperty(u)||h===d||h===void 0&&d===void 0||Ry(t,e,u,h,i,d);return}}for(var p in n)h=n[p],n.hasOwnProperty(p)&&h!=null&&!i.hasOwnProperty(p)&&we(t,e,p,null,i,h);for(f in i)h=i[f],d=n[f],!i.hasOwnProperty(f)||h===d||h==null&&d==null||we(t,e,f,h,i,d)}var Ny=null,_y=null;function qh(t){return t.nodeType===9?t:t.ownerDocument}function dk(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function QO(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Ly(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var $g=null;function uz(){var t=window.event;return t&&t.type==="popstate"?t===$g?!1:($g=t,!0):($g=null,!1)}var XO=typeof setTimeout=="function"?setTimeout:void 0,fz=typeof clearTimeout=="function"?clearTimeout:void 0,pk=typeof Promise=="function"?Promise:void 0,hz=typeof queueMicrotask=="function"?queueMicrotask:typeof pk<"u"?function(t){return pk.resolve(null).then(t).catch(dz)}:XO;function dz(t){setTimeout(function(){throw t})}function rs(t){return t==="head"}function mk(t,e){var n=e,i=0,r=0;do{var s=n.nextSibling;if(t.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(0<i&&8>i){n=i;var o=t.ownerDocument;if(n&1&&hc(o.documentElement),n&2&&hc(o.body),n&4)for(n=o.head,hc(n),o=n.firstChild;o;){var l=o.nextSibling,a=o.nodeName;o[Rc]||a==="SCRIPT"||a==="STYLE"||a==="LINK"&&o.rel.toLowerCase()==="stylesheet"||n.removeChild(o),o=l}}if(r===0){t.removeChild(s),Tc(e);return}r--}else n==="$"||n==="$?"||n==="$!"?r++:i=n.charCodeAt(0)-48;else i=0;n=s}while(n);Tc(e)}function Iy(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var n=e;switch(e=e.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Iy(n),Yy(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}t.removeChild(n)}}function pz(t,e,n,i){for(;t.nodeType===1;){var r=n;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Rc])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(s=t.getAttribute("rel"),s==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(s!==r.rel||t.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||t.getAttribute("title")!==(r.title==null?null:r.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(s=t.getAttribute("src"),(s!==(r.src==null?null:r.src)||t.getAttribute("type")!==(r.type==null?null:r.type)||t.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&s&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var s=r.name==null?null:""+r.name;if(r.type==="hidden"&&t.getAttribute("name")===s)return t}else return t;if(t=Jn(t.nextSibling),t===null)break}return null}function mz(t,e,n){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Jn(t.nextSibling),t===null))return null;return t}function By(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function gz(t,e){var n=t.ownerDocument;if(t.data!=="$?"||n.readyState==="complete")e();else{var i=function(){e(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Jn(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==="$?"||e==="F!"||e==="F")break;if(e==="/$")return null}}return t}var qy=null;function gk(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}function WO(t,e,n){switch(e=qh(n),t){case"html":if(t=e.documentElement,!t)throw Error(D(452));return t;case"head":if(t=e.head,!t)throw Error(D(453));return t;case"body":if(t=e.body,!t)throw Error(D(454));return t;default:throw Error(D(451))}}function hc(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);Yy(t)}var qn=new Map,yk=new Set;function Ph(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var pr=me.d;me.d={f:yz,r:bz,D:vz,C:Sz,L:xz,m:wz,X:Az,S:kz,M:Oz};function yz(){var t=pr.f(),e=Jh();return t||e}function bz(t){var e=Cl(t);e!==null&&e.tag===5&&e.type==="form"?VA(e):pr.r(t)}var Ml=typeof document>"u"?null:document;function ZO(t,e,n){var i=Ml;if(i&&typeof e=="string"&&e){var r=_n(e);r='link[rel="'+t+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),yk.has(r)||(yk.add(r),t={rel:t,crossOrigin:n,href:e},i.querySelector(r)===null&&(e=i.createElement("link"),vt(e,"link",t),ut(e),i.head.appendChild(e)))}}function vz(t){pr.D(t),ZO("dns-prefetch",t,null)}function Sz(t,e){pr.C(t,e),ZO("preconnect",t,e)}function xz(t,e,n){pr.L(t,e,n);var i=Ml;if(i&&t&&e){var r='link[rel="preload"][as="'+_n(e)+'"]';e==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+_n(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+_n(n.imageSizes)+'"]')):r+='[href="'+_n(t)+'"]';var s=r;switch(e){case"style":s=Ol(t);break;case"script":s=Rl(t)}qn.has(s)||(t=Ne({rel:"preload",href:e==="image"&&n&&n.imageSrcSet?void 0:t,as:e},n),qn.set(s,t),i.querySelector(r)!==null||e==="style"&&i.querySelector(Uc(s))||e==="script"&&i.querySelector(Fc(s))||(e=i.createElement("link"),vt(e,"link",t),ut(e),i.head.appendChild(e)))}}function wz(t,e){pr.m(t,e);var n=Ml;if(n&&t){var i=e&&typeof e.as=="string"?e.as:"script",r='link[rel="modulepreload"][as="'+_n(i)+'"][href="'+_n(t)+'"]',s=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=Rl(t)}if(!qn.has(s)&&(t=Ne({rel:"modulepreload",href:t},e),qn.set(s,t),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Fc(s)))return}i=n.createElement("link"),vt(i,"link",t),ut(i),n.head.appendChild(i)}}}function kz(t,e,n){pr.S(t,e,n);var i=Ml;if(i&&t){var r=ll(i).hoistableStyles,s=Ol(t);e=e||"default";var o=r.get(s);if(!o){var l={loading:0,preload:null};if(o=i.querySelector(Uc(s)))l.loading=5;else{t=Ne({rel:"stylesheet",href:t,"data-precedence":e},n),(n=qn.get(s))&&D0(t,n);var a=o=i.createElement("link");ut(a),vt(a,"link",t),a._p=new Promise(function(c,u){a.onload=c,a.onerror=u}),a.addEventListener("load",function(){l.loading|=1}),a.addEventListener("error",function(){l.loading|=2}),l.loading|=4,uh(o,e,i)}o={type:"stylesheet",instance:o,count:1,state:l},r.set(s,o)}}}function Az(t,e){pr.X(t,e);var n=Ml;if(n&&t){var i=ll(n).hoistableScripts,r=Rl(t),s=i.get(r);s||(s=n.querySelector(Fc(r)),s||(t=Ne({src:t,async:!0},e),(e=qn.get(r))&&M0(t,e),s=n.createElement("script"),ut(s),vt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function Oz(t,e){pr.M(t,e);var n=Ml;if(n&&t){var i=ll(n).hoistableScripts,r=Rl(t),s=i.get(r);s||(s=n.querySelector(Fc(r)),s||(t=Ne({src:t,async:!0,type:"module"},e),(e=qn.get(r))&&M0(t,e),s=n.createElement("script"),ut(s),vt(s,"link",t),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},i.set(r,s))}}function bk(t,e,n,i){var r=(r=Yr.current)?Ph(r):null;if(!r)throw Error(D(446));switch(t){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(e=Ol(n.href),n=ll(r).hoistableStyles,i=n.get(e),i||(i={type:"style",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){t=Ol(n.href);var s=ll(r).hoistableStyles,o=s.get(t);if(o||(r=r.ownerDocument||r,o={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(t,o),(s=r.querySelector(Uc(t)))&&!s._p&&(o.instance=s,o.state.loading=5),qn.has(t)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},qn.set(t,n),s||Tz(r,t,n,o.state))),e&&i===null)throw Error(D(528,""));return o}if(e&&i!==null)throw Error(D(529,""));return null;case"script":return e=n.async,n=n.src,typeof n=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Rl(n),n=ll(r).hoistableScripts,i=n.get(e),i||(i={type:"script",instance:null,count:0,state:null},n.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(D(444,t))}}function Ol(t){return'href="'+_n(t)+'"'}function Uc(t){return'link[rel="stylesheet"]['+t+"]"}function JO(t){return Ne({},t,{"data-precedence":t.precedence,precedence:null})}function Tz(t,e,n,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),vt(e,"link",n),ut(e),t.head.appendChild(e))}function Rl(t){return'[src="'+_n(t)+'"]'}function Fc(t){return"script[async]"+t}function vk(t,e,n){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+_n(n.href)+'"]');if(i)return e.instance=i,ut(i),i;var r=Ne({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),ut(i),vt(i,"style",r),uh(i,n.precedence,t),e.instance=i;case"stylesheet":r=Ol(n.href);var s=t.querySelector(Uc(r));if(s)return e.state.loading|=4,e.instance=s,ut(s),s;i=JO(n),(r=qn.get(r))&&D0(i,r),s=(t.ownerDocument||t).createElement("link"),ut(s);var o=s;return o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),vt(s,"link",i),e.state.loading|=4,uh(s,n.precedence,t),e.instance=s;case"script":return s=Rl(n.src),(r=t.querySelector(Fc(s)))?(e.instance=r,ut(r),r):(i=n,(r=qn.get(s))&&(i=Ne({},n),M0(i,r)),t=t.ownerDocument||t,r=t.createElement("script"),ut(r),vt(r,"link",i),t.head.appendChild(r),e.instance=r);case"void":return null;default:throw Error(D(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,uh(i,n.precedence,t));return e.instance}function uh(t,e,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,s=r,o=0;o<i.length;o++){var l=i[o];if(l.dataset.precedence===e)s=l;else if(s!==r)break}s?s.parentNode.insertBefore(t,s.nextSibling):(e=n.nodeType===9?n.head:n,e.insertBefore(t,e.firstChild))}function D0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function M0(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var fh=null;function Sk(t,e,n){if(fh===null){var i=new Map,r=fh=new Map;r.set(n,i)}else r=fh,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(t))return i;for(i.set(t,null),n=n.getElementsByTagName(t),r=0;r<n.length;r++){var s=n[r];if(!(s[Rc]||s[Ct]||t==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var o=s.getAttribute(e)||"";o=t+o;var l=i.get(o);l?l.push(s):i.set(o,[s])}}return i}function xk(t,e,n){t=t.ownerDocument||t,t.head.insertBefore(n,e==="title"?t.querySelector("head > title"):null)}function Cz(t,e,n){if(n===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function eT(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var wc=null;function Ez(){}function Dz(t,e,n){if(wc===null)throw Error(D(475));var i=wc;if(e.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var r=Ol(n.href),s=t.querySelector(Uc(r));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(i.count++,i=zh.bind(i),t.then(i,i)),e.state.loading|=4,e.instance=s,ut(s);return}s=t.ownerDocument||t,n=JO(n),(r=qn.get(r))&&D0(n,r),s=s.createElement("link"),ut(s);var o=s;o._p=new Promise(function(l,a){o.onload=l,o.onerror=a}),vt(s,"link",n),e.instance=s}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(i.count++,e=zh.bind(i),t.addEventListener("load",e),t.addEventListener("error",e))}}function Mz(){if(wc===null)throw Error(D(475));var t=wc;return t.stylesheets&&t.count===0&&Py(t,t.stylesheets),0<t.count?function(e){var n=setTimeout(function(){if(t.stylesheets&&Py(t,t.stylesheets),t.unsuspend){var i=t.unsuspend;t.unsuspend=null,i()}},6e4);return t.unsuspend=e,function(){t.unsuspend=null,clearTimeout(n)}}:null}function zh(){if(this.count--,this.count===0){if(this.stylesheets)Py(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Hh=null;function Py(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Hh=new Map,e.forEach(Rz,t),Hh=null,zh.call(t))}function Rz(t,e){if(!(e.state.loading&4)){var n=Hh.get(t);if(n)var i=n.get(null);else{n=new Map,Hh.set(t,n);for(var r=t.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<r.length;s++){var o=r[s];(o.nodeName==="LINK"||o.getAttribute("media")!=="not all")&&(n.set(o.dataset.precedence,o),i=o)}i&&n.set(null,i)}r=e.instance,o=r.getAttribute("data-precedence"),s=n.get(o)||i,s===i&&n.set(null,r),n.set(o,r),this.count++,i=zh.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),s?s.parentNode.insertBefore(r,s.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(r,t.firstChild)),e.state.loading|=4}}var kc={$$typeof:ir,Provider:null,Consumer:null,_currentValue:zs,_currentValue2:zs,_threadCount:0};function Nz(t,e,n,i,r,s,o,l){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=gg(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gg(0),this.hiddenUpdates=gg(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=s,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=l,this.incompleteTransitions=new Map}function tT(t,e,n,i,r,s,o,l,a,c,u,f){return t=new Nz(t,e,n,o,l,a,c,f),e=1,s===!0&&(e|=24),s=fn(3,null,null,e),t.current=s,s.stateNode=t,e=r0(),e.refCount++,t.pooledCache=e,e.refCount++,s.memoizedState={element:i,isDehydrated:n,cache:e},o0(s),t}function nT(t){return t?(t=il,t):il}function iT(t,e,n,i,r,s){r=nT(r),i.context===null?i.context=r:i.pendingContext=r,i=Kr(e),i.payload={element:n},s=s===void 0?null:s,s!==null&&(i.callback=s),n=Gr(t,i,e),n!==null&&(mn(n,t,e),rc(n,t,e))}function wk(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function R0(t,e){wk(t,e),(t=t.alternate)&&wk(t,e)}function rT(t){if(t.tag===13){var e=El(t,67108864);e!==null&&mn(e,t,67108864),R0(t,67108864)}}var Uh=!0;function _z(t,e,n,i){var r=Y.T;Y.T=null;var s=me.p;try{me.p=2,N0(t,e,n,i)}finally{me.p=s,Y.T=r}}function Lz(t,e,n,i){var r=Y.T;Y.T=null;var s=me.p;try{me.p=8,N0(t,e,n,i)}finally{me.p=s,Y.T=r}}function N0(t,e,n,i){if(Uh){var r=zy(i);if(r===null)Vg(t,e,i,Fh,n),kk(t,i);else if(Bz(r,t,e,n,i))i.stopPropagation();else if(kk(t,i),e&4&&-1<Iz.indexOf(t)){for(;r!==null;){var s=Cl(r);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var o=Bs(s.pendingLanes);if(o!==0){var l=s;for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var a=1<<31-dn(o);l.entanglements[1]|=a,o&=~a}Di(s),(Se&6)===0&&(Nh=Ti()+500,Hc(0,!1))}}break;case 13:l=El(s,2),l!==null&&mn(l,s,2),Jh(),R0(s,2)}if(s=zy(i),s===null&&Vg(t,e,i,Fh,n),s===r)break;r=s}r!==null&&i.stopPropagation()}else Vg(t,e,i,null,n)}}function zy(t){return t=Gy(t),_0(t)}var Fh=null;function _0(t){if(Fh=null,t=Wo(t),t!==null){var e=Cc(t);if(e===null)t=null;else{var n=e.tag;if(n===13){if(t=Dk(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 Fh=t,null}function sT(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(w5()){case _k:return 2;case Lk:return 8;case gh:case k5:return 32;case Ik:return 268435456;default:return 32}default:return 32}}var Hy=!1,Wr=null,Zr=null,Jr=null,Ac=new Map,Oc=new Map,Ur=[],Iz="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function kk(t,e){switch(t){case"focusin":case"focusout":Wr=null;break;case"dragenter":case"dragleave":Zr=null;break;case"mouseover":case"mouseout":Jr=null;break;case"pointerover":case"pointerout":Ac.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oc.delete(e.pointerId)}}function Ka(t,e,n,i,r,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:i,nativeEvent:s,targetContainers:[r]},e!==null&&(e=Cl(e),e!==null&&rT(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,r!==null&&e.indexOf(r)===-1&&e.push(r),t)}function Bz(t,e,n,i,r){switch(e){case"focusin":return Wr=Ka(Wr,t,e,n,i,r),!0;case"dragenter":return Zr=Ka(Zr,t,e,n,i,r),!0;case"mouseover":return Jr=Ka(Jr,t,e,n,i,r),!0;case"pointerover":var s=r.pointerId;return Ac.set(s,Ka(Ac.get(s)||null,t,e,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,Oc.set(s,Ka(Oc.get(s)||null,t,e,n,i,r)),!0}return!1}function oT(t){var e=Wo(t.target);if(e!==null){var n=Cc(e);if(n!==null){if(e=n.tag,e===13){if(e=Dk(n),e!==null){t.blockedOn=e,R5(t.priority,function(){if(n.tag===13){var i=pn();i=Vy(i);var r=El(n,i);r!==null&&mn(r,n,i),R0(n,i)}});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function hh(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=zy(t.nativeEvent);if(n===null){n=t.nativeEvent;var i=new n.constructor(n.type,n);iy=i,n.target.dispatchEvent(i),iy=null}else return e=Cl(n),e!==null&&rT(e),t.blockedOn=n,!1;e.shift()}return!0}function Ak(t,e,n){hh(t)&&n.delete(e)}function qz(){Hy=!1,Wr!==null&&hh(Wr)&&(Wr=null),Zr!==null&&hh(Zr)&&(Zr=null),Jr!==null&&hh(Jr)&&(Jr=null),Ac.forEach(Ak),Oc.forEach(Ak)}function Zf(t,e){t.blockedOn===e&&(t.blockedOn=null,Hy||(Hy=!0,it.unstable_scheduleCallback(it.unstable_NormalPriority,qz)))}var Jf=null;function Ok(t){Jf!==t&&(Jf=t,it.unstable_scheduleCallback(it.unstable_NormalPriority,function(){Jf===t&&(Jf=null);for(var e=0;e<t.length;e+=3){var n=t[e],i=t[e+1],r=t[e+2];if(typeof i!="function"){if(_0(i||n)===null)continue;break}var s=Cl(n);s!==null&&(t.splice(e,3),e-=3,vy(s,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function Tc(t){function e(a){return Zf(a,t)}Wr!==null&&Zf(Wr,t),Zr!==null&&Zf(Zr,t),Jr!==null&&Zf(Jr,t),Ac.forEach(e),Oc.forEach(e);for(var n=0;n<Ur.length;n++){var i=Ur[n];i.blockedOn===t&&(i.blockedOn=null)}for(;0<Ur.length&&(n=Ur[0],n.blockedOn===null);)oT(n),n.blockedOn===null&&Ur.shift();if(n=(t.ownerDocument||t).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],s=n[i+1],o=r[Zt]||null;if(typeof s=="function")o||Ok(n);else if(o){var l=null;if(s&&s.hasAttribute("formAction")){if(r=s,o=s[Zt]||null)l=o.formAction;else if(_0(r)!==null)continue}else l=o.action;typeof l=="function"?n[i+1]=l:(n.splice(i,3),i-=3),Ok(n)}}}function L0(t){this._internalRoot=t}id.prototype.render=L0.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(D(409));var n=e.current,i=pn();iT(n,i,t,e,null,null)};id.prototype.unmount=L0.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;iT(t.current,2,null,t,null,null),Jh(),e[Tl]=null}};function id(t){this._internalRoot=t}id.prototype.unstable_scheduleHydration=function(t){if(t){var e=Hk();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Ur.length&&e!==0&&e<Ur[n].priority;n++);Ur.splice(n,0,t),n===0&&oT(t)}};var Tk=Ck.version;if(Tk!=="19.1.0")throw Error(D(527,Tk,"19.1.0"));me.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(D(188)):(t=Object.keys(t).join(","),Error(D(268,t)));return t=m5(e),t=t!==null?Mk(t):null,t=t===null?null:t.stateNode,t};var Pz={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ga=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ga.isDisabled&&Ga.supportsFiber))try{Ec=Ga.inject(Pz),hn=Ga}catch{}var Ga;rd.createRoot=function(t,e){if(!Ek(t))throw Error(D(299));var n=!1,i="",r=tO,s=nO,o=iO,l=null;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(r=e.onUncaughtError),e.onCaughtError!==void 0&&(s=e.onCaughtError),e.onRecoverableError!==void 0&&(o=e.onRecoverableError),e.unstable_transitionCallbacks!==void 0&&(l=e.unstable_transitionCallbacks)),e=tT(t,1,!1,null,null,n,i,r,s,o,l,null),t[Tl]=e.current,E0(t),new L0(e)};rd.hydrateRoot=function(t,e,n){if(!Ek(t))throw Error(D(299));var i=!1,r="",s=tO,o=nO,l=iO,a=null,c=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(o=n.onCaughtError),n.onRecoverableError!==void 0&&(l=n.onRecoverableError),n.unstable_transitionCallbacks!==void 0&&(a=n.unstable_transitionCallbacks),n.formState!==void 0&&(c=n.formState)),e=tT(t,1,!0,e,n??null,i,r,s,o,l,a,c),e.context=nT(null),n=e.current,i=pn(),i=Vy(i),r=Kr(i),r.callback=null,Gr(n,r,i),n=i,e.current.lanes=n,Mc(e,n),Di(e),t[Tl]=e.current,E0(t),new id(e)};rd.version="19.1.0"});var uT=x((ase,cT)=>{"use strict";function aT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(aT)}catch(t){console.error(t)}}aT(),cT.exports=lT()});var hT=x(sd=>{"use strict";var zz=Symbol.for("react.transitional.element"),Hz=Symbol.for("react.fragment");function fT(t,e,n){var i=null;if(n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),"key"in e){n={};for(var r in e)r!=="key"&&(n[r]=e[r])}else n=e;return e=n.ref,{$$typeof:zz,type:t,key:i,ref:e!==void 0?e:null,props:n}}sd.Fragment=Hz;sd.jsx=fT;sd.jsxs=fT});var rt=x((hse,dT)=>{"use strict";dT.exports=hT()});var jR=x((Eme,FR)=>{"use strict";function c7(){this.__data__=[],this.size=0}FR.exports=c7});var xm=x((Dme,VR)=>{"use strict";function u7(t,e){return t===e||t!==t&&e!==e}VR.exports=u7});var cf=x((Mme,$R)=>{"use strict";var f7=xm();function h7(t,e){for(var n=t.length;n--;)if(f7(t[n][0],e))return n;return-1}$R.exports=h7});var KR=x((Rme,YR)=>{"use strict";var d7=cf(),p7=Array.prototype,m7=p7.splice;function g7(t){var e=this.__data__,n=d7(e,t);if(n<0)return!1;var i=e.length-1;return n==i?e.pop():m7.call(e,n,1),--this.size,!0}YR.exports=g7});var QR=x((Nme,GR)=>{"use strict";var y7=cf();function b7(t){var e=this.__data__,n=y7(e,t);return n<0?void 0:e[n][1]}GR.exports=b7});var WR=x((_me,XR)=>{"use strict";var v7=cf();function S7(t){return v7(this.__data__,t)>-1}XR.exports=S7});var JR=x((Lme,ZR)=>{"use strict";var x7=cf();function w7(t,e){var n=this.__data__,i=x7(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}ZR.exports=w7});var uf=x((Ime,eN)=>{"use strict";var k7=jR(),A7=KR(),O7=QR(),T7=WR(),C7=JR();function Ta(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Ta.prototype.clear=k7;Ta.prototype.delete=A7;Ta.prototype.get=O7;Ta.prototype.has=T7;Ta.prototype.set=C7;eN.exports=Ta});var nN=x((Bme,tN)=>{"use strict";var E7=uf();function D7(){this.__data__=new E7,this.size=0}tN.exports=D7});var rN=x((qme,iN)=>{"use strict";function M7(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}iN.exports=M7});var oN=x((Pme,sN)=>{"use strict";function R7(t){return this.__data__.get(t)}sN.exports=R7});var aN=x((zme,lN)=>{"use strict";function N7(t){return this.__data__.has(t)}lN.exports=N7});var NS=x((Hme,cN)=>{"use strict";var _7=typeof global=="object"&&global&&global.Object===Object&&global;cN.exports=_7});var bi=x((Ume,uN)=>{"use strict";var L7=NS(),I7=typeof self=="object"&&self&&self.Object===Object&&self,B7=L7||I7||Function("return this")();uN.exports=B7});var Mo=x((Fme,fN)=>{"use strict";var q7=bi(),P7=q7.Symbol;fN.exports=P7});var mN=x((jme,pN)=>{"use strict";var hN=Mo(),dN=Object.prototype,z7=dN.hasOwnProperty,H7=dN.toString,ff=hN?hN.toStringTag:void 0;function U7(t){var e=z7.call(t,ff),n=t[ff];try{t[ff]=void 0;var i=!0}catch{}var r=H7.call(t);return i&&(e?t[ff]=n:delete t[ff]),r}pN.exports=U7});var yN=x((Vme,gN)=>{"use strict";var F7=Object.prototype,j7=F7.toString;function V7(t){return j7.call(t)}gN.exports=V7});var Ro=x(($me,SN)=>{"use strict";var bN=Mo(),$7=mN(),Y7=yN(),K7="[object Null]",G7="[object Undefined]",vN=bN?bN.toStringTag:void 0;function Q7(t){return t==null?t===void 0?G7:K7:vN&&vN in Object(t)?$7(t):Y7(t)}SN.exports=Q7});var Ms=x((Yme,xN)=>{"use strict";function X7(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}xN.exports=X7});var hf=x((Kme,wN)=>{"use strict";var W7=Ro(),Z7=Ms(),J7="[object AsyncFunction]",eY="[object Function]",tY="[object GeneratorFunction]",nY="[object Proxy]";function iY(t){if(!Z7(t))return!1;var e=W7(t);return e==eY||e==tY||e==J7||e==nY}wN.exports=iY});var AN=x((Gme,kN)=>{"use strict";var rY=bi(),sY=rY["__core-js_shared__"];kN.exports=sY});var CN=x((Qme,TN)=>{"use strict";var _S=AN(),ON=(function(){var t=/[^.]+$/.exec(_S&&_S.keys&&_S.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function oY(t){return!!ON&&ON in t}TN.exports=oY});var LS=x((Xme,EN)=>{"use strict";var lY=Function.prototype,aY=lY.toString;function cY(t){if(t!=null){try{return aY.call(t)}catch{}try{return t+""}catch{}}return""}EN.exports=cY});var MN=x((Wme,DN)=>{"use strict";var uY=hf(),fY=CN(),hY=Ms(),dY=LS(),pY=/[\\^$.*+?()[\]{}|]/g,mY=/^\[object .+?Constructor\]$/,gY=Function.prototype,yY=Object.prototype,bY=gY.toString,vY=yY.hasOwnProperty,SY=RegExp("^"+bY.call(vY).replace(pY,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xY(t){if(!hY(t)||fY(t))return!1;var e=uY(t)?SY:mY;return e.test(dY(t))}DN.exports=xY});var NN=x((Zme,RN)=>{"use strict";function wY(t,e){return t?.[e]}RN.exports=wY});var Rs=x((Jme,_N)=>{"use strict";var kY=MN(),AY=NN();function OY(t,e){var n=AY(t,e);return kY(n)?n:void 0}_N.exports=OY});var wm=x((ege,LN)=>{"use strict";var TY=Rs(),CY=bi(),EY=TY(CY,"Map");LN.exports=EY});var df=x((tge,IN)=>{"use strict";var DY=Rs(),MY=DY(Object,"create");IN.exports=MY});var PN=x((nge,qN)=>{"use strict";var BN=df();function RY(){this.__data__=BN?BN(null):{},this.size=0}qN.exports=RY});var HN=x((ige,zN)=>{"use strict";function NY(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}zN.exports=NY});var FN=x((rge,UN)=>{"use strict";var _Y=df(),LY="__lodash_hash_undefined__",IY=Object.prototype,BY=IY.hasOwnProperty;function qY(t){var e=this.__data__;if(_Y){var n=e[t];return n===LY?void 0:n}return BY.call(e,t)?e[t]:void 0}UN.exports=qY});var VN=x((sge,jN)=>{"use strict";var PY=df(),zY=Object.prototype,HY=zY.hasOwnProperty;function UY(t){var e=this.__data__;return PY?e[t]!==void 0:HY.call(e,t)}jN.exports=UY});var YN=x((oge,$N)=>{"use strict";var FY=df(),jY="__lodash_hash_undefined__";function VY(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=FY&&e===void 0?jY:e,this}$N.exports=VY});var GN=x((lge,KN)=>{"use strict";var $Y=PN(),YY=HN(),KY=FN(),GY=VN(),QY=YN();function Ca(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Ca.prototype.clear=$Y;Ca.prototype.delete=YY;Ca.prototype.get=KY;Ca.prototype.has=GY;Ca.prototype.set=QY;KN.exports=Ca});var WN=x((age,XN)=>{"use strict";var QN=GN(),XY=uf(),WY=wm();function ZY(){this.size=0,this.__data__={hash:new QN,map:new(WY||XY),string:new QN}}XN.exports=ZY});var JN=x((cge,ZN)=>{"use strict";function JY(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}ZN.exports=JY});var pf=x((uge,e_)=>{"use strict";var eK=JN();function tK(t,e){var n=t.__data__;return eK(e)?n[typeof e=="string"?"string":"hash"]:n.map}e_.exports=tK});var n_=x((fge,t_)=>{"use strict";var nK=pf();function iK(t){var e=nK(this,t).delete(t);return this.size-=e?1:0,e}t_.exports=iK});var r_=x((hge,i_)=>{"use strict";var rK=pf();function sK(t){return rK(this,t).get(t)}i_.exports=sK});var o_=x((dge,s_)=>{"use strict";var oK=pf();function lK(t){return oK(this,t).has(t)}s_.exports=lK});var a_=x((pge,l_)=>{"use strict";var aK=pf();function cK(t,e){var n=aK(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}l_.exports=cK});var km=x((mge,c_)=>{"use strict";var uK=WN(),fK=n_(),hK=r_(),dK=o_(),pK=a_();function Ea(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}Ea.prototype.clear=uK;Ea.prototype.delete=fK;Ea.prototype.get=hK;Ea.prototype.has=dK;Ea.prototype.set=pK;c_.exports=Ea});var f_=x((gge,u_)=>{"use strict";var mK=uf(),gK=wm(),yK=km(),bK=200;function vK(t,e){var n=this.__data__;if(n instanceof mK){var i=n.__data__;if(!gK||i.length<bK-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new yK(i)}return n.set(t,e),this.size=n.size,this}u_.exports=vK});var Am=x((yge,h_)=>{"use strict";var SK=uf(),xK=nN(),wK=rN(),kK=oN(),AK=aN(),OK=f_();function Da(t){var e=this.__data__=new SK(t);this.size=e.size}Da.prototype.clear=xK;Da.prototype.delete=wK;Da.prototype.get=kK;Da.prototype.has=AK;Da.prototype.set=OK;h_.exports=Da});var Om=x((bge,d_)=>{"use strict";function TK(t,e){for(var n=-1,i=t==null?0:t.length;++n<i&&e(t[n],n,t)!==!1;);return t}d_.exports=TK});var IS=x((vge,p_)=>{"use strict";var CK=Rs(),EK=(function(){try{var t=CK(Object,"defineProperty");return t({},"",{}),t}catch{}})();p_.exports=EK});var BS=x((Sge,g_)=>{"use strict";var m_=IS();function DK(t,e,n){e=="__proto__"&&m_?m_(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}g_.exports=DK});var qS=x((xge,y_)=>{"use strict";var MK=BS(),RK=xm(),NK=Object.prototype,_K=NK.hasOwnProperty;function LK(t,e,n){var i=t[e];(!(_K.call(t,e)&&RK(i,n))||n===void 0&&!(e in t))&&MK(t,e,n)}y_.exports=LK});var mf=x((wge,b_)=>{"use strict";var IK=qS(),BK=BS();function qK(t,e,n,i){var r=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var l=e[s],a=i?i(n[l],t[l],l,n,t):void 0;a===void 0&&(a=t[l]),r?BK(n,l,a):IK(n,l,a)}return n}b_.exports=qK});var S_=x((kge,v_)=>{"use strict";function PK(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}v_.exports=PK});var Ki=x((Age,x_)=>{"use strict";function zK(t){return t!=null&&typeof t=="object"}x_.exports=zK});var k_=x((Oge,w_)=>{"use strict";var HK=Ro(),UK=Ki(),FK="[object Arguments]";function jK(t){return UK(t)&&HK(t)==FK}w_.exports=jK});var gf=x((Tge,T_)=>{"use strict";var A_=k_(),VK=Ki(),O_=Object.prototype,$K=O_.hasOwnProperty,YK=O_.propertyIsEnumerable,KK=A_((function(){return arguments})())?A_:function(t){return VK(t)&&$K.call(t,"callee")&&!YK.call(t,"callee")};T_.exports=KK});var lt=x((Cge,C_)=>{"use strict";var GK=Array.isArray;C_.exports=GK});var D_=x((Ege,E_)=>{"use strict";function QK(){return!1}E_.exports=QK});var Ra=x((yf,Ma)=>{"use strict";var XK=bi(),WK=D_(),N_=typeof yf=="object"&&yf&&!yf.nodeType&&yf,M_=N_&&typeof Ma=="object"&&Ma&&!Ma.nodeType&&Ma,ZK=M_&&M_.exports===N_,R_=ZK?XK.Buffer:void 0,JK=R_?R_.isBuffer:void 0,eG=JK||WK;Ma.exports=eG});var PS=x((Dge,__)=>{"use strict";var tG=9007199254740991,nG=/^(?:0|[1-9]\d*)$/;function iG(t,e){var n=typeof t;return e=e??tG,!!e&&(n=="number"||n!="symbol"&&nG.test(t))&&t>-1&&t%1==0&&t<e}__.exports=iG});var Tm=x((Mge,L_)=>{"use strict";var rG=9007199254740991;function sG(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=rG}L_.exports=sG});var B_=x((Rge,I_)=>{"use strict";var oG=Ro(),lG=Tm(),aG=Ki(),cG="[object Arguments]",uG="[object Array]",fG="[object Boolean]",hG="[object Date]",dG="[object Error]",pG="[object Function]",mG="[object Map]",gG="[object Number]",yG="[object Object]",bG="[object RegExp]",vG="[object Set]",SG="[object String]",xG="[object WeakMap]",wG="[object ArrayBuffer]",kG="[object DataView]",AG="[object Float32Array]",OG="[object Float64Array]",TG="[object Int8Array]",CG="[object Int16Array]",EG="[object Int32Array]",DG="[object Uint8Array]",MG="[object Uint8ClampedArray]",RG="[object Uint16Array]",NG="[object Uint32Array]",Le={};Le[AG]=Le[OG]=Le[TG]=Le[CG]=Le[EG]=Le[DG]=Le[MG]=Le[RG]=Le[NG]=!0;Le[cG]=Le[uG]=Le[wG]=Le[fG]=Le[kG]=Le[hG]=Le[dG]=Le[pG]=Le[mG]=Le[gG]=Le[yG]=Le[bG]=Le[vG]=Le[SG]=Le[xG]=!1;function _G(t){return aG(t)&&lG(t.length)&&!!Le[oG(t)]}I_.exports=_G});var Cm=x((Nge,q_)=>{"use strict";function LG(t){return function(e){return t(e)}}q_.exports=LG});var Em=x((bf,Na)=>{"use strict";var IG=NS(),P_=typeof bf=="object"&&bf&&!bf.nodeType&&bf,vf=P_&&typeof Na=="object"&&Na&&!Na.nodeType&&Na,BG=vf&&vf.exports===P_,zS=BG&&IG.process,qG=(function(){try{var t=vf&&vf.require&&vf.require("util").types;return t||zS&&zS.binding&&zS.binding("util")}catch{}})();Na.exports=qG});var Sf=x((_ge,U_)=>{"use strict";var PG=B_(),zG=Cm(),z_=Em(),H_=z_&&z_.isTypedArray,HG=H_?zG(H_):PG;U_.exports=HG});var HS=x((Lge,F_)=>{"use strict";var UG=S_(),FG=gf(),jG=lt(),VG=Ra(),$G=PS(),YG=Sf(),KG=Object.prototype,GG=KG.hasOwnProperty;function QG(t,e){var n=jG(t),i=!n&&FG(t),r=!n&&!i&&VG(t),s=!n&&!i&&!r&&YG(t),o=n||i||r||s,l=o?UG(t.length,String):[],a=l.length;for(var c in t)(e||GG.call(t,c))&&!(o&&(c=="length"||r&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||$G(c,a)))&&l.push(c);return l}F_.exports=QG});var xf=x((Ige,j_)=>{"use strict";var XG=Object.prototype;function WG(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||XG;return t===n}j_.exports=WG});var US=x((Bge,V_)=>{"use strict";function ZG(t,e){return function(n){return t(e(n))}}V_.exports=ZG});var Y_=x((qge,$_)=>{"use strict";var JG=US(),eQ=JG(Object.keys,Object);$_.exports=eQ});var Dm=x((Pge,K_)=>{"use strict";var tQ=xf(),nQ=Y_(),iQ=Object.prototype,rQ=iQ.hasOwnProperty;function sQ(t){if(!tQ(t))return nQ(t);var e=[];for(var n in Object(t))rQ.call(t,n)&&n!="constructor"&&e.push(n);return e}K_.exports=sQ});var Ns=x((zge,G_)=>{"use strict";var oQ=hf(),lQ=Tm();function aQ(t){return t!=null&&lQ(t.length)&&!oQ(t)}G_.exports=aQ});var _s=x((Hge,Q_)=>{"use strict";var cQ=HS(),uQ=Dm(),fQ=Ns();function hQ(t){return fQ(t)?cQ(t):uQ(t)}Q_.exports=hQ});var W_=x((Uge,X_)=>{"use strict";var dQ=mf(),pQ=_s();function mQ(t,e){return t&&dQ(e,pQ(e),t)}X_.exports=mQ});var J_=x((Fge,Z_)=>{"use strict";function gQ(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}Z_.exports=gQ});var tL=x((jge,eL)=>{"use strict";var yQ=Ms(),bQ=xf(),vQ=J_(),SQ=Object.prototype,xQ=SQ.hasOwnProperty;function wQ(t){if(!yQ(t))return vQ(t);var e=bQ(t),n=[];for(var i in t)i=="constructor"&&(e||!xQ.call(t,i))||n.push(i);return n}eL.exports=wQ});var Mm=x((Vge,nL)=>{"use strict";var kQ=HS(),AQ=tL(),OQ=Ns();function TQ(t){return OQ(t)?kQ(t,!0):AQ(t)}nL.exports=TQ});var rL=x(($ge,iL)=>{"use strict";var CQ=mf(),EQ=Mm();function DQ(t,e){return t&&CQ(e,EQ(e),t)}iL.exports=DQ});var cL=x((wf,_a)=>{"use strict";var MQ=bi(),aL=typeof wf=="object"&&wf&&!wf.nodeType&&wf,sL=aL&&typeof _a=="object"&&_a&&!_a.nodeType&&_a,RQ=sL&&sL.exports===aL,oL=RQ?MQ.Buffer:void 0,lL=oL?oL.allocUnsafe:void 0;function NQ(t,e){if(e)return t.slice();var n=t.length,i=lL?lL(n):new t.constructor(n);return t.copy(i),i}_a.exports=NQ});var fL=x((Yge,uL)=>{"use strict";function _Q(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n<i;)e[n]=t[n];return e}uL.exports=_Q});var FS=x((Kge,hL)=>{"use strict";function LQ(t,e){for(var n=-1,i=t==null?0:t.length,r=0,s=[];++n<i;){var o=t[n];e(o,n,t)&&(s[r++]=o)}return s}hL.exports=LQ});var jS=x((Gge,dL)=>{"use strict";function IQ(){return[]}dL.exports=IQ});var Rm=x((Qge,mL)=>{"use strict";var BQ=FS(),qQ=jS(),PQ=Object.prototype,zQ=PQ.propertyIsEnumerable,pL=Object.getOwnPropertySymbols,HQ=pL?function(t){return t==null?[]:(t=Object(t),BQ(pL(t),function(e){return zQ.call(t,e)}))}:qQ;mL.exports=HQ});var yL=x((Xge,gL)=>{"use strict";var UQ=mf(),FQ=Rm();function jQ(t,e){return UQ(t,FQ(t),e)}gL.exports=jQ});var Nm=x((Wge,bL)=>{"use strict";function VQ(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}bL.exports=VQ});var _m=x((Zge,vL)=>{"use strict";var $Q=US(),YQ=$Q(Object.getPrototypeOf,Object);vL.exports=YQ});var VS=x((Jge,SL)=>{"use strict";var KQ=Nm(),GQ=_m(),QQ=Rm(),XQ=jS(),WQ=Object.getOwnPropertySymbols,ZQ=WQ?function(t){for(var e=[];t;)KQ(e,QQ(t)),t=GQ(t);return e}:XQ;SL.exports=ZQ});var wL=x((eye,xL)=>{"use strict";var JQ=mf(),eX=VS();function tX(t,e){return JQ(t,eX(t),e)}xL.exports=tX});var $S=x((tye,kL)=>{"use strict";var nX=Nm(),iX=lt();function rX(t,e,n){var i=e(t);return iX(t)?i:nX(i,n(t))}kL.exports=rX});var YS=x((nye,AL)=>{"use strict";var sX=$S(),oX=Rm(),lX=_s();function aX(t){return sX(t,lX,oX)}AL.exports=aX});var TL=x((iye,OL)=>{"use strict";var cX=$S(),uX=VS(),fX=Mm();function hX(t){return cX(t,fX,uX)}OL.exports=hX});var EL=x((rye,CL)=>{"use strict";var dX=Rs(),pX=bi(),mX=dX(pX,"DataView");CL.exports=mX});var ML=x((sye,DL)=>{"use strict";var gX=Rs(),yX=bi(),bX=gX(yX,"Promise");DL.exports=bX});var KS=x((oye,RL)=>{"use strict";var vX=Rs(),SX=bi(),xX=vX(SX,"Set");RL.exports=xX});var _L=x((lye,NL)=>{"use strict";var wX=Rs(),kX=bi(),AX=wX(kX,"WeakMap");NL.exports=AX});var _o=x((aye,HL)=>{"use strict";var GS=EL(),QS=wm(),XS=ML(),WS=KS(),ZS=_L(),zL=Ro(),La=LS(),LL="[object Map]",OX="[object Object]",IL="[object Promise]",BL="[object Set]",qL="[object WeakMap]",PL="[object DataView]",TX=La(GS),CX=La(QS),EX=La(XS),DX=La(WS),MX=La(ZS),No=zL;(GS&&No(new GS(new ArrayBuffer(1)))!=PL||QS&&No(new QS)!=LL||XS&&No(XS.resolve())!=IL||WS&&No(new WS)!=BL||ZS&&No(new ZS)!=qL)&&(No=function(t){var e=zL(t),n=e==OX?t.constructor:void 0,i=n?La(n):"";if(i)switch(i){case TX:return PL;case CX:return LL;case EX:return IL;case DX:return BL;case MX:return qL}return e});HL.exports=No});var FL=x((cye,UL)=>{"use strict";var RX=Object.prototype,NX=RX.hasOwnProperty;function _X(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&NX.call(t,"index")&&(n.index=t.index,n.input=t.input),n}UL.exports=_X});var JS=x((uye,jL)=>{"use strict";var LX=bi(),IX=LX.Uint8Array;jL.exports=IX});var Lm=x((fye,$L)=>{"use strict";var VL=JS();function BX(t){var e=new t.constructor(t.byteLength);return new VL(e).set(new VL(t)),e}$L.exports=BX});var KL=x((hye,YL)=>{"use strict";var qX=Lm();function PX(t,e){var n=e?qX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}YL.exports=PX});var QL=x((dye,GL)=>{"use strict";var zX=/\w*$/;function HX(t){var e=new t.constructor(t.source,zX.exec(t));return e.lastIndex=t.lastIndex,e}GL.exports=HX});var eI=x((pye,JL)=>{"use strict";var XL=Mo(),WL=XL?XL.prototype:void 0,ZL=WL?WL.valueOf:void 0;function UX(t){return ZL?Object(ZL.call(t)):{}}JL.exports=UX});var nI=x((mye,tI)=>{"use strict";var FX=Lm();function jX(t,e){var n=e?FX(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}tI.exports=jX});var rI=x((gye,iI)=>{"use strict";var VX=Lm(),$X=KL(),YX=QL(),KX=eI(),GX=nI(),QX="[object Boolean]",XX="[object Date]",WX="[object Map]",ZX="[object Number]",JX="[object RegExp]",eW="[object Set]",tW="[object String]",nW="[object Symbol]",iW="[object ArrayBuffer]",rW="[object DataView]",sW="[object Float32Array]",oW="[object Float64Array]",lW="[object Int8Array]",aW="[object Int16Array]",cW="[object Int32Array]",uW="[object Uint8Array]",fW="[object Uint8ClampedArray]",hW="[object Uint16Array]",dW="[object Uint32Array]";function pW(t,e,n){var i=t.constructor;switch(e){case iW:return VX(t);case QX:case XX:return new i(+t);case rW:return $X(t,n);case sW:case oW:case lW:case aW:case cW:case uW:case fW:case hW:case dW:return GX(t,n);case WX:return new i;case ZX:case tW:return new i(t);case JX:return YX(t);case eW:return new i;case nW:return KX(t)}}iI.exports=pW});var ex=x((yye,oI)=>{"use strict";var mW=Ms(),sI=Object.create,gW=(function(){function t(){}return function(e){if(!mW(e))return{};if(sI)return sI(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();oI.exports=gW});var aI=x((bye,lI)=>{"use strict";var yW=ex(),bW=_m(),vW=xf();function SW(t){return typeof t.constructor=="function"&&!vW(t)?yW(bW(t)):{}}lI.exports=SW});var uI=x((vye,cI)=>{"use strict";var xW=_o(),wW=Ki(),kW="[object Map]";function AW(t){return wW(t)&&xW(t)==kW}cI.exports=AW});var pI=x((Sye,dI)=>{"use strict";var OW=uI(),TW=Cm(),fI=Em(),hI=fI&&fI.isMap,CW=hI?TW(hI):OW;dI.exports=CW});var gI=x((xye,mI)=>{"use strict";var EW=_o(),DW=Ki(),MW="[object Set]";function RW(t){return DW(t)&&EW(t)==MW}mI.exports=RW});var SI=x((wye,vI)=>{"use strict";var NW=gI(),_W=Cm(),yI=Em(),bI=yI&&yI.isSet,LW=bI?_W(bI):NW;vI.exports=LW});var OI=x((kye,AI)=>{"use strict";var IW=Am(),BW=Om(),qW=qS(),PW=W_(),zW=rL(),HW=cL(),UW=fL(),FW=yL(),jW=wL(),VW=YS(),$W=TL(),YW=_o(),KW=FL(),GW=rI(),QW=aI(),XW=lt(),WW=Ra(),ZW=pI(),JW=Ms(),eZ=SI(),tZ=_s(),nZ=Mm(),iZ=1,rZ=2,sZ=4,xI="[object Arguments]",oZ="[object Array]",lZ="[object Boolean]",aZ="[object Date]",cZ="[object Error]",wI="[object Function]",uZ="[object GeneratorFunction]",fZ="[object Map]",hZ="[object Number]",kI="[object Object]",dZ="[object RegExp]",pZ="[object Set]",mZ="[object String]",gZ="[object Symbol]",yZ="[object WeakMap]",bZ="[object ArrayBuffer]",vZ="[object DataView]",SZ="[object Float32Array]",xZ="[object Float64Array]",wZ="[object Int8Array]",kZ="[object Int16Array]",AZ="[object Int32Array]",OZ="[object Uint8Array]",TZ="[object Uint8ClampedArray]",CZ="[object Uint16Array]",EZ="[object Uint32Array]",Re={};Re[xI]=Re[oZ]=Re[bZ]=Re[vZ]=Re[lZ]=Re[aZ]=Re[SZ]=Re[xZ]=Re[wZ]=Re[kZ]=Re[AZ]=Re[fZ]=Re[hZ]=Re[kI]=Re[dZ]=Re[pZ]=Re[mZ]=Re[gZ]=Re[OZ]=Re[TZ]=Re[CZ]=Re[EZ]=!0;Re[cZ]=Re[wI]=Re[yZ]=!1;function Im(t,e,n,i,r,s){var o,l=e&iZ,a=e&rZ,c=e&sZ;if(n&&(o=r?n(t,i,r,s):n(t)),o!==void 0)return o;if(!JW(t))return t;var u=XW(t);if(u){if(o=KW(t),!l)return UW(t,o)}else{var f=YW(t),h=f==wI||f==uZ;if(WW(t))return HW(t,l);if(f==kI||f==xI||h&&!r){if(o=a||h?{}:QW(t),!l)return a?jW(t,zW(o,t)):FW(t,PW(o,t))}else{if(!Re[f])return r?t:{};o=GW(t,f,l)}}s||(s=new IW);var d=s.get(t);if(d)return d;s.set(t,o),eZ(t)?t.forEach(function(b){o.add(Im(b,e,n,b,t,s))}):ZW(t)&&t.forEach(function(b,p){o.set(p,Im(b,e,n,p,t,s))});var m=c?a?$W:VW:a?nZ:tZ,g=u?void 0:m(t);return BW(g||t,function(b,p){g&&(p=b,b=t[p]),qW(o,p,Im(b,e,n,p,t,s))}),o}AI.exports=Im});var CI=x((Aye,TI)=>{"use strict";var DZ=OI(),MZ=4;function RZ(t){return DZ(t,MZ)}TI.exports=RZ});var tx=x((Oye,EI)=>{"use strict";function NZ(t){return function(){return t}}EI.exports=NZ});var MI=x((Tye,DI)=>{"use strict";function _Z(t){return function(e,n,i){for(var r=-1,s=Object(e),o=i(e),l=o.length;l--;){var a=o[t?l:++r];if(n(s[a],a,s)===!1)break}return e}}DI.exports=_Z});var NI=x((Cye,RI)=>{"use strict";var LZ=MI(),IZ=LZ();RI.exports=IZ});var nx=x((Eye,_I)=>{"use strict";var BZ=NI(),qZ=_s();function PZ(t,e){return t&&BZ(t,e,qZ)}_I.exports=PZ});var II=x((Dye,LI)=>{"use strict";var zZ=Ns();function HZ(t,e){return function(n,i){if(n==null)return n;if(!zZ(n))return t(n,i);for(var r=n.length,s=e?r:-1,o=Object(n);(e?s--:++s<r)&&i(o[s],s,o)!==!1;);return n}}LI.exports=HZ});var kf=x((Mye,BI)=>{"use strict";var UZ=nx(),FZ=II(),jZ=FZ(UZ);BI.exports=jZ});var Af=x((Rye,qI)=>{"use strict";function VZ(t){return t}qI.exports=VZ});var zI=x((Nye,PI)=>{"use strict";var $Z=Af();function YZ(t){return typeof t=="function"?t:$Z}PI.exports=YZ});var UI=x((_ye,HI)=>{"use strict";var KZ=Om(),GZ=kf(),QZ=zI(),XZ=lt();function WZ(t,e){var n=XZ(t)?KZ:GZ;return n(t,QZ(e))}HI.exports=WZ});var jI=x((Lye,FI)=>{"use strict";FI.exports=UI()});var $I=x((Iye,VI)=>{"use strict";var ZZ=kf();function JZ(t,e){var n=[];return ZZ(t,function(i,r,s){e(i,r,s)&&n.push(i)}),n}VI.exports=JZ});var KI=x((Bye,YI)=>{"use strict";var eJ="__lodash_hash_undefined__";function tJ(t){return this.__data__.set(t,eJ),this}YI.exports=tJ});var QI=x((qye,GI)=>{"use strict";function nJ(t){return this.__data__.has(t)}GI.exports=nJ});var ix=x((Pye,XI)=>{"use strict";var iJ=km(),rJ=KI(),sJ=QI();function Bm(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new iJ;++e<n;)this.add(t[e])}Bm.prototype.add=Bm.prototype.push=rJ;Bm.prototype.has=sJ;XI.exports=Bm});var ZI=x((zye,WI)=>{"use strict";function oJ(t,e){for(var n=-1,i=t==null?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}WI.exports=oJ});var rx=x((Hye,JI)=>{"use strict";function lJ(t,e){return t.has(e)}JI.exports=lJ});var sx=x((Uye,eB)=>{"use strict";var aJ=ix(),cJ=ZI(),uJ=rx(),fJ=1,hJ=2;function dJ(t,e,n,i,r,s){var o=n&fJ,l=t.length,a=e.length;if(l!=a&&!(o&&a>l))return!1;var c=s.get(t),u=s.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&hJ?new aJ:void 0;for(s.set(t,e),s.set(e,t);++f<l;){var m=t[f],g=e[f];if(i)var b=o?i(g,m,f,e,t,s):i(m,g,f,t,e,s);if(b!==void 0){if(b)continue;h=!1;break}if(d){if(!cJ(e,function(p,y){if(!uJ(d,y)&&(m===p||r(m,p,n,i,s)))return d.push(y)})){h=!1;break}}else if(!(m===g||r(m,g,n,i,s))){h=!1;break}}return s.delete(t),s.delete(e),h}eB.exports=dJ});var nB=x((Fye,tB)=>{"use strict";function pJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i,r){n[++e]=[r,i]}),n}tB.exports=pJ});var qm=x((jye,iB)=>{"use strict";function mJ(t){var e=-1,n=Array(t.size);return t.forEach(function(i){n[++e]=i}),n}iB.exports=mJ});var aB=x((Vye,lB)=>{"use strict";var rB=Mo(),sB=JS(),gJ=xm(),yJ=sx(),bJ=nB(),vJ=qm(),SJ=1,xJ=2,wJ="[object Boolean]",kJ="[object Date]",AJ="[object Error]",OJ="[object Map]",TJ="[object Number]",CJ="[object RegExp]",EJ="[object Set]",DJ="[object String]",MJ="[object Symbol]",RJ="[object ArrayBuffer]",NJ="[object DataView]",oB=rB?rB.prototype:void 0,ox=oB?oB.valueOf:void 0;function _J(t,e,n,i,r,s,o){switch(n){case NJ:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case RJ:return!(t.byteLength!=e.byteLength||!s(new sB(t),new sB(e)));case wJ:case kJ:case TJ:return gJ(+t,+e);case AJ:return t.name==e.name&&t.message==e.message;case CJ:case DJ:return t==e+"";case OJ:var l=bJ;case EJ:var a=i&SJ;if(l||(l=vJ),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;i|=xJ,o.set(t,e);var u=yJ(l(t),l(e),i,r,s,o);return o.delete(t),u;case MJ:if(ox)return ox.call(t)==ox.call(e)}return!1}lB.exports=_J});var fB=x(($ye,uB)=>{"use strict";var cB=YS(),LJ=1,IJ=Object.prototype,BJ=IJ.hasOwnProperty;function qJ(t,e,n,i,r,s){var o=n&LJ,l=cB(t),a=l.length,c=cB(e),u=c.length;if(a!=u&&!o)return!1;for(var f=a;f--;){var h=l[f];if(!(o?h in e:BJ.call(e,h)))return!1}var d=s.get(t),m=s.get(e);if(d&&m)return d==e&&m==t;var g=!0;s.set(t,e),s.set(e,t);for(var b=o;++f<a;){h=l[f];var p=t[h],y=e[h];if(i)var v=o?i(y,p,h,e,t,s):i(p,y,h,t,e,s);if(!(v===void 0?p===y||r(p,y,n,i,s):v)){g=!1;break}b||(b=h=="constructor")}if(g&&!b){var S=t.constructor,w=e.constructor;S!=w&&"constructor"in t&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof w=="function"&&w instanceof w)&&(g=!1)}return s.delete(t),s.delete(e),g}uB.exports=qJ});var vB=x((Yye,bB)=>{"use strict";var lx=Am(),PJ=sx(),zJ=aB(),HJ=fB(),hB=_o(),dB=lt(),pB=Ra(),UJ=Sf(),FJ=1,mB="[object Arguments]",gB="[object Array]",Pm="[object Object]",jJ=Object.prototype,yB=jJ.hasOwnProperty;function VJ(t,e,n,i,r,s){var o=dB(t),l=dB(e),a=o?gB:hB(t),c=l?gB:hB(e);a=a==mB?Pm:a,c=c==mB?Pm:c;var u=a==Pm,f=c==Pm,h=a==c;if(h&&pB(t)){if(!pB(e))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new lx),o||UJ(t)?PJ(t,e,n,i,r,s):zJ(t,e,a,n,i,r,s);if(!(n&FJ)){var d=u&&yB.call(t,"__wrapped__"),m=f&&yB.call(e,"__wrapped__");if(d||m){var g=d?t.value():t,b=m?e.value():e;return s||(s=new lx),r(g,b,n,i,s)}}return h?(s||(s=new lx),HJ(t,e,n,i,r,s)):!1}bB.exports=VJ});var ax=x((Kye,wB)=>{"use strict";var $J=vB(),SB=Ki();function xB(t,e,n,i,r){return t===e?!0:t==null||e==null||!SB(t)&&!SB(e)?t!==t&&e!==e:$J(t,e,n,i,xB,r)}wB.exports=xB});var AB=x((Gye,kB)=>{"use strict";var YJ=Am(),KJ=ax(),GJ=1,QJ=2;function XJ(t,e,n,i){var r=n.length,s=r,o=!i;if(t==null)return!s;for(t=Object(t);r--;){var l=n[r];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++r<s;){l=n[r];var a=l[0],c=t[a],u=l[1];if(o&&l[2]){if(c===void 0&&!(a in t))return!1}else{var f=new YJ;if(i)var h=i(c,u,a,t,e,f);if(!(h===void 0?KJ(u,c,GJ|QJ,i,f):h))return!1}}return!0}kB.exports=XJ});var cx=x((Qye,OB)=>{"use strict";var WJ=Ms();function ZJ(t){return t===t&&!WJ(t)}OB.exports=ZJ});var CB=x((Xye,TB)=>{"use strict";var JJ=cx(),eee=_s();function tee(t){for(var e=eee(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,JJ(r)]}return e}TB.exports=tee});var ux=x((Wye,EB)=>{"use strict";function nee(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}EB.exports=nee});var MB=x((Zye,DB)=>{"use strict";var iee=AB(),ree=CB(),see=ux();function oee(t){var e=ree(t);return e.length==1&&e[0][2]?see(e[0][0],e[0][1]):function(n){return n===t||iee(n,t,e)}}DB.exports=oee});var zm=x((Jye,RB)=>{"use strict";var lee=Ro(),aee=Ki(),cee="[object Symbol]";function uee(t){return typeof t=="symbol"||aee(t)&&lee(t)==cee}RB.exports=uee});var Hm=x((e0e,NB)=>{"use strict";var fee=lt(),hee=zm(),dee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pee=/^\w*$/;function mee(t,e){if(fee(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||hee(t)?!0:pee.test(t)||!dee.test(t)||e!=null&&t in Object(e)}NB.exports=mee});var IB=x((t0e,LB)=>{"use strict";var _B=km(),gee="Expected a function";function fx(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(gee);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],s=n.cache;if(s.has(r))return s.get(r);var o=t.apply(this,i);return n.cache=s.set(r,o)||s,o};return n.cache=new(fx.Cache||_B),n}fx.Cache=_B;LB.exports=fx});var qB=x((n0e,BB)=>{"use strict";var yee=IB(),bee=500;function vee(t){var e=yee(t,function(i){return n.size===bee&&n.clear(),i}),n=e.cache;return e}BB.exports=vee});var zB=x((i0e,PB)=>{"use strict";var See=qB(),xee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wee=/\\(\\)?/g,kee=See(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(xee,function(n,i,r,s){e.push(r?s.replace(wee,"$1"):i||n)}),e});PB.exports=kee});var Um=x((r0e,HB)=>{"use strict";function Aee(t,e){for(var n=-1,i=t==null?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}HB.exports=Aee});var YB=x((s0e,$B)=>{"use strict";var UB=Mo(),Oee=Um(),Tee=lt(),Cee=zm(),Eee=1/0,FB=UB?UB.prototype:void 0,jB=FB?FB.toString:void 0;function VB(t){if(typeof t=="string")return t;if(Tee(t))return Oee(t,VB)+"";if(Cee(t))return jB?jB.call(t):"";var e=t+"";return e=="0"&&1/t==-Eee?"-0":e}$B.exports=VB});var GB=x((o0e,KB)=>{"use strict";var Dee=YB();function Mee(t){return t==null?"":Dee(t)}KB.exports=Mee});var hx=x((l0e,QB)=>{"use strict";var Ree=lt(),Nee=Hm(),_ee=zB(),Lee=GB();function Iee(t,e){return Ree(t)?t:Nee(t,e)?[t]:_ee(Lee(t))}QB.exports=Iee});var Of=x((a0e,XB)=>{"use strict";var Bee=zm(),qee=1/0;function Pee(t){if(typeof t=="string"||Bee(t))return t;var e=t+"";return e=="0"&&1/t==-qee?"-0":e}XB.exports=Pee});var dx=x((c0e,WB)=>{"use strict";var zee=hx(),Hee=Of();function Uee(t,e){e=zee(e,t);for(var n=0,i=e.length;t!=null&&n<i;)t=t[Hee(e[n++])];return n&&n==i?t:void 0}WB.exports=Uee});var JB=x((u0e,ZB)=>{"use strict";var Fee=dx();function jee(t,e,n){var i=t==null?void 0:Fee(t,e);return i===void 0?n:i}ZB.exports=jee});var t3=x((f0e,e3)=>{"use strict";function Vee(t,e){return t!=null&&e in Object(t)}e3.exports=Vee});var px=x((h0e,n3)=>{"use strict";var $ee=hx(),Yee=gf(),Kee=lt(),Gee=PS(),Qee=Tm(),Xee=Of();function Wee(t,e,n){e=$ee(e,t);for(var i=-1,r=e.length,s=!1;++i<r;){var o=Xee(e[i]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++i!=r?s:(r=t==null?0:t.length,!!r&&Qee(r)&&Gee(o,r)&&(Kee(t)||Yee(t)))}n3.exports=Wee});var r3=x((d0e,i3)=>{"use strict";var Zee=t3(),Jee=px();function ete(t,e){return t!=null&&Jee(t,e,Zee)}i3.exports=ete});var o3=x((p0e,s3)=>{"use strict";var tte=ax(),nte=JB(),ite=r3(),rte=Hm(),ste=cx(),ote=ux(),lte=Of(),ate=1,cte=2;function ute(t,e){return rte(t)&&ste(e)?ote(lte(t),e):function(n){var i=nte(n,t);return i===void 0&&i===e?ite(n,t):tte(e,i,ate|cte)}}s3.exports=ute});var mx=x((m0e,l3)=>{"use strict";function fte(t){return function(e){return e?.[t]}}l3.exports=fte});var c3=x((g0e,a3)=>{"use strict";var hte=dx();function dte(t){return function(e){return hte(e,t)}}a3.exports=dte});var f3=x((y0e,u3)=>{"use strict";var pte=mx(),mte=c3(),gte=Hm(),yte=Of();function bte(t){return gte(t)?pte(yte(t)):mte(t)}u3.exports=bte});var Tf=x((b0e,h3)=>{"use strict";var vte=MB(),Ste=o3(),xte=Af(),wte=lt(),kte=f3();function Ate(t){return typeof t=="function"?t:t==null?xte:typeof t=="object"?wte(t)?Ste(t[0],t[1]):vte(t):kte(t)}h3.exports=Ate});var p3=x((v0e,d3)=>{"use strict";var Ote=FS(),Tte=$I(),Cte=Tf(),Ete=lt();function Dte(t,e){var n=Ete(t)?Ote:Tte;return n(t,Cte(e,3))}d3.exports=Dte});var g3=x((S0e,m3)=>{"use strict";var Mte=Object.prototype,Rte=Mte.hasOwnProperty;function Nte(t,e){return t!=null&&Rte.call(t,e)}m3.exports=Nte});var b3=x((x0e,y3)=>{"use strict";var _te=g3(),Lte=px();function Ite(t,e){return t!=null&&Lte(t,e,_te)}y3.exports=Ite});var S3=x((w0e,v3)=>{"use strict";var Bte=Dm(),qte=_o(),Pte=gf(),zte=lt(),Hte=Ns(),Ute=Ra(),Fte=xf(),jte=Sf(),Vte="[object Map]",$te="[object Set]",Yte=Object.prototype,Kte=Yte.hasOwnProperty;function Gte(t){if(t==null)return!0;if(Hte(t)&&(zte(t)||typeof t=="string"||typeof t.splice=="function"||Ute(t)||jte(t)||Pte(t)))return!t.length;var e=qte(t);if(e==Vte||e==$te)return!t.size;if(Fte(t))return!Bte(t).length;for(var n in t)if(Kte.call(t,n))return!1;return!0}v3.exports=Gte});var w3=x((k0e,x3)=>{"use strict";function Qte(t){return t===void 0}x3.exports=Qte});var A3=x((A0e,k3)=>{"use strict";var Xte=kf(),Wte=Ns();function Zte(t,e){var n=-1,i=Wte(t)?Array(t.length):[];return Xte(t,function(r,s,o){i[++n]=e(r,s,o)}),i}k3.exports=Zte});var T3=x((O0e,O3)=>{"use strict";var Jte=Um(),ene=Tf(),tne=A3(),nne=lt();function ine(t,e){var n=nne(t)?Jte:tne;return n(t,ene(e,3))}O3.exports=ine});var E3=x((T0e,C3)=>{"use strict";function rne(t,e,n,i){var r=-1,s=t==null?0:t.length;for(i&&s&&(n=t[++r]);++r<s;)n=e(n,t[r],r,t);return n}C3.exports=rne});var M3=x((C0e,D3)=>{"use strict";function sne(t,e,n,i,r){return r(t,function(s,o,l){n=i?(i=!1,s):e(n,s,o,l)}),n}D3.exports=sne});var N3=x((E0e,R3)=>{"use strict";var one=E3(),lne=kf(),ane=Tf(),cne=M3(),une=lt();function fne(t,e,n){var i=une(t)?one:cne,r=arguments.length<3;return i(t,ane(e,4),n,r,lne)}R3.exports=fne});var L3=x((D0e,_3)=>{"use strict";var hne=Ro(),dne=lt(),pne=Ki(),mne="[object String]";function gne(t){return typeof t=="string"||!dne(t)&&pne(t)&&hne(t)==mne}_3.exports=gne});var B3=x((M0e,I3)=>{"use strict";var yne=mx(),bne=yne("length");I3.exports=bne});var P3=x((R0e,q3)=>{"use strict";var vne="\\ud800-\\udfff",Sne="\\u0300-\\u036f",xne="\\ufe20-\\ufe2f",wne="\\u20d0-\\u20ff",kne=Sne+xne+wne,Ane="\\ufe0e\\ufe0f",One="\\u200d",Tne=RegExp("["+One+vne+kne+Ane+"]");function Cne(t){return Tne.test(t)}q3.exports=Cne});var K3=x((N0e,Y3)=>{"use strict";var H3="\\ud800-\\udfff",Ene="\\u0300-\\u036f",Dne="\\ufe20-\\ufe2f",Mne="\\u20d0-\\u20ff",Rne=Ene+Dne+Mne,Nne="\\ufe0e\\ufe0f",_ne="["+H3+"]",gx="["+Rne+"]",yx="\\ud83c[\\udffb-\\udfff]",Lne="(?:"+gx+"|"+yx+")",U3="[^"+H3+"]",F3="(?:\\ud83c[\\udde6-\\uddff]){2}",j3="[\\ud800-\\udbff][\\udc00-\\udfff]",Ine="\\u200d",V3=Lne+"?",$3="["+Nne+"]?",Bne="(?:"+Ine+"(?:"+[U3,F3,j3].join("|")+")"+$3+V3+")*",qne=$3+V3+Bne,Pne="(?:"+[U3+gx+"?",gx,F3,j3,_ne].join("|")+")",z3=RegExp(yx+"(?="+yx+")|"+Pne+qne,"g");function zne(t){for(var e=z3.lastIndex=0;z3.test(t);)++e;return e}Y3.exports=zne});var Q3=x((_0e,G3)=>{"use strict";var Hne=B3(),Une=P3(),Fne=K3();function jne(t){return Une(t)?Fne(t):Hne(t)}G3.exports=jne});var W3=x((L0e,X3)=>{"use strict";var Vne=Dm(),$ne=_o(),Yne=Ns(),Kne=L3(),Gne=Q3(),Qne="[object Map]",Xne="[object Set]";function Wne(t){if(t==null)return 0;if(Yne(t))return Kne(t)?Gne(t):t.length;var e=$ne(t);return e==Qne||e==Xne?t.size:Vne(t).length}X3.exports=Wne});var J3=x((I0e,Z3)=>{"use strict";var Zne=Om(),Jne=ex(),eie=nx(),tie=Tf(),nie=_m(),iie=lt(),rie=Ra(),sie=hf(),oie=Ms(),lie=Sf();function aie(t,e,n){var i=iie(t),r=i||rie(t)||lie(t);if(e=tie(e,4),n==null){var s=t&&t.constructor;r?n=i?new s:[]:oie(t)?n=sie(s)?Jne(nie(t)):{}:n={}}return(r?Zne:eie)(t,function(o,l,a){return e(n,o,l,a)}),n}Z3.exports=aie});var iq=x((B0e,nq)=>{"use strict";var eq=Mo(),cie=gf(),uie=lt(),tq=eq?eq.isConcatSpreadable:void 0;function fie(t){return uie(t)||cie(t)||!!(tq&&t&&t[tq])}nq.exports=fie});var oq=x((q0e,sq)=>{"use strict";var hie=Nm(),die=iq();function rq(t,e,n,i,r){var s=-1,o=t.length;for(n||(n=die),r||(r=[]);++s<o;){var l=t[s];e>0&&n(l)?e>1?rq(l,e-1,n,i,r):hie(r,l):i||(r[r.length]=l)}return r}sq.exports=rq});var aq=x((P0e,lq)=>{"use strict";function pie(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}lq.exports=pie});var fq=x((z0e,uq)=>{"use strict";var mie=aq(),cq=Math.max;function gie(t,e,n){return e=cq(e===void 0?t.length-1:e,0),function(){for(var i=arguments,r=-1,s=cq(i.length-e,0),o=Array(s);++r<s;)o[r]=i[e+r];r=-1;for(var l=Array(e+1);++r<e;)l[r]=i[r];return l[e]=n(o),mie(t,this,l)}}uq.exports=gie});var pq=x((H0e,dq)=>{"use strict";var yie=tx(),hq=IS(),bie=Af(),vie=hq?function(t,e){return hq(t,"toString",{configurable:!0,enumerable:!1,value:yie(e),writable:!0})}:bie;dq.exports=vie});var gq=x((U0e,mq)=>{"use strict";var Sie=800,xie=16,wie=Date.now;function kie(t){var e=0,n=0;return function(){var i=wie(),r=xie-(i-n);if(n=i,r>0){if(++e>=Sie)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}mq.exports=kie});var bq=x((F0e,yq)=>{"use strict";var Aie=pq(),Oie=gq(),Tie=Oie(Aie);yq.exports=Tie});var Sq=x((j0e,vq)=>{"use strict";var Cie=Af(),Eie=fq(),Die=bq();function Mie(t,e){return Die(Eie(t,e,Cie),t+"")}vq.exports=Mie});var wq=x((V0e,xq)=>{"use strict";function Rie(t,e,n,i){for(var r=t.length,s=n+(i?1:-1);i?s--:++s<r;)if(e(t[s],s,t))return s;return-1}xq.exports=Rie});var Aq=x(($0e,kq)=>{"use strict";function Nie(t){return t!==t}kq.exports=Nie});var Tq=x((Y0e,Oq)=>{"use strict";function _ie(t,e,n){for(var i=n-1,r=t.length;++i<r;)if(t[i]===e)return i;return-1}Oq.exports=_ie});var Eq=x((K0e,Cq)=>{"use strict";var Lie=wq(),Iie=Aq(),Bie=Tq();function qie(t,e,n){return e===e?Bie(t,e,n):Lie(t,Iie,n)}Cq.exports=qie});var Mq=x((G0e,Dq)=>{"use strict";var Pie=Eq();function zie(t,e){var n=t==null?0:t.length;return!!n&&Pie(t,e,0)>-1}Dq.exports=zie});var Nq=x((Q0e,Rq)=>{"use strict";function Hie(t,e,n){for(var i=-1,r=t==null?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}Rq.exports=Hie});var Lq=x((X0e,_q)=>{"use strict";function Uie(){}_q.exports=Uie});var Bq=x((W0e,Iq)=>{"use strict";var bx=KS(),Fie=Lq(),jie=qm(),Vie=1/0,$ie=bx&&1/jie(new bx([,-0]))[1]==Vie?function(t){return new bx(t)}:Fie;Iq.exports=$ie});var Pq=x((Z0e,qq)=>{"use strict";var Yie=ix(),Kie=Mq(),Gie=Nq(),Qie=rx(),Xie=Bq(),Wie=qm(),Zie=200;function Jie(t,e,n){var i=-1,r=Kie,s=t.length,o=!0,l=[],a=l;if(n)o=!1,r=Gie;else if(s>=Zie){var c=e?null:Xie(t);if(c)return Wie(c);o=!1,r=Qie,a=new Yie}else a=e?[]:l;e:for(;++i<s;){var u=t[i],f=e?e(u):u;if(u=n||u!==0?u:0,o&&f===f){for(var h=a.length;h--;)if(a[h]===f)continue e;e&&a.push(f),l.push(u)}else r(a,f,n)||(a!==l&&a.push(f),l.push(u))}return l}qq.exports=Jie});var Hq=x((J0e,zq)=>{"use strict";var ere=Ns(),tre=Ki();function nre(t){return tre(t)&&ere(t)}zq.exports=nre});var Fq=x((ebe,Uq)=>{"use strict";var ire=oq(),rre=Sq(),sre=Pq(),ore=Hq(),lre=rre(function(t){return sre(ire(t,1,ore,!0))});Uq.exports=lre});var Vq=x((tbe,jq)=>{"use strict";var are=Um();function cre(t,e){return are(e,function(n){return t[n]})}jq.exports=cre});var Yq=x((nbe,$q)=>{"use strict";var ure=Vq(),fre=_s();function hre(t){return t==null?[]:ure(t,fre(t))}$q.exports=hre});var An=x((ibe,Kq)=>{"use strict";var Fm;if(typeof Ex=="function")try{Fm={clone:CI(),constant:tx(),each:jI(),filter:p3(),has:b3(),isArray:lt(),isEmpty:S3(),isFunction:hf(),isUndefined:w3(),keys:_s(),map:T3(),reduce:N3(),size:W3(),transform:J3(),union:Fq(),values:Yq()}}catch{}Fm||(Fm=window._);Kq.exports=Fm});var jm=x((sbe,Wq)=>{"use strict";var X=An();Wq.exports=te;var dre="\0",Lo="\0",Gq="";function te(t){this._isDirected=X.has(t,"directed")?t.directed:!0,this._isMultigraph=X.has(t,"multigraph")?t.multigraph:!1,this._isCompound=X.has(t,"compound")?t.compound:!1,this._label=void 0,this._defaultNodeLabelFn=X.constant(void 0),this._defaultEdgeLabelFn=X.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[Lo]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}te.prototype._nodeCount=0;te.prototype._edgeCount=0;te.prototype.isDirected=function(){return this._isDirected};te.prototype.isMultigraph=function(){return this._isMultigraph};te.prototype.isCompound=function(){return this._isCompound};te.prototype.setGraph=function(t){return this._label=t,this};te.prototype.graph=function(){return this._label};te.prototype.setDefaultNodeLabel=function(t){return X.isFunction(t)||(t=X.constant(t)),this._defaultNodeLabelFn=t,this};te.prototype.nodeCount=function(){return this._nodeCount};te.prototype.nodes=function(){return X.keys(this._nodes)};te.prototype.sources=function(){var t=this;return X.filter(this.nodes(),function(e){return X.isEmpty(t._in[e])})};te.prototype.sinks=function(){var t=this;return X.filter(this.nodes(),function(e){return X.isEmpty(t._out[e])})};te.prototype.setNodes=function(t,e){var n=arguments,i=this;return X.each(t,function(r){n.length>1?i.setNode(r,e):i.setNode(r)}),this};te.prototype.setNode=function(t,e){return X.has(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=e),this):(this._nodes[t]=arguments.length>1?e:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=Lo,this._children[t]={},this._children[Lo][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)};te.prototype.node=function(t){return this._nodes[t]};te.prototype.hasNode=function(t){return X.has(this._nodes,t)};te.prototype.removeNode=function(t){var e=this;if(X.has(this._nodes,t)){var n=function(i){e.removeEdge(e._edgeObjs[i])};delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],X.each(this.children(t),function(i){e.setParent(i)}),delete this._children[t]),X.each(X.keys(this._in[t]),n),delete this._in[t],delete this._preds[t],X.each(X.keys(this._out[t]),n),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this};te.prototype.setParent=function(t,e){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(X.isUndefined(e))e=Lo;else{e+="";for(var n=e;!X.isUndefined(n);n=this.parent(n))if(n===t)throw new Error("Setting "+e+" as parent of "+t+" would create a cycle");this.setNode(e)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=e,this._children[e][t]=!0,this};te.prototype._removeFromParentsChildList=function(t){delete this._children[this._parent[t]][t]};te.prototype.parent=function(t){if(this._isCompound){var e=this._parent[t];if(e!==Lo)return e}};te.prototype.children=function(t){if(X.isUndefined(t)&&(t=Lo),this._isCompound){var e=this._children[t];if(e)return X.keys(e)}else{if(t===Lo)return this.nodes();if(this.hasNode(t))return[]}};te.prototype.predecessors=function(t){var e=this._preds[t];if(e)return X.keys(e)};te.prototype.successors=function(t){var e=this._sucs[t];if(e)return X.keys(e)};te.prototype.neighbors=function(t){var e=this.predecessors(t);if(e)return X.union(e,this.successors(t))};te.prototype.isLeaf=function(t){var e;return this.isDirected()?e=this.successors(t):e=this.neighbors(t),e.length===0};te.prototype.filterNodes=function(t){var e=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});e.setGraph(this.graph());var n=this;X.each(this._nodes,function(s,o){t(o)&&e.setNode(o,s)}),X.each(this._edgeObjs,function(s){e.hasNode(s.v)&&e.hasNode(s.w)&&e.setEdge(s,n.edge(s))});var i={};function r(s){var o=n.parent(s);return o===void 0||e.hasNode(o)?(i[s]=o,o):o in i?i[o]:r(o)}return this._isCompound&&X.each(e.nodes(),function(s){e.setParent(s,r(s))}),e};te.prototype.setDefaultEdgeLabel=function(t){return X.isFunction(t)||(t=X.constant(t)),this._defaultEdgeLabelFn=t,this};te.prototype.edgeCount=function(){return this._edgeCount};te.prototype.edges=function(){return X.values(this._edgeObjs)};te.prototype.setPath=function(t,e){var n=this,i=arguments;return X.reduce(t,function(r,s){return i.length>1?n.setEdge(r,s,e):n.setEdge(r,s),s}),this};te.prototype.setEdge=function(){var t,e,n,i,r=!1,s=arguments[0];typeof s=="object"&&s!==null&&"v"in s?(t=s.v,e=s.w,n=s.name,arguments.length===2&&(i=arguments[1],r=!0)):(t=s,e=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),t=""+t,e=""+e,X.isUndefined(n)||(n=""+n);var o=Cf(this._isDirected,t,e,n);if(X.has(this._edgeLabels,o))return r&&(this._edgeLabels[o]=i),this;if(!X.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(e),this._edgeLabels[o]=r?i:this._defaultEdgeLabelFn(t,e,n);var l=pre(this._isDirected,t,e,n);return t=l.v,e=l.w,Object.freeze(l),this._edgeObjs[o]=l,Qq(this._preds[e],t),Qq(this._sucs[t],e),this._in[e][o]=l,this._out[t][o]=l,this._edgeCount++,this};te.prototype.edge=function(t,e,n){var i=arguments.length===1?vx(this._isDirected,arguments[0]):Cf(this._isDirected,t,e,n);return this._edgeLabels[i]};te.prototype.hasEdge=function(t,e,n){var i=arguments.length===1?vx(this._isDirected,arguments[0]):Cf(this._isDirected,t,e,n);return X.has(this._edgeLabels,i)};te.prototype.removeEdge=function(t,e,n){var i=arguments.length===1?vx(this._isDirected,arguments[0]):Cf(this._isDirected,t,e,n),r=this._edgeObjs[i];return r&&(t=r.v,e=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Xq(this._preds[e],t),Xq(this._sucs[t],e),delete this._in[e][i],delete this._out[t][i],this._edgeCount--),this};te.prototype.inEdges=function(t,e){var n=this._in[t];if(n){var i=X.values(n);return e?X.filter(i,function(r){return r.v===e}):i}};te.prototype.outEdges=function(t,e){var n=this._out[t];if(n){var i=X.values(n);return e?X.filter(i,function(r){return r.w===e}):i}};te.prototype.nodeEdges=function(t,e){var n=this.inEdges(t,e);if(n)return n.concat(this.outEdges(t,e))};function Qq(t,e){t[e]?t[e]++:t[e]=1}function Xq(t,e){--t[e]||delete t[e]}function Cf(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}return r+Gq+s+Gq+(X.isUndefined(i)?dre:i)}function pre(t,e,n,i){var r=""+e,s=""+n;if(!t&&r>s){var o=r;r=s,s=o}var l={v:r,w:s};return i&&(l.name=i),l}function vx(t,e){return Cf(t,e.v,e.w,e.name)}});var Jq=x((obe,Zq)=>{"use strict";Zq.exports="2.1.8"});var t4=x((lbe,e4)=>{"use strict";e4.exports={Graph:jm(),version:Jq()}});var i4=x((abe,n4)=>{"use strict";var Gi=An(),mre=jm();n4.exports={write:gre,read:vre};function gre(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:yre(t),edges:bre(t)};return Gi.isUndefined(t.graph())||(e.value=Gi.clone(t.graph())),e}function yre(t){return Gi.map(t.nodes(),function(e){var n=t.node(e),i=t.parent(e),r={v:e};return Gi.isUndefined(n)||(r.value=n),Gi.isUndefined(i)||(r.parent=i),r})}function bre(t){return Gi.map(t.edges(),function(e){var n=t.edge(e),i={v:e.v,w:e.w};return Gi.isUndefined(e.name)||(i.name=e.name),Gi.isUndefined(n)||(i.value=n),i})}function vre(t){var e=new mre(t.options).setGraph(t.value);return Gi.each(t.nodes,function(n){e.setNode(n.v,n.value),n.parent&&e.setParent(n.v,n.parent)}),Gi.each(t.edges,function(n){e.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),e}});var s4=x((cbe,r4)=>{"use strict";var Vm=An();r4.exports=Sre;function Sre(t){var e={},n=[],i;function r(s){Vm.has(e,s)||(e[s]=!0,i.push(s),Vm.each(t.successors(s),r),Vm.each(t.predecessors(s),r))}return Vm.each(t.nodes(),function(s){i=[],r(s),i.length&&n.push(i)}),n}});var Sx=x((ube,l4)=>{"use strict";var o4=An();l4.exports=Gn;function Gn(){this._arr=[],this._keyIndices={}}Gn.prototype.size=function(){return this._arr.length};Gn.prototype.keys=function(){return this._arr.map(function(t){return t.key})};Gn.prototype.has=function(t){return o4.has(this._keyIndices,t)};Gn.prototype.priority=function(t){var e=this._keyIndices[t];if(e!==void 0)return this._arr[e].priority};Gn.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key};Gn.prototype.add=function(t,e){var n=this._keyIndices;if(t=String(t),!o4.has(n,t)){var i=this._arr,r=i.length;return n[t]=r,i.push({key:t,priority:e}),this._decrease(r),!0}return!1};Gn.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key};Gn.prototype.decrease=function(t,e){var n=this._keyIndices[t];if(e>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[n].priority+" New: "+e);this._arr[n].priority=e,this._decrease(n)};Gn.prototype._heapify=function(t){var e=this._arr,n=2*t,i=n+1,r=t;n<e.length&&(r=e[n].priority<e[r].priority?n:r,i<e.length&&(r=e[i].priority<e[r].priority?i:r),r!==t&&(this._swap(t,r),this._heapify(r)))};Gn.prototype._decrease=function(t){for(var e=this._arr,n=e[t].priority,i;t!==0&&(i=t>>1,!(e[i].priority<n));)this._swap(t,i),t=i};Gn.prototype._swap=function(t,e){var n=this._arr,i=this._keyIndices,r=n[t],s=n[e];n[t]=s,n[e]=r,i[s.key]=t,i[r.key]=e}});var xx=x((fbe,a4)=>{"use strict";var xre=An(),wre=Sx();a4.exports=Are;var kre=xre.constant(1);function Are(t,e,n,i){return Ore(t,String(e),n||kre,i||function(r){return t.outEdges(r)})}function Ore(t,e,n,i){var r={},s=new wre,o,l,a=function(c){var u=c.v!==o?c.v:c.w,f=r[u],h=n(c),d=l.distance+h;if(h<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+c+" Weight: "+h);d<f.distance&&(f.distance=d,f.predecessor=o,s.decrease(u,d))};for(t.nodes().forEach(function(c){var u=c===e?0:Number.POSITIVE_INFINITY;r[c]={distance:u},s.add(c,u)});s.size()>0&&(o=s.removeMin(),l=r[o],l.distance!==Number.POSITIVE_INFINITY);)i(o).forEach(a);return r}});var u4=x((hbe,c4)=>{"use strict";var Tre=xx(),Cre=An();c4.exports=Ere;function Ere(t,e,n){return Cre.transform(t.nodes(),function(i,r){i[r]=Tre(t,r,e,n)},{})}});var wx=x((dbe,h4)=>{"use strict";var f4=An();h4.exports=Dre;function Dre(t){var e=0,n=[],i={},r=[];function s(o){var l=i[o]={onStack:!0,lowlink:e,index:e++};if(n.push(o),t.successors(o).forEach(function(u){f4.has(i,u)?i[u].onStack&&(l.lowlink=Math.min(l.lowlink,i[u].index)):(s(u),l.lowlink=Math.min(l.lowlink,i[u].lowlink))}),l.lowlink===l.index){var a=[],c;do c=n.pop(),i[c].onStack=!1,a.push(c);while(o!==c);r.push(a)}}return t.nodes().forEach(function(o){f4.has(i,o)||s(o)}),r}});var p4=x((pbe,d4)=>{"use strict";var Mre=An(),Rre=wx();d4.exports=Nre;function Nre(t){return Mre.filter(Rre(t),function(e){return e.length>1||e.length===1&&t.hasEdge(e[0],e[0])})}});var g4=x((mbe,m4)=>{"use strict";var _re=An();m4.exports=Ire;var Lre=_re.constant(1);function Ire(t,e,n){return Bre(t,e||Lre,n||function(i){return t.outEdges(i)})}function Bre(t,e,n){var i={},r=t.nodes();return r.forEach(function(s){i[s]={},i[s][s]={distance:0},r.forEach(function(o){s!==o&&(i[s][o]={distance:Number.POSITIVE_INFINITY})}),n(s).forEach(function(o){var l=o.v===s?o.w:o.v,a=e(o);i[s][l]={distance:a,predecessor:s}})}),r.forEach(function(s){var o=i[s];r.forEach(function(l){var a=i[l];r.forEach(function(c){var u=a[s],f=o[c],h=a[c],d=u.distance+f.distance;d<h.distance&&(h.distance=d,h.predecessor=f.predecessor)})})}),i}});var kx=x((gbe,b4)=>{"use strict";var Ef=An();b4.exports=y4;y4.CycleException=$m;function y4(t){var e={},n={},i=[];function r(s){if(Ef.has(n,s))throw new $m;Ef.has(e,s)||(n[s]=!0,e[s]=!0,Ef.each(t.predecessors(s),r),delete n[s],i.push(s))}if(Ef.each(t.sinks(),r),Ef.size(e)!==t.nodeCount())throw new $m;return i}function $m(){}$m.prototype=new Error});var x4=x((ybe,S4)=>{"use strict";var v4=kx();S4.exports=qre;function qre(t){try{v4(t)}catch(e){if(e instanceof v4.CycleException)return!1;throw e}return!0}});var Ax=x((bbe,k4)=>{"use strict";var Ym=An();k4.exports=Pre;function Pre(t,e,n){Ym.isArray(e)||(e=[e]);var i=(t.isDirected()?t.successors:t.neighbors).bind(t),r=[],s={};return Ym.each(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);w4(t,o,n==="post",s,i,r)}),r}function w4(t,e,n,i,r,s){Ym.has(i,e)||(i[e]=!0,n||s.push(e),Ym.each(r(e),function(o){w4(t,o,n,i,r,s)}),n&&s.push(e))}});var O4=x((vbe,A4)=>{"use strict";var zre=Ax();A4.exports=Hre;function Hre(t,e){return zre(t,e,"post")}});var C4=x((Sbe,T4)=>{"use strict";var Ure=Ax();T4.exports=Fre;function Fre(t,e){return Ure(t,e,"pre")}});var M4=x((xbe,D4)=>{"use strict";var E4=An(),jre=jm(),Vre=Sx();D4.exports=$re;function $re(t,e){var n=new jre,i={},r=new Vre,s;function o(a){var c=a.v===s?a.w:a.v,u=r.priority(c);if(u!==void 0){var f=e(a);f<u&&(i[c]=s,r.decrease(c,f))}}if(t.nodeCount()===0)return n;E4.each(t.nodes(),function(a){r.add(a,Number.POSITIVE_INFINITY),n.setNode(a)}),r.decrease(t.nodes()[0],0);for(var l=!1;r.size()>0;){if(s=r.removeMin(),E4.has(i,s))n.setEdge(s,i[s]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(s).forEach(o)}return n}});var N4=x((wbe,R4)=>{"use strict";R4.exports={components:s4(),dijkstra:xx(),dijkstraAll:u4(),findCycles:p4(),floydWarshall:g4(),isAcyclic:x4(),postorder:O4(),preorder:C4(),prim:M4(),tarjan:wx(),topsort:kx()}});var I4=x((kbe,L4)=>{"use strict";var _4=t4();L4.exports={Graph:_4.Graph,json:i4(),alg:N4(),version:_4.version}});var Jre={};K4(Jre,{FullIntegratedDemo:()=>Zre,mountIntegratedDemo:()=>P4});var On=be(Cn()),Ox=be(uT());var St=be(Cn());var P=be(rt());function pT(t,e){let n=t.getAtoms(),i=new Set(n.map(o=>o.id)),r=1,s=`${e}-${r}`;for(;i.has(s);)r++,s=`${e}-${r}`;return s}var I0=({instance:t,onChange:e,disabled:n=!1,className:i=""})=>{let[r,s]=(0,St.useState)({id:"",label:"",type:"Entity"}),o=pT(t,r.type.trim()||"Entity"),[l,a]=(0,St.useState)({name:"",atomIds:["",""]}),[c,u]=(0,St.useState)(""),f=t.getAtoms(),h=t.getRelations(),d=(0,St.useCallback)(()=>{e&&e(t)},[t,e]),m=(0,St.useCallback)(T=>{if(T.preventDefault(),!r.label.trim()){u("Atom label is required");return}let R=r.type.trim()||"Entity",C=r.id.trim()||pT(t,R);if(!C){u("Atom ID could not be generated");return}if(t.getAtoms().some(V=>V.id===C)){u("Atom ID already exists");return}try{let V={id:C,label:r.label.trim(),type:R};t.addAtom(V),s({id:"",label:"",type:"Entity"}),u(""),d()}catch(V){u(V instanceof Error?V.message:"Failed to add atom")}},[r,t,d]),g=(0,St.useCallback)(T=>{try{t.removeAtom(T),u(""),d()}catch(R){u(R instanceof Error?R.message:"Failed to remove atom")}},[t,d]),b=(0,St.useCallback)(()=>{a(T=>({...T,atomIds:[...T.atomIds,""]}))},[]),p=(0,St.useCallback)(()=>{a(T=>({...T,atomIds:T.atomIds.length>2?T.atomIds.slice(0,-1):T.atomIds}))},[]),y=(0,St.useCallback)((T,R)=>{a(C=>({...C,atomIds:C.atomIds.map((V,$)=>$===T?R:V)}))},[]),v=(0,St.useCallback)(T=>{if(T.preventDefault(),!l.name.trim()){u("Relation name is required");return}let R=l.atomIds.map(C=>C.trim()).filter(C=>C!=="");if(R.length<2){u("At least 2 atoms are required for a relation");return}if(R.length!==l.atomIds.length){u("All atom positions must be selected");return}try{let C={atoms:R,types:R.map(()=>"unknown")};t.addRelationTuple(l.name.trim(),C),a({name:"",atomIds:["",""]}),u(""),d()}catch(C){u(C instanceof Error?C.message:"Failed to add relation")}},[l,t,d]),S=(0,St.useCallback)((T,R)=>{try{t.removeRelationTuple(T,R),u(""),d()}catch(C){u(C instanceof Error?C.message:"Failed to remove relation")}},[t,d]),w=(0,St.useCallback)(()=>{try{t.getAtoms().map(C=>C.id).forEach(C=>t.removeAtom(C)),t.getRelations().map(C=>C.id).forEach(C=>{let V=t.getRelations().find($=>$.id===C);V&&V.tuples.forEach($=>t.removeRelationTuple(C,$))}),u(""),d()}catch(T){u(T instanceof Error?T.message:"Failed to clear instance")}},[t,d]),[O,k]=(0,St.useState)(null),A=(0,St.useCallback)(()=>{if(console.log("Instance in handleReify:",t),console.log("typeof instance.reify:",typeof t.reify),typeof t.reify=="function")try{let T=t.reify();k(T)}catch(T){k("Re-ify failed: "+(T instanceof Error?T.message:String(T)))}else k("Re-ify not supported on this instance.")},[t]),M=(0,St.useCallback)(T=>T.atoms.length===2?`${T.atoms[0]} \u2192 ${T.atoms[1]}`:`(${T.atoms.join(", ")})`,[]);return(0,P.jsxs)("div",{className:`instance-builder ${i}`,children:[(0,P.jsxs)("div",{className:"instance-builder__header",children:[(0,P.jsx)("h2",{children:"Instance Builder"}),(0,P.jsxs)("div",{className:"instance-builder__stats",children:[(0,P.jsxs)("span",{children:[f.length," atoms"]}),(0,P.jsxs)("span",{children:[h.reduce((T,R)=>T+R.tuples.length,0)," relations"]})]})]}),c&&(0,P.jsxs)("div",{className:"instance-builder__error",children:[c,(0,P.jsx)("button",{type:"button",onClick:()=>u(""),"aria-label":"Clear error",children:"\xD7"})]}),(0,P.jsxs)("div",{className:"instance-builder__content",children:[(0,P.jsxs)("section",{className:"instance-builder__section",children:[(0,P.jsx)("h3",{children:"Atoms"}),(0,P.jsxs)("form",{onSubmit:m,className:"instance-builder__form",children:[(0,P.jsxs)("div",{className:"form-row",children:[(0,P.jsx)("input",{type:"text",placeholder:`ID (suggested: ${o})`,value:r.id,onChange:T=>s(R=>({...R,id:T.target.value})),disabled:n,"aria-label":"Atom ID"}),(0,P.jsx)("input",{type:"text",placeholder:"Label",value:r.label,onChange:T=>s(R=>({...R,label:T.target.value})),disabled:n,required:!0}),(0,P.jsx)("input",{type:"text",placeholder:"Type",value:r.type,onChange:T=>s(R=>({...R,type:T.target.value})),disabled:n}),(0,P.jsx)("button",{type:"submit",disabled:n,children:"Add Atom"})]}),r.id===""&&(0,P.jsxs)("div",{style:{fontSize:"0.85em",color:"#888",marginTop:2},children:["Suggested ID: ",(0,P.jsx)("code",{children:o})]})]}),(0,P.jsx)("div",{className:"instance-builder__list",children:f.length===0?(0,P.jsx)("p",{className:"empty-state",children:"No atoms yet. Add one above."}):f.map(T=>(0,P.jsxs)("div",{className:"list-item",children:[(0,P.jsxs)("div",{className:"item-info",children:[(0,P.jsx)("strong",{children:T.id}),(0,P.jsx)("span",{className:"item-label",children:T.label}),(0,P.jsx)("span",{className:"item-type",children:T.type})]}),(0,P.jsx)("button",{type:"button",onClick:()=>g(T.id),disabled:n,className:"remove-button","aria-label":`Remove atom ${T.id}`,children:"Remove"})]},T.id))})]}),(0,P.jsxs)("section",{className:"instance-builder__section",children:[(0,P.jsx)("h3",{children:"Relations (N-ary Support)"}),(0,P.jsxs)("form",{onSubmit:v,className:"instance-builder__form",children:[(0,P.jsx)("div",{className:"form-row",children:(0,P.jsx)("input",{type:"text",placeholder:"Relation Name",value:l.name,onChange:T=>a(R=>({...R,name:T.target.value})),disabled:n,required:!0})}),(0,P.jsxs)("div",{className:"relation-atoms",children:[(0,P.jsxs)("div",{style:{fontSize:"0.9em",color:"#666",marginBottom:8},children:["Atoms (arity: ",l.atomIds.length,"):"]}),l.atomIds.map((T,R)=>(0,P.jsxs)("div",{className:"atom-selector",children:[(0,P.jsxs)("label",{style:{fontSize:"0.85em",color:"#666"},children:["Position ",R+1,":"]}),(0,P.jsxs)("select",{value:T,onChange:C=>y(R,C.target.value),disabled:n,required:!0,children:[(0,P.jsx)("option",{value:"",children:"Select Atom"}),f.map(C=>(0,P.jsxs)("option",{value:C.id,children:[C.id," (",C.label,")"]},C.id))]})]},R)),(0,P.jsxs)("div",{className:"arity-controls",style:{marginTop:8},children:[(0,P.jsx)("button",{type:"button",onClick:b,disabled:n,style:{marginRight:8},children:"+ Add Position"}),l.atomIds.length>2&&(0,P.jsx)("button",{type:"button",onClick:p,disabled:n,children:"- Remove Position"})]})]}),(0,P.jsx)("div",{className:"form-row",style:{marginTop:12},children:(0,P.jsx)("button",{type:"submit",disabled:n||l.atomIds.some(T=>!T.trim()),children:"Add Relation"})})]}),(0,P.jsx)("div",{className:"instance-builder__list",children:h.length===0?(0,P.jsx)("p",{className:"empty-state",children:"No relations yet. Add one above."}):h.map(T=>(0,P.jsxs)("div",{className:"relation-group",children:[(0,P.jsx)("h4",{children:T.name}),T.tuples.map((R,C)=>(0,P.jsxs)("div",{className:"list-item",children:[(0,P.jsxs)("div",{className:"item-info",children:[(0,P.jsx)("span",{children:M(R)}),(0,P.jsxs)("span",{className:"item-type",style:{fontSize:"0.8em",color:"#666"},children:["arity: ",R.atoms.length]})]}),(0,P.jsx)("button",{type:"button",onClick:()=>S(T.id,R),disabled:n,className:"remove-button","aria-label":`Remove relation ${T.name} tuple`,children:"Remove"})]},C))]},T.id))})]}),(0,P.jsxs)("section",{className:"instance-builder__actions",children:[(0,P.jsx)("button",{type:"button",onClick:w,disabled:n,className:"clear-button",children:"Clear All"}),(0,P.jsx)("button",{type:"button",onClick:A,disabled:n,className:"reify-button",style:{marginLeft:8},children:"Re-ify"})]}),O!==null&&(0,P.jsxs)("section",{className:"instance-builder__reify-result",style:{marginTop:12,background:"#f8f8f8",border:"1px solid #eee",borderRadius:4,padding:10},children:[(0,P.jsx)("strong",{children:"Re-ify Result:"}),(0,P.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",margin:0},children:typeof O=="string"?O:JSON.stringify(O,null,2)})]})]})]})};var sf=be(Cn());var yT="#000000";function ss(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function K(t){return t==null?"":String(t)}function mT(t){return Array.isArray(t)?t.map(e=>K(e)).filter(e=>e.length>0):t==null||t===""?[]:[K(t)]}function od(t){return t==null||t===""}function B0(t,e,n="error"){return{severity:n,message:e,fieldKey:t,source:"structure"}}var bT=["above","below","left","right","directlyAbove","directlyBelow","directlyLeft","directlyRight"],vT=["clockwise","counterclockwise"],ST=["horizontal","vertical"],q0=["solid","dashed","dotted"],Uz=["small","normal","large"],jc=[{key:"size",kind:"enum",options:Uz,label:"Size"},{key:"color",kind:"color",label:"Color"}],Fz=["none","togroup","fromgroup"];function gT(t){return t&&typeof t=="object"&&(t=t.points),t===!0||t==="togroup"?"togroup":t==="fromgroup"?"fromgroup":"none"}var jz=["hideDisconnected","hideDisconnectedBuiltIns"],Vz={kind:"constraint",type:"orientation",label:"Orientation",description:"Specify the relative positioning of elements.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary",placeholder:"e.g. parent",help:"Binary selector; orientation applies from the source end to the target end of each tuple."},{key:"directions",kind:"enum",label:"Directions",required:!0,multiple:!0,options:bT,help:"Where the target sits relative to the source."}],summary(t){let e=mT(t.directions),n=K(t.selector),i=e.length>0?e.join(", "):"no directions";return n?`target ${i} of source \xB7 ${n}`:`target ${i} of source`},validate(t){let e=[],n=mT(t.directions),i=r=>n.includes(r);return i("above")&&i("below")&&e.push(B0("directions","Cannot be both above and below.")),i("left")&&i("right")&&e.push(B0("directions","Cannot be both left and right.")),e}},$z={kind:"constraint",type:"cyclic",label:"Cyclic",description:"Arrange elements along the perimeter of a circle.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",options:vT,default:"clockwise"}],summary(t){let e=K(t.direction)||"clockwise",n=K(t.selector);return n?`${e} \xB7 ${n}`:e}},Yz={kind:"constraint",type:"align",label:"Align",description:"Ensure elements are aligned horizontally or vertically.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"direction",kind:"enum",label:"Direction",required:!0,options:ST,default:"horizontal"}],summary(t){let e=K(t.direction)||"horizontal",n=K(t.selector);return n?`${e} \xB7 ${n}`:e}},Kz={kind:"constraint",type:"groupselector",label:"Group (by selector)",description:"Group elements based on a selector.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"binary"},{key:"name",kind:"text",label:"Group name",placeholder:"e.g. cluster"},{key:"addEdge",kind:"enum",label:"Add edge",options:Fz,default:"none",help:'Draw an edge between the group key and the group: "togroup" points key \u2192 group, "fromgroup" points group \u2192 key, "none" draws nothing. (To style that connector, author addEdge as a block \u2014 { points, lineStyle, textStyle } \u2014 in YAML.)'},{key:"textStyle",kind:"group",label:"Label text style",children:[{key:"color",kind:"color",label:"Color"}]}],summary(t){let e=K(t.selector),n=K(t.name),i=n?`group "${n}"`:"group";return e?`${i} \xB7 ${e}`:i},toYamlNode(t){let e={selector:K(t.selector)};od(t.name)||(e.name=K(t.name));let n=gT(t.addEdge);if(n!=="none"&&(e.addEdge=n),ss(t.textStyle)){let i={};for(let[r,s]of Object.entries(t.textStyle))s!=null&&s!==""&&(i[r]=s);Object.keys(i).length>0&&(e.textStyle=i)}return t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!ss(t))return null;let e=t.group;if(!ss(e)||e.field!==void 0)return null;let n={selector:K(e.selector),addEdge:gT(e.addEdge)};return e.name!==void 0&&(n.name=K(e.name)),ss(e.textStyle)&&(n.textStyle={...e.textStyle}),e.hold!==void 0&&(n.hold=e.hold),n}},Gz={kind:"constraint",type:"groupfield",label:"Group (by field)",description:"Group elements based on a field. Deprecated \u2014 prefer Group (by selector).",deprecated:!0,deprecatedInFavorOf:"groupselector",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"groupOn",kind:"number",label:"Group on (index)",required:!0,default:0},{key:"addToGroup",kind:"number",label:"Add to group (index)",required:!0,default:1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=K(t.field),n=e?`group on "${e}"`:"group on field",i=K(t.selector);return i?`${n} \xB7 ${i}`:n},toYamlNode(t){let e={field:K(t.field),groupOn:typeof t.groupOn=="number"?t.groupOn:Number(t.groupOn??0),addToGroup:typeof t.addToGroup=="number"?t.addToGroup:Number(t.addToGroup??1)};return od(t.selector)||(e.selector=K(t.selector)),t.hold!==void 0&&(e.hold=t.hold),{group:e}},fromYamlNode(t){if(!ss(t))return null;let e=t.group;if(!ss(e)||e.field===void 0)return null;let n={field:K(e.field),groupOn:typeof e.groupOn=="number"?e.groupOn:Number(e.groupOn??0),addToGroup:typeof e.addToGroup=="number"?e.addToGroup:Number(e.addToGroup??1)};return e.selector!==void 0&&(n.selector=K(e.selector)),e.hold!==void 0&&(n.hold=e.hold),n}},Qz={kind:"constraint",type:"size",label:"Size",description:"Set the width and height of elements matching the selector.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"width",kind:"number",label:"Width",required:!0,default:100},{key:"height",kind:"number",label:"Height",required:!0,default:60}],summary(t){let e=od(t.width)?"?":K(t.width),n=od(t.height)?"?":K(t.height),i=K(t.selector);return i?`${e}\xD7${n} \xB7 ${i}`:`${e}\xD7${n}`},validate(t){let e=[];for(let n of["width","height"]){let i=t[n];typeof i=="number"&&(Number.isNaN(i)||i<=0)&&e.push(B0(n,`${n} must be greater than 0.`))}return e}},Xz={kind:"constraint",type:"hideAtom",label:"Hide atom",description:"Hide elements matching the selector from the visualization.",fields:[{key:"selector",kind:"selector",label:"Selector",required:!0,selectorArity:"unary"}],summary(t){let e=K(t.selector);return e?`hide \xB7 ${e}`:"hide"}},Wz={kind:"directive",type:"flag",label:"Flag",description:"Toggle a built-in rendering flag, e.g. hideDisconnectedBuiltIns.",fields:[{key:"flag",kind:"enum",options:jz,label:"Flag",required:!0,default:"hideDisconnected",help:"hideDisconnected hides disconnected atoms; hideDisconnectedBuiltIns hides only disconnected built-in atoms."}],summary(t){return K(t.flag)||"(no flag)"},toYamlNode(t){return{flag:K(t.flag)}},fromYamlNode(t){if(!ss(t))return null;let e=t.flag;return typeof e=="string"?{flag:e}:ss(e)&&typeof e.flag=="string"?{flag:e.flag}:null}},Zz={kind:"directive",type:"attribute",label:"Attribute",description:"Render a field as an inline attribute on its source atom.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 apply only to matching (source, target) tuples."},{key:"textStyle",kind:"group",label:"Text style",children:jc}],summary(t){let e=K(t.field),n=K(t.selector),i=e||"(no field)";return n?`${i} \xB7 ${n}`:i}},Jz={kind:"directive",type:"hideField",label:"Hide field",description:"Hide a relation/field from the visualization.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary",help:"Optional n-ary selector \u2014 hide only matching (source, target) tuples."}],summary(t){let e=K(t.field),n=K(t.selector),i=e?`hide ${e}`:"hide field";return n?`${i} \xB7 ${n}`:i}},e6={kind:"directive",type:"icon",label:"Icon",description:"Render matching atoms with an icon.",fields:[{key:"path",kind:"text",label:"Path / URL",required:!0,placeholder:"e.g. https://\u2026 or assets/foo.svg"},{key:"showLabels",kind:"boolean",label:"Show labels",default:!1},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=K(t.path),n=K(t.selector),i=e||"(no path)";return n?`${i} \xB7 ${n}`:i}},t6={kind:"directive",type:"atomColor",label:"Atom color",description:"Deprecated \u2014 use Atom style (atomStyle). Still parsed/rendered for back-compat (value \u2192 border color).",deprecated:!0,deprecatedInFavorOf:"atomStyle",fields:[{key:"value",kind:"color",label:"Color",required:!0,default:yT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"}],summary(t){let e=K(t.value),n=K(t.selector),i=e||"(no color)";return n?`${i} \xB7 ${n}`:i}},xT=[{key:"color",kind:"color",label:"Color"},{key:"pattern",kind:"enum",options:q0,label:"Pattern"},{key:"weight",kind:"number",label:"Weight"},{key:"highlight",kind:"color",label:"Highlight"}],n6=[{key:"color",kind:"color",label:"Color"}],i6=[{key:"color",kind:"color",label:"Color"},{key:"width",kind:"number",label:"Width"}],r6={kind:"directive",type:"edgeStyle",label:"Edge style",description:"Style the edges of a field/relation \u2014 line and label.",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"filter",kind:"selector",label:"Filter",selectorArity:"binary"},{key:"lineStyle",kind:"group",label:"Line style",children:xT},{key:"textStyle",kind:"group",label:"Text style",children:jc},{key:"showLabel",kind:"boolean",label:"Show label"},{key:"hidden",kind:"boolean",label:"Hidden"}],summary(t){let e=K(t.field),n=t.lineStyle??{},i=K(n.color),r=e?i?`${e}: ${i}`:e:i||"edge",s=K(t.selector);return s?`${r} \xB7 ${s}`:r}},s6={kind:"directive",type:"atomStyle",label:"Atom style",description:"Style matching atoms \u2014 fill, border, and label.",fields:[{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"fillStyle",kind:"group",label:"Fill style",children:n6},{key:"borderStyle",kind:"group",label:"Border style",children:i6},{key:"textStyle",kind:"group",label:"Text style",children:jc}],summary(t){let e=t.fillStyle??{},n=t.borderStyle??{},i=K(e.color)||K(n.color),r=K(t.selector),s=i||"atom";return r?`${s} \xB7 ${r}`:s}},o6={kind:"directive",type:"edgeColor",label:"Edge color",description:"Deprecated \u2014 use Edge style (edgeStyle). Still parsed/rendered for back-compat.",deprecated:!0,deprecatedInFavorOf:"edgeStyle",fields:[{key:"field",kind:"relationName",label:"Field",required:!0},{key:"value",kind:"color",label:"Color",required:!0,default:yT},{key:"selector",kind:"selector",label:"Selector",selectorArity:"unary"},{key:"style",kind:"enum",label:"Style",options:q0},{key:"weight",kind:"number",label:"Weight"}],summary(t){let e=K(t.field),n=K(t.value),i=e?`${e}: ${n||"edge"}`:n||"edge",r=K(t.selector);return r?`${i} \xB7 ${r}`:i}},l6={kind:"directive",type:"inferredEdge",label:"Inferred edge",description:"Draw an inferred edge from a selector \u2014 line and label.",fields:[{key:"name",kind:"text",label:"Name",required:!0},{key:"selector",kind:"selector",label:"Selector",selectorArity:"binary"},{key:"draw",kind:"text",label:"Draw",help:"Endpoint interpretation: '<end> -> <end>', each end '_' (the atom itself) or a group constraint name (attach to that group's hull \u2014 a keyed group picks by the end's atom; a unary group is a single group and attaches directly). E.g. 'regions -> regions' or '_ -> regions'."},{key:"lineStyle",kind:"group",label:"Line style",children:xT},{key:"textStyle",kind:"group",label:"Text style",children:jc}],summary(t){let e=K(t.name),n=K(t.selector),i=t.lineStyle??{},r=K(i.color),s=e||"(no name)",o=r?`${s}: ${r}`:s;return n?`${o} \xB7 ${n}`:o}},a6={kind:"directive",type:"tag",label:"Tag",description:"Add computed attributes to nodes based on selector evaluation.",fields:[{key:"toTag",kind:"selector",label:"To tag (selector)",required:!0,selectorArity:"unary",help:"Selects which atoms get the tag."},{key:"name",kind:"text",label:"Name",required:!0,help:"The attribute name to display."},{key:"value",kind:"selector",label:"Value (selector)",required:!0,help:"Selector whose result becomes the attribute value."},{key:"textStyle",kind:"group",label:"Text style",children:jc}],summary(t){let e=K(t.name),n=K(t.toTag),i=e||"(no name)";return n?`${i} \xB7 ${n}`:i}},P0=[Vz,$z,Yz,Kz,Gz,Qz,Xz,Wz,Zz,Jz,e6,s6,t6,r6,o6,l6,a6],wT=new Map(P0.map(t=>[t.type,t])),c6={groupselector:"group",groupfield:"group"};function u6(t){return c6[t]??t}var z0=(()=>{let t=new Map;for(let e of P0){let n=u6(e.type),i=t.get(n);i?i.push(e):t.set(n,[e])}return t})();function H0(t){return z0.get(t)??[]}function ld(t){return z0.has(t)}function ad(t){let e=[];for(let[n,i]of z0)(!t||i.some(r=>r.kind===t))&&e.push(n);return e}function zt(t){return wT.get(t)}function U0(t,e={}){let n=e.includeDeprecated??!1;return P0.filter(i=>i.kind===t&&(n||!i.deprecated))}function F0(t){let e=wT.get(t);if(!e)return{};let n={};for(let i of e.fields)i.default!==void 0&&(n[i.key]=i.default);return n}function PT(t){return typeof t>"u"||t===null}function f6(t){return typeof t=="object"&&t!==null}function h6(t){return Array.isArray(t)?t:PT(t)?[]:[t]}function d6(t,e){var n,i,r,s;if(e)for(s=Object.keys(e),n=0,i=s.length;n<i;n+=1)r=s[n],t[r]=e[r];return t}function p6(t,e){var n="",i;for(i=0;i<e;i+=1)n+=t;return n}function m6(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var g6=PT,y6=f6,b6=h6,v6=p6,S6=m6,x6=d6,st={isNothing:g6,isObject:y6,toArray:b6,repeat:v6,isNegativeZero:S6,extend:x6};function zT(t,e){var n="",i=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(n+='in "'+t.mark.name+'" '),n+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(n+=`
|
|
10
10
|
|
|
11
|
-
`+t.mark.snippet),i+" "+n):i}function
|
|
12
|
-
`+l;for(c=
|
|
13
|
-
`,l+=
|
|
14
|
-
`,a=1;a<=e.linesAfter&&!(o+a>=r.length);a++)c=
|
|
15
|
-
`;return l.replace(/\n$/,"")}var
|
|
16
|
-
\r`;function
|
|
17
|
-
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function
|
|
18
|
-
`,e-1))}function
|
|
19
|
-
`,s?1+a:a):r
|
|
20
|
-
`);break}for(i?
|
|
21
|
-
`,s?1+a:a)):c?(c=!1,t.result+=
|
|
22
|
-
`,a+1)):a===0?s&&(t.result+=" "):t.result+=
|
|
23
|
-
`,a):t.result+=
|
|
24
|
-
`,s?1+a:a),s=!0,o=!0,a=0,n=t.position;!
|
|
25
|
-
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new
|
|
11
|
+
`+t.mark.snippet),i+" "+n):i}function $c(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=zT(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}$c.prototype=Object.create(Error.prototype);$c.prototype.constructor=$c;$c.prototype.toString=function(e){return this.name+": "+zT(this,e)};var Ht=$c;function j0(t,e,n,i,r){var s="",o="",l=Math.floor(r/2)-1;return i-e>l&&(s=" ... ",e=i-l+s.length),n-i>l&&(o=" ...",n=i+l-o.length),{str:s+t.slice(e,n).replace(/\t/g,"\u2192")+o,pos:i-e+s.length}}function V0(t,e){return st.repeat(" ",e-t.length)+t}function w6(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var n=/\r?\n|\r|\0/g,i=[0],r=[],s,o=-1;s=n.exec(t.buffer);)r.push(s.index),i.push(s.index+s[0].length),t.position<=s.index&&o<0&&(o=i.length-2);o<0&&(o=i.length-1);var l="",a,c,u=Math.min(t.line+e.linesAfter,r.length).toString().length,f=e.maxLength-(e.indent+u+3);for(a=1;a<=e.linesBefore&&!(o-a<0);a++)c=j0(t.buffer,i[o-a],r[o-a],t.position-(i[o]-i[o-a]),f),l=st.repeat(" ",e.indent)+V0((t.line-a+1).toString(),u)+" | "+c.str+`
|
|
12
|
+
`+l;for(c=j0(t.buffer,i[o],r[o],t.position,f),l+=st.repeat(" ",e.indent)+V0((t.line+1).toString(),u)+" | "+c.str+`
|
|
13
|
+
`,l+=st.repeat("-",e.indent+u+3+c.pos)+`^
|
|
14
|
+
`,a=1;a<=e.linesAfter&&!(o+a>=r.length);a++)c=j0(t.buffer,i[o+a],r[o+a],t.position-(i[o]-i[o+a]),f),l+=st.repeat(" ",e.indent)+V0((t.line+a+1).toString(),u)+" | "+c.str+`
|
|
15
|
+
`;return l.replace(/\n$/,"")}var k6=w6,A6=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],O6=["scalar","sequence","mapping"];function T6(t){var e={};return t!==null&&Object.keys(t).forEach(function(n){t[n].forEach(function(i){e[String(i)]=n})}),e}function C6(t,e){if(e=e||{},Object.keys(e).forEach(function(n){if(A6.indexOf(n)===-1)throw new Ht('Unknown option "'+n+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(n){return n},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=T6(e.styleAliases||null),O6.indexOf(this.kind)===-1)throw new Ht('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var xt=C6;function kT(t,e){var n=[];return t[e].forEach(function(i){var r=n.length;n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&s.multi===i.multi&&(r=o)}),n[r]=i}),n}function E6(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,n;function i(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r}for(e=0,n=arguments.length;e<n;e+=1)arguments[e].forEach(i);return t}function Y0(t){return this.extend(t)}Y0.prototype.extend=function(e){var n=[],i=[];if(e instanceof xt)i.push(e);else if(Array.isArray(e))i=i.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(n=n.concat(e.implicit)),e.explicit&&(i=i.concat(e.explicit));else throw new Ht("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(s){if(!(s instanceof xt))throw new Ht("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Ht("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Ht("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(s){if(!(s instanceof xt))throw new Ht("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(Y0.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(i),r.compiledImplicit=kT(r,"implicit"),r.compiledExplicit=kT(r,"explicit"),r.compiledTypeMap=E6(r.compiledImplicit,r.compiledExplicit),r};var HT=Y0,UT=new xt("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),FT=new xt("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),jT=new xt("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),VT=new HT({explicit:[UT,FT,jT]});function D6(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function M6(){return null}function R6(t){return t===null}var $T=new xt("tag:yaml.org,2002:null",{kind:"scalar",resolve:D6,construct:M6,predicate:R6,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function N6(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function _6(t){return t==="true"||t==="True"||t==="TRUE"}function L6(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var YT=new xt("tag:yaml.org,2002:bool",{kind:"scalar",resolve:N6,construct:_6,predicate:L6,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function I6(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function B6(t){return 48<=t&&t<=55}function q6(t){return 48<=t&&t<=57}function P6(t){if(t===null)return!1;var e=t.length,n=0,i=!1,r;if(!e)return!1;if(r=t[n],(r==="-"||r==="+")&&(r=t[++n]),r==="0"){if(n+1===e)return!0;if(r=t[++n],r==="b"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(r!=="0"&&r!=="1")return!1;i=!0}return i&&r!=="_"}if(r==="x"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!I6(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}if(r==="o"){for(n++;n<e;n++)if(r=t[n],r!=="_"){if(!B6(t.charCodeAt(n)))return!1;i=!0}return i&&r!=="_"}}if(r==="_")return!1;for(;n<e;n++)if(r=t[n],r!=="_"){if(!q6(t.charCodeAt(n)))return!1;i=!0}return!(!i||r==="_")}function z6(t){var e=t,n=1,i;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),i=e[0],(i==="-"||i==="+")&&(i==="-"&&(n=-1),e=e.slice(1),i=e[0]),e==="0")return 0;if(i==="0"){if(e[1]==="b")return n*parseInt(e.slice(2),2);if(e[1]==="x")return n*parseInt(e.slice(2),16);if(e[1]==="o")return n*parseInt(e.slice(2),8)}return n*parseInt(e,10)}function H6(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!st.isNegativeZero(t)}var KT=new xt("tag:yaml.org,2002:int",{kind:"scalar",resolve:P6,construct:z6,predicate:H6,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),U6=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function F6(t){return!(t===null||!U6.test(t)||t[t.length-1]==="_")}function j6(t){var e,n;return e=t.replace(/_/g,"").toLowerCase(),n=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:n*parseFloat(e,10)}var V6=/^[-+]?[0-9]+e/;function $6(t,e){var n;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(st.isNegativeZero(t))return"-0.0";return n=t.toString(10),V6.test(n)?n.replace("e",".e"):n}function Y6(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||st.isNegativeZero(t))}var GT=new xt("tag:yaml.org,2002:float",{kind:"scalar",resolve:F6,construct:j6,predicate:Y6,represent:$6,defaultStyle:"lowercase"}),QT=VT.extend({implicit:[$T,YT,KT,GT]}),XT=QT,WT=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ZT=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function K6(t){return t===null?!1:WT.exec(t)!==null||ZT.exec(t)!==null}function G6(t){var e,n,i,r,s,o,l,a=0,c=null,u,f,h;if(e=WT.exec(t),e===null&&(e=ZT.exec(t)),e===null)throw new Error("Date resolve error");if(n=+e[1],i=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(n,i,r));if(s=+e[4],o=+e[5],l=+e[6],e[7]){for(a=e[7].slice(0,3);a.length<3;)a+="0";a=+a}return e[9]&&(u=+e[10],f=+(e[11]||0),c=(u*60+f)*6e4,e[9]==="-"&&(c=-c)),h=new Date(Date.UTC(n,i,r,s,o,l,a)),c&&h.setTime(h.getTime()-c),h}function Q6(t){return t.toISOString()}var JT=new xt("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:K6,construct:G6,instanceOf:Date,represent:Q6});function X6(t){return t==="<<"||t===null}var eC=new xt("tag:yaml.org,2002:merge",{kind:"scalar",resolve:X6}),W0=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
16
|
+
\r`;function W6(t){if(t===null)return!1;var e,n,i=0,r=t.length,s=W0;for(n=0;n<r;n++)if(e=s.indexOf(t.charAt(n)),!(e>64)){if(e<0)return!1;i+=6}return i%8===0}function Z6(t){var e,n,i=t.replace(/[\r\n=]/g,""),r=i.length,s=W0,o=0,l=[];for(e=0;e<r;e++)e%4===0&&e&&(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)),o=o<<6|s.indexOf(i.charAt(e));return n=r%4*6,n===0?(l.push(o>>16&255),l.push(o>>8&255),l.push(o&255)):n===18?(l.push(o>>10&255),l.push(o>>2&255)):n===12&&l.push(o>>4&255),new Uint8Array(l)}function J6(t){var e="",n=0,i,r,s=t.length,o=W0;for(i=0;i<s;i++)i%3===0&&i&&(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]),n=(n<<8)+t[i];return r=s%3,r===0?(e+=o[n>>18&63],e+=o[n>>12&63],e+=o[n>>6&63],e+=o[n&63]):r===2?(e+=o[n>>10&63],e+=o[n>>4&63],e+=o[n<<2&63],e+=o[64]):r===1&&(e+=o[n>>2&63],e+=o[n<<4&63],e+=o[64],e+=o[64]),e}function e8(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var tC=new xt("tag:yaml.org,2002:binary",{kind:"scalar",resolve:W6,construct:Z6,predicate:e8,represent:J6}),t8=Object.prototype.hasOwnProperty,n8=Object.prototype.toString;function i8(t){if(t===null)return!0;var e=[],n,i,r,s,o,l=t;for(n=0,i=l.length;n<i;n+=1){if(r=l[n],o=!1,n8.call(r)!=="[object Object]")return!1;for(s in r)if(t8.call(r,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function r8(t){return t!==null?t:[]}var nC=new xt("tag:yaml.org,2002:omap",{kind:"sequence",resolve:i8,construct:r8}),s8=Object.prototype.toString;function o8(t){if(t===null)return!0;var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1){if(i=o[e],s8.call(i)!=="[object Object]"||(r=Object.keys(i),r.length!==1))return!1;s[e]=[r[0],i[r[0]]]}return!0}function l8(t){if(t===null)return[];var e,n,i,r,s,o=t;for(s=new Array(o.length),e=0,n=o.length;e<n;e+=1)i=o[e],r=Object.keys(i),s[e]=[r[0],i[r[0]]];return s}var iC=new xt("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:o8,construct:l8}),a8=Object.prototype.hasOwnProperty;function c8(t){if(t===null)return!0;var e,n=t;for(e in n)if(a8.call(n,e)&&n[e]!==null)return!1;return!0}function u8(t){return t!==null?t:{}}var rC=new xt("tag:yaml.org,2002:set",{kind:"mapping",resolve:c8,construct:u8}),Z0=XT.extend({implicit:[JT,eC],explicit:[tC,nC,iC,rC]}),ls=Object.prototype.hasOwnProperty,cd=1,sC=2,oC=3,ud=4,$0=1,f8=2,AT=3,h8=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,d8=/[\x85\u2028\u2029]/,p8=/[,\[\]\{\}]/,lC=/^(?:!|!!|![a-z\-]+!)$/i,aC=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function OT(t){return Object.prototype.toString.call(t)}function Mi(t){return t===10||t===13}function to(t){return t===9||t===32}function en(t){return t===9||t===32||t===10||t===13}function _l(t){return t===44||t===91||t===93||t===123||t===125}function m8(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function g8(t){return t===120?2:t===117?4:t===85?8:0}function y8(t){return 48<=t&&t<=57?t-48:-1}function TT(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
|
|
17
|
+
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function b8(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function cC(t,e,n){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:n}):t[e]=n}var uC=new Array(256),fC=new Array(256);for(eo=0;eo<256;eo++)uC[eo]=TT(eo)?1:0,fC[eo]=TT(eo);var eo;function v8(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Z0,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function hC(t,e){var n={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return n.snippet=k6(n),new Ht(e,n)}function U(t,e){throw hC(t,e)}function fd(t,e){t.onWarning&&t.onWarning.call(null,hC(t,e))}var CT={YAML:function(e,n,i){var r,s,o;e.version!==null&&U(e,"duplication of %YAML directive"),i.length!==1&&U(e,"YAML directive accepts exactly one argument"),r=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),r===null&&U(e,"ill-formed argument of the YAML directive"),s=parseInt(r[1],10),o=parseInt(r[2],10),s!==1&&U(e,"unacceptable YAML version of the document"),e.version=i[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&fd(e,"unsupported YAML version of the document")},TAG:function(e,n,i){var r,s;i.length!==2&&U(e,"TAG directive accepts exactly two arguments"),r=i[0],s=i[1],lC.test(r)||U(e,"ill-formed tag handle (first argument) of the TAG directive"),ls.call(e.tagMap,r)&&U(e,'there is a previously declared suffix for "'+r+'" tag handle'),aC.test(s)||U(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{U(e,"tag prefix is malformed: "+s)}e.tagMap[r]=s}};function os(t,e,n,i){var r,s,o,l;if(e<n){if(l=t.input.slice(e,n),i)for(r=0,s=l.length;r<s;r+=1)o=l.charCodeAt(r),o===9||32<=o&&o<=1114111||U(t,"expected valid JSON character");else h8.test(l)&&U(t,"the stream contains non-printable characters");t.result+=l}}function ET(t,e,n,i){var r,s,o,l;for(st.isObject(n)||U(t,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(n),o=0,l=r.length;o<l;o+=1)s=r[o],ls.call(e,s)||(cC(e,s,n[s]),i[s]=!0)}function Ll(t,e,n,i,r,s,o,l,a){var c,u;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),c=0,u=r.length;c<u;c+=1)Array.isArray(r[c])&&U(t,"nested arrays are not supported inside keys"),typeof r=="object"&&OT(r[c])==="[object Object]"&&(r[c]="[object Object]");if(typeof r=="object"&&OT(r)==="[object Object]"&&(r="[object Object]"),r=String(r),e===null&&(e={}),i==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(c=0,u=s.length;c<u;c+=1)ET(t,e,s[c],n);else ET(t,e,s,n);else!t.json&&!ls.call(n,r)&&ls.call(e,r)&&(t.line=o||t.line,t.lineStart=l||t.lineStart,t.position=a||t.position,U(t,"duplicated mapping key")),cC(e,r,s),delete n[r];return e}function J0(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):U(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Je(t,e,n){for(var i=0,r=t.input.charCodeAt(t.position);r!==0;){for(;to(r);)r===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&r===35)do r=t.input.charCodeAt(++t.position);while(r!==10&&r!==13&&r!==0);if(Mi(r))for(J0(t),r=t.input.charCodeAt(t.position),i++,t.lineIndent=0;r===32;)t.lineIndent++,r=t.input.charCodeAt(++t.position);else break}return n!==-1&&i!==0&&t.lineIndent<n&&fd(t,"deficient indentation"),i}function pd(t){var e=t.position,n;return n=t.input.charCodeAt(e),!!((n===45||n===46)&&n===t.input.charCodeAt(e+1)&&n===t.input.charCodeAt(e+2)&&(e+=3,n=t.input.charCodeAt(e),n===0||en(n)))}function eb(t,e){e===1?t.result+=" ":e>1&&(t.result+=st.repeat(`
|
|
18
|
+
`,e-1))}function S8(t,e,n){var i,r,s,o,l,a,c,u,f=t.kind,h=t.result,d;if(d=t.input.charCodeAt(t.position),en(d)||_l(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=t.input.charCodeAt(t.position+1),en(r)||n&&_l(r)))return!1;for(t.kind="scalar",t.result="",s=o=t.position,l=!1;d!==0;){if(d===58){if(r=t.input.charCodeAt(t.position+1),en(r)||n&&_l(r))break}else if(d===35){if(i=t.input.charCodeAt(t.position-1),en(i))break}else{if(t.position===t.lineStart&&pd(t)||n&&_l(d))break;if(Mi(d))if(a=t.line,c=t.lineStart,u=t.lineIndent,Je(t,!1,-1),t.lineIndent>=e){l=!0,d=t.input.charCodeAt(t.position);continue}else{t.position=o,t.line=a,t.lineStart=c,t.lineIndent=u;break}}l&&(os(t,s,o,!1),eb(t,t.line-a),s=o=t.position,l=!1),to(d)||(o=t.position+1),d=t.input.charCodeAt(++t.position)}return os(t,s,o,!1),t.result?!0:(t.kind=f,t.result=h,!1)}function x8(t,e){var n,i,r;if(n=t.input.charCodeAt(t.position),n!==39)return!1;for(t.kind="scalar",t.result="",t.position++,i=r=t.position;(n=t.input.charCodeAt(t.position))!==0;)if(n===39)if(os(t,i,t.position,!0),n=t.input.charCodeAt(++t.position),n===39)i=t.position,t.position++,r=t.position;else return!0;else Mi(n)?(os(t,i,r,!0),eb(t,Je(t,!1,e)),i=r=t.position):t.position===t.lineStart&&pd(t)?U(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);U(t,"unexpected end of the stream within a single quoted scalar")}function w8(t,e){var n,i,r,s,o,l;if(l=t.input.charCodeAt(t.position),l!==34)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(l=t.input.charCodeAt(t.position))!==0;){if(l===34)return os(t,n,t.position,!0),t.position++,!0;if(l===92){if(os(t,n,t.position,!0),l=t.input.charCodeAt(++t.position),Mi(l))Je(t,!1,e);else if(l<256&&uC[l])t.result+=fC[l],t.position++;else if((o=g8(l))>0){for(r=o,s=0;r>0;r--)l=t.input.charCodeAt(++t.position),(o=m8(l))>=0?s=(s<<4)+o:U(t,"expected hexadecimal character");t.result+=b8(s),t.position++}else U(t,"unknown escape sequence");n=i=t.position}else Mi(l)?(os(t,n,i,!0),eb(t,Je(t,!1,e)),n=i=t.position):t.position===t.lineStart&&pd(t)?U(t,"unexpected end of the document within a double quoted scalar"):(t.position++,i=t.position)}U(t,"unexpected end of the stream within a double quoted scalar")}function k8(t,e){var n=!0,i,r,s,o=t.tag,l,a=t.anchor,c,u,f,h,d,m=Object.create(null),g,b,p,y;if(y=t.input.charCodeAt(t.position),y===91)u=93,d=!1,l=[];else if(y===123)u=125,d=!0,l={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=l),y=t.input.charCodeAt(++t.position);y!==0;){if(Je(t,!0,e),y=t.input.charCodeAt(t.position),y===u)return t.position++,t.tag=o,t.anchor=a,t.kind=d?"mapping":"sequence",t.result=l,!0;n?y===44&&U(t,"expected the node content, but found ','"):U(t,"missed comma between flow collection entries"),b=g=p=null,f=h=!1,y===63&&(c=t.input.charCodeAt(t.position+1),en(c)&&(f=h=!0,t.position++,Je(t,!0,e))),i=t.line,r=t.lineStart,s=t.position,Il(t,e,cd,!1,!0),b=t.tag,g=t.result,Je(t,!0,e),y=t.input.charCodeAt(t.position),(h||t.line===i)&&y===58&&(f=!0,y=t.input.charCodeAt(++t.position),Je(t,!0,e),Il(t,e,cd,!1,!0),p=t.result),d?Ll(t,l,m,b,g,p,i,r,s):f?l.push(Ll(t,null,m,b,g,p,i,r,s)):l.push(g),Je(t,!0,e),y=t.input.charCodeAt(t.position),y===44?(n=!0,y=t.input.charCodeAt(++t.position)):n=!1}U(t,"unexpected end of the stream within a flow collection")}function A8(t,e){var n,i,r=$0,s=!1,o=!1,l=e,a=0,c=!1,u,f;if(f=t.input.charCodeAt(t.position),f===124)i=!1;else if(f===62)i=!0;else return!1;for(t.kind="scalar",t.result="";f!==0;)if(f=t.input.charCodeAt(++t.position),f===43||f===45)$0===r?r=f===43?AT:f8:U(t,"repeat of a chomping mode identifier");else if((u=y8(f))>=0)u===0?U(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?U(t,"repeat of an indentation width identifier"):(l=e+u-1,o=!0);else break;if(to(f)){do f=t.input.charCodeAt(++t.position);while(to(f));if(f===35)do f=t.input.charCodeAt(++t.position);while(!Mi(f)&&f!==0)}for(;f!==0;){for(J0(t),t.lineIndent=0,f=t.input.charCodeAt(t.position);(!o||t.lineIndent<l)&&f===32;)t.lineIndent++,f=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>l&&(l=t.lineIndent),Mi(f)){a++;continue}if(t.lineIndent<l){r===AT?t.result+=st.repeat(`
|
|
19
|
+
`,s?1+a:a):r===$0&&s&&(t.result+=`
|
|
20
|
+
`);break}for(i?to(f)?(c=!0,t.result+=st.repeat(`
|
|
21
|
+
`,s?1+a:a)):c?(c=!1,t.result+=st.repeat(`
|
|
22
|
+
`,a+1)):a===0?s&&(t.result+=" "):t.result+=st.repeat(`
|
|
23
|
+
`,a):t.result+=st.repeat(`
|
|
24
|
+
`,s?1+a:a),s=!0,o=!0,a=0,n=t.position;!Mi(f)&&f!==0;)f=t.input.charCodeAt(++t.position);os(t,n,t.position,!1)}return!0}function DT(t,e){var n,i=t.tag,r=t.anchor,s=[],o,l=!1,a;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),a=t.input.charCodeAt(t.position);a!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,U(t,"tab characters must not be used in indentation")),!(a!==45||(o=t.input.charCodeAt(t.position+1),!en(o))));){if(l=!0,t.position++,Je(t,!0,-1)&&t.lineIndent<=e){s.push(null),a=t.input.charCodeAt(t.position);continue}if(n=t.line,Il(t,e,oC,!1,!0),s.push(t.result),Je(t,!0,-1),a=t.input.charCodeAt(t.position),(t.line===n||t.lineIndent>e)&&a!==0)U(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return l?(t.tag=i,t.anchor=r,t.kind="sequence",t.result=s,!0):!1}function O8(t,e,n){var i,r,s,o,l,a,c=t.tag,u=t.anchor,f={},h=Object.create(null),d=null,m=null,g=null,b=!1,p=!1,y;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=f),y=t.input.charCodeAt(t.position);y!==0;){if(!b&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,U(t,"tab characters must not be used in indentation")),i=t.input.charCodeAt(t.position+1),s=t.line,(y===63||y===58)&&en(i))y===63?(b&&(Ll(t,f,h,d,m,null,o,l,a),d=m=g=null),p=!0,b=!0,r=!0):b?(b=!1,r=!0):U(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,y=i;else{if(o=t.line,l=t.lineStart,a=t.position,!Il(t,n,sC,!1,!0))break;if(t.line===s){for(y=t.input.charCodeAt(t.position);to(y);)y=t.input.charCodeAt(++t.position);if(y===58)y=t.input.charCodeAt(++t.position),en(y)||U(t,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Ll(t,f,h,d,m,null,o,l,a),d=m=g=null),p=!0,b=!1,r=!1,d=t.tag,m=t.result;else if(p)U(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=c,t.anchor=u,!0}else if(p)U(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=c,t.anchor=u,!0}if((t.line===s||t.lineIndent>e)&&(b&&(o=t.line,l=t.lineStart,a=t.position),Il(t,e,ud,!0,r)&&(b?m=t.result:g=t.result),b||(Ll(t,f,h,d,m,g,o,l,a),d=m=g=null),Je(t,!0,-1),y=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&y!==0)U(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return b&&Ll(t,f,h,d,m,null,o,l,a),p&&(t.tag=c,t.anchor=u,t.kind="mapping",t.result=f),p}function T8(t){var e,n=!1,i=!1,r,s,o;if(o=t.input.charCodeAt(t.position),o!==33)return!1;if(t.tag!==null&&U(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(n=!0,o=t.input.charCodeAt(++t.position)):o===33?(i=!0,r="!!",o=t.input.charCodeAt(++t.position)):r="!",e=t.position,n){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(s=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):U(t,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!en(o);)o===33&&(i?U(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),lC.test(r)||U(t,"named tag handle cannot contain such characters"),i=!0,e=t.position+1)),o=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),p8.test(s)&&U(t,"tag suffix cannot contain flow indicator characters")}s&&!aC.test(s)&&U(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{U(t,"tag name is malformed: "+s)}return n?t.tag=s:ls.call(t.tagMap,r)?t.tag=t.tagMap[r]+s:r==="!"?t.tag="!"+s:r==="!!"?t.tag="tag:yaml.org,2002:"+s:U(t,'undeclared tag handle "'+r+'"'),!0}function C8(t){var e,n;if(n=t.input.charCodeAt(t.position),n!==38)return!1;for(t.anchor!==null&&U(t,"duplication of an anchor property"),n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!en(n)&&!_l(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&U(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function E8(t){var e,n,i;if(i=t.input.charCodeAt(t.position),i!==42)return!1;for(i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!en(i)&&!_l(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&U(t,"name of an alias node must contain at least one character"),n=t.input.slice(e,t.position),ls.call(t.anchorMap,n)||U(t,'unidentified alias "'+n+'"'),t.result=t.anchorMap[n],Je(t,!0,-1),!0}function Il(t,e,n,i,r){var s,o,l,a=1,c=!1,u=!1,f,h,d,m,g,b;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=o=l=ud===n||oC===n,i&&Je(t,!0,-1)&&(c=!0,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)),a===1)for(;T8(t)||C8(t);)Je(t,!0,-1)?(c=!0,l=s,t.lineIndent>e?a=1:t.lineIndent===e?a=0:t.lineIndent<e&&(a=-1)):l=!1;if(l&&(l=c||r),(a===1||ud===n)&&(cd===n||sC===n?g=e:g=e+1,b=t.position-t.lineStart,a===1?l&&(DT(t,b)||O8(t,b,g))||k8(t,g)?u=!0:(o&&A8(t,g)||x8(t,g)||w8(t,g)?u=!0:E8(t)?(u=!0,(t.tag!==null||t.anchor!==null)&&U(t,"alias node should not have any properties")):S8(t,g,cd===n)&&(u=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):a===0&&(u=l&&DT(t,b))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&U(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),f=0,h=t.implicitTypes.length;f<h;f+=1)if(m=t.implicitTypes[f],m.resolve(t.result)){t.result=m.construct(t.result),t.tag=m.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(ls.call(t.typeMap[t.kind||"fallback"],t.tag))m=t.typeMap[t.kind||"fallback"][t.tag];else for(m=null,d=t.typeMap.multi[t.kind||"fallback"],f=0,h=d.length;f<h;f+=1)if(t.tag.slice(0,d[f].tag.length)===d[f].tag){m=d[f];break}m||U(t,"unknown tag !<"+t.tag+">"),t.result!==null&&m.kind!==t.kind&&U(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+m.kind+'", not "'+t.kind+'"'),m.resolve(t.result,t.tag)?(t.result=m.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):U(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||u}function D8(t){var e=t.position,n,i,r,s=!1,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(Je(t,!0,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(s=!0,o=t.input.charCodeAt(++t.position),n=t.position;o!==0&&!en(o);)o=t.input.charCodeAt(++t.position);for(i=t.input.slice(n,t.position),r=[],i.length<1&&U(t,"directive name must not be less than one character in length");o!==0;){for(;to(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!Mi(o));break}if(Mi(o))break;for(n=t.position;o!==0&&!en(o);)o=t.input.charCodeAt(++t.position);r.push(t.input.slice(n,t.position))}o!==0&&J0(t),ls.call(CT,i)?CT[i](t,i,r):fd(t,'unknown document directive "'+i+'"')}if(Je(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Je(t,!0,-1)):s&&U(t,"directives end mark is expected"),Il(t,t.lineIndent-1,ud,!1,!0),Je(t,!0,-1),t.checkLineBreaks&&d8.test(t.input.slice(e,t.position))&&fd(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&pd(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Je(t,!0,-1));return}if(t.position<t.length-1)U(t,"end of the stream or a document separator is expected");else return}function dC(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
25
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var n=new v8(t,e),i=t.indexOf("\0");for(i!==-1&&(n.position=i,U(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)D8(n);return n.documents}function M8(t,e,n){e!==null&&typeof e=="object"&&typeof n>"u"&&(n=e,e=null);var i=dC(t,n);if(typeof e!="function")return i;for(var r=0,s=i.length;r<s;r+=1)e(i[r])}function R8(t,e){var n=dC(t,e);if(n.length!==0){if(n.length===1)return n[0];throw new Ht("expected a single document in the stream, but found more")}}var N8=M8,_8=R8,pC={loadAll:N8,load:_8},mC=Object.prototype.toString,gC=Object.prototype.hasOwnProperty,tb=65279,L8=9,Yc=10,I8=13,B8=32,q8=33,P8=34,K0=35,z8=37,H8=38,U8=39,F8=42,yC=44,j8=45,hd=58,V8=61,$8=62,Y8=63,K8=64,bC=91,vC=93,G8=96,SC=123,Q8=124,xC=125,Dt={};Dt[0]="\\0";Dt[7]="\\a";Dt[8]="\\b";Dt[9]="\\t";Dt[10]="\\n";Dt[11]="\\v";Dt[12]="\\f";Dt[13]="\\r";Dt[27]="\\e";Dt[34]='\\"';Dt[92]="\\\\";Dt[133]="\\N";Dt[160]="\\_";Dt[8232]="\\L";Dt[8233]="\\P";var X8=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],W8=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Z8(t,e){var n,i,r,s,o,l,a;if(e===null)return{};for(n={},i=Object.keys(e),r=0,s=i.length;r<s;r+=1)o=i[r],l=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),a=t.compiledTypeMap.fallback[o],a&&gC.call(a.styleAliases,l)&&(l=a.styleAliases[l]),n[o]=l;return n}function J8(t){var e,n,i;if(e=t.toString(16).toUpperCase(),t<=255)n="x",i=2;else if(t<=65535)n="u",i=4;else if(t<=4294967295)n="U",i=8;else throw new Ht("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+st.repeat("0",i-e.length)+e}var e9=1,Kc=2;function t9(t){this.schema=t.schema||Z0,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=st.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=Z8(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Kc:e9,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function MT(t,e){for(var n=st.repeat(" ",e),i=0,r=-1,s="",o,l=t.length;i<l;)r=t.indexOf(`
|
|
26
26
|
`,i),r===-1?(o=t.slice(i),i=l):(o=t.slice(i,r+1),i=r+1),o.length&&o!==`
|
|
27
|
-
`&&(s+=n),s+=o;return s}function
|
|
28
|
-
`+
|
|
27
|
+
`&&(s+=n),s+=o;return s}function G0(t,e){return`
|
|
28
|
+
`+st.repeat(" ",t.indent*e)}function n9(t,e){var n,i,r;for(n=0,i=t.implicitTypes.length;n<i;n+=1)if(r=t.implicitTypes[n],r.resolve(e))return!0;return!1}function dd(t){return t===B8||t===L8}function Gc(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==tb||65536<=t&&t<=1114111}function RT(t){return Gc(t)&&t!==tb&&t!==I8&&t!==Yc}function NT(t,e,n){var i=RT(t),r=i&&!dd(t);return(n?i:i&&t!==yC&&t!==bC&&t!==vC&&t!==SC&&t!==xC)&&t!==K0&&!(e===hd&&!r)||RT(e)&&!dd(e)&&t===K0||e===hd&&r}function i9(t){return Gc(t)&&t!==tb&&!dd(t)&&t!==j8&&t!==Y8&&t!==hd&&t!==yC&&t!==bC&&t!==vC&&t!==SC&&t!==xC&&t!==K0&&t!==H8&&t!==F8&&t!==q8&&t!==Q8&&t!==V8&&t!==$8&&t!==U8&&t!==P8&&t!==z8&&t!==K8&&t!==G8}function r9(t){return!dd(t)&&t!==hd}function Vc(t,e){var n=t.charCodeAt(e),i;return n>=55296&&n<=56319&&e+1<t.length&&(i=t.charCodeAt(e+1),i>=56320&&i<=57343)?(n-55296)*1024+i-56320+65536:n}function wC(t){var e=/^\n* /;return e.test(t)}var kC=1,Q0=2,AC=3,OC=4,Nl=5;function s9(t,e,n,i,r,s,o,l){var a,c=0,u=null,f=!1,h=!1,d=i!==-1,m=-1,g=i9(Vc(t,0))&&r9(Vc(t,t.length-1));if(e||o)for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=Vc(t,a),!Gc(c))return Nl;g=g&&NT(c,u,l),u=c}else{for(a=0;a<t.length;c>=65536?a+=2:a++){if(c=Vc(t,a),c===Yc)f=!0,d&&(h=h||a-m-1>i&&t[m+1]!==" ",m=a);else if(!Gc(c))return Nl;g=g&&NT(c,u,l),u=c}h=h||d&&a-m-1>i&&t[m+1]!==" "}return!f&&!h?g&&!o&&!r(t)?kC:s===Kc?Nl:Q0:n>9&&wC(t)?Nl:o?s===Kc?Nl:Q0:h?OC:AC}function o9(t,e,n,i,r){t.dump=(function(){if(e.length===0)return t.quotingType===Kc?'""':"''";if(!t.noCompatMode&&(X8.indexOf(e)!==-1||W8.test(e)))return t.quotingType===Kc?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,n),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),l=i||t.flowLevel>-1&&n>=t.flowLevel;function a(c){return n9(t,c)}switch(s9(e,l,t.indent,o,a,t.quotingType,t.forceQuotes&&!i,r)){case kC:return e;case Q0:return"'"+e.replace(/'/g,"''")+"'";case AC:return"|"+_T(e,t.indent)+LT(MT(e,s));case OC:return">"+_T(e,t.indent)+LT(MT(l9(e,o),s));case Nl:return'"'+a9(e)+'"';default:throw new Ht("impossible error: invalid scalar style")}})()}function _T(t,e){var n=wC(t)?String(e):"",i=t[t.length-1]===`
|
|
29
29
|
`,r=i&&(t[t.length-2]===`
|
|
30
30
|
`||t===`
|
|
31
31
|
`),s=r?"+":i?"":"-";return n+s+`
|
|
32
|
-
`}function
|
|
33
|
-
`?t.slice(0,-1):t}function
|
|
34
|
-
`);return c=c!==-1?c:t.length,n.lastIndex=c,
|
|
32
|
+
`}function LT(t){return t[t.length-1]===`
|
|
33
|
+
`?t.slice(0,-1):t}function l9(t,e){for(var n=/(\n+)([^\n]*)/g,i=(function(){var c=t.indexOf(`
|
|
34
|
+
`);return c=c!==-1?c:t.length,n.lastIndex=c,IT(t.slice(0,c),e)})(),r=t[0]===`
|
|
35
35
|
`||t[0]===" ",s,o;o=n.exec(t);){var l=o[1],a=o[2];s=a[0]===" ",i+=l+(!r&&!s&&a!==""?`
|
|
36
|
-
`:"")+
|
|
36
|
+
`:"")+IT(a,e),r=s}return i}function IT(t,e){if(t===""||t[0]===" ")return t;for(var n=/ [^ ]/g,i,r=0,s,o=0,l=0,a="";i=n.exec(t);)l=i.index,l-r>e&&(s=o>r?o:l,a+=`
|
|
37
37
|
`+t.slice(r,s),r=s+1),o=l;return a+=`
|
|
38
38
|
`,t.length-r>e&&o>r?a+=t.slice(r,o)+`
|
|
39
|
-
`+t.slice(o+1):a+=t.slice(r),a.slice(1)}function
|
|
40
|
-
`:""}var
|
|
39
|
+
`+t.slice(o+1):a+=t.slice(r),a.slice(1)}function a9(t){for(var e="",n=0,i,r=0;r<t.length;n>=65536?r+=2:r++)n=Vc(t,r),i=Dt[n],!i&&Gc(n)?(e+=t[r],n>=65536&&(e+=t[r+1])):e+=i||J8(n);return e}function c9(t,e,n){var i="",r=t.tag,s,o,l;for(s=0,o=n.length;s<o;s+=1)l=n[s],t.replacer&&(l=t.replacer.call(n,String(s),l)),(mr(t,e,l,!1,!1)||typeof l>"u"&&mr(t,e,null,!1,!1))&&(i!==""&&(i+=","+(t.condenseFlow?"":" ")),i+=t.dump);t.tag=r,t.dump="["+i+"]"}function BT(t,e,n,i){var r="",s=t.tag,o,l,a;for(o=0,l=n.length;o<l;o+=1)a=n[o],t.replacer&&(a=t.replacer.call(n,String(o),a)),(mr(t,e+1,a,!0,!0,!1,!0)||typeof a>"u"&&mr(t,e+1,null,!0,!0,!1,!0))&&((!i||r!=="")&&(r+=G0(t,e)),t.dump&&Yc===t.dump.charCodeAt(0)?r+="-":r+="- ",r+=t.dump);t.tag=s,t.dump=r||"[]"}function u9(t,e,n){var i="",r=t.tag,s=Object.keys(n),o,l,a,c,u;for(o=0,l=s.length;o<l;o+=1)u="",i!==""&&(u+=", "),t.condenseFlow&&(u+='"'),a=s[o],c=n[a],t.replacer&&(c=t.replacer.call(n,a,c)),mr(t,e,a,!1,!1)&&(t.dump.length>1024&&(u+="? "),u+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),mr(t,e,c,!1,!1)&&(u+=t.dump,i+=u));t.tag=r,t.dump="{"+i+"}"}function f9(t,e,n,i){var r="",s=t.tag,o=Object.keys(n),l,a,c,u,f,h;if(t.sortKeys===!0)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new Ht("sortKeys must be a boolean or a function");for(l=0,a=o.length;l<a;l+=1)h="",(!i||r!=="")&&(h+=G0(t,e)),c=o[l],u=n[c],t.replacer&&(u=t.replacer.call(n,c,u)),mr(t,e+1,c,!0,!0,!0)&&(f=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,f&&(t.dump&&Yc===t.dump.charCodeAt(0)?h+="?":h+="? "),h+=t.dump,f&&(h+=G0(t,e)),mr(t,e+1,u,!0,f)&&(t.dump&&Yc===t.dump.charCodeAt(0)?h+=":":h+=": ",h+=t.dump,r+=h));t.tag=s,t.dump=r||"{}"}function qT(t,e,n){var i,r,s,o,l,a;for(r=n?t.explicitTypes:t.implicitTypes,s=0,o=r.length;s<o;s+=1)if(l=r[s],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof e=="object"&&e instanceof l.instanceOf)&&(!l.predicate||l.predicate(e))){if(n?l.multi&&l.representName?t.tag=l.representName(e):t.tag=l.tag:t.tag="?",l.represent){if(a=t.styleMap[l.tag]||l.defaultStyle,mC.call(l.represent)==="[object Function]")i=l.represent(e,a);else if(gC.call(l.represent,a))i=l.represent[a](e,a);else throw new Ht("!<"+l.tag+'> tag resolver accepts not "'+a+'" style');t.dump=i}return!0}return!1}function mr(t,e,n,i,r,s,o){t.tag=null,t.dump=n,qT(t,n,!1)||qT(t,n,!0);var l=mC.call(t.dump),a=i,c;i&&(i=t.flowLevel<0||t.flowLevel>e);var u=l==="[object Object]"||l==="[object Array]",f,h;if(u&&(f=t.duplicates.indexOf(n),h=f!==-1),(t.tag!==null&&t.tag!=="?"||h||t.indent!==2&&e>0)&&(r=!1),h&&t.usedDuplicates[f])t.dump="*ref_"+f;else{if(u&&h&&!t.usedDuplicates[f]&&(t.usedDuplicates[f]=!0),l==="[object Object]")i&&Object.keys(t.dump).length!==0?(f9(t,e,t.dump,r),h&&(t.dump="&ref_"+f+t.dump)):(u9(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object Array]")i&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?BT(t,e-1,t.dump,r):BT(t,e,t.dump,r),h&&(t.dump="&ref_"+f+t.dump)):(c9(t,e,t.dump),h&&(t.dump="&ref_"+f+" "+t.dump));else if(l==="[object String]")t.tag!=="?"&&o9(t,t.dump,e,s,a);else{if(l==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Ht("unacceptable kind of an object to dump "+l)}t.tag!==null&&t.tag!=="?"&&(c=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",t.dump=c+" "+t.dump)}return!0}function h9(t,e){var n=[],i=[],r,s;for(X0(t,n,i),r=0,s=i.length;r<s;r+=1)e.duplicates.push(n[i[r]]);e.usedDuplicates=new Array(s)}function X0(t,e,n){var i,r,s;if(t!==null&&typeof t=="object")if(r=e.indexOf(t),r!==-1)n.indexOf(r)===-1&&n.push(r);else if(e.push(t),Array.isArray(t))for(r=0,s=t.length;r<s;r+=1)X0(t[r],e,n);else for(i=Object.keys(t),r=0,s=i.length;r<s;r+=1)X0(t[i[r]],e,n)}function d9(t,e){e=e||{};var n=new t9(e);n.noRefs||h9(t,n);var i=t;return n.replacer&&(i=n.replacer.call({"":i},"",i)),mr(n,0,i,!0,!0)?n.dump+`
|
|
40
|
+
`:""}var p9=d9,m9={dump:p9};function nb(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}var g9=xt,y9=HT,b9=VT,v9=QT,S9=XT,x9=Z0,TC=pC.load,w9=pC.loadAll,k9=m9.dump,A9=Ht,O9={binary:tC,float:GT,map:jT,null:$T,pairs:iC,set:rC,timestamp:JT,bool:YT,int:KT,merge:eC,omap:nC,seq:FT,str:UT},T9=nb("safeLoad","load"),C9=nb("safeLoadAll","loadAll"),E9=nb("safeDump","dump"),no={Type:g9,Schema:y9,FAILSAFE_SCHEMA:b9,JSON_SCHEMA:v9,CORE_SCHEMA:S9,DEFAULT_SCHEMA:x9,load:TC,loadAll:w9,dump:k9,YAMLException:A9,types:O9,safeLoad:T9,safeLoadAll:C9,safeDump:E9};function Ri(){let t=globalThis.crypto;if(t&&typeof t.randomUUID=="function")return t.randomUUID();let e=Date.now().toString(36),n=Math.random().toString(36).slice(2,12),i=Math.random().toString(36).slice(2,12);return`${e}-${n}-${i}`}var as=class t extends Error{constructor(e,n,i){super(e),this.name="SpecParseError",this.line=n,this.column=i,Object.setPrototypeOf(this,t.prototype)}};function Bl(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function CC(t){return Array.isArray(t)?t:Bl(t)?Object.entries(t).map(([e,n])=>({[e]:n})):[]}function M9(t){if(typeof t=="string"||!Bl(t))return;let e=Object.keys(t);return e.length>0?e[0]:void 0}function EC(t,e){let n=new Map,i=t.split(`
|
|
41
41
|
`),r=!1,s="",o=-1,l=a=>{s&&(n.set(a,s),s="")};for(let a of i){let c=a.trim();if(!r){c===`${e}:`&&(r=!0);continue}if(c.length>0&&!c.startsWith("#")&&!c.startsWith("-")&&/^[A-Za-z_]/.test(a)&&c.endsWith(":"))break;if(c.startsWith("#")){let u=c.slice(1).trim();s=s?`${s}
|
|
42
|
-
${u}`:u;continue}if(c.startsWith("-")){o+=1,l(o);let u=
|
|
43
|
-
${u}`:u)}}}return n}function
|
|
42
|
+
${u}`:u;continue}if(c.startsWith("-")){o+=1,l(o);let u=R9(a);if(u){let f=n.get(o);n.set(o,f?`${f}
|
|
43
|
+
${u}`:u)}}}return n}function R9(t){let e=0,n=!0;for(;e<t.length;){let i=t[e];if(i===" "||i===" "){e+=1;continue}if((i==="'"||i==='"')&&n){e=N9(t,e,i),n=!1;continue}if(i==="#"){if(e===0||/\s/.test(t[e-1]))return t.slice(e+1).trim();e+=1;continue}n=i===":"||i===","||i==="["||i==="{",e+=1}}function N9(t,e,n){let i=e+1;for(;i<t.length;){let r=t[i];if(n==="'"){if(r==="'"){if(t[i+1]==="'"){i+=2;continue}return i+1}}else{if(r==="\\"){i+=2;continue}if(r==='"')return i+1}i+=1}return i}function _9(t){let e=t.split(`
|
|
44
44
|
`),n=[];for(let i of e){let r=i.trim();if(r!==""){if(r.startsWith("#")){n.push(r.slice(1).trim());continue}break}}return n.length>0?n.join(`
|
|
45
|
-
`):void 0}function
|
|
46
|
-
`).map(i=>` ${i}`)}function
|
|
47
|
-
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>` # ${e}`)}function
|
|
48
|
-
`).map(i=>i.trim()).filter(i=>i.length>0);for(let i of n)e.push(`# ${i}`);n.length>0&&e.push("")}if(t.constraints.length>0){e.push("constraints:");for(let n of t.constraints)n.comment&&e.push(...
|
|
45
|
+
`):void 0}function DC(t,e){let n=M9(t);if(n===void 0)return null;if(!ld(n))return{id:Ri(),kind:e,type:n,params:{},raw:t};let i=H0(n);for(let o of i){if(!o.fromYamlNode)continue;let l=o.fromYamlNode(t);if(l!==null){let a={id:Ri(),kind:e,type:o.type,params:l},c=t[n];return Bl(c)&&(a.sourceBody=c),a}}let r=i.find(o=>!o.fromYamlNode);if(r){let o=t[n],l=Bl(o)?{...o}:{};return{id:Ri(),kind:e,type:r.type,params:l}}let s=i[0]?.type??n;return{id:Ri(),kind:e,type:s,params:{},raw:t}}function cs(t){let e;try{e=t.trim()===""?{}:no.load(t)}catch(h){if(h instanceof no.YAMLException){let d=h.mark?.line!==void 0?h.mark.line+1:void 0,m=h.mark?.column!==void 0?h.mark.column+1:void 0;throw new as(h.reason||h.message,d,m)}throw new as(h.message)}let n=Bl(e)?e:{},i=CC(n.constraints),r=CC(n.directives),s=EC(t,"constraints"),o=EC(t,"directives"),l=[];i.forEach((h,d)=>{let m=DC(h,"constraint");if(!m)return;let g=s.get(d);g&&(m.comment=g),l.push(m)});let a=[];r.forEach((h,d)=>{let m=DC(h,"directive");if(!m)return;let g=o.get(d);g&&(m.comment=g),a.push(m)});let c={constraints:l,directives:a},u=_9(t);u&&(c.headerComment=u);let f=Object.entries(n).filter(([h])=>h!=="constraints"&&h!=="directives").map(([h,d])=>({key:h,value:d}));return f.length>0&&(c.otherSections=f),c}function L9(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function NC(t){let e={};for(let[n,i]of Object.entries(t))if(i!==void 0)if(L9(i)){let r=NC(i);Object.keys(r).length>0&&(e[n]=r)}else e[n]=i;return e}function I9(t){if(t.raw!==void 0)return t.raw;let e=zt(t.type);return e?.toYamlNode?e.toYamlNode(t.params):{[t.type]:NC(t.params)}}var B9=/^[A-Za-z0-9_.-]+$/;function q9(t){if(!B9.test(t))return!1;try{return no.load(t)===t}catch{return!1}}function MC(t){let e=I9(t);return t.type==="flag"&&Bl(e)&&typeof e.flag=="string"&&q9(e.flag)?[` - flag: ${e.flag}`]:no.dump([e],{flowLevel:2,lineWidth:-1,sortKeys:!1}).trimEnd().split(`
|
|
46
|
+
`).map(i=>` ${i}`)}function RC(t){return t.split(`
|
|
47
|
+
`).map(e=>e.trim()).filter(e=>e.length>0).map(e=>` # ${e}`)}function md(t){let e=[];if(t.headerComment){let n=t.headerComment.split(`
|
|
48
|
+
`).map(i=>i.trim()).filter(i=>i.length>0);for(let i of n)e.push(`# ${i}`);n.length>0&&e.push("")}if(t.constraints.length>0){e.push("constraints:");for(let n of t.constraints)n.comment&&e.push(...RC(n.comment)),e.push(...MC(n))}if(t.directives.length>0){t.constraints.length>0&&e.push(""),e.push("directives:");for(let n of t.directives)n.comment&&e.push(...RC(n.comment)),e.push(...MC(n))}for(let n of t.otherSections??[]){e.length>0&&e.push("");let i=no.dump({[n.key]:n.value},{lineWidth:-1,sortKeys:!1}).trimEnd();e.push(...i.split(`
|
|
49
49
|
`))}return e.length>0?`${e.join(`
|
|
50
50
|
`)}
|
|
51
|
-
`:""}var
|
|
52
|
-
`;)e+=" ",n+=1;continue}if(r==='"'||r==="'"){let s=r;for(e+=" ",n+=1;n<i&&t[n]!==s;)e+=" ",n+=1;n<i&&(e+=" ",n+=1);continue}e+=r,n+=1}return e}function
|
|
51
|
+
`:""}var IC=new Set(["univ","iden","none","Int","seq/Int","String","this","true","false","all","some","no","one","lone","set","sum","let","disj","two","in","and","or","not","implies","iff","else","ni"]),P9=new Set(["all","some","no","one","lone","set","sum","let","disj"]),_C=/[A-Za-z_][A-Za-z0-9_/]*/g,z9=/^-?\d+$/;function H9(t){let e="",n=0,i=t.length;for(;n<i;){let r=t[n];if(r==="/"&&t[n+1]==="/"||r==="-"&&t[n+1]==="-"){for(;n<i&&t[n]!==`
|
|
52
|
+
`;)e+=" ",n+=1;continue}if(r==='"'||r==="'"){let s=r;for(e+=" ",n+=1;n<i&&t[n]!==s;)e+=" ",n+=1;n<i&&(e+=" ",n+=1);continue}e+=r,n+=1}return e}function U9(t){let e=new Set;for(let n=0;n<t.length;n+=1){let i=t[n];if(!(i.kind!=="word"||!P9.has(i.value)))for(let r=n+1;r<t.length;r+=1){let s=t[r];if(s.kind==="delim"&&(s.value===":"||s.value==="|"||s.value==="="))break;s.kind==="word"&&!IC.has(s.value)&&e.add(s.value)}}return e}function F9(t){let e=H9(t),n=[],i=0,r=e.length;for(;i<r;){let s=e[i];if(/[A-Za-z_]/.test(s)){_C.lastIndex=i;let o=_C.exec(e);if(o&&o.index===i){n.push({kind:"word",value:o[0]}),i+=o[0].length;continue}}if(s===":"||s==="|"||s==="="){n.push({kind:"delim",value:s}),i+=1;continue}n.push({kind:"other",value:s}),i+=1}return n}function BC(t){if(typeof t!="string"||t.trim().length===0)return[];let e=F9(t),n=U9(e),i=[],r=new Set;for(let s of e){if(s.kind!=="word")continue;let o=s.value;IC.has(o)||z9.test(o)||n.has(o)||r.has(o)||(r.add(o),i.push(o))}return i}function j9(t){let e=new Set,n=new Set,i=new Set;for(let r of t.types){e.add(r.name);for(let s of r.atoms)i.add(s)}for(let r of t.relations)n.add(r.name);return{types:e,relations:n,atoms:i}}function V9(t,e){return t.types.has(e)||t.relations.has(e)||t.atoms.has(e)}function ib(t,e,n){let i={severity:"warning",message:t,itemId:e,source:"domain"};return n!==void 0&&(i.fieldKey=n),i}function rb(t,e){let n=t.params[e.key];if(typeof n!="string")return;let i=n.trim();return i.length>0?i:void 0}function LC(t,e){let n=zt(t.type);if(!n)return[];let i=[];for(let r of n.fields)if(r.kind==="relationName"){let s=rb(t,r);s!==void 0&&!e.relations.has(s)&&i.push(ib(`Relation "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="typeName"){let s=rb(t,r);s!==void 0&&!e.types.has(s)&&i.push(ib(`Type "${s}" is not in this instance.`,t.id,r.key))}else if(r.kind==="selector"){let s=rb(t,r);if(s!==void 0)for(let o of BC(s))V9(e,o)||i.push(ib(`"${o}" is not a type, relation, or atom in this instance.`,t.id,r.key))}return i}function sb(t,e){let n=j9(e),i=[];for(let r of t.constraints)i.push(...LC(r,n));for(let r of t.directives)i.push(...LC(r,n));return i}function qC(t){return t==null?!0:typeof t=="string"?t.trim()==="":Array.isArray(t)?t.length===0:!1}function PC(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}var $9=["hold"],Y9={inferredEdge:["color","style","weight","highlight"],edgeColor:["highlight","showLabel","hidden","filter"]};function K9(t,e){let n=t.length,i=e.length,r=new Array(i+1),s=new Array(i+1);for(let o=0;o<=i;o++)r[o]=o;for(let o=1;o<=n;o++){s[0]=o;for(let l=1;l<=i;l++){let a=t[o-1]===e[l-1]?0:1;s[l]=Math.min(r[l]+1,s[l-1]+1,r[l-1]+a)}for(let l=0;l<=i;l++)r[l]=s[l]}return r[i]}function G9(t,e){let n,i=1/0,r=t.toLowerCase();for(let s of e){let o=K9(r,s.toLowerCase());o<i&&(i=o,n=s)}return n!==void 0&&i<=2&&i<t.length?n:void 0}function zC(t,e,n,i,r=t){let s=G9(t,e),o=s?` Did you mean "${s}"?`:e.length>0?` Known fields: ${e.join(", ")}.`:"";return{severity:"warning",code:"unknown-key",message:`Unknown field "${t}" in ${n}.${o}`,itemId:i,fieldKey:r,source:"structure"}}function Q9(t,e){let n=[],i=e.fields.map(o=>o.key),r=new Set(i);if(t.kind==="constraint")for(let o of $9)r.add(o);for(let o of Y9[t.type]??[])r.add(o);let s=PC(t.sourceBody)?t.sourceBody:t.params;for(let o of Object.keys(s))r.has(o)||n.push(zC(o,i,e.label,t.id));for(let o of e.fields){if(o.kind!=="group"||!o.children)continue;let l=t.params[o.key];if(!PC(l))continue;let a=o.children.map(u=>u.key),c=new Set(a);for(let u of Object.keys(l))c.has(u)||n.push(zC(u,a,o.label,t.id,`${o.key}.${u}`))}return n}function ob(t){let e=[];if(t.raw!==void 0&&zt(t.type)===void 0)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}". It is preserved as-is but the builder cannot edit it.`,itemId:t.id,source:"structure"}),e;let n=zt(t.type);if(!n)return e.push({severity:"warning",code:"unknown-type",message:`Unknown ${t.kind} type "${t.type}".`,itemId:t.id,source:"structure"}),e;if(n.deprecated){let i=n.deprecatedInFavorOf?` Use "${n.deprecatedInFavorOf}" instead.`:"";e.push({severity:"warning",code:"deprecated",message:`"${n.label}" is deprecated.${i}`,itemId:t.id,source:"structure"})}for(let i of n.fields){let r=t.params[i.key];if(i.required&&qC(r)){e.push({severity:"error",code:"missing-required",message:`Missing required field "${i.label}".`,itemId:t.id,fieldKey:i.key,source:"structure"});continue}if(i.kind==="enum"&&i.options&&!qC(r)){let s=new Set(i.options),o=i.multiple?Array.isArray(r)?r.map(l=>String(l)):[String(r)]:[String(r)];for(let l of o)s.has(l)||e.push({severity:"error",code:"invalid-value",message:`Invalid value "${l}" for "${i.label}". Allowed: ${i.options.join(", ")}.`,itemId:t.id,fieldKey:i.key,source:"structure"})}}if(e.push(...Q9(t,n)),n.validate)for(let i of n.validate(t.params))e.push(i.itemId?i:{...i,itemId:t.id});return e}function X9(t){let e=[],n=new Map;for(let i of t){if(i.type!=="cyclic")continue;let r=String(i.params.selector??""),s=String(i.params.direction??"");if(!r||!s)continue;let o=n.get(r);o&&o.direction!==s?e.push({severity:"error",message:`Inconsistent cyclic directions for selector "${r}" (${o.direction} vs ${s}) \u2014 the layout engine rejects this spec.`,itemId:i.id,fieldKey:"direction",source:"structure"}):o||n.set(r,{direction:s,itemId:i.id})}return e}function Qc(t,e){let n=[];for(let i of t.constraints)n.push(...ob(i));for(let i of t.directives)n.push(...ob(i));return n.push(...X9(t.constraints)),e&&n.push(...sb(t,e)),n}function W9(t){if(t===void 0)return;let e=t.split(`
|
|
53
53
|
`).map(n=>n.trim()).filter(n=>n.length>0);return e.length>0?e.join(`
|
|
54
|
-
`):void 0}function
|
|
55
|
-
`)}};
|
|
56
|
-
`)?
|
|
54
|
+
`):void 0}function Wc(t){return{id:t.id,kind:t.kind,type:t.type,params:Zc(t.params),...t.comment!==void 0?{comment:t.comment}:{},...t.raw!==void 0?{raw:Zc(t.raw)}:{}}}function Zc(t){if(Array.isArray(t))return t.map(e=>Zc(e));if(t!==null&&typeof t=="object"){let e={};for(let[n,i]of Object.entries(t))e[n]=Zc(i);return e}return t}function Xc(t){return{constraints:t.constraints.map(Wc),directives:t.directives.map(Wc),...t.headerComment!==void 0?{headerComment:t.headerComment}:{},...t.otherSections!==void 0?{otherSections:t.otherSections.map(e=>({key:e.key,value:Zc(e.value)}))}:{}}}function Z9(t){return t.constraints.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),t.directives.forEach(e=>{Object.freeze(e.params),Object.freeze(e)}),Object.freeze(t.constraints),Object.freeze(t.directives),t.otherSections!==void 0&&(t.otherSections.forEach(e=>Object.freeze(e)),Object.freeze(t.otherSections)),Object.freeze(t)}var ql=class t{constructor(e){this.undoStack=[];this.redoStack=[];this.listeners=new Set;this.state=e?Xc(e):{constraints:[],directives:[]}}static fromYaml(e){let n=cs(e);return new t(n)}toYaml(){return md(this.state)}getState(){return this.frozen||(this.frozen=Z9(Xc(this.state))),this.frozen}addItem(e,n){let i=zt(n);if(!i)throw new Error(`Cannot add unknown ${e} type "${n}".`);if(i.kind!==e)throw new Error(`Type "${n}" is a ${i.kind}, not a ${e}.`);this.pushUndo();let r={id:Ri(),kind:e,type:n,params:F0(n)};return e==="constraint"?this.state.constraints.push(r):this.state.directives.push(r),this.commit(),Wc(r)}updateItem(e,n){let i=this.find(e);if(!i)return;this.pushUndo();let{item:r}=i;if(n.type!==void 0&&(r.type=n.type),n.params!==void 0){let s={...r.params};for(let[o,l]of Object.entries(n.params))l===void 0?delete s[o]:s[o]=l;r.params=s}if("comment"in n){let s=W9(n.comment);s===void 0?delete r.comment:r.comment=s}this.commit()}duplicateItem(e){let n=this.find(e);if(!n)return null;this.pushUndo();let i={...Wc(n.item),id:Ri()};return(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index+1,0,i),this.commit(),Wc(i)}removeItem(e){let n=this.find(e);if(!n)return;this.pushUndo(),(n.kind==="constraint"?this.state.constraints:this.state.directives).splice(n.index,1),this.commit()}moveItem(e,n){let i=this.find(e);if(!i)return;let r=i.kind==="constraint"?this.state.constraints:this.state.directives,s=Math.max(0,Math.min(n,r.length-1));if(s===i.index)return;this.pushUndo();let[o]=r.splice(i.index,1);r.splice(s,0,o),this.commit()}replaceFromYaml(e){let n=cs(e);this.pushUndo(),this.state=n,this.commit()}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){let e=this.undoStack.pop();e&&(this.redoStack.push(Xc(this.state)),this.state=e,this.commit())}redo(){let e=this.redoStack.pop();e&&(this.undoStack.push(Xc(this.state)),this.state=e,this.commit())}validate(e){return Qc(this.state,e)}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}pushUndo(){this.undoStack.push(Xc(this.state)),this.redoStack.length=0}commit(){this.frozen=void 0;let e=this.getState();for(let n of this.listeners)n(e)}find(e){let n=this.state.constraints.findIndex(r=>r.id===e);if(n!==-1)return{item:this.state.constraints[n],index:n,kind:"constraint"};let i=this.state.directives.findIndex(r=>r.id===e);if(i!==-1)return{item:this.state.directives[i],index:i,kind:"directive"}}};var gd=Symbol.for("yaml.alias"),yd=Symbol.for("yaml.document"),ti=Symbol.for("yaml.map"),lb=Symbol.for("yaml.pair"),yn=Symbol.for("yaml.scalar"),gr=Symbol.for("yaml.seq"),Ut=Symbol.for("yaml.node.type"),ni=t=>!!t&&typeof t=="object"&&t[Ut]===gd,Ni=t=>!!t&&typeof t=="object"&&t[Ut]===yd,Ft=t=>!!t&&typeof t=="object"&&t[Ut]===ti,le=t=>!!t&&typeof t=="object"&&t[Ut]===lb,G=t=>!!t&&typeof t=="object"&&t[Ut]===yn,jt=t=>!!t&&typeof t=="object"&&t[Ut]===gr;function ge(t){if(t&&typeof t=="object")switch(t[Ut]){case ti:case gr:return!0}return!1}function ae(t){if(t&&typeof t=="object")switch(t[Ut]){case gd:case ti:case yn:case gr:return!0}return!1}var bd=t=>(G(t)||ge(t))&&!!t.anchor;var tn=Symbol("break visit"),HC=Symbol("skip children"),_i=Symbol("remove node");function Li(t,e){let n=UC(e);Ni(t)?Pl(null,t.contents,n,Object.freeze([t]))===_i&&(t.contents=null):Pl(null,t,n,Object.freeze([]))}Li.BREAK=tn;Li.SKIP=HC;Li.REMOVE=_i;function Pl(t,e,n,i){let r=FC(t,e,n,i);if(ae(r)||le(r))return jC(t,i,r),Pl(t,r,n,i);if(typeof r!="symbol"){if(ge(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=Pl(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===tn)return tn;o===_i&&(e.items.splice(s,1),s-=1)}}}else if(le(e)){i=Object.freeze(i.concat(e));let s=Pl("key",e.key,n,i);if(s===tn)return tn;s===_i&&(e.key=null);let o=Pl("value",e.value,n,i);if(o===tn)return tn;o===_i&&(e.value=null)}}return r}async function vd(t,e){let n=UC(e);Ni(t)?await zl(null,t.contents,n,Object.freeze([t]))===_i&&(t.contents=null):await zl(null,t,n,Object.freeze([]))}vd.BREAK=tn;vd.SKIP=HC;vd.REMOVE=_i;async function zl(t,e,n,i){let r=await FC(t,e,n,i);if(ae(r)||le(r))return jC(t,i,r),zl(t,r,n,i);if(typeof r!="symbol"){if(ge(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){let o=await zl(s,e.items[s],n,i);if(typeof o=="number")s=o-1;else{if(o===tn)return tn;o===_i&&(e.items.splice(s,1),s-=1)}}}else if(le(e)){i=Object.freeze(i.concat(e));let s=await zl("key",e.key,n,i);if(s===tn)return tn;s===_i&&(e.key=null);let o=await zl("value",e.value,n,i);if(o===tn)return tn;o===_i&&(e.value=null)}}return r}function UC(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function FC(t,e,n,i){if(typeof n=="function")return n(t,e,i);if(Ft(e))return n.Map?.(t,e,i);if(jt(e))return n.Seq?.(t,e,i);if(le(e))return n.Pair?.(t,e,i);if(G(e))return n.Scalar?.(t,e,i);if(ni(e))return n.Alias?.(t,e,i)}function jC(t,e,n){let i=e[e.length-1];if(ge(i))i.items[t]=n;else if(le(i))t==="key"?i.key=n:i.value=n;else if(Ni(i))i.contents=n;else{let r=ni(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}var J9={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},eH=t=>t.replace(/[!,[\]{}]/g,e=>J9[e]),Ii=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[s,o]=i;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${r}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}let[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||n(`The ${e} tag has no suffix`);let s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(o){return n(String(o)),null}return i==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,i]of Object.entries(this.tags))if(e.startsWith(i))return n+eH(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),r;if(e&&i.length>0&&ae(e.contents)){let s={};Li(e.contents,(o,l)=>{ae(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(let[s,o]of i)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
|
|
55
|
+
`)}};Ii.defaultYaml={explicit:!1,version:"1.2"};Ii.defaultTags={"!!":"tag:yaml.org,2002:"};function Sd(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ab(t){let e=new Set;return Li(t,{Value(n,i){i.anchor&&e.add(i.anchor)}}),e}function cb(t,e){for(let n=1;;++n){let i=`${t}${n}`;if(!e.has(i))return i}}function VC(t,e){let n=[],i=new Map,r=null;return{onAnchor:s=>{n.push(s),r??(r=ab(t));let o=cb(e,r);return r.add(o),o},setAnchors:()=>{for(let s of n){let o=i.get(s);if(typeof o=="object"&&o.anchor&&(G(o.node)||ge(o.node)))o.node.anchor=o.anchor;else{let l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function us(t,e,n,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){let o=i[r],l=us(t,i,String(r),o);l===void 0?delete i[r]:l!==o&&(i[r]=l)}else if(i instanceof Map)for(let r of Array.from(i.keys())){let s=i.get(r),o=us(t,i,r,s);o===void 0?i.delete(r):o!==s&&i.set(r,o)}else if(i instanceof Set)for(let r of Array.from(i)){let s=us(t,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(let[r,s]of Object.entries(i)){let o=us(t,i,r,s);o===void 0?delete i[r]:o!==s&&(i[r]=o)}return t.call(e,n,i)}function ot(t,e,n){if(Array.isArray(t))return t.map((i,r)=>ot(i,String(r),n));if(t&&typeof t.toJSON=="function"){if(!n||!bd(t))return t.toJSON(e,n);let i={aliasCount:0,count:1,res:void 0};n.anchors.set(t,i),n.onCreate=s=>{i.res=s,delete n.onCreate};let r=t.toJSON(e,n);return n.onCreate&&n.onCreate(r),r}return typeof t=="bigint"&&!n?.keep?Number(t):t}var fs=class{constructor(e){Object.defineProperty(this,Ut,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Ni(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=ot(this,"",o);if(typeof r=="function")for(let{count:a,res:c}of o.anchors.values())r(c,a);return typeof s=="function"?us(s,{"":l},"",l):l}};var yr=class extends fs{constructor(e){super(gd),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;n?.aliasResolveCache?i=n.aliasResolveCache:(i=[],Li(e,{Node:(s,o)=>{(ni(o)||bd(o))&&i.push(o)}}),n&&(n.aliasResolveCache=i));let r;for(let s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,n){if(!n)return{source:this.source};let{anchors:i,doc:r,maxAliasCount:s}=n,o=this.resolve(r,n);if(!o){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(a)}let l=i.get(o);if(l||(ot(o,null,n),l=i.get(o)),l?.res===void 0){let a="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(a)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=xd(r,o,i)),l.count*l.aliasCount>s)){let a="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(a)}return l.res}toString(e,n,i){let r=`*${this.source}`;if(e){if(Sd(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}};function xd(t,e,n){if(ni(e)){let i=e.resolve(t),r=n&&i&&n.get(i);return r?r.count*r.aliasCount:0}else if(ge(e)){let i=0;for(let r of e.items){let s=xd(t,r,n);s>i&&(i=s)}return i}else if(le(e)){let i=xd(t,e.key,n),r=xd(t,e.value,n);return Math.max(i,r)}return 1}var wd=t=>!t||typeof t!="function"&&typeof t!="object",B=class extends fs{constructor(e){super(yn),this.value=e}toJSON(e,n){return n?.keep?this.value:ot(this.value,e,n)}toString(){return String(this.value)}};B.BLOCK_FOLDED="BLOCK_FOLDED";B.BLOCK_LITERAL="BLOCK_LITERAL";B.PLAIN="PLAIN";B.QUOTE_DOUBLE="QUOTE_DOUBLE";B.QUOTE_SINGLE="QUOTE_SINGLE";var tH="tag:yaml.org,2002:";function nH(t,e,n){if(e){let i=n.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return n.find(i=>i.identify?.(t)&&!i.format)}function br(t,e,n){if(Ni(t)&&(t=t.contents),ae(t))return t;if(le(t)){let f=n.schema[ti].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:o,sourceObjects:l}=n,a;if(i&&t&&typeof t=="object"){if(a=l.get(t),a)return a.anchor??(a.anchor=r(t)),new yr(a.anchor);a={anchor:null,node:null},l.set(t,a)}e?.startsWith("!!")&&(e=tH+e.slice(2));let c=nH(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new B(t);return a&&(a.node=f),f}c=t instanceof Map?o[ti]:Symbol.iterator in Object(t)?o[gr]:o[ti]}s&&(s(c),delete n.onTagObj);let u=c?.createNode?c.createNode(n.schema,t,n):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(n.schema,t,n):new B(t);return e?u.tag=e:c.default||(u.tag=c.tag),a&&(a.node=u),u}function Jc(t,e,n){let i=n;for(let r=e.length-1;r>=0;--r){let s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let o=[];o[s]=i,i=o}else i=new Map([[s,i]])}return br(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Ul=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Hl=class extends fs{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(i=>ae(i)||le(i)?i.clone(e):i),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Ul(e))this.add(n);else{let[i,...r]=e,s=this.get(i,!0);if(ge(s))s.addIn(r,n);else if(s===void 0&&this.schema)this.set(i,Jc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){let[n,...i]=e;if(i.length===0)return this.delete(n);let r=this.get(n,!0);if(ge(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}getIn(e,n){let[i,...r]=e,s=this.get(i,!0);return r.length===0?!n&&G(s)?s.value:s:ge(s)?s.getIn(r,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!le(n))return!1;let i=n.value;return i==null||e&&G(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[n,...i]=e;if(i.length===0)return this.has(n);let r=this.get(n,!0);return ge(r)?r.hasIn(i):!1}setIn(e,n){let[i,...r]=e;if(r.length===0)this.set(i,n);else{let s=this.get(i,!0);if(ge(s))s.setIn(r,n);else if(s===void 0&&this.schema)this.set(i,Jc(this.schema,r,n));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}};var $C=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Pn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Bi=(t,e,n)=>t.endsWith(`
|
|
56
|
+
`)?Pn(n,e):n.includes(`
|
|
57
57
|
`)?`
|
|
58
|
-
`+
|
|
59
|
-
`)n===
|
|
60
|
-
`&&d!==" "){let S=t[
|
|
61
|
-
`&&S!==" "&&(h=
|
|
62
|
-
${e}${t.slice(0,w)}`:(n===
|
|
63
|
-
${e}${t.slice(S+1,w)}`)}return
|
|
64
|
-
`);i=e,r=e+1,s=t[r]}return i}var
|
|
65
|
-
`){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function
|
|
58
|
+
`+Pn(n,e):(t.endsWith(" ")?"":" ")+n;var ub="flow",kd="block",eu="quoted";function tu(t,e,n="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:o,onOverflow:l}={}){if(!r||r<0)return t;r<s&&(s=0);let a=Math.max(1+s,1+r-e.length);if(t.length<=a)return t;let c=[],u={},f=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?c.push(0):f=r-i);let h,d,m=!1,g=-1,b=-1,p=-1;n===kd&&(g=YC(t,g,e.length),g!==-1&&(f=g+a));for(let v;v=t[g+=1];){if(n===eu&&v==="\\"){switch(b=g,t[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}p=g}if(v===`
|
|
59
|
+
`)n===kd&&(g=YC(t,g,e.length)),f=g+e.length+a,h=void 0;else{if(v===" "&&d&&d!==" "&&d!==`
|
|
60
|
+
`&&d!==" "){let S=t[g+1];S&&S!==" "&&S!==`
|
|
61
|
+
`&&S!==" "&&(h=g)}if(g>=f)if(h)c.push(h),f=h+a,h=void 0;else if(n===eu){for(;d===" "||d===" ";)d=v,v=t[g+=1],m=!0;let S=g>p+1?g-2:b-1;if(u[S])return t;c.push(S),u[S]=!0,f=S+a,h=void 0}else m=!0}d=v}if(m&&l&&l(),c.length===0)return t;o&&o();let y=t.slice(0,c[0]);for(let v=0;v<c.length;++v){let S=c[v],w=c[v+1]||t.length;S===0?y=`
|
|
62
|
+
${e}${t.slice(0,w)}`:(n===eu&&u[S]&&(y+=`${t[S]}\\`),y+=`
|
|
63
|
+
${e}${t.slice(S+1,w)}`)}return y}function YC(t,e,n){let i=e,r=e+1,s=t[r];for(;s===" "||s===" ";)if(e<r+n)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
64
|
+
`);i=e,r=e+1,s=t[r]}return i}var Od=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Td=t=>/^(%|---|\.\.\.)/m.test(t);function iH(t,e,n){if(!e||e<0)return!1;let i=e-n,r=t.length;if(r<=i)return!1;for(let s=0,o=0;s<r;++s)if(t[s]===`
|
|
65
|
+
`){if(s-o>i)return!0;if(o=s+1,r-o<=i)return!1}return!0}function nu(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Td(t)?" ":""),o="",l=0;for(let a=0,c=n[a];c;c=n[++a])if(c===" "&&n[a+1]==="\\"&&n[a+2]==="n"&&(o+=n.slice(l,a)+"\\ ",a+=1,l=a,c="\\"),c==="\\")switch(n[a+1]){case"u":{o+=n.slice(l,a);let u=n.substr(a+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=n.substr(a,6)}a+=5,l=a+1}break;case"n":if(i||n[a+2]==='"'||n.length<r)a+=1;else{for(o+=n.slice(l,a)+`
|
|
66
66
|
|
|
67
67
|
`;n[a+2]==="\\"&&n[a+3]==="n"&&n[a+4]!=='"';)o+=`
|
|
68
|
-
`,a+=2;o+=s,n[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+n.slice(l):n,i?o:
|
|
69
|
-
`)||/[ \t]\n|\n[ \t]/.test(t))return
|
|
70
|
-
${n}`)+"'";return e.implicitKey?i:
|
|
68
|
+
`,a+=2;o+=s,n[a+2]===" "&&(o+="\\"),a+=1,l=a+1}break;default:a+=1}return o=l?o+n.slice(l):n,i?o:tu(o,s,eu,Od(e,!1))}function fb(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
69
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return nu(t,e);let n=e.indent||(Td(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
70
|
+
${n}`)+"'";return e.implicitKey?i:tu(i,n,ub,Od(e,!1))}function Fl(t,e){let{singleQuote:n}=e.options,i;if(n===!1)i=nu;else{let r=t.includes('"'),s=t.includes("'");r&&!s?i=fb:s&&!r?i=nu:i=n?fb:nu}return i(t,e)}var hb;try{hb=new RegExp(`(^|(?<!
|
|
71
71
|
))
|
|
72
72
|
+(?!
|
|
73
|
-
|$)`,"g")}catch{
|
|
73
|
+
|$)`,"g")}catch{hb=/\n+(?!\n|$)/g}function Ad({comment:t,type:e,value:n},i,r,s){let{blockQuote:o,commentString:l,lineWidth:a}=i.options;if(!o||/\n[\t ]+$/.test(n))return Fl(n,i);let c=i.indent||(i.forceBlockIndent||Td(n)?" ":""),u=o==="literal"?!0:o==="folded"||e===B.BLOCK_FOLDED?!1:e===B.BLOCK_LITERAL?!0:!iH(n,a,c.length);if(!n)return u?`|
|
|
74
74
|
`:`>
|
|
75
75
|
`;let f,h;for(h=n.length;h>0;--h){let w=n[h-1];if(w!==`
|
|
76
|
-
`&&w!==" "&&w!==" ")break}let d=n.substring(h),
|
|
77
|
-
`);
|
|
78
|
-
`&&(d=d.slice(0,-1)),d=d.replace(
|
|
79
|
-
`)
|
|
80
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),O=!1,k=
|
|
76
|
+
`&&w!==" "&&w!==" ")break}let d=n.substring(h),m=d.indexOf(`
|
|
77
|
+
`);m===-1?f="-":n===d||m!==d.length-1?(f="+",s&&s()):f="",d&&(n=n.slice(0,-d.length),d[d.length-1]===`
|
|
78
|
+
`&&(d=d.slice(0,-1)),d=d.replace(hb,`$&${c}`));let g=!1,b,p=-1;for(b=0;b<n.length;++b){let w=n[b];if(w===" ")g=!0;else if(w===`
|
|
79
|
+
`)p=b;else break}let y=n.substring(0,p<b?p+1:b);y&&(n=n.substring(y.length),y=y.replace(/\n+/g,`$&${c}`));let S=(g?c?"2":"1":"")+f;if(t&&(S+=" "+l(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!u){let w=n.replace(/\n+/g,`
|
|
80
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`),O=!1,k=Od(i,!0);o!=="folded"&&e!==B.BLOCK_FOLDED&&(k.onOverflow=()=>{O=!0});let A=tu(`${y}${w}${d}`,c,kd,k);if(!O)return`>${S}
|
|
81
81
|
${c}${A}`}return n=n.replace(/\n+/g,`$&${c}`),`|${S}
|
|
82
|
-
${c}${
|
|
83
|
-
`)||u&&/[[\]{},]/.test(s))return
|
|
84
|
-
`)?
|
|
85
|
-
`))return
|
|
86
|
-
${a}`);if(o){let h=
|
|
87
|
-
${e.indent}${l}`:l}function
|
|
88
|
-
${l}:`):(b=`${b}:`,h&&(b+=
|
|
89
|
-
`:"",
|
|
90
|
-
${
|
|
82
|
+
${c}${y}${n}${d}`}function rH(t,e,n,i){let{type:r,value:s}=t,{actualString:o,implicitKey:l,indent:a,indentStep:c,inFlow:u}=e;if(l&&s.includes(`
|
|
83
|
+
`)||u&&/[[\]{},]/.test(s))return Fl(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||u||!s.includes(`
|
|
84
|
+
`)?Fl(s,e):Ad(t,e,n,i);if(!l&&!u&&r!==B.PLAIN&&s.includes(`
|
|
85
|
+
`))return Ad(t,e,n,i);if(Td(s)){if(a==="")return e.forceBlockIndent=!0,Ad(t,e,n,i);if(l&&a===c)return Fl(s,e)}let f=s.replace(/\n+/g,`$&
|
|
86
|
+
${a}`);if(o){let h=g=>g.default&&g.tag!=="tag:yaml.org,2002:str"&&g.test?.test(f),{compat:d,tags:m}=e.doc.schema;if(m.some(h)||d?.some(h))return Fl(s,e)}return l?f:tu(f,a,ub,Od(e,!1))}function io(t,e,n,i){let{implicitKey:r,inFlow:s}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:l}=t;l!==B.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(l=B.QUOTE_DOUBLE);let a=u=>{switch(u){case B.BLOCK_FOLDED:case B.BLOCK_LITERAL:return r||s?Fl(o.value,e):Ad(o,e,n,i);case B.QUOTE_DOUBLE:return nu(o.value,e);case B.QUOTE_SINGLE:return fb(o.value,e);case B.PLAIN:return rH(o,e,n,i);default:return null}},c=a(l);if(c===null){let{defaultKeyType:u,defaultStringType:f}=e.options,h=r&&u||f;if(c=a(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function Cd(t,e){let n=Object.assign({blockQuote:!0,commentString:$C,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(n.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:i,options:n}}function sH(t,e){if(e.tag){let r=t.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let n,i;if(G(e)){i=e.value;let r=t.filter(s=>s.identify?.(i));if(r.length>1){let s=r.filter(o=>o.test);s.length>0&&(r=s)}n=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,n=t.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!n){let r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return n}function oH(t,e,{anchors:n,doc:i}){if(!i.directives)return"";let r=[],s=(G(t)||ge(t))&&t.anchor;s&&Sd(s)&&(n.add(s),r.push(`&${s}`));let o=t.tag??(e.default?null:e.tag);return o&&r.push(i.directives.tagString(o)),r.join(" ")}function vr(t,e,n,i){if(le(t))return t.toString(e,n,i);if(ni(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let r,s=ae(t)?t:e.doc.createNode(t,{onTagObj:a=>r=a});r??(r=sH(e.doc.schema.tags,s));let o=oH(s,r,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let l=typeof r.stringify=="function"?r.stringify(s,e,n,i):G(s)?io(s,e,n,i):s.toString(e,n,i);return o?G(s)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
87
|
+
${e.indent}${l}`:l}function KC({key:t,value:e},n,i,r){let{allNullValues:s,doc:o,indent:l,indentStep:a,options:{commentString:c,indentSeq:u,simpleKeys:f}}=n,h=ae(t)&&t.comment||null;if(f){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(ge(t)||!ae(t)&&typeof t=="object"){let k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let d=!f&&(!t||h&&e==null&&!n.inFlow||ge(t)||(G(t)?t.type===B.BLOCK_FOLDED||t.type===B.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!d&&(f||!s),indent:l+a});let m=!1,g=!1,b=vr(t,n,()=>m=!0,()=>g=!0);if(!d&&!n.inFlow&&b.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");d=!0}if(n.inFlow){if(s||e==null)return m&&i&&i(),b===""?"?":d?`? ${b}`:b}else if(s&&!f||e==null&&d)return b=`? ${b}`,h&&!m?b+=Bi(b,n.indent,c(h)):g&&r&&r(),b;m&&(h=null),d?(h&&(b+=Bi(b,n.indent,c(h))),b=`? ${b}
|
|
88
|
+
${l}:`):(b=`${b}:`,h&&(b+=Bi(b,n.indent,c(h))));let p,y,v;ae(e)?(p=!!e.spaceBefore,y=e.commentBefore,v=e.comment):(p=!1,y=null,v=null,e&&typeof e=="object"&&(e=o.createNode(e))),n.implicitKey=!1,!d&&!h&&G(e)&&(n.indentAtStart=b.length+1),g=!1,!u&&a.length>=2&&!n.inFlow&&!d&&jt(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let S=!1,w=vr(e,n,()=>S=!0,()=>g=!0),O=" ";if(h||p||y){if(O=p?`
|
|
89
|
+
`:"",y){let k=c(y);O+=`
|
|
90
|
+
${Pn(k,n.indent)}`}w===""&&!n.inFlow?O===`
|
|
91
91
|
`&&v&&(O=`
|
|
92
92
|
|
|
93
93
|
`):O+=`
|
|
94
94
|
${n.indent}`}else if(!d&&ge(e)){let k=w[0],A=w.indexOf(`
|
|
95
|
-
`),
|
|
95
|
+
`),M=A!==-1,T=n.inFlow??e.flow??e.items.length===0;if(M||!T){let R=!1;if(M&&(k==="&"||k==="!")){let C=w.indexOf(" ");k==="&"&&C!==-1&&C<A&&w[C+1]==="!"&&(C=w.indexOf(" ",C+1)),(C===-1||A<C)&&(R=!0)}R||(O=`
|
|
96
96
|
${n.indent}`)}}else(w===""||w[0]===`
|
|
97
|
-
`)&&(O="");return b+=O+w,n.inFlow?S&&i&&i():v&&!S?b+=
|
|
98
|
-
${a}${
|
|
97
|
+
`)&&(O="");return b+=O+w,n.inFlow?S&&i&&i():v&&!S?b+=Bi(b,n.indent,c(v)):g&&r&&r(),b}function db(t,e){(t==="debug"||t==="warn")&&console.warn(e)}var Ed="<<",ii={identify:t=>t===Ed||typeof t=="symbol"&&t.description===Ed,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new B(Symbol(Ed)),{addToJSMap:mb}),stringify:()=>Ed},GC=(t,e)=>(ii.identify(e)||G(e)&&(!e.type||e.type===B.PLAIN)&&ii.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===ii.tag&&n.default);function mb(t,e,n){let i=QC(t,n);if(jt(i))for(let r of i.items)pb(t,e,r);else if(Array.isArray(i))for(let r of i)pb(t,e,r);else pb(t,e,i)}function pb(t,e,n){let i=QC(t,n);if(!Ft(i))throw new Error("Merge sources must be maps or map aliases");let r=i.toJSON(null,t,Map);for(let[s,o]of r)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function QC(t,e){return t&&ni(e)?e.resolve(t.doc,t):e}function Dd(t,e,{key:n,value:i}){if(ae(n)&&n.addToJSMap)n.addToJSMap(t,e,i);else if(GC(t,n))mb(t,e,i);else{let r=ot(n,"",t);if(e instanceof Map)e.set(r,ot(i,r,t));else if(e instanceof Set)e.add(r);else{let s=lH(n,r,t),o=ot(i,s,t);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function lH(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(ae(t)&&n?.doc){let i=Cd(n.doc,{});i.anchors=new Set;for(let s of n.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;let r=t.toString(i);if(!n.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),db(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(e)}function jl(t,e,n){let i=br(t,void 0,n),r=br(e,void 0,n);return new $e(i,r)}var $e=class t{constructor(e,n=null){Object.defineProperty(this,Ut,{value:lb}),this.key=e,this.value=n}clone(e){let{key:n,value:i}=this;return ae(n)&&(n=n.clone(e)),ae(i)&&(i=i.clone(e)),new t(n,i)}toJSON(e,n){let i=n?.mapAsMap?new Map:{};return Dd(n,i,this)}toString(e,n,i){return e?.doc?KC(this,e,n,i):JSON.stringify(this)}};function Rd(t,e,n){return(e.inFlow??t.flow?cH:aH)(t,e,n)}function aH({comment:t,items:e},n,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:o,onComment:l}){let{indent:a,options:{commentString:c}}=n,u=Object.assign({},n,{indent:s,type:null}),f=!1,h=[];for(let m=0;m<e.length;++m){let g=e[m],b=null;if(ae(g))!f&&g.spaceBefore&&h.push(""),Md(n,h,g.commentBefore,f),g.comment&&(b=g.comment);else if(le(g)){let y=ae(g.key)?g.key:null;y&&(!f&&y.spaceBefore&&h.push(""),Md(n,h,y.commentBefore,f))}f=!1;let p=vr(g,u,()=>b=null,()=>f=!0);b&&(p+=Bi(p,s,c(b))),f&&b&&(f=!1),h.push(i+p)}let d;if(h.length===0)d=r.start+r.end;else{d=h[0];for(let m=1;m<h.length;++m){let g=h[m];d+=g?`
|
|
98
|
+
${a}${g}`:`
|
|
99
99
|
`}}return t?(d+=`
|
|
100
|
-
`+
|
|
101
|
-
`)),
|
|
102
|
-
${s}${r}${
|
|
103
|
-
`;return`${
|
|
104
|
-
${r}${d}`}else return`${h}${o}${f.join(" ")}${o}${d}`}function
|
|
105
|
-
`:" ")}return
|
|
100
|
+
`+Pn(c(t),a),l&&l()):f&&o&&o(),d}function cH({items:t},e,{flowChars:n,itemIndent:i}){let{indent:r,indentStep:s,flowCollectionPadding:o,options:{commentString:l}}=e;i+=s;let a=Object.assign({},e,{indent:i,inFlow:!0,type:null}),c=!1,u=0,f=[];for(let m=0;m<t.length;++m){let g=t[m],b=null;if(ae(g))g.spaceBefore&&f.push(""),Md(e,f,g.commentBefore,!1),g.comment&&(b=g.comment);else if(le(g)){let y=ae(g.key)?g.key:null;y&&(y.spaceBefore&&f.push(""),Md(e,f,y.commentBefore,!1),y.comment&&(c=!0));let v=ae(g.value)?g.value:null;v?(v.comment&&(b=v.comment),v.commentBefore&&(c=!0)):g.value==null&&y?.comment&&(b=y.comment)}b&&(c=!0);let p=vr(g,a,()=>b=null);c||(c=f.length>u||p.includes(`
|
|
101
|
+
`)),m<t.length-1?p+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=f.reduce((y,v)=>y+v.length+2,2)+(p.length+2)>e.options.lineWidth)),c&&(p+=",")),b&&(p+=Bi(p,i,l(b))),f.push(p),u=f.length}let{start:h,end:d}=n;if(f.length===0)return h+d;if(!c){let m=f.reduce((g,b)=>g+b.length+2,2);c=e.options.lineWidth>0&&m>e.options.lineWidth}if(c){let m=h;for(let g of f)m+=g?`
|
|
102
|
+
${s}${r}${g}`:`
|
|
103
|
+
`;return`${m}
|
|
104
|
+
${r}${d}`}else return`${h}${o}${f.join(" ")}${o}${d}`}function Md({indent:t,options:{commentString:e}},n,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){let s=Pn(e(i),t);n.push(s.trimStart())}}function hs(t,e){let n=G(e)?e.value:e;for(let i of t)if(le(i)&&(i.key===e||i.key===n||G(i.key)&&i.key.value===n))return i}var Qe=class extends Hl{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ti,e),this.items=[]}static from(e,n,i){let{keepUndefined:r,replacer:s}=i,o=new this(e),l=(a,c)=>{if(typeof s=="function")c=s.call(n,a,c);else if(Array.isArray(s)&&!s.includes(a))return;(c!==void 0||r)&&o.items.push(jl(a,c,i))};if(n instanceof Map)for(let[a,c]of n)l(a,c);else if(n&&typeof n=="object")for(let a of Object.keys(n))l(a,n[a]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,n){let i;le(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new $e(e,e?.value):i=new $e(e.key,e.value);let r=hs(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!n)throw new Error(`Key ${i.key} already set`);G(r.value)&&wd(i.value)?r.value.value=i.value:r.value=i.value}else if(s){let o=this.items.findIndex(l=>s(i,l)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let n=hs(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let r=hs(this.items,e)?.value;return(!n&&G(r)?r.value:r)??void 0}has(e){return!!hs(this.items,e)}set(e,n){this.add(new $e(e,n),!0)}toJSON(e,n,i){let r=i?new i:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(r);for(let s of this.items)Dd(n,r,s);return r}toString(e,n,i){if(!e)return JSON.stringify(this);for(let r of this.items)if(!le(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Rd(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:n})}};var ri={collection:"map",default:!0,nodeClass:Qe,tag:"tag:yaml.org,2002:map",resolve(t,e){return Ft(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Qe.from(t,e,n)};var Mt=class extends Hl{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(gr,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Nd(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let i=Nd(e);if(typeof i!="number")return;let r=this.items[i];return!n&&G(r)?r.value:r}has(e){let n=Nd(e);return typeof n=="number"&&n<this.items.length}set(e,n){let i=Nd(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let r=this.items[i];G(r)&&wd(n)?r.value=n:this.items[i]=n}toJSON(e,n){let i=[];n?.onCreate&&n.onCreate(i);let r=0;for(let s of this.items)i.push(ot(s,String(r++),n));return i}toString(e,n,i){return e?Rd(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:n}):JSON.stringify(this)}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n)){let o=0;for(let l of n){if(typeof r=="function"){let a=n instanceof Set?l:String(o++);l=r.call(n,a,l)}s.items.push(br(l,void 0,i))}}return s}};function Nd(t){let e=G(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}var si={collection:"seq",default:!0,nodeClass:Mt,tag:"tag:yaml.org,2002:seq",resolve(t,e){return jt(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Mt.from(t,e,n)};var ds={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,i){return e=Object.assign({actualString:!0},e),io(t,e,n,i)}};var ro={identify:t=>t==null,createNode:()=>new B(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new B(null),stringify:({source:t},e)=>typeof t=="string"&&ro.test.test(t)?t:e.options.nullStr};var iu={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new B(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&iu.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?n.options.trueStr:n.options.falseStr}};function Rt({format:t,minFractionDigits:e,tag:n,value:i}){if(typeof i=="bigint")return String(i);let r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let l=e-(s.length-o-1);for(;l-- >0;)s+="0"}return s}var _d={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rt},Ld={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Rt(t)}},Id={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new B(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:Rt};var Bd=t=>typeof t=="bigint"||Number.isInteger(t),gb=(t,e,n,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),n);function XC(t,e,n){let{value:i}=t;return Bd(i)&&i>=0?n+i.toString(e):Rt(t)}var qd={identify:t=>Bd(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>gb(t,2,8,n),stringify:t=>XC(t,8,"0o")},Pd={identify:Bd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>gb(t,0,10,n),stringify:Rt},zd={identify:t=>Bd(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>gb(t,2,16,n),stringify:t=>XC(t,16,"0x")};var WC=[ri,si,ds,ro,iu,qd,Pd,zd,_d,Ld,Id];function ZC(t){return typeof t=="bigint"||Number.isInteger(t)}var Hd=({value:t})=>JSON.stringify(t),uH=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Hd},{identify:t=>t==null,createNode:()=>new B(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Hd},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Hd},{identify:ZC,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>ZC(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Hd}],fH={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},JC=[ri,si].concat(uH,fH);var ru={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(n.length);for(let r=0;r<n.length;++r)i[r]=n.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},i,r,s){if(!n)return"";let o=n,l;if(typeof btoa=="function"){let a="";for(let c=0;c<o.length;++c)a+=String.fromCharCode(o[c]);l=btoa(a)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=B.BLOCK_LITERAL),e!==B.QUOTE_DOUBLE){let a=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),c=Math.ceil(l.length/a),u=new Array(c);for(let f=0,h=0;f<c;++f,h+=a)u[f]=l.substr(h,a);l=u.join(e===B.BLOCK_LITERAL?`
|
|
105
|
+
`:" ")}return io({comment:t,type:e,value:l},i,r,s)}};function yb(t,e){if(jt(t))for(let n=0;n<t.items.length;++n){let i=t.items[n];if(!le(i)){if(Ft(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let r=i.items[0]||new $e(new B(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
106
106
|
${r.key.commentBefore}`:i.commentBefore),i.comment){let s=r.value??r.key;s.comment=s.comment?`${i.comment}
|
|
107
|
-
${s.comment}`:i.comment}i=r}t.items[n]=
|
|
108
|
-
`)?(n.push("..."),n.push(
|
|
107
|
+
${s.comment}`:i.comment}i=r}t.items[n]=le(i)?i:new $e(i)}}else e("Expected a sequence for this tag");return t}function bb(t,e,n){let{replacer:i}=n,r=new Mt(t);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(s++),o));let l,a;if(Array.isArray(o))if(o.length===2)l=o[0],a=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let c=Object.keys(o);if(c.length===1)l=c[0],a=o[l];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else l=o;r.items.push(jl(l,a,n))}return r}var su={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:yb,createNode:bb};var Vl=class t extends Mt{constructor(){super(),this.add=Qe.prototype.add.bind(this),this.delete=Qe.prototype.delete.bind(this),this.get=Qe.prototype.get.bind(this),this.has=Qe.prototype.has.bind(this),this.set=Qe.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let i=new Map;n?.onCreate&&n.onCreate(i);for(let r of this.items){let s,o;if(le(r)?(s=ot(r.key,"",n),o=ot(r.value,s,n)):s=ot(r,"",n),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,o)}return i}static from(e,n,i){let r=bb(e,n,i),s=new this;return s.items=r.items,s}};Vl.tag="tag:yaml.org,2002:omap";var ou={collection:"seq",identify:t=>t instanceof Map,nodeClass:Vl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=yb(t,e),i=[];for(let{key:r}of n.items)G(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Vl,n)},createNode:(t,e,n)=>Vl.from(t,e,n)};function e2({value:t,source:e},n){return e&&(t?vb:Sb).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var vb={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new B(!0),stringify:e2},Sb={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new B(!1),stringify:e2};var t2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Rt},n2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Rt(t)}},i2={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new B(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let i=t.substring(n+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Rt};var lu=t=>typeof t=="bigint"||Number.isInteger(t);function Ud(t,e,n,{intAsBigInt:i}){let r=t[0];if((r==="-"||r==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return r==="-"?BigInt(-1)*o:o}let s=parseInt(t,n);return r==="-"?-1*s:s}function xb(t,e,n){let{value:i}=t;if(lu(i)){let r=i.toString(e);return i<0?"-"+n+r.substr(1):n+r}return Rt(t)}var r2={identify:lu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Ud(t,2,2,n),stringify:t=>xb(t,2,"0b")},s2={identify:lu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Ud(t,1,8,n),stringify:t=>xb(t,8,"0")},o2={identify:lu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Ud(t,0,10,n),stringify:Rt},l2={identify:lu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Ud(t,2,16,n),stringify:t=>xb(t,16,"0x")};var $l=class t extends Qe{constructor(e){super(e),this.tag=t.tag}add(e){let n;le(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new $e(e.key,null):n=new $e(e,null),hs(this.items,n.key)||this.items.push(n)}get(e,n){let i=hs(this.items,e);return!n&&le(i)?G(i.key)?i.key.value:i.key:i}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let i=hs(this.items,e);i&&!n?this.items.splice(this.items.indexOf(i),1):!i&&n&&this.items.push(new $e(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,i);throw new Error("Set items must all have null values")}static from(e,n,i){let{replacer:r}=i,s=new this(e);if(n&&Symbol.iterator in Object(n))for(let o of n)typeof r=="function"&&(o=r.call(n,o,o)),s.items.push(jl(o,null,i));return s}};$l.tag="tag:yaml.org,2002:set";var au={collection:"map",identify:t=>t instanceof Set,nodeClass:$l,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>$l.from(t,e,n),resolve(t,e){if(Ft(t)){if(t.hasAllNullValues(!0))return Object.assign(new $l,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};function wb(t,e){let n=t[0],i=n==="-"||n==="+"?t.substring(1):t,r=o=>e?BigInt(o):Number(o),s=i.replace(/_/g,"").split(":").reduce((o,l)=>o*r(60)+r(l),r(0));return n==="-"?r(-1)*s:s}function a2(t){let{value:e}=t,n=o=>o;if(typeof e=="bigint")n=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Rt(t);let i="";e<0&&(i="-",e*=n(-1));let r=n(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Fd={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:n})=>wb(t,n),stringify:a2},jd={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>wb(t,!1),stringify:a2},Yl={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Yl.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,i,r,s,o,l]=e.map(Number),a=e[7]?Number((e[7]+"00").substr(1,3)):0,c=Date.UTC(n,i-1,r,s||0,o||0,l||0,a),u=e[8];if(u&&u!=="Z"){let f=wb(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};var kb=[ri,si,ds,ro,vb,Sb,r2,s2,o2,l2,t2,n2,i2,ru,ii,ou,su,au,Fd,jd,Yl];var c2=new Map([["core",WC],["failsafe",[ri,si,ds]],["json",JC],["yaml11",kb],["yaml-1.1",kb]]),u2={binary:ru,bool:iu,float:Id,floatExp:Ld,floatNaN:_d,floatTime:jd,int:Pd,intHex:zd,intOct:qd,intTime:Fd,map:ri,merge:ii,null:ro,omap:ou,pairs:su,seq:si,set:au,timestamp:Yl},f2={"tag:yaml.org,2002:binary":ru,"tag:yaml.org,2002:merge":ii,"tag:yaml.org,2002:omap":ou,"tag:yaml.org,2002:pairs":su,"tag:yaml.org,2002:set":au,"tag:yaml.org,2002:timestamp":Yl};function Vd(t,e,n){let i=c2.get(e);if(i&&!t)return n&&!i.includes(ii)?i.concat(ii):i.slice();let r=i;if(!r)if(Array.isArray(t))r=[];else{let s=Array.from(c2.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)r=r.concat(s);else typeof t=="function"&&(r=t(r.slice()));return n&&(r=r.concat(ii)),r.reduce((s,o)=>{let l=typeof o=="string"?u2[o]:o;if(!l){let a=JSON.stringify(o),c=Object.keys(u2).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${a}; use one of ${c}`)}return s.includes(l)||s.push(l),s},[])}var hH=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,cu=class t{constructor({compat:e,customTags:n,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:o,toStringDefaults:l}){this.compat=Array.isArray(e)?Vd(e,"compat"):e?Vd(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?f2:{},this.tags=Vd(n,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,ti,{value:ri}),Object.defineProperty(this,yn,{value:ds}),Object.defineProperty(this,gr,{value:si}),this.sortMapEntries=typeof o=="function"?o:o===!0?hH:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function h2(t,e){let n=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let a=t.directives.toString(t);a?(n.push(a),i=!0):t.directives.docStart&&(i=!0)}i&&n.push("---");let r=Cd(t,e),{commentString:s}=r.options;if(t.commentBefore){n.length!==1&&n.unshift("");let a=s(t.commentBefore);n.unshift(Pn(a,""))}let o=!1,l=null;if(t.contents){if(ae(t.contents)){if(t.contents.spaceBefore&&i&&n.push(""),t.contents.commentBefore){let u=s(t.contents.commentBefore);n.push(Pn(u,""))}r.forceBlockIndent=!!t.comment,l=t.contents.comment}let a=l?void 0:()=>o=!0,c=vr(t.contents,r,()=>l=null,a);l&&(c+=Bi(c,"",s(l))),(c[0]==="|"||c[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${c}`:n.push(c)}else n.push(vr(t.contents,r));if(t.directives?.docEnd)if(t.comment){let a=s(t.comment);a.includes(`
|
|
108
|
+
`)?(n.push("..."),n.push(Pn(a,""))):n.push(`... ${a}`)}else n.push("...");else{let a=t.comment;a&&o&&(a=a.replace(/^\n+/,"")),a&&((!o||l)&&n[n.length-1]!==""&&n.push(""),n.push(Pn(s(a),"")))}return n.join(`
|
|
109
109
|
`)+`
|
|
110
|
-
`}var
|
|
110
|
+
`}var ps=class t{constructor(e,n,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ut,{value:yd});let r=null;typeof n=="function"||Array.isArray(n)?r=n:i===void 0&&n&&(i=n,n=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:o}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Ii({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){let e=Object.create(t.prototype,{[Ut]:{value:yd}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=ae(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Kl(this.contents)&&this.contents.add(e)}addIn(e,n){Kl(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let i=ab(this);e.anchor=!n||i.has(n)?cb(n||"a",i):n}return new yr(e.anchor)}createNode(e,n,i){let r;if(typeof n=="function")e=n.call({"":e},"",e),r=n;else if(Array.isArray(n)){let b=y=>typeof y=="number"||y instanceof String||y instanceof Number,p=n.filter(b).map(String);p.length>0&&(n=n.concat(p)),r=n}else i===void 0&&n&&(i=n,n=void 0);let{aliasDuplicateObjects:s,anchorPrefix:o,flow:l,keepUndefined:a,onTagObj:c,tag:u}=i??{},{onAnchor:f,setAnchors:h,sourceObjects:d}=VC(this,o||"a"),m={aliasDuplicateObjects:s??!0,keepUndefined:a??!1,onAnchor:f,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:d},g=br(e,u,m);return l&&ge(g)&&(g.flow=!0),h(),g}createPair(e,n,i={}){let r=this.createNode(e,null,i),s=this.createNode(n,null,i);return new $e(r,s)}delete(e){return Kl(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ul(e)?this.contents==null?!1:(this.contents=null,!0):Kl(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return ge(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return Ul(e)?!n&&G(this.contents)?this.contents.value:this.contents:ge(this.contents)?this.contents.getIn(e,n):void 0}has(e){return ge(this.contents)?this.contents.has(e):!1}hasIn(e){return Ul(e)?this.contents!==void 0:ge(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=Jc(this.schema,[e],n):Kl(this.contents)&&this.contents.set(e,n)}setIn(e,n){Ul(e)?this.contents=n:this.contents==null?this.contents=Jc(this.schema,Array.from(e),n):Kl(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ii({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ii({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(i)this.schema=new cu(Object.assign(i,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:o}={}){let l={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=ot(this.contents,n??"",l);if(typeof s=="function")for(let{count:c,res:u}of l.anchors.values())s(u,c);return typeof o=="function"?us(o,{"":a},"",a):a}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return h2(this,e)}};function Kl(t){if(ge(t))return!0;throw new Error("Expected a YAML collection as document contents")}var uu=class extends Error{constructor(e,n,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=n}},oi=class extends uu{constructor(e,n,i){super("YAMLParseError",e,n,i)}},fu=class extends uu{constructor(e,n,i){super("YAMLWarning",e,n,i)}},Ab=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(l=>e.linePos(l));let{line:i,col:r}=n.linePos[0];n.message+=` at line ${i}, column ${r}`;let s=r-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let l=Math.min(s-39,o.length-79);o="\u2026"+o.substring(l),s-=l-1}if(o.length>80&&(o=o.substring(0,79)+"\u2026"),i>1&&/^ *$/.test(o.substring(0,s))){let l=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`\u2026
|
|
111
111
|
`),o=l+o}if(/[^ ]/.test(o)){let l=1,a=n.linePos[1];a?.line===i&&a.col>r&&(l=Math.max(1,Math.min(a.col-r,80-s)));let c=" ".repeat(s)+"^".repeat(l);n.message+=`:
|
|
112
112
|
|
|
113
113
|
${o}
|
|
114
114
|
${c}
|
|
115
|
-
`}};function
|
|
116
|
-
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(
|
|
117
|
-
`+
|
|
118
|
-
`+v.comment:
|
|
119
|
-
`+O.comment:c.comment=O.comment),f=O.end;continue}!o&&n.options.strict&&
|
|
120
|
-
`+k:A.comment=k,O.comment=O.comment.substring(k.length+1)}}if(!o&&!S&&!O.found){let k=w?t(n,w,O,r):e(n,O.end,S,null,O,r);c.items.push(k),f=k.range[2],
|
|
121
|
-
`+
|
|
122
|
-
`+b.comment:c.comment=b.comment),c.range=[i.offset,
|
|
123
|
-
`.repeat(Math.max(1,o.length-1)):"",b=i+r.length;return e.source&&(b+=e.source.length),{value:
|
|
124
|
-
`;for(let
|
|
125
|
-
`):b.length>a||
|
|
115
|
+
`}};function qi(t,{flow:e,indicator:n,next:i,offset:r,onError:s,parentIndent:o,startOnNewline:l}){let a=!1,c=l,u=l,f="",h="",d=!1,m=!1,g=null,b=null,p=null,y=null,v=null,S=null,w=null;for(let A of t)switch(m&&(A.type!=="space"&&A.type!=="newline"&&A.type!=="comma"&&s(A.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),g&&(c&&A.type!=="comment"&&A.type!=="newline"&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),A.type){case"space":!e&&(n!=="doc-start"||i?.type!=="flow-collection")&&A.source.includes(" ")&&(g=A),u=!0;break;case"comment":{u||s(A,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let M=A.source.substring(1)||" ";f?f+=h+M:f=M,h="",c=!1;break}case"newline":c?f?f+=A.source:(!S||n!=="seq-item-ind")&&(a=!0):h+=A.source,c=!0,d=!0,(b||p)&&(y=A),u=!0;break;case"anchor":b&&s(A,"MULTIPLE_ANCHORS","A node can have at most one anchor"),A.source.endsWith(":")&&s(A.offset+A.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=A,w??(w=A.offset),c=!1,u=!1,m=!0;break;case"tag":{p&&s(A,"MULTIPLE_TAGS","A node can have at most one tag"),p=A,w??(w=A.offset),c=!1,u=!1,m=!0;break}case n:(b||p)&&s(A,"BAD_PROP_ORDER",`Anchors and tags must be after the ${A.source} indicator`),S&&s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.source} in ${e??"collection"}`),S=A,c=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){v&&s(A,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),v=A,c=!1,u=!1;break}default:s(A,"UNEXPECTED_TOKEN",`Unexpected ${A.type} token`),c=!1,u=!1}let O=t[t.length-1],k=O?O.offset+O.source.length:r;return m&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(c&&g.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:S,spaceBefore:a,comment:f,hasNewline:d,anchor:b,tag:p,newlineAfterProp:y,end:k,start:w??k}}function ms(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
116
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(ms(e.key)||ms(e.value))return!0}return!1;default:return!0}}function hu(t,e,n){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&ms(e)&&n(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function $d(t,e,n){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let r=typeof i=="function"?i:(s,o)=>s===o||G(s)&&G(o)&&s.value===o.value;return e.some(s=>r(s.key,n))}var d2="All mapping items must start at the same column";function p2({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Qe,l=new o(n.schema);n.atRoot&&(n.atRoot=!1);let a=i.offset,c=null;for(let u of i.items){let{start:f,key:h,sep:d,value:m}=u,g=qi(f,{indicator:"explicit-key-ind",next:h??d?.[0],offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0}),b=!g.found;if(b){if(h&&(h.type==="block-seq"?r(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in h&&h.indent!==i.indent&&r(a,"BAD_INDENT",d2)),!g.anchor&&!g.tag&&!d){c=g.end,g.comment&&(l.comment?l.comment+=`
|
|
117
|
+
`+g.comment:l.comment=g.comment);continue}(g.newlineAfterProp||ms(h))&&r(h??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else g.found?.indent!==i.indent&&r(a,"BAD_INDENT",d2);n.atKey=!0;let p=g.end,y=h?t(n,h,g,r):e(n,p,f,null,g,r);n.schema.compat&&hu(i.indent,h,r),n.atKey=!1,$d(n,l.items,y)&&r(p,"DUPLICATE_KEY","Map keys must be unique");let v=qi(d??[],{indicator:"map-value-ind",next:m,offset:y.range[2],onError:r,parentIndent:i.indent,startOnNewline:!h||h.type==="block-scalar"});if(a=v.end,v.found){b&&(m?.type==="block-map"&&!v.hasNewline&&r(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&g.start<v.found.offset-1024&&r(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=m?t(n,m,v,r):e(n,a,d,null,v,r);n.schema.compat&&hu(i.indent,m,r),a=S.range[2];let w=new $e(y,S);n.options.keepSourceTokens&&(w.srcToken=u),l.items.push(w)}else{b&&r(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),v.comment&&(y.comment?y.comment+=`
|
|
118
|
+
`+v.comment:y.comment=v.comment);let S=new $e(y);n.options.keepSourceTokens&&(S.srcToken=u),l.items.push(S)}}return c&&c<a&&r(c,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,a,c??a],l}function m2({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=s?.nodeClass??Mt,l=new o(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let a=i.offset,c=null;for(let{start:u,value:f}of i.items){let h=qi(u,{indicator:"seq-item-ind",next:f,offset:a,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||f)f?.type==="block-seq"?r(h.end,"BAD_INDENT","All sequence items must start at the same column"):r(a,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(l.comment=h.comment);continue}let d=f?t(n,f,h,r):e(n,h.end,u,null,h,r);n.schema.compat&&hu(i.indent,f,r),a=d.range[2],l.items.push(d)}return l.range=[i.offset,a,c??a],l}function Pi(t,e,n,i){let r="";if(t){let s=!1,o="";for(let l of t){let{source:a,type:c}=l;switch(c){case"space":s=!0;break;case"comment":{n&&!s&&i(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=a.substring(1)||" ";r?r+=o+u:r=u,o="";break}case"newline":r&&(o+=a),s=!0;break;default:i(l,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=a.length}}return{comment:r,offset:e}}var Ob="Block collections are not allowed within flow collections",Tb=t=>t&&(t.type==="block-map"||t.type==="block-seq");function g2({composeNode:t,composeEmptyNode:e},n,i,r,s){let o=i.start.source==="{",l=o?"flow map":"flow sequence",a=s?.nodeClass??(o?Qe:Mt),c=new a(n.schema);c.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=i.offset+i.start.source.length;for(let b=0;b<i.items.length;++b){let p=i.items[b],{start:y,key:v,sep:S,value:w}=p,O=qi(y,{flow:l,indicator:"explicit-key-ind",next:v??S?.[0],offset:f,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!S&&!w){b===0&&O.comma?r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):b<i.items.length-1&&r(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),O.comment&&(c.comment?c.comment+=`
|
|
119
|
+
`+O.comment:c.comment=O.comment),f=O.end;continue}!o&&n.options.strict&&ms(v)&&r(v,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)O.comma&&r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(O.comma||r(O.start,"MISSING_CHAR",`Missing , between ${l} items`),O.comment){let k="";e:for(let A of y)switch(A.type){case"comma":case"space":break;case"comment":k=A.source.substring(1);break e;default:break e}if(k){let A=c.items[c.items.length-1];le(A)&&(A=A.value??A.key),A.comment?A.comment+=`
|
|
120
|
+
`+k:A.comment=k,O.comment=O.comment.substring(k.length+1)}}if(!o&&!S&&!O.found){let k=w?t(n,w,O,r):e(n,O.end,S,null,O,r);c.items.push(k),f=k.range[2],Tb(w)&&r(k.range,"BLOCK_IN_FLOW",Ob)}else{n.atKey=!0;let k=O.end,A=v?t(n,v,O,r):e(n,k,y,null,O,r);Tb(v)&&r(A.range,"BLOCK_IN_FLOW",Ob),n.atKey=!1;let M=qi(S??[],{flow:l,indicator:"map-value-ind",next:w,offset:A.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(M.found){if(!o&&!O.found&&n.options.strict){if(S)for(let C of S){if(C===M.found)break;if(C.type==="newline"){r(C,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<M.found.offset-1024&&r(M.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else w&&("source"in w&&w.source?.[0]===":"?r(w,"MISSING_CHAR",`Missing space after : in ${l}`):r(M.start,"MISSING_CHAR",`Missing , or : between ${l} items`));let T=w?t(n,w,M,r):M.found?e(n,M.end,S,null,M,r):null;T?Tb(w)&&r(T.range,"BLOCK_IN_FLOW",Ob):M.comment&&(A.comment?A.comment+=`
|
|
121
|
+
`+M.comment:A.comment=M.comment);let R=new $e(A,T);if(n.options.keepSourceTokens&&(R.srcToken=p),o){let C=c;$d(n,C.items,A)&&r(k,"DUPLICATE_KEY","Map keys must be unique"),C.items.push(R)}else{let C=new Qe(n.schema);C.flow=!0,C.items.push(R);let V=(T??A).range;C.range=[A.range[0],V[1],V[2]],c.items.push(C)}f=T?T.range[2]:M.end}}let h=o?"}":"]",[d,...m]=i.end,g=f;if(d?.source===h)g=d.offset+d.source.length;else{let b=l[0].toUpperCase()+l.substring(1),p=u?`${b} must end with a ${h}`:`${b} in block collection must be sufficiently indented and end with a ${h}`;r(f,u?"MISSING_CHAR":"BAD_INDENT",p),d&&d.source.length!==1&&m.unshift(d)}if(m.length>0){let b=Pi(m,g,n.options.strict,r);b.comment&&(c.comment?c.comment+=`
|
|
122
|
+
`+b.comment:c.comment=b.comment),c.range=[i.offset,g,b.offset]}else c.range=[i.offset,g,g];return c}function Cb(t,e,n,i,r,s){let o=n.type==="block-map"?p2(t,e,n,i,s):n.type==="block-seq"?m2(t,e,n,i,s):g2(t,e,n,i,s),l=o.constructor;return r==="!"||r===l.tagName?(o.tag=l.tagName,o):(r&&(o.tag=r),o)}function y2(t,e,n,i,r){let s=i.tag,o=s?e.directives.tagName(s.source,h=>r(s,"TAG_RESOLVE_FAILED",h)):null;if(n.type==="block-seq"){let{anchor:h,newlineAfterProp:d}=i,m=h&&s?h.offset>s.offset?h:s:h??s;m&&(!d||d.offset<m.offset)&&r(m,"MISSING_CHAR","Missing newline after block sequence props")}let l=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===Qe.tagName&&l==="map"||o===Mt.tagName&&l==="seq")return Cb(t,e,n,r,o);let a=e.schema.tags.find(h=>h.tag===o&&h.collection===l);if(!a){let h=e.schema.knownTags[o];if(h?.collection===l)e.schema.tags.push(Object.assign({},h,{default:!1})),a=h;else return h?r(s,"BAD_COLLECTION_TYPE",`${h.tag} used for ${l} collection, but expects ${h.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Cb(t,e,n,r,o)}let c=Cb(t,e,n,r,o,a),u=a.resolve?.(c,h=>r(s,"TAG_RESOLVE_FAILED",h),e.options)??c,f=ae(u)?u:new B(u);return f.range=c.range,f.tag=o,a?.format&&(f.format=a.format),f}function Eb(t,e,n){let i=e.offset,r=dH(e,t.options.strict,n);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};let s=r.mode===">"?B.BLOCK_FOLDED:B.BLOCK_LITERAL,o=e.source?pH(e.source):[],l=o.length;for(let g=o.length-1;g>=0;--g){let b=o[g][1];if(b===""||b==="\r")l=g;else break}if(l===0){let g=r.chomp==="+"&&o.length>0?`
|
|
123
|
+
`.repeat(Math.max(1,o.length-1)):"",b=i+r.length;return e.source&&(b+=e.source.length),{value:g,type:s,comment:r.comment,range:[i,b,b]}}let a=e.indent+r.indent,c=e.offset+r.length,u=0;for(let g=0;g<l;++g){let[b,p]=o[g];if(p===""||p==="\r")r.indent===0&&b.length>a&&(a=b.length);else{b.length<a&&n(c+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(a=b.length),u=g,a===0&&!t.atRoot&&n(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=b.length+p.length+1}for(let g=o.length-1;g>=l;--g)o[g][0].length>a&&(l=g+1);let f="",h="",d=!1;for(let g=0;g<u;++g)f+=o[g][0].slice(a)+`
|
|
124
|
+
`;for(let g=u;g<l;++g){let[b,p]=o[g];c+=b.length+p.length+1;let y=p[p.length-1]==="\r";if(y&&(p=p.slice(0,-1)),p&&b.length<a){let S=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;n(c-p.length-(y?2:1),"BAD_INDENT",S),b=""}s===B.BLOCK_LITERAL?(f+=h+b.slice(a)+p,h=`
|
|
125
|
+
`):b.length>a||p[0]===" "?(h===" "?h=`
|
|
126
126
|
`:!d&&h===`
|
|
127
127
|
`&&(h=`
|
|
128
128
|
|
|
129
|
-
`),f+=h+b.slice(a)+
|
|
130
|
-
`,d=!0):
|
|
129
|
+
`),f+=h+b.slice(a)+p,h=`
|
|
130
|
+
`,d=!0):p===""?h===`
|
|
131
131
|
`?f+=`
|
|
132
132
|
`:h=`
|
|
133
|
-
`:(f+=h+
|
|
134
|
-
`+o[
|
|
133
|
+
`:(f+=h+p,h=" ",d=!1)}switch(r.chomp){case"-":break;case"+":for(let g=l;g<o.length;++g)f+=`
|
|
134
|
+
`+o[g][0].slice(a);f[f.length-1]!==`
|
|
135
135
|
`&&(f+=`
|
|
136
136
|
`);break;default:f+=`
|
|
137
|
-
`}let
|
|
137
|
+
`}let m=i+r.length+e.source.length;return{value:f,type:s,comment:r.comment,range:[i,m,m]}}function dH({offset:t,props:e},n,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:r}=e[0],s=r[0],o=0,l="",a=-1;for(let h=1;h<r.length;++h){let d=r[h];if(!l&&(d==="-"||d==="+"))l=d;else{let m=Number(d);!o&&m?o=m:a===-1&&(a=t+h)}}a!==-1&&i(a,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,u="",f=r.length;for(let h=1;h<e.length;++h){let d=e[h];switch(d.type){case"space":c=!0;case"newline":f+=d.source.length;break;case"comment":n&&!c&&i(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=d.source.length,u=d.source.substring(1);break;case"error":i(d,"UNEXPECTED_TOKEN",d.message),f+=d.source.length;break;default:{let m=`Unexpected token in block scalar header: ${d.type}`;i(d,"UNEXPECTED_TOKEN",m);let g=d.source;g&&typeof g=="string"&&(f+=g.length)}}}return{mode:s,indent:o,chomp:l,comment:u,length:f}}function pH(t){let e=t.split(/\n( *)/),n=e[0],i=n.match(/^( *)/),s=[i?.[1]?[i[1],n.slice(i[1].length)]:["",n]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}function Db(t,e,n){let{offset:i,type:r,source:s,end:o}=t,l,a,c=(h,d,m)=>n(i+h,d,m);switch(r){case"scalar":l=B.PLAIN,a=mH(s,c);break;case"single-quoted-scalar":l=B.QUOTE_SINGLE,a=gH(s,c);break;case"double-quoted-scalar":l=B.QUOTE_DOUBLE,a=yH(s,c);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}let u=i+s.length,f=Pi(o,u,e,n);return{value:a,type:l,comment:f.comment,range:[i,u,f.offset]}}function mH(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),b2(t)}function gH(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),b2(t.slice(1,-1)).replace(/''/g,"'")}function b2(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
138
138
|
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
139
139
|
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let r=i[1],s=" ",o=e.lastIndex;for(n.lastIndex=o;i=n.exec(t);)i[1]===""?s===`
|
|
140
140
|
`?r+=s:s=`
|
|
141
|
-
`:(r+=s+i[1],s=" "),o=n.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=o,i=l.exec(t),r+s+(i?.[1]??"")}function
|
|
141
|
+
`:(r+=s+i[1],s=" "),o=n.lastIndex;let l=/[ \t]*(.*)/sy;return l.lastIndex=o,i=l.exec(t),r+s+(i?.[1]??"")}function yH(t,e){let n="";for(let i=1;i<t.length-1;++i){let r=t[i];if(!(r==="\r"&&t[i+1]===`
|
|
142
142
|
`))if(r===`
|
|
143
|
-
`){let{fold:s,offset:o}=
|
|
143
|
+
`){let{fold:s,offset:o}=bH(t,i);n+=s,i=o}else if(r==="\\"){let s=t[++i],o=vH[s];if(o)n+=o;else if(s===`
|
|
144
144
|
`)for(s=t[i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="\r"&&t[i+1]===`
|
|
145
|
-
`)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;n+=
|
|
145
|
+
`)for(s=t[++i+1];s===" "||s===" ";)s=t[++i+1];else if(s==="x"||s==="u"||s==="U"){let l=s==="x"?2:s==="u"?4:8;n+=SH(t,i+1,l,e),i+=l}else{let l=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),n+=l}}else if(r===" "||r===" "){let s=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
|
|
146
146
|
`&&!(o==="\r"&&t[i+2]===`
|
|
147
|
-
`)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function
|
|
147
|
+
`)&&(n+=i>s?t.slice(s,i+1):r)}else n+=r}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function bH(t,e){let n="",i=t[e+1];for(;(i===" "||i===" "||i===`
|
|
148
148
|
`||i==="\r")&&!(i==="\r"&&t[e+2]!==`
|
|
149
149
|
`);)i===`
|
|
150
150
|
`&&(n+=`
|
|
151
|
-
`),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var
|
|
152
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
151
|
+
`),e+=1,i=t[e+1];return n||(n=" "),{fold:n,offset:e}}var vH={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
152
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function SH(t,e,n,i){let r=t.substr(e,n),o=r.length===n&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(o)}catch{let l=t.substr(e-2,n+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}}function Mb(t,e,n,i){let{value:r,type:s,comment:o,range:l}=e.type==="block-scalar"?Eb(t,e,i):Db(e,t.options.strict,i),a=n?t.directives.tagName(n.source,f=>i(n,"TAG_RESOLVE_FAILED",f)):null,c;t.options.stringKeys&&t.atKey?c=t.schema[yn]:a?c=xH(t.schema,r,a,n,i):e.type==="scalar"?c=wH(t,r,e,i):c=t.schema[yn];let u;try{let f=c.resolve(r,h=>i(n??e,"TAG_RESOLVE_FAILED",h),t.options);u=G(f)?f:new B(f)}catch(f){let h=f instanceof Error?f.message:String(f);i(n??e,"TAG_RESOLVE_FAILED",h),u=new B(r)}return u.range=l,u.source=r,s&&(u.type=s),a&&(u.tag=a),c.format&&(u.format=c.format),o&&(u.comment=o),u}function xH(t,e,n,i,r){if(n==="!")return t[yn];let s=[];for(let l of t.tags)if(!l.collection&&l.tag===n)if(l.default&&l.test)s.push(l);else return l;for(let l of s)if(l.test?.test(e))return l;let o=t.knownTags[n];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[yn])}function wH({atKey:t,directives:e,schema:n},i,r,s){let o=n.tags.find(l=>(l.default===!0||t&&l.default==="key")&&l.test?.test(i))||n[yn];if(n.compat){let l=n.compat.find(a=>a.default&&a.test?.test(i))??n[yn];if(o.tag!==l.tag){let a=e.tagString(o.tag),c=e.tagString(l.tag),u=`Value may be parsed as either ${a} or ${c}`;s(r,"TAG_RESOLVE_FAILED",u,!0)}}return o}function v2(t,e,n){if(e){n??(n=e.length);for(let i=n-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=e[++i];r?.type==="space";)t+=r.source.length,r=e[++i];break}}return t}var kH={composeNode:Rb,composeEmptyNode:Yd};function Rb(t,e,n,i){let r=t.atKey,{spaceBefore:s,comment:o,anchor:l,tag:a}=n,c,u=!0;switch(e.type){case"alias":c=AH(t,e,i),(l||a)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Mb(t,e,a,i),l&&(c.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=y2(kH,t,e,n,i),l&&(c.anchor=l.source.substring(1))}catch(f){let h=f instanceof Error?f.message:String(f);i(e,"RESOURCE_EXHAUSTION",h)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",f),u=!1}}return c??(c=Yd(t,e.offset,void 0,null,n,i)),l&&c.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!G(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&i(a??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),t.options.keepSourceTokens&&u&&(c.srcToken=e),c}function Yd(t,e,n,i,{spaceBefore:r,comment:s,anchor:o,tag:l,end:a},c){let u={type:"scalar",offset:v2(e,n,i),indent:-1,source:""},f=Mb(t,u,l,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=a),f}function AH({options:t},{offset:e,source:n,end:i},r){let s=new yr(n.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+n.length,l=Pi(i,o,t.strict,r);return s.range=[e,o,l.offset],l.comment&&(s.comment=l.comment),s}function S2(t,e,{offset:n,start:i,value:r,end:s},o){let l=Object.assign({_directives:e},t),a=new ps(void 0,l),c={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},u=qi(i,{indicator:"doc-start",next:r??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(a.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=r?Rb(c,r,u,o):Yd(c,u.end,i,null,u,o);let f=a.contents.range[2],h=Pi(s,f,!1,o);return h.comment&&(a.comment=h.comment),a.range=[n,f,h.offset],a}function du(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function x2(t){let e="",n=!1,i=!1;for(let r=0;r<t.length;++r){let s=t[r];switch(s[0]){case"#":e+=(e===""?"":i?`
|
|
153
153
|
|
|
154
154
|
`:`
|
|
155
|
-
`)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var
|
|
156
|
-
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(ge(s)&&!s.flow&&s.items.length>0){let o=s.items[0];
|
|
155
|
+
`)+(s.substring(1)||" "),n=!0,i=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),n=!1;break;default:n||(i=!0),n=!1}}return{comment:e,afterEmptyLine:i}}var pu=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,i,r,s)=>{let o=du(n);s?this.warnings.push(new fu(o,i,r)):this.errors.push(new oi(o,i,r))},this.directives=new Ii({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:i,afterEmptyLine:r}=x2(this.prelude);if(i){let s=e.contents;if(n)e.comment=e.comment?`${e.comment}
|
|
156
|
+
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(ge(s)&&!s.flow&&s.items.length>0){let o=s.items[0];le(o)&&(o=o.key);let l=o.commentBefore;o.commentBefore=l?`${i}
|
|
157
157
|
${l}`:i}else{let o=s.commentBefore;s.commentBefore=o?`${i}
|
|
158
|
-
${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
159
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new
|
|
158
|
+
${o}`:i}}if(n){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:x2(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,i=-1){for(let r of e)yield*this.next(r);yield*this.end(n,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(n,i,r)=>{let s=du(e);s[0]+=n,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=S2(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new oi(du(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new oi(du(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let n=Pi(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
|
|
159
|
+
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new oi(du(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),r=new ps(void 0,i);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,n,n],this.decorate(r,!1),yield r}}};var Nb=Symbol("break visit"),OH=Symbol("skip children"),w2=Symbol("remove item");function so(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),k2(Object.freeze([]),t,e)}so.BREAK=Nb;so.SKIP=OH;so.REMOVE=w2;so.itemAtPath=(t,e)=>{let n=t;for(let[i,r]of e){let s=n?.[i];if(s&&"items"in s)n=s.items[r];else return}return n};so.parentCollection=(t,e)=>{let n=so.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],r=n?.[i];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function k2(t,e,n){let i=n(e,t);if(typeof i=="symbol")return i;for(let r of["key","value"]){let s=e[r];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){let l=k2(Object.freeze(t.concat([[r,o]])),s.items[o],n);if(typeof l=="number")o=l-1;else{if(l===Nb)return Nb;l===w2&&(s.items.splice(o,1),o-=1)}}typeof i=="function"&&r==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}var _b="\uFEFF",Lb="",Ib="",Kd="";function A2(t){switch(t){case _b:return"byte-order-mark";case Lb:return"doc-mode";case Ib:return"flow-error-end";case Kd:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
160
160
|
`:case`\r
|
|
161
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function
|
|
162
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
163
|
-
\r `),
|
|
161
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function li(t){switch(t){case void 0:case" ":case`
|
|
162
|
+
`:case"\r":case" ":return!0;default:return!1}}var O2=new Set("0123456789ABCDEFabcdef"),CH=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Gd=new Set(",[]{}"),EH=new Set(` ,[]{}
|
|
163
|
+
\r `),Bb=t=>!t||EH.has(t),mu=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,n=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!n;let i=this.next??"stream";for(;i&&(n||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
|
|
164
164
|
`?!0:n==="\r"?this.buffer[e+1]===`
|
|
165
165
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let i=0;for(;n===" ";)n=this.buffer[++i+e];if(n==="\r"){let r=this.buffer[i+e+1];if(r===`
|
|
166
166
|
`||!r&&!this.atEnd)return e+i+1}return n===`
|
|
167
|
-
`||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&
|
|
168
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
167
|
+
`||i>=this.indentNext||!n&&!this.atEnd?e+i:-1}if(n==="-"||n==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&li(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
168
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===_b&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,i=e.indexOf("#");for(;i!==-1;){let s=e[i-1];if(s===" "||s===" "){n=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let s=e[n-1];if(s===" "||s===" ")n-=1;else break}let r=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield Lb,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let n=this.peek(3);if((n==="---"||n==="...")&&li(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!li(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&li(n)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Bb),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,i=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=i=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&li(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Ib,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Bb),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||li(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let s=0;for(;this.buffer[n-1-s]==="\\";)s+=1;if(s%2===0)break;n=this.buffer.indexOf('"',n+1)}let i=this.buffer.substring(0,n),r=i.indexOf(`
|
|
169
169
|
`,this.pos);if(r!==-1){for(;r!==-1;){let s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
|
|
170
|
-
`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>
|
|
170
|
+
`,s)}r!==-1&&(n=r-(i[r-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>li(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":n+=1;break;case`
|
|
171
171
|
`:e=s,n=0;break;case"\r":{let o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
172
172
|
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
173
173
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
174
174
|
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);let l=s;for(;o===" ";)o=this.buffer[--s];if(o===`
|
|
175
|
-
`&&s>=this.pos&&s+1+n>l)e=s;else break}while(!0);return yield
|
|
175
|
+
`&&s>=this.pos&&s+1+n>l)e=s;else break}while(!0);return yield Kd,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){let s=this.buffer[i+1];if(li(s)||e&&Gd.has(s))break;n=i}else if(li(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
|
|
176
176
|
`?(i+=1,r=`
|
|
177
|
-
`,s=this.buffer[i+1]):n=i),s==="#"||e&&
|
|
178
|
-
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&
|
|
177
|
+
`,s=this.buffer[i+1]):n=i),s==="#"||e&&Gd.has(s))break;if(r===`
|
|
178
|
+
`){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Gd.has(r))break;n=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Kd,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(n&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Bb),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,i=this.charAt(1);if(li(i)||n&&Gd.has(i)){n?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,n=this.buffer[e];for(;!li(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(CH.has(n))n=this.buffer[++e];else if(n==="%"&&O2.has(this.buffer[e+1])&&O2.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
179
179
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
180
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};var
|
|
180
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,i;do i=this.buffer[++n];while(i===" "||e&&i===" ");let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let n=this.pos,i=this.buffer[n];for(;!e(i);)i=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};var gu=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,i=this.lineStarts.length;for(;n<i;){let s=n+i>>1;this.lineStarts[s]<e?n=s+1:i=s}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let r=this.lineStarts[n-1];return{line:n,col:e-r+1}}}};function gs(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function T2(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function E2(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Qd(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Gl(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Xd(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function C2(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!gs(e.start,"explicit-key-ind")&&!gs(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,E2(e.value)?e.value.end?Xd(e.value.end,e.sep):e.value.end=e.sep:Xd(e.start,e.sep),delete e.sep)}var yu=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new mu,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,n))yield*this.next(i);n||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=A2(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let i=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in i?i.indent:0:n.type==="flow-collection"&&i.type==="document"&&(n.indent=0),n.type==="flow-collection"&&C2(n),i.type){case"document":i.value=n;break;case"block-scalar":i.props.push(n);break;case"block-map":{let r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=n;else{Object.assign(r,{key:n,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{let r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:n}):r.value=n;break}case"flow-collection":{let r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:n,sep:[]}):r.sep?r.value=n:Object.assign(r,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let r=n.items[n.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&T2(r.start)===-1&&(n.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<n.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{T2(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let n=Qd(this.peek(2)),i=Gl(n),r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
181
181
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
182
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){
|
|
182
|
+
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Xd(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,r=i&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",s=[];if(r&&n.sep&&!n.value){let o=[];for(let l=0;l<n.sep.length;++l){let a=n.sep[l];switch(a.type){case"newline":o.push(l);break;case"space":break;case"comment":a.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=n.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":r||n.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):r||n.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gs(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(E2(n.key)&&!gs(n.sep,"newline")){let o=Gl(n.start),l=n.key,a=n.sep;a.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:a}]})}else s.length>0?n.sep=n.sep.concat(s,this.sourceToken):n.sep.push(this.sourceToken);else if(gs(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let o=Gl(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):gs(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);r||n.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(o):(Object.assign(n,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!n.explicitKey&&n.sep&&!gs(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let i="end"in n.value?n.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Xd(r,n.start),r.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||gs(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let r=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:r,sep:[]}):n.sep?this.stack.push(r):Object.assign(n,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let r=Qd(i),s=Gl(r);C2(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
|
|
183
183
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
184
|
-
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=
|
|
185
|
-
`&&e.push(n+1);return e}function
|
|
184
|
+
`,n)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let n=Qd(e),i=Gl(n);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=Qd(e),i=Gl(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function DH(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new gu||null,prettyErrors:e}}function qb(t,e={}){let{lineCounter:n,prettyErrors:i}=DH(e),r=new yu(n?.addNewLine),s=new pu(e),o=null;for(let l of s.compose(r.parse(t),!0,t.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new oi(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&n&&(o.errors.forEach(Ab(t,n)),o.warnings.forEach(Ab(t,n))),o}function RH(t){let e=[0];for(let n=0;n<t.length;n++)t[n]===`
|
|
185
|
+
`&&e.push(n+1);return e}function NH(t,e,n,i){let r=Math.min(Math.max(t-1,0),n.length-1);return Math.min(n[r]+Math.max(e-1,0),i)}function _H(t){if(Ft(t)&&t.items.length>0){let e=t.items[0].key;if(G(e)&&e.range)return[e.range[0],e.range[1]]}return null}function Pb(t,e){if(Ft(t)){for(let n of t.items)if(G(n.key)&&String(n.key.value)===e&&n.key.range)return[n.key.range[0],n.key.range[1]];for(let n of t.items){let i=Pb(n.value,e);if(i)return i}}else if(jt(t))for(let n of t.items){let i=Pb(n,e);if(i)return i}return null}function Wd(t,e){if(e.length===0)return null;if(e.length===1)return Pb(t,e[0]);let[n,...i]=e;if(Ft(t)){for(let r of t.items)if(G(r.key)&&String(r.key.value)===n){let s=Wd(r.value,i);if(s)return s}for(let r of t.items){let s=Wd(r.value,e);if(s)return s}}else if(jt(t))for(let r of t.items){let s=Wd(r,e);if(s)return s}return null}function LH(t,e,n,i,r){if(t.itemId&&n){let s=e.get(t.itemId);if(s){let o=n.get(s.section);if(jt(o)){let l=o.items[s.index];if(l!==void 0){if(t.fieldKey){let c=Wd(l,t.fieldKey.split("."));if(c)return c}let a=_H(l);if(a)return a}}}}if(t.line!==void 0){let s=NH(t.line,t.column??1,i,r);return[s,Math.min(s+1,r)]}return null}function zb(t,e,n){let i=new Map;e.constraints.forEach((l,a)=>i.set(l.id,{section:"constraints",index:a})),e.directives.forEach((l,a)=>i.set(l.id,{section:"directives",index:a}));let r=null;try{r=qb(t)}catch{r=null}let s=RH(t),o=t.length;return n.map(l=>{let a=LH(l,i,r,s,o);if(!a)return{...l};let c=Math.max(0,Math.min(a[0],o)),u=Math.max(c,Math.min(a[1],o));return{...l,from:c,to:u}})}function Hb(t,e){if(t.trim()==="")return[];let n;try{n=cs(t)}catch(r){let s=r,o={severity:"error",code:"yaml-syntax",source:"yaml",message:`YAML syntax error: ${s.message}`,...s.line!==void 0?{line:s.line}:{},...s.column!==void 0?{column:s.column}:{}};return zb(t,{constraints:[],directives:[]},[o])}let i=Qc(n,e).filter(r=>r.severity==="error"||r.severity==="warning");return zb(t,n,i)}var D2={types:[],relations:[]},M2=new Set(["univ","Int","seq/Int","iden","none","String"]);function IH(t){return t.isBuiltin===!0?!0:M2.has(t.id)}function BH(t){return t.length===0?!1:t.every(e=>M2.has(e))}function qH(t){let e;try{e=t.getTypes()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{if(!r||typeof r.id!="string"||r.id.length===0||IH(r)||i.has(r.id))continue;i.add(r.id);let s=[],o=new Set;if(Array.isArray(r.atoms))for(let l of r.atoms){let a=l&&typeof l.label=="string"&&l.label.length>0?l.label:l&&typeof l.id=="string"?l.id:void 0;a!==void 0&&!o.has(a)&&(o.add(a),s.push(a))}n.push({name:r.id,atoms:s})}catch{continue}return n}function PH(t){let e;try{e=t.getRelations()}catch{return[]}if(!Array.isArray(e))return[];let n=[],i=new Set;for(let r of e)try{let s=r&&typeof r.name=="string"&&r.name.length>0?r.name:void 0;if(s===void 0)continue;let o=Array.isArray(r.types)?r.types.filter(c=>typeof c=="string"):[];if(BH(o))continue;let l=`${s}\0${o.join("\0")}`;if(i.has(l))continue;i.add(l);let a={name:s};o.length>0&&(a.arity=o.length,a.typeSignature=o),n.push(a)}catch{continue}return n}function Ub(t){if(t==null)return D2;try{return{types:qH(t),relations:PH(t)}}catch{return D2}}var zH=["univ","none","iden","Int"],HH=["all","some","no","one","lone","set","sum","let","disj"],UH=["in","and","or","not","implies","iff","else"],FH=[{insert:".",detail:"join"},{insert:"->",detail:"product"},{insert:"+",detail:"union"},{insert:"&",detail:"intersection"},{insert:"-",detail:"difference"},{insert:"~",detail:"transpose"},{insert:"^",detail:"transitive closure"},{insert:"*",detail:"reflexive-transitive closure"},{insert:"#",detail:"cardinality"}],Fb;function N2(){if(Fb)return Fb.map(e=>({...e}));let t=[];for(let e of zH)t.push({label:e,kind:"keyword",detail:"built-in"});for(let e of HH)t.push({label:e,kind:"keyword",detail:"quantifier"});for(let e of UH)t.push({label:e,kind:"keyword",detail:"operator"});for(let e of FH)t.push({label:e.insert,insertText:e.insert,kind:"snippet",detail:e.detail});return Fb=t,t.map(e=>({...e}))}function _2(t){let e=[];for(let s of t.types)e.push({label:s.name,kind:"type",detail:"type"});for(let s of t.relations)e.push({label:s.name,kind:"relation",detail:s.arity!==void 0?`relation \xB7 arity ${s.arity}`:"relation"});let n=new Set(t.types.map(s=>s.name)),i=new Set,r=0;for(let s of t.types){if(r>=200)break;for(let o of s.atoms){if(r>=200)break;i.has(o)||n.has(o)||(i.add(o),e.push({label:o,kind:"atom",detail:`atom \xB7 ${s.name}`}),r+=1)}}return e}function jH(t,e){if(e.length===0)return 0;let n=t.toLowerCase(),i=e.toLowerCase();return n.startsWith(i)?0:n.includes(i)?1:2}function R2(t){switch(t){case"type":return 0;case"relation":return 1;case"atom":return 2;case"keyword":return 3;case"snippet":return 4;default:return 5}}function VH(t){return`${t.label}\0${t.insertText??t.label}`}function jb(t){let e=[];t&&e.push(..._2(t)),e.push(...N2());let n=L2(e);return i=>{let r=[];return n.forEach((s,o)=>{let l=jH(s.label,i);l<2&&r.push({c:s,rank:l,idx:o})}),r.sort((s,o)=>{if(s.rank!==o.rank)return s.rank-o.rank;let l=R2(s.c.kind),a=R2(o.c.kind);return l!==a?l-a:s.c.label.length!==o.c.label.length?s.c.label.length-o.c.label.length:s.idx-o.idx}),r.map(s=>s.c)}}function Vb(...t){let e=[];for(let n of t)for(let i of n)e.push(i);return L2(e)}function L2(t){let e=new Set,n=[];for(let i of t){let r=VH(i);e.has(r)||(e.add(r),n.push(i))}return n}var B2={accent:"#b5431a",accentText:"#fdf6ec",surface:"#faf8f2",surfaceRaised:"#f1ecdf",border:"#d9d2c0",text:"#221d14",textMuted:"#6e6553",danger:"#a32014",warning:"#8a6200",success:"#2f6c43",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#6d28a8",synType:"#0e6b6b",synRelation:"#1f4f9e",synOperator:"#b5431a",synString:"#7a5901",synComment:"#8a8170"},q2={accent:"#e08a3c",accentText:"#16100a",surface:"#12161e",surfaceRaised:"#1a202b",border:"#2d3645",text:"#e7e2d3",textMuted:"#94865f",danger:"#e06c5d",warning:"#d4a843",success:"#5fb98a",fontFamily:"'Avenir Next', 'Avenir', 'Seravek', 'Segoe UI Variable', 'Segoe UI', 'Trebuchet MS', sans-serif",monoFontFamily:"ui-monospace, 'Cascadia Code', 'JetBrains Mono', 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace",fontSize:"14px",radius:"2px",spacing:"8px",synKeyword:"#b48ee0",synType:"#5fb3a1",synRelation:"#7ba3e8",synOperator:"#e08a3c",synString:"#cfa75e",synComment:"#6e7889"},I2={accent:"--spytial-ed-accent",accentText:"--spytial-ed-accent-text",surface:"--spytial-ed-surface",surfaceRaised:"--spytial-ed-surface-raised",border:"--spytial-ed-border",text:"--spytial-ed-text",textMuted:"--spytial-ed-text-muted",danger:"--spytial-ed-danger",warning:"--spytial-ed-warning",success:"--spytial-ed-success",fontFamily:"--spytial-ed-font-family",monoFontFamily:"--spytial-ed-mono-font-family",fontSize:"--spytial-ed-font-size",radius:"--spytial-ed-radius",spacing:"--spytial-ed-spacing",synKeyword:"--spytial-ed-syn-keyword",synType:"--spytial-ed-syn-type",synRelation:"--spytial-ed-syn-relation",synOperator:"--spytial-ed-syn-operator",synString:"--spytial-ed-syn-string",synComment:"--spytial-ed-syn-comment"};function $b(t){let e={};return Object.keys(I2).forEach(n=>{let i=t[n];i!=null&&(e[I2[n]]=i)}),e}var $H=new Map([["light",B2],["dark",q2]]);function Yb(t){if(t!==void 0)return typeof t=="string"?$H.get(t):t}var YH=new Set(["univ","none","iden","all","some","no","one","lone","set","sum","let","disj","count","and","or","not","implies","else","in"]),KH=["->","<:",":>","<=",">=","=<","=>","!="],GH=new Set(["+","-","&","~","*","^",".","<",">","=","!","#"]);var QH=/[A-Za-z_$]/,XH=/[A-Za-z0-9_$]/,Zd=/[0-9]/,P2=/\s/;function Kb(t){let e=[],n=t.length,i=0,r=(s,o,l)=>{e.push({kind:s,text:t.slice(o,l),start:o,end:l})};for(;i<n;){let s=t[i];if(P2.test(s)){let l=i;for(;i<n&&P2.test(t[i]);)i++;r("whitespace",l,i);continue}if(s==="-"&&t[i+1]==="-"||s==="/"&&t[i+1]==="/"){let l=i;for(i+=2;i<n&&t[i]!==`
|
|
186
186
|
`;)i++;r("comment",l,i);continue}if(s==='"'||s==="'"){let l=s,a=i;for(i++;i<n&&t[i]!==l&&t[i]!==`
|
|
187
|
-
`;)t[i]==="\\"&&i+1<n?i+=2:i++;i<n&&t[i]===l&&i++,r("string",a,i);continue}if(
|
|
188
|
-
`)?"\u200B":null]})},$b=({value:t,onChange:e,placeholder:n,disabled:i=!1,selectorArity:r,complete:s,synthesize:o,diagnostics:l,highlight:a=!0,className:c,"aria-label":u,"aria-labelledby":f})=>{let h=(0,Z.useRef)(null),d=(0,Z.useRef)(null),p=(0,Z.useId)(),m=`${p}-listbox`,b=F=>`${p}-opt-${F}`,y=`${p}-diag`,[g,v]=(0,Z.useState)(!1),[S,w]=(0,Z.useState)([]),[O,k]=(0,Z.useState)(0),A=(0,Z.useRef)(0),R=(0,Z.useRef)(null),T=(0,Z.useRef)(0),[M,C]=(0,Z.useState)(!1),[H,le]=(0,Z.useState)(""),[Re,Kt]=(0,Z.useState)(!1),[ke,An]=(0,Z.useState)(null),[et,Kn]=(0,Z.useState)(null),ct=(0,Z.useRef)(null),tt=VH(l),nt=(0,Z.useCallback)(()=>{let F=h.current,te=d.current;!F||!te||(te.scrollTop=F.scrollTop,te.scrollLeft=F.scrollLeft)},[]),Lt=(0,Z.useRef)(0),Gt=(0,Z.useCallback)(()=>{let F=h.current;if(F){if(F.value===""){F.style.height="",Lt.current=0;return}if(F.clientWidth<60){Lt.current<10&&(Lt.current+=1,requestAnimationFrame(Gt));return}Lt.current=0,F.style.height="auto",F.style.height=`${F.scrollHeight}px`}},[]);(0,Z.useEffect)(()=>{Gt(),nt()},[t,Gt,nt]);let Gn=(0,Z.useCallback)((F,te)=>{if(!s)return;let{prefix:Es,start:Ds}=$H(F,te);T.current=Ds,R.current&&clearTimeout(R.current);let B=++A.current;R.current=setTimeout(()=>{let ye;try{ye=s(Es)}catch{return}Promise.resolve(ye).then(Fe=>{if(B===A.current){if(!Fe||Fe.length===0){w([]),v(!1);return}w(Fe),k(0),v(!0)}}).catch(()=>{B===A.current&&(w([]),v(!1))})},FH)},[s]),Qn=(0,Z.useCallback)(()=>{A.current++,R.current&&clearTimeout(R.current),v(!1),w([])},[]),Ea=(0,Z.useCallback)(F=>{let te=h.current,Es=te?te.selectionStart:t.length,Ds=F.insertText??F.label,B=t.slice(0,T.current)+Ds+t.slice(Es);e(B),Qn();let ye=T.current+Ds.length;requestAnimationFrame(()=>{let Fe=h.current;Fe&&(Fe.focus(),Fe.setSelectionRange(ye,ye))})},[t,e,Qn]),Vm=(0,Z.useCallback)(F=>{let te=F.target.value;e(te),Gn(te,F.target.selectionStart)},[e,Gn]),$m=(0,Z.useCallback)(F=>{if(F.code==="Space"&&(F.ctrlKey||F.metaKey)){F.preventDefault();let te=h.current;te&&Gn(te.value,te.selectionStart);return}if(!(!g||S.length===0))switch(F.key){case"ArrowDown":F.preventDefault(),k(te=>(te+1)%S.length);break;case"ArrowUp":F.preventDefault(),k(te=>(te-1+S.length)%S.length);break;case"Enter":case"Tab":F.preventDefault(),Ea(S[O]);break;case"Escape":F.preventDefault(),Qn();break;default:break}},[g,S,O,Ea,Qn,Gn]),Ym=(0,Z.useCallback)(F=>{let te=F.relatedTarget;te&&d.current?.parentElement?.contains(te)||Qn()},[Qn]),Km=(0,Z.useCallback)(()=>{C(!0),An(null),Kn(null),requestAnimationFrame(()=>ct.current?.focus())},[]),Mo=(0,Z.useCallback)(()=>{C(!1),Kt(!1),An(null),Kn(null),le("")},[]),Ro=(0,Z.useCallback)(async()=>{if(!o||Re)return;let F=H.trim();if(F){Kt(!0),An(null),Kn(null);try{let te=await o(F);Kn(te)}catch(te){An(te instanceof Error?te.message:"Synthesis failed. Try again.")}finally{Kt(!1)}}},[o,Re,H]),Da=(0,Z.useCallback)(()=>{et&&(e(et.value),Mo(),requestAnimationFrame(()=>h.current?.focus()))},[et,e,Mo]);(0,Z.useEffect)(()=>()=>{R.current&&clearTimeout(R.current)},[]);let Gm=n??(r==="binary"?"binary selector, e.g. parent":r==="unary"?"unary selector, e.g. Node":"selector expression"),Qm=l&&l.length>0?y:void 0,Af=du(g&&S.length>0,h,{align:"stretch",estimatedHeight:224});return(0,ce.jsxs)("div",{className:`spytial-ed-selector${tt?` spytial-ed-selector--${tt}`:""}${c?` ${c}`:""}`,children:[(0,ce.jsxs)("div",{className:`spytial-ed-selector-input-wrap${o?" spytial-ed-selector-input-wrap--with-synth":""}`,children:[a?(0,ce.jsx)("pre",{ref:d,className:"spytial-ed-selector-mirror","aria-hidden":"true",children:(0,ce.jsx)(N2,{value:t})}):null,(0,ce.jsx)("textarea",{ref:h,className:`spytial-ed-selector-textarea${a?"":" spytial-ed-selector-textarea--plain"}`,value:t,onChange:Vm,onScroll:nt,onKeyDown:$m,onBlur:Ym,placeholder:Gm,disabled:i,rows:1,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"soft",role:"combobox","aria-expanded":g,"aria-controls":m,"aria-autocomplete":"list","aria-activedescendant":g&&S.length>0?b(O):void 0,"aria-label":u,"aria-labelledby":f,"aria-describedby":Qm,"aria-invalid":tt==="error"||void 0}),o?(0,ce.jsx)("button",{type:"button",className:"spytial-ed-selector-synth-btn",onClick:Km,disabled:i,"aria-label":"Generate selector from a description","aria-haspopup":"dialog","aria-expanded":M,title:"Generate selector from a description",children:(0,ce.jsx)("span",{"aria-hidden":"true",children:"\u2728"})}):null,g&&S.length>0?(0,ce.jsx)("ul",{className:"spytial-ed-autocomplete",style:Af,id:m,role:"listbox","aria-label":"Selector completions",children:S.map((F,te)=>(0,ce.jsxs)("li",{id:b(te),role:"option","aria-selected":te===O,className:`spytial-ed-autocomplete-item${te===O?" spytial-ed-autocomplete-item--active":""}`,onMouseDown:Es=>{Es.preventDefault(),Ea(F)},onMouseEnter:()=>k(te),children:[(0,ce.jsx)("span",{className:`spytial-ed-autocomplete-kind spytial-ed-kind-${F.kind}`,"aria-hidden":"true"}),(0,ce.jsx)("span",{className:"spytial-ed-autocomplete-label",children:F.label}),F.detail?(0,ce.jsx)("span",{className:"spytial-ed-autocomplete-detail",children:F.detail}):null]},`${F.label}-${te}`))}):null]}),M?(0,ce.jsxs)("div",{className:"spytial-ed-synth-popover",role:"dialog","aria-label":"Generate selector",children:[(0,ce.jsxs)("div",{className:"spytial-ed-synth-row",children:[(0,ce.jsx)("input",{ref:ct,type:"text",className:"spytial-ed-synth-input",value:H,placeholder:"Describe the selector you want\u2026",disabled:Re,"aria-label":"Selector description",onChange:F=>le(F.target.value),onKeyDown:F=>{F.key==="Enter"?(F.preventDefault(),Ro()):F.key==="Escape"&&(F.preventDefault(),Mo())}}),(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-generate",onClick:()=>{Ro()},disabled:Re||H.trim().length===0,children:Re?"Generating\u2026":"Generate"})]}),ke?(0,ce.jsx)("div",{className:"spytial-ed-synth-error",role:"alert",children:ke}):null,et?(0,ce.jsxs)("div",{className:"spytial-ed-synth-result",children:[(0,ce.jsx)("pre",{className:"spytial-ed-synth-preview","aria-label":"Proposed selector",children:(0,ce.jsx)(N2,{value:et.value})}),et.explanation?(0,ce.jsx)("p",{className:"spytial-ed-synth-explanation",children:et.explanation}):null,(0,ce.jsxs)("div",{className:"spytial-ed-synth-actions",children:[(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-accept",onClick:Da,children:"Accept"}),(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-dismiss",onClick:Mo,children:"Dismiss"})]})]}):null]}):null,l&&l.length>0?(0,ce.jsx)("ul",{className:"spytial-ed-diagnostics",id:y,children:l.map((F,te)=>(0,ce.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${F.severity}`,children:[(0,ce.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,ce.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:F.message})]},te))}):null]})};var _2=Ae(On());var re=Ae(vt());function Fl(t){return t==null?"":String(t)}function YH(t){return Array.isArray(t)?t.map(e=>String(e)):t==null||t===""?[]:[String(t)]}function KH(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var GH=(t,e)=>(t??[]).filter(n=>n.fieldKey===e),QH=t=>{if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"},XH=({diagnostics:t,id:e})=>t.length>0?(0,re.jsx)("ul",{className:"spytial-ed-diagnostics",id:e,children:t.map((n,i)=>(0,re.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${n.severity}`,children:[(0,re.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,re.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:n.message})]},i))}):null,Qd=({fields:t,values:e,onChange:n,diagnostics:i,options:r,selectorProps:s,disabled:o=!1,className:l})=>{let a=(0,_2.useId)();return(0,re.jsx)("div",{className:`spytial-ed-fields${l?` ${l}`:""}`,children:t.map(c=>{if(c.kind==="group")return(0,re.jsx)(WH,{field:c,value:e[c.key],onChange:n,options:r,selectorProps:s,diagnostics:i,disabled:o},c.key);let u=`${a}-${c.key}`,f=`${u}-label`,h=`${u}-diag`,d=GH(i,c.key),p=QH(d),m=e[c.key];return(0,re.jsxs)("div",{className:`spytial-ed-field spytial-ed-field--${c.kind}${p?` spytial-ed-field--${p}`:""}`,children:[(0,re.jsxs)("label",{id:f,htmlFor:c.kind==="selector"?void 0:u,className:"spytial-ed-field-label",title:c.help,children:[c.label,c.required?(0,re.jsxs)("span",{className:"spytial-ed-field-required","aria-hidden":"true",title:"required",children:[" ","*"]}):null]}),(0,re.jsxs)("div",{className:"spytial-ed-field-control",children:[ZH(c,m,{fieldId:u,labelId:f,diagId:h,hasDiagnostics:d.length>0,disabled:o,onChange:n,options:r,selectorProps:s,diagnostics:d}),c.kind==="selector"?null:(0,re.jsx)(XH,{diagnostics:d,id:h})]})]},c.key)})})};function WH({field:t,value:e,onChange:n,options:i,selectorProps:r,diagnostics:s,disabled:o}){let l=KH(e)?e:void 0,a=!t.required;if(l===void 0)return(0,re.jsxs)("button",{type:"button",className:"spytial-ed-group-add",onClick:()=>n(t.key,{}),disabled:o,title:t.help,children:["+ ",t.label]});let c=(u,f)=>{let h={...l};f===void 0||f===""||Array.isArray(f)&&f.length===0?delete h[u]:h[u]=f,n(t.key,h)};return(0,re.jsxs)("fieldset",{className:"spytial-ed-group",children:[(0,re.jsxs)("legend",{className:"spytial-ed-group-legend",children:[(0,re.jsx)("span",{children:t.label}),a?(0,re.jsx)("button",{type:"button",className:"spytial-ed-group-remove",onClick:()=>n(t.key,void 0),disabled:o,"aria-label":`Remove ${t.label}`,title:`Remove ${t.label}`,children:"\xD7"}):null]}),(0,re.jsx)(Qd,{fields:t.children??[],values:l,onChange:c,options:i,selectorProps:r,diagnostics:s,disabled:o})]})}function ZH(t,e,n){let{fieldId:i,labelId:r,diagId:s,hasDiagnostics:o,disabled:l,onChange:a,options:c,selectorProps:u,diagnostics:f}=n,h=o?s:void 0;switch(t.kind){case"selector":{let d=u?.(t)??{};return(0,re.jsx)($b,{value:Fl(e),onChange:p=>a(t.key,p),placeholder:t.placeholder,disabled:l,selectorArity:t.selectorArity,"aria-labelledby":r,diagnostics:f,complete:d.complete,synthesize:d.synthesize,highlight:d.highlight})}case"relationName":case"typeName":{let d=t.kind==="relationName"?c?.relationNames:c?.typeNames,p=`${i}-list`,m=!!d&&d.length>0;return(0,re.jsxs)(re.Fragment,{children:[(0,re.jsx)("input",{id:i,type:"text",className:"spytial-ed-input spytial-ed-combo",value:Fl(e),placeholder:t.placeholder,disabled:l,list:m?p:void 0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":h,"aria-invalid":f.some(b=>b.severity==="error")||void 0,onChange:b=>a(t.key,b.target.value)}),m?(0,re.jsx)("datalist",{id:p,children:d.map(b=>(0,re.jsx)("option",{value:b},b))}):null]})}case"enum":{let d=t.options??[];if(t.multiple){let m=YH(e);return(0,re.jsx)("div",{className:"spytial-ed-pills",role:"group","aria-labelledby":r,"aria-describedby":h,children:d.map(b=>{let y=m.includes(b);return(0,re.jsx)("button",{type:"button",className:`spytial-ed-pill${y?" spytial-ed-pill--active":""}`,"aria-pressed":y,disabled:l,onClick:()=>{let g=y?m.filter(v=>v!==b):[...m,b];a(t.key,g)},children:b},b)})})}let p=Fl(e);return(0,re.jsx)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":r,"aria-describedby":h,children:d.map(m=>{let b=p===m;return(0,re.jsx)("button",{type:"button",className:`spytial-ed-pill${b?" spytial-ed-pill--active":""}`,role:"radio","aria-checked":b,disabled:l,onClick:()=>a(t.key,m),children:m},m)})})}case"number":{let d=e,p=d==null||d===""?"":String(d);return(0,re.jsx)("input",{id:i,type:"number",className:"spytial-ed-input spytial-ed-input--number",value:p,placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(m=>m.severity==="error")||void 0,onChange:m=>{let b=m.target.value;a(t.key,b===""?"":Number(b))}})}case"color":{let d=Fl(e)||"#000000";return(0,re.jsxs)("div",{className:"spytial-ed-color",children:[(0,re.jsx)("input",{id:i,type:"color",className:"spytial-ed-color-swatch",value:JH(d),disabled:l,"aria-describedby":h,"aria-label":`${t.label} color`,onChange:p=>a(t.key,p.target.value)}),(0,re.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-color-text",value:Fl(e),placeholder:t.placeholder??"#rrggbb",disabled:l,spellCheck:!1,"aria-label":`${t.label} hex value`,onChange:p=>a(t.key,p.target.value)})]})}case"boolean":{let d=e===!0||e==="true";return(0,re.jsx)("button",{id:i,type:"button",role:"switch","aria-checked":d,"aria-describedby":h,className:`spytial-ed-switch${d?" spytial-ed-switch--on":""}`,disabled:l,onClick:()=>a(t.key,!d),children:(0,re.jsx)("span",{className:"spytial-ed-switch-thumb","aria-hidden":"true"})})}default:return(0,re.jsx)("input",{id:i,type:"text",className:"spytial-ed-input",value:Fl(e),placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(d=>d.severity==="error")||void 0,onChange:d=>a(t.key,d.target.value)})}}function JH(t){let e=t.trim();return/^#[0-9a-fA-F]{6}$/.test(e)?e:/^#[0-9a-fA-F]{3}$/.test(e)?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:"#000000"}var sn=Ae(On());var Kb=[],q2=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?q2:Kb).push(n=n+t[e])})();function eU(t){if(t<768)return!1;for(let e=0,n=Kb.length;;){let i=e+n>>1;if(t<Kb[i])n=i;else if(t>=q2[i])e=i+1;else return!0;if(e==n)return!1}}function L2(t){return t>=127462&&t<=127487}var I2=8205;function P2(t,e,n=!0,i=!0){return(n?z2:tU)(t,e,i)}function z2(t,e,n){if(e==t.length)return e;e&&H2(t.charCodeAt(e))&&U2(t.charCodeAt(e-1))&&e--;let i=Yb(t,e);for(e+=B2(i);e<t.length;){let r=Yb(t,e);if(i==I2||r==I2||n&&eU(r))e+=B2(r),i=r;else if(L2(r)){let s=0,o=e-2;for(;o>=0&&L2(Yb(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function tU(t,e,n){for(;e>1;){let i=z2(t,e-2,n);if(i<e)return i;e--}return 0}function Yb(t,e){let n=t.charCodeAt(e);if(!U2(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return H2(i)?(n-55296<<10)+(i-56320)+65536:n}function H2(t){return t>=56320&&t<57344}function U2(t){return t>=55296&&t<56320}function B2(t){return t<65536?1:2}var ue=class t{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,i){[e,n]=Yl(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),jl.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Yl(this,e,n);let i=[];return this.decompose(e,n,i,0),jl.from(i,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),i=this.length-this.scanIdentical(e,-1),r=new ro(this),s=new ro(e);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new ro(this,e)}iterRange(e,n=this.length){return new ep(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new tp(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?t.empty:e.length<=32?new gn(e):jl.from(gn.split(e,[]))}},gn=class t extends ue{constructor(e,n=nU(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=e)return new Qb(r,l,i,o);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new t(F2(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=Jd(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new t(l,o.length+s.length));else{let a=l.length>>1;i.push(new t(l.slice(0,a)),new t(l.slice(a)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof t))return super.replace(e,n,i);[e,n]=Yl(this,e,n);let r=Jd(this.text,Jd(i.text,F2(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new t(r,s):jl.from(t.split(r,[]),s)}sliceString(e,n=this.length,i=`
|
|
189
|
-
`){[e,n]=
|
|
190
|
-
`){[e,n]=
|
|
191
|
-
`,this;e--}else if(r instanceof gn){let a=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=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=r.children[o+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof gn?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)}},ep=class{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new ro(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}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 i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},tp=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(ue.prototype[Symbol.iterator]=function(){return this.iter()},ro.prototype[Symbol.iterator]=ep.prototype[Symbol.iterator]=tp.prototype[Symbol.iterator]=function(){return this});var Qb=class{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function Yl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function mt(t,e,n=!0,i=!0){return P2(t,e,n,i)}function iU(t){return t>=56320&&t<57344}function rU(t){return t>=55296&&t<56320}function K2(t,e){let n=t.charCodeAt(e);if(!rU(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return iU(i)?(n-55296<<10)+(i-56320)+65536:n}function G2(t){return t<65536?1:2}var Xb=/\r\n?|\n/,jt=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(jt||(jt={})),mr=class t{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 i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,n=!1){Wb(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:Q2(this,e)}mapDesc(e,n=!1){return e.empty?this:Zb(this,e,n)}mapPos(e,n=-1,i=jt.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(i!=jt.Simple&&c>=e&&(i==jt.TrackDel&&r<e&&c>e||i==jt.TrackBefore&&r<e||i==jt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==r||n<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}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 t(e)}static create(e){return new t(e)}},Vt=class t extends mr{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 Wb(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return Zb(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let o=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(ue.empty);i.push(o?e.slice(s,s+o):ue.empty)}s+=o}return new t(n,i)}compose(e){return this.empty?e:e.empty?this:Q2(this,e,!0)}map(e,n=!1){return e.empty?this:Zb(this,e,n,!0)}iterChanges(e,n=!1){Wb(this,e,n)}get desc(){return mr.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new so(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,a-l);Dt(r,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;Dt(n,u,f),f>0&&fs(i,n,s.text),s.forward(u),l+=u}let c=e[o++];for(;l<c;){if(s.done)break e;let u=Math.min(s.len,c-l);Dt(n,u,-1),Dt(r,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),l+=u}}return{changes:new t(n,i),filtered:mr.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!r.length)return;o<n&&Dt(r,n-o,-1);let f=new t(r,s);l=l?l.compose(f.map(l)):f,r=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof t){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:f,to:h=f,insert:d}=u;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"?ue.of(d.split(i||Xb)):d:ue.empty,m=p.length;if(f==h&&m==0)return;f<o&&a(),f>o&&Dt(r,f-o,-1),Dt(r,h-f,m),fs(s,r,p),o=h}}return c(e),a(!l),l}static empty(e){return new t(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(ue.empty);i[r]=ue.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new t(n,i)}static createSet(e,n){return new t(e,n)}};function Dt(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function fs(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(ue.empty);t.push(n)}}function Wb(t,e,n){let i=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,u=s,f=ue.empty;for(;c+=l,u+=a,a&&i&&(f=f.append(i[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,s,u,f),r=c,s=u}}}function Zb(t,e,n,i=!1){let r=[],s=i?[]:null,o=new so(t),l=new so(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);Dt(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(Dt(r,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(Dt(r,0,o.ins),s&&fs(s,r,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let f=Math.min(u,l.len);c+=f,u-=f,l.forward(f)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;Dt(r,c,a<o.i?o.ins:0),s&&a<o.i&&fs(s,r,o.text),a=o.i,o.forward(o.len-u)}else{if(o.done&&l.done)return s?Vt.createSet(r,s):mr.create(r);throw new Error("Mismatched change set lengths")}}}function Q2(t,e,n=!1){let i=[],r=n?[]:null,s=new so(t),o=new so(e);for(let l=!1;;){if(s.done&&o.done)return r?Vt.createSet(i,r):mr.create(i);if(s.ins==0)Dt(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)Dt(i,0,o.ins,l),r&&fs(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=i.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Dt(i,a,u,l),r&&u&&fs(r,i,o.text)}else o.ins==-1?(Dt(i,s.off?0:s.len,a,l),r&&fs(r,i,s.textBit(a))):(Dt(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&fs(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),s.forward2(a),o.forward(a)}}}}var so=class{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?ue.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?ue.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},to=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new t(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return N.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return N.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!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 N.range(e.anchor,e.head)}static create(e,n,i,r){return new t(e,n,i,r)}},N=class t{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:t.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new t([this.main],0)}addRange(e,n=!0){return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,t.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map(n=>to.fromJSON(n)),e.main)}static single(e,n=e){return new t([t.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 i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return t.normalized(e.slice(),n);i=s.to}return new t(e,n)}static cursor(e,n=0,i,r){return to.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,s){let o=r==null?7:Math.min(6,r);return!s&&e!=n&&(s=n<e?1:-1),s&&(o|=s<0?8:16),n<e?to.create(n,e,o|32,i):to.create(e,n,o,i)}static undirectionalRange(e,n){return to.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?t.range(a,l):t.range(l,a))}}return new t(e,n)}};function X2(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}var av=0,I=class t{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=av++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new t(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:cv),!!e.static,e.enables)}of(e){return new Vl([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vl(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vl(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}};function cv(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}var Vl=class{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=av++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(a&&h.docChanged||c&&(h.docChanged||h.selection)||Jb(f,u)){let d=i(f);if(l?!j2(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,h)=>{let d,p=h.config.address[s];if(p!=null){let m=rp(h,p);if(this.dependencies.every(b=>b instanceof I?h.facet(b)===f.facet(b):b instanceof Mt?h.field(b,!1)==f.field(b,!1):!0)||(l?j2(d=i(f),m,r):r(d=i(f),m)))return f.values[o]=m,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}};function j2(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function Jb(t,e){let n=!1;for(let i of e)mu(t,i)&1&&(n=!0);return n}function sU(t,e,n){let i=n.map(a=>t[a.id]),r=n.map(a=>a.type),s=i.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<i.length;u++){let f=rp(a,i[u]);if(r[u]==2)for(let h of f)c.push(h);else c.push(f)}return e.combine(c)}return{create(a){for(let c of i)mu(a,c);return a.values[o]=l(a),1},update(a,c){if(!Jb(a,s))return 0;let u=l(a);return e.compare(u,a.values[o])?0:(a.values[o]=u,1)},reconfigure(a,c){let u=Jb(a,i),f=c.config.facets[e.id],h=c.facet(e);if(f&&!u&&cv(n,f))return a.values[o]=h,0;let d=l(a);return e.compare(d,h)?(a.values[o]=h,0):(a.values[o]=d,1)}}}var Xd=I.define({static:!0}),Mt=class t{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new t(av++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Xd).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Xd),o=r.facet(Xd),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,Xd.of({field:this,create:e})]}get extension(){return this}},no={lowest:4,low:3,default:2,high:1,highest:0};function pu(t){return e=>new np(e,t)}var vu={highest:pu(no.highest),high:pu(no.high),default:pu(no.default),low:pu(no.low),lowest:pu(no.lowest)},np=class{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}},Kl=class t{of(e){return new gu(this,e)}reconfigure(e){return t.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},gu=class{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}},ip=class t{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.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,i){let r=[],s=Object.create(null),o=new Map;for(let h of oU(e,n,o))h instanceof Mt?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),a=[],c=[];for(let h of r)l[h.id]=c.length<<1,c.push(d=>h.slot(d));let u=i?.config.facets;for(let h in s){let d=s[h],p=d[0].facet,m=u&&u[h]||[];if(d.every(b=>b.type==0))if(l[p.id]=a.length<<1|1,cv(m,d))a.push(i.facet(p));else{let b=p.combine(d.map(y=>y.value));a.push(i&&p.compare(b,i.facet(p))?i.facet(p):b)}else{for(let b of d)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=c.length<<1,c.push(y=>b.dynamicSlot(y)));l[p.id]=c.length<<1,c.push(b=>sU(b,p,d))}}let f=c.map(h=>h(l));return new t(e,o,f,l,a,s)}};function oU(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof gu&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof gu){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,l)}else if(o instanceof np)s(o.inner,o.prec);else if(o instanceof Mt)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Vl)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,no.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(c==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(t,no.default),i.reduce((o,l)=>o.concat(l))}function mu(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function rp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}var W2=I.define(),ev=I.define({combine:t=>t.some(e=>e),static:!0}),Z2=I.define({combine:t=>t.length?t[0]:void 0,static:!0}),J2=I.define(),eE=I.define(),tE=I.define(),nE=I.define({combine:t=>t.length?t[0]:!1}),qn=class{constructor(e,n){this.type=e,this.value=n}static define(){return new tv}},tv=class{of(e){return new qn(this,e)}},nv=class{constructor(e){this.map=e}of(e){return new he(this,e)}},he=class t{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 t(this.type,n)}is(e){return this.type==e}static define(e={}){return new nv(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}};he.reconfigure=he.define();he.appendConfig=he.define();var pt=class t{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&X2(i,n.newLength),s.some(l=>l.type==t.time)||(this.annotations=s.concat(t.time.of(Date.now())))}static create(e,n,i,r,s,o){return new t(e,n,i,r,s,o)}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(t.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};pt.time=qn.define();pt.userEvent=qn.define();pt.addToHistory=qn.define();pt.remote=qn.define();function lU(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else if(r<e.length)s=e[r++],o=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function iE(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=Vt.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:he.mapEffects(t.effects,r).concat(he.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function iv(t,e,n){let i=e.selection,r=$l(e.annotations);return e.userEvent&&(r=r.concat(pt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Vt?e.changes:Vt.of(e.changes||[],n,t.facet(Z2)),selection:i&&(i instanceof N?i:N.single(i.anchor,i.head)),effects:$l(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function rE(t,e,n){let i=iv(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;i=iE(i,iv(t,e[s],o?i.changes.newLength:t.doc.length),o)}let r=pt.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return cU(n?aU(r):r)}function aU(t){let e=t.startState,n=!0;for(let r of e.facet(J2)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:lU(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=Vt.empty(e.doc.length);else{let o=t.changes.filter(n);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=pt.create(e,r,t.selection&&t.selection.map(s),he.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(eE);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof pt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof pt?t=s[0]:t=rE(e,$l(s),!1)}return t}function cU(t){let e=t.startState,n=e.facet(tE),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=iE(i,iv(e,s,t.changes.newLength),!0))}return i==t?t:pt.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}var uU=[];function $l(t){return t==null?uU:Array.isArray(t)?t:[t]}var oi=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(oi||(oi={})),fU=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,rv;try{rv=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function hU(t){if(rv)return rv.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||fU.test(n)))return!0}return!1}function dU(t){return e=>{if(!/\S/.test(e))return oi.Space;if(hU(e))return oi.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return oi.Word;return oi.Other}}var Ee=class t{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)mu(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return mu(this,i),rp(this,i)}update(...e){return rE(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(Kl.reconfigure)?(n&&(r=new Map,n.compartments.forEach((a,c)=>r.set(c,a)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(he.reconfigure)?(n=null,i=l.value):l.is(he.appendConfig)&&(n=null,i=$l(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=ip.resolve(i,r,this),s=new t(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(ev)?e.newSelection:e.newSelection.asSingle();new t(n,e.newDoc,o,s,(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:N.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=$l(i.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(r);for(let h=0;h<l;h++)s[h]=s[h].map(u);let f=r.mapDesc(c,!0);s.push(a.range.map(f)),r=r.compose(u),o=he.mapEffects(o,u).concat(he.mapEffects($l(a.effects),f))}return{changes:r,selection:N.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Vt?e:Vt.of(e,this.doc.length,this.facet(t.lineSeparator))}toText(e){return ue.of(e.split(this.facet(t.lineSeparator)||Xb))}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:(mu(this,n),rp(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Mt&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return t.create({doc:e.doc,selection:N.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=ip.resolve(e.extensions||[],new Map),i=e.doc instanceof ue?e.doc:ue.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||Xb)),r=e.selection?e.selection instanceof N?e.selection:N.single(e.selection.anchor,e.selection.head):N.single(0);return X2(r,i.length),n.staticFacet(ev)||(r=r.asSingle()),new t(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(t.tabSize)}get lineBreak(){return this.facet(t.lineSeparator)||`
|
|
192
|
-
`}get readOnly(){return this.facet(nE)}phrase(e,...n){for(let i of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(W2))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return dU(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=mt(n,o,!1);if(s(n.slice(a,o))!=oi.Word)break;o=a}for(;l<r;){let a=mt(n,l);if(s(n.slice(l,a))!=oi.Word)break;l=a}return o==l?null:N.range(o+i,l+i)}};Ee.allowMultipleSelections=ev;Ee.tabSize=I.define({combine:t=>t.length?t[0]:4});Ee.lineSeparator=Z2;Ee.readOnly=nE;Ee.phrases=I.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});Ee.languageData=W2;Ee.changeFilter=J2;Ee.transactionFilter=eE;Ee.transactionExtender=tE;Kl.reconfigure=he.define();function hs(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var Ii=class{eq(e){return this==e}range(e,n=e){return yu.create(e,n,this)}};Ii.prototype.startSide=Ii.prototype.endSide=0;Ii.prototype.point=!1;Ii.prototype.mapMode=jt.TrackDel;function uv(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}var yu=class t{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new t(e,n,i)}};function sv(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var ov=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-n;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,f=this.to[a]+e,h,d;if(u==f){let p=n.mapPos(u,c.startSide,c.mapMode);if(p==null||(h=d=p,c.startSide!=c.endSide&&(d=n.mapPos(u,c.endSide),d<h)))continue}else if(h=n.mapPos(u,c.startSide),d=n.mapPos(f,c.endSide),h>d||h==d&&c.startSide>0&&c.endSide<=0)continue;(d-h||c.endSide-c.startSide)<0||(o<0&&(o=h),c.point&&(l=Math.max(l,d-h)),i.push(c),r.push(h-o),s.push(d-o))}return{mapped:i.length?new t(r,s,i,l):null,pos:o}}},de=class t{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new t(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let 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:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(sv)),this.isEmpty)return n.length?t.of(n):this;let l=new sp(this,null,-1).goto(0),a=0,c=[],u=new gr;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++];u.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(yu.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?t.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),n.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:f}=a.map(l,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),i.push(f))}}let s=this.nextLayer.map(e);return n.length==0?s:new t(i,n,s||t.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return bu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return bu.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=V2(o,l,i),c=new io(o,a,s),u=new io(l,a,s);i.iterGaps((f,h,d)=>$2(c,f,u,h,d,r)),i.empty&&i.length==0&&$2(c,0,u,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=V2(s,o),a=new io(s,l,0).goto(i),c=new io(o,l,0).goto(i);for(;;){if(a.to!=c.to||!lv(a.active,c.active)||a.point&&(!c.point||!uv(a.point,c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,n,i,r,s=-1){let o=new io(e,null,s).goto(n),l=n,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,a);r.point(l,c,o.point,u,f,o.pointRank),a=Math.min(o.openEnd(c),u.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,n=!1){let i=new gr;for(let r of e instanceof yu?[e]:n?pU(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return t.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=t.empty;r=r.nextLayer)n=new t(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}};de.empty=new de([],[],null,-1);function pU(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(sv(e,i)>0)return t.slice().sort(sv);e=i}return t}de.empty.nextLayer=de.empty;var gr=class t{finishChunk(e){this.chunks.push(new ov(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,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.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 i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(de.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=de.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}};function V2(t,e,n){let i=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=i.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!n?.touchesRange(l,l+s.chunk[o].length)&&r.add(s.chunk[o])}return r}var sp=class{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}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],i=e+n.from[this.rangeIndex];if(this.from=i,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}},bu=class t{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new sp(o,n,i,s));return r.length==1?r[0]:new t(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)Gb(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)Gb(this.heap,i);(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(),Gb(this.heap,0)}}};function Gb(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}var io=class{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=bu.from(e,n,i)}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){Wd(this.active,e),Wd(this.activeTo,e),Wd(this.activeRank,e),this.minActive=Y2(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;Zd(this.active,n,i),Zd(this.activeTo,n,r),Zd(this.activeRank,n,s),e&&Zd(e,n,this.cursor.from),this.minActive=Y2(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Wd(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}};function $2(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e,c=!!s.boundChange;for(let u=!1;;){let f=t.to+a-n.to,h=f||t.endSide-n.endSide,d=h<0?t.to+a:n.to,p=Math.min(d,o);if(t.point||n.point?(t.point&&n.point&&uv(t.point,n.point)&&lv(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,p,t.point,n.point),u=!1):(u&&s.boundChange(l),p>l&&!lv(t.active,n.active)&&s.compareRange(l,p,t.active,n.active),c&&p<o&&(f||t.openEnd(d)!=n.openEnd(d))&&(u=!0)),d>o)break;l=d,h<=0&&t.next(),h>=0&&n.next()}}function lv(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!uv(t[n],e[n]))return!1;return!0}function Wd(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function Zd(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function Y2(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function oo(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=mt(t,r));return i}function sE(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=mt(t,r)}return i===!0?-1:t.length}var oE=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),fv=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),lE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Pn=class{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))s(d.split(/,\s*/).map(m=>o.map(b=>m.replace(/&/,b))).reduce((m,b)=>m.concat(b)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),p,u,h)}else p!=null&&u.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||h)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
193
|
-
`)}static newName(){let e=
|
|
194
|
-
`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var yr={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:"'"},Gl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},mU=typeof navigator<"u"&&/Mac/.test(navigator.platform),gU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(Je=0;Je<10;Je++)yr[48+Je]=yr[96+Je]=String(Je);var Je;for(Je=1;Je<=24;Je++)yr[Je+111]="F"+Je;var Je;for(Je=65;Je<=90;Je++)yr[Je]=String.fromCharCode(Je+32),Gl[Je]=String.fromCharCode(Je);var Je;for(op in yr)Gl.hasOwnProperty(op)||(Gl[op]=yr[op]);var op;function cE(t){var e=mU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||gU&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Gl:yr)[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 yn(){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 i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)uE(t,arguments[e]);return t}function uE(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++)uE(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}var $t=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},xv=typeof document<"u"?document:{documentElement:{style:{}}},wv=/Edge\/(\d+)/.exec($t.userAgent),VE=/MSIE \d/.test($t.userAgent),kv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($t.userAgent),qp=!!(VE||kv||wv),fE=!qp&&/gecko\/(\d+)/i.test($t.userAgent),dv=!qp&&/Chrome\/(\d+)/.exec($t.userAgent),hE="webkitFontSmoothing"in xv.documentElement.style,Av=!qp&&/Apple Computer/.test($t.vendor),dE=Av&&(/Mobile\/\w+/.test($t.userAgent)||$t.maxTouchPoints>2),L={mac:dE||/Mac/.test($t.platform),windows:/Win/.test($t.platform),linux:/Linux|X11/.test($t.platform),ie:qp,ie_version:VE?xv.documentMode||6:kv?+kv[1]:wv?+wv[1]:0,gecko:fE,gecko_version:fE?+(/Firefox\/(\d+)/.exec($t.userAgent)||[0,0])[1]:0,chrome:!!dv,chrome_version:dv?+dv[1]:0,ios:dE,android:/Android\b/.test($t.userAgent),webkit:hE,webkit_version:hE?+(/\bAppleWebKit\/(\d+)/.exec($t.userAgent)||[0,0])[1]:0,safari:Av,safari_version:Av?+(/\bVersion\/(\d+(\.\d+)?)/.exec($t.userAgent)||[0,0])[1]:0,tabSize:xv.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function c1(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}var bp=Object.create(null);function u1(t,e,n){if(t==e)return!0;t||(t=bp),e||(e=bp);let i=Object.keys(t),r=Object.keys(e);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function yU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function pE(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function bU(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}var Sr=class{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},rn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(rn||(rn={})),Se=class extends Ii{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Ru(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new co(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=$E(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new co(e,i,r,n,e.widget||null,!0)}static line(e){return new Nu(e)}static set(e,n=!1){return de.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};Se.none=de.empty;var Ru=class t extends Se{constructor(e){let{start:n,end:i}=$E(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?c1(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||bp}eq(e){return this==e||e instanceof t&&this.tagName==e.tagName&&u1(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}};Ru.prototype.point=!1;var Nu=class t extends Se{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof t&&this.spec.class==e.spec.class&&u1(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)}};Nu.prototype.mapMode=jt.TrackBefore;Nu.prototype.point=!0;var co=class t extends Se{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?jt.TrackBefore:jt.TrackAfter:jt.TrackDel}get type(){return this.startSide!=this.endSide?rn.WidgetRange:this.startSide<=0?rn.WidgetBefore:rn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof t&&vU(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)}};co.prototype.point=!0;function $E(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function vU(t,e){return t==e||!!(t&&e&&t.compare(e))}function ea(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}var vp=class t extends Ii{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof t&&this.tagName==e.tagName&&u1(this.attributes,e.attributes)}static create(e){return new t(e.tagName,e.attributes||bp,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return de.of(e,n)}};vp.prototype.startSide=vp.prototype.endSide=-1;function _u(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Ov(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function wu(t,e){if(!e.anchorNode)return!1;try{return Ov(t,e.anchorNode)}catch{return!1}}function gp(t){return t.nodeType==3?Lu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function ku(t,e,n,i){return n?mE(t,e,n,i,-1)||mE(t,e,n,i,1):!1}function ms(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Sp(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function mE(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:xr(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=ms(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?xr(t):0}else return!1}}function xr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function xp(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function SU(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function YE(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function xU(t,e,n,i,r,s,o,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let h,d=u==a.body,p=1,m=1;if(d)h=SU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let g=u.getBoundingClientRect();({scaleX:p,scaleY:m}=YE(u,g)),h={left:g.left,right:g.left+u.clientWidth*p,top:g.top,bottom:g.top+u.clientHeight*m}}let b=0,y=0;if(r=="nearest")e.top<h.top+o?(y=e.top-(h.top+o),n>0&&e.bottom>h.bottom+y&&(y=e.bottom-h.bottom+o)):e.bottom>h.bottom-o&&(y=e.bottom-h.bottom+o,n<0&&e.top-y<h.top&&(y=e.top-(h.top+o)));else{let g=e.bottom-e.top,v=h.bottom-h.top;y=(r=="center"&&g<=v?e.top+g/2-v/2:r=="start"||r=="center"&&n<0?e.top-o:e.bottom-v+o)-h.top}if(i=="nearest"?e.left<h.left+s?(b=e.left-(h.left+s),n>0&&e.right>h.right+b&&(b=e.right-h.right+s)):e.right>h.right-s&&(b=e.right-h.right+s,n<0&&e.left<h.left+b&&(b=e.left-(h.left+s))):b=(i=="center"?e.left+(e.right-e.left)/2-(h.right-h.left)/2:i=="start"==l?e.left-s:e.right-(h.right-h.left)+s)-h.left,b||y)if(d)c.scrollBy(b,y);else{let g=0,v=0;if(y){let S=u.scrollTop;u.scrollTop+=y/m,v=(u.scrollTop-S)*m}if(b){let S=u.scrollLeft;u.scrollLeft+=b/p,g=(u.scrollLeft-S)*p}e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v},g&&Math.abs(g-b)<1&&(i="nearest"),v&&Math.abs(v-y)<1&&(r="nearest")}if(d)break;(e.top<h.top||e.bottom>h.bottom||e.left<h.left||e.right>h.right)&&(e={left:Math.max(e.left,h.left),right:Math.min(e.right,h.right),top:Math.max(e.top,h.top),bottom:Math.min(e.bottom,h.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function KE(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var Tv=class{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:i}=e;this.set(n,Math.min(e.anchorOffset,n?xr(n):0),i,Math.min(e.focusOffset,i?xr(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}},lo=null;L.safari&&L.safari_version>=26&&(lo=!1);function GE(t){if(t.setActive)return t.setActive();if(lo)return t.focus(lo);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(lo==null?{get preventScroll(){return lo={preventScroll:!0},!0}}:void 0),!lo){lo=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}var gE;function Lu(t,e,n=e){let i=gE||(gE=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function ta(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function wU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function kU(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,xr(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=xr(n))}else{if(n==t)return!0;i=ms(n),n=n.parentNode}}function QE(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function XE(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=xr(n)}else if(n.parentNode&&!Sp(n))i=ms(n),n=n.parentNode;else return null}}function WE(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Sp(n))i=ms(n)+1,n=n.parentNode;else return null}}var qi=class t{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new t(e.parentNode,ms(e),n)}static after(e,n){return new t(e.parentNode,ms(e)+1,n)}},_e=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(_e||(_e={})),uo=_e.LTR,f1=_e.RTL;function ZE(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}var AU=ZE("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),OU=ZE("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 JE(t){return t<=247?AU[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?OU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}var TU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,Un=class{get dir(){return this.level%2?f1:uo}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function eD(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!eD(i.inner,r.inner))return!1}return!0}var Te=[];function CU(t,e,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,l=s<i.length?i[s].from:n,a=s?256:r;for(let c=o,u=a,f=a;c<l;c++){let h=JE(t.charCodeAt(c));h==512?h=u:h==8&&f==4&&(h=16),Te[c]=h==4?2:h,h&7&&(f=h),u=h}for(let c=o,u=a,f=a;c<l;c++){let h=Te[c];if(h==128)c<l-1&&u==Te[c+1]&&u&24?h=Te[c]=u:Te[c]=256;else if(h==64){let d=c+1;for(;d<l&&Te[d]==64;)d++;let p=c&&u==8||d<n&&Te[d]==8?f==1?1:8:256;for(let m=c;m<d;m++)Te[m]=p;c=d-1}else h==8&&f==1&&(Te[c]=1);u=h,h&7&&(f=h)}}}function EU(t,e,n,i,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,u=o<i.length?i[o].from:n;for(let f=c,h,d,p;f<u;f++)if(d=Cv[h=t.charCodeAt(f)])if(d<0){for(let m=l-3;m>=0;m-=3)if(Bi[m+1]==-d){let b=Bi[m+2],y=b&2?r:b&4?b&1?s:r:0;y&&(Te[f]=Te[Bi[m]]=y),l=m;break}}else{if(Bi.length==189)break;Bi[l++]=f,Bi[l++]=h,Bi[l++]=a}else if((p=Te[f])==2||p==1){let m=p==r;a=m?0:1;for(let b=l-3;b>=0;b-=3){let y=Bi[b+2];if(y&2)break;if(m)Bi[b+2]|=2;else{if(y&4)break;Bi[b+2]|=4}}}}}function DU(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let a=o;a<l;){let c=Te[a];if(c==256){let u=a+1;for(;;)if(u==l){if(r==n.length)break;u=n[r++].to,l=r<n.length?n[r].from:e}else if(Te[u]==256)u++;else break;let f=s==1,h=(u<e?Te[u]:i)==1,d=f==h?f?1:2:i;for(let p=u,m=r,b=m?n[m-1].to:t;p>a;)p==b&&(p=n[--m].from,b=m?n[m-1].to:t),Te[--p]=d;a=u}else s=c,a++}}}function Ev(t,e,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;a<n;){let u=!0,f=!1;if(c==s.length||a<s[c].from){let m=Te[a];m!=l&&(u=!1,f=m==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,p=a;e:for(;;)if(c<s.length&&p==s[c].from){if(f)break e;let m=s[c];if(!u)for(let b=m.to,y=c+1;;){if(b==n)break e;if(y<s.length&&s[y].from==b)b=s[y++].to;else{if(Te[b]==l)break e;break}}if(c++,h)h.push(m);else{m.from>a&&o.push(new Un(a,m.from,d));let b=m.direction==uo!=!(d%2);Dv(t,b?i+1:i,r,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==n||(u?Te[p]!=l:Te[p]==l))break;p++}h?Ev(t,a,p,i+1,r,h,o):a<p&&o.push(new Un(a,p,d)),a=p}else for(let a=n,c=s.length;a>e;){let u=!0,f=!1;if(!c||a>s[c-1].to){let m=Te[a-1];m!=l&&(u=!1,f=m==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,p=a;e:for(;;)if(c&&p==s[c-1].to){if(f)break e;let m=s[--c];if(!u)for(let b=m.from,y=c;;){if(b==e)break e;if(y&&s[y-1].to==b)b=s[--y].from;else{if(Te[b-1]==l)break e;break}}if(h)h.push(m);else{m.to<a&&o.push(new Un(m.to,a,d));let b=m.direction==uo!=!(d%2);Dv(t,b?i+1:i,r,m.inner,m.from,m.to,o),a=m.from}p=m.from}else{if(p==e||(u?Te[p-1]!=l:Te[p-1]==l))break;p--}h?Ev(t,p,a,i+1,r,h,o):p<a&&o.push(new Un(p,a,d)),a=p}}function Dv(t,e,n,i,r,s,o){let l=e%2?2:1;CU(t,r,s,i,l),EU(t,r,s,i,l),DU(r,s,i,l),Ev(t,r,s,e,n,i,o)}function MU(t,e,n){if(!t)return[new Un(0,0,e==f1?1:0)];if(e==uo&&!n.length&&!TU.test(t))return tD(t.length);if(n.length)for(;t.length>Te.length;)Te[Te.length]=256;let i=[],r=e==uo?0:1;return Dv(t,r,r,n,0,t.length,i),i}function tD(t){return[new Un(0,t,0)]}var nD="";function RU(t,e,n,i,r){var s;let o=i.head-t.from,l=Un.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],c=a.side(r,n);if(o==c){let h=l+=r?1:-1;if(h<0||h>=e.length)return null;a=e[l=h],o=a.side(!r,n),c=a.side(r,n)}let u=mt(t.text,o,a.forward(r,n));(u<a.from||u>a.to)&&(u=c),nD=t.text.slice(Math.min(o,u),Math.max(o,u));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&u==c&&f.level+(r?0:1)<a.level?N.cursor(f.side(!r,n)+t.from,f.forward(r,n)?1:-1,f.level):N.cursor(u+t.from,a.forward(r,n)?-1:1,a.level)}function NU(t,e,n){for(let i=e;i<n;i++){let r=JE(t.charCodeAt(i));if(r==1)return uo;if(r==2||r==4)return f1}return uo}var iD=I.define(),rD=I.define(),sD=I.define(),oD=I.define(),Mv=I.define(),lD=I.define(),aD=I.define(),h1=I.define(),d1=I.define(),cD=I.define({combine:t=>t.some(e=>e)}),_U=I.define({combine:t=>t.some(e=>e)}),uD=I.define(),Au=class t{constructor(e,n,i,r,s,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new t(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 t(N.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},lp=he.define({map:(t,e)=>t.map(e)}),fD=he.define();function bn(t,e,n){let i=t.facet(oD);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}var br=I.define({combine:t=>t.length?t[0]:!0}),LU=0,Xl=I.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}}),Fn=class t{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Xl.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Xl.of({plugin:this,arg:e}))}static define(e,n){let{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=n||{};return new t(LU++,e,i,r,l=>{let a=[];return o&&a.push(Pp.of(c=>{let u=c.plugin(l);return u?o(u):Se.none})),s&&a.push(s(l)),a})}static fromClass(e,n){return t.define((i,r)=>new e(i,r),n)}},Ou=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(bn(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){bn(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(i){bn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},hD=I.define(),p1=I.define(),Pp=I.define(),dD=I.define(),m1=I.define(),Iu=I.define(),pD=I.define();function yE(t,e){let n=t.state.facet(pD);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return de.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,f=r;for(let h=l.length-1;h>=0;h--,a--){let d=l[h].spec.bidiIsolate,p;if(d==null&&(d=NU(e.text,c,u)),a>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==d)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:d,inner:[]};f.push(m),f=m.inner}}}}),r}var mD=I.define();function g1(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(mD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}var Su=I.define(),ai=class t{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new t(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,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,a=s<n.length?n[s]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+o,f=c,h=u;for(;;)if(s<n.length&&n[s]<=f){let d=n[s+1];s+=2,f=Math.max(f,d);for(let p=r;p<e.length&&e[p].fromB<=f;p++)o=e[p].toA-e[p].toB;h=Math.max(h,d+o)}else if(r<e.length&&e[r].fromB<=f){let d=e[r++];f=Math.max(f,d.toB),h=Math.max(h,d.toA),o=d.toA-d.toB}else break;i.push(new t(u,h,c,f))}return i}},wp=class t{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Vt.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new ai(s,o,l,a))),this.changedRanges=r}static create(e,n,i){return new t(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},IU=[],ze=class{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return IU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&yU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=ms(this.dom),r=this.length?e>0:n>0;return new qi(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof ia)return e;return null}static get(e){return e.cmTile}},na=class extends ze{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=bE(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=bE(r);this.length=o}};function bE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var ia=class extends na{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=ze.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof vr)n.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},vr=class t extends na{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},ra=class t extends na{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new t(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,l=-1;function a(u,f){for(let h=0,d=0;h<u.children.length&&d<=f;h++){let p=u.children[h],m=d+p.length;m>=f&&(p.isComposite()?a(p,f-d):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&qU(o,p)))&&(m>f||p.flags&32)?(o=p,l=f-d):(d<f||p.flags&16&&!p.isHidden)&&(r=p,s=f-d)),d=m}}a(this,e);let c=(n<0?r:o)||r||o;return c?{tile:c,offset:c==r?s:l}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):BU(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new qi(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new qi(a.dom,0);a==i.tile&&(l=!0)}}return new qi(this.dom,0)}};function BU(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=gp(e);return n[n.length-1]||null}function qU(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}var nn=class t extends na{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},ao=class t extends ze{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,o=e,l=0;e==0&&n<0||e==r&&n>=0?L.chrome||L.gecko||(e?(s--,l=1):o<r&&(o++,l=-1)):n<0?s--:o<r&&o++;let a=Lu(this.dom,s,o).getClientRects();if(!a.length)return null;let c=a[(l?l<0:n>=0)?0:a.length-1];return L.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),i==null?c:xp(c,(l?l>0:n<0)==i)}static of(e,n){let i=new t(n||document.createTextNode(e),e);return n||(i.flags|=2),i}},fo=class t extends ze{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return xp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return xp(o,!l)}}get overrideDOMText(){if(!this.length)return ue.empty;let{root:e}=this;if(!e)return ue.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new t(s,i,e,r)}},sa=class extends ze{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return ue.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:xp(r,n>0==i)}},Rv=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!i||i.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!c,s++,e-=a.length):(l.push({tile:r,index:s}),r=a,s=0,i&&a.isComposite()&&i.enter(a))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,r.length-s);i&&i.skip(r,s,s+a),e-=a,s+=a}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Nv=class{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}},_v=class{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let o=this.ensureMarks(n,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new ao(l.dom,l.text+e);a.parent=o}else o.append(r||ao.of(e,(s=this.cache.find(ao))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?pv(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=r.lastChild;if(c instanceof nn&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(pv(a.dom)),r=c;else{if(this.cache.reused.get(a)){let f=ze.get(a.dom);f&&f.setDOM(pv(a.dom))}let u=nn.of(a.mark,a.dom);r.append(u),r=u}this.cache.reused.set(a,2)}let s=ze.get(e.text);s&&this.cache.reused.set(s,2);let o=new ao(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=gD);let r=ra.start(e,n||((i=this.cache.find(ra))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof nn&&l.mark.eq(o))r=l,n--;else{let a=nn.of(o,(i=this.cache.find(nn,c=>c.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!vE(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(L.ios&&vE(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(mv,0,32)||new fo(mv.toDOM(),0,mv,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new Nv(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof vr&&r.wrapper.eq(i.wrapper))n=r;else{let s=vr.of(i.wrapper,(e=this.cache.find(vr,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(sa,void 0,1);return i&&(i.flags=n),i||new sa(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Lv=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}},kp=[fo,ra,ao,nn,sa,vr,ia];for(let t=0;t<kp.length;t++)kp[t].bucket=t;var Iv=class{constructor(e){this.view=e,this.buckets=kp.map(()=>[]),this.index=kp.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l<s.length;l++){let a=(l+o)%s.length,c=s[a];if((!n||n(c))&&!this.reused.has(c))return s.splice(a,1),a<o&&this.index[r]--,this.reused.set(c,i),c}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new fo(l.dom,n,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},Bv=class{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Iv(e),this.text=new Lv(e.state.doc),this.builder=new _v(this.cache,new ia(e,e.contentDOM),de.iter(i)),this.cache.reused.set(n,2),this.old=new Rv(n),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>r){let c=a-r;this.preserve(c,!o,!l),r=a,s+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=HU(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<o.length?fo.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof sa)this.cache.add(o);else if(o instanceof nn)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof nn&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof nn&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=-1,o=de.spans(this.decorations,e,n,{point:(l,a,c,u,f,h)=>{if(c instanceof co){if(this.disallowBlockEffectsFor[h]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)r.continueWidget(a-l);else{let d=c.widget||(c.block?gs.block:gs.inline),p=PU(c),m=this.cache.findWidget(d,a-l,p)||fo.of(d,this.view,a-l,p);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(m)):(r.ensureLine(i),r.addInlineWidget(m,u,f))}i=null}else i=zU(i,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let f=l;f<a;){let h=this.text.next(Math.min(512,a-f));h==null?(r.addLineStartIfNotCovered(i),r.addBreak(),f++):(r.ensureLine(i),r.addText(h,c,f==l?u:c.length),f+=h.length),i=null}s=c.length}});s>-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=ze.get(r);if(r==this.view.contentDOM)break;s instanceof nn?n.push(s):s?.isLine()?i=s:s instanceof vr||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new ra(r,gD):i||n.push(nn.of(new Ru({tagName:r.nodeName.toLowerCase(),attributes:bU(r)}),r)))}return{line:i,marks:n}}};function vE(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function PU(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}var gD={class:"cm-line"};function zU(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&c1(n,t),i&&(t.class+=" "+i)),t}function HU(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof nn&&e.push(i.mark)}return e}function pv(t){let e=ze.get(t);return e&&e.setDOM(t.cloneNode()),t}var gs=class extends Sr{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}};gs.inline=new gs("span");gs.block=new gs("div");var mv=new class extends Sr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},Ap=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Se.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ia(e,e.contentDOM),this.updateInner([new ai(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:u,toA:f})=>f<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),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!GU(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?FU(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;i=new ai(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(L.ie||L.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=$U(o,this.decorations,e.changes);a.length&&(i=ai.extendWithRanges(i,a));let c=YU(l,this.blockWrappers,e.changes);return c.length&&(i=ai.extendWithRanges(i,c)),s&&!i.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,l=new Bv(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ze.get(n.text)&&l.cache.reused.set(ze.get(n.text),2),this.tile=l.run(e,n),qv(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=L.chrome||L.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Tu&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(fD)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(br)||i.tabIndex>-1)&&wu(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),L.gecko&&a.empty&&!this.hasComposition&&UU(c)){let h=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(h,c.node.childNodes[c.offset]||null)),c=u=new qi(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!ku(c.node,c.offset,f.anchorNode,f.anchorOffset)||!ku(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{L.android&&L.chrome&&i.contains(f.focusNode)&&KU(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=_u(this.view.root);if(h)if(a.empty){if(L.gecko){let d=jU(c.node,c.offset);if(d&&d!=3){let p=(d==1?XE:WE)(c.node,c.offset);p&&(c=new qi(p.node,p.offset))}}h.collapse(c.node,c.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(c.node,c.offset);try{h.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),d.setEnd(u.node,u.offset),d.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new qi(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new qi(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&ku(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,i=_u(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(u.node,u.offset),i.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&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=xr(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!ze.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let f=u+c.length;if(u<=e&&(i=c,r=e-u,s=f<e),f>=e&&!o&&(o=c,l=e-u,a=u>e),u>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:a&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(e,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Tu?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=mt(s.text,o);if(l==o)return null;let a=Lu(s.dom,o,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==_e.LTR,c=0,u=(f,h,d)=>{for(let p=0;p<f.children.length&&!(h>r);p++){let m=f.children[p],b=h+m.length,y=m.dom.getBoundingClientRect(),{height:g}=y;if(d&&!p&&(c+=y.top-d.top),m instanceof vr)b>i&&u(m,h,y);else if(h>=i&&(c>0&&n.push(-c),n.push(g+c),c=0,o)){let v=m.dom.lastChild,S=v?gp(v):[];if(S.length){let w=S[S.length-1],O=a?w.right-y.left:y.right-w.left;O>l&&(l=O,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=b)}}d&&p==f.children.length-1&&(c+=d.bottom-y.bottom),h=b+m.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?_e.RTL:_e.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=gp(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=gp(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(Se.replace({widget:new Tu(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return Se.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Pp).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(m1).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(de.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(dD).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(uD))try{if(c(this.view,e.range,e))return!0}catch(u){bn(this.view.state,u,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=g1(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(xU(this.view.scrollDOM,o,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==_e.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){qv(this.tile)}};function qv(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)qv(i,e)}}function UU(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")}function yD(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=XE(n.focusNode,n.focusOffset),r=WE(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=ze.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let a=ze.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function FU(t,e,n){let i=yD(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new ai(a.mapPos(s),a.mapPos(o),s,o),text:r}}function jU(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)}var VU=class{constructor(){this.changes=[]}compareRange(e,n){ea(e,n,this.changes)}comparePoint(e,n){ea(e,n,this.changes)}boundChange(e){ea(e,e,this.changes)}};function $U(t,e,n){let i=new VU;return de.compare(t,e,n,i),i.changes}var Pv=class{constructor(){this.changes=[]}compareRange(e,n){ea(e,n,this.changes)}comparePoint(){}boundChange(e){ea(e,e,this.changes)}};function YU(t,e,n){let i=new Pv;return de.compare(t,e,n,i),i.changes}function KU(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 GU(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}var Tu=class extends Sr{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function QU(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return N.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=mt(r.text,s,!1):l=mt(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let c=mt(r.text,o,!1);if(i(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=mt(r.text,l);if(i(r.text.slice(l,c))!=a)break;l=c}return N.undirectionalRange(o+r.from,l+r.from)}function XU(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+sE(o,s,t.state.tabSize)}function WU(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==rn.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function ZU(t,e,n,i){let r=WU(t,e.head,e.assoc||-1),s=!i||r.type!=rn.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),a=t.posAtCoords({x:n==(l==_e.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return N.cursor(a,n?-1:1)}return N.cursor(n?r.to:r.from,n?-1:1)}function SE(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,a=null;;){let c=RU(r,s,o,l,n),u=nD;if(!c){if(r.number==(n?t.state.doc.lines:1))return l;u=`
|
|
195
|
-
`,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(a){if(!a(u))return l}else{if(!i)return c;a=i(u)}l=c}}function JU(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==oi.Space&&(r=o),r==o}}function eF(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return N.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+u}let f=a.left+o,h=t.viewState.heightOracle.textHeight>>1,d=i??h;for(let p=0;;p+=h){let m=l+(d+p)*s,b=zv(t,{x:f,y:m},!1,s);if(n?m>a.bottom:m<a.top)return N.cursor(b.pos,b.assoc);let y=t.coordsAtPos(b.pos,b.assoc),g=y?(y.top+y.bottom)/2:0;if(!y||(n?g>l:g<l))return N.cursor(b.pos,b.assoc,void 0,o)}}function Cu(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=i||n||(e-s<o-e?-1:1);e=a<0?s:o,i=a}});if(!i)return e}}function bD(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=Cu(t,r.from,0);o!=r.from&&(s=N.cursor(o,-1))}else{let o=Cu(t,r.from,-1),l=Cu(t,r.to,1);(o!=r.from||l!=r.to)&&(r.undirectional?s=N.undirectionalRange(r.from,r.to):s=N.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?N.create(n,e.mainIndex):e}function gv(t,e,n){let i=Cu(t.state.facet(Iu).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:N.cursor(i,i<n.from?1:-1)}var Hn=class{constructor(e,n){this.pos=e,this.assoc=n}};function zv(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,a=l-s,c;for(;;){if(a<0)return new Hn(0,1);if(a>t.viewState.docHeight)return new Hn(t.state.doc.length,-1);if(c=t.elementAtHeight(a),i==null)break;if(c.type==rn.Text){if(i<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let h=t.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(h&&(i<0?h.top<=a+s:h.bottom>=a+s))break}let f=t.viewState.heightOracle.textHeight/2;a=i>0?c.bottom+f:c.top-f}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==rn.Text){let f=XU(t,r,c,o,l);return new Hn(f,f==c.from?1:-1)}}if(c.type!=rn.Text)return a<(c.top+c.bottom)/2?new Hn(c.from,1):new Hn(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new Hv(t,o,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}var Hv=class{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Un.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[Un.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),a,c,u=-1,f=1e9,h;e:for(;r<s;){let p=s-r,m=r+s>>1;t:if(o.has(m)){let y=r+Math.floor(Math.random()*p);for(let g=0;g<p;g++){if(!o.has(y)){m=y;break t}y++,y==s&&(y=r)}break e}o.add(m);let b=n(m);if(b)for(let y=0;y<b.length;y++){let g=b[y],v=0;if(!(g.width==0&&b.length>1)){if(g.bottom<this.y)(!a||a.bottom<g.bottom)&&(a=g),v=1;else if(g.top>this.y)(!c||c.top>g.top)&&(c=g),v=-1;else{let S=g.left>this.x?this.x-g.left:g.right<this.x?this.x-g.right:0,w=Math.abs(S);w<f&&(u=m,f=w,h=g),S&&(v=S<0==(this.baseDir==_e.LTR)?-1:1)}v==-1&&(!l||this.baseDirAt(e[m],1))?s=m:v==1&&(!l||this.baseDirAt(e[m+1],-1))&&(r=m+1)}}}if(!h){if(!c&&!a)return{i:e[0],after:!1};let p=a&&(!c||this.y-a.bottom<c.top-this.y)?a:c;return this.y=(p.top+p.bottom)/2,this.scan(e,n,!0)}if(f&&!i){let{top:p,bottom:m}=h;if(a&&a.bottom>(p+p+m)/3)return this.y=a.bottom-1,this.scan(e,n,!0);if(c&&c.top<(p+m+m)/3)return this.y=c.top+1,this.scan(e,n,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==_e.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=mt(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let o=i[s]-n,l=i[s+1]-n;return Lu(e.dom,o,l).getClientRects()});return r.after?new Hn(i[r.i+1],-1):new Hn(i[r.i],1)}scanTile(e,n){if(!e.length)return new Hn(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,a=n;l<e.children.length;l++)i.push(a+=e.children[l].length);let r=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Lu(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new Hn(i[r.i+1],-1):new Hn(o,1)}},Ql="\uFFFF",Uv=class{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(Ee.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ql}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=ze.get(r),l=r.nextSibling;if(l==n){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=ze.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:Sp(r))||Sp(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!nF(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let n=ze.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(tF(e,i.node,i.offset)?n:0))}};function tF(t,e,n){for(;;){if(!e||n<xr(e))return!1;if(e==t)return!0;n=ms(e)+1,e=e.parentNode}}function nF(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=ze.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}var Op=class{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}},Fv=class{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=vD(e.docView.tile,n,i,0))){let a=s||o?[]:rF(e),c=new Uv(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=sF(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Ov(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Ov(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((L.ios||L.chrome)&&c!=u&&Math.min(c,u)<=l.main.from&&Math.max(c,u)>=l.main.to&&(f.from>0||f.to<e.state.doc.length)){let h=Math.min(c,u),d=Math.max(c,u),p=f.from-h,m=f.to-d;(p==0||p==1||h==0)&&(m==0||m==-1||d==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(N.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let h=e.coordsAtPos(c,-1),d=0;h&&(d=e.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=N.create([N.cursor(c,d)])}else this.newSel=N.single(u,c)}}};function vD(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=i,u=i;a<t.children.length;a++){let f=t.children[a],h=c+f.length;if(c<e&&h>n)return vD(f,e,n,c);if(h>=e&&r==-1&&(r=a,s=c),c>n&&f.dom.parentNode==t.dom){o=a,l=u;break}u=h,c=h+f.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function SD(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=s.from,u=null;(o===8||L.android&&e.text.length<a-l)&&(c=s.to,u="end");let f=r.doc.sliceString(l,a,Ql),h,d;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(h=e.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:ue.of(e.text.slice(s.from-l,h).split(Ql))}:(d=xD(f,e.text,c-l,u))&&(L.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Ql+Ql&&d.toB--,n={from:l+d.from,to:l+d.toA,insert:ue.of(e.text.slice(d.from,d.toB).split(Ql))})}else i&&(!t.hasFocus&&r.facet(br)||Tp(i,s))&&(i=null);if(!n&&!i)return!1;if((L.mac||L.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=N.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:ue.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:L.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
196
|
-
`&&t.lineWrapping&&(i&&(i=N.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:ue.of([" "])}),n)return y1(t,n,i,o);if(i&&!Tp(i,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=bD(r.facet(Iu).map(c=>c(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function y1(t,e,n,i=-1){if(L.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(L.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ta(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&ta(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ta(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=iF(t,e,n));return t.state.facet(lD).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function iF(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,c=a<0?s.from:s.to,u=Cu(r.facet(Iu).map(f=>f(t)),c,a);e.from==u&&(o=u)}if(o>-1)i={changes:e,selection:N.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",c=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=r.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),f,h=n&&yD(t,n.main.head);if(h){let p=e.insert.length-(e.to-e.from);f={from:h.from,to:h.to-p}}else f=t.state.doc.lineAt(s.head);let d=s.to-e.to;i=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:c||p.map(a)};let m=p.to-d,b=m-u.length;if(t.state.sliceDoc(b,m)!=u||m>=f.from&&b<=f.to)return{range:p};let y=r.changes({from:b,to:m,insert:e.insert}),g=p.to-s.to;return{changes:y,range:c?N.range(Math.max(0,c.anchor+g),Math.max(0,c.head+g)):p.map(y)}})}else i={changes:a,selection:c&&r.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function xD(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o<s&&t.length<e.length){let a=n<=s&&n>=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=n<=s&&n>=l?s-n:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function rF(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new Op(n,i)),(r!=n||s!=i)&&e.push(new Op(r,s))),e}function sF(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?N.single(n+e,i+e):null}function Tp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}var jv=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,L.safari&&e.contentDOM.addEventListener("input",()=>null),L.gecko&&SF(e.contentDOM.ownerDocument)}handleEvent(e){!dF(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=lF(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&kD.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),L.android&&L.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(L.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(wD.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||aF.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&L.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&oF(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,ta(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:L.safari&&!L.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function oF(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function xE(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){bn(n.state,r)}}}function lF(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&n(l).handlers.push(xE(i.value,a))}if(o)for(let l in o){let a=o[l];a&&n(l).observers.push(xE(i.value,a))}}for(let i in ci)n(i).handlers.push(ci[i]);for(let i in Yt)n(i).observers.push(Yt[i]);return e}var wD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],aF="dthko",kD=[16,17,18,20,91,92,224,225],ap=6;function cp(t){return Math.max(0,t)*.7+8}function cF(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}var Vv=class{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=KE(e.contentDOM),this.atoms=e.state.facet(Iu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(Ee.allowMultipleSelections)&&uF(e,n),this.dragging=hF(e,n)&&TD(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&cF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=g1(this.view);e.clientX-a.left<=r+ap?n=-cp(r-e.clientX):e.clientX+a.right>=o-ap&&(n=cp(e.clientX-o)),e.clientY-a.top<=s+ap?i=-cp(s-e.clientY):e.clientY+a.bottom>=l-ap&&(i=cp(e.clientY-l)),this.setScrollSpeed(n,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(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=bD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function uF(t,e){let n=t.state.facet(iD);return n.length?n[0](e):L.mac?e.metaKey:e.ctrlKey}function fF(t,e){let n=t.state.facet(rD);return n.length?n[0](e):L.mac?!e.altKey:!e.ctrlKey}function hF(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=_u(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function dF(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=ze.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var ci=Object.create(null),Yt=Object.create(null),AD=L.ie&&L.ie_version<15||L.ios&&L.webkit_version<604;function pF(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(),OD(t,n.value)},50)}function zp(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function OD(t,e){e=zp(t.state,h1,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if($v!=null&&n.selection.ranges.every(a=>a.empty)&&$v==s.toString()){let a=-1;i=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let f=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:N.cursor(c.from+f.length)}})}else o?i=n.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:N.cursor(a.from+c.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Yt.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,L.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};Yt.wheel=Yt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};ci.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Yt.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Yt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Yt.touchend=(t,e)=>{t.inputState.touchActive=!1};ci.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(sD))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=gF(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new Vv(t,e,n,i)),i&&t.observer.ignore(()=>{GE(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function wE(t,e,n,i){if(i==1)return N.cursor(e,n);if(i==2)return QU(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,N.undirectionalRange(o,l)}}var mF=L.ie&&L.ie_version<=11,kE=null,AE=0,OE=0;function TD(t){if(!mF)return t.detail;let e=kE,n=OE;return kE=t,OE=Date.now(),AE=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(AE+1)%3:1}function gF(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=TD(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=wE(t,a.pos,a.assoc,i);if(n.pos!=a.pos&&!o){let f=wE(t,n.pos,n.assoc,i),h=Math.min(f.from,u.from),d=Math.max(f.to,u.to);u=h<u.from?N.range(h,d,u.assoc):N.range(d,h,u.assoc)}return o?r.replaceRange(r.main.extend(u.from,u.to,u.assoc)):l&&i==1&&r.ranges.length>1&&(c=yF(r,a.pos))?c:l?r.addRange(u):N.create([u])}}}function yF(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return N.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}ci.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=N.undirectionalRange(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",zp(t.state,d1,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ci.dragend=t=>(t.inputState.draggedContent=null,!1);function TE(t,e,n,i){if(n=zp(t.state,h1,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&fF(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ci.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&TE(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return TE(t,e,i,!0),!0}return!1};ci.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=AD?null:e.clipboardData;return n?(OD(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(pF(t),!1)};function bF(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function vF(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:zp(t,d1,e.join(t.lineBreak)),ranges:n,linewise:i}}var $v=null;ci.copy=ci.cut=(t,e)=>{if(!wu(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=vF(t.state);if(!n&&!r)return!1;$v=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=AD?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(bF(t,n),!1)};var CD=qn.define();function ED(t,e){let n=[];for(let i of t.facet(aD)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:CD.of(!0)}):null}function DD(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=ED(t.state,e);n?t.dispatch(n):t.update([])}},10)}Yt.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),DD(t)};Yt.blur=t=>{t.observer.clearSelectionRange(),DD(t)};Yt.compositionstart=Yt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Yt.compositionend=t=>{t.observer.editContext||(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,L.chrome&&L.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Yt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ci.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return y1(t,{from:a,to:c,insert:t.state.toText(s)},null),!0}}let r;if(L.chrome&&L.android&&(r=wD.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return L.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),L.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Yt.compositionend(t,e),20),!1};var CE=new Set;function SF(t){CE.has(t)||(CE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}var EE=["pre-wrap","normal","pre-line","break-spaces"],oa=!1;function DE(){oa=!1}var Yv=class{constructor(e){this.lineWrapping=e,this.doc=ue.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return EE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,o){let l=EE.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}},Kv=class{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}},li=class t{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?rn.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 co?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 t(this.from,this.length+e.length,this.top,this.height+e.height,n)}},De=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(De||(De={})),yp=.001,vn=class t{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>yp&&(oa=!0),this.height=e)}replace(e,n,i){return t.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:f}=r[l],h=s.lineAt(a,De.ByPosNoHeight,i.setDoc(n),0,0),d=h.to>=c?h:s.lineAt(c,De.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&h.from<=r[l-1].toA;)a=r[l-1].fromA,u=r[l-1].fromB,l--,a<h.from&&(h=s.lineAt(a,De.ByPosNoHeight,i,0,0));u+=h.from-a,a=h.from;let p=Qv.build(i.setDoc(o),e,u,f);s=Cp(s,s.replace(a,c,p))}return s.updateHeight(i,0)}static empty(){return new zn(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>s*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),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,i++),new Gv(t.of(e.slice(0,n)),o,t.of(e.slice(i)))}};function Cp(t,e){return t==e?t:(t.constructor!=e.constructor&&(oa=!0),e)}vn.prototype.size=1;var xF=Se.replace({}),Ep=class extends vn{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new li(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new li(r,0,i,this.spaceAbove,xF):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,n,i,r,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,De.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},zn=class t extends Ep{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new li(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof t||r instanceof ps&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof ps?r=new t(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):vn.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},ps=class t extends vn{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),u=n.doc.lineAt(c),f=l+u.length*a,h=Math.max(i,e-f/2);return new li(u.from,u.length,h,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-i)/l))),{from:u,length:f}=n.doc.line(s+c);return new li(u,f,i+l*c,l,0)}}lineAt(e,n,i,r,s){if(n==De.ByHeight)return this.blockAt(e,i,r,s);if(n==De.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(e);return new li(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),u=l+c.length*a,f=c.number-o,h=r+l*f+a*(c.from-s-f);return new li(c.from,c.length,Math.max(r,Math.min(h,r+this.height-u)),u,0)}forEachLine(e,n,i,r,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let u=e,f=r;u<=n;){let h=i.doc.lineAt(u);if(u==e){let p=h.number-l;f+=a*p+c*(e-s-p)}let d=a+c*h.length;o(new li(h.from,h.length,f,d,0)),f+=d,u=h.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof t?i[i.length-1]=new t(s.length+r):i.push(null,new t(r-1))}if(e>0){let s=i[0];s instanceof t?i[0]=new t(e+s.length):i.unshift(new t(e-1),null)}return vn.of(i)}decomposeLeft(e,n){n.push(new t(e-1),null)}decomposeRight(e,n){n.push(null,new t(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),a=-1;for(r.from>n&&o.push(new t(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=yp&&(a=-2);let d=new zn(u,f,h);d.outdated=!1,o.push(d),l+=u+1}l<=s&&o.push(null,new t(s-l).updateHeight(e,l));let c=vn.of(o);return(a<0||Math.abs(c.height-this.height)>=yp||Math.abs(a-this.heightMetrics(e,n).perLine)>=yp)&&(oa=!0),Cp(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Gv=class extends vn{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=n==De.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==De.ByPosNoHeight?De.ByPosNoHeight:De.ByPos;return a?c.join(this.right.lineAt(l,u,i,o,l)):this.left.lineAt(l,u,i,r,s).join(c)}forEachLine(e,n,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,i,r,s,o),n>=a&&this.right.forEachLine(e,n,i,l,a,o);else{let c=this.lineAt(a,De.ByPos,i,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,i,r,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,i,l,a,o)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&ME(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),ME(s,l)}return vn.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?vn.of(this.break?[e,null,n]:[e,n]):(this.left=Cp(this.left,e),this.right=Cp(this.right,n),this.setHeight(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,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,a=null;return r&&r.from<=n+s.length&&r.more?a=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function ME(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof ps&&(i=t[e+1])instanceof ps&&t.splice(e-1,3,new ps(n.length+1+i.length))}var wF=5,Qv=class t{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 i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof zn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new zn(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=n-e;i.block?this.addBlock(new Ep(o,r,i)):(o||s||r>=wF)&&this.addLineDeco(r,s,o)}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 zn(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new ps(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof zn)return e;let n=new zn(0,-1,0);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,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof zn)&&!this.isCovered?this.nodes.push(new zn(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof zn&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new t(i,e);return de.spans(n,i,r,s,0),s.finish(i)}};function kF(t,e,n){let i=new Xv;return de.compare(t,e,n,i,0),i.changes}var Xv=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&ea(e,n,this.changes,5)}};function AF(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=i.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let h=u.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),a=Math.min(c==t.parentNode?r.innerHeight:a,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function OF(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function TF(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}var Eu=class{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return Se.replace({widget:new Wv(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}},Wv=class extends Sr{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}},Dp=class{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=RE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=_e.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(p1).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Yv(i),this.stateDeco=NE(n),this.heightMap=vn.empty().applyChanges(this.stateDeco,ue.empty,this.heightOracle.setDoc(n.doc),[new ai(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Se.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new Wl(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?RE:new Zv(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(xu(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=NE(this.state);let r=e.changedRanges,s=ai.extendWithRanges(r,kF(i,this.stateDeco,e?e.changes:Vt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);DE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||oa)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.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 c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(_U)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?_e.RTL:_e.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:w,scaleY:O}=YE(n,l);(w>.005&&Math.abs(this.scaleX-w)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=w,this.scaleY=O,c|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let d=KE(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=QE(this.scrollParent||e.win);let m=(this.printing?TF:AF)(n,this.paddingTop),b=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let g=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(g!=this.inView&&(this.inView=g,g&&(a=!0)),!this.inView&&!this.scrollTarget&&!OF(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(w)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:O,charWidth:k,textHeight:A}=e.docView.measureTextSize();o=O>0&&r.refresh(s,O,k,A,Math.max(5,v/k),w),o&&(e.docView.minWidth=0,c|=16)}b>0&&y>0?u=Math.max(b,y):b<0&&y<0&&(u=Math.min(b,y)),DE();for(let O of this.viewports){let k=O.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(O);this.heightMap=(o?vn.empty().applyChanges(this.stateDeco,ue.empty,this.heightOracle,[new ai(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Kv(O.from,k))}oa&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Wl(r.lineAt(o-i*1e3,De.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,De.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(c,De.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?h=f.top:h=f.bottom-u,a=new Wl(r.lineAt(h-1e3/2,De.ByHeight,s,0,0).from,r.lineAt(h+u+1e3/2,De.ByHeight,s,0,0).to)}}return a}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new Wl(this.heightMap.lineAt(i,De.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,De.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,De.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,De.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new Eu(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=_e.LTR&&!i)return[];let l=[],a=(u,f,h,d)=>{if(f-u<s)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let y of m)if(y>u&&y<f){a(u,y-10,h,d),a(y+10,f,h,d);return}let b=EF(e,y=>y.from>=h.from&&y.to<=h.to&&Math.abs(y.from-u)<s&&Math.abs(y.to-f)<s&&!m.some(g=>y.from<g&&y.to>g));if(!b){if(f<h.to&&n&&i&&n.visibleRanges.some(v=>v.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(N.cursor(f),!1,!0).head;v>u&&(f=v)}let y=this.gapSize(h,u,f,d),g=i||y<2e6?y:2e6;b=new Eu(u,f,y,g)}l.push(b)},c=u=>{if(u.length<o||u.type!=rn.Text)return;let f=CF(u.from,u.to,this.stateDeco);if(f.total<o)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(i){let m=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,y;if(h!=null){let g=fp(f,h),v=((this.visibleBottom-this.visibleTop)/2+m)/u.height;b=g-v,y=g+v}else b=(this.visibleTop-u.top-m)/u.height,y=(this.visibleBottom-u.top+m)/u.height;d=up(f,b),p=up(f,y)}else{let m=f.total*this.heightOracle.charWidth,b=r*this.heightOracle.charWidth,y=0;if(m>2e6)for(let O of e)O.from>=u.from&&O.from<u.to&&O.size!=O.displaySize&&O.from*this.heightOracle.charWidth+y<this.pixelViewport.left&&(y=O.size-O.displaySize);let g=this.pixelViewport.left+y,v=this.pixelViewport.right+y,S,w;if(h!=null){let O=fp(f,h),k=((v-g)/2+b)/m;S=O-k,w=O+k}else S=(g-b)/m,w=(v+b)/m;d=up(f,S),p=up(f,w)}d>u.from&&a(u.from,d,u,f),p<u.to&&a(p,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,i,r){let s=fp(r,i)-fp(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Eu.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Se.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];de.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],l=i[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||xu(this.heightMap.lineAt(e,De.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||xu(this.heightMap.lineAt(this.scaler.fromDOM(e),De.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return xu(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}},Wl=class{constructor(e,n){this.from=e,this.to=n}};function CF(t,e,n){let i=[],r=t,s=0;return de.spans(n,t,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function up({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function fp(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function EF(t,e){for(let n of t)if(e(n))return n}var RE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function NE(t){let e=t.facet(Pp).filter(i=>typeof i!="function"),n=t.facet(m1).filter(i=>typeof i!="function");return n.length&&e.push(de.join(n)),e}var Zv=class t{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=n.lineAt(l,De.ByPos,e,0,0).top,u=n.lineAt(a,De.ByPos,e,0,0).bottom;return r+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof t?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}};function xu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new li(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>xu(r,e)):t._content)}var hp=I.define({combine:t=>t.join(" ")}),Jv=I.define({combine:t=>t.indexOf(!0)>-1}),e1=Pn.newName(),MD=Pn.newName(),RD=Pn.newName(),ND={"&light":"."+MD,"&dark":"."+RD};function t1(t,e,n){return new Pn(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}var DF=t1("."+e1,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ND),MF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},yv=L.ie&&L.ie_version<=11,n1=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Tv,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(L.ie&&L.ie_version<=11||L.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&L.android&&e.constructor.EDIT_CONTEXT!==!1&&!(L.chrome&&L.chrome_version<126)&&(this.editContext=new i1(e),e.state.facet(br)&&(e.contentDOM.editContext=this.editContext.editContext)),yv&&(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),window.matchMedia&&(this.printQuery=window.matchMedia("print")),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.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){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:i}=this,r=this.selectionRange;if(i.state.facet(br)?i.root.activeElement!=this.dom:!wu(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(L.ie&&L.ie_version<=11||L.android&&L.chrome)&&!i.state.selection.main.empty&&r.focusNode&&ku(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=_u(e.root);if(!n)return!1;let i=L.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&RF(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=wu(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&kU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),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 i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,MF),yv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),yv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&ta(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&wu(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Fv(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=SD(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Tp(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=_E(n,e.previousSibling||e.target.previousSibling,-1),r=_E(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):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),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(br)!=e.state.facet(br)&&(e.view.contentDOM.editContext=e.state.facet(br)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function _E(t,e,n){for(;e;){let i=ze.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function LE(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return ku(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function RF(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return LE(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?LE(t,n):null}var i1=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>i.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let u=xD(e.state.sliceDoc(l,a),i.text,(c?r.from:r.to)-l,c?"end":null);if(!u){let h=N.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Tp(h,r)||e.dispatch({selection:h,userEvent:"select"});return}let f={from:u.from+l,to:u.toA+l,insert:ue.of(i.text.slice(u.from,u.toB).split(`
|
|
197
|
-
`))};if((L.mac||L.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ue.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);y1(e,f,N.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(Se.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:fD.of(Se.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=_u(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},U=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||wU(e.parent)||document,this.viewState=new Dp(this,e.state||Ee.create(e)),e.scrollTo&&e.scrollTo.is(lp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Xl).map(r=>new Ou(r));for(let r of this.plugins)r.update(this);this.observer=new n1(this),this.inputState=new jv(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Ap(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof pt?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,i=!1,r,s=this.state;for(let h of e){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(h=>h.annotation(CD))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=ED(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(Ee.phrases)!=this.state.facet(Ee.phrases))return this.setState(s);r=wp.create(this,s,e),r.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,{x:p,y:m}=this.state.facet(t.cursorScrollMargin);f=new Au(d.empty?d:N.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",m,p)}for(let d of h.effects)d.is(lp)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Mp.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(Su)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(hp)!=r.state.facet(hp)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Mv))try{h(r)}catch(d){bn(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!SD(this,u)&&c.force&&ta(this.contentDOM,c.key,c.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 i of this.plugins)i.destroy(this);this.viewState=new Dp(this,e),this.plugins=e.facet(Xl).map(i=>new Ou(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Ap(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(Xl),i=e.state.facet(Xl);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Ou(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){bn(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(QE(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();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 c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(p){return bn(this.state,p),IE}}),f=wp.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),h&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(u[d]!=IE)try{let p=c[d];p.write&&p.write(u[d],this)}catch(p){bn(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,o=-1;continue}else{let p=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((p>1||p<-1)&&!(L.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Mv))l(n)}get themeClasses(){return e1+" "+(this.state.facet(Jv)?RD:MD)+" "+this.state.facet(hp)}updateAttrs(){let e=BE(this,hD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(br)?"true":"false",class:"cm-content",style:`${L.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),BE(this,p1,n);let i=this.observer.ignore(()=>{let r=pE(this.contentDOM,this.contentAttrs,n),s=pE(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(t.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Su);let e=this.state.facet(t.cspNonce);Pn.mount(this.root,this.styleModules.concat(DF).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.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==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,i){return gv(this,e,SE(this,e,n,i))}moveByGroup(e,n){return gv(this,e,SE(this,e,n,i=>JU(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return N.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return ZU(this,e,n,i)}moveVertically(e,n,i){return gv(this,e,eF(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=zv(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),zv(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[Un.find(r,e-i.from,-1,n)];return this.docView.coordsAt(e,n,s.dir==_e.RTL)}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(cD)||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>NF)return tD(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||eD(s.isolates,i=yE(this,e))))return s.order;i||(i=yE(this,e));let r=MU(e.text,n,i);return this.bidiCache.push(new Mp(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||L.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{GE(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var i,r,s,o;return lp.of(new Au(typeof e=="number"?N.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return lp.of(new Au(N.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Fn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Fn.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=Pn.newName(),r=[hp.of(i),Su.of(t1(`.${i}`,e))];return n&&n.dark&&r.push(Jv.of(!0)),r}static baseTheme(e){return vu.lowest(Su.of(t1("."+e1,e,ND)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&ze.get(i)||ze.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}};U.styleModule=Su;U.inputHandler=lD;U.clipboardInputFilter=h1;U.clipboardOutputFilter=d1;U.scrollHandler=uD;U.focusChangeEffect=aD;U.perLineTextDirection=cD;U.exceptionSink=oD;U.updateListener=Mv;U.editable=br;U.mouseSelectionStyle=sD;U.dragMovesSelection=rD;U.clickAddsSelectionRange=iD;U.decorations=Pp;U.blockWrappers=dD;U.outerDecorations=m1;U.atomicRanges=Iu;U.bidiIsolatedRanges=pD;U.cursorScrollMargin=I.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});U.scrollMargins=mD;U.darkTheme=Jv;U.cspNonce=I.define({combine:t=>t.length?t[0]:""});U.contentAttributes=p1;U.editorAttributes=hD;U.lineWrapping=U.contentAttributes.of({class:"cm-lineWrapping"});U.announce=he.define();var NF=4096,IE={},Mp=class t{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:_e.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!n.touchesRange(o.from,o.to)&&i.push(new t(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function BE(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&c1(o,n)}return n}var _F=L.mac?"mac":L.windows?"win":L.linux?"linux":"key";function LF(t,e){let n=t.split(/-(?!$)/),i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<n.length-1;++a){let c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function dp(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}var IF=vu.default(U.domEventHandlers({keydown(t,e){return zF(BF(e.state),t,e,"editor")}})),b1=I.define({enables:IF}),qE=new WeakMap;function BF(t){let e=t.facet(b1),n=qE.get(e);return n||qE.set(e,n=PF(e.reduce((i,r)=>i.concat(r),[]))),n}var ds=null,qF=4e3;function PF(t,e=_F){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var f,h;let d=n[o]||(n[o]=Object.create(null)),p=l.split(/ (?!$)/).map(y=>LF(y,e));for(let y=1;y<p.length;y++){let g=p.slice(0,y).join(" ");r(g,!0),d[g]||(d[g]={preventDefault:!0,stopPropagation:!1,run:[v=>{let S=ds={view:v,prefix:g,scope:o};return setTimeout(()=>{ds==S&&(ds=null)},qF),!0}]})}let m=p.join(" ");r(m,!1);let b=d[m]||(d[m]={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&&b.run.push(a),c&&(b.preventDefault=!0),u&&(b.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in u)u[h].run.push(d=>f(d,r1))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return n}var r1=null;function zF(t,e,n,i){r1=e;let r=cE(e),s=K2(r,0),o=G2(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;ds&&ds.view==n&&ds.scope==i&&(l=ds.prefix+" ",kD.indexOf(e.keyCode)<0&&(c=!0,ds=null));let f=new Set,h=b=>{if(b){for(let y of b.run)if(!f.has(y)&&(f.add(y),y(n)))return b.stopPropagation&&(u=!0),!0;b.preventDefault&&(b.stopPropagation&&(u=!0),c=!0)}return!1},d=t[i],p,m;return d&&(h(d[l+dp(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(L.windows&&e.ctrlKey&&e.altKey)&&!(L.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=yr[e.keyCode])&&p!=r?(h(d[l+dp(p,e,!0)])||e.shiftKey&&(m=Gl[e.keyCode])!=r&&m!=p&&h(d[l+dp(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&h(d[l+dp(r,e,!0)])&&(a=!0),!a&&h(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),r1=null,a}var Ife=/x/.unicode!=null?"gu":"g";var pp="-10000px",Rp=class{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=n?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==c.create&&(u=f)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[u];l&&(l[a]=n[u]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return n&&(l.forEach((a,c)=>n[c]=a),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function HF(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var bv=I.define({combine:t=>{var e,n,i;return{position:L.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||HF}}}),PE=new WeakMap,_D=Fn.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(bv);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.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Rp(t,Hp,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),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,i=t.state.facet(bv);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=pp,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(L.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=g1(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(bv).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}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{visible:n,space:i,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,f=t.pos[l],h=t.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(n.top,i.top)||f.top>=Math.min(n.bottom,i.bottom)||f.right<Math.max(n.left,i.left)-.1||f.left>Math.min(n.right,i.right)+.1)){u.style.top=pp;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=h.right-h.left,b=(e=PE.get(c))!==null&&e!==void 0?e:h.bottom-h.top,y=c.offset||FF,g=this.view.textDirection==_e.LTR,v=h.width>i.right-i.left?g?i.left:i.right-h.width:g?Math.max(i.left,Math.min(f.left-(d?14:0)+y.x,i.right-m)):Math.min(Math.max(i.left,f.left-m+(d?14:0)-y.x),i.right-m),S=this.above[l];!a.strictSide&&(S?f.top-b-p-y.y<i.top:f.bottom+b+p+y.y>i.bottom)&&S==i.bottom-f.bottom>f.top-i.top&&(S=this.above[l]=!S);let w=(S?f.top-i.top:i.bottom-f.bottom)-p;if(w<b&&c.resize!==!1){if(w<this.view.defaultLineHeight){u.style.top=pp;continue}PE.set(c,b),u.style.height=(b=w)/s+"px"}else u.style.height&&(u.style.height="");let O=S?f.top-b-p-y.y:f.bottom+p+y.y,k=v+m;if(c.overlap!==!0)for(let A of o)A.left<k&&A.right>v&&A.top<O+b&&A.bottom>O&&(O=S?A.top-b-2-p:A.bottom+p+2);if(this.position=="absolute"?(u.style.top=(O-t.parent.top)/s+"px",zE(u,(v-t.parent.left)/r)):(u.style.top=O/s+"px",zE(u,v/r)),d){let A=f.left+(g?y.x:-y.x)-(v+14-7);d.style.left=A/r+"px"}c.overlap!==!0&&o.push({left:v,top:O,right:k,bottom:O+b}),u.classList.toggle("cm-tooltip-above",S),u.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.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=pp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function zE(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}var UF=U.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),FF={x:0,y:0},Hp=I.define({enables:[_D,UF]}),Np=I.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])}),_p=class t{static create(e){return new t(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Rp(e,Np,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}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 i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)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")}},jF=Hp.compute([Np],t=>{let e=t.facet(Np);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:_p.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),VF=I.define(),s1=class{constructor(e,n,i,r,s,o){this.view=e,this.source=n,this.field=i,this.locked=r,this.setHover=s,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(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,i=e.docView.tile.nearest(n.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(n),r==null)return;let o=e.coordsAtPos(r);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),a=l&&l.dir==_e.RTL?-1:1;s=n.x<o.left?-a:a}this.activateHover(e,r,s)}activateHover(e,n,i,r){let s=this.source(e,n,i),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>bn(e.state,a,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(_D),n=e?e.manager.tooltips.findIndex(i=>i.create==_p.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!$F(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!YF(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},mp=4;function $F(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=n-mp&&e.clientX<=i+mp&&e.clientY>=r-mp&&e.clientY<=s+mp}function YF(t,e,n,i,r,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=t.posAtCoords({x:i,y:r},!1);return a>=e&&a<=n}function LD(t,e={}){let n=he.define(),i=new WeakMap,r=Mt.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(l,c)))),l.docChanged&&o.length){let c=[];for(let u of o){let f=l.changes.mapPos(u.pos,-1,jt.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),u);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),c.push(h)}}o=c}for(let c of l.effects)c.is(n)&&(o=c.value,a=void 0),(c.is(KF)&&!c.value||c.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>Np.from(o)}),s=Fn.define(o=>new s1(o,t,r,i,n,e.hoverTime||300));return{active:r,extension:[r,s,VF.of(s),jF]}}var KF=he.define();var HE=I.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});var GF=Fn.fromClass(class{constructor(t){this.input=t.state.facet(Lp),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(HE);this.top=new Zl(t,!0,e.topContainer),this.bottom=new Zl(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(HE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Zl(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Zl(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Lp);if(n!=this.input){let i=n.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>U.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),Zl=class{constructor(e,n,i){this.view=e,this.top=n,this.container=i,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=UE(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=UE(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 UE(t){let e=t.nextSibling;return t.remove(),e}var Lp=I.define({enables:GF});var jn=class extends Ii{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};jn.prototype.elementClass="";jn.prototype.toDOM=void 0;jn.prototype.mapMode=jt.TrackBefore;jn.prototype.startSide=jn.prototype.endSide=-1;jn.prototype.point=!0;var vv=I.define(),QF=I.define(),XF={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>de.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Du=I.define();function v1(t){return[ID(),Du.of({...XF,...t})]}var o1=I.define({combine:t=>t.some(e=>e)});function ID(t){let e=[WF];return t&&t.fixed===!1&&e.push(o1.of(!0)),e}var WF=Fn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Du).map(e=>new Ip(t,e)),this.fixed=!t.state.facet(o1);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(o1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=de.iter(this.view.state.facet(vv),this.view.viewport.from),i=[],r=this.gutters.map(s=>new a1(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==rn.Text&&o){l1(n,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==rn.Text){l1(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Du),n=t.state.facet(Du),i=t.docChanged||t.heightChanged||t.viewportChanged||!de.eq(t.startState.facet(vv),t.state.facet(vv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=e.indexOf(s);o<0?r.push(new Ip(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>U.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==_e.LTR?{left:i,right:r}:{right:i,left:r}})});function FE(t){return Array.isArray(t)?t:[t]}function l1(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}var a1=class{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=de.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==r.elements.length){let l=new Bp(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];l1(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(QF)){let o=s(e,n.widget,n);o&&(r||(r=[])).push(o)}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()}}},Ip=class{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 i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=FE(n.markers(e)),n.initialSpacer&&(this.spacer=new Bp(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=FE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!de.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Bp=class{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),ZF(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<n.length?n[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let f=r.nextSibling;r.remove(),r=f}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}};function ZF(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}var JF=I.define(),ej=I.define(),Jl=I.define({combine(t){return hs(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let s=i[r],o=n[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}}),Mu=class extends jn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Sv(t,e){return t.state.facet(Jl).formatNumber(e,t.state)}var tj=Du.compute([Jl],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(JF)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new Mu(Sv(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(ej)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Jl)!=e.state.facet(Jl),initialSpacer(e){return new Mu(Sv(e,jE(e.state.doc.lines)))},updateSpacer(e,n){let i=Sv(n.view,jE(n.view.state.doc.lines));return i==e.number?e:new Mu(i)},domEventHandlers:t.facet(Jl).domEventHandlers,side:"before"}));function BD(t={}){return[Jl.of(t),ID(),tj]}function jE(t){let e=9;for(;e<t;)e=e*10+9;return e}var nj=0,Bu=class{constructor(e,n){this.from=e,this.to=n}},G=class{constructor(e={}){this.id=nj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Rt.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}};G.closedBy=new G({deserialize:t=>t.split(" ")});G.openedBy=new G({deserialize:t=>t.split(" ")});G.group=new G({deserialize:t=>t.split(" ")});G.isolate=new G({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});G.contextHash=new G({perNode:!0});G.lookAhead=new G({perNode:!0});G.mounted=new G({perNode:!0});var ho=class{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[G.mounted.id]}},ij=Object.create(null),Rt=class t{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):ij,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new t(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(G.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(G.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}};Rt.none=new Rt("",Object.create(null),0,8);var qu=class t{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 i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}n.push(r?new Rt(i.name,r,i.id,i.flags):i)}return new t(n)}},Up=new WeakMap,qD=new WeakMap,He;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(He||(He={}));var Ye=class t{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=ho.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}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 Hu(this.topNode,e)}cursorAt(e,n=0,i=0){let r=Up.get(this)||this.topNode,s=new Hu(r);return s.moveTo(e,n),Up.set(this,s._tree),s}get topNode(){return new Pi(this,0,0,null)}resolve(e,n=0){let i=Pu(Up.get(this)||this.topNode,e,n,!1);return Up.set(this,i),i}resolveInner(e,n=0){let i=Pu(qD.get(this)||this.topNode,e,n,!0);return qD.set(this,i),i}resolveStack(e,n=0){return rj(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&He.IncludeAnonymous)>0;for(let a=this.cursor(o|He.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!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:T1(Rt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new t(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new t(Rt.none,n,i,r)))}static build(e){return sj(e)}};Ye.empty=new Ye(Rt.none,[],[],0);var S1=class t{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 t(this.buffer,this.index)}},ys=class t{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return Rt.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],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=n&&!(HD(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,a=0;l<n;){s[a++]=r[l++],s[a++]=r[l++]-i;let c=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,c)}return new t(s,o,this.set)}};function HD(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function Pu(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!i&&t instanceof Pi&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=i?0:He.IgnoreOverlays;if(i)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof Pi&&o.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}var jp=class{cursor(e=0){return new Hu(this,e)}getChild(e,n=null,i=null){let r=PD(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return PD(this,e,n,i)}resolve(e,n=0){return Pu(this,e,n,!1)}resolveInner(e,n=0){return Pu(this,e,n,!0)}matchContext(e){return x1(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}},Pi=class t extends jp{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],f=a[e]+o.from,h;if(!(!(s&He.EnterBracketed&&u instanceof Ye&&(h=ho.get(u))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+u.length)&&!HD(r,i,f,f+u.length))){if(u instanceof ys){if(s&He.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,i-f,r);if(d>-1)return new zu(new w1(o,u,e,f),null,d)}else if(s&He.IncludeAnonymous||!u.type.isAnonymous||O1(u)){let d;if(!(s&He.IgnoreMounts)&&(d=ho.get(u))&&!d.overlay)return new t(d.tree,f,e,o);let p=new t(u,f,e,o);return s&He.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,i,r,s)}}}if(s&He.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&He.IgnoreOverlays)&&(r=ho.get(this._tree))&&r.overlay){let s=e-this.from,o=i&He.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?a>=s:a>s))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function PD(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function x1(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}var w1=class{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}},zu=class t extends jp{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,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new t(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&He.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new t(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(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 t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new Ye(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function UD(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let i=n instanceof Pi&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new k1(r,n)}var k1=class{constructor(e,n){this.heads=e,this.node=n}get next(){return UD(this.heads)}};function rj(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof Pi?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,n)),s=o}else{let o=ho.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Pi(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(Pu(l,e,n,!1))}}return r?UD(r):i}var Hu=class{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~He.EnterBracketed,e instanceof Pi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Pi?(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,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&He.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&He.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&He.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,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&He.IncludeAnonymous||l instanceof ys||!l.type.isAnonymous||O1(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,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new zu(this.buffer,n,this.stack[r]);return this.bufferNode=new zu(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return x1(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return x1(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function O1(t){return t.children.some(e=>e instanceof ys||!e.type.isAnonymous||O1(e))}function sj(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=t,l=Array.isArray(n)?new S1(n,n.length):n,a=i.types,c=0,u=0;function f(w,O,k,A,R,T){let{id:M,start:C,end:H,size:le}=l,Re=u,Kt=c;if(le<0)if(l.next(),le==-1){let ct=s[M];k.push(ct),A.push(C-w);return}else if(le==-3){c=M;return}else if(le==-4){u=M;return}else throw new RangeError(`Unrecognized record size: ${le}`);let ke=a[M],An,et,Kn=C-w;if(H-C<=r&&(et=b(l.pos-O,R))){let ct=new Uint16Array(et.size-et.skip),tt=l.pos-et.size,nt=ct.length;for(;l.pos>tt;)nt=y(et.start,ct,nt);An=new ys(ct,H-et.start,i),Kn=et.start-w}else{let ct=l.pos-le;l.next();let tt=[],nt=[],Lt=M>=o?M:-1,Gt=0,Gn=H;for(;l.pos>ct;)Lt>=0&&l.id==Lt&&l.size>=0?(l.end<=Gn-r&&(p(tt,nt,C,Gt,l.end,Gn,Lt,Re,Kt),Gt=tt.length,Gn=l.end),l.next()):T>2500?h(C,ct,tt,nt):f(C,ct,tt,nt,Lt,T+1);if(Lt>=0&&Gt>0&&Gt<tt.length&&p(tt,nt,C,Gt,C,Gn,Lt,Re,Kt),tt.reverse(),nt.reverse(),Lt>-1&&Gt>0){let Qn=d(ke,Kt);An=T1(ke,tt,nt,0,tt.length,0,H-C,Qn,Qn)}else An=m(ke,tt,nt,H-C,Re-H,Kt)}k.push(An),A.push(Kn)}function h(w,O,k,A){let R=[],T=0,M=-1;for(;l.pos>O;){let{id:C,start:H,end:le,size:Re}=l;if(Re>4)l.next();else{if(M>-1&&H<M)break;M<0&&(M=le-r),R.push(C,H,le),T++,l.next()}}if(T){let C=new Uint16Array(T*4),H=R[R.length-2];for(let le=R.length-3,Re=0;le>=0;le-=3)C[Re++]=R[le],C[Re++]=R[le+1]-H,C[Re++]=R[le+2]-H,C[Re++]=Re;k.push(new ys(C,R[2]-H,i)),A.push(H-w)}}function d(w,O){return(k,A,R)=>{let T=0,M=k.length-1,C,H;if(M>=0&&(C=k[M])instanceof Ye){if(!M&&C.type==w&&C.length==R)return C;(H=C.prop(G.lookAhead))&&(T=A[M]+C.length+H)}return m(w,k,A,R,T,O)}}function p(w,O,k,A,R,T,M,C,H){let le=[],Re=[];for(;w.length>A;)le.push(w.pop()),Re.push(O.pop()+k-R);w.push(m(i.types[M],le,Re,T-R,C-T,H)),O.push(R-k)}function m(w,O,k,A,R,T,M){if(T){let C=[G.contextHash,T];M=M?[C].concat(M):[C]}if(R>25){let C=[G.lookAhead,R];M=M?[C].concat(M):[C]}return new Ye(w,O,k,A,M)}function b(w,O){let k=l.fork(),A=0,R=0,T=0,M=k.end-r,C={size:0,start:0,skip:0};e:for(let H=k.pos-w;k.pos>H;){let le=k.size;if(k.id==O&&le>=0){C.size=A,C.start=R,C.skip=T,T+=4,A+=4,k.next();continue}let Re=k.pos-le;if(le<0||Re<H||k.start<M)break;let Kt=k.id>=o?4:0,ke=k.start;for(k.next();k.pos>Re;){if(k.size<0)if(k.size==-3||k.size==-4)Kt+=4;else break e;else k.id>=o&&(Kt+=4);k.next()}R=ke,A+=le,T+=Kt}return(O<0||A==w)&&(C.size=A,C.start=R,C.skip=T),C.size>4?C:void 0}function y(w,O,k){let{id:A,start:R,end:T,size:M}=l;if(l.next(),M>=0&&A<o){let C=k;if(M>4){let H=l.pos-(M-4);for(;l.pos>H;)k=y(w,O,k)}O[--k]=C,O[--k]=T-w,O[--k]=R-w,O[--k]=A}else M==-3?c=A:M==-4&&(u=A);return k}let g=[],v=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,g,v,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:g.length?v[0]+g[0].length:0;return new Ye(a[t.topID],g.reverse(),v.reverse(),S)}var zD=new WeakMap;function Fp(t,e){if(!t.isAnonymous||e instanceof ys||e.type!=t)return 1;let n=zD.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof Ye)){n=1;break}n+=Fp(t,i)}zD.set(e,n)}return n}function T1(t,e,n,i,r,s,o,l,a){let c=0;for(let p=i;p<r;p++)c+=Fp(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],h=[];function d(p,m,b,y,g){for(let v=b;v<y;){let S=v,w=m[v],O=Fp(t,p[v]);for(v++;v<y;v++){let k=Fp(t,p[v]);if(O+k>=u)break;O+=k}if(v==S+1){if(O>u){let k=p[S];d(k.children,k.positions,0,k.children.length,m[S]+g);continue}f.push(p[S])}else{let k=m[v-1]+p[v-1].length-w;f.push(T1(t,p,m,S,v,w,k,null,a))}h.push(w+g-s)}}return d(e,n,i,r,0),(l||a)(f,h,o)}var po=class t{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new t(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,f=u?u.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let h=o;if(a>=h.from||f<=h.to||c){let d=Math.max(h.from,a)-c,p=Math.min(h.to,f)-c;h=d>=p?null:new t(d,p,h.tree,h.offset+c,l>0,!!u)}if(h&&r.push(h),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return r}},la=class{startParse(e,n,i){return typeof e=="string"&&(e=new A1(e)),i=i?i.length?i.map(r=>new Bu(r.from,r.to)):[new Bu(0,0)]:[new Bu(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}},A1=class{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)}};var Ufe=new G({perNode:!0});var oj=0,ui=class t{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=oj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof t&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new t(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new Kp(e);return i=>i.modified.indexOf(n)>-1?i:Kp.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},lj=0,Kp=class t{constructor(e){this.name=e,this.instances=[],this.id=lj++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&aj(n,l.modified));if(i)return i;let r=[],s=new ui(e.name,r,e,n);for(let l of n)l.instances.push(s);let o=cj(n);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(t.get(l,a));return s}};function aj(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function cj(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function aa(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new go(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return VD.add(e)}var VD=new G({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new go(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}}),go=class{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};go.empty=new go([],2,null);function M1(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=n[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function uj(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function $D(t,e,n,i=0,r=t.length){let s=new E1(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}var E1=class{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,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,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=n)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=r,u=fj(e)||go.empty,f=uj(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),c),u.opaque)return;let h=e.tree&&e.tree.prop(G.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+l,1),p=this.highlighters.filter(b=>!b.scope||b.scope(h.tree.type)),m=e.firstChild();for(let b=0,y=l;;b++){let g=b<h.overlay.length?h.overlay[b]:null,v=g?g.from+l:a,S=Math.max(n,y),w=Math.min(i,v);if(S<w&&m)for(;e.from<w&&(this.highlightRange(e,S,w,r,s),this.startSpan(Math.min(w,e.to),c),!(e.to>=v||!e.nextSibling())););if(!g||v>i)break;y=g.to+l,y>n&&(this.highlightRange(d.cursor(),Math.max(n,g.from+l),Math.min(i,y),"",p),this.startSpan(Math.min(i,y),c))}m&&e.parent()}else if(e.firstChild()){h&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}};function fj(t){let e=t.type.prop(VD);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}var _=ui.define,Vp=_(),bs=_(),FD=_(bs),jD=_(bs),vs=_(),$p=_(vs),C1=_(vs),Ui=_(),mo=_(Ui),zi=_(),Hi=_(),D1=_(),Uu=_(D1),Yp=_(),E={comment:Vp,lineComment:_(Vp),blockComment:_(Vp),docComment:_(Vp),name:bs,variableName:_(bs),typeName:FD,tagName:_(FD),propertyName:jD,attributeName:_(jD),className:_(bs),labelName:_(bs),namespace:_(bs),macroName:_(bs),literal:vs,string:$p,docString:_($p),character:_($p),attributeValue:_($p),number:C1,integer:_(C1),float:_(C1),bool:_(vs),regexp:_(vs),escape:_(vs),color:_(vs),url:_(vs),keyword:zi,self:_(zi),null:_(zi),atom:_(zi),unit:_(zi),modifier:_(zi),operatorKeyword:_(zi),controlKeyword:_(zi),definitionKeyword:_(zi),moduleKeyword:_(zi),operator:Hi,derefOperator:_(Hi),arithmeticOperator:_(Hi),logicOperator:_(Hi),bitwiseOperator:_(Hi),compareOperator:_(Hi),updateOperator:_(Hi),definitionOperator:_(Hi),typeOperator:_(Hi),controlOperator:_(Hi),punctuation:D1,separator:_(D1),bracket:Uu,angleBracket:_(Uu),squareBracket:_(Uu),paren:_(Uu),brace:_(Uu),content:Ui,heading:mo,heading1:_(mo),heading2:_(mo),heading3:_(mo),heading4:_(mo),heading5:_(mo),heading6:_(mo),contentSeparator:_(Ui),list:_(Ui),quote:_(Ui),emphasis:_(Ui),strong:_(Ui),link:_(Ui),monospace:_(Ui),strikethrough:_(Ui),inserted:_(),deleted:_(),changed:_(),invalid:_(),meta:Yp,documentMeta:_(Yp),annotation:_(Yp),processingInstruction:_(Yp),definition:ui.defineModifier("definition"),constant:ui.defineModifier("constant"),function:ui.defineModifier("function"),standard:ui.defineModifier("standard"),local:ui.defineModifier("local"),special:ui.defineModifier("special")};for(let t in E){let e=E[t];e instanceof ui&&(e.name=t)}var Vfe=M1([{tag:E.link,class:"tok-link"},{tag:E.heading,class:"tok-heading"},{tag:E.emphasis,class:"tok-emphasis"},{tag:E.strong,class:"tok-strong"},{tag:E.keyword,class:"tok-keyword"},{tag:E.atom,class:"tok-atom"},{tag:E.bool,class:"tok-bool"},{tag:E.url,class:"tok-url"},{tag:E.labelName,class:"tok-labelName"},{tag:E.inserted,class:"tok-inserted"},{tag:E.deleted,class:"tok-deleted"},{tag:E.literal,class:"tok-literal"},{tag:E.string,class:"tok-string"},{tag:E.number,class:"tok-number"},{tag:[E.regexp,E.escape,E.special(E.string)],class:"tok-string2"},{tag:E.variableName,class:"tok-variableName"},{tag:E.local(E.variableName),class:"tok-variableName tok-local"},{tag:E.definition(E.variableName),class:"tok-variableName tok-definition"},{tag:E.special(E.variableName),class:"tok-variableName2"},{tag:E.definition(E.propertyName),class:"tok-propertyName tok-definition"},{tag:E.typeName,class:"tok-typeName"},{tag:E.namespace,class:"tok-namespace"},{tag:E.className,class:"tok-className"},{tag:E.macroName,class:"tok-macroName"},{tag:E.propertyName,class:"tok-propertyName"},{tag:E.operator,class:"tok-operator"},{tag:E.comment,class:"tok-comment"},{tag:E.meta,class:"tok-meta"},{tag:E.invalid,class:"tok-invalid"},{tag:E.punctuation,class:"tok-punctuation"}]);var R1,ca=new G;function hj(t){return I.define({combine:t?e=>e.concat(t):void 0})}var dj=new G,Sn=class{constructor(e,n,i=[],r=""){this.data=e,this.name=r,Ee.prototype.hasOwnProperty("tree")||Object.defineProperty(Ee.prototype,"tree",{get(){return fi(this)}}),this.parser=n,this.extension=[ua.of(this),Ee.languageData.of((s,o,l)=>{let a=YD(s,o,l),c=a.type.prop(ca);if(!c)return[];let u=s.facet(c),f=a.type.prop(dj);if(f){let h=a.resolve(o-a.from,l);for(let d of f)if(d.test(h,s)){let p=s.facet(d.facet);return d.type=="replace"?p:p.concat(u)}}return u})].concat(i)}isActiveAt(e,n,i=-1){return YD(e,n,i).type.prop(ca)==this.data}findRegions(e){let n=e.facet(ua);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(ca)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(G.mounted);if(l){if(l.tree.prop(ca)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof Ye&&r(c,s.positions[a]+o)}};return r(fi(e),0),i}get allowsNesting(){return!0}};Sn.setState=he.define();function YD(t,e,n){let i=t.facet(ua),r=fi(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,He.ExcludeBuffers|He.EnterBracketed))s.type.isTop&&(r=s);return r}var ju=class t extends Sn{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=hj(e.languageData);return new t(n,e.parser.configure({props:[ca.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new t(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function fi(t){let e=t.field(Sn.state,!1);return e?e.tree:Ye.empty}var I1=class{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 i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}},Fu=null,B1=class t{constructor(e,n,i=[],r,s,o,l,a){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new t(e,n,[],Ye.empty,0,i,[],null)}startParse(){return this.parser.startParse(new I1(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ye.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(po.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(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=Fu;Fu=this;try{return e()}finally{Fu=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=KD(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,f,h)=>a.push({fromA:c,toA:u,fromB:f,toB:h})),i=po.applyChanges(i,a),r=Ye.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&l.push({from:u,to:f})}}}return new t(this.parser,n,i,r,s,o,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 i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=KD(this.fragments,r,s),this.skipped.splice(i--,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 la{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=Fu;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Ye(Rt.none,[],[],o-s)},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 Fu}};function KD(t,e,n){return po.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}var Vu=class t{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),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new t(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=B1.create(e.facet(ua).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new t(i)}};Sn.state=Mt.define({create:Vu.init,update(t,e){for(let n of e.effects)if(n.is(Sn.setState))return n.value;return e.startState.facet(ua)!=e.state.facet(ua)?Vu.init(e.state):t.apply(e)}});var WD=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(WD=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});var N1=typeof navigator<"u"&&(!((R1=navigator.scheduling)===null||R1===void 0)&&R1.isInputPending)?()=>navigator.scheduling.isInputPending():null,pj=Fn.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(Sn.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(Sn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=WD(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:i,viewport:{to:r}}=this.view,s=i.field(Sn.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!N1?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>N1&&N1()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Sn.setState.of(new Vu(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>bn(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()}}}),ua=I.define({combine(t){return t.length?t[0]:null},enables:t=>[Sn.state,pj,U.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),Gp=class{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};var mj=I.define(),Qp=I.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 $u(t){let e=t.facet(Qp);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Yu(t,e){let n="",i=t.tabSize,r=t.facet(Qp)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function F1(t,e){t instanceof Ee&&(t=new yo(t));for(let i of t.state.facet(mj)){let r=i(t,e);if(r!==void 0)return r}let n=fi(t.state);return n.length>=e?gj(t,n,e):null}var yo=class{constructor(e,n={}){this.state=e,this.options=n,this.unit=$u(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return oo(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},j1=new G;function gj(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return ZD(i,t,n)}function ZD(t,e,n){for(let i=t;i;i=i.next){let r=bj(i.node);if(r)return r(q1.create(e,n,i))}return 0}function yj(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function bj(t){let e=t.type.prop(j1);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(G.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>JD(o,!0,1,void 0,s&&!yj(o)?r.from:void 0)}return t.parent==null?vj:null}function vj(){return 0}var q1=class t extends yo{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new t(e,n,i)}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 i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Sj(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return ZD(this.context.next,this.base,this.pos)}};function Sj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function xj(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function V1({closing:t,align:e=!0,units:n=1}){return i=>JD(i,e,n,t)}function JD(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,a=e?xj(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}var eM=new G;function tM(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}var fa=class t{constructor(e,n){this.specs=e;let i;function r(l){let a=Pn.newName();return(i||(i=Object.create(null)))["."+a]=l,a}let s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof Sn?l=>l.prop(ca)==o.data:o?l=>l==o:void 0,this.style=M1(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Pn(i):null,this.themeType=n.themeType}static define(e,n){return new t(e,n||{})}},P1=I.define(),nM=I.define({combine(t){return t.length?[t[0]]:null}});function _1(t){let e=t.facet(P1);return e.length?e:t.facet(nM)}function iM(t,e){let n=[wj],i;return t instanceof fa&&(t.module&&n.push(U.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(nM.of(t)):i?n.push(P1.computeN([U.darkTheme],r=>r.facet(U.darkTheme)==(i=="dark")?[t]:[])):n.push(P1.of(t)),n}var z1=class{constructor(e){this.markCache=Object.create(null),this.tree=fi(e.state),this.decorations=this.buildDeco(e,_1(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=fi(e.state),i=_1(e.state),r=i!=_1(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return Se.none;let i=new gr;for(let{from:r,to:s}of e.visibleRanges)$D(this.tree,n,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=Se.mark({class:a})))},r,s);return i.finish()}},wj=vu.high(Fn.fromClass(z1,{decorations:t=>t.decorations})),Zfe=fa.define([{tag:E.meta,color:"#404740"},{tag:E.link,textDecoration:"underline"},{tag:E.heading,textDecoration:"underline",fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.keyword,color:"#708"},{tag:[E.atom,E.bool,E.url,E.contentSeparator,E.labelName],color:"#219"},{tag:[E.literal,E.inserted],color:"#164"},{tag:[E.string,E.deleted],color:"#a11"},{tag:[E.regexp,E.escape,E.special(E.string)],color:"#e40"},{tag:E.definition(E.variableName),color:"#00f"},{tag:E.local(E.variableName),color:"#30a"},{tag:[E.typeName,E.namespace],color:"#085"},{tag:E.className,color:"#167"},{tag:[E.special(E.variableName),E.macroName],color:"#256"},{tag:E.definition(E.propertyName),color:"#00c"},{tag:E.comment,color:"#940"},{tag:E.invalid,color:"#f00"}]);var kj=1e4,Aj="()[]{}";var Oj=new G;function H1(t,e,n){let i=t.prop(e<0?G.openedBy:G.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function U1(t){let e=t.type.prop(Oj);return e?e(t.node):t}function bo(t,e,n,i={}){let r=i.maxScanDistance||kj,s=i.brackets||Aj,o=fi(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=H1(a.type,n,s);if(c&&a.from<a.to){let u=U1(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return Tj(t,e,n,a,u,c,s)}}return Cj(t,e,n,o,l.type,r,s)}function Tj(t,e,n,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l?.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do if(n<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=U1(u);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(H1(u.type,n,o))c++;else if(H1(u.type,-n,o)){if(c==0){let f=U1(u);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function Cj(t,e,n,i,r,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!u.next().done&&h<=s;){let d=u.value;n<0&&(h+=d.length);let p=e+h*n;for(let m=n>0?0:d.length-1,b=n>0?d.length:-1;m!=b;m+=n){let y=o.indexOf(d[m]);if(!(y<0||i.resolveInner(p+m,1).type!=r))if(y%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:y>>1==a>>1};f--}}n>0&&(h+=d.length)}return u.done?{start:c,matched:!1}:null}var Ej=Object.create(null),GD=[Rt.none];var QD=[],XD=Object.create(null),Dj=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"]])Dj[t]=Mj(Ej,e);function L1(t,e){QD.indexOf(t)>-1||(QD.push(t),console.warn(e))}function Mj(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||E[c];u?typeof u=="function"?a.length?a=a.map(u):L1(c,`Modifier ${c} used at start of tag`):a.length?L1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:L1(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=XD[r];if(s)return s.id;let o=XD[r]=Rt.define({id:GD.length,name:i,props:[aa({[i]:n})]});return GD.push(o),o.id}var Jfe={rtl:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:_e.RTL}),ltr:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:_e.LTR}),auto:Se.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Rj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=W1(t.state,n.from);return i.line?Nj(t):i.block?Lj(t):!1};function X1(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}var Nj=X1(qj,0);var _j=X1(hM,0);var Lj=X1((t,e)=>hM(t,e,Bj(e)),0);function W1(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}var Ku=50;function Ij(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-Ku,i),o=t.sliceDoc(r,r+Ku),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let u,f;r-i<=2*Ku?u=f=t.sliceDoc(i,r):(u=t.sliceDoc(i,i+Ku),f=t.sliceDoc(r-Ku,r));let h=/^\s*/.exec(u)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-n.length;return u.slice(h,h+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:i+h+e.length,margin:/\s/.test(u.charAt(h+e.length))?1:0},close:{pos:r-d-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function Bj(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function hM(t,e,n=e.selection.ranges){let i=n.map(s=>W1(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>Ij(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=i[o],{open:c,close:u}=l;s.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:s}}return null}function qj(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of n){let l=i.length,a=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=W1(e,f.from).line,!c))continue e;if(f.from>r&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,p=f.text.slice(h,h+c.length)==c?h:-1;h<f.text.length&&h<a&&(a=h),i.push({line:f,comment:p,token:c,indent:h,empty:d,single:!1})}u=f.to+1}if(a<1e9)for(let u=l;u<i.length;u++)i[u].indent<i[u].line.text.length&&(i[u].indent=a);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:f}of i)(f||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}var Y1=qn.define(),Pj=qn.define(),zj=I.define(),dM=I.define({combine(t){return hs(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),pM=Mt.define({create(){return vo.empty},update(t,e){let n=e.state.facet(dM),i=e.annotation(Y1);if(i){let a=hi.fromTransaction(e,i.selection),c=i.side,u=c==0?t.undone:t.done;return a?u=Wp(u,u.length,n.minDepth,a):u=bM(u,e.startState.selection),new vo(c==0?i.rest:u,c==0?u:i.rest)}let r=e.annotation(Pj);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(pt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=hi.fromTransaction(e),o=e.annotation(pt.time),l=e.annotation(pt.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="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 vo(t.done.map(hi.fromJSON),t.undone.map(hi.fromJSON))}});function mM(t={}){return[pM,dM.of(t),U.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?gM:e.inputType=="historyRedo"?K1:null;return i?(e.preventDefault(),i(n)):!1}})]}function Zp(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(pM,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}var gM=Zp(0,!1),K1=Zp(1,!1),Hj=Zp(0,!0),Uj=Zp(1,!0);var hi=class t{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;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:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new t(e.changes&&Vt.fromJSON(e.changes),[],e.mapped&&mr.fromJSON(e.mapped),e.startSelection&&N.fromJSON(e.startSelection),e.selectionsAfter.map(N.fromJSON))}static fromTransaction(e,n){let i=Vn;for(let r of e.startState.facet(zj)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,Vn)}static selection(e){return new t(void 0,Vn,void 0,void 0,e)}};function Wp(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function Fj(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&o<=u&&(i=!0)}}),i}function jj(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function yM(t,e){return t.length?e.length?t.concat(e):t:e}var Vn=[],Vj=200;function bM(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Vj));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),Wp(t,t.length-1,1e9,n.setSelAfter(i)))}else return[hi.selection([e])]}function $j(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 $1(t,e){if(!t.length)return t;let n=t.length,i=Vn;for(;n;){let r=Yj(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[hi.selection(i)]:Vn}function Yj(t,e,n){let i=yM(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Vn,n);if(!t.changes)return hi.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new hi(r,he.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}var Kj=/^(input\.type|delete)($|\.)/,vo=class t{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new t(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Kj.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,Fj(l.changes,e.changes))||i=="input.type.compose")?o=Wp(o,o.length-1,r.minDepth,new hi(e.changes.compose(l.changes),yM(he.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Vn)):o=Wp(o,o.length,r.minDepth,e),new t(o,Vn,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Vn;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&jj(s[s.length-1],e)?this:new t(bM(this.done,e),this.undone,n,i)}addMapping(e){return new t($1(this.done,e),$1(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:Y1.of({side:e,rest:$j(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Vn:r.slice(0,r.length-1);return s.mapped&&(l=$1(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:Y1.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};vo.empty=new vo(Vn,Vn);var vM=[{key:"Mod-z",run:gM,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:K1,preventDefault:!0},{linux:"Ctrl-Shift-z",run:K1,preventDefault:!0},{key:"Mod-u",run:Hj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Uj,preventDefault:!0}];function ha(t,e){return N.create(t.ranges.map(e),t.mainIndex)}function di(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function pi({state:t,dispatch:e},n){let i=ha(t.selection,n);return i.eq(t.selection,!0)?!1:(e(di(t,i)),!0)}function Jp(t,e){return N.cursor(e?t.to:t.from)}function SM(t,e){return pi(t,n=>n.empty?t.moveByChar(n,e):Jp(n,e))}function Nt(t){return t.textDirectionAt(t.state.selection.main.head)==_e.LTR}var xM=t=>SM(t,!Nt(t)),wM=t=>SM(t,Nt(t));function kM(t,e){return pi(t,n=>n.empty?t.moveByGroup(n,e):Jp(n,e))}var Gj=t=>kM(t,!Nt(t)),Qj=t=>kM(t,Nt(t));var ohe=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function Xj(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function em(t,e,n){let i=fi(t).resolveInner(e.head),r=n?G.closedBy:G.openedBy;for(let a=e.head;;){let c=n?i.childAfter(a):i.childBefore(a);if(!c)break;Xj(t,c,r)?i=c:a=n?c.to:c.from}let s=i.type.prop(r),o,l;return s&&(o=n?bo(t,i.from,1):bo(t,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,N.cursor(l,n?-1:1)}var Wj=t=>pi(t,e=>em(t.state,e,!Nt(t))),Zj=t=>pi(t,e=>em(t.state,e,Nt(t)));function AM(t,e){return pi(t,n=>{if(!n.empty)return Jp(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}var OM=t=>AM(t,!1),TM=t=>AM(t,!0);function CM(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(U.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function EM(t,e){let n=CM(t),{state:i}=t,r=ha(i.selection,o=>o.empty?t.moveVertically(o,e,n.height):Jp(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;o&&o.top>a&&o.bottom<c&&(s=U.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-a}))}return t.dispatch(di(i,r),{effects:s}),!0}var rM=t=>EM(t,!1),G1=t=>EM(t,!0);function Ss(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=N.cursor(i.from+s))}return r}var Jj=t=>pi(t,e=>Ss(t,e,!0)),eV=t=>pi(t,e=>Ss(t,e,!1)),tV=t=>pi(t,e=>Ss(t,e,!Nt(t))),nV=t=>pi(t,e=>Ss(t,e,Nt(t))),iV=t=>pi(t,e=>N.cursor(t.lineBlockAt(e.head).from,1)),rV=t=>pi(t,e=>N.cursor(t.lineBlockAt(e.head).to,-1));function sV(t,e,n){let i=!1,r=ha(t.selection,s=>{let o=bo(t,s.head,-1)||bo(t,s.head,1)||s.head>0&&bo(t,s.head-1,1)||s.head<t.doc.length&&bo(t,s.head+1,-1);if(!o||!o.end)return s;i=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return n?N.range(s.anchor,l):N.cursor(l)});return i?(e(di(t,r)),!0):!1}var oV=({state:t,dispatch:e})=>sV(t,e,!1);function $n(t,e,n){let i=ha(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=N.range(r.head,r.anchor));let s=n(r);return N.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(di(t.state,i)),!0)}function DM(t,e){return $n(t,e,n=>t.moveByChar(n,e))}var MM=t=>DM(t,!Nt(t)),RM=t=>DM(t,Nt(t));function NM(t,e){return $n(t,e,n=>t.moveByGroup(n,e))}var lV=t=>NM(t,!Nt(t)),aV=t=>NM(t,Nt(t));var cV=t=>{let e=!Nt(t);return $n(t,e,n=>em(t.state,n,e))},uV=t=>{let e=Nt(t);return $n(t,e,n=>em(t.state,n,e))};function _M(t,e){return $n(t,e,n=>t.moveVertically(n,e))}var LM=t=>_M(t,!1),IM=t=>_M(t,!0);function BM(t,e){return $n(t,e,n=>t.moveVertically(n,e,CM(t).height))}var sM=t=>BM(t,!1),oM=t=>BM(t,!0),fV=t=>$n(t,!0,e=>Ss(t,e,!0)),hV=t=>$n(t,!1,e=>Ss(t,e,!1)),dV=t=>{let e=!Nt(t);return $n(t,e,n=>Ss(t,n,e))},pV=t=>{let e=Nt(t);return $n(t,e,n=>Ss(t,n,e))},mV=t=>$n(t,!1,e=>N.cursor(t.lineBlockAt(e.head).from)),gV=t=>$n(t,!0,e=>N.cursor(t.lineBlockAt(e.head).to)),lM=({state:t,dispatch:e})=>(e(di(t,{anchor:0})),!0),aM=({state:t,dispatch:e})=>(e(di(t,{anchor:t.doc.length})),!0),cM=({state:t,dispatch:e})=>(e(di(t,{anchor:t.selection.main.anchor,head:0})),!0),uM=({state:t,dispatch:e})=>(e(di(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),yV=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),bV=({state:t,dispatch:e})=>{let n=tm(t).map(({from:i,to:r})=>N.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:N.create(n),userEvent:"select"})),!0},vV=({state:t,dispatch:e})=>{let n=ha(t.selection,i=>{let r=fi(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return N.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(di(t,n)),!0)};function qM(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.head<o.from||a.head>o.to){r.some(c=>c.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(t.dispatch(di(n,N.create(r,r.length-1))),!0)}var SV=t=>qM(t,!1),xV=t=>qM(t,!0),wV=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=N.create([n.main]):n.main.empty||(i=N.create([N.cursor(n.main.head)])),i?(e(di(t,i)),!0):!1};function Gu(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(n="delete.backward",a=Xp(t,a,!1)):a>o&&(n="delete.forward",a=Xp(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Xp(t,o,!1),l=Xp(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:N.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?U.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Xp(t,e,n){if(t instanceof U)for(let i of t.state.facet(U.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}var PM=(t,e,n)=>Gu(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),l,a;if(n&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let c=oo(l,s.tabSize),u=c%$u(s)||$u(s);for(let f=0;f<u&&l[l.length-1-f]==" ";f++)r--;a=r}else a=mt(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=mt(o.text,a-o.from,!1,!1)+o.from);return a}),Q1=t=>PM(t,!1,!0);var zM=t=>PM(t,!0,!1),HM=(t,e)=>Gu(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=mt(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||i!=n.head)&&(l=u),i=a}return i}),UM=t=>HM(t,!1),kV=t=>HM(t,!0);var AV=t=>Gu(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var OV=t=>Gu(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),TV=t=>Gu(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var CV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:ue.of(["",""])},range:N.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},EV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:mt(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:mt(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:N.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function tm(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function FM(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of tm(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)r.push(N.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)r.push(N.range(a.anchor-l,a.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:N.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}var DV=({state:t,dispatch:e})=>FM(t,e,!1),MV=({state:t,dispatch:e})=>FM(t,e,!0);function jM(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of tm(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var RV=({state:t,dispatch:e})=>jM(t,e,!1),NV=({state:t,dispatch:e})=>jM(t,e,!0),_V=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(tm(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=ha(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function LV(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=fi(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(G.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var fM=VM(!1),IV=VM(!0);function VM(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!t&&s==o&&LV(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new yo(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=F1(c,s);for(u==null&&(u=oo(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let f=["",Yu(e,u)];return a&&f.push(Yu(e,c.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:ue.of(f)},range:N.cursor(s+1+f[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Z1(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let l=t.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:N.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var BV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new yo(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=Z1(t,(s,o,l)=>{let a=F1(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=Yu(t,a);(c!=u||l.from<s.from+c.length)&&(n[s.from]=a,o.push({from:s.from,to:s.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},qV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Z1(t,(n,i)=>{i.push({from:n.from,insert:t.facet(Qp)})}),{userEvent:"input.indent"})),!0),PV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Z1(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=oo(r,t.tabSize),o=0,l=Yu(t,Math.max(0,s-$u(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:n.from+o,to:n.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),zV=t=>(t.setTabFocusMode(),!0);var HV=[{key:"Ctrl-b",run:xM,shift:MM,preventDefault:!0},{key:"Ctrl-f",run:wM,shift:RM},{key:"Ctrl-p",run:OM,shift:LM},{key:"Ctrl-n",run:TM,shift:IM},{key:"Ctrl-a",run:iV,shift:mV},{key:"Ctrl-e",run:rV,shift:gV},{key:"Ctrl-d",run:zM},{key:"Ctrl-h",run:Q1},{key:"Ctrl-k",run:AV},{key:"Ctrl-Alt-h",run:UM},{key:"Ctrl-o",run:CV},{key:"Ctrl-t",run:EV},{key:"Ctrl-v",run:G1}],UV=[{key:"ArrowLeft",run:xM,shift:MM,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Gj,shift:lV,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:tV,shift:dV,preventDefault:!0},{key:"ArrowRight",run:wM,shift:RM,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Qj,shift:aV,preventDefault:!0},{mac:"Cmd-ArrowRight",run:nV,shift:pV,preventDefault:!0},{key:"ArrowUp",run:OM,shift:LM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:lM,shift:cM},{mac:"Ctrl-ArrowUp",run:rM,shift:sM},{key:"ArrowDown",run:TM,shift:IM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:aM,shift:uM},{mac:"Ctrl-ArrowDown",run:G1,shift:oM},{key:"PageUp",run:rM,shift:sM},{key:"PageDown",run:G1,shift:oM},{key:"Home",run:eV,shift:hV,preventDefault:!0},{key:"Mod-Home",run:lM,shift:cM},{key:"End",run:Jj,shift:fV,preventDefault:!0},{key:"Mod-End",run:aM,shift:uM},{key:"Enter",run:fM,shift:fM},{key:"Mod-a",run:yV},{key:"Backspace",run:Q1,shift:Q1,preventDefault:!0},{key:"Delete",run:zM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:UM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:kV,preventDefault:!0},{mac:"Mod-Backspace",run:OV,preventDefault:!0},{mac:"Mod-Delete",run:TV,preventDefault:!0}].concat(HV.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),$M=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Wj,shift:cV},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Zj,shift:uV},{key:"Alt-ArrowUp",run:DV},{key:"Shift-Alt-ArrowUp",run:RV},{key:"Alt-ArrowDown",run:MV},{key:"Shift-Alt-ArrowDown",run:NV},{key:"Mod-Alt-ArrowUp",run:SV},{key:"Mod-Alt-ArrowDown",run:xV},{key:"Escape",run:wV},{key:"Mod-Enter",run:IV},{key:"Alt-l",mac:"Ctrl-l",run:bV},{key:"Mod-i",run:vV,preventDefault:!0},{key:"Mod-[",run:PV},{key:"Mod-]",run:qV},{key:"Mod-Alt-\\",run:BV},{key:"Shift-Mod-k",run:_V},{key:"Shift-Mod-\\",run:oV},{key:"Mod-/",run:Rj},{key:"Alt-A",run:_j},{key:"Ctrl-m",mac:"Shift-Alt-m",run:zV}].concat(UV);var tS=class t{constructor(e,n,i,r,s,o,l,a,c,u=0,f){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,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,i=0){let r=e.parser.context;return new t(e,[],n,i,i,0,[],0,r?new nm(r,r.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 i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(i-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-f;if(r<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,d,h+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new t(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new nS(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}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 r=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(n[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let o=n[s+1];r.some((l,a)=>a&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}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=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let 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 nm(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},nm=class{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}},nS=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}},iS=class t{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new t(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 t(this.stack,this.pos,this.index)}};function Qu(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}var da=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},YM=new da,rS=class{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=YM,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 i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}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,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}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=YM,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 i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}},xs=class{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;WM(this.data,e,n,this.id,i.data,i.tokenPrecTable)}};xs.prototype.contextual=xs.prototype.fallback=xs.prototype.extend=!1;var sS=class{constructor(e,n,i){this.precTable=n,this.elseToken=i,this.data=typeof e=="string"?Qu(e):e}token(e,n){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(WM(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};sS.prototype.contextual=xs.prototype.fallback=xs.prototype.extend=!1;var So=class{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};function WM(t,e,n,i,r,s){let o=0,l=1<<i,{dialect:a}=n.p.parser;e:for(;(l&t[o])!=0;){let c=t[o+1];for(let d=o+3;d<c;d+=2)if((t[d+1]&l)>0){let p=t[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||jV(p,e.token.value,r,s))){e.acceptToken(p);break}}let u=e.next,f=0,h=t[o+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){o=t[c+h*3-1];continue e}for(;f<h;){let d=f+h>>1,p=c+d+(d<<1),m=t[p],b=t[p+1]||65536;if(u<m)h=d;else if(u>=b)f=d+1;else{o=t[p+2],e.advance();continue e}}break}}function KM(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function jV(t,e,n,i){let r=KM(n,i,e);return r<0||KM(n,i,t)<r}var xn=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),J1=null;function GM(t,e,n){let i=t.cursor(He.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}var oS=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?GM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?GM(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 i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[n]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof Ye){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(G.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}},lS=class{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new da)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],f=this.tokens[c];if(!(i&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,u,e),f.mask=o,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),!u.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new da,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new da,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(s,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=wr(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(wr(l,c+2),n,i,r));break}l[c]==n&&(r=this.putAction(wr(l,c+1),n,i,r))}return r}},aS=class{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new rS(n,r),this.tokens=new lS(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[tS.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new oS(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&VV(r);if(o)return xn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw xn&&r&&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&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return xn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let c=i[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].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,i){let r=e.pos,{parser:s}=this,o=xn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(G.contextHash)||0)==u))return e.useNode(f,h),xn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ye)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof Ye&&f.positions[0]==0)f=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),xn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],f=a[c++],h=a[c++],d=c==a.length||!i,p=d?e:e.split(),m=this.tokens.mainToken;if(p.apply(u,f,m?m.start:p.pos,h),xn&&console.log(o+this.stackID(p)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(f)} @ ${r}${p==e?"":", split"})`),d)return!0;p.pos>r?n.push(p):i.push(p)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return QM(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=n[o<<1],c=n[(o<<1)+1],u=xn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),xn&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=u;for(let d=0;d<10&&f.forceReduce()&&(xn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)xn&&(h=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))xn&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),xn&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),QM(l,i)):(!r||r.score<f.score)&&(r=f)}return r}stackToTree(e){return e.close(),Ye.build({buffer:iS.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=(J1||(J1=new WeakMap)).get(e);return n||J1.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}};function QM(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}var cS=class{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}},eS=t=>t,im=class{constructor(e){this.start=e.start,this.shift=e.shift||eS,this.reduce=e.reduce||eS,this.reuse=e.reuse||eS,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},pa=class t extends la{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 i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,a,c){r[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=G[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)s(u,a,l[c++]);else{let f=l[c+-u];for(let h=-u;h>0;h--)s(l[c++],a,f);c++}}}this.nodeSet=new qu(n.map((l,a)=>Rt.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.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=1024;let o=Qu(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(XM),this.states=Qu(e.states,Uint32Array),this.data=Qu(e.stateData),this.goto=Qu(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new xs(o,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,i){let r=new aS(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let c=s+(o>>1);s<c;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=wr(i,s+2)];else{if(i[s+1]==2)return wr(i,s+2);break}if(o==n||o==0)return wr(i,s+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,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=wr(this.data,s+2);else break;r=n(wr(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=wr(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=XM(o),o})),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),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new cS(e,i,r)}static deserialize(e){return new t(e)}};function wr(t,e){return t[e]|t[e+1]<<16}function VV(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function XM(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}var ma=63,ZM=64,$V=1,YV=2,tR=3,KV=4,nR=5,GV=6,QV=7,iR=65,XV=66,WV=8,ZV=9,JV=10,e$=11,t$=12,rR=13,n$=19,i$=20,r$=29,s$=33,o$=34,l$=47,a$=0,mS=1,fS=2,Wu=3,hS=4,kr=class{constructor(e,n,i){this.parent=e,this.depth=n,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+i}};kr.top=new kr(null,-1,a$);function Xu(t,e){for(let n=0,i=e-t.pos-1;;i--,n++){let r=t.peek(i);if(Ar(r)||r==-1)return n}}function dS(t){return t==32||t==9}function Ar(t){return t==10||t==13}function sR(t){return dS(t)||Ar(t)}function xo(t){return t<0||sR(t)}var c$=new im({start:kr.top,reduce(t,e){return t.type==Wu&&(e==i$||e==o$)?t.parent:t},shift(t,e,n,i){if(e==tR)return new kr(t,Xu(i,i.pos),mS);if(e==iR||e==nR)return new kr(t,Xu(i,i.pos),fS);if(e==ma)return t.parent;if(e==n$||e==s$)return new kr(t,0,Wu);if(e==rR&&t.type==hS)return t.parent;if(e==l$){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new kr(t,t.depth+ +r[0],hS)}return t},hash(t){return t.hash}});function ga(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&xo(t.peek(n+3))}var u$=new So((t,e)=>{if(t.next==-1&&e.canShift(ZM))return t.acceptToken(ZM);let n=t.peek(-1);if((Ar(n)||n<0)&&e.context.type!=Wu){if(ga(t,45))if(e.canShift(ma))t.acceptToken(ma);else return t.acceptToken($V,3);if(ga(t,46))if(e.canShift(ma))t.acceptToken(ma);else return t.acceptToken(YV,3);let i=0;for(;t.next==32;)i++,t.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==mS&&(t.next!=45||!xo(t.peek(1))))&&t.next!=-1&&!Ar(t.next)&&t.next!=35&&t.acceptToken(ma,-i)}},{contextual:!0}),f$=new So((t,e)=>{if(e.context.type==Wu){t.next==63&&(t.advance(),xo(t.next)&&t.acceptToken(QV));return}if(t.next==45)t.advance(),xo(t.next)&&t.acceptToken(e.context.type==mS&&e.context.depth==Xu(t,t.pos-1)?KV:tR);else if(t.next==63)t.advance(),xo(t.next)&&t.acceptToken(e.context.type==fS&&e.context.depth==Xu(t,t.pos-1)?GV:nR);else{let n=t.pos;for(;;)if(dS(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)oR(t);else if(t.next==38)pS(t);else if(t.next==42){pS(t);break}else if(t.next==39||t.next==34){if(gS(t,!0))break;return}else if(t.next==91||t.next==123){if(!d$(t))return;break}else{lR(t,!0,!1,0);break}for(;dS(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(r$))return;let i=t.peek(1);xo(i)&&t.acceptTokenTo(e.context.type==fS&&e.context.depth==Xu(t,n)?XV:iR,n)}}},{contextual:!0});function h$(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function JM(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function eR(t,e){return t.next==37?(t.advance(),JM(t.next)&&t.advance(),JM(t.next)&&t.advance(),!0):h$(t.next)||e&&t.next==44?(t.advance(),!0):!1}function oR(t){if(t.advance(),t.next==60){for(t.advance();;)if(!eR(t,!0)){t.next==62&&t.advance();break}}else for(;eR(t,!1););}function pS(t){for(t.advance();!xo(t.next)&&rm(t.next)!="f";)t.advance()}function gS(t,e){let n=t.next,i=!1,r=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(Ar(s)){if(e)return!1;i=!0}else if(e&&t.pos>=r+1024)return!1}return!i}function d$(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!gS(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||Ar(t.next))return!1;t.advance()}}var p$="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function rm(t){return t<33?"u":t>125?"s":p$[t-33]}function uS(t,e){let n=rm(t);return n!="u"&&!(e&&n=="f")}function lR(t,e,n,i){if(rm(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&uS(t.peek(1),n))t.advance();else return!1;let r=t.pos;for(;;){let s=t.next,o=0,l=i+1;for(;sR(s);){if(Ar(s)){if(e)return!1;l=0}else l++;s=t.peek(++o)}if(!(s>=0&&(s==58?uS(t.peek(o+1),n):s==35?t.peek(o-1)!=32:uS(s,n)))||!n&&l<=i||l==0&&!n&&(ga(t,45,o)||ga(t,46,o)))break;if(e&&rm(s)=="f")return!1;for(let c=o;c>=0;c--)t.advance();if(e&&t.pos>r+1024)return!1}return!0}var m$=new So((t,e)=>{if(t.next==33)oR(t),t.acceptToken(t$);else if(t.next==38||t.next==42){let n=t.next==38?JV:e$;pS(t),t.acceptToken(n)}else t.next==39||t.next==34?(gS(t,!1),t.acceptToken(ZV)):lR(t,!1,e.context.type==Wu,e.context.depth)&&t.acceptToken(WV)}),g$=new So((t,e)=>{let n=e.context.type==hS?e.context.depth:-1,i=t.pos;e:for(;;){let r=0,s=t.next;for(;s==32;)s=t.peek(++r);if(!r&&(ga(t,45,r)||ga(t,46,r))||!Ar(s)&&(n<0&&(n=Math.max(e.context.depth+1,r)),r<n))break;for(;;){if(t.next<0)break e;let o=Ar(t.next);if(t.advance(),o)continue e;i=t.pos}}t.acceptTokenTo(rR,i)}),y$=aa({DirectiveName:E.keyword,DirectiveContent:E.attributeValue,"DirectiveEnd DocEnd":E.meta,QuotedLiteral:E.string,BlockLiteralHeader:E.special(E.string),BlockLiteralContent:E.content,Literal:E.content,"Key/Literal Key/QuotedLiteral":E.definition(E.propertyName),"Anchor Alias":E.labelName,Tag:E.typeName,Comment:E.lineComment,": , -":E.separator,"?":E.punctuation,"[ ]":E.squareBracket,"{ }":E.brace}),aR=pa.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"\u26A0 DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:c$,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[y$],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[u$,f$,m$,g$,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var b$=pa.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"\u26A0 Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),v$=ju.define({name:"yaml",parser:aR.configure({props:[j1.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:V1({closing:"}"}),FlowSequence:V1({closing:"]"})}),eM.add({"FlowMapping FlowSequence":tM,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function cR(){return new Gp(v$)}var vhe=ju.define({name:"yaml-frontmatter",parser:b$.configure({props:[aa({DashLine:E.meta})]})});var lm=class{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}},wo=class t{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(Zu).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((d,p)=>d.from-p.from||d.to-p.to),o=new gr,l=[],a=0,c=i.doc.iter(),u=0,f=i.doc.length;for(let d=0;;){let p=d==s.length?null:s[d];if(!p&&!l.length)break;let m,b;if(l.length)m=a,b=l.reduce((v,S)=>Math.min(v,S.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;b=p.to,l.push(p),d++}for(;d<s.length;){let v=s[d];if(v.from==m&&(v.to>v.from||v.to==m))l.push(v),d++,b=Math.min(v.to,b);else{b=Math.min(v.from,b);break}}b=Math.min(b,f);let y=!1;if(l.some(v=>v.from==m&&(v.to==b||b==f))&&(y=m==b,!y&&b-m<10)){let v=m-(u+c.value.length);v>0&&(c.next(v),u=m);for(let S=m;;){if(S>=b){y=!0;break}if(!c.lineBreak&&u+c.value.length>S)break;S=u+c.value.length,u+=c.value.length,c.next()}}let g=vR(l);if(y)o.add(m,m,Se.widget({widget:new yS(g),diagnostics:l.slice()}));else{let v=l.reduce((S,w)=>w.markClass?S+" "+w.markClass:S,"");o.add(m,b,Se.mark({class:"cm-lintRange cm-lintRange-"+g+v,diagnostics:l.slice(),inclusiveEnd:l.some(S=>S.to>b)}))}if(a=b,a==f)break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1)}let h=o.finish();return new t(h,n,ya(h))}};function ya(t,e=null,n=0){let i=null;return t.between(n,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new lm(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new lm(i.from,s,i.diagnostic)}}),i}function hR(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(Zu).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(fm))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function S$(t,e){return t.field(mi,!1)?e:e.concat(he.appendConfig.of(R$))}function dR(t,e){return{effects:S$(t,[fm.of(e)])}}var fm=he.define(),pR=he.define(),mR=he.define(),mi=Mt.define({create(){return new wo(Se.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=ya(n,t.selected.diagnostic,s)||ya(n,null,s)}!n.size&&r&&e.state.facet(Zu).autoPanel&&(r=null),t=new wo(n,r,i)}for(let n of e.effects)if(n.is(fm)){let i=e.state.facet(Zu).autoPanel?n.value.length?cm.open:null:t.panel;t=wo.init(n.value,i,e.state)}else n.is(pR)?t=new wo(t.diagnostics,n.value?cm.open:null,t.selected):n.is(mR)&&(t=new wo(t.diagnostics,t.panel,n.value));return t},provide:t=>[Lp.from(t,e=>e.panel),U.decorations.from(t,e=>e.diagnostics)]});var x$=Se.mark({class:"cm-lintRange cm-lintRange-active"});function w$(t,e,n){let{diagnostics:i}=t.state.field(mi),r,s=-1,o=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0)))return r=u.diagnostics,s=a,o=c,!1});let l=t.state.facet(Zu).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:o,above:!0,create(){return{dom:gR(t,r)}}}:null}function gR(t,e){return yn("ul",{class:"cm-tooltip-lint"},e.map(n=>bR(t,n,!1)))}var uR=t=>{let e=t.state.field(mi,!1);return!e||!e.panel?!1:(t.dispatch({effects:pR.of(!1)}),!0)};var Zu=I.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...hs(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:fR,tooltipFilter:fR,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function fR(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function yR(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function bR(t,e,n){var i;let r=n?yR(e.actions):[];return yn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},yn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let p=ya(t.state.field(mi).diagnostics,e);p&&s.apply(t,p.from,p.to)},{name:c}=s,u=r[o]?c.indexOf(r[o]):-1,f=u<0?c:[c.slice(0,u),yn("u",c.slice(u,u+1)),c.slice(u+1)],h=s.markClass?" "+s.markClass:"";return yn("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&yn("div",{class:"cm-diagnosticSource"},e.source))}var yS=class extends Sr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return yn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},am=class{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=bR(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},cm=class t{constructor(e){this.view=e,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)uR(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=yR(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let a=ya(this.view.state.field(mi).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=yn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:i}),this.dom=yn("div",{class:"cm-panel-lint"},this.list,yn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>uR(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(mi).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(mi),i=0,r=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let f=-1,h;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==u){f=d;break}f<0?(h=new am(this.view,u),this.items.splice(i,0,h),r=!0):(h=this.items[f],f>i&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new am(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(mi),i=ya(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:mR.of(i)})}static open(e){return new t(e)}};function om(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 sm(t){return om(`<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"')}var k$=U.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:sm("#f11")},".cm-lintRange-warning":{backgroundImage:sm("orange")},".cm-lintRange-info":{backgroundImage:sm("#999")},".cm-lintRange-hint":{backgroundImage:sm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function A$(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function vR(t){let e="hint",n=1;for(let i of t){let r=A$(i.severity);r>n&&(n=r,e=i.severity)}return e}var um=class extends jn{constructor(e){super(),this.diagnostics=e,this.severity=vR(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,r=e.state.facet(hm).tooltipFilter;return r&&(i=r(i,e.state)),i.length&&(n.onmouseover=()=>T$(e,n,i)),n}};function O$(t,e){let n=i=>{let r=e.getBoundingClientRect();if(!(i.clientX>r.left-10&&i.clientX<r.right+10&&i.clientY>r.top-10&&i.clientY<r.bottom+10)){for(let s=i.target;s;s=s.parentNode)if(s.nodeType==1&&s.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),t.state.field(SR)&&t.dispatch({effects:vS.of(null)})}};window.addEventListener("mousemove",n)}function T$(t,e,n){function i(){let o=t.elementAtHeight(e.getBoundingClientRect().top+5-t.documentTop);t.coordsAtPos(o.from)&&t.dispatch({effects:vS.of({pos:o.from,above:!1,clip:!1,create(){return{dom:gR(t,n),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,O$(t,e)}let{hoverTime:r}=t.state.facet(hm),s=setTimeout(i,r);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(i,r)}}function C$(t,e){let n=Object.create(null);for(let r of e){let s=t.lineAt(r.from);(n[s.from]||(n[s.from]=[])).push(r)}let i=[];for(let r in n)i.push(new um(n[r]).range(+r));return de.of(i,!0)}var E$=v1({class:"cm-gutter-lint",markers:t=>t.state.field(bS),widgetMarker:(t,e,n)=>{let i=[];return t.state.field(bS).between(n.from,n.to,(r,s,o)=>{r>n.from&&r<n.to&&i.push(...o.diagnostics)}),i.length?new um(i):null}}),bS=Mt.define({create(){return de.empty},update(t,e){t=t.map(e.changes);let n=e.state.facet(hm).markerFilter;for(let i of e.effects)if(i.is(fm)){let r=i.value;n&&(r=n(r||[],e.state)),t=C$(e.state.doc,r.slice(0))}return t}}),vS=he.define(),SR=Mt.define({create(){return null},update(t,e){return t&&e.docChanged&&(t=hR(e,t)?null:{...t,pos:e.changes.mapPos(t.pos)}),e.effects.reduce((n,i)=>i.is(vS)?i.value:n,t)},provide:t=>Hp.from(t)}),D$=U.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:om('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:om('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:om('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),M$=LD(w$,{hideOn:hR}),R$=[mi,U.decorations.compute([mi],t=>{let{selected:e,panel:n}=t.field(mi);return!e||!n||e.from==e.to?Se.none:Se.set([x$.range(e.from,e.to)])}),M$,k$],hm=I.define({combine(t){return hs(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function xR(t={}){return[hm.of(t),bS,E$,D$,SR]}var Fi=Ae(vt()),wR={error:0,warning:1,info:2},N$=fa.define([{tag:E.comment,color:"var(--spytial-ed-syn-comment, #8a8170)",fontStyle:"italic"},{tag:[E.string,E.special(E.string)],color:"var(--spytial-ed-syn-string, #7a5901)"},{tag:[E.number,E.bool,E.null],color:"var(--spytial-ed-syn-number, #7a5901)"},{tag:[E.propertyName,E.definition(E.propertyName),E.keyword,E.atom],color:"var(--spytial-ed-syn-keyword, #6d28a8)"},{tag:[E.punctuation,E.separator],color:"var(--spytial-ed-text-muted, #6e6553)"}]),_$=U.theme({"&":{fontSize:"0.85em",color:"var(--spytial-ed-text, #221d14)",backgroundColor:"var(--spytial-ed-surface, #faf8f2)",border:"1px solid var(--spytial-ed-border, #d9d2c0)",borderRadius:"var(--spytial-ed-radius, 2px)",minHeight:"12rem"},"&.cm-focused":{outline:"2px solid var(--spytial-ed-accent, #b5431a)",outlineOffset:"-1px"},".cm-scroller":{fontFamily:"var(--spytial-ed-mono-font-family, ui-monospace, monospace)",lineHeight:"1.5",overflow:"auto"},".cm-content":{padding:"0.5em 0",caretColor:"var(--spytial-ed-accent, #b5431a)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--spytial-ed-accent, #b5431a)"},".cm-gutters":{backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text-muted, #6e6553)",border:"none",borderInlineEnd:"1px solid var(--spytial-ed-border, #d9d2c0)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5em 0 0.6em"},"&.cm-editor .cm-selectionBackground, & .cm-selectionBackground, & .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--spytial-ed-accent, #b5431a) 22%, transparent)"},".cm-tooltip":{border:"1px solid var(--spytial-ed-border, #d9d2c0)",backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text, #221d14)",borderRadius:"var(--spytial-ed-radius, 2px)",fontSize:"0.85em"}});function L$(t,e){if(!t)return[];let n=[];for(let i of t){if(i.from===void 0||i.to===void 0)continue;let r=Math.max(0,Math.min(i.from,e)),s=Math.max(r,Math.min(i.to,e));n.push({from:r,to:s,severity:i.severity,message:i.message,source:i.code})}return n.sort((i,r)=>i.from-r.from),n}var SS=({value:t,onChange:e,diagnostics:n,hasUnappliedEdits:i=!1,showLineNumbers:r=!0,syntaxHighlighting:s=!0,disabled:o=!1,"aria-label":l="Layout specification YAML",className:a})=>{let c=(0,sn.useRef)(null),u=(0,sn.useRef)(null),f=(0,sn.useRef)(e);f.current=e;let h=(0,sn.useRef)(new Kl),p=`${(0,sn.useId)()}-diag`;(0,sn.useEffect)(()=>{let b=c.current;if(!b)return;let y=[mM(),b1.of([...$M,...vM]),...r?[BD()]:[],...s?[cR(),iM(N$)]:[],xR(),_$,h.current.of([U.editable.of(!o),Ee.readOnly.of(o)]),U.contentAttributes.of({"aria-label":l,"aria-describedby":p}),U.updateListener.of(v=>{v.docChanged&&f.current(v.state.doc.toString())})],g=new U({state:Ee.create({doc:t,extensions:y}),parent:b});return u.current=g,()=>{g.destroy(),u.current=null}},[]),(0,sn.useEffect)(()=>{let b=u.current;if(!b)return;let y=b.state.doc.toString();y!==t&&b.dispatch({changes:{from:0,to:y.length,insert:t}})},[t]),(0,sn.useEffect)(()=>{let b=u.current;b&&b.dispatch(dR(b.state,L$(n,b.state.doc.length)))},[n]),(0,sn.useEffect)(()=>{let b=u.current;b&&b.dispatch({effects:h.current.reconfigure([U.editable.of(!o),Ee.readOnly.of(o)])})},[o]);let m=(0,sn.useMemo)(()=>!n||n.length===0?[]:[...n].sort((b,y)=>{let g=wR[b.severity]-wR[y.severity];return g!==0?g:(b.line??1/0)-(y.line??1/0)}),[n]);return(0,Fi.jsxs)("div",{className:`spytial-ed-code${a?` ${a}`:""}`,children:[i?(0,Fi.jsx)("div",{className:"spytial-ed-code-notice",role:"status",children:"Text has unapplied edits \u2014 fix the error below to update the builder."}):null,(0,Fi.jsx)("div",{ref:c,className:`spytial-ed-code-cm${o?" spytial-ed-code-cm--disabled":""}`}),m.length>0?(0,Fi.jsx)("ul",{className:"spytial-ed-code-diagnostics",id:p,children:m.map((b,y)=>(0,Fi.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${b.severity}`,children:[(0,Fi.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),b.line!==void 0?(0,Fi.jsx)("span",{className:"spytial-ed-code-diagnostic-loc",children:b.column!==void 0?`Ln ${b.line}, Col ${b.column}`:`Ln ${b.line}`}):null,(0,Fi.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:b.message})]},y))}):null]})};var se=Ae(On());var P=Ae(vt()),I$=new Set(["orientation","cyclic","align","groupselector","groupfield"]),xS=({constraints:t,directives:e,diagnostics:n,options:i,selectorProps:r,onAddItem:s,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h=!1,className:d})=>{let[p,m]=(0,se.useState)(null),b=(0,se.useCallback)(S=>{m(w=>w===S?null:S)},[]),y=(0,se.useCallback)(S=>m(null),[]),g=(0,se.useCallback)((S,w)=>{let O=s(S,w);return O&&typeof O=="object"&&"id"in O&&m(O.id),O},[s]),v=t.length===0&&e.length===0;return(0,P.jsxs)("div",{className:`spytial-ed-builder${d?` ${d}`:""}`,children:[(0,P.jsx)(kR,{title:"Constraints",kind:"constraint",items:t,diagnostics:n,options:i,selectorProps:r,expandedId:p,onToggleExpand:b,onCollapse:y,onAddItem:g,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),(0,P.jsx)(kR,{title:"Directives",kind:"directive",items:e,diagnostics:n,options:i,selectorProps:r,expandedId:p,onToggleExpand:b,onCollapse:y,onAddItem:g,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),v?(0,P.jsx)("p",{className:"spytial-ed-builder-empty",children:"No constraints or directives yet \u2014 add one to start shaping the layout."}):null]})},kR=({title:t,kind:e,items:n,diagnostics:i,options:r,selectorProps:s,expandedId:o,onToggleExpand:l,onCollapse:a,onAddItem:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:p,onMove:m,disabled:b})=>{let y=`${t} List`,g=(0,se.useRef)(new Map),v=(0,se.useRef)(null),S=(0,se.useRef)(null),w=(0,se.useCallback)((k,A)=>{A?g.current.set(k,A):g.current.delete(k)},[]),O=(0,se.useCallback)(k=>{let A=n.findIndex(M=>M.id===k),R=n[A+1],T=n[A-1];S.current=R?.id??T?.id??"__add__",p(k)},[n,p]);return(0,se.useEffect)(()=>{let k=S.current;if(k!==null){if(S.current=null,k==="__add__"){v.current?.focus();return}g.current.get(k)?.focus()}},[n]),(0,P.jsxs)("section",{className:"spytial-ed-section","aria-label":t,children:[(0,P.jsxs)("div",{className:"spytial-ed-section-head",children:[(0,P.jsx)("h3",{className:"spytial-ed-section-title",children:t}),(0,P.jsx)(P$,{kind:e,onAdd:c,disabled:b,triggerRef:v})]}),(0,P.jsx)("ul",{className:"spytial-ed-rows","aria-label":y,children:n.map((k,A)=>(0,P.jsx)(B$,{item:k,index:A,count:n.length,diagnostics:i,options:r,selectorProps:s,expanded:o===k.id,onToggleExpand:l,onCollapse:a,registerToggle:w,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:O,onMove:m,disabled:b},k.id))})]})},B$=({item:t,index:e,count:n,diagnostics:i,options:r,selectorProps:s,expanded:o,onToggleExpand:l,onCollapse:a,registerToggle:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:p,onMove:m,disabled:b})=>{let y=(0,se.useId)(),g=`${y}-panel`,v=Pt(t.type),S=(0,se.useRef)(null),w=t.id;(0,se.useEffect)(()=>(c(w,S.current),()=>c(w,null)),[w,c]);let O=(0,se.useMemo)(()=>(i??[]).filter(M=>M.itemId===t.id),[i,t.id]),k=H$(O);if(!v)return(0,P.jsx)("li",{className:"spytial-ed-row spytial-ed-row--unknown",children:(0,P.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,P.jsx)("span",{className:"spytial-ed-badge spytial-ed-badge--unknown",children:t.kind==="constraint"?"C":"D"}),(0,P.jsx)("span",{className:"spytial-ed-row-type",children:t.type}),(0,P.jsx)("span",{className:"spytial-ed-row-summary spytial-ed-row-summary--muted",children:"preserved as written"})]})});let A=(()=>{try{return v.summary(t.params)}catch{return""}})(),R=I$.has(t.type),T=t.params.hold==="never";return(0,P.jsxs)("li",{className:`spytial-ed-row${o?" spytial-ed-row--expanded":""}${k?` spytial-ed-row--${k}`:""}`,children:[(0,P.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,P.jsxs)("button",{ref:S,type:"button",className:"spytial-ed-row-toggle","aria-expanded":o,"aria-controls":g,disabled:b,onClick:()=>l(t.id),children:[(0,P.jsx)("span",{className:`spytial-ed-badge spytial-ed-badge--${t.kind}`,"aria-hidden":"true",children:t.kind==="constraint"?"C":"D"}),(0,P.jsx)("span",{className:"spytial-ed-row-type",children:v.label}),T?(0,P.jsx)("span",{className:"spytial-ed-row-negated",role:"img","aria-label":"should not hold",title:"should not hold (hold: never)",children:"\xAC"}):null,(0,P.jsx)("span",{className:"spytial-ed-row-summary",children:A}),k?(0,P.jsx)("span",{className:`spytial-ed-row-dot spytial-ed-row-dot--${k}`,role:"img","aria-label":`${k}: ${O.length} issue${O.length===1?"":"s"}`}):null]}),(0,P.jsx)(q$,{item:t,index:e,count:n,disabled:b,onDuplicate:d,onRemove:p,onMove:m,onAddComment:()=>l(t.id)})]}),o?(0,P.jsxs)("div",{className:"spytial-ed-row-panel",id:g,onKeyDown:M=>{M.key==="Escape"&&(M.stopPropagation(),a(t.id),S.current?.focus())},children:[(0,P.jsx)(Qd,{fields:z$(v.fields),values:t.params,diagnostics:O,options:r,disabled:b,onChange:(M,C)=>u(t.id,M,C),selectorProps:s?M=>s(t,M):void 0}),R?(0,P.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--hold",children:[(0,P.jsx)("span",{className:"spytial-ed-field-label",id:`${y}-hold-label`,title:"Whether this constraint must hold, or must NOT hold (hold: never), in the layout.",children:"Condition"}),(0,P.jsx)("div",{className:"spytial-ed-field-control",children:(0,P.jsxs)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":`${y}-hold-label`,children:[(0,P.jsx)("button",{type:"button",role:"radio","aria-checked":!T,className:`spytial-ed-pill${T?"":" spytial-ed-pill--active"}`,disabled:b,onClick:()=>h(t.id,!1),children:"Should hold"}),(0,P.jsx)("button",{type:"button",role:"radio","aria-checked":T,className:`spytial-ed-pill${T?" spytial-ed-pill--active spytial-ed-pill--negated":""}`,disabled:b,onClick:()=>h(t.id,!0),children:"Should not hold"})]})})]}):null,(0,P.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--text",children:[(0,P.jsx)("label",{className:"spytial-ed-field-label",htmlFor:`${y}-comment`,children:"Comment"}),(0,P.jsx)("div",{className:"spytial-ed-field-control",children:(0,P.jsx)("input",{id:`${y}-comment`,type:"text",className:"spytial-ed-input",value:t.comment??"",placeholder:"Optional note (round-trips as a YAML comment)",disabled:b,onChange:M=>f(t.id,M.target.value)})})]})]}):null]})},q$=({item:t,index:e,count:n,disabled:i,onDuplicate:r,onRemove:s,onMove:o,onAddComment:l})=>{let[a,c]=(0,se.useState)(!1),u=(0,se.useRef)(null),f=(0,se.useRef)(null),h=du(a,f,{align:"end",estimatedHeight:220}),d=Pt(t.type)?.label??t.type;(0,se.useEffect)(()=>{if(!a)return;let b=y=>{u.current&&!u.current.contains(y.target)&&c(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);let p=(0,se.useCallback)(()=>c(!1),[]),m=(0,se.useCallback)(b=>{b(),p()},[p]);return(0,P.jsxs)("div",{className:"spytial-ed-overflow",ref:u,children:[(0,P.jsx)("button",{ref:f,type:"button",className:"spytial-ed-overflow-btn","aria-haspopup":"menu","aria-expanded":a,"aria-label":`Actions for ${d}`,disabled:i,onClick:()=>c(b=>!b),children:(0,P.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})}),a?(0,P.jsxs)("ul",{className:"spytial-ed-overflow-menu",style:h,role:"menu","aria-label":`Actions for ${d}`,onKeyDown:b=>{b.key==="Escape"&&(b.stopPropagation(),p())},children:[(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>m(l),children:"Add comment"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>m(()=>r(t.id)),children:"Duplicate"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e===0,onClick:()=>m(()=>o(t.id,-1)),children:"Move up"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e>=n-1,onClick:()=>m(()=>o(t.id,1)),children:"Move down"})}),(0,P.jsx)("li",{role:"none",children:(0,P.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item spytial-ed-overflow-item--danger","aria-label":`Remove ${d} ${t.kind}`,onClick:()=>m(()=>s(t.id)),children:"Delete"})})]}):null]})},P$=({kind:t,onAdd:e,disabled:n,triggerRef:i})=>{let[r,s]=(0,se.useState)(!1),[o,l]=(0,se.useState)(""),a=(0,se.useRef)(null),c=(0,se.useRef)(null),u=(0,se.useRef)(null),f=(0,se.useCallback)(g=>{u.current=g,typeof i=="function"?i(g):i&&typeof i=="object"&&(i.current=g)},[i]),h=du(r,u,{align:"end",estimatedHeight:320}),d=(0,se.useMemo)(()=>q0(t),[t]),p=(0,se.useMemo)(()=>{let g=o.trim().toLowerCase();return g?d.filter(v=>v.label.toLowerCase().includes(g)||v.type.toLowerCase().includes(g)||(v.description??"").toLowerCase().includes(g)):d},[d,o]);(0,se.useEffect)(()=>{if(!r)return;requestAnimationFrame(()=>c.current?.focus());let g=v=>{a.current&&!a.current.contains(v.target)&&s(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[r]);let m=(0,se.useCallback)(()=>{s(!1),l("")},[]),b=(0,se.useCallback)(g=>{e(t,g),m()},[e,t,m]),y=t==="constraint"?"Add constraint":"Add directive";return(0,P.jsxs)("div",{className:"spytial-ed-add",ref:a,children:[(0,P.jsxs)("button",{ref:f,type:"button",className:"spytial-ed-add-btn","aria-haspopup":"menu","aria-expanded":r,disabled:n,onClick:()=>s(g=>!g),children:["+ ",y]}),r?(0,P.jsxs)("div",{className:"spytial-ed-add-menu",style:h,role:"menu","aria-label":y,onKeyDown:g=>{g.key==="Escape"&&(g.preventDefault(),m())},children:[(0,P.jsx)("input",{ref:c,type:"text",className:"spytial-ed-add-search",value:o,placeholder:"Search types\u2026","aria-label":`Search ${t} types`,onChange:g=>l(g.target.value)}),(0,P.jsx)("ul",{className:"spytial-ed-add-list",children:p.length===0?(0,P.jsx)("li",{className:"spytial-ed-add-empty",children:"No matching types."}):p.map(g=>(0,P.jsx)("li",{role:"none",children:(0,P.jsxs)("button",{type:"button",role:"menuitem",className:"spytial-ed-add-item",onClick:()=>b(g.type),children:[(0,P.jsx)("span",{className:"spytial-ed-add-item-label",children:g.label}),g.description?(0,P.jsx)("span",{className:"spytial-ed-add-item-desc",children:g.description}):null]})},g.type))})]}):null]})};function z$(t){return t.filter(e=>e.key!=="hold")}function H$(t){if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}var Y=Ae(On());var _t=Ae(vt()),U$=300,F$=400,kS=({value:t,onChange:e,instance:n,domain:i,theme:r,selectorAssistant:s,density:o="compact",syntaxHighlighting:l=!0,defaultView:a="builder",view:c,onViewChange:u,className:f,disabled:h=!1,"aria-label":d="Layout specification editor",onDiagnostics:p})=>{let m=(0,Y.useRef)(null);m.current===null&&(m.current=j$(t));let b=m.current.doc,[,y]=(0,Y.useReducer)(B=>B+1,0),g=(0,Y.useRef)(t),v=(0,Y.useRef)(0),[S,w]=(0,Y.useState)(a),O=c??S,k=(0,Y.useRef)(null),A=(0,Y.useRef)(null),R=(0,Y.useRef)(()=>{}),T=(0,Y.useCallback)(B=>{R.current(),c===void 0&&w(B),u?.(B)},[c,u]),[M,C]=(0,Y.useState)(()=>m.current?.error??null),H=(0,Y.useMemo)(()=>{if(i)return i;if(n)return qb(n)},[i,n]),le=(0,Y.useMemo)(()=>zb(H),[H]),Re=(0,Y.useMemo)(()=>H?.relations.map(B=>B.name)??[],[H]),Kt=(0,Y.useMemo)(()=>H?.types.map(B=>B.name)??[],[H]),ke=(0,Y.useCallback)(()=>{let B=b.toYaml();g.current=B,v.current+=1,C(null),e(B)},[b,e]),[An,et]=(0,Y.useState)([]),Kn=(0,Y.useRef)(0),ct=(0,Y.useRef)(null),tt=(0,Y.useMemo)(()=>b.validate(H),[b,H,t]),nt=(0,Y.useMemo)(()=>[...tt,...An],[tt,An]),Lt=(0,Y.useRef)("");(0,Y.useEffect)(()=>{if(!p)return;let B=V$(nt);B!==Lt.current&&(Lt.current=B,p(nt))},[nt,p]),(0,Y.useEffect)(()=>{if(t===g.current)return;let B;try{B=b.toYaml()}catch{B=""}if(t===B){g.current=t;return}try{b.replaceFromYaml(t),g.current=t,v.current+=1,C(null),y()}catch(ye){C(wS(ye))}},[t,b]),(0,Y.useEffect)(()=>b.subscribe(()=>y()),[b]);let Gt=(0,Y.useCallback)(()=>{k.current&&(clearTimeout(k.current),k.current=null);let B=A.current;if(A.current=null,!!B&&v.current===B.seq)try{b.replaceFromYaml(B.text),C(null),y()}catch(ye){C(wS(ye))}},[b]);R.current=Gt;let Gn=(0,Y.useCallback)(B=>{h||(g.current=B,e(B),k.current&&clearTimeout(k.current),A.current={text:B,seq:v.current},k.current=setTimeout(Gt,U$))},[h,e,Gt]);(0,Y.useEffect)(()=>()=>{k.current&&clearTimeout(k.current),ct.current&&clearTimeout(ct.current)},[]);let Qn=(0,Y.useCallback)((B,ye)=>{if(h)return;let Fe=b.addItem(B,ye);return ke(),Fe},[h,b,ke]),Ea=(0,Y.useCallback)((B,ye,Fe)=>{if(h)return;let Ma=Fe===""?void 0:Fe;b.updateItem(B,{params:{[ye]:Ma}}),ke()},[h,b,ke]),Vm=(0,Y.useCallback)((B,ye)=>{h||(b.updateItem(B,{comment:ye}),ke())},[h,b,ke]),$m=(0,Y.useCallback)((B,ye)=>{h||(b.updateItem(B,{params:{hold:ye?"never":void 0}}),ke())},[h,b,ke]),Ym=(0,Y.useCallback)(B=>{h||!b.duplicateItem(B)||ke()},[h,b,ke]),Km=(0,Y.useCallback)(B=>{h||(b.removeItem(B),ke())},[h,b,ke]),Mo=(0,Y.useCallback)((B,ye)=>{if(h)return;let Fe=b.getState(),Or=(Fe.constraints.some(wt=>wt.id===B)?Fe.constraints:Fe.directives).findIndex(wt=>wt.id===B);Or!==-1&&(b.moveItem(B,Or+ye),ke())},[h,b,ke]),Ro=(0,Y.useCallback)(()=>{h||!b.canUndo()||(b.undo(),ke())},[h,b,ke]),Da=(0,Y.useCallback)(()=>{h||!b.canRedo()||(b.redo(),ke())},[h,b,ke]),Gm=(0,Y.useCallback)(B=>{!(B.metaKey||B.ctrlKey)||B.key.toLowerCase()!=="z"||(B.preventDefault(),B.shiftKey?Da():Ro())},[Ro,Da]),Qm=(0,Y.useCallback)((B,ye)=>{if(ye.kind!=="selector")return;let Fe={itemKind:B.kind,itemType:B.type,fieldKey:ye.key,domain:H,specYaml:g.current},Or={complete:wt=>{let $i=le(wt),Yi=s?.complete;if(!Yi)return $i;let Ra={...Fe,currentValue:String(B.params[ye.key]??"")},Of;try{Of=Yi(Ra,wt)??[]}catch{return $i}return Promise.resolve(Of).then(Xm=>Hb(Xm??[],$i)).catch(()=>$i)},highlight:l};if(s?.synthesize){let wt=s.synthesize;Or.synthesize=$i=>{let Yi={...Fe,currentValue:String(B.params[ye.key]??"")};return wt(Yi,$i)}}return Or},[H,le,s,l]);(0,Y.useEffect)(()=>{let B=s?.review;if(!B){et([]);return}ct.current&&clearTimeout(ct.current);let ye=++Kn.current;ct.current=setTimeout(()=>{let Fe=b.getState(),Ma=[...Fe.constraints,...Fe.directives],Or=[];for(let wt of Ma){let $i=Pt(wt.type);if($i)for(let Yi of $i.fields){if(Yi.kind!=="selector")continue;let Ra=String(wt.params[Yi.key]??"");if(Ra.trim()==="")continue;let Of={itemKind:wt.kind,itemType:wt.type,fieldKey:Yi.key,currentValue:Ra,domain:H,specYaml:g.current};Or.push(Promise.resolve().then(()=>B(Of,Ra)).then(Xm=>(Xm??[]).map(N4=>({...N4,itemId:wt.id,fieldKey:Yi.key,source:"assistant"}))).catch(()=>[]))}}Promise.all(Or).then(wt=>{ye===Kn.current&&et(wt.flat())}).catch(()=>{ye===Kn.current&&et([])})},F$)},[s,H,t,b]);let Af=b.getState(),F=M!==null,te=["spytial-ed",o==="compact"?"spytial-ed--compact":"",f??""].filter(Boolean).join(" "),Es=(0,Y.useMemo)(()=>Bb(t,H),[t,H]),Ds=Fb(r);return(0,_t.jsxs)("section",{className:te,style:Ds?Ub(Ds):void 0,"aria-label":d,onKeyDown:Gm,children:[(0,_t.jsxs)("div",{className:"spytial-ed-toolbar",children:[(0,_t.jsxs)("div",{className:"spytial-ed-viewtoggle",role:"tablist","aria-label":"Editor view",children:[(0,_t.jsxs)("button",{type:"button",role:"tab","aria-selected":O==="builder",className:`spytial-ed-viewtoggle-btn${O==="builder"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>T("builder"),children:["Builder",F?(0,_t.jsx)("span",{className:"spytial-ed-diagnostic-badge spytial-ed-diagnostic-badge--warning",title:"Text has unapplied edits","aria-label":"Text has unapplied edits",children:"!"}):null]}),(0,_t.jsx)("button",{type:"button",role:"tab","aria-selected":O==="code",className:`spytial-ed-viewtoggle-btn${O==="code"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:h,onClick:()=>T("code"),children:"Code"})]}),(0,_t.jsxs)("div",{className:"spytial-ed-history",children:[(0,_t.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Undo",title:"Undo (Cmd/Ctrl+Z)",disabled:h||!b.canUndo(),onClick:Ro,children:(0,_t.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,_t.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Redo",title:"Redo (Shift+Cmd/Ctrl+Z)",disabled:h||!b.canRedo(),onClick:Da,children:(0,_t.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})})]})]}),(0,_t.jsx)("div",{className:"spytial-ed-body",children:O==="builder"?(0,_t.jsx)(xS,{constraints:Af.constraints,directives:Af.directives,diagnostics:nt,options:{relationNames:Re,typeNames:Kt},selectorProps:Qm,onAddItem:Qn,onUpdateParam:Ea,onUpdateComment:Vm,onToggleNegate:$m,onDuplicate:Ym,onRemove:Km,onMove:Mo,disabled:h}):(0,_t.jsx)(SS,{value:t,onChange:Gn,diagnostics:Es,hasUnappliedEdits:F,syntaxHighlighting:l,disabled:h})})]})};function j$(t){try{return{doc:Ml.fromYaml(t),error:null}}catch(e){return{doc:new Ml,error:wS(e)}}}function wS(t){return t instanceof ns?{severity:"error",message:t.message,source:"yaml",...t.line!==void 0?{line:t.line}:{},...t.column!==void 0?{column:t.column}:{}}:{severity:"error",message:t instanceof Error?t.message:String(t),source:"yaml"}}function V$(t){return t.map(e=>`${e.severity}|${e.source}|${e.itemId??""}|${e.fieldKey??""}|${e.line??""}|${e.column??""}|${e.message}`).join(`
|
|
198
|
-
`)}function
|
|
199
|
-
`)}for(let
|
|
200
|
-
`:e+=`no ${
|
|
187
|
+
`;)t[i]==="\\"&&i+1<n?i+=2:i++;i<n&&t[i]===l&&i++,r("string",a,i);continue}if(Zd.test(s)){let l=i;for(;i<n&&Zd.test(t[i]);)i++;if(i<n&&t[i]==="."&&i+1<n&&Zd.test(t[i+1]))for(i++;i<n&&Zd.test(t[i]);)i++;r("number",l,i);continue}if(QH.test(s)){let l=i;for(i++;i<n&&XH.test(t[i]);)i++;let a=t.slice(l,i);r(YH.has(a)?"keyword":"identifier",l,i);continue}let o=t.slice(i,i+2);if(KH.includes(o)){r("operator",i,i+2),i+=2;continue}if(GH.has(s)){r("operator",i,i+1),i++;continue}r("punctuation",i,i+1),i++}return e}function Gb(t){switch(t){case"keyword":return"spytial-ed-syn-keyword";case"operator":return"spytial-ed-syn-operator";case"string":return"spytial-ed-syn-string";case"number":return"spytial-ed-syn-number";case"identifier":return"spytial-ed-syn-identifier";case"comment":return"spytial-ed-syn-comment";default:return}}var J=be(Cn());var Jd=be(Cn());function bu(t,e,n){let{align:i="start",gap:r=2,estimatedHeight:s=280}=n??{},[o,l]=(0,Jd.useState)({});return(0,Jd.useLayoutEffect)(()=>{if(!t){l({});return}let a=()=>{let c=e.current;if(!c)return;let u=c.getBoundingClientRect(),f=window.innerWidth||document.documentElement.clientWidth,h=window.innerHeight||document.documentElement.clientHeight,d=h-u.bottom-r,m=u.top-r,g=d<s&&m>d,b={maxHeight:Math.max(120,(g?m:d)-8)};g?b.bottom=h-u.top+r:b.top=u.bottom+r,i==="end"?b.right=Math.max(8,f-u.right):i==="stretch"?(b.left=u.left,b.width=u.width):b.left=u.left,l(b)};return a(),window.addEventListener("resize",a),document.addEventListener("scroll",a,!0),()=>{window.removeEventListener("resize",a),document.removeEventListener("scroll",a,!0)}},[t,e,i,r,s]),o}var ce=be(rt()),WH=150,ZH=/[A-Za-z0-9_$]/;function JH(t){if(!(!t||t.length===0))return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}function eU(t,e){let n=e;for(;n>0&&ZH.test(t[n-1]);)n--;return{prefix:t.slice(n,e),start:n}}var z2=({value:t})=>{let e=(0,J.useMemo)(()=>Kb(t),[t]);return(0,ce.jsxs)(ce.Fragment,{children:[e.map((n,i)=>{let r=Gb(n.kind);return r?(0,ce.jsx)("span",{className:r,children:n.text},i):(0,ce.jsx)(J.default.Fragment,{children:n.text},i)}),t.endsWith(`
|
|
188
|
+
`)?"\u200B":null]})},Qb=({value:t,onChange:e,placeholder:n,disabled:i=!1,selectorArity:r,complete:s,synthesize:o,diagnostics:l,highlight:a=!0,className:c,"aria-label":u,"aria-labelledby":f})=>{let h=(0,J.useRef)(null),d=(0,J.useRef)(null),m=(0,J.useId)(),g=`${m}-listbox`,b=F=>`${m}-opt-${F}`,p=`${m}-diag`,[y,v]=(0,J.useState)(!1),[S,w]=(0,J.useState)([]),[O,k]=(0,J.useState)(0),A=(0,J.useRef)(0),M=(0,J.useRef)(null),T=(0,J.useRef)(0),[R,C]=(0,J.useState)(!1),[V,$]=(0,J.useState)(""),[Te,Gt]=(0,J.useState)(!1),[vi,ye]=(0,J.useState)(null),[at,Qn]=(0,J.useState)(null),kt=(0,J.useRef)(null),Fe=JH(l),mt=(0,J.useCallback)(()=>{let F=h.current,ne=d.current;!F||!ne||(ne.scrollTop=F.scrollTop,ne.scrollLeft=F.scrollLeft)},[]),gt=(0,J.useRef)(0),on=(0,J.useCallback)(()=>{let F=h.current;if(F){if(F.value===""){F.style.height="",gt.current=0;return}if(F.clientWidth<60){gt.current<10&&(gt.current+=1,requestAnimationFrame(on));return}gt.current=0,F.style.height="auto",F.style.height=`${F.scrollHeight}px`}},[]);(0,J.useEffect)(()=>{on(),mt()},[t,on,mt]);let ln=(0,J.useCallback)((F,ne)=>{if(!s)return;let{prefix:Qi,start:Mr}=eU(F,ne);T.current=Mr,M.current&&clearTimeout(M.current);let Po=++A.current;M.current=setTimeout(()=>{let Ls;try{Ls=s(Qi)}catch{return}Promise.resolve(Ls).then(Si=>{if(Po===A.current){if(!Si||Si.length===0){w([]),v(!1);return}w(Si),k(0),v(!0)}}).catch(()=>{Po===A.current&&(w([]),v(!1))})},WH)},[s]),Xn=(0,J.useCallback)(()=>{A.current++,M.current&&clearTimeout(M.current),v(!1),w([])},[]),Wn=(0,J.useCallback)(F=>{let ne=h.current,Qi=ne?ne.selectionStart:t.length,Mr=F.insertText??F.label,Po=t.slice(0,T.current)+Mr+t.slice(Qi);e(Po),Xn();let Ls=T.current+Mr.length;requestAnimationFrame(()=>{let Si=h.current;Si&&(Si.focus(),Si.setSelectionRange(Ls,Ls))})},[t,e,Xn]),Io=(0,J.useCallback)(F=>{let ne=F.target.value;e(ne),ln(ne,F.target.selectionStart)},[e,ln]),Bo=(0,J.useCallback)(F=>{if(F.code==="Space"&&(F.ctrlKey||F.metaKey)){F.preventDefault();let ne=h.current;ne&&ln(ne.value,ne.selectionStart);return}if(!(!y||S.length===0))switch(F.key){case"ArrowDown":F.preventDefault(),k(ne=>(ne+1)%S.length);break;case"ArrowUp":F.preventDefault(),k(ne=>(ne-1+S.length)%S.length);break;case"Enter":case"Tab":F.preventDefault(),Wn(S[O]);break;case"Escape":F.preventDefault(),Xn();break;default:break}},[y,S,O,Wn,Xn,ln]),Ia=(0,J.useCallback)(F=>{let ne=F.relatedTarget;ne&&d.current?.parentElement?.contains(ne)||Xn()},[Xn]),Qm=(0,J.useCallback)(()=>{C(!0),ye(null),Qn(null),requestAnimationFrame(()=>kt.current?.focus())},[]),qo=(0,J.useCallback)(()=>{C(!1),Gt(!1),ye(null),Qn(null),$("")},[]),Df=(0,J.useCallback)(async()=>{if(!o||Te)return;let F=V.trim();if(F){Gt(!0),ye(null),Qn(null);try{let ne=await o(F);Qn(ne)}catch(ne){ye(ne instanceof Error?ne.message:"Synthesis failed. Try again.")}finally{Gt(!1)}}},[o,Te,V]),Xm=(0,J.useCallback)(()=>{at&&(e(at.value),qo(),requestAnimationFrame(()=>h.current?.focus()))},[at,e,qo]);(0,J.useEffect)(()=>()=>{M.current&&clearTimeout(M.current)},[]);let Wm=n??(r==="binary"?"binary selector, e.g. parent":r==="unary"?"unary selector, e.g. Node":"selector expression"),Zm=l&&l.length>0?p:void 0,Jm=bu(y&&S.length>0,h,{align:"stretch",estimatedHeight:224});return(0,ce.jsxs)("div",{className:`spytial-ed-selector${Fe?` spytial-ed-selector--${Fe}`:""}${c?` ${c}`:""}`,children:[(0,ce.jsxs)("div",{className:`spytial-ed-selector-input-wrap${o?" spytial-ed-selector-input-wrap--with-synth":""}`,children:[a?(0,ce.jsx)("pre",{ref:d,className:"spytial-ed-selector-mirror","aria-hidden":"true",children:(0,ce.jsx)(z2,{value:t})}):null,(0,ce.jsx)("textarea",{ref:h,className:`spytial-ed-selector-textarea${a?"":" spytial-ed-selector-textarea--plain"}`,value:t,onChange:Io,onScroll:mt,onKeyDown:Bo,onBlur:Ia,placeholder:Wm,disabled:i,rows:1,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off",wrap:"soft",role:"combobox","aria-expanded":y,"aria-controls":g,"aria-autocomplete":"list","aria-activedescendant":y&&S.length>0?b(O):void 0,"aria-label":u,"aria-labelledby":f,"aria-describedby":Zm,"aria-invalid":Fe==="error"||void 0}),o?(0,ce.jsx)("button",{type:"button",className:"spytial-ed-selector-synth-btn",onClick:Qm,disabled:i,"aria-label":"Generate selector from a description","aria-haspopup":"dialog","aria-expanded":R,title:"Generate selector from a description",children:(0,ce.jsx)("span",{"aria-hidden":"true",children:"\u2728"})}):null,y&&S.length>0?(0,ce.jsx)("ul",{className:"spytial-ed-autocomplete",style:Jm,id:g,role:"listbox","aria-label":"Selector completions",children:S.map((F,ne)=>(0,ce.jsxs)("li",{id:b(ne),role:"option","aria-selected":ne===O,className:`spytial-ed-autocomplete-item${ne===O?" spytial-ed-autocomplete-item--active":""}`,onMouseDown:Qi=>{Qi.preventDefault(),Wn(F)},onMouseEnter:()=>k(ne),children:[(0,ce.jsx)("span",{className:`spytial-ed-autocomplete-kind spytial-ed-kind-${F.kind}`,"aria-hidden":"true"}),(0,ce.jsx)("span",{className:"spytial-ed-autocomplete-label",children:F.label}),F.detail?(0,ce.jsx)("span",{className:"spytial-ed-autocomplete-detail",children:F.detail}):null]},`${F.label}-${ne}`))}):null]}),R?(0,ce.jsxs)("div",{className:"spytial-ed-synth-popover",role:"dialog","aria-label":"Generate selector",children:[(0,ce.jsxs)("div",{className:"spytial-ed-synth-row",children:[(0,ce.jsx)("input",{ref:kt,type:"text",className:"spytial-ed-synth-input",value:V,placeholder:"Describe the selector you want\u2026",disabled:Te,"aria-label":"Selector description",onChange:F=>$(F.target.value),onKeyDown:F=>{F.key==="Enter"?(F.preventDefault(),Df()):F.key==="Escape"&&(F.preventDefault(),qo())}}),(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-generate",onClick:()=>{Df()},disabled:Te||V.trim().length===0,children:Te?"Generating\u2026":"Generate"})]}),vi?(0,ce.jsx)("div",{className:"spytial-ed-synth-error",role:"alert",children:vi}):null,at?(0,ce.jsxs)("div",{className:"spytial-ed-synth-result",children:[(0,ce.jsx)("pre",{className:"spytial-ed-synth-preview","aria-label":"Proposed selector",children:(0,ce.jsx)(z2,{value:at.value})}),at.explanation?(0,ce.jsx)("p",{className:"spytial-ed-synth-explanation",children:at.explanation}):null,(0,ce.jsxs)("div",{className:"spytial-ed-synth-actions",children:[(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-accept",onClick:Xm,children:"Accept"}),(0,ce.jsx)("button",{type:"button",className:"spytial-ed-synth-dismiss",onClick:qo,children:"Dismiss"})]})]}):null]}):null,l&&l.length>0?(0,ce.jsx)("ul",{className:"spytial-ed-diagnostics",id:p,children:l.map((F,ne)=>(0,ce.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${F.severity}`,children:[(0,ce.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,ce.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:F.message})]},ne))}):null]})};var H2=be(Cn());var se=be(rt());function Ql(t){return t==null?"":String(t)}function tU(t){return Array.isArray(t)?t.map(e=>String(e)):t==null||t===""?[]:[String(t)]}function nU(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var iU=(t,e)=>(t??[]).filter(n=>n.fieldKey===e),rU=t=>{if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"},sU=({diagnostics:t,id:e})=>t.length>0?(0,se.jsx)("ul",{className:"spytial-ed-diagnostics",id:e,children:t.map((n,i)=>(0,se.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${n.severity}`,children:[(0,se.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),(0,se.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:n.message})]},i))}):null,ep=({fields:t,values:e,onChange:n,diagnostics:i,options:r,selectorProps:s,disabled:o=!1,className:l})=>{let a=(0,H2.useId)();return(0,se.jsx)("div",{className:`spytial-ed-fields${l?` ${l}`:""}`,children:t.map(c=>{if(c.kind==="group")return(0,se.jsx)(oU,{field:c,value:e[c.key],onChange:n,options:r,selectorProps:s,diagnostics:i,disabled:o},c.key);let u=`${a}-${c.key}`,f=`${u}-label`,h=`${u}-diag`,d=iU(i,c.key),m=rU(d),g=e[c.key];return(0,se.jsxs)("div",{className:`spytial-ed-field spytial-ed-field--${c.kind}${m?` spytial-ed-field--${m}`:""}`,children:[(0,se.jsxs)("label",{id:f,htmlFor:c.kind==="selector"?void 0:u,className:"spytial-ed-field-label",title:c.help,children:[c.label,c.required?(0,se.jsxs)("span",{className:"spytial-ed-field-required","aria-hidden":"true",title:"required",children:[" ","*"]}):null]}),(0,se.jsxs)("div",{className:"spytial-ed-field-control",children:[lU(c,g,{fieldId:u,labelId:f,diagId:h,hasDiagnostics:d.length>0,disabled:o,onChange:n,options:r,selectorProps:s,diagnostics:d}),c.kind==="selector"?null:(0,se.jsx)(sU,{diagnostics:d,id:h})]})]},c.key)})})};function oU({field:t,value:e,onChange:n,options:i,selectorProps:r,diagnostics:s,disabled:o}){let l=nU(e)?e:void 0,a=!t.required;if(l===void 0)return(0,se.jsxs)("button",{type:"button",className:"spytial-ed-group-add",onClick:()=>n(t.key,{}),disabled:o,title:t.help,children:["+ ",t.label]});let c=(u,f)=>{let h={...l};f===void 0||f===""||Array.isArray(f)&&f.length===0?delete h[u]:h[u]=f,n(t.key,h)};return(0,se.jsxs)("fieldset",{className:"spytial-ed-group",children:[(0,se.jsxs)("legend",{className:"spytial-ed-group-legend",children:[(0,se.jsx)("span",{children:t.label}),a?(0,se.jsx)("button",{type:"button",className:"spytial-ed-group-remove",onClick:()=>n(t.key,void 0),disabled:o,"aria-label":`Remove ${t.label}`,title:`Remove ${t.label}`,children:"\xD7"}):null]}),(0,se.jsx)(ep,{fields:t.children??[],values:l,onChange:c,options:i,selectorProps:r,diagnostics:s,disabled:o})]})}function lU(t,e,n){let{fieldId:i,labelId:r,diagId:s,hasDiagnostics:o,disabled:l,onChange:a,options:c,selectorProps:u,diagnostics:f}=n,h=o?s:void 0;switch(t.kind){case"selector":{let d=u?.(t)??{};return(0,se.jsx)(Qb,{value:Ql(e),onChange:m=>a(t.key,m),placeholder:t.placeholder,disabled:l,selectorArity:t.selectorArity,"aria-labelledby":r,diagnostics:f,complete:d.complete,synthesize:d.synthesize,highlight:d.highlight})}case"relationName":case"typeName":{let d=t.kind==="relationName"?c?.relationNames:c?.typeNames,m=`${i}-list`,g=!!d&&d.length>0;return(0,se.jsxs)(se.Fragment,{children:[(0,se.jsx)("input",{id:i,type:"text",className:"spytial-ed-input spytial-ed-combo",value:Ql(e),placeholder:t.placeholder,disabled:l,list:g?m:void 0,spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","aria-describedby":h,"aria-invalid":f.some(b=>b.severity==="error")||void 0,onChange:b=>a(t.key,b.target.value)}),g?(0,se.jsx)("datalist",{id:m,children:d.map(b=>(0,se.jsx)("option",{value:b},b))}):null]})}case"enum":{let d=t.options??[];if(t.multiple){let g=tU(e);return(0,se.jsx)("div",{className:"spytial-ed-pills",role:"group","aria-labelledby":r,"aria-describedby":h,children:d.map(b=>{let p=g.includes(b);return(0,se.jsx)("button",{type:"button",className:`spytial-ed-pill${p?" spytial-ed-pill--active":""}`,"aria-pressed":p,disabled:l,onClick:()=>{let y=p?g.filter(v=>v!==b):[...g,b];a(t.key,y)},children:b},b)})})}let m=Ql(e);return(0,se.jsx)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":r,"aria-describedby":h,children:d.map(g=>{let b=m===g;return(0,se.jsx)("button",{type:"button",className:`spytial-ed-pill${b?" spytial-ed-pill--active":""}`,role:"radio","aria-checked":b,disabled:l,onClick:()=>a(t.key,g),children:g},g)})})}case"number":{let d=e,m=d==null||d===""?"":String(d);return(0,se.jsx)("input",{id:i,type:"number",className:"spytial-ed-input spytial-ed-input--number",value:m,placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(g=>g.severity==="error")||void 0,onChange:g=>{let b=g.target.value;a(t.key,b===""?"":Number(b))}})}case"color":{let d=Ql(e)||"#000000";return(0,se.jsxs)("div",{className:"spytial-ed-color",children:[(0,se.jsx)("input",{id:i,type:"color",className:"spytial-ed-color-swatch",value:aU(d),disabled:l,"aria-describedby":h,"aria-label":`${t.label} color`,onChange:m=>a(t.key,m.target.value)}),(0,se.jsx)("input",{type:"text",className:"spytial-ed-input spytial-ed-color-text",value:Ql(e),placeholder:t.placeholder??"#rrggbb",disabled:l,spellCheck:!1,"aria-label":`${t.label} hex value`,onChange:m=>a(t.key,m.target.value)})]})}case"boolean":{let d=e===!0||e==="true";return(0,se.jsx)("button",{id:i,type:"button",role:"switch","aria-checked":d,"aria-describedby":h,className:`spytial-ed-switch${d?" spytial-ed-switch--on":""}`,disabled:l,onClick:()=>a(t.key,!d),children:(0,se.jsx)("span",{className:"spytial-ed-switch-thumb","aria-hidden":"true"})})}default:return(0,se.jsx)("input",{id:i,type:"text",className:"spytial-ed-input",value:Ql(e),placeholder:t.placeholder,disabled:l,"aria-describedby":h,"aria-invalid":f.some(d=>d.severity==="error")||void 0,onChange:d=>a(t.key,d.target.value)})}}function aU(t){let e=t.trim();return/^#[0-9a-fA-F]{6}$/.test(e)?e:/^#[0-9a-fA-F]{3}$/.test(e)?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:"#000000"}var sn=be(Cn());var Wb=[],V2=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?V2:Wb).push(n=n+t[e])})();function cU(t){if(t<768)return!1;for(let e=0,n=Wb.length;;){let i=e+n>>1;if(t<Wb[i])n=i;else if(t>=V2[i])e=i+1;else return!0;if(e==n)return!1}}function U2(t){return t>=127462&&t<=127487}var F2=8205;function $2(t,e,n=!0,i=!0){return(n?Y2:uU)(t,e,i)}function Y2(t,e,n){if(e==t.length)return e;e&&K2(t.charCodeAt(e))&&G2(t.charCodeAt(e-1))&&e--;let i=Xb(t,e);for(e+=j2(i);e<t.length;){let r=Xb(t,e);if(i==F2||r==F2||n&&cU(r))e+=j2(r),i=r;else if(U2(r)){let s=0,o=e-2;for(;o>=0&&U2(Xb(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function uU(t,e,n){for(;e>1;){let i=Y2(t,e-2,n);if(i<e)return i;e--}return 0}function Xb(t,e){let n=t.charCodeAt(e);if(!G2(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return K2(i)?(n-55296<<10)+(i-56320)+65536:n}function K2(t){return t>=56320&&t<57344}function G2(t){return t>=55296&&t<56320}function j2(t){return t<65536?1:2}var ue=class t{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,i){[e,n]=Jl(this,e,n);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(n,this.length,r,1),Xl.from(r,this.length-(n-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Jl(this,e,n);let i=[];return this.decompose(e,n,i,0),Xl.from(i,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),i=this.length-this.scanIdentical(e,-1),r=new co(this),s=new co(e);for(let o=n,l=n;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=i)return!0}}iter(e=1){return new co(this,e)}iterRange(e,n=this.length){return new sp(this,e,n)}iterLines(e,n){let i;if(e==null)i=this.iter();else{n==null&&(n=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new op(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?t.empty:e.length<=32?new bn(e):Xl.from(bn.split(e,[]))}},bn=class t extends ue{constructor(e,n=fU(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((n?i:l)>=e)return new Jb(r,l,i,o);r=l+1,i++}}decompose(e,n,i,r){let s=e<=0&&n>=this.length?this:new t(Q2(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),l=rp(s.text,o.text.slice(),0,s.length);if(l.length<=32)i.push(new t(l,o.length+s.length));else{let a=l.length>>1;i.push(new t(l.slice(0,a)),new t(l.slice(a)))}}else i.push(s)}replace(e,n,i){if(!(i instanceof t))return super.replace(e,n,i);[e,n]=Jl(this,e,n);let r=rp(this.text,rp(i.text,Q2(this.text,0,e)),n),s=this.length+i.length-(n-e);return r.length<=32?new t(r,s):Xl.from(t.split(r,[]),s)}sliceString(e,n=this.length,i=`
|
|
189
|
+
`){[e,n]=Jl(this,e,n);let r="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(r+=i),e<a&&n>s&&(r+=l.slice(Math.max(0,e-s),n-s)),s=a+1}return r}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(n.push(new t(i,r)),i=[],r=-1);return r>-1&&n.push(new t(i,r)),n}},Xl=class t extends ue{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,n,i,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=i+o.lines-1;if((n?a:l)>=e)return o.lineInner(e,n,i,r);r=l+1,i=a+1}}decompose(e,n,i,r){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&n>=o){let c=r&((o<=e?1:0)|(a>=n?2:0));o>=e&&a<=n&&!c?i.push(l):l.decompose(e-o,n-o,i,c)}o=a+1}}replace(e,n,i){if([e,n]=Jl(this,e,n),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.length;if(e>=s&&n<=l){let a=o.replace(e-s,n-s,i),c=this.lines-o.lines+a.lines;if(a.lines<c>>4&&a.lines>c>>6){let u=this.children.slice();return u[r]=a,new t(u,this.length-(n-e)+i.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,n,i)}sliceString(e,n=this.length,i=`
|
|
190
|
+
`){[e,n]=Jl(this,e,n);let r="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(r+=i),e<a&&n>o&&(r+=l.sliceString(e-o,n-o,i)),o=a+1}return r}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof t))return 0;let i=0,[r,s,o,l]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=n,s+=n){if(r==o||s==l)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,n);i+=a.length+1}}static from(e,n=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let m of e)m.flatten(d);return new bn(d,n)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,l=[],a=0,c=-1,u=[];function f(d){let m;if(d.lines>s&&d instanceof t)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(h(),l.push(d)):d instanceof bn&&a&&(m=u[u.length-1])instanceof bn&&d.lines+m.lines<=32?(a+=d.lines,c+=d.length+1,u[u.length-1]=new bn(m.text.concat(d.text),m.length+1+d.length)):(a+d.lines>r&&h(),a+=d.lines,c+=d.length+1,u.push(d))}function h(){a!=0&&(l.push(u.length==1?u[0]:t.from(u,c)),c=-1,a=u.length=0)}for(let d of e)f(d);return h(),l.length==1?l[0]:new t(l,n)}};ue.empty=new bn([""],0);function fU(t){let e=-1;for(let n of t)e+=n.length+1;return e}function rp(t,e,n=0,i=1e9){for(let r=0,s=0,o=!0;s<t.length&&r<=i;s++){let l=t[s],a=r+l.length;a>=n&&(a>i&&(l=l.slice(0,i-r)),r<n&&(l=l.slice(n-r)),o?(e[e.length-1]+=l,o=!1):e.push(l)),r=a+1}return e}function Q2(t,e,n){return rp(t,[""],e,n)}var co=class{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 bn?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,l=r instanceof bn?r.text.length:r.children.length;if(o==(n>0?l:0)){if(i==0)return this.done=!0,this.value="",this;n>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[i]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
191
|
+
`,this;e--}else if(r instanceof bn){let a=r.text[o+(n<0?-1:0)];if(this.offsets[i]+=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=r.children[o+(n<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=n):(n<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(n>0?1:(a instanceof bn?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)}},sp=class{constructor(e,n,i){this.value="",this.done=!1,this.cursor=new co(e,n>i?-1:1),this.pos=n>i?e.length:0,this.from=Math.min(n,i),this.to=Math.max(n,i)}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 i=n<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*n,this.value=r.length<=i?r:n<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},op=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:i,value:r}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(ue.prototype[Symbol.iterator]=function(){return this.iter()},co.prototype[Symbol.iterator]=sp.prototype[Symbol.iterator]=op.prototype[Symbol.iterator]=function(){return this});var Jb=class{constructor(e,n,i,r){this.from=e,this.to=n,this.number=i,this.text=r}get length(){return this.to-this.from}};function Jl(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function pt(t,e,n=!0,i=!0){return $2(t,e,n,i)}function hU(t){return t>=56320&&t<57344}function dU(t){return t>=55296&&t<56320}function eE(t,e){let n=t.charCodeAt(e);if(!dU(n)||e+1==t.length)return n;let i=t.charCodeAt(e+1);return hU(i)?(n-55296<<10)+(i-56320)+65536:n}function tE(t){return t<65536?1:2}var ev=/\r\n?|\n/,Vt=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Vt||(Vt={})),Sr=class t{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 i=this.sections[n+1];e+=i<0?this.sections[n]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,i=0,r=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,n=!1){tv(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];r<0?e.push(i,r):e.push(r,i)}return new t(e)}composeDesc(e){return this.empty?e:e.empty?this:nE(this,e)}mapDesc(e,n=!1){return e.empty?this:nv(this,e,n)}mapPos(e,n=-1,i=Vt.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],c=r+l;if(a<0){if(c>e)return s+(e-r);s+=l}else{if(i!=Vt.Simple&&c>=e&&(i==Vt.TrackDel&&r<e&&c>e||i==Vt.TrackBefore&&r<e||i==Vt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!l)return e==r||n<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,n=e){for(let i=0,r=0;i<this.sections.length&&r<=n;){let s=this.sections[i++],o=this.sections[i++],l=r+s;if(o>=0&&r<=n&&l>=e)return r<e&&l>n?"cover":!0;r=l}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let i=this.sections[n++],r=this.sections[n++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}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 t(e)}static create(e){return new t(e)}},$t=class t extends Sr{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 tv(this,(n,i,r,s,o)=>e=e.replace(r,r+(i-n),o),!1),e}mapDesc(e,n=!1){return nv(this,e,n,!0)}invert(e){let n=this.sections.slice(),i=[];for(let r=0,s=0;r<n.length;r+=2){let o=n[r],l=n[r+1];if(l>=0){n[r]=l,n[r+1]=o;let a=r>>1;for(;i.length<a;)i.push(ue.empty);i.push(o?e.slice(s,s+o):ue.empty)}s+=o}return new t(n,i)}compose(e){return this.empty?e:e.empty?this:nE(this,e,!0)}map(e,n=!1){return e.empty?this:nv(this,e,n,!0)}iterChanges(e,n=!1){tv(this,e,n)}get desc(){return Sr.create(this.sections)}filter(e){let n=[],i=[],r=[],s=new uo(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,a-l);Nt(r,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;Nt(n,u,f),f>0&&ys(i,n,s.text),s.forward(u),l+=u}let c=e[o++];for(;l<c;){if(s.done)break e;let u=Math.min(s.len,c-l);Nt(n,u,-1),Nt(r,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),l+=u}}return{changes:new t(n,i),filtered:Sr.create(r)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let i=this.sections[n],r=this.sections[n+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,i){let r=[],s=[],o=0,l=null;function a(u=!1){if(!u&&!r.length)return;o<n&&Nt(r,n-o,-1);let f=new t(r,s);l=l?l.compose(f.map(l)):f,r=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof t){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);a(),l=l?l.compose(u.map(l)):u}else{let{from:f,to:h=f,insert:d}=u;if(f>h||f<0||h>n)throw new RangeError(`Invalid change range ${f} to ${h} (in doc of length ${n})`);let m=d?typeof d=="string"?ue.of(d.split(i||ev)):d:ue.empty,g=m.length;if(f==h&&g==0)return;f<o&&a(),f>o&&Nt(r,f-o,-1),Nt(r,h-f,g),ys(s,r,m),o=h}}return c(e),a(!l),l}static empty(e){return new t(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;i.length<r;)i.push(ue.empty);i[r]=ue.of(s.slice(1)),n.push(s[0],i[r].length)}}}return new t(n,i)}static createSet(e,n){return new t(e,n)}};function Nt(t,e,n,i=!1){if(e==0&&n<=0)return;let r=t.length-2;r>=0&&n<=0&&n==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=n:i?(t[r]+=e,t[r+1]+=n):t.push(e,n)}function ys(t,e,n){if(n.length==0)return;let i=e.length-2>>1;if(i<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<i;)t.push(ue.empty);t.push(n)}}function tv(t,e,n){let i=t.inserted;for(let r=0,s=0,o=0;o<t.sections.length;){let l=t.sections[o++],a=t.sections[o++];if(a<0)r+=l,s+=l;else{let c=r,u=s,f=ue.empty;for(;c+=l,u+=a,a&&i&&(f=f.append(i[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,c,s,u,f),r=c,s=u}}}function nv(t,e,n,i=!1){let r=[],s=i?[]:null,o=new uo(t),l=new uo(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let c=Math.min(o.len,l.len);Nt(r,c,-1),o.forward(c),l.forward(c)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!n))){let c=l.len;for(Nt(r,l.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&a<o.i&&o.len<=u&&(Nt(r,0,o.ins),s&&ys(s,r,o.text),a=o.i),o.forward(u),c-=u}l.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(l.ins==-1){let f=Math.min(u,l.len);c+=f,u-=f,l.forward(f)}else if(l.ins==0&&l.len<u)u-=l.len,l.next();else break;Nt(r,c,a<o.i?o.ins:0),s&&a<o.i&&ys(s,r,o.text),a=o.i,o.forward(o.len-u)}else{if(o.done&&l.done)return s?$t.createSet(r,s):Sr.create(r);throw new Error("Mismatched change set lengths")}}}function nE(t,e,n=!1){let i=[],r=n?[]:null,s=new uo(t),o=new uo(e);for(let l=!1;;){if(s.done&&o.done)return r?$t.createSet(i,r):Sr.create(i);if(s.ins==0)Nt(i,s.len,0,l),s.next();else if(o.len==0&&!o.done)Nt(i,0,o.ins,l),r&&ys(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),c=i.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Nt(i,a,u,l),r&&u&&ys(r,i,o.text)}else o.ins==-1?(Nt(i,s.off?0:s.len,a,l),r&&ys(r,i,s.textBit(a))):(Nt(i,s.off?0:s.len,o.off?0:o.ins,l),r&&!o.off&&ys(r,i,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>c),s.forward2(a),o.forward(a)}}}}var uo=class{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?ue.empty:e[n]}textBit(e){let{inserted:n}=this.set,i=this.i-2>>1;return i>=n.length&&!e?ue.empty:n[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},oo=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.flags=i,this.goalColumn=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 undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,n):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new t(i,r,this.flags,this.goalColumn)}extend(e,n=e,i=0){if(e<=this.anchor&&n>=this.anchor)return N.range(e,n,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return N.range(this.anchor,r,void 0,void 0,i)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!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 N.range(e.anchor,e.head)}static create(e,n,i,r){return new t(e,n,i,r)}},N=class t{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:t.create(this.ranges.map(i=>i.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new t([this.main],0)}addRange(e,n=!0){return t.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let i=this.ranges.slice();return i[n]=e,t.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new t(e.ranges.map(n=>oo.fromJSON(n)),e.main)}static single(e,n=e){return new t([t.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 i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return t.normalized(e.slice(),n);i=s.to}return new t(e,n)}static cursor(e,n=0,i,r){return oo.create(e,e,(n==0?0:n<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,n,i,r,s){let o=r==null?7:Math.min(6,r);return!s&&e!=n&&(s=n<e?1:-1),s&&(o|=s<0?8:16),n<e?oo.create(n,e,o|32,i):oo.create(e,n,o,i)}static undirectionalRange(e,n){return oo.create(e,n,64,void 0)}static normalized(e,n=0){let i=e[n];e.sort((r,s)=>r.from-s.from),n=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);r<=n&&n--,e.splice(--r,2,s.anchor>s.head?t.range(a,l):t.range(l,a))}}return new t(e,n)}};function iE(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}var hv=0,I=class t{constructor(e,n,i,r,s){this.combine=e,this.compareInput=n,this.compare=i,this.isStatic=r,this.id=hv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new t(e.combine||(n=>n),e.compareInput||((n,i)=>n===i),e.compare||(e.combine?(n,i)=>n===i:dv),!!e.static,e.enables)}of(e){return new Wl([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Wl(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new Wl(e,this,2,n)}from(e,n){return n||(n=i=>i),this.compute([e],i=>n(i.field(e)))}};function dv(t,e){return t==e||t.length==e.length&&t.every((n,i)=>n===e[i])}var Wl=class{constructor(e,n,i,r){this.dependencies=e,this.facet=n,this.type=i,this.value=r,this.id=hv++}dynamicSlot(e){var n;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?c=!0:(((n=e[f.id])!==null&&n!==void 0?n:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,h){if(a&&h.docChanged||c&&(h.docChanged||h.selection)||iv(f,u)){let d=i(f);if(l?!X2(d,f.values[o],r):!r(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,h)=>{let d,m=h.config.address[s];if(m!=null){let g=cp(h,m);if(this.dependencies.every(b=>b instanceof I?h.facet(b)===f.facet(b):b instanceof _t?h.field(b,!1)==f.field(b,!1):!0)||(l?X2(d=i(f),g,r):r(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}};function X2(t,e,n){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!n(t[i],e[i]))return!1;return!0}function iv(t,e){let n=!1;for(let i of e)Su(t,i)&1&&(n=!0);return n}function pU(t,e,n){let i=n.map(a=>t[a.id]),r=n.map(a=>a.type),s=i.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let c=[];for(let u=0;u<i.length;u++){let f=cp(a,i[u]);if(r[u]==2)for(let h of f)c.push(h);else c.push(f)}return e.combine(c)}return{create(a){for(let c of i)Su(a,c);return a.values[o]=l(a),1},update(a,c){if(!iv(a,s))return 0;let u=l(a);return e.compare(u,a.values[o])?0:(a.values[o]=u,1)},reconfigure(a,c){let u=iv(a,i),f=c.config.facets[e.id],h=c.facet(e);if(f&&!u&&dv(n,f))return a.values[o]=h,0;let d=l(a);return e.compare(d,h)?(a.values[o]=h,0):(a.values[o]=d,1)}}}var tp=I.define({static:!0}),_t=class t{constructor(e,n,i,r,s){this.id=e,this.createF=n,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let n=new t(hv++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(tp).find(i=>i.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:i=>(i.values[n]=this.create(i),1),update:(i,r)=>{let s=i.values[n],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[n]=o,1)},reconfigure:(i,r)=>{let s=i.facet(tp),o=r.facet(tp),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[n]=l.create(i),1):r.config.address[this.id]!=null?(i.values[n]=r.field(this),0):(i.values[n]=this.create(i),1)}}}init(e){return[this,tp.of({field:this,create:e})]}get extension(){return this}},lo={lowest:4,low:3,default:2,high:1,highest:0};function vu(t){return e=>new lp(e,t)}var Au={highest:vu(lo.highest),high:vu(lo.high),default:vu(lo.default),low:vu(lo.low),lowest:vu(lo.lowest)},lp=class{constructor(e,n){this.inner=e,this.prec=n}get extension(){return this}},ea=class t{of(e){return new xu(this,e)}reconfigure(e){return t.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},xu=class{constructor(e,n){this.compartment=e,this.inner=n}get extension(){return this}},ap=class t{constructor(e,n,i,r,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.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,i){let r=[],s=Object.create(null),o=new Map;for(let h of mU(e,n,o))h instanceof _t?r.push(h):(s[h.facet.id]||(s[h.facet.id]=[])).push(h);let l=Object.create(null),a=[],c=[];for(let h of r)l[h.id]=c.length<<1,c.push(d=>h.slot(d));let u=i?.config.facets;for(let h in s){let d=s[h],m=d[0].facet,g=u&&u[h]||[];if(d.every(b=>b.type==0))if(l[m.id]=a.length<<1|1,dv(g,d))a.push(i.facet(m));else{let b=m.combine(d.map(p=>p.value));a.push(i&&m.compare(b,i.facet(m))?i.facet(m):b)}else{for(let b of d)b.type==0?(l[b.id]=a.length<<1|1,a.push(b.value)):(l[b.id]=c.length<<1,c.push(p=>b.dynamicSlot(p)));l[m.id]=c.length<<1,c.push(b=>pU(b,m,d))}}let f=c.map(h=>h(l));return new t(e,o,f,l,a,s)}};function mU(t,e,n){let i=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let c=i[a].indexOf(o);c>-1&&i[a].splice(c,1),o instanceof xu&&n.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let c of o)s(c,l);else if(o instanceof xu){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;n.set(o.compartment,c),s(c,l)}else if(o instanceof lp)s(o.inner,o.prec);else if(o instanceof _t)i[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof Wl)i[l].push(o),o.facet.extensions&&s(o.facet.extensions,lo.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(c==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,l)}}return s(t,lo.default),i.reduce((o,l)=>o.concat(l))}function Su(t,e){if(e&1)return 2;let n=e>>1,i=t.status[n];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;t.status[n]=4;let r=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|r}function cp(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}var rE=I.define(),rv=I.define({combine:t=>t.some(e=>e),static:!0}),sE=I.define({combine:t=>t.length?t[0]:void 0,static:!0}),oE=I.define(),lE=I.define(),aE=I.define(),cE=I.define({combine:t=>t.length?t[0]:!1}),zn=class{constructor(e,n){this.type=e,this.value=n}static define(){return new sv}},sv=class{of(e){return new zn(this,e)}},ov=class{constructor(e){this.map=e}of(e){return new he(this,e)}},he=class t{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 t(this.type,n)}is(e){return this.type==e}static define(e={}){return new ov(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(n);s&&i.push(s)}return i}};he.reconfigure=he.define();he.appendConfig=he.define();var dt=class t{constructor(e,n,i,r,s,o){this.startState=e,this.changes=n,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&iE(i,n.newLength),s.some(l=>l.type==t.time)||(this.annotations=s.concat(t.time.of(Date.now())))}static create(e,n,i,r,s,o){return new t(e,n,i,r,s,o)}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(t.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}};dt.time=zn.define();dt.userEvent=zn.define();dt.addToHistory=zn.define();dt.remote=zn.define();function gU(t,e){let n=[];for(let i=0,r=0;;){let s,o;if(i<t.length&&(r==e.length||e[r]>=t[i]))s=t[i++],o=t[i++];else if(r<e.length)s=e[r++],o=e[r++];else return n;!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function uE(t,e,n){var i;let r,s,o;return n?(r=e.changes,s=$t.empty(e.changes.length),o=t.changes.compose(e.changes)):(r=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=t.selection)===null||i===void 0?void 0:i.map(r),effects:he.mapEffects(t.effects,r).concat(he.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function lv(t,e,n){let i=e.selection,r=Zl(e.annotations);return e.userEvent&&(r=r.concat(dt.userEvent.of(e.userEvent))),{changes:e.changes instanceof $t?e.changes:$t.of(e.changes||[],n,t.facet(sE)),selection:i&&(i instanceof N?i:N.single(i.anchor,i.head)),effects:Zl(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function fE(t,e,n){let i=lv(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(n=!1);let o=!!e[s].sequential;i=uE(i,lv(t,e[s],o?i.changes.newLength:t.doc.length),o)}let r=dt.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return bU(n?yU(r):r)}function yU(t){let e=t.startState,n=!0;for(let r of e.facet(oE)){let s=r(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:gU(n,s))}if(n!==!0){let r,s;if(n===!1)s=t.changes.invertedDesc,r=$t.empty(e.doc.length);else{let o=t.changes.filter(n);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=dt.create(e,r,t.selection&&t.selection.map(s),he.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let i=e.facet(lE);for(let r=i.length-1;r>=0;r--){let s=i[r](t);s instanceof dt?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof dt?t=s[0]:t=fE(e,Zl(s),!1)}return t}function bU(t){let e=t.startState,n=e.facet(aE),i=t;for(let r=n.length-1;r>=0;r--){let s=n[r](t);s&&Object.keys(s).length&&(i=uE(i,lv(e,s,t.changes.newLength),!0))}return i==t?t:dt.create(e,t.changes,t.selection,i.effects,i.annotations,i.scrollIntoView)}var vU=[];function Zl(t){return t==null?vU:Array.isArray(t)?t:[t]}var ai=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(ai||(ai={})),SU=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,av;try{av=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function xU(t){if(av)return av.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||SU.test(n)))return!0}return!1}function wU(t){return e=>{if(!/\S/.test(e))return ai.Space;if(xU(e))return ai.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return ai.Word;return ai.Other}}var De=class t{constructor(e,n,i,r,s,o){this.config=e,this.doc=n,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Su(this,l<<1);this.computeSlot=null}field(e,n=!0){let i=this.config.address[e.id];if(i==null){if(n)throw new RangeError("Field is not present in this state");return}return Su(this,i),cp(this,i)}update(...e){return fE(this,e,!0)}applyTransaction(e){let n=this.config,{base:i,compartments:r}=n;for(let l of e.effects)l.is(ea.reconfigure)?(n&&(r=new Map,n.compartments.forEach((a,c)=>r.set(c,a)),n=null),r.set(l.value.compartment,l.value.extension)):l.is(he.reconfigure)?(n=null,i=l.value):l.is(he.appendConfig)&&(n=null,i=Zl(i).concat(l.value));let s;n?s=e.startState.values.slice():(n=ap.resolve(i,r,this),s=new t(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values);let o=e.startState.facet(rv)?e.newSelection:e.newSelection.asSingle();new t(n,e.newDoc,o,s,(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:N.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,i=e(n.ranges[0]),r=this.changes(i.changes),s=[i.range],o=Zl(i.effects);for(let l=1;l<n.ranges.length;l++){let a=e(n.ranges[l]),c=this.changes(a.changes),u=c.map(r);for(let h=0;h<l;h++)s[h]=s[h].map(u);let f=r.mapDesc(c,!0);s.push(a.range.map(f)),r=r.compose(u),o=he.mapEffects(o,u).concat(he.mapEffects(Zl(a.effects),f))}return{changes:r,selection:N.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof $t?e:$t.of(e,this.doc.length,this.facet(t.lineSeparator))}toText(e){return ue.of(e.split(this.facet(t.lineSeparator)||ev))}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:(Su(this,n),cp(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof _t&&this.config.address[r.id]!=null&&(n[i]=r.spec.toJSON(this.field(e[i]),this))}return n}static fromJSON(e,n={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],l=e[s];r.push(o.init(a=>o.spec.fromJSON(l,a)))}}return t.create({doc:e.doc,selection:N.fromJSON(e.selection),extensions:n.extensions?r.concat([n.extensions]):r})}static create(e={}){let n=ap.resolve(e.extensions||[],new Map),i=e.doc instanceof ue?e.doc:ue.of((e.doc||"").split(n.staticFacet(t.lineSeparator)||ev)),r=e.selection?e.selection instanceof N?e.selection:N.single(e.selection.anchor,e.selection.head):N.single(0);return iE(r,i.length),n.staticFacet(rv)||(r=r.asSingle()),new t(n,i,r,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(t.tabSize)}get lineBreak(){return this.facet(t.lineSeparator)||`
|
|
192
|
+
`}get readOnly(){return this.facet(cE)}phrase(e,...n){for(let i of this.facet(t.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>n.length?i:n[s-1]})),e}languageDataAt(e,n,i=-1){let r=[];for(let s of this.facet(rE))for(let o of s(this,n,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return wU(n.length?n[0]:"")}wordAt(e){let{text:n,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=pt(n,o,!1);if(s(n.slice(a,o))!=ai.Word)break;o=a}for(;l<r;){let a=pt(n,l);if(s(n.slice(l,a))!=ai.Word)break;l=a}return o==l?null:N.range(o+i,l+i)}};De.allowMultipleSelections=rv;De.tabSize=I.define({combine:t=>t.length?t[0]:4});De.lineSeparator=sE;De.readOnly=cE;De.phrases=I.define({compare(t,e){let n=Object.keys(t),i=Object.keys(e);return n.length==i.length&&n.every(r=>t[r]==e[r])}});De.languageData=rE;De.changeFilter=oE;De.transactionFilter=lE;De.transactionExtender=aE;ea.reconfigure=he.define();function bs(t,e,n={}){let i={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=i[s];if(l===void 0)i[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(n,s))i[s]=n[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var zi=class{eq(e){return this==e}range(e,n=e){return wu.create(e,n,this)}};zi.prototype.startSide=zi.prototype.endSide=0;zi.prototype.point=!1;zi.prototype.mapMode=Vt.TrackDel;function pv(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}var wu=class t{constructor(e,n,i){this.from=e,this.to=n,this.value=i}static create(e,n,i){return new t(e,n,i)}};function cv(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}var uv=class t{constructor(e,n,i,r){this.from=e,this.to=n,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,n,i,r=0){let s=i?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-n;if(a==o)return c>=0?o:l;c>=0?l=a:o=a+1}}between(e,n,i,r){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let i=[],r=[],s=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let c=this.value[a],u=this.from[a]+e,f=this.to[a]+e,h,d;if(u==f){let m=n.mapPos(u,c.startSide,c.mapMode);if(m==null||(h=d=m,c.startSide!=c.endSide&&(d=n.mapPos(u,c.endSide),d<h)))continue}else if(h=n.mapPos(u,c.startSide),d=n.mapPos(f,c.endSide),h>d||h==d&&c.startSide>0&&c.endSide<=0)continue;(d-h||c.endSide-c.startSide)<0||(o<0&&(o=h),c.point&&(l=Math.max(l,d-h)),i.push(c),r.push(h-o),s.push(d-o))}return{mapped:i.length?new t(r,s,i,l):null,pos:o}}},de=class t{constructor(e,n,i,r){this.chunkPos=e,this.chunk=n,this.nextLayer=i,this.maxPoint=r}static create(e,n,i,r){return new t(e,n,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let 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:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(i&&(n=n.slice().sort(cv)),this.isEmpty)return n.length?t.of(n):this;let l=new up(this,null,-1).goto(0),a=0,c=[],u=new xr;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++];u.addInner(f.from,f.to,f.value)||c.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==n.length||this.chunkEnd(l.chunkIndex)<n[a].from)&&(!o||r>this.chunkEnd(l.chunkIndex)||s<this.chunkPos[l.chunkIndex])&&u.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||r>l.to||s<l.from||o(l.from,l.to,l.value))&&(u.addInner(l.from,l.to,l.value)||c.push(wu.create(l.from,l.to,l.value))),l.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?t.empty:this.nextLayer.update({add:c,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],c=e.touchesRange(l,l+a.length);if(c===!1)r=Math.max(r,a.maxPoint),n.push(a),i.push(e.mapPos(l));else if(c===!0){let{mapped:u,pos:f}=a.map(l,e);u&&(r=Math.max(r,u.maxPoint),n.push(u),i.push(f))}}let s=this.nextLayer.map(e);return n.length==0?s:new t(i,n,s||t.empty,r)}between(e,n,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,i)===!1)return}this.nextLayer.between(e,n,i)}}iter(e=0){return ku.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return ku.from(e).goto(n)}static compare(e,n,i,r,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=W2(o,l,i),c=new ao(o,a,s),u=new ao(l,a,s);i.iterGaps((f,h,d)=>Z2(c,f,u,h,d,r)),i.empty&&i.length==0&&Z2(c,0,u,0,0,r)}static eq(e,n,i=0,r){r==null&&(r=999999999);let s=e.filter(u=>!u.isEmpty&&n.indexOf(u)<0),o=n.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=W2(s,o),a=new ao(s,l,0).goto(i),c=new ao(o,l,0).goto(i);for(;;){if(a.to!=c.to||!fv(a.active,c.active)||a.point&&(!c.point||!pv(a.point,c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,n,i,r,s=-1){let o=new ao(e,null,s).goto(n),l=n,a=o.openStart;for(;;){let c=Math.min(o.to,i);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFrom<n?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,a);r.point(l,c,o.point,u,f,o.pointRank),a=Math.min(o.openEnd(c),u.length)}else c>l&&(r.span(l,c,o.active,a),a=o.openEnd(c));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,n=!1){let i=new xr;for(let r of e instanceof wu?[e]:n?kU(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return t.empty;let n=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=t.empty;r=r.nextLayer)n=new t(r.chunkPos,r.chunk,n,Math.max(r.maxPoint,n.maxPoint));return n}};de.empty=new de([],[],null,-1);function kU(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let i=t[n];if(cv(e,i)>0)return t.slice().sort(cv);e=i}return t}de.empty.nextLayer=de.empty;var xr=class t{finishChunk(e){this.chunks.push(new uv(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,i){this.addInner(e,n,i)||(this.nextLayer||(this.nextLayer=new t)).add(e,n,i)}addInner(e,n,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=n,this.value.push(i),i.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 i=n.value.length-1;return this.last=n.value[i],this.lastFrom=n.from[i]+e,this.lastTo=n.to[i]+e,!0}finish(){return this.finishInner(de.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=de.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}};function W2(t,e,n){let i=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let l=i.get(s.chunk[o]);l!=null&&(n?n.mapPos(l):l)==s.chunkPos[o]&&!n?.touchesRange(l,l+s.chunk[o].length)&&r.add(s.chunk[o])}return r}var up=class{constructor(e,n,i,r=0){this.layer=e,this.skip=n,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}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],i=e+n.from[this.rangeIndex];if(this.from=i,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}},ku=class t{constructor(e){this.heap=e}static from(e,n=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new up(o,n,i,s));return r.length==1?r[0]:new t(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let i of this.heap)i.goto(e,n);for(let i=this.heap.length>>1;i>=0;i--)Zb(this.heap,i);return this.next(),this}forward(e,n){for(let i of this.heap)i.forward(e,n);for(let i=this.heap.length>>1;i>=0;i--)Zb(this.heap,i);(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(),Zb(this.heap,0)}}};function Zb(t,e){for(let n=t[e];;){let i=(e<<1)+1;if(i>=t.length)break;let r=t[i];if(i+1<t.length&&r.compare(t[i+1])>=0&&(r=t[i+1],i++),n.compare(r)<0)break;t[i]=n,t[e]=r,e=i}}var ao=class{constructor(e,n,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=ku.from(e,n,i)}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){np(this.active,e),np(this.activeTo,e),np(this.activeRank,e),this.minActive=J2(this.active,this.activeTo)}addActive(e){let n=0,{value:i,to:r,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||r-this.activeTo[n])>0;)n++;ip(this.active,n,i),ip(this.activeTo,n,r),ip(this.activeRank,n,s),e&&ip(e,n,this.cursor.from),this.minActive=J2(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&np(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&n.push(this.active[i]);return n.reverse()}openEnd(e){let n=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)n++;return n}};function Z2(t,e,n,i,r,s){t.goto(e),n.goto(i);let o=i+r,l=i,a=i-e,c=!!s.boundChange;for(let u=!1;;){let f=t.to+a-n.to,h=f||t.endSide-n.endSide,d=h<0?t.to+a:n.to,m=Math.min(d,o);if(t.point||n.point?(t.point&&n.point&&pv(t.point,n.point)&&fv(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(l,m,t.point,n.point),u=!1):(u&&s.boundChange(l),m>l&&!fv(t.active,n.active)&&s.compareRange(l,m,t.active,n.active),c&&m<o&&(f||t.openEnd(d)!=n.openEnd(d))&&(u=!0)),d>o)break;l=d,h<=0&&t.next(),h>=0&&n.next()}}function fv(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!pv(t[n],e[n]))return!1;return!0}function np(t,e){for(let n=e,i=t.length-1;n<i;n++)t[n]=t[n+1];t.pop()}function ip(t,e,n){for(let i=t.length-1;i>=e;i--)t[i+1]=t[i];t[e]=n}function J2(t,e){let n=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||t[r].endSide-t[n].endSide)<0&&(n=r,i=e[r]);return n}function fo(t,e,n=t.length){let i=0;for(let r=0;r<n&&r<t.length;)t.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=pt(t,r));return i}function hE(t,e,n,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?n-s%n:1,r=pt(t,r)}return i===!0?-1:t.length}var dE=typeof Symbol>"u"?"__\u037C":Symbol.for("\u037C"),mv=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),pE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},Hn=class{constructor(e,n){this.rules=[];let{finish:i}=n||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),h=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let m=l[d];if(/&/.test(d))s(d.split(/,\s*/).map(g=>o.map(b=>g.replace(/&/,b))).reduce((g,b)=>g.concat(b)),m,a);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),m,u,h)}else m!=null&&u.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+m+";")}(u.length||h)&&a.push((i&&!f&&!c?o.map(i):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
193
|
+
`)}static newName(){let e=pE[dE]||1;return pE[dE]=e+1,"\u037C"+e.toString(36)}static mount(e,n,i){let r=e[mv],s=i&&i.nonce;r?s&&r.setNonce(s):r=new gv(e,s),r.mount(Array.isArray(n)?n:[n],e)}},mE=new Map,gv=class{constructor(e,n){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=mE.get(i);if(s)return e[mv]=s;this.sheet=new r.CSSStyleSheet,mE.set(i,this)}else this.styleTag=i.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[mv]=this}mount(e,n){let i=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<s&&a>-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),i)for(let c=0;c<l.rules.length;c++)i.insertRule(l.rules[c],r++)}else{for(;s<a;)r+=this.modules[s++].rules.length;r+=l.rules.length,s++}}if(i)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|
194
|
+
`;this.styleTag.textContent=o;let l=n.head||n;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var wr={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:"'"},ta={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},AU=typeof navigator<"u"&&/Mac/.test(navigator.platform),OU=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(et=0;et<10;et++)wr[48+et]=wr[96+et]=String(et);var et;for(et=1;et<=24;et++)wr[et+111]="F"+et;var et;for(et=65;et<=90;et++)wr[et]=String.fromCharCode(et+32),ta[et]=String.fromCharCode(et);var et;for(fp in wr)ta.hasOwnProperty(fp)||(ta[fp]=wr[fp]);var fp;function gE(t){var e=AU&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||OU&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ta:wr)[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 vn(){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 i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];typeof r=="string"?t.setAttribute(i,r):r!=null&&(t[i]=r)}e++}for(;e<arguments.length;e++)yE(t,arguments[e]);return t}function yE(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++)yE(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}var Yt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Ov=typeof document<"u"?document:{documentElement:{style:{}}},Tv=/Edge\/(\d+)/.exec(Yt.userAgent),WE=/MSIE \d/.test(Yt.userAgent),Cv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Yt.userAgent),Fp=!!(WE||Cv||Tv),bE=!Fp&&/gecko\/(\d+)/i.test(Yt.userAgent),yv=!Fp&&/Chrome\/(\d+)/.exec(Yt.userAgent),vE="webkitFontSmoothing"in Ov.documentElement.style,Ev=!Fp&&/Apple Computer/.test(Yt.vendor),SE=Ev&&(/Mobile\/\w+/.test(Yt.userAgent)||Yt.maxTouchPoints>2),L={mac:SE||/Mac/.test(Yt.platform),windows:/Win/.test(Yt.platform),linux:/Linux|X11/.test(Yt.platform),ie:Fp,ie_version:WE?Ov.documentMode||6:Cv?+Cv[1]:Tv?+Tv[1]:0,gecko:bE,gecko_version:bE?+(/Firefox\/(\d+)/.exec(Yt.userAgent)||[0,0])[1]:0,chrome:!!yv,chrome_version:yv?+yv[1]:0,ios:SE,android:/Android\b/.test(Yt.userAgent),webkit:vE,webkit_version:vE?+(/\bAppleWebKit\/(\d+)/.exec(Yt.userAgent)||[0,0])[1]:0,safari:Ev,safari_version:Ev?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Yt.userAgent)||[0,0])[1]:0,tabSize:Ov.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function d1(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}var kp=Object.create(null);function p1(t,e,n){if(t==e)return!0;t||(t=kp),e||(e=kp);let i=Object.keys(t),r=Object.keys(e);if(i.length-(n&&i.indexOf(n)>-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let s of i)if(s!=n&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function TU(t,e){for(let n=t.attributes.length-1;n>=0;n--){let i=t.attributes[n].name;e[i]==null&&t.removeAttribute(i)}for(let n in e){let i=e[n];n=="style"?t.style.cssText=i:t.getAttribute(n)!=i&&t.setAttribute(n,i)}}function xE(t,e,n){let i=!1;if(e)for(let r in e)n&&r in n||(i=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(n)for(let r in n)e&&e[r]==n[r]||(i=!0,r=="style"?t.style.cssText=n[r]:t.setAttribute(r,n[r]));return i}function CU(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let i=t.attributes[n];e[i.name]=i.value}return e}var Or=class{eq(e){return!1}updateDOM(e,n,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},rn=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(rn||(rn={})),xe=class extends zi{constructor(e,n,i,r){super(),this.startSide=e,this.endSide=n,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Bu(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return n+=i&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new mo(e,n,n,i,e.widget||null,!1)}static replace(e){let n=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=ZE(e,n);i=(s?n?-3e8:-1:5e8)-1,r=(o?n?2e8:1:-6e8)+1}return new mo(e,i,r,n,e.widget||null,!0)}static line(e){return new qu(e)}static set(e,n=!1){return de.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};xe.none=de.empty;var Bu=class t extends xe{constructor(e){let{start:n,end:i}=ZE(e);super(n?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?d1(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||kp}eq(e){return this==e||e instanceof t&&this.tagName==e.tagName&&p1(this.attrs,e.attrs)}range(e,n=e){if(e>=n)throw new RangeError("Mark decorations may not be empty");return super.range(e,n)}};Bu.prototype.point=!1;var qu=class t extends xe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof t&&this.spec.class==e.spec.class&&p1(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)}};qu.prototype.mapMode=Vt.TrackBefore;qu.prototype.point=!0;var mo=class t extends xe{constructor(e,n,i,r,s,o){super(n,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?n<=0?Vt.TrackBefore:Vt.TrackAfter:Vt.TrackDel}get type(){return this.startSide!=this.endSide?rn.WidgetRange:this.startSide<=0?rn.WidgetBefore:rn.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof t&&EU(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)}};mo.prototype.point=!0;function ZE(t,e=!1){let{inclusiveStart:n,inclusiveEnd:i}=t;return n==null&&(n=t.inclusive),i==null&&(i=t.inclusive),{start:n??e,end:i??e}}function EU(t,e){return t==e||!!(t&&e&&t.compare(e))}function la(t,e,n,i=0){let r=n.length-1;r>=0&&n[r]+i>=t?n[r]=Math.max(n[r],e):n.push(t,e)}var Ap=class t extends zi{constructor(e,n,i){super(),this.tagName=e,this.attributes=n,this.rank=i}eq(e){return e==this||e instanceof t&&this.tagName==e.tagName&&p1(this.attributes,e.attributes)}static create(e){return new t(e.tagName,e.attributes||kp,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return de.of(e,n)}};Ap.prototype.startSide=Ap.prototype.endSide=-1;function Pu(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Dv(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function Cu(t,e){if(!e.anchorNode)return!1;try{return Dv(t,e.anchorNode)}catch{return!1}}function xp(t){return t.nodeType==3?zu(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function Eu(t,e,n,i){return n?wE(t,e,n,i,-1)||wE(t,e,n,i,1):!1}function xs(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Op(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function wE(t,e,n,i,r){for(;;){if(t==n&&e==i)return!0;if(e==(r<0?0:Tr(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=xs(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?Tr(t):0}else return!1}}function Tr(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Tp(t,e){let{left:n,right:i}=t;if(n==i)return t;let r=e?n:i;return{left:r,right:r,top:t.top,bottom:t.bottom}}function DU(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function JE(t,e){let n=e.width/t.offsetWidth,i=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-t.offsetHeight)<1)&&(i=1),{scaleX:n,scaleY:i}}function MU(t,e,n,i,r,s,o,l){let a=t.ownerDocument,c=a.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let h,d=u==a.body,m=1,g=1;if(d)h=DU(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let y=u.getBoundingClientRect();({scaleX:m,scaleY:g}=JE(u,y)),h={left:y.left,right:y.left+u.clientWidth*m,top:y.top,bottom:y.top+u.clientHeight*g}}let b=0,p=0;if(r=="nearest")e.top<h.top+o?(p=e.top-(h.top+o),n>0&&e.bottom>h.bottom+p&&(p=e.bottom-h.bottom+o)):e.bottom>h.bottom-o&&(p=e.bottom-h.bottom+o,n<0&&e.top-p<h.top&&(p=e.top-(h.top+o)));else{let y=e.bottom-e.top,v=h.bottom-h.top;p=(r=="center"&&y<=v?e.top+y/2-v/2:r=="start"||r=="center"&&n<0?e.top-o:e.bottom-v+o)-h.top}if(i=="nearest"?e.left<h.left+s?(b=e.left-(h.left+s),n>0&&e.right>h.right+b&&(b=e.right-h.right+s)):e.right>h.right-s&&(b=e.right-h.right+s,n<0&&e.left<h.left+b&&(b=e.left-(h.left+s))):b=(i=="center"?e.left+(e.right-e.left)/2-(h.right-h.left)/2:i=="start"==l?e.left-s:e.right-(h.right-h.left)+s)-h.left,b||p)if(d)c.scrollBy(b,p);else{let y=0,v=0;if(p){let S=u.scrollTop;u.scrollTop+=p/g,v=(u.scrollTop-S)*g}if(b){let S=u.scrollLeft;u.scrollLeft+=b/m,y=(u.scrollLeft-S)*m}e={left:e.left-y,top:e.top-v,right:e.right-y,bottom:e.bottom-v},y&&Math.abs(y-b)<1&&(i="nearest"),v&&Math.abs(v-p)<1&&(r="nearest")}if(d)break;(e.top<h.top||e.bottom>h.bottom||e.left<h.left||e.right>h.right)&&(e={left:Math.max(e.left,h.left),right:Math.min(e.right,h.right),top:Math.max(e.top,h.top),bottom:Math.min(e.bottom,h.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function eD(t,e=!0){let n=t.ownerDocument,i=null,r=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}var Mv=class{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:i}=e;this.set(n,Math.min(e.anchorOffset,n?Tr(n):0),i,Math.min(e.focusOffset,i?Tr(i):0))}set(e,n,i,r){this.anchorNode=e,this.anchorOffset=n,this.focusNode=i,this.focusOffset=r}},ho=null;L.safari&&L.safari_version>=26&&(ho=!1);function tD(t){if(t.setActive)return t.setActive();if(ho)return t.focus(ho);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(ho==null?{get preventScroll(){return ho={preventScroll:!0},!0}}:void 0),!ho){ho=!1;for(let n=0;n<e.length;){let i=e[n++],r=e[n++],s=e[n++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}var kE;function zu(t,e,n=e){let i=kE||(kE=document.createRange());return i.setEnd(t,n),i.setStart(t,e),i}function aa(t,e,n,i){let r={key:e,code:e,keyCode:n,which:n,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function RU(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function NU(t,e){let n=e.focusNode,i=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=i)return!1;for(i=Math.min(i,Tr(n));;)if(i){if(n.nodeType!=1)return!1;let r=n.childNodes[i-1];r.contentEditable=="false"?i--:(n=r,i=Tr(n))}else{if(n==t)return!0;i=xs(n),n=n.parentNode}}function nD(t){return t instanceof Window?t.pageYOffset>Math.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function iD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i>0)return{node:n,offset:i};if(n.nodeType==1&&i>0){if(n.contentEditable=="false")return null;n=n.childNodes[i-1],i=Tr(n)}else if(n.parentNode&&!Op(n))i=xs(n),n=n.parentNode;else return null}}function rD(t,e){for(let n=t,i=e;;){if(n.nodeType==3&&i<n.nodeValue.length)return{node:n,offset:i};if(n.nodeType==1&&i<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[i],i=0}else if(n.parentNode&&!Op(n))i=xs(n)+1,n=n.parentNode;else return null}}var Ui=class t{constructor(e,n,i=!0){this.node=e,this.offset=n,this.precise=i}static before(e,n){return new t(e.parentNode,xs(e),n)}static after(e,n){return new t(e.parentNode,xs(e)+1,n)}},_e=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(_e||(_e={})),go=_e.LTR,m1=_e.RTL;function sD(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}var _U=sD("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),LU=sD("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Rv=Object.create(null),Hi=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);Rv[e]=n,Rv[n]=-e}function oD(t){return t<=247?_U[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?LU[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}var IU=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,jn=class{get dir(){return this.level%2?m1:go}constructor(e,n,i){this.from=e,this.to=n,this.level=i}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,i,r){let s=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=n&&l.to>=n){if(l.level==i)return o;(s<0||(r!=0?r<0?l.from<n:l.to>n:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}};function lD(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let i=t[n],r=e[n];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!lD(i.inner,r.inner))return!1}return!0}var Oe=[];function BU(t,e,n,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,l=s<i.length?i[s].from:n,a=s?256:r;for(let c=o,u=a,f=a;c<l;c++){let h=oD(t.charCodeAt(c));h==512?h=u:h==8&&f==4&&(h=16),Oe[c]=h==4?2:h,h&7&&(f=h),u=h}for(let c=o,u=a,f=a;c<l;c++){let h=Oe[c];if(h==128)c<l-1&&u==Oe[c+1]&&u&24?h=Oe[c]=u:Oe[c]=256;else if(h==64){let d=c+1;for(;d<l&&Oe[d]==64;)d++;let m=c&&u==8||d<n&&Oe[d]==8?f==1?1:8:256;for(let g=c;g<d;g++)Oe[g]=m;c=d-1}else h==8&&f==1&&(Oe[c]=1);u=h,h&7&&(f=h)}}}function qU(t,e,n,i,r){let s=r==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let c=o?i[o-1].to:e,u=o<i.length?i[o].from:n;for(let f=c,h,d,m;f<u;f++)if(d=Rv[h=t.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(Hi[g+1]==-d){let b=Hi[g+2],p=b&2?r:b&4?b&1?s:r:0;p&&(Oe[f]=Oe[Hi[g]]=p),l=g;break}}else{if(Hi.length==189)break;Hi[l++]=f,Hi[l++]=h,Hi[l++]=a}else if((m=Oe[f])==2||m==1){let g=m==r;a=g?0:1;for(let b=l-3;b>=0;b-=3){let p=Hi[b+2];if(p&2)break;if(g)Hi[b+2]|=2;else{if(p&4)break;Hi[b+2]|=4}}}}}function PU(t,e,n,i){for(let r=0,s=i;r<=n.length;r++){let o=r?n[r-1].to:t,l=r<n.length?n[r].from:e;for(let a=o;a<l;){let c=Oe[a];if(c==256){let u=a+1;for(;;)if(u==l){if(r==n.length)break;u=n[r++].to,l=r<n.length?n[r].from:e}else if(Oe[u]==256)u++;else break;let f=s==1,h=(u<e?Oe[u]:i)==1,d=f==h?f?1:2:i;for(let m=u,g=r,b=g?n[g-1].to:t;m>a;)m==b&&(m=n[--g].from,b=g?n[g-1].to:t),Oe[--m]=d;a=u}else s=c,a++}}}function Nv(t,e,n,i,r,s,o){let l=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;a<n;){let u=!0,f=!1;if(c==s.length||a<s[c].from){let g=Oe[a];g!=l&&(u=!1,f=g==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,m=a;e:for(;;)if(c<s.length&&m==s[c].from){if(f)break e;let g=s[c];if(!u)for(let b=g.to,p=c+1;;){if(b==n)break e;if(p<s.length&&s[p].from==b)b=s[p++].to;else{if(Oe[b]==l)break e;break}}if(c++,h)h.push(g);else{g.from>a&&o.push(new jn(a,g.from,d));let b=g.direction==go!=!(d%2);_v(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.to}m=g.to}else{if(m==n||(u?Oe[m]!=l:Oe[m]==l))break;m++}h?Nv(t,a,m,i+1,r,h,o):a<m&&o.push(new jn(a,m,d)),a=m}else for(let a=n,c=s.length;a>e;){let u=!0,f=!1;if(!c||a>s[c-1].to){let g=Oe[a-1];g!=l&&(u=!1,f=g==16)}let h=!u&&l==1?[]:null,d=u?i:i+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(f)break e;let g=s[--c];if(!u)for(let b=g.from,p=c;;){if(b==e)break e;if(p&&s[p-1].to==b)b=s[--p].from;else{if(Oe[b-1]==l)break e;break}}if(h)h.push(g);else{g.to<a&&o.push(new jn(g.to,a,d));let b=g.direction==go!=!(d%2);_v(t,b?i+1:i,r,g.inner,g.from,g.to,o),a=g.from}m=g.from}else{if(m==e||(u?Oe[m-1]!=l:Oe[m-1]==l))break;m--}h?Nv(t,m,a,i+1,r,h,o):m<a&&o.push(new jn(m,a,d)),a=m}}function _v(t,e,n,i,r,s,o){let l=e%2?2:1;BU(t,r,s,i,l),qU(t,r,s,i,l),PU(r,s,i,l),Nv(t,r,s,e,n,i,o)}function zU(t,e,n){if(!t)return[new jn(0,0,e==m1?1:0)];if(e==go&&!n.length&&!IU.test(t))return aD(t.length);if(n.length)for(;t.length>Oe.length;)Oe[Oe.length]=256;let i=[],r=e==go?0:1;return _v(t,r,r,n,0,t.length,i),i}function aD(t){return[new jn(0,t,0)]}var cD="";function HU(t,e,n,i,r){var s;let o=i.head-t.from,l=jn.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),a=e[l],c=a.side(r,n);if(o==c){let h=l+=r?1:-1;if(h<0||h>=e.length)return null;a=e[l=h],o=a.side(!r,n),c=a.side(r,n)}let u=pt(t.text,o,a.forward(r,n));(u<a.from||u>a.to)&&(u=c),cD=t.text.slice(Math.min(o,u),Math.max(o,u));let f=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return f&&u==c&&f.level+(r?0:1)<a.level?N.cursor(f.side(!r,n)+t.from,f.forward(r,n)?1:-1,f.level):N.cursor(u+t.from,a.forward(r,n)?-1:1,a.level)}function UU(t,e,n){for(let i=e;i<n;i++){let r=oD(t.charCodeAt(i));if(r==1)return go;if(r==2||r==4)return m1}return go}var uD=I.define(),fD=I.define(),hD=I.define(),dD=I.define(),Lv=I.define(),pD=I.define(),mD=I.define(),g1=I.define(),y1=I.define(),gD=I.define({combine:t=>t.some(e=>e)}),FU=I.define({combine:t=>t.some(e=>e)}),yD=I.define(),Du=class t{constructor(e,n,i,r,s,o=!1){this.range=e,this.y=n,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new t(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 t(N.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},hp=he.define({map:(t,e)=>t.map(e)}),bD=he.define();function Sn(t,e,n){let i=t.facet(dD);i.length?i[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}var kr=I.define({combine:t=>t.length?t[0]:!0}),jU=0,ia=I.define({combine(t){return t.filter((e,n)=>{for(let i=0;i<n;i++)if(t[i].plugin==e.plugin)return!1;return!0})}}),Vn=class t{constructor(e,n,i,r,s){this.id=e,this.create=n,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(ia.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(ia.of({plugin:this,arg:e}))}static define(e,n){let{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=n||{};return new t(jU++,e,i,r,l=>{let a=[];return o&&a.push(jp.of(c=>{let u=c.plugin(l);return u?o(u):xe.none})),s&&a.push(s(l)),a})}static fromClass(e,n){return t.define((i,r)=>new e(i,r),n)}},Mu=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(i){if(Sn(n.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Sn(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(i){Sn(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},vD=I.define(),b1=I.define(),jp=I.define(),SD=I.define(),v1=I.define(),Hu=I.define(),xD=I.define();function AE(t,e){let n=t.state.facet(xD);if(!n.length)return n;let i=n.map(s=>s instanceof Function?s(t):s),r=[];return de.spans(i,e.from,e.to,{point(){},span(s,o,l,a){let c=s-e.from,u=o-e.from,f=r;for(let h=l.length-1;h>=0;h--,a--){let d=l[h].spec.bidiIsolate,m;if(d==null&&(d=UU(e.text,c,u)),a>0&&f.length&&(m=f[f.length-1]).to==c&&m.direction==d)m.to=u,f=m.inner;else{let g={from:c,to:u,direction:d,inner:[]};f.push(g),f=g.inner}}}}),r}var wD=I.define();function S1(t){let e=0,n=0,i=0,r=0;for(let s of t.state.facet(wD)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:n,top:i,bottom:r}}var Ou=I.define(),ui=class t{constructor(e,n,i,r){this.fromA=e,this.toA=n,this.fromB=i,this.toB=r}join(e){return new t(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,i=this;for(;n>0;n--){let r=e[n-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(n-1,1)}}return e.splice(n,0,i),e}static extendWithRanges(e,n){if(n.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let l=r<e.length?e[r].fromB:1e9,a=s<n.length?n[s]:1e9,c=Math.min(l,a);if(c==1e9)break;let u=c+o,f=c,h=u;for(;;)if(s<n.length&&n[s]<=f){let d=n[s+1];s+=2,f=Math.max(f,d);for(let m=r;m<e.length&&e[m].fromB<=f;m++)o=e[m].toA-e[m].toB;h=Math.max(h,d+o)}else if(r<e.length&&e[r].fromB<=f){let d=e[r++];f=Math.max(f,d.toB),h=Math.max(h,d.toA),o=d.toA-d.toB}else break;i.push(new t(u,h,c,f))}return i}},Cp=class t{constructor(e,n,i){this.view=e,this.state=n,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=$t.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,l,a)=>r.push(new ui(s,o,l,a))),this.changedRanges=r}static create(e,n,i){return new t(e,n,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},VU=[],ze=class{constructor(e,n,i=0){this.dom=e,this.length=n,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return VU}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let n=this.domAttrs;n&&TU(this.dom,n)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,n=this.posAtStart){let i=n;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n,i){return null}domPosFor(e,n){let i=xs(this.dom),r=this.length?e>0:n>0;return new Ui(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof ua)return e;return null}static get(e){return e.cmTile}},ca=class extends ze{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let n=this.dom,i=null,r,s=e?.node==n?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=i?i.nextSibling:n.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==n)for(;r&&r!=l.dom;)r=OE(r);else n.insertBefore(l.dom,r);i=l.dom}for(r=i?i.nextSibling:n.firstChild,s&&r&&(s.written=!0);r;)r=OE(r);this.length=o}};function OE(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}var ua=class extends ca{constructor(e,n){super(n),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let n=ze.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!n.length)return;i=i.parent,i.breakAfter&&s++,r=n.pop()}else{let o=i.children[r++];if(o instanceof Ar)n.push(r),i=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,n){let i,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let c=a+l.length;if(e>=a&&e<=c){if(l.isWidget()&&n>=-1&&n<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(a<e||e==c&&(n<-1?l.length:l.covers(1)))&&(!i||!l.isWidget()&&i.isWidget())&&(i=l,r=e-a),(c>e||e==a&&(n>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&n<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}},Ar=class t extends ca{constructor(e,n){super(e),this.wrapper=n}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},fa=class t extends ca{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,i){let r=new t(n||document.createElement("div"),e);return(!n||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,n,i){let r=null,s=-1,o=null,l=-1;function a(u,f){for(let h=0,d=0;h<u.children.length&&d<=f;h++){let m=u.children[h],g=d+m.length;g>=f&&(m.isComposite()?a(m,f-d):(!o||o.isHidden&&(n>0&&!(o.flags&32)||i&&YU(o,m)))&&(g>f||m.flags&32)?(o=m,l=f-d):(d<f||m.flags&16&&!m.isHidden)&&(r=m,s=f-d)),d=g}}a(this,e);let c=(n<0?r:o)||r||o;return c?{tile:c,offset:c==r?s:l}:null}coordsIn(e,n,i){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n,i):$U(this)}domIn(e,n){let i=this.resolveInline(e,n);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new Ui(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:n);let o=i.tile.parent,l=!1;for(let a of o.children){if(l)return new Ui(a.dom,0);a==i.tile&&(l=!0)}}return new Ui(this.dom,0)}};function $U(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=xp(e);return n[n.length-1]||null}function YU(t,e){let n=t.coordsIn(0,1),i=e.coordsIn(0,1);return n&&i&&i.top<n.bottom}var nn=class t extends ca{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let i=new t(n||document.createElement(e.tagName),e);return n||(i.flags|=4),i}},po=class t extends ze{constructor(e,n){super(e,n.length),this.text=n}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,n,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let s=e,o=e,l=0;e==0&&n<0||e==r&&n>=0?L.chrome||L.gecko||(e?(s--,l=1):o<r&&(o++,l=-1)):n<0?s--:o<r&&o++;let a=zu(this.dom,s,o).getClientRects();if(!a.length)return null;let c=a[(l?l<0:n>=0)?0:a.length-1];return L.safari&&!l&&c.width==0&&(c=Array.prototype.find.call(a,u=>u.width)||c),i==null?c:Tp(c,(l?l>0:n<0)==i)}static of(e,n){let i=new t(n||document.createTextNode(e),e);return n||(i.flags|=2),i}},yo=class t extends ze{constructor(e,n,i,r){super(e,n,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,n){return this.coordsInWidget(e,n,!1)}coordsInWidget(e,n,i){let r=this.widget.coordsAt(this.dom,e,n);if(r)return r;if(i)return Tp(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top<o.bottom);a+=l?-1:1);return Tp(o,!l)}}get overrideDOMText(){if(!this.length)return ue.empty;let{root:e}=this;if(!e)return ue.empty;let n=this.posAtStart;return e.view.state.doc.slice(n,n+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,n,i,r,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new t(s,i,e,r)}},ha=class extends ze{constructor(e){let n=document.createElement("img");n.className="cm-widgetBuffer",n.setAttribute("aria-hidden","true"),super(n,0,e)}get isHidden(){return!0}get overrideDOMText(){return ue.empty}coordsIn(e,n,i){let r=this.dom.getBoundingClientRect();return i==null?r:Tp(r,n>0==i)}},Iv=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,i){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||n>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],c=a.breakAfter;(n>0?a.length<=e:a.length<e)&&(!i||i.skip(a,0,a.length)!==!1||!a.isComposite)?(o=!!c,s++,e-=a.length):(l.push({tile:r,index:s}),r=a,s=0,i&&a.isComposite()&&i.enter(a))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++;else if(e){let a=Math.min(e,r.length-s);i&&i.skip(r,s,s+a),e-=a,s+=a}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},Bv=class{constructor(e,n,i,r){this.from=e,this.to=n,this.wrapper=i,this.rank=r}},qv=class{constructor(e,n,i){this.cache=e,this.root=n,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,i,r){var s;this.flushBuffer();let o=this.ensureMarks(n,i),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let a=o.children[o.children.length-1]=new po(l.dom,l.text+e);a.parent=o}else o.append(r||po.of(e,(s=this.cache.find(po))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let i=this.curLine;i.dom!=n.line.dom&&(i.setDOM(this.cache.reused.has(n.line)?bv(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let r=i;for(let l=n.marks.length-1;l>=0;l--){let a=n.marks[l],c=r.lastChild;if(c instanceof nn&&c.mark.eq(a.mark))c.dom!=a.dom&&c.setDOM(bv(a.dom)),r=c;else{if(this.cache.reused.get(a)){let f=ze.get(a.dom);f&&f.setDOM(bv(a.dom))}let u=nn.of(a.mark,a.dom);r.append(u),r=u}this.cache.reused.set(a,2)}let s=ze.get(e.text);s&&this.cache.reused.set(s,2);let o=new po(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,n,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(n,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,i){this.flushBuffer(),this.ensureMarks(n,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let n=this.afterWidget||this.lastBlock;n.length+=e,this.pos+=e}addLineStart(e,n){var i;e||(e=kD);let r=fa.start(e,n||((i=this.cache.find(fa))===null||i===void 0?void 0:i.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,n){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(n>0&&(l=r.lastChild)&&l instanceof nn&&l.mark.eq(o))r=l,n--;else{let a=nn.of(o,(i=this.cache.find(nn,c=>c.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(a),r=a,n=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!TE(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(L.ios&&TE(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(vv,0,32)||new yo(vv.toDOM(),0,vv,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let n=e.rank*102+e.value.rank,i=new Bv(e.from,e.to,e.value,n),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let i of this.wrappers){let r=n.lastChild;if(i.from<this.pos&&r instanceof Ar&&r.wrapper.eq(i.wrapper))n=r;else{let s=Ar.of(i.wrapper,(e=this.cache.find(Ar,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);n.append(s),n=s}}return n}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let n=2|(e<0?16:32),i=this.cache.find(ha,void 0,1);return i&&(i.flags=n),i||new ha(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},Pv=class{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let n=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,n);return this.textOff=n,i}},Ep=[yo,fa,po,nn,ha,Ar,ua];for(let t=0;t<Ep.length;t++)Ep[t].bucket=t;var zv=class{constructor(e){this.view=e,this.buckets=Ep.map(()=>[]),this.index=Ep.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,i=this.buckets[n];i.length<6?i.push(e):i[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l<s.length;l++){let a=(l+o)%s.length,c=s[a];if((!n||n(c))&&!this.reused.has(c))return s.splice(a,1),a<o&&this.index[r]--,this.reused.set(c,i),c}return null}findWidget(e,n,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let l=r[s];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view,l.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,l.widget==e&&l.length==n&&(l.flags&497)==i?(this.reused.set(l,1),l):(this.reused.set(l,2),new yo(l.dom,n,e,l.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,n=2){if(!this.reused.has(e))return this.reused.set(e,n),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},Hv=class{constructor(e,n,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new zv(e),this.text=new Pv(e.state.doc),this.builder=new qv(this.cache,new ua(e,e.contentDOM),de.iter(i)),this.cache.reused.set(n,2),this.old=new Iv(n),this.reuseWalker={skip:(o,l,a)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let i=n&&this.getCompositionContext(n.text);for(let r=0,s=0,o=0;;){let l=o<e.length?e[o++]:null,a=l?l.fromA:this.old.root.length;if(a>r){let c=a-r;this.preserve(c,!o,!l),r=a,s+=c}if(!l)break;n&&l.fromA<=n.range.fromA&&l.toA>=n.range.toA?(this.forward(l.fromA,n.range.fromA,n.range.fromA<n.range.toA?1:-1),this.emit(s,n.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(n,i),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,l.toA),this.emit(n.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(s,l.toB)),s=l.toB,r=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,i){let r=QU(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,l,a)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let c=a>0||l<o.length?yo.of(o.widget,this.view,a-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!l&&a==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,a),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof ha)this.cache.add(o);else if(o instanceof nn)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof nn&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof nn&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let i=null,r=this.builder,s=-1,o=de.spans(this.decorations,e,n,{point:(l,a,c,u,f,h)=>{if(c instanceof mo){if(this.disallowBlockEffectsFor[h]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)r.continueWidget(a-l);else{let d=c.widget||(c.block?ws.block:ws.inline),m=KU(c),g=this.cache.findWidget(d,a-l,m)||yo.of(d,this.view,a-l,m);c.block?(c.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(g)):(r.ensureLine(i),r.addInlineWidget(g,u,f))}i=null}else i=GU(i,c);a>l&&this.text.skip(a-l)},span:(l,a,c,u)=>{for(let f=l;f<a;){let h=this.text.next(Math.min(512,a-f));h==null?(r.addLineStartIfNotCovered(i),r.addBreak(),f++):(r.ensureLine(i),r.addText(h,c,f==l?u:c.length),f+=h.length),i=null}s=c.length}});s>-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=o}forward(e,n,i=1){n-e<=10?this.old.advance(n-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let n=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=ze.get(r);if(r==this.view.contentDOM)break;s instanceof nn?n.push(s):s?.isLine()?i=s:s instanceof Ar||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new fa(r,kD):i||n.push(nn.of(new Bu({tagName:r.nodeName.toLowerCase(),attributes:CU(r)}),r)))}return{line:i,marks:n}}};function TE(t,e){let n=i=>{for(let r of i.children)if((e?r.isText():r.length)||n(r))return!0;return!1};return n(t)}function KU(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}var kD={class:"cm-line"};function GU(t,e){let n=e.spec.attributes,i=e.spec.class;return!n&&!i||(t||(t={class:"cm-line"}),n&&d1(n,t),i&&(t.class+=" "+i)),t}function QU(t){let e=[];for(let n=t.parents.length;n>1;n--){let i=n==t.parents.length?t.tile:t.parents[n].tile;i instanceof nn&&e.push(i.mark)}return e}function bv(t){let e=ze.get(t);return e&&e.setDOM(t.cloneNode()),t}var ws=class extends Or{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}};ws.inline=new ws("span");ws.block=new ws("div");var vv=new class extends Or{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}},Dp=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=xe.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new ua(e,e.contentDOM),this.updateInner([new ui(0,0,0,e.state.doc.length)],null)}update(e){var n;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:u,toA:f})=>f<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),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?r=this.domChanged.newSel.head:!iF(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?WU(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;i=new ui(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(L.ie||L.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=eF(o,this.decorations,e.changes);a.length&&(i=ui.extendWithRanges(i,a));let c=tF(l,this.blockWrappers,e.changes);return c.length&&(i=ui.extendWithRanges(i,c)),s&&!i.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(n||e.length){let o=this.tile,l=new Hv(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&ze.get(n.text)&&l.cache.reused.set(ze.get(n.text),2),this.tile=l.run(e,n),Uv(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=L.chrome||L.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Ru&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let i of n.effects)i.is(bD)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(kr)||i.tabIndex>-1)&&Cu(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||n||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c,u;if(a.empty?u=c=this.inlineDOMNearPos(a.anchor,a.assoc||1):(u=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),c=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),L.gecko&&a.empty&&!this.hasComposition&&XU(c)){let h=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(h,c.node.childNodes[c.offset]||null)),c=u=new Ui(h,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!Eu(c.node,c.offset,f.anchorNode,f.anchorOffset)||!Eu(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{L.android&&L.chrome&&i.contains(f.focusNode)&&nF(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let h=Pu(this.view.root);if(h)if(a.empty){if(L.gecko){let d=ZU(c.node,c.offset);if(d&&d!=3){let m=(d==1?iD:rD)(c.node,c.offset);m&&(c=new Ui(m.node,m.offset))}}h.collapse(c.node,c.offset),a.bidiLevel!=null&&h.caretBidiLevel!==void 0&&(h.caretBidiLevel=a.bidiLevel)}else if(h.extend){h.collapse(c.node,c.offset);try{h.extend(u.node,u.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([c,u]=[u,c]),d.setEnd(u.node,u.offset),d.setStart(c.node,c.offset),h.removeAllRanges(),h.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new Ui(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new Ui(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&Eu(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,i=Pu(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!n.empty||!n.assoc||!i.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let l=o.posAtStart;if(n.head==l||n.head==l+o.length)return;let a=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!a||!c||a.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);i.collapse(u.node,u.offset),i.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&&i.collapse(r,s)}posFromDOM(e,n){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[n];else{let o=Tr(e)==0?0:n==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!ze.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,l=r;;o++){let a=i.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?r+n:r+(n?i.length:0):r}domAtPos(e,n){let{tile:i,offset:r}=this.tile.resolveBlock(e,n);return i.isWidget()?i.domPosFor(r,n):i.domIn(r,n)}inlineDOMNearPos(e,n){let i,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let f=u+c.length;if(u<=e&&(i=c,r=e-u,s=f<e),f>=e&&!o&&(o=c,l=e-u,a=u>e),u>e&&o)return!0}}),!i&&!o?this.domAtPos(e,n):(s&&o?i=null:a&&i&&(o=null),i&&n<0||!o?i.domIn(r,n):o.domIn(l,n))}coordsAt(e,n,i){let{tile:r,offset:s}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Ru?null:r.coordsInWidget(s,n,!0):r.coordsIn(s,n,i)}lineAt(e,n){let{tile:i}=this.tile.resolveBlock(e,n);return i.isLine()?i:null}coordsForChar(e){let{tile:n,offset:i}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&o<s.length){let l=pt(s.text,o);if(l==o)return null;let a=zu(s.dom,o,l).getClientRects();for(let c=0;c<a.length;c++){let u=a[c];if(c==a.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return r(n,i)}measureVisibleLineHeights(e){let n=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==_e.LTR,c=0,u=(f,h,d)=>{for(let m=0;m<f.children.length&&!(h>r);m++){let g=f.children[m],b=h+g.length,p=g.dom.getBoundingClientRect(),{height:y}=p;if(d&&!m&&(c+=p.top-d.top),g instanceof Ar)b>i&&u(g,h,p);else if(h>=i&&(c>0&&n.push(-c),n.push(y+c),c=0,o)){let v=g.dom.lastChild,S=v?xp(v):[];if(S.length){let w=S[S.length-1],O=a?w.right-p.left:p.right-w.left;O>l&&(l=O,this.minWidth=s,this.minWidthFrom=h,this.minWidthTo=b)}}d&&m==f.children.length-1&&(c+=d.bottom-p.bottom),h=b+g.breakAfter}};return u(this.tile,0,null),n}textDirectionAt(e){let{tile:n}=this.tile.resolveBlock(e,1);return getComputedStyle(n.dom).direction=="rtl"?_e.RTL:_e.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=xp(c.dom);if(u.length!=1)return;l+=u[0].width,a=u[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let n=document.createElement("div"),i,r,s;return n.className="cm-line",n.style.width="99999px",n.style.position="absolute",n.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(n);let o=xp(n.firstChild)[0];i=n.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,n.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let i=0,r=0;;r++){let s=r==n.viewports.length?null:n.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let l=(n.lineBlockAt(o).bottom-n.lineBlockAt(i).top)/this.view.scaleY;e.push(xe.replace({widget:new Ru(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return xe.set(e)}updateDeco(){let e=1,n=this.view.state.facet(jp).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(v1).map((s,o)=>{let l=typeof s=="function";return l&&(i=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,n.push(de.join(r))),this.decorations=[this.editContextFormatting,...n,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(SD).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(yD))try{if(c(this.view,e.range,e))return!0}catch(u){Sn(this.view.state,u,"scroll handler")}let{range:n}=e,i=this.coordsAt(n.head,n.assoc||(n.head>n.anchor?-1:1)),r;if(!i)return;!n.empty&&(r=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=S1(this.view),o={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(MU(this.view.scrollDOM,o,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==_e.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let c=this.view.docView.lineAt(n.head,1);c&&c.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=i=>i.isWidget()||i.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){Uv(this.tile)}};function Uv(t,e){let n=e?.get(t);if(n!=1){n==null&&t.destroy();for(let i of t.children)Uv(i,e)}}function XU(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")}function AD(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let i=iD(n.focusNode,n.focusOffset),r=rD(n.focusNode,n.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let l=ze.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let a=ze.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function WU(t,e,n){let i=AD(t,n);if(!i)return null;let{node:r,from:s,to:o}=i,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new ui(a.mapPos(s),a.mapPos(o),s,o),text:r}}function ZU(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)}var JU=class{constructor(){this.changes=[]}compareRange(e,n){la(e,n,this.changes)}comparePoint(e,n){la(e,n,this.changes)}boundChange(e){la(e,e,this.changes)}};function eF(t,e,n){let i=new JU;return de.compare(t,e,n,i),i.changes}var Fv=class{constructor(){this.changes=[]}compareRange(e,n){la(e,n,this.changes)}comparePoint(){}boundChange(e){la(e,e,this.changes)}};function tF(t,e,n){let i=new Fv;return de.compare(t,e,n,i),i.changes}function nF(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 iF(t,e){let n=!1;return e&&t.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(n=!0)}),n}var Ru=class extends Or{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function rF(t,e,n=1){let i=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return N.cursor(e);s==0?n=1:s==r.length&&(n=-1);let o=s,l=s;n<0?o=pt(r.text,s,!1):l=pt(r.text,s);let a=i(r.text.slice(o,l));for(;o>0;){let c=pt(r.text,o,!1);if(i(r.text.slice(c,o))!=a)break;o=c}for(;l<r.length;){let c=pt(r.text,l);if(i(r.text.slice(l,c))!=a)break;l=c}return N.undirectionalRange(o+r.from,l+r.from)}function sF(t,e,n,i,r){let s=Math.round((i-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((r-n.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+hE(o,s,t.state.tabSize)}function oF(t,e,n){let i=t.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==rn.Text&&(r.type!=s.type||(n<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function lF(t,e,n,i){let r=oF(t,e.head,e.assoc||-1),s=!i||r.type!=rn.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),a=t.posAtCoords({x:n==(l==_e.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return N.cursor(a,n?-1:1)}return N.cursor(n?r.to:r.from,n?-1:1)}function CE(t,e,n,i){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,a=null;;){let c=HU(r,s,o,l,n),u=cD;if(!c){if(r.number==(n?t.state.doc.lines:1))return l;u=`
|
|
195
|
+
`,r=t.state.doc.line(r.number+(n?1:-1)),s=t.bidiSpans(r),c=t.visualLineSide(r,!n)}if(a){if(!a(u))return l}else{if(!i)return c;a=i(u)}l=c}}function aF(t,e,n){let i=t.state.charCategorizer(e),r=i(n);return s=>{let o=i(s);return r==ai.Space&&(r=o),r==o}}function cF(t,e,n,i){let r=e.head,s=n?1:-1;if(r==(n?t.state.doc.length:0))return N.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(r,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-a.left),l=s<0?c.top:c.bottom;else{let m=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-m.from))),l=(s<0?m.top:m.bottom)+u}let f=a.left+o,h=t.viewState.heightOracle.textHeight>>1,d=i??h;for(let m=0;;m+=h){let g=l+(d+m)*s,b=jv(t,{x:f,y:g},!1,s);if(n?g>a.bottom:g<a.top)return N.cursor(b.pos,b.assoc);let p=t.coordsAtPos(b.pos,b.assoc),y=p?(p.top+p.bottom)/2:0;if(!p||(n?y>l:y<l))return N.cursor(b.pos,b.assoc,void 0,o)}}function Nu(t,e,n){for(;;){let i=0;for(let r of t)r.between(e-1,e+1,(s,o,l)=>{if(e>s&&e<o){let a=i||n||(e-s<o-e?-1:1);e=a<0?s:o,i=a}});if(!i)return e}}function OD(t,e){let n=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=Nu(t,r.from,0);o!=r.from&&(s=N.cursor(o,-1))}else{let o=Nu(t,r.from,-1),l=Nu(t,r.to,1);(o!=r.from||l!=r.to)&&(r.undirectional?s=N.undirectionalRange(r.from,r.to):s=N.range(r.from==r.anchor?o:l,r.from==r.head?o:l))}s&&(n||(n=e.ranges.slice()),n[i]=s)}return n?N.create(n,e.mainIndex):e}function Sv(t,e,n){let i=Nu(t.state.facet(Hu).map(r=>r(t)),n.from,e.head>n.from?-1:1);return i==n.from?n:N.cursor(i,i<n.from?1:-1)}var Fn=class{constructor(e,n){this.pos=e,this.assoc=n}};function jv(t,e,n,i){let r=t.contentDOM.getBoundingClientRect(),s=r.top+t.viewState.paddingTop,{x:o,y:l}=e,a=l-s,c;for(;;){if(a<0)return new Fn(0,1);if(a>t.viewState.docHeight)return new Fn(t.state.doc.length,-1);if(c=t.elementAtHeight(a),i==null)break;if(c.type==rn.Text){if(i<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let h=t.docView.coordsAt(i<0?c.from:c.to,i>0?-1:1);if(h&&(i<0?h.top<=a+s:h.bottom>=a+s))break}let f=t.viewState.heightOracle.textHeight/2;a=i>0?c.bottom+f:c.top-f}if(t.viewport.from>=c.to||t.viewport.to<=c.from){if(n)return null;if(c.type==rn.Text){let f=sF(t,r,c,o,l);return new Fn(f,f==c.from?1:-1)}}if(c.type!=rn.Text)return a<(c.top+c.bottom)/2?new Fn(c.from,1):new Fn(c.to,-1);let u=t.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=t.docView.lineAt(c.from,-2)),new Vv(t,o,l,t.textDirectionAt(c.from)).scanTile(u,c.from)}var Vv=class{constructor(e,n,i,r){this.view=e,this.x=n,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[jn.find(r,e-i.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:i,spans:r}=this.bidiSpansAt(e);return r[jn.find(r,e-i.from,-1,n)].dir}bidiIn(e,n){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<n)}scan(e,n,i=!1){let r=0,s=e.length-1,o=new Set,l=this.bidiIn(e[0],e[s]),a,c,u=-1,f=1e9,h;e:for(;r<s;){let m=s-r,g=r+s>>1;t:if(o.has(g)){let p=r+Math.floor(Math.random()*m);for(let y=0;y<m;y++){if(!o.has(p)){g=p;break t}p++,p==s&&(p=r)}break e}o.add(g);let b=n(g);if(b)for(let p=0;p<b.length;p++){let y=b[p],v=0;if(!(y.width==0&&b.length>1)){if(y.bottom<this.y)(!a||a.bottom<y.bottom)&&(a=y),v=1;else if(y.top>this.y)(!c||c.top>y.top)&&(c=y),v=-1;else{let S=y.left>this.x?this.x-y.left:y.right<this.x?this.x-y.right:0,w=Math.abs(S);w<f&&(u=g,f=w,h=y),S&&(v=S<0==(this.baseDir==_e.LTR)?-1:1)}v==-1&&(!l||this.baseDirAt(e[g],1))?s=g:v==1&&(!l||this.baseDirAt(e[g+1],-1))&&(r=g+1)}}}if(!h){if(!c&&!a)return{i:e[0],after:!1};let m=a&&(!c||this.y-a.bottom<c.top-this.y)?a:c;return this.y=(m.top+m.bottom)/2,this.scan(e,n,!0)}if(f&&!i){let{top:m,bottom:g}=h;if(a&&a.bottom>(m+m+g)/3)return this.y=a.bottom-1,this.scan(e,n,!0);if(c&&c.top<(m+g+g)/3)return this.y=c.top+1,this.scan(e,n,!0)}let d=(l?this.dirAt(e[u],1):this.baseDir)==_e.LTR;return{i:u,after:this.x>(h.left+h.right)/2==d}}scanText(e,n){let i=[];for(let s=0;s<e.length;s=pt(e.text,s))i.push(n+s);i.push(n+e.length);let r=this.scan(i,s=>{let o=i[s]-n,l=i[s+1]-n;return zu(e.dom,o,l).getClientRects()});return r.after?new Fn(i[r.i+1],-1):new Fn(i[r.i],1)}scanTile(e,n){if(!e.length)return new Fn(n,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,n);if(l.isComposite())return this.scanTile(l,n)}let i=[n];for(let l=0,a=n;l<e.children.length;l++)i.push(a+=e.children[l].length);let r=this.scan(i,l=>{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:zu(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new Fn(i[r.i+1],-1):new Fn(o,1)}},na="\uFFFF",$v=class{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(De.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=na}readRange(e,n){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=ze.get(r),l=r.nextSibling;if(l==n){o?.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=ze.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:Op(r))||Op(l)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!fF(l,n)&&this.lineBreak(),r=l}return this.findPointBefore(i,n),this}readTextNode(e){let n=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,n.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=r.exec(n))&&(s=l.index,o=l[0].length),this.append(n.slice(i,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=s+o}}readNode(e){let n=ze.get(e),i=n&&n.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==n&&(i.pos=this.text.length)}findPointInside(e,n){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(uF(e,i.node,i.offset)?n:0))}};function uF(t,e,n){for(;;){if(!e||n<Tr(e))return!1;if(e==t)return!0;n=xs(e)+1,e=e.parentNode}}function fF(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let i=ze.get(t);if(!i?.isWidget())return!1;i&&(n||(n=[])).push(i)}if(n)for(let i of n){let r=i.overrideDOMText;if(r?.length)return!1}return!0}var Mp=class{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}},Yv=class{constructor(e,n,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=TD(e.docView.tile,n,i,0))){let a=s||o?[]:dF(e),c=new $v(a,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=pF(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Dv(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),u=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Dv(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((L.ios||L.chrome)&&c!=u&&Math.min(c,u)<=l.main.from&&Math.max(c,u)>=l.main.to&&(f.from>0||f.to<e.state.doc.length)){let h=Math.min(c,u),d=Math.max(c,u),m=f.from-h,g=f.to-d;(m==0||m==1||h==0)&&(g==0||g==-1||d==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&l.ranges.length>1)this.newSel=l.replaceRange(N.range(u,c));else if(e.lineWrapping&&u==c&&!(l.main.empty&&l.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let h=e.coordsAtPos(c,-1),d=0;h&&(d=e.inputState.lastTouchY<=h.bottom?-1:1),this.newSel=N.create([N.cursor(c,d)])}else this.newSel=N.single(u,c)}}};function TD(t,e,n,i){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,c=i,u=i;a<t.children.length;a++){let f=t.children[a],h=c+f.length;if(c<e&&h>n)return TD(f,e,n,c);if(h>=e&&r==-1&&(r=a,s=c),c>n&&f.dom.parentNode==t.dom){o=a,l=u;break}u=h,c=h+f.breakAfter}return{from:s,to:l<0?i+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:i,to:i+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function CD(t,e){let n,{newSel:i}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,c=s.from,u=null;(o===8||L.android&&e.text.length<a-l)&&(c=s.to,u="end");let f=r.doc.sliceString(l,a,na),h,d;!s.empty&&s.from>=l&&s.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&f.slice(s.to-l)==e.text.slice(h=e.text.length-(f.length-(s.to-l)))?n={from:s.from,to:s.to,insert:ue.of(e.text.slice(s.from-l,h).split(na))}:(d=ED(f,e.text,c-l,u))&&(L.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==na+na&&d.toB--,n={from:l+d.from,to:l+d.toA,insert:ue.of(e.text.slice(d.from,d.toB).split(na))})}else i&&(!t.hasFocus&&r.facet(kr)||Rp(i,s))&&(i=null);if(!n&&!i)return!1;if((L.mac||L.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(i&&n.insert.length==2&&(i=N.single(i.main.anchor-1,i.main.head-1)),n={from:n.from,to:n.to,insert:ue.of([n.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?n={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:L.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
196
|
+
`&&t.lineWrapping&&(i&&(i=N.single(i.main.anchor-1,i.main.head-1)),n={from:s.from,to:s.to,insert:ue.of([" "])}),n)return x1(t,n,i,o);if(i&&!Rp(i,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=OD(r.facet(Hu).map(c=>c(t)),i))),t.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function x1(t,e,n,i=-1){if(L.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(L.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&aa(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&aa(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&aa(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=hF(t,e,n));return t.state.facet(pD).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function hF(t,e,n){let i,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let a=e.from<s.from?-1:1,c=a<0?s.from:s.to,u=Nu(r.facet(Hu).map(f=>f(t)),c,a);e.from==u&&(o=u)}if(o>-1)i={changes:e,selection:N.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!n||n.main.empty&&n.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.from<e.from?r.sliceDoc(s.from,e.from):"",c=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let a=r.changes(e),c=n&&n.main.to<=a.newLength?n.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=t.state.sliceDoc(e.from,e.to),f,h=n&&AD(t,n.main.head);if(h){let m=e.insert.length-(e.to-e.from);f={from:h.from,to:h.to-m}}else f=t.state.doc.lineAt(s.head);let d=s.to-e.to;i=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:c||m.map(a)};let g=m.to-d,b=g-u.length;if(t.state.sliceDoc(b,g)!=u||g>=f.from&&b<=f.to)return{range:m};let p=r.changes({from:b,to:g,insert:e.insert}),y=m.to-s.to;return{changes:p,range:c?N.range(Math.max(0,c.anchor+y),Math.max(0,c.head+y)):m.map(p)}})}else i={changes:a,selection:c&&r.selection.replaceRange(c)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function ED(t,e,n,i){let r=Math.min(t.length,e.length),s=0;for(;s<r&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,s-Math.min(o,l));n-=o+a-s}if(o<s&&t.length<e.length){let a=n<=s&&n>=o?s-n:0;s-=a,l=s+(l-o),o=s}else if(l<s){let a=n<=s&&n>=l?s-n:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function dF(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new Mp(n,i)),(r!=n||s!=i)&&e.push(new Mp(r,s))),e}function pF(t,e){if(t.length==0)return null;let n=t[0].pos,i=t.length==2?t[1].pos:n;return n>-1&&i>-1?N.single(n+e,i+e):null}function Rp(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}var Kv=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,L.safari&&e.contentDOM.addEventListener("input",()=>null),L.gecko&&DF(e.contentDOM.ownerDocument)}handleEvent(e){!wF(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,n){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,n);for(let r of i.handlers){if(n.defaultPrevented)break;if(r(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=gF(e),i=this.handlers,r=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,l=i[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!n[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=n}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&MD.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),L.android&&L.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(L.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(DD.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||yF.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&L.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&mF(this.view.win)&&(n.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:n},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let n=this.pendingIOSKey;return!n||n.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,aa(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:L.safari&&!L.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function mF(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function EE(t,e){return(n,i)=>{try{return e.call(t,i,n)}catch(r){Sn(n.state,r)}}}function gF(t){let e=Object.create(null);function n(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of t){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&n(l).handlers.push(EE(i.value,a))}if(o)for(let l in o){let a=o[l];a&&n(l).observers.push(EE(i.value,a))}}for(let i in fi)n(i).handlers.push(fi[i]);for(let i in Kt)n(i).observers.push(Kt[i]);return e}var DD=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],yF="dthko",MD=[16,17,18,20,91,92,224,225],dp=6;function pp(t){return Math.max(0,t)*.7+8}function bF(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}var Gv=class{constructor(e,n,i,r){this.view=e,this.startEvent=n,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=eD(e.contentDOM),this.atoms=e.state.facet(Hu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=e.state.facet(De.allowMultipleSelections)&&vF(e,n),this.dragging=xF(e,n)&&_D(n)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&bF(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,i=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=S1(this.view);e.clientX-a.left<=r+dp?n=-pp(r-e.clientX):e.clientX+a.right>=o-dp&&(n=pp(e.clientX-o)),e.clientY-a.top<=s+dp?i=-pp(s-e.clientY):e.clientY+a.bottom>=l-dp&&(i=pp(e.clientY-l)),this.setScrollSpeed(n,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(){let{x:e,y:n}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),n&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=n,n=0),(e||n)&&this.view.win.scrollBy(e,n),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:n}=this,i=OD(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function vF(t,e){let n=t.state.facet(uD);return n.length?n[0](e):L.mac?e.metaKey:e.ctrlKey}function SF(t,e){let n=t.state.facet(fD);return n.length?n[0](e):L.mac?!e.altKey:!e.ctrlKey}function xF(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let i=Pu(t.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function wF(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,i;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(i=ze.get(n))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}var fi=Object.create(null),Kt=Object.create(null),RD=L.ie&&L.ie_version<15||L.ios&&L.webkit_version<604;function kF(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(),ND(t,n.value)},50)}function Vp(t,e,n){for(let i of t.facet(e))n=i(n,t);return n}function ND(t,e){e=Vp(t.state,g1,e);let{state:n}=t,i,r=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(Qv!=null&&n.selection.ranges.every(a=>a.empty)&&Qv==s.toString()){let a=-1;i=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==a)return{range:c};a=u.from;let f=n.toText((o?s.line(r++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:N.cursor(c.from+f.length)}})}else o?i=n.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:N.cursor(a.from+c.length)}}):i=n.replaceSelection(s);t.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Kt.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,L.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};Kt.wheel=Kt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};fi.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Kt.touchstart=(t,e)=>{let n=t.inputState,i=e.targetTouches[0];n.touchActive=!0,n.lastTouchTime=Date.now(),i&&(n.lastTouchX=i.clientX,n.lastTouchY=i.clientY),n.setSelectionOrigin("select.pointer")};Kt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Kt.touchend=(t,e)=>{t.inputState.touchActive=!1};fi.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let i of t.state.facet(hD))if(n=i(t,e),n)break;if(!n&&e.button==0&&(n=OF(t,e)),n){let i=!t.hasFocus;t.inputState.startMouseSelection(new Gv(t,e,n,i)),i&&t.observer.ignore(()=>{tD(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function DE(t,e,n,i){if(i==1)return N.cursor(e,n);if(i==2)return rF(t.state,e,n);{let r=t.docView.lineAt(e,n),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return l<t.state.doc.length&&l==s.to&&l++,N.undirectionalRange(o,l)}}var AF=L.ie&&L.ie_version<=11,ME=null,RE=0,NE=0;function _D(t){if(!AF)return t.detail;let e=ME,n=NE;return ME=t,NE=Date.now(),RE=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(RE+1)%3:1}function OF(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=_D(e),r=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),r=r.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=DE(t,a.pos,a.assoc,i);if(n.pos!=a.pos&&!o){let f=DE(t,n.pos,n.assoc,i),h=Math.min(f.from,u.from),d=Math.max(f.to,u.to);u=h<u.from?N.range(h,d,u.assoc):N.range(d,h,u.assoc)}return o?r.replaceRange(r.main.extend(u.from,u.to,u.assoc)):l&&i==1&&r.ranges.length>1&&(c=TF(r,a.pos))?c:l?r.addRange(u):N.create([u])}}}function TF(t,e){for(let n=0;n<t.ranges.length;n++){let{from:i,to:r}=t.ranges[n];if(i<=e&&r>=e)return N.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}fi.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=n.to||o<=n.from)&&(n=N.undirectionalRange(s,o))}}let{inputState:i}=t;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",Vp(t.state,y1,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};fi.dragend=t=>(t.inputState.draggedContent=null,!1);function _E(t,e,n,i){if(n=Vp(t.state,g1,n),!n)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=i&&s&&SF(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:n},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}fi.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let i=Array(n.length),r=0,s=()=>{++r==n.length&&_E(t,e,i.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let l=new FileReader;l.onerror=s,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),s()},l.readAsText(n[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return _E(t,e,i,!0),!0}return!1};fi.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=RD?null:e.clipboardData;return n?(ND(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(kF(t),!1)};function CF(t,e){let n=t.dom.parentNode;if(!n)return;let i=n.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),t.focus()},50)}function EF(t){let e=[],n=[],i=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),n.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}i=!0}return{text:Vp(t,y1,e.join(t.lineBreak)),ranges:n,linewise:i}}var Qv=null;fi.copy=fi.cut=(t,e)=>{if(!Cu(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:i,linewise:r}=EF(t.state);if(!n&&!r)return!1;Qv=r?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=RD?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(CF(t,n),!1)};var LD=zn.define();function ID(t,e){let n=[];for(let i of t.facet(mD)){let r=i(t,e);r&&n.push(r)}return n.length?t.update({effects:n,annotations:LD.of(!0)}):null}function BD(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=ID(t.state,e);n?t.dispatch(n):t.update([])}},10)}Kt.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),BD(t)};Kt.blur=t=>{t.observer.clearSelectionRange(),BD(t)};Kt.compositionstart=Kt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Kt.compositionend=t=>{t.observer.editContext||(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,L.chrome&&L.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Kt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};fi.beforeinput=(t,e)=>{var n,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(n=e.dataTransfer)===null||n===void 0?void 0:n.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),c=t.posAtDOM(l.endContainer,l.endOffset);return x1(t,{from:a,to:c,insert:t.state.toText(s)},null),!0}}let r;if(L.chrome&&L.android&&(r=DD.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return L.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),L.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Kt.compositionend(t,e),20),!1};var LE=new Set;function DF(t){LE.has(t)||(LE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}var IE=["pre-wrap","normal","pre-line","break-spaces"],da=!1;function BE(){da=!1}var Xv=class{constructor(e){this.lineWrapping=e,this.doc=ue.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let i=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((n-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return IE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(n=!0,this.heightSamples[Math.floor(r*10)]=!0)}return n}refresh(e,n,i,r,s,o){let l=IE.indexOf(e)>-1,a=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=n,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return a}},Wv=class{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}},ci=class t{constructor(e,n,i,r,s){this.from=e,this.length=n,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?rn.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 mo?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 t(this.from,this.length+e.length,this.top,this.height+e.height,n)}},Me=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Me||(Me={})),wp=.001,xn=class t{constructor(e,n,i=2){this.length=e,this.height=n,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>wp&&(da=!0),this.height=e)}replace(e,n,i){return t.of(i)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,i,r){let s=this,o=i.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:c,fromB:u,toB:f}=r[l],h=s.lineAt(a,Me.ByPosNoHeight,i.setDoc(n),0,0),d=h.to>=c?h:s.lineAt(c,Me.ByPosNoHeight,i,0,0);for(f+=d.to-c,c=d.to;l>0&&h.from<=r[l-1].toA;)a=r[l-1].fromA,u=r[l-1].fromB,l--,a<h.from&&(h=s.lineAt(a,Me.ByPosNoHeight,i,0,0));u+=h.from-a,a=h.from;let m=Jv.build(i.setDoc(o),e,u,f);s=Np(s,s.replace(a,c,m))}return s.updateHeight(i,0)}static empty(){return new Un(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,i=e.length,r=0,s=0;for(;;)if(n==i)if(r>s*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),i+=1+l.break,r-=l.size}else if(s>r*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,s-=l.size}else break;else if(r<s){let l=e[n++];l&&(r+=l.size)}else{let l=e[--i];l&&(s+=l.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,i++),new Zv(t.of(e.slice(0,n)),o,t.of(e.slice(i)))}};function Np(t,e){return t==e?t:(t.constructor!=e.constructor&&(da=!0),e)}xn.prototype.size=1;var MF=xe.replace({}),_p=class extends xn{constructor(e,n,i){super(e,n),this.deco=i,this.spaceAbove=0}mainBlock(e,n){return new ci(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new ci(r,0,i,this.spaceAbove,MF):this.mainBlock(i,r)}lineAt(e,n,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,n,i,r,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,Me.ByPos,i,r,s))}setMeasuredHeight(e){let n=e.heights[e.index++];n<0?(this.spaceAbove=-n,n=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(n)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}},Un=class t extends _p{constructor(e,n,i){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,n){return new ci(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,i){let r=i[0];return i.length==1&&(r instanceof t||r instanceof Ss&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ss?r=new t(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):xn.of(i)}updateHeight(e,n=0,i=!1,r){return r&&r.from<=n&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},Ss=class t extends xn{constructor(e){super(e,0)}heightMetrics(e,n){let i=e.doc.lineAt(n).number,r=e.doc.lineAt(n+this.length).number,s=r-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:l}}blockAt(e,n,i,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(n,r);if(n.lineWrapping){let c=r+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),u=n.doc.lineAt(c),f=l+u.length*a,h=Math.max(i,e-f/2);return new ci(u.from,u.length,h,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-i)/l))),{from:u,length:f}=n.doc.line(s+c);return new ci(u,f,i+l*c,l,0)}}lineAt(e,n,i,r,s){if(n==Me.ByHeight)return this.blockAt(e,i,r,s);if(n==Me.ByPosNoHeight){let{from:d,to:m}=i.doc.lineAt(e);return new ci(d,m-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),u=l+c.length*a,f=c.number-o,h=r+l*f+a*(c.from-s-f);return new ci(c.from,c.length,Math.max(r,Math.min(h,r+this.height-u)),u,0)}forEachLine(e,n,i,r,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:l,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let u=e,f=r;u<=n;){let h=i.doc.lineAt(u);if(u==e){let m=h.number-l;f+=a*m+c*(e-s-m)}let d=a+c*h.length;o(new ci(h.from,h.length,f,d,0)),f+=d,u=h.to+1}}replace(e,n,i){let r=this.length-n;if(r>0){let s=i[i.length-1];s instanceof t?i[i.length-1]=new t(s.length+r):i.push(null,new t(r-1))}if(e>0){let s=i[0];s instanceof t?i[0]=new t(e+s.length):i.unshift(new t(e-1),null)}return xn.of(i)}decomposeLeft(e,n){n.push(new t(e-1),null)}decomposeRight(e,n){n.push(null,new t(this.length-e-1))}updateHeight(e,n=0,i=!1,r){let s=n+this.length;if(r&&r.from<=n+this.length&&r.more){let o=[],l=Math.max(n,r.from),a=-1;for(r.from>n&&o.push(new t(r.from-n-1).updateHeight(e,n));l<=s&&r.more;){let u=e.doc.lineAt(l).length;o.length&&o.push(null);let f=r.heights[r.index++],h=0;f<0&&(h=-f,f=r.heights[r.index++]),a==-1?a=f:Math.abs(f-a)>=wp&&(a=-2);let d=new Un(u,f,h);d.outdated=!1,o.push(d),l+=u+1}l<=s&&o.push(null,new t(s-l).updateHeight(e,l));let c=xn.of(o);return(a<0||Math.abs(c.height-this.height)>=wp||Math.abs(a-this.heightMetrics(e,n).perLine)>=wp)&&(da=!0),Np(this,c)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Zv=class extends xn{constructor(e,n,i){super(e.length+n+i.length,e.height+i.height,n|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,n,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,n,i,r):this.right.blockAt(e,n,s,r+this.left.length+this.break)}lineAt(e,n,i,r,s){let o=r+this.left.height,l=s+this.left.length+this.break,a=n==Me.ByHeight?e<o:e<l,c=a?this.left.lineAt(e,n,i,r,s):this.right.lineAt(e,n,i,o,l);if(this.break||(a?c.to<l:c.from>l))return c;let u=n==Me.ByPosNoHeight?Me.ByPosNoHeight:Me.ByPos;return a?c.join(this.right.lineAt(l,u,i,o,l)):this.left.lineAt(l,u,i,r,s).join(c)}forEachLine(e,n,i,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e<a&&this.left.forEachLine(e,n,i,r,s,o),n>=a&&this.right.forEachLine(e,n,i,l,a,o);else{let c=this.lineAt(a,Me.ByPos,i,r,s);e<c.from&&this.left.forEachLine(e,c.from-1,i,r,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,i,l,a,o)}}replace(e,n,i){let r=this.left.length+this.break;if(n<r)return this.balanced(this.left.replace(e,n,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,n-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of i)s.push(l);if(e>0&&qE(s,o-1),n<this.length){let l=s.length;this.decomposeRight(n,s),qE(s,l)}return xn.of(s)}decomposeLeft(e,n){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(i++,e>=i&&n.push(null)),e>i&&this.right.decomposeLeft(e-i,n)}decomposeRight(e,n){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,n);e<i&&this.left.decomposeRight(e,n),this.break&&e<r&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?xn.of(this.break?[e,null,n]:[e,n]):(this.left=Np(this.left,e),this.right=Np(this.right,n),this.setHeight(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,i=!1,r){let{left:s,right:o}=this,l=n+s.length+this.break,a=null;return r&&r.from<=n+s.length&&r.more?a=s=s.updateHeight(e,n,i,r):s.updateHeight(e,n,i),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,i,r):o.updateHeight(e,l,i),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function qE(t,e){let n,i;t[e]==null&&(n=t[e-1])instanceof Ss&&(i=t[e+1])instanceof Ss&&t.splice(e-1,3,new Ss(n.length+1+i.length))}var RF=5,Jv=class t{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 i=Math.min(n,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Un?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Un(i-this.pos,-1,0)),this.writtenTo=i,n>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,i){if(e<n||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=n-e;i.block?this.addBlock(new _p(o,r,i)):(o||s||r>=RF)&&this.addLineDeco(r,s,o)}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 Un(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let i=new Ss(n-e);return this.oracle.doc.lineAt(e).to==n&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Un)return e;let n=new Un(0,-1,0);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,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=n,this.writtenTo=this.pos=this.pos+i}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof Un)&&!this.isCovered?this.nodes.push(new Un(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof Un&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,n,i,r){let s=new t(i,e);return de.spans(n,i,r,s,0),s.finish(i)}};function NF(t,e,n){let i=new e1;return de.compare(t,e,n,i,0),i.changes}var e1=class{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,i,r){(e<n||i&&i.heightRelevant||r&&r.heightRelevant)&&la(e,n,this.changes,5)}};function _F(t,e){let n=t.getBoundingClientRect(),i=t.ownerDocument,r=i.defaultView||window,s=Math.max(0,n.left),o=Math.min(r.innerWidth,n.right),l=Math.max(0,n.top),a=Math.min(r.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=i.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let h=u.getBoundingClientRect();s=Math.max(s,h.left),o=Math.min(o,h.right),l=Math.max(l,h.top),a=Math.min(c==t.parentNode?r.innerHeight:a,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-n.left,right:Math.max(s,o)-n.left,top:l-(n.top+e),bottom:Math.max(l,a)-(n.top+e)}}function LF(t){let e=t.getBoundingClientRect(),n=t.ownerDocument.defaultView||window;return e.left<n.innerWidth&&e.right>0&&e.top<n.innerHeight&&e.bottom>0}function IF(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}var _u=class{constructor(e,n,i,r){this.from=e,this.to=n,this.size=i,this.displaySize=r}static same(e,n){if(e.length!=n.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=n[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,n){return xe.replace({widget:new t1(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}},t1=class extends Or{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}},Lp=class{constructor(e,n){this.view=e,this.state=n,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=PE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=_e.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=n.facet(b1).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Xv(i),this.stateDeco=zE(n),this.heightMap=xn.empty().applyChanges(this.stateDeco,ue.empty,this.heightOracle.setDoc(n.doc),[new ui(0,0,0,n.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=xe.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let i=0;i<=1;i++){let r=i?n.head:n.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new ra(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?PE:new n1(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Tu(e,this.scaler))})}update(e,n=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=zE(this.state);let r=e.changedRanges,s=ui.extendWithRanges(r,NF(i,this.stateDeco,e?e.changes:$t.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);BE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||da)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.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 c=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(FU)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,i=window.getComputedStyle(n),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?_e.RTL:_e.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=n.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let c=0,u=0;if(l.width&&l.height){let{scaleX:w,scaleY:O}=JE(n,l);(w>.005&&Math.abs(this.scaleX-w)>.005||O>.005&&Math.abs(this.scaleY-O)>.005)&&(this.scaleX=w,this.scaleY=O,c|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,h=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=h)&&(this.paddingTop=f,this.paddingBottom=h,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let d=eD(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let m=this.getScrollOffset();this.scrollOffset!=m&&(this.scrollAnchorHeight=-1,this.scrollOffset=m),this.scrolledToBottom=nD(this.scrollParent||e.win);let g=(this.printing?IF:_F)(n,this.paddingTop),b=g.top-this.pixelViewport.top,p=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(a=!0)),!this.inView&&!this.scrollTarget&&!LF(e.dom))return 0;let v=l.width;if((this.contentDOMWidth!=v||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),a){let w=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(w)&&(o=!0),o||r.lineWrapping&&Math.abs(v-this.contentDOMWidth)>r.charWidth){let{lineHeight:O,charWidth:k,textHeight:A}=e.docView.measureTextSize();o=O>0&&r.refresh(s,O,k,A,Math.max(5,v/k),w),o&&(e.docView.minWidth=0,c|=16)}b>0&&p>0?u=Math.max(b,p):b<0&&p<0&&(u=Math.min(b,p)),BE();for(let O of this.viewports){let k=O.from==this.viewport.from?w:e.docView.measureVisibleLineHeights(O);this.heightMap=(o?xn.empty().applyChanges(this.stateDeco,ue.empty,this.heightOracle,[new ui(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new Wv(O.from,k))}da&&(c|=2)}let S=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return S&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||S)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,n){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new ra(r.lineAt(o-i*1e3,Me.ByHeight,s,0,0).from,r.lineAt(l+(1-i)*1e3,Me.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<a.from||c>a.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=r.lineAt(c,Me.ByPos,s,0,0),h;n.y=="center"?h=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<a.from?h=f.top:h=f.bottom-u,a=new ra(r.lineAt(h-1e3/2,Me.ByHeight,s,0,0).from,r.lineAt(h+u+1e3/2,Me.ByHeight,s,0,0).to)}}return a}mapViewport(e,n){let i=n.mapPos(e.from,-1),r=n.mapPos(e.to,1);return new ra(this.heightMap.lineAt(i,Me.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Me.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Me.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Me.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(n==this.state.doc.length||s>=l+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<l+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let i=[];for(let r of e)n.touchesRange(r.from,r.to)||i.push(new _u(n.mapPos(r.from),n.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,n){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=_e.LTR&&!i)return[];let l=[],a=(u,f,h,d)=>{if(f-u<s)return;let m=this.state.selection.main,g=[m.from];m.empty||g.push(m.to);for(let p of g)if(p>u&&p<f){a(u,p-10,h,d),a(p+10,f,h,d);return}let b=qF(e,p=>p.from>=h.from&&p.to<=h.to&&Math.abs(p.from-u)<s&&Math.abs(p.to-f)<s&&!g.some(y=>p.from<y&&p.to>y));if(!b){if(f<h.to&&n&&i&&n.visibleRanges.some(v=>v.from<=f&&v.to>=f)){let v=n.moveToLineBoundary(N.cursor(f),!1,!0).head;v>u&&(f=v)}let p=this.gapSize(h,u,f,d),y=i||p<2e6?p:2e6;b=new _u(u,f,p,y)}l.push(b)},c=u=>{if(u.length<o||u.type!=rn.Text)return;let f=BF(u.from,u.to,this.stateDeco);if(f.total<o)return;let h=this.scrollTarget?this.scrollTarget.range.head:null,d,m;if(i){let g=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,p;if(h!=null){let y=gp(f,h),v=((this.visibleBottom-this.visibleTop)/2+g)/u.height;b=y-v,p=y+v}else b=(this.visibleTop-u.top-g)/u.height,p=(this.visibleBottom-u.top+g)/u.height;d=mp(f,b),m=mp(f,p)}else{let g=f.total*this.heightOracle.charWidth,b=r*this.heightOracle.charWidth,p=0;if(g>2e6)for(let O of e)O.from>=u.from&&O.from<u.to&&O.size!=O.displaySize&&O.from*this.heightOracle.charWidth+p<this.pixelViewport.left&&(p=O.size-O.displaySize);let y=this.pixelViewport.left+p,v=this.pixelViewport.right+p,S,w;if(h!=null){let O=gp(f,h),k=((v-y)/2+b)/g;S=O-k,w=O+k}else S=(y-b)/g,w=(v+b)/g;d=mp(f,S),m=mp(f,w)}d>u.from&&a(u.from,d,u,f),m<u.to&&a(m,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return l}gapSize(e,n,i,r){let s=gp(r,i)-gp(r,n);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){_u.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=xe.set(e.map(n=>n.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let n=this.stateDeco;this.lineGaps.length&&(n=n.concat(this.lineGapDeco));let i=[];de.spans(n,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],l=i[s];(o.from!=l.from||o.to!=l.to)&&(r|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Tu(this.heightMap.lineAt(e,Me.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(n=>n.top<=e&&n.bottom>=e)||Tu(this.heightMap.lineAt(this.scaler.fromDOM(e),Me.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let n=this.lineBlockAtHeight(e+8);return n.from>=this.viewport.from||this.viewportLines[0].top-e>200?n:this.viewportLines[0]}elementAtHeight(e){return Tu(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}},ra=class{constructor(e,n){this.from=e,this.to=n}};function BF(t,e,n){let i=[],r=t,s=0;return de.spans(n,t,e,{span(){},point(o,l){o>r&&(i.push({from:r,to:o}),s+=o-r),r=l}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function mp({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let i=Math.floor(t*n);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(i<=l)return s+i;i-=l}}function gp(t,e){let n=0;for(let{from:i,to:r}of t.ranges){if(e<=r){n+=e-i;break}n+=r-i}return n/t.total}function qF(t,e){for(let n of t)if(e(n))return n}var PE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function zE(t){let e=t.facet(jp).filter(i=>typeof i!="function"),n=t.facet(v1).filter(i=>typeof i!="function");return n.length&&e.push(de.join(n)),e}var n1=class t{constructor(e,n,i){let r=0,s=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let c=n.lineAt(l,Me.ByPos,e,0,0).top,u=n.lineAt(a,Me.ByPos,e,0,0).bottom;return r+=u-c,{from:l,to:a,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(n.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let n=0,i=0,r=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof t?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,i)=>n.from==e.viewports[i].from&&n.to==e.viewports[i].to):!1}};function Tu(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),i=e.toDOM(t.bottom);return new ci(t.from,t.length,n,i-n,Array.isArray(t._content)?t._content.map(r=>Tu(r,e)):t._content)}var yp=I.define({combine:t=>t.join(" ")}),i1=I.define({combine:t=>t.indexOf(!0)>-1}),r1=Hn.newName(),qD=Hn.newName(),PD=Hn.newName(),zD={"&light":"."+qD,"&dark":"."+PD};function s1(t,e,n){return new Hn(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return t;if(!n||!n[r])throw new RangeError(`Unsupported selector: ${r}`);return n[r]}):t+" "+i}})}var PF=s1("."+r1,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},zD),zF={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},xv=L.ie&&L.ie_version<=11,o1=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Mv,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(n=>{for(let i of n)this.queue.push(i);(L.ie&&L.ie_version<=11||L.ios&&e.composing)&&n.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&L.android&&e.constructor.EDIT_CONTEXT!==!1&&!(L.chrome&&L.chrome_version<126)&&(this.editContext=new l1(e),e.state.facet(kr)&&(e.contentDOM.editContext=this.editContext.editContext)),xv&&(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),window.matchMedia&&(this.printQuery=window.matchMedia("print")),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.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((n,i)=>n!=e[i]))){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:i}=this,r=this.selectionRange;if(i.state.facet(kr)?i.root.activeElement!=this.dom:!Cu(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(L.ie&&L.ie_version<=11||L.android&&L.chrome)&&!i.state.selection.main.empty&&r.focusNode&&Eu(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Pu(e.root);if(!n)return!1;let i=L.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&HF(this.view,n)||n;if(!i||this.selectionRange.eq(i))return!1;let r=Cu(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&NU(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),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 i=this.dom;i;)if(i.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=n)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,zF),xv&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),xv&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&aa(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),n==-1?{from:n,to:i}=o:(n=Math.min(o.from,n),i=Math.max(o.to,i)))}return{from:n,to:i,typeOver:r}}readChange(){let{from:e,to:n,typeOver:i}=this.processRecords(),r=this.selectionChanged&&Cu(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Yv(this.view,e,n,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let n=this.readChange();if(!n)return this.view.requestMeasure(),!1;let i=this.view.state,r=CD(this.view,n);return this.view.state==i&&(n.domChanged||n.newSel&&!Rp(this.view.state.selection,n.newSel.main))&&this.view.update([]),r}readMutation(e){let n=this.view.docView.tile.nearest(e.target);if(!n||n.isWidget())return null;if(n.markDirty(e.type=="attributes"),e.type=="childList"){let i=HE(n,e.previousSibling||e.target.previousSibling,-1),r=HE(n,e.nextSibling||e.target.nextSibling,1);return{from:i?n.posAfter(i):n.posAtStart,to:r?n.posBefore(r):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),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(kr)!=e.state.facet(kr)&&(e.view.contentDOM.editContext=e.state.facet(kr)?this.editContext.editContext:null))}destroy(){var e,n,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function HE(t,e,n){for(;e;){let i=ze.get(e);if(i&&i.parent==t)return i;let r=e.parentNode;e=r!=t.dom?r:n>0?e.nextSibling:e.previousSibling}return null}function UE(t,e){let n=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return Eu(o.node,o.offset,r,s)&&([n,i,r,s]=[r,s,n,i]),{anchorNode:n,anchorOffset:i,focusNode:r,focusOffset:s}}function HF(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return UE(t,r)}let n=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",i,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",i,!0),n?UE(t,n):null}var l1=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let n=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let c=a-l>i.text.length;l==this.from&&s<this.from?l=s:a==this.to&&s>this.to&&(a=s);let u=ED(e.state.sliceDoc(l,a),i.text,(c?r.from:r.to)-l,c?"end":null);if(!u){let h=N.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Rp(h,r)||e.dispatch({selection:h,userEvent:"select"});return}let f={from:u.from+l,to:u.toA+l,insert:ue.of(i.text.slice(u.from,u.toB).split(`
|
|
197
|
+
`))};if((L.mac||L.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ue.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);x1(e,f,N.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(n.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(n.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);s=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||s||new DOMRect,r.push(s)}n.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(a<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;r.push(xe.mark({attributes:{style:u}}).range(a,c))}}}e.dispatch({effects:bD.of(xe.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)n.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=Pu(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,c)=>{if(i)return;let u=c.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(c)){r=this.pendingContextChange=null,n+=u,this.to+=u;return}else r=null,this.revertPending(e.state);if(s+=n,o+=n,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),r&&!i&&this.revertPending(e.state),!i}update(e){let n=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||n)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:n}=e.selection.main;this.from=Math.max(0,n-1e4),this.to=Math.min(e.doc.length,n+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let n=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(n.from),this.toContextPos(n.from+n.insert.length),e.doc.sliceString(n.from,n.to))}setSelection(e){let{main:n}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),r=this.toContextPos(n.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:n}=e.selection.main;return!(this.from>0&&n-this.from<500||this.to<e.doc.length&&this.to-n<500||this.to-this.from>1e4*3)}toEditorPos(e,n=this.to-this.from){e=Math.min(e,n);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let n=this.composing;return n&&n.drifted?n.contextBase+(e-n.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},H=class t{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var n;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||RU(e.parent)||document,this.viewState=new Lp(this,e.state||De.create(e)),e.scrollTo&&e.scrollTo.is(hp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(ia).map(r=>new Mu(r));for(let r of this.plugins)r.update(this);this.observer=new o1(this),this.inputState=new Kv(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Dp(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((n=document.fonts)===null||n===void 0)&&n.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let n=e.length==1&&e[0]instanceof dt?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,i=!1,r,s=this.state;for(let h of e){if(h.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=h.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(h=>h.annotation(LD))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=ID(s,o),a||(l=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(De.phrases)!=this.state.facet(De.phrases))return this.setState(s);r=Cp.create(this,s,e),r.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,{x:m,y:g}=this.state.facet(t.cursorScrollMargin);f=new Du(d.empty?d:N.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,m)}for(let d of h.effects)d.is(hp)&&(f=d.value.clip(this.state))}this.viewState.update(r,f),this.bidiCache=Ip.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),n=this.docView.update(r),this.state.facet(Ou)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(h=>h.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(yp)!=r.state.facet(yp)&&(this.viewState.mustMeasureContent=!0),(n||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!r.empty)for(let h of this.state.facet(Lv))try{h(r)}catch(d){Sn(this.state,d,"update listener")}(a||u)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),u&&!CD(this,u)&&c.force&&aa(this.contentDOM,c.key,c.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 i of this.plugins)i.destroy(this);this.viewState=new Lp(this,e),this.plugins=e.facet(ia).map(i=>new Mu(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Dp(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(ia),i=e.state.facet(ia);if(n!=i){let r=[];for(let s of i){let o=n.indexOf(s);if(o<0)r.push(new Mu(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);n!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(i){Sn(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let n=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(nD(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();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 c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(d=>{try{return d.read(this)}catch(m){return Sn(this.state,m),FE}}),f=Cp.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),h&&this.docViewUpdate());for(let d=0;d<c.length;d++)if(u[d]!=FE)try{let m=c[d];m.write&&m.write(u[d],this)}catch(m){Sn(this.state,m)}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,o=-1;continue}else{let m=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((m>1||m<-1)&&!(L.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+m,i?i.scrollTop+=m:this.win.scrollBy(0,m),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let l of this.state.facet(Lv))l(n)}get themeClasses(){return r1+" "+(this.state.facet(i1)?PD:qD)+" "+this.state.facet(yp)}updateAttrs(){let e=jE(this,vD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(kr)?"true":"false",class:"cm-content",style:`${L.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),jE(this,b1,n);let i=this.observer.ignore(()=>{let r=xE(this.contentDOM,this.contentAttrs,n),s=xE(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=n,i}showAnnouncements(e){let n=!0;for(let i of e)for(let r of i.effects)if(r.is(t.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Ou);let e=this.state.facet(t.cspNonce);Hn.mount(this.root,this.styleModules.concat(PF).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.plugin!=e)&&this.pluginMap.set(e,n=this.plugins.find(i=>i.plugin==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,i){return Sv(this,e,CE(this,e,n,i))}moveByGroup(e,n){return Sv(this,e,CE(this,e,n,i=>aF(this,e.head,i)))}visualLineSide(e,n){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[n?i.length-1:0];return N.cursor(s.side(n,r)+e.from,s.forward(!n,r)?1:-1)}moveToLineBoundary(e,n,i=!0){return lF(this,e,n,i)}moveVertically(e,n,i){return Sv(this,e,cF(this,e,n,i))}domAtPos(e,n=1){return this.docView.domAtPos(e,n)}posAtDOM(e,n=0){return this.docView.posFromDOM(e,n)}posAtCoords(e,n=!0){this.readMeasured();let i=jv(this,e,n);return i&&i.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),jv(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),s=r[jn.find(r,e-i.from,-1,n)];return this.docView.coordsAt(e,n,s.dir==_e.RTL)}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(gD)||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>UF)return aD(e.length);let n=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||lD(s.isolates,i=AE(this,e))))return s.order;i||(i=AE(this,e));let r=zU(e.text,n,i);return this.bidiCache.push(new Ip(e.from,e.to,n,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||L.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{tD(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,n={}){var i,r,s,o;return hp.of(new Du(typeof e=="number"?N.cursor(e):e,(i=n.y)!==null&&i!==void 0?i:"nearest",(r=n.x)!==null&&r!==void 0?r:"nearest",(s=n.yMargin)!==null&&s!==void 0?s:5,(o=n.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:n}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return hp.of(new Du(N.cursor(i.from),"start","start",i.top-e,n,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Vn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Vn.define(()=>({}),{eventObservers:e})}static theme(e,n){let i=Hn.newName(),r=[yp.of(i),Ou.of(s1(`.${i}`,e))];return n&&n.dark&&r.push(i1.of(!0)),r}static baseTheme(e){return Au.lowest(Ou.of(s1("."+r1,e,zD)))}static findFromDOM(e){var n;let i=e.querySelector(".cm-content"),r=i&&ze.get(i)||ze.get(e);return((n=r?.root)===null||n===void 0?void 0:n.view)||null}};H.styleModule=Ou;H.inputHandler=pD;H.clipboardInputFilter=g1;H.clipboardOutputFilter=y1;H.scrollHandler=yD;H.focusChangeEffect=mD;H.perLineTextDirection=gD;H.exceptionSink=dD;H.updateListener=Lv;H.editable=kr;H.mouseSelectionStyle=hD;H.dragMovesSelection=fD;H.clickAddsSelectionRange=uD;H.decorations=jp;H.blockWrappers=SD;H.outerDecorations=v1;H.atomicRanges=Hu;H.bidiIsolatedRanges=xD;H.cursorScrollMargin=I.define({combine:t=>{let e=5,n=5;for(let i of t)typeof i=="number"?e=n=i:{x:e,y:n}=i;return{x:e,y:n}}});H.scrollMargins=wD;H.darkTheme=i1;H.cspNonce=I.define({combine:t=>t.length?t[0]:""});H.contentAttributes=b1;H.editorAttributes=vD;H.lineWrapping=H.contentAttributes.of({class:"cm-lineWrapping"});H.announce=he.define();var UF=4096,FE={},Ip=class t{constructor(e,n,i,r,s,o){this.from=e,this.to=n,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:_e.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!n.touchesRange(o.from,o.to)&&i.push(new t(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function jE(t,e,n){for(let i=t.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(t):s;o&&d1(o,n)}return n}var FF=L.mac?"mac":L.windows?"win":L.linux?"linux":"key";function jF(t,e){let n=t.split(/-(?!$)/),i=n[n.length-1];i=="Space"&&(i=" ");let r,s,o,l;for(let a=0;a<n.length-1;++a){let c=n[a];if(/^(cmd|meta|m)$/i.test(c))l=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function bp(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}var VF=Au.default(H.domEventHandlers({keydown(t,e){return GF($F(e.state),t,e,"editor")}})),w1=I.define({enables:VF}),VE=new WeakMap;function $F(t){let e=t.facet(w1),n=VE.get(e);return n||VE.set(e,n=KF(e.reduce((i,r)=>i.concat(r),[]))),n}var vs=null,YF=4e3;function KF(t,e=FF){let n=Object.create(null),i=Object.create(null),r=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,c,u)=>{var f,h;let d=n[o]||(n[o]=Object.create(null)),m=l.split(/ (?!$)/).map(p=>jF(p,e));for(let p=1;p<m.length;p++){let y=m.slice(0,p).join(" ");r(y,!0),d[y]||(d[y]={preventDefault:!0,stopPropagation:!1,run:[v=>{let S=vs={view:v,prefix:y,scope:o};return setTimeout(()=>{vs==S&&(vs=null)},YF),!0}]})}let g=m.join(" ");r(g,!1);let b=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&&b.run.push(a),c&&(b.preventDefault=!0),u&&(b.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of l){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let h in u)u[h].run.push(d=>f(d,a1))}let a=o[e]||o.key;if(a)for(let c of l)s(c,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return n}var a1=null;function GF(t,e,n,i){a1=e;let r=gE(e),s=eE(r,0),o=tE(s)==r.length&&r!=" ",l="",a=!1,c=!1,u=!1;vs&&vs.view==n&&vs.scope==i&&(l=vs.prefix+" ",MD.indexOf(e.keyCode)<0&&(c=!0,vs=null));let f=new Set,h=b=>{if(b){for(let p of b.run)if(!f.has(p)&&(f.add(p),p(n)))return b.stopPropagation&&(u=!0),!0;b.preventDefault&&(b.stopPropagation&&(u=!0),c=!0)}return!1},d=t[i],m,g;return d&&(h(d[l+bp(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(L.windows&&e.ctrlKey&&e.altKey)&&!(L.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=wr[e.keyCode])&&m!=r?(h(d[l+bp(m,e,!0)])||e.shiftKey&&(g=ta[e.keyCode])!=r&&g!=m&&h(d[l+bp(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&h(d[l+bp(r,e,!0)])&&(a=!0),!a&&h(d._any)&&(a=!0)),c&&(a=!0),a&&u&&e.stopPropagation(),a1=null,a}var $fe=/x/.unicode!=null?"gu":"g";var vp="-10000px",Bp=class{constructor(e,n,i,r){this.facet=n,this.createTooltipView=i,this.removeTooltipView=r,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=i(o,s))}update(e,n){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=n?[]:null;for(let a=0;a<s.length;a++){let c=s[a],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let h=this.tooltips[f];h&&h.create==c.create&&(u=f)}if(u<0)o[a]=this.createTooltipView(c,a?o[a-1]:null),l&&(l[a]=!!c.above);else{let f=o[a]=this.tooltipViews[u];l&&(l[a]=n[u]),f.update&&f.update(e)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return n&&(l.forEach((a,c)=>n[c]=a),n.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}};function QF(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var wv=I.define({combine:t=>{var e,n,i;return{position:L.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(r=>r.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((i=t.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||QF}}}),$E=new WeakMap,HD=Vn.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(wv);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.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Bp(t,$p,(n,i)=>this.createTooltip(n,i),n=>{this.resizeObserver&&this.resizeObserver.unobserve(n.dom),n.dom.remove()}),this.above=this.manager.tooltips.map(n=>!!n.above),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,i=t.state.facet(wv);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;n=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),i=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=vp,n.dom.style.left="0px",this.container.insertBefore(n.dom,i),n.mount&&n.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(n.dom),n}destroy(){var t,e,n;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(t=i.destroy)===null||t===void 0||t.call(i);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,n=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(L.safari){let o=s.getBoundingClientRect();n=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else n=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(n||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let i=this.view.scrollDOM.getBoundingClientRect(),r=S1(this.view);return{visible:{left:i.left+r.left,top:i.top+r.top,right:i.right-r.right,bottom:i.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(wv).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}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{visible:n,space:i,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],c=this.manager.tooltipViews[l],{dom:u}=c,f=t.pos[l],h=t.size[l];if(!f||a.clip!==!1&&(f.bottom<=Math.max(n.top,i.top)||f.top>=Math.min(n.bottom,i.bottom)||f.right<Math.max(n.left,i.left)-.1||f.left>Math.min(n.right,i.right)+.1)){u.style.top=vp;continue}let d=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=d?7:0,g=h.right-h.left,b=(e=$E.get(c))!==null&&e!==void 0?e:h.bottom-h.top,p=c.offset||WF,y=this.view.textDirection==_e.LTR,v=h.width>i.right-i.left?y?i.left:i.right-h.width:y?Math.max(i.left,Math.min(f.left-(d?14:0)+p.x,i.right-g)):Math.min(Math.max(i.left,f.left-g+(d?14:0)-p.x),i.right-g),S=this.above[l];!a.strictSide&&(S?f.top-b-m-p.y<i.top:f.bottom+b+m+p.y>i.bottom)&&S==i.bottom-f.bottom>f.top-i.top&&(S=this.above[l]=!S);let w=(S?f.top-i.top:i.bottom-f.bottom)-m;if(w<b&&c.resize!==!1){if(w<this.view.defaultLineHeight){u.style.top=vp;continue}$E.set(c,b),u.style.height=(b=w)/s+"px"}else u.style.height&&(u.style.height="");let O=S?f.top-b-m-p.y:f.bottom+m+p.y,k=v+g;if(c.overlap!==!0)for(let A of o)A.left<k&&A.right>v&&A.top<O+b&&A.bottom>O&&(O=S?A.top-b-2-m:A.bottom+m+2);if(this.position=="absolute"?(u.style.top=(O-t.parent.top)/s+"px",YE(u,(v-t.parent.left)/r)):(u.style.top=O/s+"px",YE(u,v/r)),d){let A=f.left+(y?p.x:-p.x)-(v+14-7);d.style.left=A/r+"px"}c.overlap!==!0&&o.push({left:v,top:O,right:k,bottom:O+b}),u.classList.toggle("cm-tooltip-above",S),u.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.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=vp}},{eventObservers:{scroll(){this.maybeMeasure()}}});function YE(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}var XF=H.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),WF={x:0,y:0},$p=I.define({enables:[HD,XF]}),qp=I.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])}),Pp=class t{static create(e){return new t(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Bp(e,qp,(n,i)=>this.createHostedView(n,i),n=>n.dom.remove())}createHostedView(e,n){let i=e.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}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 i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(n===void 0)n=r;else if(n!==r)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")}},ZF=$p.compute([qp],t=>{let e=t.facet(qp);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var i;return(i=n.end)!==null&&i!==void 0?i:n.pos})),create:Pp.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),JF=I.define(),c1=class{constructor(e,n,i,r,s,o){this.view=e,this.source=n,this.field=i,this.locked=r,this.setHover=s,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(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:n}=this,i=e.docView.tile.nearest(n.target);if(!i)return;let r,s=1;if(i.isWidget())r=i.posAtStart;else{if(r=e.posAtCoords(n),r==null)return;let o=e.coordsAtPos(r);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let l=e.bidiSpans(e.state.doc.lineAt(r)).find(c=>c.from<=r&&c.to>=r),a=l&&l.dir==_e.RTL?-1:1;s=n.x<o.left?-a:a}this.activateHover(e,r,s)}activateHover(e,n,i,r){let s=this.source(e,n,i),o=l=>{if(l&&!(Array.isArray(l)&&!l.length)){let a=Array.isArray(l)?l:[l];r&&this.locked.set(a,r),e.dispatch({effects:this.setHover.of(a)})}};if(s&&"then"in s){let l=this.pending={pos:n};s.then(a=>{this.pending==l&&(this.pending=null,o(a))},a=>Sn(e.state,a,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(HD),n=e?e.manager.tooltips.findIndex(i=>i.create==Pp.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,i;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:r,tooltip:s}=this;if(r.length&&!this.locked.has(r)&&s&&!ej(s.dom,e)||this.pending){let{pos:o}=r[0]||this.pending,l=(i=(n=r[0])===null||n===void 0?void 0:n.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!tj(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:n}=this;if(n.length&&!this.locked.has(n)){let{tooltip:i}=this;i&&i.dom.contains(e.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=i=>{e.removeEventListener("mouseleave",n);let{active:r}=this;r.length&&!this.locked.has(r)&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",n)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},Sp=4;function ej(t,e){let{left:n,right:i,top:r,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();r=Math.min(l.top,r),s=Math.max(l.bottom,s)}return e.clientX>=n-Sp&&e.clientX<=i+Sp&&e.clientY>=r-Sp&&e.clientY<=s+Sp}function tj(t,e,n,i,r,s){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>i||o.right<i||o.top>r||Math.min(o.bottom,l)<r)return!1;let a=t.posAtCoords({x:i,y:r},!1);return a>=e&&a<=n}function UD(t,e={}){let n=he.define(),i=new WeakMap,r=_t.define({create(){return[]},update(o,l){let a=i.get(o);if(o.length&&(e.hideOnChange&&(l.docChanged||l.selection)?o=[]:a&&a(l)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(l,c)))),l.docChanged&&o.length){let c=[];for(let u of o){let f=l.changes.mapPos(u.pos,-1,Vt.TrackDel);if(f!=null){let h=Object.assign(Object.create(null),u);h.pos=f,h.end!=null&&(h.end=l.changes.mapPos(h.end)),c.push(h)}}o=c}for(let c of l.effects)c.is(n)&&(o=c.value,a=void 0),(c.is(nj)&&!c.value||c.value==r)&&(o=[]);return o.length&&a&&i.set(o,a),o},provide:o=>qp.from(o)}),s=Vn.define(o=>new c1(o,t,r,i,n,e.hoverTime||300));return{active:r,extension:[r,s,JF.of(s),ZF]}}var nj=he.define();var KE=I.define({combine(t){let e,n;for(let i of t)e=e||i.topContainer,n=n||i.bottomContainer;return{topContainer:e,bottomContainer:n}}});var ij=Vn.fromClass(class{constructor(t){this.input=t.state.facet(zp),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(KE);this.top=new sa(t,!0,e.topContainer),this.bottom=new sa(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(KE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new sa(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new sa(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(zp);if(n!=this.input){let i=n.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of i){let c=this.specs.indexOf(a),u;c<0?(u=a(t.view),l.push(u)):(u=this.panels[c],u.update&&u.update(t)),r.push(u),(u.top?s:o).push(u)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>H.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})}),sa=class{constructor(e,n,i){this.view=e,this.top=n,this.container=i,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=GE(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=GE(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 GE(t){let e=t.nextSibling;return t.remove(),e}var zp=I.define({enables:ij});var $n=class extends zi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};$n.prototype.elementClass="";$n.prototype.toDOM=void 0;$n.prototype.mapMode=Vt.TrackBefore;$n.prototype.startSide=$n.prototype.endSide=-1;$n.prototype.point=!0;var kv=I.define(),rj=I.define(),sj={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>de.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},Lu=I.define();function k1(t){return[FD(),Lu.of({...sj,...t})]}var u1=I.define({combine:t=>t.some(e=>e)});function FD(t){let e=[oj];return t&&t.fixed===!1&&e.push(u1.of(!0)),e}var oj=Vn.fromClass(class{constructor(t){this.view=t,this.domAfter=null,this.prevViewport=t.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=t.state.facet(Lu).map(e=>new Hp(t,e)),this.fixed=!t.state.facet(u1);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,n=t.view.viewport,i=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(i<(n.to-n.from)*.8)}if(t.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(u1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;t&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let n=de.iter(this.view.state.facet(kv),this.view.viewport.from),i=[],r=this.gutters.map(s=>new h1(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let l of s.type)if(l.type==rn.Text&&o){f1(n,i,l.from);for(let a of r)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of r)a.widget(this.view,l)}else if(s.type==rn.Text){f1(n,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(Lu),n=t.state.facet(Lu),i=t.docChanged||t.heightChanged||t.viewportChanged||!de.eq(t.startState.facet(kv),t.state.facet(kv),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let r of this.gutters)r.update(t)&&(i=!0);else{i=!0;let r=[];for(let s of n){let o=e.indexOf(s);o<0?r.push(new Hp(this.view,s)):(this.gutters[o].update(t),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>H.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let i=n.dom.offsetWidth*e.scaleX,r=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==_e.LTR?{left:i,right:r}:{right:i,left:r}})});function QE(t){return Array.isArray(t)?t:[t]}function f1(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}var h1=class{constructor(e,n,i){this.gutter=e,this.height=i,this.i=0,this.cursor=de.iter(e.markers,n.from)}addElement(e,n,i){let{gutter:r}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==r.elements.length){let l=new Up(e,o,s,i);r.elements.push(l),r.dom.appendChild(l.dom)}else r.elements[this.i].update(e,o,s,i);this.height=n.bottom,this.i++}line(e,n,i){let r=[];f1(this.cursor,r,n.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,n,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,r)}widget(e,n){let i=this.gutter.config.widgetMarker(e,n.widget,n),r=i?[i]:null;for(let s of e.state.facet(rj)){let o=s(e,n.widget,n);o&&(r||(r=[])).push(o)}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()}}},Hp=class{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 i in n.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=r.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[i](e,l,r)&&r.preventDefault()});this.markers=QE(n.markers(e)),n.initialSpacer&&(this.spacer=new Up(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=QE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!de.eq(this.markers,n,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Up=class{constructor(e,n,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,i,r)}update(e,n,i,r){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),lj(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,n){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let l=o,a=s<n.length?n[s++]:null,c=!1;if(a){let u=a.elementClass;u&&(i+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,c=!0;break}}else l=this.markers.length;for(;o<l;){let u=this.markers[o++];if(u.toDOM){u.destroy(r);let f=r.nextSibling;r.remove(),r=f}}if(!a)break;a.toDOM&&(c?r=r.nextSibling:this.dom.insertBefore(a.toDOM(e),r)),c&&o++}this.dom.className=i,this.markers=n}destroy(){this.setMarkers(null,[])}};function lj(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}var aj=I.define(),cj=I.define(),oa=I.define({combine(t){return bs(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let i=Object.assign({},e);for(let r in n){let s=i[r],o=n[r];i[r]=s?(l,a,c)=>s(l,a,c)||o(l,a,c):o}return i}})}}),Iu=class extends $n{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Av(t,e){return t.state.facet(oa).formatNumber(e,t.state)}var uj=Lu.compute([oa],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(aj)},lineMarker(e,n,i){return i.some(r=>r.toDOM)?null:new Iu(Av(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,i)=>{for(let r of e.state.facet(cj)){let s=r(e,n,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(oa)!=e.state.facet(oa),initialSpacer(e){return new Iu(Av(e,XE(e.state.doc.lines)))},updateSpacer(e,n){let i=Av(n.view,XE(n.view.state.doc.lines));return i==e.number?e:new Iu(i)},domEventHandlers:t.facet(oa).domEventHandlers,side:"before"}));function jD(t={}){return[oa.of(t),FD(),uj]}function XE(t){let e=9;for(;e<t;)e=e*10+9;return e}var fj=0,Uu=class{constructor(e,n){this.from=e,this.to=n}},Q=class{constructor(e={}){this.id=fj++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Lt.match(e)),n=>{let i=e(n);return i===void 0?null:[this,i]}}};Q.closedBy=new Q({deserialize:t=>t.split(" ")});Q.openedBy=new Q({deserialize:t=>t.split(" ")});Q.group=new Q({deserialize:t=>t.split(" ")});Q.isolate=new Q({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Q.contextHash=new Q({perNode:!0});Q.lookAhead=new Q({perNode:!0});Q.mounted=new Q({perNode:!0});var bo=class{constructor(e,n,i,r=!1){this.tree=e,this.overlay=n,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[Q.mounted.id]}},hj=Object.create(null),Lt=class t{constructor(e,n,i,r=0){this.name=e,this.props=n,this.id=i,this.flags=r}static define(e){let n=e.props&&e.props.length?Object.create(null):hj,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new t(e.name||"",n,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Q.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let i in e)for(let r of i.split(" "))n[r]=e[i];return i=>{for(let r=i.prop(Q.group),s=-1;s<(r?r.length:0);s++){let o=n[s<0?i.name:r[s]];if(o)return o}}}};Lt.none=new Lt("",Object.create(null),0,8);var Fu=class t{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 i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let l=o[1],a=o[0];a.combine&&a.id in r&&(l=a.combine(r[a.id],l)),r[a.id]=l}}n.push(r?new Lt(i.name,r,i.id,i.flags):i)}return new t(n)}},Yp=new WeakMap,VD=new WeakMap,He;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays",t[t.EnterBracketed=16]="EnterBracketed"})(He||(He={}));var Ye=class t{constructor(e,n,i,r,s){if(this.type=e,this.children=n,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,l]of s)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=bo.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let i of this.children){let r=i.toString();r&&(n&&(n+=","),n+=r)}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 $u(this.topNode,e)}cursorAt(e,n=0,i=0){let r=Yp.get(this)||this.topNode,s=new $u(r);return s.moveTo(e,n),Yp.set(this,s._tree),s}get topNode(){return new Fi(this,0,0,null)}resolve(e,n=0){let i=ju(Yp.get(this)||this.topNode,e,n,!1);return Yp.set(this,i),i}resolveInner(e,n=0){let i=ju(VD.get(this)||this.topNode,e,n,!0);return VD.set(this,i),i}resolveStack(e,n=0){return dj(this,e,n)}iterate(e){let{enter:n,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,l=(o&He.IncludeAnonymous)>0;for(let a=this.cursor(o|He.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||n(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;c=!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:M1(Lt.none,this.children,this.positions,0,this.children.length,0,this.length,(n,i,r)=>new t(this.type,n,i,r,this.propValues),e.makeTree||((n,i,r)=>new t(Lt.none,n,i,r)))}static build(e){return pj(e)}};Ye.empty=new Ye(Lt.none,[],[],0);var A1=class t{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 t(this.buffer,this.index)}},ks=class t{constructor(e,n,i){this.buffer=e,this.length=n,this.set=i}get type(){return Lt.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],i=this.buffer[e+3],r=this.set.types[n],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,i,r,s){let{buffer:o}=this,l=-1;for(let a=e;a!=n&&!(KD(s,r,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(e,n,i){let r=this.buffer,s=new Uint16Array(n-e),o=0;for(let l=e,a=0;l<n;){s[a++]=r[l++],s[a++]=r[l++]-i;let c=s[a++]=r[l++]-i;s[a++]=r[l++]-e,o=Math.max(o,c)}return new t(s,o,this.set)}};function KD(t,e,n,i){switch(t){case-2:return n<e;case-1:return i>=e&&n<e;case 0:return n<e&&i>e;case 1:return n<=e&&i>e;case 2:return i>e;case 4:return!0}}function ju(t,e,n,i){for(var r;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!i&&t instanceof Fi&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=i?0:He.IgnoreOverlays;if(i)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof Fi&&o.index<0&&((r=l.enter(e,n,s))===null||r===void 0?void 0:r.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}var Gp=class{cursor(e=0){return new $u(this,e)}getChild(e,n=null,i=null){let r=$D(this,e,n,i);return r.length?r[0]:null}getChildren(e,n=null,i=null){return $D(this,e,n,i)}resolve(e,n=0){return ju(this,e,n,!1)}resolveInner(e,n=0){return ju(this,e,n,!0)}matchContext(e){return O1(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),i=this;for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(i=n,n=r.prevSibling):n=r}return i}get node(){return this}get next(){return this.parent}},Fi=class t extends Gp{constructor(e,n,i,r){super(),this._tree=e,this.from=n,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,i,r,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=n>0?l.length:-1;e!=c;e+=n){let u=l[e],f=a[e]+o.from,h;if(!(!(s&He.EnterBracketed&&u instanceof Ye&&(h=bo.get(u))&&!h.overlay&&h.bracketed&&i>=f&&i<=f+u.length)&&!KD(r,i,f,f+u.length))){if(u instanceof ks){if(s&He.ExcludeBuffers)continue;let d=u.findChild(0,u.buffer.length,n,i-f,r);if(d>-1)return new Vu(new T1(o,u,e,f),null,d)}else if(s&He.IncludeAnonymous||!u.type.isAnonymous||D1(u)){let d;if(!(s&He.IgnoreMounts)&&(d=bo.get(u))&&!d.overlay)return new t(d.tree,f,e,o);let m=new t(u,f,e,o);return s&He.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(n<0?u.children.length-1:0,n,i,r,s)}}}if(s&He.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+n:e=n<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,n,i=0){let r;if(!(i&He.IgnoreOverlays)&&(r=bo.get(this._tree))&&r.overlay){let s=e-this.from,o=i&He.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((n>0||o?l<=s:l<s)&&(n<0||o?a>=s:a>s))return new t(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function $D(t,e,n,i){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=r.type.is(n),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function O1(t,e,n=e.length-1){for(let i=t;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[n]&&e[n]!=i.name)return!1;n--}}return!0}var T1=class{constructor(e,n,i,r){this.parent=e,this.buffer=n,this.index=i,this.start=r}},Vu=class t extends Gp{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,i){super(),this.context=e,this._parent=n,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,n,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.context.start,i);return s<0?null:new t(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,n,i=0){if(i&He.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new t(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new t(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 t(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),n.push(0)}return new Ye(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function GD(t){if(!t.length)return null;let e=0,n=t[0];for(let s=1;s<t.length;s++){let o=t[s];(o.from>n.from||o.to<n.to)&&(n=o,e=s)}let i=n instanceof Fi&&n.index<0?null:n.parent,r=t.slice();return i?r[e]=i:r.splice(e,1),new C1(r,n)}var C1=class{constructor(e,n){this.heads=e,this.node=n}get next(){return GD(this.heads)}};function dj(t,e,n){let i=t.resolveInner(e,n),r=null;for(let s=i instanceof Fi?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,n)),s=o}else{let o=bo.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new Fi(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(ju(l,e,n,!1))}}return r?GD(r):i}var $u=class{get name(){return this.type.name}constructor(e,n=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=n&~He.EnterBracketed,e instanceof Fi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=n||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof Fi?(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,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,n-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,i=this.mode){return this.buffer?i&He.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&He.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&He.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,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(n.findChild(r,this.index,-1,0,4))}else{let r=n.buffer[this.index+3];if(r<(i<0?n.buffer.length:n.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:i}=r)}else({index:n,_parent:i}=this._tree);for(;i;{index:n,_parent:i}=i)if(n>-1)for(let s=n+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let l=i._tree.children[s];if(this.mode&He.IncludeAnonymous||l instanceof ks||!l.type.isAnonymous||D1(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,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;n=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)n=new Vu(this.buffer,n,this.stack[r]);return this.bufferNode=new Vu(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&n&&n(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return O1(this.node.parent,e);let{buffer:n}=this.buffer,{types:i}=n.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return O1(this._tree,e,r);let o=i[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}};function D1(t){return t.children.some(e=>e instanceof ks||!e.type.isAnonymous||D1(e))}function pj(t){var e;let{buffer:n,nodeSet:i,maxBufferLength:r=1024,reused:s=[],minRepeatType:o=i.types.length}=t,l=Array.isArray(n)?new A1(n,n.length):n,a=i.types,c=0,u=0;function f(w,O,k,A,M,T){let{id:R,start:C,end:V,size:$}=l,Te=u,Gt=c;if($<0)if(l.next(),$==-1){let kt=s[R];k.push(kt),A.push(C-w);return}else if($==-3){c=R;return}else if($==-4){u=R;return}else throw new RangeError(`Unrecognized record size: ${$}`);let vi=a[R],ye,at,Qn=C-w;if(V-C<=r&&(at=b(l.pos-O,M))){let kt=new Uint16Array(at.size-at.skip),Fe=l.pos-at.size,mt=kt.length;for(;l.pos>Fe;)mt=p(at.start,kt,mt);ye=new ks(kt,V-at.start,i),Qn=at.start-w}else{let kt=l.pos-$;l.next();let Fe=[],mt=[],gt=R>=o?R:-1,on=0,ln=V;for(;l.pos>kt;)gt>=0&&l.id==gt&&l.size>=0?(l.end<=ln-r&&(m(Fe,mt,C,on,l.end,ln,gt,Te,Gt),on=Fe.length,ln=l.end),l.next()):T>2500?h(C,kt,Fe,mt):f(C,kt,Fe,mt,gt,T+1);if(gt>=0&&on>0&&on<Fe.length&&m(Fe,mt,C,on,C,ln,gt,Te,Gt),Fe.reverse(),mt.reverse(),gt>-1&&on>0){let Xn=d(vi,Gt);ye=M1(vi,Fe,mt,0,Fe.length,0,V-C,Xn,Xn)}else ye=g(vi,Fe,mt,V-C,Te-V,Gt)}k.push(ye),A.push(Qn)}function h(w,O,k,A){let M=[],T=0,R=-1;for(;l.pos>O;){let{id:C,start:V,end:$,size:Te}=l;if(Te>4)l.next();else{if(R>-1&&V<R)break;R<0&&(R=$-r),M.push(C,V,$),T++,l.next()}}if(T){let C=new Uint16Array(T*4),V=M[M.length-2];for(let $=M.length-3,Te=0;$>=0;$-=3)C[Te++]=M[$],C[Te++]=M[$+1]-V,C[Te++]=M[$+2]-V,C[Te++]=Te;k.push(new ks(C,M[2]-V,i)),A.push(V-w)}}function d(w,O){return(k,A,M)=>{let T=0,R=k.length-1,C,V;if(R>=0&&(C=k[R])instanceof Ye){if(!R&&C.type==w&&C.length==M)return C;(V=C.prop(Q.lookAhead))&&(T=A[R]+C.length+V)}return g(w,k,A,M,T,O)}}function m(w,O,k,A,M,T,R,C,V){let $=[],Te=[];for(;w.length>A;)$.push(w.pop()),Te.push(O.pop()+k-M);w.push(g(i.types[R],$,Te,T-M,C-T,V)),O.push(M-k)}function g(w,O,k,A,M,T,R){if(T){let C=[Q.contextHash,T];R=R?[C].concat(R):[C]}if(M>25){let C=[Q.lookAhead,M];R=R?[C].concat(R):[C]}return new Ye(w,O,k,A,R)}function b(w,O){let k=l.fork(),A=0,M=0,T=0,R=k.end-r,C={size:0,start:0,skip:0};e:for(let V=k.pos-w;k.pos>V;){let $=k.size;if(k.id==O&&$>=0){C.size=A,C.start=M,C.skip=T,T+=4,A+=4,k.next();continue}let Te=k.pos-$;if($<0||Te<V||k.start<R)break;let Gt=k.id>=o?4:0,vi=k.start;for(k.next();k.pos>Te;){if(k.size<0)if(k.size==-3||k.size==-4)Gt+=4;else break e;else k.id>=o&&(Gt+=4);k.next()}M=vi,A+=$,T+=Gt}return(O<0||A==w)&&(C.size=A,C.start=M,C.skip=T),C.size>4?C:void 0}function p(w,O,k){let{id:A,start:M,end:T,size:R}=l;if(l.next(),R>=0&&A<o){let C=k;if(R>4){let V=l.pos-(R-4);for(;l.pos>V;)k=p(w,O,k)}O[--k]=C,O[--k]=T-w,O[--k]=M-w,O[--k]=A}else R==-3?c=A:R==-4&&(u=A);return k}let y=[],v=[];for(;l.pos>0;)f(t.start||0,t.bufferStart||0,y,v,-1,0);let S=(e=t.length)!==null&&e!==void 0?e:y.length?v[0]+y[0].length:0;return new Ye(a[t.topID],y.reverse(),v.reverse(),S)}var YD=new WeakMap;function Kp(t,e){if(!t.isAnonymous||e instanceof ks||e.type!=t)return 1;let n=YD.get(e);if(n==null){n=1;for(let i of e.children){if(i.type!=t||!(i instanceof Ye)){n=1;break}n+=Kp(t,i)}YD.set(e,n)}return n}function M1(t,e,n,i,r,s,o,l,a){let c=0;for(let m=i;m<r;m++)c+=Kp(t,e[m]);let u=Math.ceil(c*1.5/8),f=[],h=[];function d(m,g,b,p,y){for(let v=b;v<p;){let S=v,w=g[v],O=Kp(t,m[v]);for(v++;v<p;v++){let k=Kp(t,m[v]);if(O+k>=u)break;O+=k}if(v==S+1){if(O>u){let k=m[S];d(k.children,k.positions,0,k.children.length,g[S]+y);continue}f.push(m[S])}else{let k=g[v-1]+m[v-1].length-w;f.push(M1(t,m,g,S,v,w,k,null,a))}h.push(w+y-s)}}return d(e,n,i,r,0),(l||a)(f,h,o)}var vo=class t{constructor(e,n,i,r,s=!1,o=!1){this.from=e,this.to=n,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],i=!1){let r=[new t(0,e.length,e,0,!1,i)];for(let s of n)s.to>e.length&&r.push(s);return r}static applyChanges(e,n,i=128){if(!n.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,c=0;;l++){let u=l<n.length?n[l]:null,f=u?u.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let h=o;if(a>=h.from||f<=h.to||c){let d=Math.max(h.from,a)-c,m=Math.min(h.to,f)-c;h=d>=m?null:new t(d,m,h.tree,h.offset+c,l>0,!!u)}if(h&&r.push(h),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;a=u.toA,c=u.toA-u.toB}return r}},pa=class{startParse(e,n,i){return typeof e=="string"&&(e=new E1(e)),i=i?i.length?i.map(r=>new Uu(r.from,r.to)):[new Uu(0,0)]:[new Uu(0,e.length)],this.createParse(e,n||[],i)}parse(e,n,i){let r=this.startParse(e,n,i);for(;;){let s=r.advance();if(s)return s}}},E1=class{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)}};var Wfe=new Q({perNode:!0});var mj=0,hi=class t{constructor(e,n,i,r){this.name=e,this.set=n,this.base=i,this.modified=r,this.id=mj++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let i=typeof e=="string"?e:"?";if(e instanceof t&&(n=e),n?.base)throw new Error("Can not derive from a modified tag");let r=new t(i,[],null,[]);if(r.set.push(r),n)for(let s of n.set)r.set.push(s);return r}static defineModifier(e){let n=new Zp(e);return i=>i.modified.indexOf(n)>-1?i:Zp.get(i.base||i,i.modified.concat(n).sort((r,s)=>r.id-s.id))}},gj=0,Zp=class t{constructor(e){this.name=e,this.instances=[],this.id=gj++}static get(e,n){if(!n.length)return e;let i=n[0].instances.find(l=>l.base==e&&yj(n,l.modified));if(i)return i;let r=[],s=new hi(e.name,r,e,n);for(let l of n)l.instances.push(s);let o=bj(n);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(t.get(l,a));return s}};function yj(t,e){return t.length==e.length&&t.every((n,i)=>n==e[i])}function bj(t){let e=[[]];for(let n=0;n<t.length;n++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[n]));return e.sort((n,i)=>i.length-n.length)}function ma(t){let e=Object.create(null);for(let n in t){let i=t[n];Array.isArray(i)||(i=[i]);for(let r of n.split(" "))if(r){let s=[],o=2,l=r;for(let f=0;;){if(l=="..."&&f>0&&f+3==r.length){o=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!h)throw new RangeError("Invalid path: "+r);if(s.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==r.length)break;let d=r[f++];if(f==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(f)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let u=new xo(i,o,a>0?s.slice(0,a):null);e[c]=u.sort(e[c])}}return WD.add(e)}var WD=new Q({combine(t,e){let n,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),n&&n.mode==r.mode&&!r.context&&!n.context)continue;let s=new xo(r.tags,r.mode,r.context);n?n.next=s:i=s,n=s}return i}}),xo=class{constructor(e,n,i,r){this.tags=e,this.mode=n,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};xo.empty=new xo([],2,null);function L1(t,e){let n=Object.create(null);for(let s of t)if(!Array.isArray(s.tag))n[s.tag.id]=s.class;else for(let o of s.tag)n[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let l of s)for(let a of l.set){let c=n[a.id];if(c){o=o?o+" "+c:c;break}}return o},scope:i}}function vj(t,e){let n=null;for(let i of t){let r=i.style(e);r&&(n=n?n+" "+r:r)}return n}function ZD(t,e,n,i=0,r=t.length){let s=new N1(i,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),i,r,"",s.highlighters),s.flush(r)}var N1=class{constructor(e,n,i){this.at=e,this.highlighters=n,this.span=i,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,i,r,s){let{type:o,from:l,to:a}=e;if(l>=i||a<=n)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let c=r,u=Sj(e)||xo.empty,f=vj(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(n,l),c),u.opaque)return;let h=e.tree&&e.tree.prop(Q.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+l,1),m=this.highlighters.filter(b=>!b.scope||b.scope(h.tree.type)),g=e.firstChild();for(let b=0,p=l;;b++){let y=b<h.overlay.length?h.overlay[b]:null,v=y?y.from+l:a,S=Math.max(n,p),w=Math.min(i,v);if(S<w&&g)for(;e.from<w&&(this.highlightRange(e,S,w,r,s),this.startSpan(Math.min(w,e.to),c),!(e.to>=v||!e.nextSibling())););if(!y||v>i)break;p=y.to+l,p>n&&(this.highlightRange(d.cursor(),Math.max(n,y.from+l),Math.min(i,p),"",m),this.startSpan(Math.min(i,p),c))}g&&e.parent()}else if(e.firstChild()){h&&(r="");do if(!(e.to<=n)){if(e.from>=i)break;this.highlightRange(e,n,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}};function Sj(t){let e=t.type.prop(WD);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}var _=hi.define,Qp=_(),As=_(),QD=_(As),XD=_(As),Os=_(),Xp=_(Os),R1=_(Os),$i=_(),So=_($i),ji=_(),Vi=_(),_1=_(),Yu=_(_1),Wp=_(),E={comment:Qp,lineComment:_(Qp),blockComment:_(Qp),docComment:_(Qp),name:As,variableName:_(As),typeName:QD,tagName:_(QD),propertyName:XD,attributeName:_(XD),className:_(As),labelName:_(As),namespace:_(As),macroName:_(As),literal:Os,string:Xp,docString:_(Xp),character:_(Xp),attributeValue:_(Xp),number:R1,integer:_(R1),float:_(R1),bool:_(Os),regexp:_(Os),escape:_(Os),color:_(Os),url:_(Os),keyword:ji,self:_(ji),null:_(ji),atom:_(ji),unit:_(ji),modifier:_(ji),operatorKeyword:_(ji),controlKeyword:_(ji),definitionKeyword:_(ji),moduleKeyword:_(ji),operator:Vi,derefOperator:_(Vi),arithmeticOperator:_(Vi),logicOperator:_(Vi),bitwiseOperator:_(Vi),compareOperator:_(Vi),updateOperator:_(Vi),definitionOperator:_(Vi),typeOperator:_(Vi),controlOperator:_(Vi),punctuation:_1,separator:_(_1),bracket:Yu,angleBracket:_(Yu),squareBracket:_(Yu),paren:_(Yu),brace:_(Yu),content:$i,heading:So,heading1:_(So),heading2:_(So),heading3:_(So),heading4:_(So),heading5:_(So),heading6:_(So),contentSeparator:_($i),list:_($i),quote:_($i),emphasis:_($i),strong:_($i),link:_($i),monospace:_($i),strikethrough:_($i),inserted:_(),deleted:_(),changed:_(),invalid:_(),meta:Wp,documentMeta:_(Wp),annotation:_(Wp),processingInstruction:_(Wp),definition:hi.defineModifier("definition"),constant:hi.defineModifier("constant"),function:hi.defineModifier("function"),standard:hi.defineModifier("standard"),local:hi.defineModifier("local"),special:hi.defineModifier("special")};for(let t in E){let e=E[t];e instanceof hi&&(e.name=t)}var ehe=L1([{tag:E.link,class:"tok-link"},{tag:E.heading,class:"tok-heading"},{tag:E.emphasis,class:"tok-emphasis"},{tag:E.strong,class:"tok-strong"},{tag:E.keyword,class:"tok-keyword"},{tag:E.atom,class:"tok-atom"},{tag:E.bool,class:"tok-bool"},{tag:E.url,class:"tok-url"},{tag:E.labelName,class:"tok-labelName"},{tag:E.inserted,class:"tok-inserted"},{tag:E.deleted,class:"tok-deleted"},{tag:E.literal,class:"tok-literal"},{tag:E.string,class:"tok-string"},{tag:E.number,class:"tok-number"},{tag:[E.regexp,E.escape,E.special(E.string)],class:"tok-string2"},{tag:E.variableName,class:"tok-variableName"},{tag:E.local(E.variableName),class:"tok-variableName tok-local"},{tag:E.definition(E.variableName),class:"tok-variableName tok-definition"},{tag:E.special(E.variableName),class:"tok-variableName2"},{tag:E.definition(E.propertyName),class:"tok-propertyName tok-definition"},{tag:E.typeName,class:"tok-typeName"},{tag:E.namespace,class:"tok-namespace"},{tag:E.className,class:"tok-className"},{tag:E.macroName,class:"tok-macroName"},{tag:E.propertyName,class:"tok-propertyName"},{tag:E.operator,class:"tok-operator"},{tag:E.comment,class:"tok-comment"},{tag:E.meta,class:"tok-meta"},{tag:E.invalid,class:"tok-invalid"},{tag:E.punctuation,class:"tok-punctuation"}]);var I1,ga=new Q;function xj(t){return I.define({combine:t?e=>e.concat(t):void 0})}var wj=new Q,wn=class{constructor(e,n,i=[],r=""){this.data=e,this.name=r,De.prototype.hasOwnProperty("tree")||Object.defineProperty(De.prototype,"tree",{get(){return di(this)}}),this.parser=n,this.extension=[ya.of(this),De.languageData.of((s,o,l)=>{let a=JD(s,o,l),c=a.type.prop(ga);if(!c)return[];let u=s.facet(c),f=a.type.prop(wj);if(f){let h=a.resolve(o-a.from,l);for(let d of f)if(d.test(h,s)){let m=s.facet(d.facet);return d.type=="replace"?m:m.concat(u)}}return u})].concat(i)}isActiveAt(e,n,i=-1){return JD(e,n,i).type.prop(ga)==this.data}findRegions(e){let n=e.facet(ya);if(n?.data==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(ga)==this.data){i.push({from:o,to:o+s.length});return}let l=s.prop(Q.mounted);if(l){if(l.tree.prop(ga)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+s.length});return}else if(l.overlay){let a=i.length;if(r(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<s.children.length;a++){let c=s.children[a];c instanceof Ye&&r(c,s.positions[a]+o)}};return r(di(e),0),i}get allowsNesting(){return!0}};wn.setState=he.define();function JD(t,e,n){let i=t.facet(ya),r=di(t).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,n,He.ExcludeBuffers|He.EnterBracketed))s.type.isTop&&(r=s);return r}var Gu=class t extends wn{constructor(e,n,i){super(e,n,[],i),this.parser=n}static define(e){let n=xj(e.languageData);return new t(n,e.parser.configure({props:[ga.add(i=>i.isTop?n:void 0)]}),e.name)}configure(e,n){return new t(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function di(t){let e=t.field(wn.state,!1);return e?e.tree:Ye.empty}var z1=class{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 i=this.cursorPos-this.string.length;return e<i||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-i,n-i)}},Ku=null,H1=class t{constructor(e,n,i=[],r,s,o,l,a){this.parser=e,this.state=n,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,n,i){return new t(e,n,[],Ye.empty,0,i,[],null)}startParse(){return this.parser.startParse(new z1(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ye.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(vo.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(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(vo.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Ku;Ku=this;try{return e()}finally{Ku=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=eM(e,n.from,n.to);return e}changes(e,n){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,u,f,h)=>a.push({fromA:c,toA:u,fromB:f,toB:h})),i=vo.applyChanges(i,a),r=Ye.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&l.push({from:u,to:f})}}}return new t(this.parser,n,i,r,s,o,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 i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=eM(this.fragments,r,s),this.skipped.splice(i--,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 pa{createParse(n,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=Ku;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new Ye(Lt.none,[],[],o-s)},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 Ku}};function eM(t,e,n){return vo.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}var Qu=class t{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),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,i)||n.takeTree(),new t(n)}static init(e){let n=Math.min(3e3,e.doc.length),i=H1.create(e.facet(ya).parser,e,{from:0,to:n});return i.work(20,n)||i.takeTree(),new t(i)}};wn.state=_t.define({create:Qu.init,update(t,e){for(let n of e.effects)if(n.is(wn.setState))return n.value;return e.startState.facet(ya)!=e.state.facet(ya)?Qu.init(e.state):t.apply(e)}});var rM=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(rM=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});var B1=typeof navigator<"u"&&(!((I1=navigator.scheduling)===null||I1===void 0)&&I1.isInputPending)?()=>navigator.scheduling.isInputPending():null,kj=Vn.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(wn.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(wn.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=rM(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:i,viewport:{to:r}}=this.view,s=i.field(wn.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!B1?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<r&&i.doc.length>r+1e3,a=s.context.work(()=>B1&&B1()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-n,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:wn.setState.of(new Qu(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Sn(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()}}}),ya=I.define({combine(t){return t.length?t[0]:null},enables:t=>[wn.state,kj,H.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]}),Jp=class{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}};var Aj=I.define(),em=I.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 Xu(t){let e=t.facet(em);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Wu(t,e){let n="",i=t.tabSize,r=t.facet(em)[0];if(r==" "){for(;e>=i;)n+=" ",e-=i;r=" "}for(let s=0;s<e;s++)n+=r;return n}function Y1(t,e){t instanceof De&&(t=new wo(t));for(let i of t.state.facet(Aj)){let r=i(t,e);if(r!==void 0)return r}let n=di(t.state);return n.length>=e?Oj(t,n,e):null}var wo=class{constructor(e,n={}){this.state=e,this.options=n,this.unit=Xu(e)}lineAt(e,n=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(n<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,n);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,n=e.length){return fo(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:i,from:r}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},K1=new Q;function Oj(t,e,n){let i=e.resolveStack(n),r=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return sM(i,t,n)}function sM(t,e,n){for(let i=t;i;i=i.next){let r=Cj(i.node);if(r)return r(U1.create(e,n,i))}return 0}function Tj(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function Cj(t){let e=t.type.prop(K1);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(Q.closedBy))){let r=t.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>oM(o,!0,1,void 0,s&&!Tj(o)?r.from:void 0)}return t.parent==null?Ej:null}function Ej(){return 0}var U1=class t extends wo{constructor(e,n,i){super(e.state,e.options),this.base=e,this.pos=n,this.context=i}get node(){return this.context.node}static create(e,n,i){return new t(e,n,i)}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 i=e.resolve(n.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Dj(i,e))break;n=this.state.doc.lineAt(i.from)}return this.lineIndent(n.from)}continue(){return sM(this.context.next,this.base,this.pos)}};function Dj(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function Mj(t){let e=t.node,n=e.childAfter(e.from),i=e.lastChild;if(!n)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=n.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}l=a.to}}function G1({closing:t,align:e=!0,units:n=1}){return i=>oM(i,e,n,t)}function oM(t,e,n,i,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=i&&s.slice(o,o+i.length)==i||r==t.pos+o,a=e?Mj(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*n)}var lM=new Q;function aM(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}var ba=class t{constructor(e,n){this.specs=e;let i;function r(l){let a=Hn.newName();return(i||(i=Object.create(null)))["."+a]=l,a}let s=typeof n.all=="string"?n.all:n.all?r(n.all):void 0,o=n.scope;this.scope=o instanceof wn?l=>l.prop(ga)==o.data:o?l=>l==o:void 0,this.style=L1(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=i?new Hn(i):null,this.themeType=n.themeType}static define(e,n){return new t(e,n||{})}},F1=I.define(),cM=I.define({combine(t){return t.length?[t[0]]:null}});function q1(t){let e=t.facet(F1);return e.length?e:t.facet(cM)}function uM(t,e){let n=[Rj],i;return t instanceof ba&&(t.module&&n.push(H.styleModule.of(t.module)),i=t.themeType),e?.fallback?n.push(cM.of(t)):i?n.push(F1.computeN([H.darkTheme],r=>r.facet(H.darkTheme)==(i=="dark")?[t]:[])):n.push(F1.of(t)),n}var j1=class{constructor(e){this.markCache=Object.create(null),this.tree=di(e.state),this.decorations=this.buildDeco(e,q1(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=di(e.state),i=q1(e.state),r=i!=q1(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!r&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||r)&&(this.tree=n,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return xe.none;let i=new xr;for(let{from:r,to:s}of e.visibleRanges)ZD(this.tree,n,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=xe.mark({class:a})))},r,s);return i.finish()}},Rj=Au.high(Vn.fromClass(j1,{decorations:t=>t.decorations})),ahe=ba.define([{tag:E.meta,color:"#404740"},{tag:E.link,textDecoration:"underline"},{tag:E.heading,textDecoration:"underline",fontWeight:"bold"},{tag:E.emphasis,fontStyle:"italic"},{tag:E.strong,fontWeight:"bold"},{tag:E.strikethrough,textDecoration:"line-through"},{tag:E.keyword,color:"#708"},{tag:[E.atom,E.bool,E.url,E.contentSeparator,E.labelName],color:"#219"},{tag:[E.literal,E.inserted],color:"#164"},{tag:[E.string,E.deleted],color:"#a11"},{tag:[E.regexp,E.escape,E.special(E.string)],color:"#e40"},{tag:E.definition(E.variableName),color:"#00f"},{tag:E.local(E.variableName),color:"#30a"},{tag:[E.typeName,E.namespace],color:"#085"},{tag:E.className,color:"#167"},{tag:[E.special(E.variableName),E.macroName],color:"#256"},{tag:E.definition(E.propertyName),color:"#00c"},{tag:E.comment,color:"#940"},{tag:E.invalid,color:"#f00"}]);var Nj=1e4,_j="()[]{}";var Lj=new Q;function V1(t,e,n){let i=t.prop(e<0?Q.openedBy:Q.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function $1(t){let e=t.type.prop(Lj);return e?e(t.node):t}function ko(t,e,n,i={}){let r=i.maxScanDistance||Nj,s=i.brackets||_j,o=di(t),l=o.resolveInner(e,n);for(let a=l;a;a=a.parent){let c=V1(a.type,n,s);if(c&&a.from<a.to){let u=$1(a);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return Ij(t,e,n,a,u,c,s)}}return Bj(t,e,n,o,l.type,r,s)}function Ij(t,e,n,i,r,s,o){let l=i.parent,a={from:r.from,to:r.to},c=0,u=l?.cursor();if(u&&(n<0?u.childBefore(i.from):u.childAfter(i.to)))do if(n<0?u.to<=i.from:u.from>=i.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=$1(u);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(V1(u.type,n,o))c++;else if(V1(u.type,-n,o)){if(c==0){let f=$1(u);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:a,matched:!1}}function Bj(t,e,n,i,r,s,o){if(n<0?!e:e==t.doc.length)return null;let l=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!u.next().done&&h<=s;){let d=u.value;n<0&&(h+=d.length);let m=e+h*n;for(let g=n>0?0:d.length-1,b=n>0?d.length:-1;g!=b;g+=n){let p=o.indexOf(d[g]);if(!(p<0||i.resolveInner(m+g,1).type!=r))if(p%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:m+g,to:m+g+1},matched:p>>1==a>>1};f--}}n>0&&(h+=d.length)}return u.done?{start:c,matched:!1}:null}var qj=Object.create(null),tM=[Lt.none];var nM=[],iM=Object.create(null),Pj=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"]])Pj[t]=zj(qj,e);function P1(t,e){nM.indexOf(t)>-1||(nM.push(t),console.warn(e))}function zj(t,e){let n=[];for(let l of e.split(" ")){let a=[];for(let c of l.split(".")){let u=t[c]||E[c];u?typeof u=="function"?a.length?a=a.map(u):P1(c,`Modifier ${c} used at start of tag`):a.length?P1(c,`Tag ${c} used as modifier`):a=Array.isArray(u)?u:[u]:P1(c,`Unknown highlighting tag ${c}`)}for(let c of a)n.push(c)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+n.map(l=>l.id),s=iM[r];if(s)return s.id;let o=iM[r]=Lt.define({id:tM.length,name:i,props:[ma({[i]:n})]});return tM.push(o),o.id}var che={rtl:xe.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:_e.RTL}),ltr:xe.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:_e.LTR}),auto:xe.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var Hj=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),i=tS(t.state,n.from);return i.line?Uj(t):i.block?jj(t):!1};function eS(t,e){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=t(e,n);return r?(i(n.update(r)),!0):!1}}var Uj=eS(Yj,0);var Fj=eS(vM,0);var jj=eS((t,e)=>vM(t,e,$j(e)),0);function tS(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}var Zu=50;function Vj(t,{open:e,close:n},i,r){let s=t.sliceDoc(i-Zu,i),o=t.sliceDoc(r,r+Zu),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,c=s.length-l;if(s.slice(c-e.length,c)==e&&o.slice(a,a+n.length)==n)return{open:{pos:i-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let u,f;r-i<=2*Zu?u=f=t.sliceDoc(i,r):(u=t.sliceDoc(i,i+Zu),f=t.sliceDoc(r-Zu,r));let h=/^\s*/.exec(u)[0].length,d=/\s*$/.exec(f)[0].length,m=f.length-d-n.length;return u.slice(h,h+e.length)==e&&f.slice(m,m+n.length)==n?{open:{pos:i+h+e.length,margin:/\s/.test(u.charAt(h+e.length))?1:0},close:{pos:r-d-n.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function $j(t){let e=[];for(let n of t.selection.ranges){let i=t.doc.lineAt(n.from),r=n.to<=i.to?i:t.doc.lineAt(n.to);r.from>i.from&&r.from==n.to&&(r=n.to==i.to+1?i:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function vM(t,e,n=e.selection.ranges){let i=n.map(s=>tS(e,s.from).block);if(!i.every(s=>s))return null;let r=n.map((s,o)=>Vj(e,i[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(n.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;o<r.length;o++)if(l=r[o]){let a=i[o],{open:c,close:u}=l;s.push({from:c.pos-a.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+a.close.length})}return{changes:s}}return null}function Yj(t,e,n=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of n){let l=i.length,a=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=tS(e,f.from).line,!c))continue e;if(f.from>r&&(s==o||o>f.from)){r=f.from;let h=/^\s*/.exec(f.text)[0].length,d=h==f.length,m=f.text.slice(h,h+c.length)==c?h:-1;h<f.text.length&&h<a&&(a=h),i.push({line:f,comment:m,token:c,indent:h,empty:d,single:!1})}u=f.to+1}if(a<1e9)for(let u=l;u<i.length;u++)i[u].indent<i[u].line.text.length&&(i[u].indent=a);i.length==l+1&&(i[l].single=!0)}if(t!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:c,empty:u,single:f}of i)(f||!u)&&s.push({from:l.from+c,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let c=o.from+l,u=c+a.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}var X1=zn.define(),Kj=zn.define(),Gj=I.define(),SM=I.define({combine(t){return bs(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(i,r)=>e(i,r)||n(i,r)})}}),xM=_t.define({create(){return Ao.empty},update(t,e){let n=e.state.facet(SM),i=e.annotation(X1);if(i){let a=pi.fromTransaction(e,i.selection),c=i.side,u=c==0?t.undone:t.done;return a?u=nm(u,u.length,n.minDepth,a):u=OM(u,e.startState.selection),new Ao(c==0?i.rest:u,c==0?u:i.rest)}let r=e.annotation(Kj);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(dt.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=pi.fromTransaction(e),o=e.annotation(dt.time),l=e.annotation(dt.userEvent);return s?t=t.addChanges(s,o,l,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,n.newGroupDelay)),(r=="full"||r=="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 Ao(t.done.map(pi.fromJSON),t.undone.map(pi.fromJSON))}});function wM(t={}){return[xM,SM.of(t),H.domEventHandlers({beforeinput(e,n){let i=e.inputType=="historyUndo"?kM:e.inputType=="historyRedo"?W1:null;return i?(e.preventDefault(),i(n)):!1}})]}function im(t,e){return function({state:n,dispatch:i}){if(!e&&n.readOnly)return!1;let r=n.field(xM,!1);if(!r)return!1;let s=r.pop(t,n,e);return s?(i(s),!0):!1}}var kM=im(0,!1),W1=im(1,!1),Qj=im(0,!0),Xj=im(1,!0);var pi=class t{constructor(e,n,i,r,s){this.changes=e,this.effects=n,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new t(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,i;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:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new t(e.changes&&$t.fromJSON(e.changes),[],e.mapped&&Sr.fromJSON(e.mapped),e.startSelection&&N.fromJSON(e.startSelection),e.selectionsAfter.map(N.fromJSON))}static fromTransaction(e,n){let i=Yn;for(let r of e.startState.facet(Gj)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new t(e.changes.invert(e.startState.doc),i,void 0,n||e.startState.selection,Yn)}static selection(e){return new t(void 0,Yn,void 0,void 0,e)}};function nm(t,e,n,i){let r=e+1>n+20?e-n-1:0,s=t.slice(r,e);return s.push(i),s}function Wj(t,e){let n=[],i=!1;return t.iterChangedRanges((r,s)=>n.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a<n.length;){let c=n[a++],u=n[a++];l>=c&&o<=u&&(i=!0)}}),i}function Zj(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,i)=>n.empty!=e.ranges[i].empty).length===0}function AM(t,e){return t.length?e.length?t.concat(e):t:e}var Yn=[],Jj=200;function OM(t,e){if(t.length){let n=t[t.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-Jj));return i.length&&i[i.length-1].eq(e)?t:(i.push(e),nm(t,t.length-1,1e9,n.setSelAfter(i)))}else return[pi.selection([e])]}function eV(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 Q1(t,e){if(!t.length)return t;let n=t.length,i=Yn;for(;n;){let r=tV(t[n-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,n);return s[n-1]=r,s}else e=r.mapped,n--,i=r.selectionsAfter}return i.length?[pi.selection(i)]:Yn}function tV(t,e,n){let i=AM(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Yn,n);if(!t.changes)return pi.selection(i);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new pi(r,he.mapEffects(t.effects,e),o,t.startSelection.map(s),i)}var nV=/^(input\.type|delete)($|\.)/,Ao=class t{constructor(e,n,i=0,r=void 0){this.done=e,this.undone=n,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new t(this.done,this.undone):this}addChanges(e,n,i,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||nV.test(i))&&(!l.selectionsAfter.length&&n-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,Wj(l.changes,e.changes))||i=="input.type.compose")?o=nm(o,o.length-1,r.minDepth,new pi(e.changes.compose(l.changes),AM(he.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Yn)):o=nm(o,o.length,r.minDepth,e),new t(o,Yn,n,i)}addSelection(e,n,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Yn;return s.length>0&&n-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&Zj(s[s.length-1],e)?this:new t(OM(this.done,e),this.undone,n,i)}addMapping(e){return new t(Q1(this.done,e),Q1(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(i&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:X1.of({side:e,rest:eV(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let l=r.length==1?Yn:r.slice(0,r.length-1);return s.mapped&&(l=Q1(l,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:X1.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}};Ao.empty=new Ao(Yn,Yn);var TM=[{key:"Mod-z",run:kM,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:W1,preventDefault:!0},{linux:"Ctrl-Shift-z",run:W1,preventDefault:!0},{key:"Mod-u",run:Qj,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Xj,preventDefault:!0}];function va(t,e){return N.create(t.ranges.map(e),t.mainIndex)}function mi(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function gi({state:t,dispatch:e},n){let i=va(t.selection,n);return i.eq(t.selection,!0)?!1:(e(mi(t,i)),!0)}function rm(t,e){return N.cursor(e?t.to:t.from)}function CM(t,e){return gi(t,n=>n.empty?t.moveByChar(n,e):rm(n,e))}function It(t){return t.textDirectionAt(t.state.selection.main.head)==_e.LTR}var EM=t=>CM(t,!It(t)),DM=t=>CM(t,It(t));function MM(t,e){return gi(t,n=>n.empty?t.moveByGroup(n,e):rm(n,e))}var iV=t=>MM(t,!It(t)),rV=t=>MM(t,It(t));var ghe=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function sV(t,e,n){if(e.type.prop(n))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function sm(t,e,n){let i=di(t).resolveInner(e.head),r=n?Q.closedBy:Q.openedBy;for(let a=e.head;;){let c=n?i.childAfter(a):i.childBefore(a);if(!c)break;sV(t,c,r)?i=c:a=n?c.to:c.from}let s=i.type.prop(r),o,l;return s&&(o=n?ko(t,i.from,1):ko(t,i.to,-1))&&o.matched?l=n?o.end.to:o.end.from:l=n?i.to:i.from,N.cursor(l,n?-1:1)}var oV=t=>gi(t,e=>sm(t.state,e,!It(t))),lV=t=>gi(t,e=>sm(t.state,e,It(t)));function RM(t,e){return gi(t,n=>{if(!n.empty)return rm(n,e);let i=t.moveVertically(n,e);return i.head!=n.head?i:t.moveToLineBoundary(n,e)})}var NM=t=>RM(t,!1),_M=t=>RM(t,!0);function LM(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,i=0,r;if(e){for(let s of t.state.facet(H.scrollMargins)){let o=s(t);o?.top&&(n=Math.max(o?.top,n)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=t.scrollDOM.clientHeight-n-i}else r=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:e,height:Math.max(t.defaultLineHeight,r-5)}}function IM(t,e){let n=LM(t),{state:i}=t,r=va(i.selection,o=>o.empty?t.moveVertically(o,e,n.height):rm(o,e));if(r.eq(i.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(i.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+n.marginTop,c=l.bottom-n.marginBottom;o&&o.top>a&&o.bottom<c&&(s=H.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-a}))}return t.dispatch(mi(i,r),{effects:s}),!0}var fM=t=>IM(t,!1),Z1=t=>IM(t,!0);function Ts(t,e,n){let i=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,n);if(r.head==e.head&&r.head!=(n?i.to:i.from)&&(r=t.moveToLineBoundary(e,n,!1)),!n&&r.head==i.from&&i.length){let s=/^\s*/.exec(t.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=N.cursor(i.from+s))}return r}var aV=t=>gi(t,e=>Ts(t,e,!0)),cV=t=>gi(t,e=>Ts(t,e,!1)),uV=t=>gi(t,e=>Ts(t,e,!It(t))),fV=t=>gi(t,e=>Ts(t,e,It(t))),hV=t=>gi(t,e=>N.cursor(t.lineBlockAt(e.head).from,1)),dV=t=>gi(t,e=>N.cursor(t.lineBlockAt(e.head).to,-1));function pV(t,e,n){let i=!1,r=va(t.selection,s=>{let o=ko(t,s.head,-1)||ko(t,s.head,1)||s.head>0&&ko(t,s.head-1,1)||s.head<t.doc.length&&ko(t,s.head+1,-1);if(!o||!o.end)return s;i=!0;let l=o.start.from==s.head?o.end.to:o.end.from;return n?N.range(s.anchor,l):N.cursor(l)});return i?(e(mi(t,r)),!0):!1}var mV=({state:t,dispatch:e})=>pV(t,e,!1);function Kn(t,e,n){let i=va(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=N.range(r.head,r.anchor));let s=n(r);return N.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return i.eq(t.state.selection)?!1:(t.dispatch(mi(t.state,i)),!0)}function BM(t,e){return Kn(t,e,n=>t.moveByChar(n,e))}var qM=t=>BM(t,!It(t)),PM=t=>BM(t,It(t));function zM(t,e){return Kn(t,e,n=>t.moveByGroup(n,e))}var gV=t=>zM(t,!It(t)),yV=t=>zM(t,It(t));var bV=t=>{let e=!It(t);return Kn(t,e,n=>sm(t.state,n,e))},vV=t=>{let e=It(t);return Kn(t,e,n=>sm(t.state,n,e))};function HM(t,e){return Kn(t,e,n=>t.moveVertically(n,e))}var UM=t=>HM(t,!1),FM=t=>HM(t,!0);function jM(t,e){return Kn(t,e,n=>t.moveVertically(n,e,LM(t).height))}var hM=t=>jM(t,!1),dM=t=>jM(t,!0),SV=t=>Kn(t,!0,e=>Ts(t,e,!0)),xV=t=>Kn(t,!1,e=>Ts(t,e,!1)),wV=t=>{let e=!It(t);return Kn(t,e,n=>Ts(t,n,e))},kV=t=>{let e=It(t);return Kn(t,e,n=>Ts(t,n,e))},AV=t=>Kn(t,!1,e=>N.cursor(t.lineBlockAt(e.head).from)),OV=t=>Kn(t,!0,e=>N.cursor(t.lineBlockAt(e.head).to)),pM=({state:t,dispatch:e})=>(e(mi(t,{anchor:0})),!0),mM=({state:t,dispatch:e})=>(e(mi(t,{anchor:t.doc.length})),!0),gM=({state:t,dispatch:e})=>(e(mi(t,{anchor:t.selection.main.anchor,head:0})),!0),yM=({state:t,dispatch:e})=>(e(mi(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),TV=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),CV=({state:t,dispatch:e})=>{let n=om(t).map(({from:i,to:r})=>N.range(i,Math.min(r+1,t.doc.length)));return e(t.update({selection:N.create(n),userEvent:"select"})),!0},EV=({state:t,dispatch:e})=>{let n=va(t.selection,i=>{let r=di(t),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return N.range(l.to,l.from)}return i});return n.eq(t.selection)?!1:(e(mi(t,n)),!0)};function VM(t,e){let{state:n}=t,i=n.selection,r=n.selection.ranges.slice();for(let s of n.selection.ranges){let o=n.doc.lineAt(s.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.head<o.from||a.head>o.to){r.some(c=>c.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==i.ranges.length?!1:(t.dispatch(mi(n,N.create(r,r.length-1))),!0)}var DV=t=>VM(t,!1),MV=t=>VM(t,!0),RV=({state:t,dispatch:e})=>{let n=t.selection,i=null;return n.ranges.length>1?i=N.create([n.main]):n.main.empty||(i=N.create([N.cursor(n.main.head)])),i?(e(mi(t,i)),!0):!1};function Ju(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:i}=t,r=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);a<o?(n="delete.backward",a=tm(t,a,!1)):a>o&&(n="delete.forward",a=tm(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=tm(t,o,!1),l=tm(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:N.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(t.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?H.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function tm(t,e,n){if(t instanceof H)for(let i of t.state.facet(H.atomicRanges).map(r=>r(t)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=n?s:r)});return e}var $M=(t,e,n)=>Ju(t,i=>{let r=i.from,{state:s}=t,o=s.doc.lineAt(r),l,a;if(n&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,r-o.from))){if(l[l.length-1]==" ")return r-1;let c=fo(l,s.tabSize),u=c%Xu(s)||Xu(s);for(let f=0;f<u&&l[l.length-1-f]==" ";f++)r--;a=r}else a=pt(o.text,r-o.from,e,e)+o.from,a==r&&o.number!=(e?s.doc.lines:1)?a+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,r-o.from))&&(a=pt(o.text,a-o.from,!1,!1)+o.from);return a}),J1=t=>$M(t,!1,!0);var YM=t=>$M(t,!0,!1),KM=(t,e)=>Ju(t,n=>{let i=n.head,{state:r}=t,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==n.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=pt(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),u=o(c);if(l!=null&&u!=l)break;(c!=" "||i!=n.head)&&(l=u),i=a}return i}),GM=t=>KM(t,!1),NV=t=>KM(t,!0);var _V=t=>Ju(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var LV=t=>Ju(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),IV=t=>Ju(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)});var BV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:ue.of(["",""])},range:N.cursor(i.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},qV=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(i=>{if(!i.empty||i.from==0||i.from==t.doc.length)return{range:i};let r=i.from,s=t.doc.lineAt(r),o=r==s.from?r-1:pt(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:pt(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:N.cursor(l)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function om(t){let e=[],n=-1;for(let i of t.selection.ranges){let r=t.doc.lineAt(i.from),s=t.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=t.doc.lineAt(i.to-1)),n>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return e}function QM(t,e,n){if(t.readOnly)return!1;let i=[],r=[];for(let s of om(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),l=o.length+1;if(n){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)r.push(N.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)r.push(N.range(a.anchor-l,a.head-l))}}return i.length?(e(t.update({changes:i,scrollIntoView:!0,selection:N.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}var PV=({state:t,dispatch:e})=>QM(t,e,!1),zV=({state:t,dispatch:e})=>QM(t,e,!0);function XM(t,e,n){if(t.readOnly)return!1;let i=[];for(let s of om(t))n?i.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):i.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(i);return e(t.update({changes:r,selection:t.selection.map(r,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}var HV=({state:t,dispatch:e})=>XM(t,e,!1),UV=({state:t,dispatch:e})=>XM(t,e,!0),FV=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(om(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=va(e.selection,r=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(n);return t.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function jV(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=di(t).resolveInner(e),i=n.childBefore(e),r=n.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(Q.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(i.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}var bM=WM(!1),VV=WM(!0);function WM(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!t&&s==o&&jV(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let c=new wo(e,{simulateBreak:s,simulateDoubleBreak:!!a}),u=Y1(c,s);for(u==null&&(u=fo(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:s,to:o}=a:s>l.from&&s<l.from+100&&!/\S/.test(l.text.slice(0,s))&&(s=l.from);let f=["",Wu(e,u)];return a&&f.push(Wu(e,c.lineIndent(l.from,-1))),{changes:{from:s,to:o,insert:ue.of(f)},range:N.cursor(s+1+f[1].length)}});return n(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function nS(t,e){let n=-1;return t.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let l=t.doc.lineAt(o);l.number>n&&(i.empty||i.to>l.from)&&(e(l,r,i),n=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:N.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var $V=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),i=new wo(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),r=nS(t,(s,o,l)=>{let a=Y1(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],u=Wu(t,a);(c!=u||l.from<s.from+c.length)&&(n[s.from]=a,o.push({from:s.from,to:s.from+c.length,insert:u}))});return r.changes.empty||e(t.update(r,{userEvent:"indent"})),!0},YV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nS(t,(n,i)=>{i.push({from:n.from,insert:t.facet(em)})}),{userEvent:"input.indent"})),!0),KV=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nS(t,(n,i)=>{let r=/^\s*/.exec(n.text)[0];if(!r)return;let s=fo(r,t.tabSize),o=0,l=Wu(t,Math.max(0,s-Xu(t)));for(;o<r.length&&o<l.length&&r.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:n.from+o,to:n.from+r.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),GV=t=>(t.setTabFocusMode(),!0);var QV=[{key:"Ctrl-b",run:EM,shift:qM,preventDefault:!0},{key:"Ctrl-f",run:DM,shift:PM},{key:"Ctrl-p",run:NM,shift:UM},{key:"Ctrl-n",run:_M,shift:FM},{key:"Ctrl-a",run:hV,shift:AV},{key:"Ctrl-e",run:dV,shift:OV},{key:"Ctrl-d",run:YM},{key:"Ctrl-h",run:J1},{key:"Ctrl-k",run:_V},{key:"Ctrl-Alt-h",run:GM},{key:"Ctrl-o",run:BV},{key:"Ctrl-t",run:qV},{key:"Ctrl-v",run:Z1}],XV=[{key:"ArrowLeft",run:EM,shift:qM,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:iV,shift:gV,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:uV,shift:wV,preventDefault:!0},{key:"ArrowRight",run:DM,shift:PM,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:rV,shift:yV,preventDefault:!0},{mac:"Cmd-ArrowRight",run:fV,shift:kV,preventDefault:!0},{key:"ArrowUp",run:NM,shift:UM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:pM,shift:gM},{mac:"Ctrl-ArrowUp",run:fM,shift:hM},{key:"ArrowDown",run:_M,shift:FM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:mM,shift:yM},{mac:"Ctrl-ArrowDown",run:Z1,shift:dM},{key:"PageUp",run:fM,shift:hM},{key:"PageDown",run:Z1,shift:dM},{key:"Home",run:cV,shift:xV,preventDefault:!0},{key:"Mod-Home",run:pM,shift:gM},{key:"End",run:aV,shift:SV,preventDefault:!0},{key:"Mod-End",run:mM,shift:yM},{key:"Enter",run:bM,shift:bM},{key:"Mod-a",run:TV},{key:"Backspace",run:J1,shift:J1,preventDefault:!0},{key:"Delete",run:YM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:GM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:NV,preventDefault:!0},{mac:"Mod-Backspace",run:LV,preventDefault:!0},{mac:"Mod-Delete",run:IV,preventDefault:!0}].concat(QV.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),ZM=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:oV,shift:bV},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:lV,shift:vV},{key:"Alt-ArrowUp",run:PV},{key:"Shift-Alt-ArrowUp",run:HV},{key:"Alt-ArrowDown",run:zV},{key:"Shift-Alt-ArrowDown",run:UV},{key:"Mod-Alt-ArrowUp",run:DV},{key:"Mod-Alt-ArrowDown",run:MV},{key:"Escape",run:RV},{key:"Mod-Enter",run:VV},{key:"Alt-l",mac:"Ctrl-l",run:CV},{key:"Mod-i",run:EV,preventDefault:!0},{key:"Mod-[",run:KV},{key:"Mod-]",run:YV},{key:"Mod-Alt-\\",run:$V},{key:"Shift-Mod-k",run:FV},{key:"Shift-Mod-\\",run:mV},{key:"Mod-/",run:Hj},{key:"Alt-A",run:Fj},{key:"Ctrl-m",mac:"Shift-Alt-m",run:GV}].concat(XV);var sS=class t{constructor(e,n,i,r,s,o,l,a,c,u=0,f){this.p=e,this.stack=n,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=c,this.lookAhead=u,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,i=0){let r=e.parser.context;return new t(e,[],n,i,i,0,[],0,r?new lm(r,r.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 i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=s.dynamicPrecedence(r);if(l&&(this.score+=l),i==0){r<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let a=this.stack.length-(i-1)*3-(e&262144?6:0),c=a?this.stack[a-2]:this.p.ranges[0].from;r<s.minRepeatTerm&&c==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-c;u>=2e3&&!(!((n=this.p.parser.nodeSet.types[r])===null||n===void 0)&&n.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=a?this.stack[a-1]:0,h=this.bufferBase+this.buffer.length-f;if(r<s.minRepeatTerm||e&131072){let d=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,c,d,h+4,!0)}if(e&262144)this.state=this.stack[a];else{let d=this.stack[a-3];this.state=s.getGoto(d,r,!0)}for(;this.stack.length>a;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,n,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this.buffer.length;if(o>0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(n==i)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,n,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,n,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>i||n<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?i:Math.min(i,this.reducePos)),this.shiftContext(n,i),n<=o.maxNode&&this.buffer.push(n,i,r,4)}else this.pos=r,this.shiftContext(n,i),n<=this.p.parser.maxNode&&this.buffer.push(n,i,r,4)}apply(e,n,i,r){e&65536?this.reduce(e):this.shift(e,n,i,r)}useNode(e,n){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(n,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let i=e.buffer.slice(n),r=e.bufferBase+n;for(;e&&r==e.bufferBase;)e=e.parent;return new t(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,i?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new oS(this);;){let i=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(i==0)return!1;if((i&65536)==0)return!0;n.reduce(i)}}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 r=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(n[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<n.length;s+=2){let o=n[s+1];r.some((l,a)=>a&1&&l==o)||r.push(n[s],o)}n=r}let i=[];for(let r=0;r<n.length&&i.length<4;r+=2){let s=n[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(n[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if((n&65536)==0)return!1;if(!e.validAction(this.state,n)){let i=n>>19,r=n&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;n=o}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=[],i=(r,s)=>{if(!n.includes(r))return n.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,c=this.stack.length-l*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,s+1);if(l!=null)return l}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let 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 lm(this.curContext.tracker,e);n.hash!=this.curContext.hash&&this.emitContext(),this.curContext=n}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},lm=class{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}},oS=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=r}},lS=class t{constructor(e,n,i){this.stack=e,this.pos=n,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new t(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 t(this.stack,this.pos,this.index)}};function ef(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let i=0,r=0;i<t.length;){let s=0;for(;;){let o=t.charCodeAt(i++),l=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}n?n[r++]=s:n=new e(s)}return n}var Sa=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},JM=new Sa,aS=class{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=JM,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 i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;n<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}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,i,r;if(n>=0&&n<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,n=0){let i=n?this.resolveOffset(n,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,n){this.token.value=e,this.token.end=n}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=JM,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 i="";for(let r of this.ranges){if(r.from>=n)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,n)))}return i}},Cs=class{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:i}=n.p;rR(this.data,e,n,this.id,i.data,i.tokenPrecTable)}};Cs.prototype.contextual=Cs.prototype.fallback=Cs.prototype.extend=!1;var cS=class{constructor(e,n,i){this.precTable=n,this.elseToken=i,this.data=typeof e=="string"?ef(e):e}token(e,n){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(rR(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}};cS.prototype.contextual=Cs.prototype.fallback=Cs.prototype.extend=!1;var Oo=class{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}};function rR(t,e,n,i,r,s){let o=0,l=1<<i,{dialect:a}=n.p.parser;e:for(;(l&t[o])!=0;){let c=t[o+1];for(let d=o+3;d<c;d+=2)if((t[d+1]&l)>0){let m=t[d];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||ZV(m,e.token.value,r,s))){e.acceptToken(m);break}}let u=e.next,f=0,h=t[o+2];if(e.next<0&&h>f&&t[c+h*3-3]==65535){o=t[c+h*3-1];continue e}for(;f<h;){let d=f+h>>1,m=c+d+(d<<1),g=t[m],b=t[m+1]||65536;if(u<g)h=d;else if(u>=b)f=d+1;else{o=t[m+2],e.advance();continue e}}break}}function eR(t,e,n){for(let i=e,r;(r=t[i])!=65535;i++)if(r==n)return i-e;return-1}function ZV(t,e,n,i){let r=eR(n,i,e);return r<0||eR(n,i,t)<r}var kn=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG),iS=null;function tR(t,e,n){let i=t.cursor(He.IncludeAnonymous);for(i.moveTo(e);;)if(!(n<0?i.childBefore(e):i.childAfter(e)))for(;;){if((n<0?i.to<e:i.from>e)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(t.length,Math.max(i.from+1,e+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:t.length}}var uS=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?tR(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?tR(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 i=this.trees[n],r=this.index[n];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[n]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof Ye){if(o==e){if(o<this.safeFrom)return null;let l=o+s.length;if(l<=this.safeTo){let a=s.prop(Q.lookAhead);if(!a||l+a<this.fragment.to)return s}}this.index[n]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[n]++,this.nextStart=o+s.length}}},fS=class{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Sa)}getActions(e){let n=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],f=this.tokens[c];if(!(i&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,u,e),f.mask=o,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),!u.extend&&(i=f,n>h))break}}for(;this.actions.length>n;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new Sa,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,n=this.addActions(e,i.value,i.end,n)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new Sa,{pos:i,p:r}=e;return n.start=i,n.end=Math.min(i+1,r.stream.end),n.value=i==r.stream.end?r.parser.eofTerm:0,n}updateCachedToken(e,n,i){let r=this.stream.clipPos(i.pos);if(n.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let l=s.specializers[o](this.stream.read(e.start,e.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,n,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=n,this.actions[r++]=i,r}addActions(e,n,i,r){let{state:s}=e,{parser:o}=e.p,{data:l}=o;for(let a=0;a<2;a++)for(let c=o.stateSlot(s,a?2:1);;c+=3){if(l[c]==65535)if(l[c+1]==1)c=Cr(l,c+2);else{r==0&&l[c+1]==2&&(r=this.putAction(Cr(l,c+2),n,i,r));break}l[c]==n&&(r=this.putAction(Cr(l,c+1),n,i,r))}return r}},hS=class{constructor(e,n,i,r){this.parser=e,this.input=n,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new aS(n,r),this.tokens=new fS(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[sS.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new uS(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>n)i.push(l);else{if(this.advanceStack(l,i,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!i.length){let o=r&&JV(r);if(o)return kn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw kn&&r&&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&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return kn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>n)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let c=i[a];if(l.sameState(c)||l.buffer.length>500&&c.buffer.length>500)if((l.score-c.score||l.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,l)=>l.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].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,i){let r=e.pos,{parser:s}=this,o=kn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(r);f;){let h=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(h>-1&&f.length&&(!c||(f.prop(Q.contextHash)||0)==u))return e.useNode(f,h),kn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ye)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof Ye&&f.positions[0]==0)f=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),kn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;c<a.length;){let u=a[c++],f=a[c++],h=a[c++],d=c==a.length||!i,m=d?e:e.split(),g=this.tokens.mainToken;if(m.apply(u,f,g?g.start:m.pos,h),kn&&console.log(o+this.stackID(m)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(f)} @ ${r}${m==e?"":", split"})`),d)return!0;m.pos>r?n.push(m):i.push(m)}return!1}advanceFully(e,n){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return nR(e,n),!0}}runRecovery(e,n,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let l=e[o],a=n[o<<1],c=n[(o<<1)+1],u=kn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),kn&&console.log(u+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),h=u;for(let d=0;d<10&&f.forceReduce()&&(kn&&console.log(h+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)kn&&(h=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))kn&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(c==l.pos&&(c++,a=0),l.recoverByDelete(a,c),kn&&console.log(u+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),nR(l,i)):(!r||r.score<f.score)&&(r=f)}return r}stackToTree(e){return e.close(),Ye.build({buffer:lS.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=(iS||(iS=new WeakMap)).get(e);return n||iS.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}};function nR(t,e){for(let n=0;n<e.length;n++){let i=e[n];if(i.pos==t.pos&&i.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}var dS=class{constructor(e,n,i){this.source=e,this.flags=n,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}},rS=t=>t,am=class{constructor(e){this.start=e.start,this.shift=e.shift||rS,this.reduce=e.reduce||rS,this.reuse=e.reuse||rS,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},xa=class t extends pa{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 i=Object.keys(e.topRules).map(l=>e.topRules[l][1]),r=[];for(let l=0;l<n.length;l++)r.push([]);function s(l,a,c){r[l].push([a,a.deserialize(String(c))])}if(e.nodeProps)for(let l of e.nodeProps){let a=l[0];typeof a=="string"&&(a=Q[a]);for(let c=1;c<l.length;){let u=l[c++];if(u>=0)s(u,a,l[c++]);else{let f=l[c+-u];for(let h=-u;h>0;h--)s(l[c++],a,f);c++}}}this.nodeSet=new Fu(n.map((l,a)=>Lt.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:i.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=1024;let o=ef(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(iR),this.states=ef(e.states,Uint32Array),this.data=ef(e.stateData),this.goto=ef(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Cs(o,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,i){let r=new hS(this,e,n,i);for(let s of this.wrappers)r=s(r,e,n,i);return r}getGoto(e,n,i=!1){let r=this.goto;if(n>=r[0])return-1;for(let s=r[n+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&i)return a;for(let c=s+(o>>1);s<c;s++)if(r[s]==e)return a;if(l)return-1}}hasAction(e,n){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=Cr(i,s+2)];else{if(i[s+1]==2)return Cr(i,s+2);break}if(o==n||o==0)return Cr(i,s+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,i=>i==n?!0:null)}allActions(e,n){let i=this.stateSlot(e,4),r=i?n(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Cr(this.data,s+2);else break;r=n(Cr(this.data,s+1))}return r}nextStates(e){let n=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Cr(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];n.some((s,o)=>o&1&&s==r)||n.push(this.data[i],r)}}return n}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=i}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(l=>l.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return n.specializers[r]=iR(o),o})),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),i=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<n.length;s++)if(!i[s])for(let o=this.dialects[n[s]],l;(l=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[l]=1;return new dS(e,i,r)}static deserialize(e){return new t(e)}};function Cr(t,e){return t[e]|t[e+1]<<16}function JV(t){let e=null;for(let n of t){let i=n.p.stoppedAt;(n.pos==n.p.stream.end||i!=null&&n.pos>i)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function iR(t){if(t.external){let e=t.extend?1:0;return(n,i)=>t.external(n,i)<<1|e}return t.get}var wa=63,sR=64,e$=1,t$=2,aR=3,n$=4,cR=5,i$=6,r$=7,uR=65,s$=66,o$=8,l$=9,a$=10,c$=11,u$=12,fR=13,f$=19,h$=20,d$=29,p$=33,m$=34,g$=47,y$=0,vS=1,mS=2,nf=3,gS=4,Er=class{constructor(e,n,i){this.parent=e,this.depth=n,this.type=i,this.hash=(e?e.hash+e.hash<<8:0)+n+(n<<4)+i}};Er.top=new Er(null,-1,y$);function tf(t,e){for(let n=0,i=e-t.pos-1;;i--,n++){let r=t.peek(i);if(Dr(r)||r==-1)return n}}function yS(t){return t==32||t==9}function Dr(t){return t==10||t==13}function hR(t){return yS(t)||Dr(t)}function To(t){return t<0||hR(t)}var b$=new am({start:Er.top,reduce(t,e){return t.type==nf&&(e==h$||e==m$)?t.parent:t},shift(t,e,n,i){if(e==aR)return new Er(t,tf(i,i.pos),vS);if(e==uR||e==cR)return new Er(t,tf(i,i.pos),mS);if(e==wa)return t.parent;if(e==f$||e==p$)return new Er(t,0,nf);if(e==fR&&t.type==gS)return t.parent;if(e==g$){let r=/[1-9]/.exec(i.read(i.pos,n.pos));if(r)return new Er(t,t.depth+ +r[0],gS)}return t},hash(t){return t.hash}});function ka(t,e,n=0){return t.peek(n)==e&&t.peek(n+1)==e&&t.peek(n+2)==e&&To(t.peek(n+3))}var v$=new Oo((t,e)=>{if(t.next==-1&&e.canShift(sR))return t.acceptToken(sR);let n=t.peek(-1);if((Dr(n)||n<0)&&e.context.type!=nf){if(ka(t,45))if(e.canShift(wa))t.acceptToken(wa);else return t.acceptToken(e$,3);if(ka(t,46))if(e.canShift(wa))t.acceptToken(wa);else return t.acceptToken(t$,3);let i=0;for(;t.next==32;)i++,t.advance();(i<e.context.depth||i==e.context.depth&&e.context.type==vS&&(t.next!=45||!To(t.peek(1))))&&t.next!=-1&&!Dr(t.next)&&t.next!=35&&t.acceptToken(wa,-i)}},{contextual:!0}),S$=new Oo((t,e)=>{if(e.context.type==nf){t.next==63&&(t.advance(),To(t.next)&&t.acceptToken(r$));return}if(t.next==45)t.advance(),To(t.next)&&t.acceptToken(e.context.type==vS&&e.context.depth==tf(t,t.pos-1)?n$:aR);else if(t.next==63)t.advance(),To(t.next)&&t.acceptToken(e.context.type==mS&&e.context.depth==tf(t,t.pos-1)?i$:cR);else{let n=t.pos;for(;;)if(yS(t.next)){if(t.pos==n)return;t.advance()}else if(t.next==33)dR(t);else if(t.next==38)bS(t);else if(t.next==42){bS(t);break}else if(t.next==39||t.next==34){if(SS(t,!0))break;return}else if(t.next==91||t.next==123){if(!w$(t))return;break}else{pR(t,!0,!1,0);break}for(;yS(t.next);)t.advance();if(t.next==58){if(t.pos==n&&e.canShift(d$))return;let i=t.peek(1);To(i)&&t.acceptTokenTo(e.context.type==mS&&e.context.depth==tf(t,n)?s$:uR,n)}}},{contextual:!0});function x$(t){return t>32&&t<127&&t!=34&&t!=37&&t!=44&&t!=60&&t!=62&&t!=92&&t!=94&&t!=96&&t!=123&&t!=124&&t!=125}function oR(t){return t>=48&&t<=57||t>=97&&t<=102||t>=65&&t<=70}function lR(t,e){return t.next==37?(t.advance(),oR(t.next)&&t.advance(),oR(t.next)&&t.advance(),!0):x$(t.next)||e&&t.next==44?(t.advance(),!0):!1}function dR(t){if(t.advance(),t.next==60){for(t.advance();;)if(!lR(t,!0)){t.next==62&&t.advance();break}}else for(;lR(t,!1););}function bS(t){for(t.advance();!To(t.next)&&cm(t.next)!="f";)t.advance()}function SS(t,e){let n=t.next,i=!1,r=t.pos;for(t.advance();;){let s=t.next;if(s<0)break;if(t.advance(),s==n)if(s==39)if(t.next==39)t.advance();else break;else break;else if(s==92&&n==34)t.next>=0&&t.advance();else if(Dr(s)){if(e)return!1;i=!0}else if(e&&t.pos>=r+1024)return!1}return!i}function w$(t){for(let e=[],n=t.pos+1024;;)if(t.next==91||t.next==123)e.push(t.next),t.advance();else if(t.next==39||t.next==34){if(!SS(t,!0))return!1}else if(t.next==93||t.next==125){if(e[e.length-1]!=t.next-2)return!1;if(e.pop(),t.advance(),!e.length)return!0}else{if(t.next<0||t.pos>n||Dr(t.next))return!1;t.advance()}}var k$="iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif";function cm(t){return t<33?"u":t>125?"s":k$[t-33]}function pS(t,e){let n=cm(t);return n!="u"&&!(e&&n=="f")}function pR(t,e,n,i){if(cm(t.next)=="s"||(t.next==63||t.next==58||t.next==45)&&pS(t.peek(1),n))t.advance();else return!1;let r=t.pos;for(;;){let s=t.next,o=0,l=i+1;for(;hR(s);){if(Dr(s)){if(e)return!1;l=0}else l++;s=t.peek(++o)}if(!(s>=0&&(s==58?pS(t.peek(o+1),n):s==35?t.peek(o-1)!=32:pS(s,n)))||!n&&l<=i||l==0&&!n&&(ka(t,45,o)||ka(t,46,o)))break;if(e&&cm(s)=="f")return!1;for(let c=o;c>=0;c--)t.advance();if(e&&t.pos>r+1024)return!1}return!0}var A$=new Oo((t,e)=>{if(t.next==33)dR(t),t.acceptToken(u$);else if(t.next==38||t.next==42){let n=t.next==38?a$:c$;bS(t),t.acceptToken(n)}else t.next==39||t.next==34?(SS(t,!1),t.acceptToken(l$)):pR(t,!1,e.context.type==nf,e.context.depth)&&t.acceptToken(o$)}),O$=new Oo((t,e)=>{let n=e.context.type==gS?e.context.depth:-1,i=t.pos;e:for(;;){let r=0,s=t.next;for(;s==32;)s=t.peek(++r);if(!r&&(ka(t,45,r)||ka(t,46,r))||!Dr(s)&&(n<0&&(n=Math.max(e.context.depth+1,r)),r<n))break;for(;;){if(t.next<0)break e;let o=Dr(t.next);if(t.advance(),o)continue e;i=t.pos}}t.acceptTokenTo(fR,i)}),T$=ma({DirectiveName:E.keyword,DirectiveContent:E.attributeValue,"DirectiveEnd DocEnd":E.meta,QuotedLiteral:E.string,BlockLiteralHeader:E.special(E.string),BlockLiteralContent:E.content,Literal:E.content,"Key/Literal Key/QuotedLiteral":E.definition(E.propertyName),"Anchor Alias":E.labelName,Tag:E.typeName,Comment:E.lineComment,": , -":E.separator,"?":E.punctuation,"[ ]":E.squareBracket,"{ }":E.brace}),mR=xa.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:"\u26A0 DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document",maxTerm:74,context:b$,nodeProps:[["isolate",-3,8,9,14,""],["openedBy",18,"[",32,"{"],["closedBy",19,"]",33,"}"]],propSources:[T$],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[v$,S$,A$,O$,0,1],topRules:{Stream:[0,15]},tokenPrec:0});var C$=xa.deserialize({version:14,states:"!vOQOPOOO]OPO'#C_OhOPO'#C^OOOO'#Cc'#CcOpOPO'#CaQOOOOOO{OPOOOOOO'#Cb'#CbO!WOPO'#C`O!`OPO,58xOOOO-E6a-E6aOOOO-E6`-E6`OOOO'#C_'#C_OOOO1G.d1G.d",stateData:"!h~OXPOYROWTP~OWVXXRXYRX~OYVOXSP~OXROYROWTX~OXROYROWTP~OYVOXSX~OX[O~OXY~",goto:"vWPPX[beioRUOQQOR]XRXQTTOUQWQRZWSSOURYS",nodeNames:"\u26A0 Document Frontmatter DashLine FrontmatterContent Body",maxTerm:10,skippedNodes:[0],repeatNodeCount:2,tokenData:"$z~RXOYnYZ!^Z]n]^!^^}n}!O!i!O;'Sn;'S;=`!c<%lOn~qXOYnYZ!^Z]n]^!^^;'Sn;'S;=`!c<%l~n~On~~!^~!cOY~~!fP;=`<%ln~!lZOYnYZ!^Z]n]^!^^}n}!O#_!O;'Sn;'S;=`!c<%l~n~On~~!^~#bZOYnYZ!^Z]n]^!^^}n}!O$T!O;'Sn;'S;=`!c<%l~n~On~~!^~$WXOYnYZ$sZ]n]^$s^;'Sn;'S;=`!c<%l~n~On~~$s~$zOX~Y~",tokenizers:[0],topRules:{Document:[0,1]},tokenPrec:67}),E$=Gu.define({name:"yaml",parser:mR.configure({props:[K1.add({Stream:t=>{for(let e=t.node.resolve(t.pos,-1);e&&e.to>=t.pos;e=e.parent){if(e.name=="BlockLiteralContent"&&e.from<e.to)return t.baseIndentFor(e);if(e.name=="BlockLiteral")return t.baseIndentFor(e)+t.unit;if(e.name=="BlockSequence"||e.name=="BlockMapping")return t.column(e.firstChild.from,1);if(e.name=="QuotedLiteral")return null;if(e.name=="Literal"){let n=t.column(e.from,1);if(n==t.lineIndent(e.from,1))return n;if(e.to>t.pos)return null}}return null},FlowMapping:G1({closing:"}"}),FlowSequence:G1({closing:"]"})}),lM.add({"FlowMapping FlowSequence":aM,"Item Pair BlockLiteral":(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*[\]\}]$/}});function gR(){return new Jp(E$)}var Dhe=Gu.define({name:"yaml-frontmatter",parser:C$.configure({props:[ma({DashLine:E.meta})]})});var hm=class{constructor(e,n,i){this.from=e,this.to=n,this.diagnostic=i}},Co=class t{constructor(e,n,i){this.diagnostics=e,this.panel=n,this.selected=i}static init(e,n,i){let r=i.facet(rf).markerFilter;r&&(e=r(e,i));let s=e.slice().sort((d,m)=>d.from-m.from||d.to-m.to),o=new xr,l=[],a=0,c=i.doc.iter(),u=0,f=i.doc.length;for(let d=0;;){let m=d==s.length?null:s[d];if(!m&&!l.length)break;let g,b;if(l.length)g=a,b=l.reduce((v,S)=>Math.min(v,S.to),m&&m.from>g?m.from:1e8);else{if(g=m.from,g>f)break;b=m.to,l.push(m),d++}for(;d<s.length;){let v=s[d];if(v.from==g&&(v.to>v.from||v.to==g))l.push(v),d++,b=Math.min(v.to,b);else{b=Math.min(v.from,b);break}}b=Math.min(b,f);let p=!1;if(l.some(v=>v.from==g&&(v.to==b||b==f))&&(p=g==b,!p&&b-g<10)){let v=g-(u+c.value.length);v>0&&(c.next(v),u=g);for(let S=g;;){if(S>=b){p=!0;break}if(!c.lineBreak&&u+c.value.length>S)break;S=u+c.value.length,u+=c.value.length,c.next()}}let y=TR(l);if(p)o.add(g,g,xe.widget({widget:new xS(y),diagnostics:l.slice()}));else{let v=l.reduce((S,w)=>w.markClass?S+" "+w.markClass:S,"");o.add(g,b,xe.mark({class:"cm-lintRange cm-lintRange-"+y+v,diagnostics:l.slice(),inclusiveEnd:l.some(S=>S.to>b)}))}if(a=b,a==f)break;for(let v=0;v<l.length;v++)l[v].to<=a&&l.splice(v--,1)}let h=o.finish();return new t(h,n,Aa(h))}};function Aa(t,e=null,n=0){let i=null;return t.between(n,1e9,(r,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new hm(r,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new hm(i.from,s,i.diagnostic)}}),i}function vR(t,e){let n=e.pos,i=e.end||n,r=t.state.facet(rf).hideOn(t,n,i);if(r!=null)return r;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(gm))||t.changes.touchesRange(s.from,Math.max(s.to,i)))}function D$(t,e){return t.field(yi,!1)?e:e.concat(he.appendConfig.of(H$))}function SR(t,e){return{effects:D$(t,[gm.of(e)])}}var gm=he.define(),xR=he.define(),wR=he.define(),yi=_t.define({create(){return new Co(xe.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),i=null,r=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);i=Aa(n,t.selected.diagnostic,s)||Aa(n,null,s)}!n.size&&r&&e.state.facet(rf).autoPanel&&(r=null),t=new Co(n,r,i)}for(let n of e.effects)if(n.is(gm)){let i=e.state.facet(rf).autoPanel?n.value.length?pm.open:null:t.panel;t=Co.init(n.value,i,e.state)}else n.is(xR)?t=new Co(t.diagnostics,n.value?pm.open:null,t.selected):n.is(wR)&&(t=new Co(t.diagnostics,t.panel,n.value));return t},provide:t=>[zp.from(t,e=>e.panel),H.decorations.from(t,e=>e.diagnostics)]});var M$=xe.mark({class:"cm-lintRange cm-lintRange-active"});function R$(t,e,n){let{diagnostics:i}=t.state.field(yi),r,s=-1,o=-1;i.between(e-(n<0?1:0),e+(n>0?1:0),(a,c,{spec:u})=>{if(e>=a&&e<=c&&(a==c||(e>a||n>0)&&(e<c||n<0)))return r=u.diagnostics,s=a,o=c,!1});let l=t.state.facet(rf).tooltipFilter;return r&&l&&(r=l(r,t.state)),r?{pos:s,end:o,above:!0,create(){return{dom:kR(t,r)}}}:null}function kR(t,e){return vn("ul",{class:"cm-tooltip-lint"},e.map(n=>OR(t,n,!1)))}var yR=t=>{let e=t.state.field(yi,!1);return!e||!e.panel?!1:(t.dispatch({effects:xR.of(!1)}),!0)};var rf=I.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...bs(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:bR,tooltipFilter:bR,needsRefresh:(e,n)=>e?n?i=>e(i)||n(i):e:n,hideOn:(e,n)=>e?n?(i,r,s)=>e(i,r,s)||n(i,r,s):e:n,autoPanel:(e,n)=>e||n})}}});function bR(t,e){return t?e?(n,i)=>e(t(n,i),i):t:e}function AR(t){let e=[];if(t)e:for(let{name:n}of t){for(let i=0;i<n.length;i++){let r=n[i];if(/[a-zA-Z]/.test(r)&&!e.some(s=>s.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function OR(t,e,n){var i;let r=n?AR(e.actions):[];return vn("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},vn("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=d=>{if(d.preventDefault(),l)return;l=!0;let m=Aa(t.state.field(yi).diagnostics,e);m&&s.apply(t,m.from,m.to)},{name:c}=s,u=r[o]?c.indexOf(r[o]):-1,f=u<0?c:[c.slice(0,u),vn("u",c.slice(u,u+1)),c.slice(u+1)],h=s.markClass?" "+s.markClass:"";return vn("button",{type:"button",class:"cm-diagnosticAction"+h,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${u<0?"":` (access key "${r[o]})"`}.`},f)}),e.source&&vn("div",{class:"cm-diagnosticSource"},e.source))}var xS=class extends Or{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return vn("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},dm=class{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=OR(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},pm=class t{constructor(e){this.view=e,this.items=[];let n=r=>{if(!(r.ctrlKey||r.altKey||r.metaKey)){if(r.keyCode==27)yR(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=AR(s.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==r.keyCode){let a=Aa(this.view.state.field(yi).diagnostics,s);a&&s.actions[l].apply(e,a.from,a.to)}}else return;r.preventDefault()}},i=r=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(r.target)&&this.moveSelection(s)};this.list=vn("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:i}),this.dom=vn("div",{class:"cm-panel-lint"},this.list,vn("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>yR(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(yi).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(yi),i=0,r=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,a,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let f=-1,h;for(let d=i;d<this.items.length;d++)if(this.items[d].diagnostic==u){f=d;break}f<0?(h=new dm(this.view,u),this.items.splice(i,0,h),r=!0):(h=this.items[f],f>i&&(this.items.splice(i,f-i),r=!0)),n&&h.diagnostic==n.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new dm(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let c=a.height/this.list.offsetHeight;l.top<a.top?this.list.scrollTop-=(a.top-l.top)/c:l.bottom>a.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function n(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)n();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(yi),i=Aa(n.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:wR.of(i)})}static open(e){return new t(e)}};function fm(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 um(t){return fm(`<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"')}var N$=H.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:um("#f11")},".cm-lintRange-warning":{backgroundImage:um("orange")},".cm-lintRange-info":{backgroundImage:um("#999")},".cm-lintRange-hint":{backgroundImage:um("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function _$(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function TR(t){let e="hint",n=1;for(let i of t){let r=_$(i.severity);r>n&&(n=r,e=i.severity)}return e}var mm=class extends $n{constructor(e){super(),this.diagnostics=e,this.severity=TR(e)}toDOM(e){let n=document.createElement("div");n.className="cm-lint-marker cm-lint-marker-"+this.severity;let i=this.diagnostics,r=e.state.facet(ym).tooltipFilter;return r&&(i=r(i,e.state)),i.length&&(n.onmouseover=()=>I$(e,n,i)),n}};function L$(t,e){let n=i=>{let r=e.getBoundingClientRect();if(!(i.clientX>r.left-10&&i.clientX<r.right+10&&i.clientY>r.top-10&&i.clientY<r.bottom+10)){for(let s=i.target;s;s=s.parentNode)if(s.nodeType==1&&s.classList.contains("cm-tooltip-lint"))return;window.removeEventListener("mousemove",n),t.state.field(CR)&&t.dispatch({effects:kS.of(null)})}};window.addEventListener("mousemove",n)}function I$(t,e,n){function i(){let o=t.elementAtHeight(e.getBoundingClientRect().top+5-t.documentTop);t.coordsAtPos(o.from)&&t.dispatch({effects:kS.of({pos:o.from,above:!1,clip:!1,create(){return{dom:kR(t,n),getCoords:()=>e.getBoundingClientRect()}}})}),e.onmouseout=e.onmousemove=null,L$(t,e)}let{hoverTime:r}=t.state.facet(ym),s=setTimeout(i,r);e.onmouseout=()=>{clearTimeout(s),e.onmouseout=e.onmousemove=null},e.onmousemove=()=>{clearTimeout(s),s=setTimeout(i,r)}}function B$(t,e){let n=Object.create(null);for(let r of e){let s=t.lineAt(r.from);(n[s.from]||(n[s.from]=[])).push(r)}let i=[];for(let r in n)i.push(new mm(n[r]).range(+r));return de.of(i,!0)}var q$=k1({class:"cm-gutter-lint",markers:t=>t.state.field(wS),widgetMarker:(t,e,n)=>{let i=[];return t.state.field(wS).between(n.from,n.to,(r,s,o)=>{r>n.from&&r<n.to&&i.push(...o.diagnostics)}),i.length?new mm(i):null}}),wS=_t.define({create(){return de.empty},update(t,e){t=t.map(e.changes);let n=e.state.facet(ym).markerFilter;for(let i of e.effects)if(i.is(gm)){let r=i.value;n&&(r=n(r||[],e.state)),t=B$(e.state.doc,r.slice(0))}return t}}),kS=he.define(),CR=_t.define({create(){return null},update(t,e){return t&&e.docChanged&&(t=vR(e,t)?null:{...t,pos:e.changes.mapPos(t.pos)}),e.effects.reduce((n,i)=>i.is(kS)?i.value:n,t)},provide:t=>$p.from(t)}),P$=H.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:fm('<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>')},".cm-lint-marker-warning":{content:fm('<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>')},".cm-lint-marker-error":{content:fm('<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>')}}),z$=UD(R$,{hideOn:vR}),H$=[yi,H.decorations.compute([yi],t=>{let{selected:e,panel:n}=t.field(yi);return!e||!n||e.from==e.to?xe.none:xe.set([M$.range(e.from,e.to)])}),z$,N$],ym=I.define({combine(t){return bs(t,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function ER(t={}){return[ym.of(t),wS,q$,P$,CR]}var Yi=be(rt()),DR={error:0,warning:1,info:2},U$=ba.define([{tag:E.comment,color:"var(--spytial-ed-syn-comment, #8a8170)",fontStyle:"italic"},{tag:[E.string,E.special(E.string)],color:"var(--spytial-ed-syn-string, #7a5901)"},{tag:[E.number,E.bool,E.null],color:"var(--spytial-ed-syn-number, #7a5901)"},{tag:[E.propertyName,E.definition(E.propertyName),E.keyword,E.atom],color:"var(--spytial-ed-syn-keyword, #6d28a8)"},{tag:[E.punctuation,E.separator],color:"var(--spytial-ed-text-muted, #6e6553)"}]),F$=H.theme({"&":{fontSize:"0.85em",color:"var(--spytial-ed-text, #221d14)",backgroundColor:"var(--spytial-ed-surface, #faf8f2)",border:"1px solid var(--spytial-ed-border, #d9d2c0)",borderRadius:"var(--spytial-ed-radius, 2px)",minHeight:"12rem"},"&.cm-focused":{outline:"2px solid var(--spytial-ed-accent, #b5431a)",outlineOffset:"-1px"},".cm-scroller":{fontFamily:"var(--spytial-ed-mono-font-family, ui-monospace, monospace)",lineHeight:"1.5",overflow:"auto"},".cm-content":{padding:"0.5em 0",caretColor:"var(--spytial-ed-accent, #b5431a)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--spytial-ed-accent, #b5431a)"},".cm-gutters":{backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text-muted, #6e6553)",border:"none",borderInlineEnd:"1px solid var(--spytial-ed-border, #d9d2c0)"},".cm-lineNumbers .cm-gutterElement":{padding:"0 0.5em 0 0.6em"},"&.cm-editor .cm-selectionBackground, & .cm-selectionBackground, & .cm-content ::selection":{backgroundColor:"color-mix(in srgb, var(--spytial-ed-accent, #b5431a) 22%, transparent)"},".cm-tooltip":{border:"1px solid var(--spytial-ed-border, #d9d2c0)",backgroundColor:"var(--spytial-ed-surface-raised, #f1ecdf)",color:"var(--spytial-ed-text, #221d14)",borderRadius:"var(--spytial-ed-radius, 2px)",fontSize:"0.85em"}});function j$(t,e){if(!t)return[];let n=[];for(let i of t){if(i.from===void 0||i.to===void 0)continue;let r=Math.max(0,Math.min(i.from,e)),s=Math.max(r,Math.min(i.to,e));n.push({from:r,to:s,severity:i.severity,message:i.message,source:i.code})}return n.sort((i,r)=>i.from-r.from),n}var AS=({value:t,onChange:e,diagnostics:n,hasUnappliedEdits:i=!1,showLineNumbers:r=!0,syntaxHighlighting:s=!0,disabled:o=!1,"aria-label":l="Layout specification YAML",className:a})=>{let c=(0,sn.useRef)(null),u=(0,sn.useRef)(null),f=(0,sn.useRef)(e);f.current=e;let h=(0,sn.useRef)(new ea),m=`${(0,sn.useId)()}-diag`;(0,sn.useEffect)(()=>{let b=c.current;if(!b)return;let p=[wM(),w1.of([...ZM,...TM]),...r?[jD()]:[],...s?[gR(),uM(U$)]:[],ER(),F$,h.current.of([H.editable.of(!o),De.readOnly.of(o)]),H.contentAttributes.of({"aria-label":l,"aria-describedby":m}),H.updateListener.of(v=>{v.docChanged&&f.current(v.state.doc.toString())})],y=new H({state:De.create({doc:t,extensions:p}),parent:b});return u.current=y,()=>{y.destroy(),u.current=null}},[]),(0,sn.useEffect)(()=>{let b=u.current;if(!b)return;let p=b.state.doc.toString();p!==t&&b.dispatch({changes:{from:0,to:p.length,insert:t}})},[t]),(0,sn.useEffect)(()=>{let b=u.current;b&&b.dispatch(SR(b.state,j$(n,b.state.doc.length)))},[n]),(0,sn.useEffect)(()=>{let b=u.current;b&&b.dispatch({effects:h.current.reconfigure([H.editable.of(!o),De.readOnly.of(o)])})},[o]);let g=(0,sn.useMemo)(()=>!n||n.length===0?[]:[...n].sort((b,p)=>{let y=DR[b.severity]-DR[p.severity];return y!==0?y:(b.line??1/0)-(p.line??1/0)}),[n]);return(0,Yi.jsxs)("div",{className:`spytial-ed-code${a?` ${a}`:""}`,children:[i?(0,Yi.jsx)("div",{className:"spytial-ed-code-notice",role:"status",children:"Text has unapplied edits \u2014 fix the error below to update the builder."}):null,(0,Yi.jsx)("div",{ref:c,className:`spytial-ed-code-cm${o?" spytial-ed-code-cm--disabled":""}`}),g.length>0?(0,Yi.jsx)("ul",{className:"spytial-ed-code-diagnostics",id:m,children:g.map((b,p)=>(0,Yi.jsxs)("li",{className:`spytial-ed-diagnostic spytial-ed-diagnostic--${b.severity}`,children:[(0,Yi.jsx)("span",{className:"spytial-ed-diagnostic-dot","aria-hidden":"true"}),b.line!==void 0?(0,Yi.jsx)("span",{className:"spytial-ed-code-diagnostic-loc",children:b.column!==void 0?`Ln ${b.line}, Col ${b.column}`:`Ln ${b.line}`}):null,(0,Yi.jsx)("span",{className:"spytial-ed-diagnostic-msg",children:b.message})]},p))}):null]})};var oe=be(Cn());var q=be(rt()),V$=new Set(["orientation","cyclic","align","groupselector","groupfield"]),OS=({constraints:t,directives:e,diagnostics:n,options:i,selectorProps:r,onAddItem:s,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h=!1,className:d})=>{let[m,g]=(0,oe.useState)(null),b=(0,oe.useCallback)(S=>{g(w=>w===S?null:S)},[]),p=(0,oe.useCallback)(S=>g(null),[]),y=(0,oe.useCallback)((S,w)=>{let O=s(S,w);return O&&typeof O=="object"&&"id"in O&&g(O.id),O},[s]),v=t.length===0&&e.length===0;return(0,q.jsxs)("div",{className:`spytial-ed-builder${d?` ${d}`:""}`,children:[(0,q.jsx)(MR,{title:"Constraints",kind:"constraint",items:t,diagnostics:n,options:i,selectorProps:r,expandedId:m,onToggleExpand:b,onCollapse:p,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),(0,q.jsx)(MR,{title:"Directives",kind:"directive",items:e,diagnostics:n,options:i,selectorProps:r,expandedId:m,onToggleExpand:b,onCollapse:p,onAddItem:y,onUpdateParam:o,onUpdateComment:l,onToggleNegate:a,onDuplicate:c,onRemove:u,onMove:f,disabled:h}),v?(0,q.jsx)("p",{className:"spytial-ed-builder-empty",children:"No constraints or directives yet \u2014 add one to start shaping the layout."}):null]})},MR=({title:t,kind:e,items:n,diagnostics:i,options:r,selectorProps:s,expandedId:o,onToggleExpand:l,onCollapse:a,onAddItem:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:m,onMove:g,disabled:b})=>{let p=`${t} List`,y=(0,oe.useRef)(new Map),v=(0,oe.useRef)(null),S=(0,oe.useRef)(null),w=(0,oe.useCallback)((k,A)=>{A?y.current.set(k,A):y.current.delete(k)},[]),O=(0,oe.useCallback)(k=>{let A=n.findIndex(R=>R.id===k),M=n[A+1],T=n[A-1];S.current=M?.id??T?.id??"__add__",m(k)},[n,m]);return(0,oe.useEffect)(()=>{let k=S.current;if(k!==null){if(S.current=null,k==="__add__"){v.current?.focus();return}y.current.get(k)?.focus()}},[n]),(0,q.jsxs)("section",{className:"spytial-ed-section","aria-label":t,children:[(0,q.jsxs)("div",{className:"spytial-ed-section-head",children:[(0,q.jsx)("h3",{className:"spytial-ed-section-title",children:t}),(0,q.jsx)(K$,{kind:e,onAdd:c,disabled:b,triggerRef:v})]}),(0,q.jsx)("ul",{className:"spytial-ed-rows","aria-label":p,children:n.map((k,A)=>(0,q.jsx)($$,{item:k,index:A,count:n.length,diagnostics:i,options:r,selectorProps:s,expanded:o===k.id,onToggleExpand:l,onCollapse:a,registerToggle:w,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:O,onMove:g,disabled:b},k.id))})]})},$$=({item:t,index:e,count:n,diagnostics:i,options:r,selectorProps:s,expanded:o,onToggleExpand:l,onCollapse:a,registerToggle:c,onUpdateParam:u,onUpdateComment:f,onToggleNegate:h,onDuplicate:d,onRemove:m,onMove:g,disabled:b})=>{let p=(0,oe.useId)(),y=`${p}-panel`,v=zt(t.type),S=(0,oe.useRef)(null),w=t.id;(0,oe.useEffect)(()=>(c(w,S.current),()=>c(w,null)),[w,c]);let O=(0,oe.useMemo)(()=>(i??[]).filter(R=>R.itemId===t.id),[i,t.id]),k=Q$(O);if(!v)return(0,q.jsx)("li",{className:"spytial-ed-row spytial-ed-row--unknown",children:(0,q.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,q.jsx)("span",{className:"spytial-ed-badge spytial-ed-badge--unknown",children:t.kind==="constraint"?"C":"D"}),(0,q.jsx)("span",{className:"spytial-ed-row-type",children:t.type}),(0,q.jsx)("span",{className:"spytial-ed-row-summary spytial-ed-row-summary--muted",children:"preserved as written"})]})});let A=(()=>{try{return v.summary(t.params)}catch{return""}})(),M=V$.has(t.type),T=t.params.hold==="never";return(0,q.jsxs)("li",{className:`spytial-ed-row${o?" spytial-ed-row--expanded":""}${k?` spytial-ed-row--${k}`:""}`,children:[(0,q.jsxs)("div",{className:"spytial-ed-row-main",children:[(0,q.jsxs)("button",{ref:S,type:"button",className:"spytial-ed-row-toggle","aria-expanded":o,"aria-controls":y,disabled:b,onClick:()=>l(t.id),children:[(0,q.jsx)("span",{className:`spytial-ed-badge spytial-ed-badge--${t.kind}`,"aria-hidden":"true",children:t.kind==="constraint"?"C":"D"}),(0,q.jsx)("span",{className:"spytial-ed-row-type",children:v.label}),T?(0,q.jsx)("span",{className:"spytial-ed-row-negated",role:"img","aria-label":"should not hold",title:"should not hold (hold: never)",children:"\xAC"}):null,(0,q.jsx)("span",{className:"spytial-ed-row-summary",children:A}),k?(0,q.jsx)("span",{className:`spytial-ed-row-dot spytial-ed-row-dot--${k}`,role:"img","aria-label":`${k}: ${O.length} issue${O.length===1?"":"s"}`}):null]}),(0,q.jsx)(Y$,{item:t,index:e,count:n,disabled:b,onDuplicate:d,onRemove:m,onMove:g,onAddComment:()=>l(t.id)})]}),o?(0,q.jsxs)("div",{className:"spytial-ed-row-panel",id:y,onKeyDown:R=>{R.key==="Escape"&&(R.stopPropagation(),a(t.id),S.current?.focus())},children:[(0,q.jsx)(ep,{fields:G$(v.fields),values:t.params,diagnostics:O,options:r,disabled:b,onChange:(R,C)=>u(t.id,R,C),selectorProps:s?R=>s(t,R):void 0}),M?(0,q.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--hold",children:[(0,q.jsx)("span",{className:"spytial-ed-field-label",id:`${p}-hold-label`,title:"Whether this constraint must hold, or must NOT hold (hold: never), in the layout.",children:"Condition"}),(0,q.jsx)("div",{className:"spytial-ed-field-control",children:(0,q.jsxs)("div",{className:"spytial-ed-pills",role:"radiogroup","aria-labelledby":`${p}-hold-label`,children:[(0,q.jsx)("button",{type:"button",role:"radio","aria-checked":!T,className:`spytial-ed-pill${T?"":" spytial-ed-pill--active"}`,disabled:b,onClick:()=>h(t.id,!1),children:"Should hold"}),(0,q.jsx)("button",{type:"button",role:"radio","aria-checked":T,className:`spytial-ed-pill${T?" spytial-ed-pill--active spytial-ed-pill--negated":""}`,disabled:b,onClick:()=>h(t.id,!0),children:"Should not hold"})]})})]}):null,(0,q.jsxs)("div",{className:"spytial-ed-field spytial-ed-field--text",children:[(0,q.jsx)("label",{className:"spytial-ed-field-label",htmlFor:`${p}-comment`,children:"Comment"}),(0,q.jsx)("div",{className:"spytial-ed-field-control",children:(0,q.jsx)("input",{id:`${p}-comment`,type:"text",className:"spytial-ed-input",value:t.comment??"",placeholder:"Optional note (round-trips as a YAML comment)",disabled:b,onChange:R=>f(t.id,R.target.value)})})]})]}):null]})},Y$=({item:t,index:e,count:n,disabled:i,onDuplicate:r,onRemove:s,onMove:o,onAddComment:l})=>{let[a,c]=(0,oe.useState)(!1),u=(0,oe.useRef)(null),f=(0,oe.useRef)(null),h=bu(a,f,{align:"end",estimatedHeight:220}),d=zt(t.type)?.label??t.type;(0,oe.useEffect)(()=>{if(!a)return;let b=p=>{u.current&&!u.current.contains(p.target)&&c(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a]);let m=(0,oe.useCallback)(()=>c(!1),[]),g=(0,oe.useCallback)(b=>{b(),m()},[m]);return(0,q.jsxs)("div",{className:"spytial-ed-overflow",ref:u,children:[(0,q.jsx)("button",{ref:f,type:"button",className:"spytial-ed-overflow-btn","aria-haspopup":"menu","aria-expanded":a,"aria-label":`Actions for ${d}`,disabled:i,onClick:()=>c(b=>!b),children:(0,q.jsx)("span",{"aria-hidden":"true",children:"\u22EF"})}),a?(0,q.jsxs)("ul",{className:"spytial-ed-overflow-menu",style:h,role:"menu","aria-label":`Actions for ${d}`,onKeyDown:b=>{b.key==="Escape"&&(b.stopPropagation(),m())},children:[(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(l),children:"Add comment"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",onClick:()=>g(()=>r(t.id)),children:"Duplicate"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e===0,onClick:()=>g(()=>o(t.id,-1)),children:"Move up"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item",disabled:e>=n-1,onClick:()=>g(()=>o(t.id,1)),children:"Move down"})}),(0,q.jsx)("li",{role:"none",children:(0,q.jsx)("button",{type:"button",role:"menuitem",className:"spytial-ed-overflow-item spytial-ed-overflow-item--danger","aria-label":`Remove ${d} ${t.kind}`,onClick:()=>g(()=>s(t.id)),children:"Delete"})})]}):null]})},K$=({kind:t,onAdd:e,disabled:n,triggerRef:i})=>{let[r,s]=(0,oe.useState)(!1),[o,l]=(0,oe.useState)(""),a=(0,oe.useRef)(null),c=(0,oe.useRef)(null),u=(0,oe.useRef)(null),f=(0,oe.useCallback)(y=>{u.current=y,typeof i=="function"?i(y):i&&typeof i=="object"&&(i.current=y)},[i]),h=bu(r,u,{align:"end",estimatedHeight:320}),d=(0,oe.useMemo)(()=>U0(t),[t]),m=(0,oe.useMemo)(()=>{let y=o.trim().toLowerCase();return y?d.filter(v=>v.label.toLowerCase().includes(y)||v.type.toLowerCase().includes(y)||(v.description??"").toLowerCase().includes(y)):d},[d,o]);(0,oe.useEffect)(()=>{if(!r)return;requestAnimationFrame(()=>c.current?.focus());let y=v=>{a.current&&!a.current.contains(v.target)&&s(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[r]);let g=(0,oe.useCallback)(()=>{s(!1),l("")},[]),b=(0,oe.useCallback)(y=>{e(t,y),g()},[e,t,g]),p=t==="constraint"?"Add constraint":"Add directive";return(0,q.jsxs)("div",{className:"spytial-ed-add",ref:a,children:[(0,q.jsxs)("button",{ref:f,type:"button",className:"spytial-ed-add-btn","aria-haspopup":"menu","aria-expanded":r,disabled:n,onClick:()=>s(y=>!y),children:["+ ",p]}),r?(0,q.jsxs)("div",{className:"spytial-ed-add-menu",style:h,role:"menu","aria-label":p,onKeyDown:y=>{y.key==="Escape"&&(y.preventDefault(),g())},children:[(0,q.jsx)("input",{ref:c,type:"text",className:"spytial-ed-add-search",value:o,placeholder:"Search types\u2026","aria-label":`Search ${t} types`,onChange:y=>l(y.target.value)}),(0,q.jsx)("ul",{className:"spytial-ed-add-list",children:m.length===0?(0,q.jsx)("li",{className:"spytial-ed-add-empty",children:"No matching types."}):m.map(y=>(0,q.jsx)("li",{role:"none",children:(0,q.jsxs)("button",{type:"button",role:"menuitem",className:"spytial-ed-add-item",onClick:()=>b(y.type),children:[(0,q.jsx)("span",{className:"spytial-ed-add-item-label",children:y.label}),y.description?(0,q.jsx)("span",{className:"spytial-ed-add-item-desc",children:y.description}):null]})},y.type))})]}):null]})};function G$(t){return t.filter(e=>e.key!=="hold")}function Q$(t){if(t.length!==0)return t.some(e=>e.severity==="error")?"error":t.some(e=>e.severity==="warning")?"warning":"info"}var wt=be(rt()),TS=({result:t,onDismiss:e})=>{let n=t.suggestions??[],i=t.notes??[];return(0,wt.jsxs)("div",{className:"spytial-ed-suggestions",role:"region","aria-label":"Layout suggestions",children:[(0,wt.jsxs)("div",{className:"spytial-ed-suggestions-head",children:[(0,wt.jsx)("span",{className:"spytial-ed-suggestions-title",children:n.length>0?`${n.length} suggestion${n.length===1?"":"s"}`:"Suggestion applied"}),(0,wt.jsx)("button",{type:"button",className:"spytial-ed-suggestions-dismiss","aria-label":"Dismiss suggestions",title:"Dismiss",onClick:e,children:(0,wt.jsx)("span",{"aria-hidden":"true",children:"\xD7"})})]}),n.length>0?(0,wt.jsx)("ul",{className:"spytial-ed-suggestions-list",children:n.map(r=>(0,wt.jsx)(X$,{suggestion:r},r.id))}):null,i.length>0?(0,wt.jsx)("ul",{className:"spytial-ed-suggestions-notes",children:i.map((r,s)=>(0,wt.jsx)("li",{children:r},s))}):null]})},X$=({suggestion:t})=>{let{id:e,rationale:n,confidence:i,outcome:r}=t;return(0,wt.jsxs)("li",{className:`spytial-ed-suggestion${r==="omitted"?" spytial-ed-suggestion--omitted":""}`,children:[(0,wt.jsxs)("div",{className:"spytial-ed-suggestion-head",children:[(0,wt.jsx)("span",{className:"spytial-ed-suggestion-text",children:n||e}),i?(0,wt.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${i}`,title:`${i} confidence`,children:i}):null,r?(0,wt.jsx)("span",{className:`spytial-ed-suggestion-chip spytial-ed-suggestion-chip--${r}`,title:`Outcome: ${r}`,children:r}):null]}),n?(0,wt.jsx)("code",{className:"spytial-ed-suggestion-id",children:e}):null]})};var j=be(Cn());var Xe=be(rt()),W$=300,Z$=400,ES=({value:t,onChange:e,instance:n,domain:i,theme:r,selectorAssistant:s,layoutAssistant:o,density:l="compact",syntaxHighlighting:a=!0,defaultView:c="builder",view:u,onViewChange:f,className:h,disabled:d=!1,"aria-label":m="Layout specification editor",onDiagnostics:g})=>{let b=(0,j.useRef)(null);b.current===null&&(b.current=J$(t));let p=b.current.doc,[,y]=(0,j.useReducer)(z=>z+1,0),v=(0,j.useRef)(t),S=(0,j.useRef)(0),[w,O]=(0,j.useState)(c),k=u??w,A=(0,j.useRef)(null),M=(0,j.useRef)(null),T=(0,j.useRef)(()=>{}),R=(0,j.useCallback)(z=>{T.current(),u===void 0&&O(z),f?.(z)},[u,f]),[C,V]=(0,j.useState)(()=>b.current?.error??null),$=(0,j.useMemo)(()=>{if(i)return i;if(n)return Ub(n)},[i,n]),Te=(0,j.useMemo)(()=>jb($),[$]),Gt=(0,j.useMemo)(()=>$?.relations.map(z=>z.name)??[],[$]),vi=(0,j.useMemo)(()=>$?.types.map(z=>z.name)??[],[$]),ye=(0,j.useCallback)(()=>{let z=p.toYaml();v.current=z,S.current+=1,V(null),e(z)},[p,e]),[at,Qn]=(0,j.useState)([]),kt=(0,j.useRef)(0),Fe=(0,j.useRef)(null),mt=(0,j.useMemo)(()=>p.validate($),[p,$,t]),gt=(0,j.useMemo)(()=>[...mt,...at],[mt,at]),on=(0,j.useRef)("");(0,j.useEffect)(()=>{if(!g)return;let z=e7(gt);z!==on.current&&(on.current=z,g(gt))},[gt,g]),(0,j.useEffect)(()=>{if(t===v.current)return;let z;try{z=p.toYaml()}catch{z=""}if(t===z){v.current=t;return}try{p.replaceFromYaml(t),v.current=t,S.current+=1,V(null),y()}catch(Ce){V(CS(Ce))}},[t,p]),(0,j.useEffect)(()=>p.subscribe(()=>y()),[p]);let ln=(0,j.useCallback)(()=>{A.current&&(clearTimeout(A.current),A.current=null);let z=M.current;if(M.current=null,!!z&&S.current===z.seq)try{p.replaceFromYaml(z.text),V(null),y()}catch(Ce){V(CS(Ce))}},[p]);T.current=ln;let Xn=(0,j.useCallback)(z=>{d||(v.current=z,e(z),A.current&&clearTimeout(A.current),M.current={text:z,seq:S.current},A.current=setTimeout(ln,W$))},[d,e,ln]);(0,j.useEffect)(()=>()=>{Ia.current=!1,A.current&&clearTimeout(A.current),Fe.current&&clearTimeout(Fe.current)},[]);let[Wn,Io]=(0,j.useState)({running:!1,result:null,error:null}),Bo=(0,j.useRef)(0),Ia=(0,j.useRef)(!0),Qm=(0,j.useCallback)(()=>{let z=o?.suggest;if(!z||d)return;T.current();let Ce=++Bo.current;Io({running:!0,result:null,error:null});let At={domain:$,instance:n,currentYaml:t};Promise.resolve().then(()=>z(At)).then(Tn=>{Ce!==Bo.current||!Ia.current||(p.replaceFromYaml(Tn.yaml),ye(),Io({running:!1,result:Tn,error:null}))}).catch(Tn=>{Ce!==Bo.current||!Ia.current||Io({running:!1,result:null,error:Tn instanceof Error?Tn.message:String(Tn)})})},[o,d,$,n,t,p,ye]),qo=(0,j.useCallback)(()=>{Bo.current+=1,Io({running:!1,result:null,error:null})},[]),Df=(0,j.useCallback)((z,Ce)=>{if(d)return;let At=p.addItem(z,Ce);return ye(),At},[d,p,ye]),Xm=(0,j.useCallback)((z,Ce,At)=>{if(d)return;let Tn=At===""?void 0:At;p.updateItem(z,{params:{[Ce]:Tn}}),ye()},[d,p,ye]),Wm=(0,j.useCallback)((z,Ce)=>{d||(p.updateItem(z,{comment:Ce}),ye())},[d,p,ye]),Zm=(0,j.useCallback)((z,Ce)=>{d||(p.updateItem(z,{params:{hold:Ce?"never":void 0}}),ye())},[d,p,ye]),Jm=(0,j.useCallback)(z=>{d||!p.duplicateItem(z)||ye()},[d,p,ye]),F=(0,j.useCallback)(z=>{d||(p.removeItem(z),ye())},[d,p,ye]),ne=(0,j.useCallback)((z,Ce)=>{if(d)return;let At=p.getState(),Rr=(At.constraints.some(Ot=>Ot.id===z)?At.constraints:At.directives).findIndex(Ot=>Ot.id===z);Rr!==-1&&(p.moveItem(z,Rr+Ce),ye())},[d,p,ye]),Qi=(0,j.useCallback)(()=>{d||!p.canUndo()||(p.undo(),ye())},[d,p,ye]),Mr=(0,j.useCallback)(()=>{d||!p.canRedo()||(p.redo(),ye())},[d,p,ye]),Po=(0,j.useCallback)(z=>{!(z.metaKey||z.ctrlKey)||z.key.toLowerCase()!=="z"||(z.preventDefault(),z.shiftKey?Mr():Qi())},[Qi,Mr]),Ls=(0,j.useCallback)((z,Ce)=>{if(Ce.kind!=="selector")return;let At={itemKind:z.kind,itemType:z.type,fieldKey:Ce.key,domain:$,specYaml:v.current},Rr={complete:Ot=>{let Xi=Te(Ot),Wi=s?.complete;if(!Wi)return Xi;let Ba={...At,currentValue:String(z.params[Ce.key]??"")},Mf;try{Mf=Wi(Ba,Ot)??[]}catch{return Xi}return Promise.resolve(Mf).then(eg=>Vb(eg??[],Xi)).catch(()=>Xi)},highlight:a};if(s?.synthesize){let Ot=s.synthesize;Rr.synthesize=Xi=>{let Wi={...At,currentValue:String(z.params[Ce.key]??"")};return Ot(Wi,Xi)}}return Rr},[$,Te,s,a]);(0,j.useEffect)(()=>{let z=s?.review;if(!z){Qn([]);return}Fe.current&&clearTimeout(Fe.current);let Ce=++kt.current;Fe.current=setTimeout(()=>{let At=p.getState(),Tn=[...At.constraints,...At.directives],Rr=[];for(let Ot of Tn){let Xi=zt(Ot.type);if(Xi)for(let Wi of Xi.fields){if(Wi.kind!=="selector")continue;let Ba=String(Ot.params[Wi.key]??"");if(Ba.trim()==="")continue;let Mf={itemKind:Ot.kind,itemType:Ot.type,fieldKey:Wi.key,currentValue:Ba,domain:$,specYaml:v.current};Rr.push(Promise.resolve().then(()=>z(Mf,Ba)).then(eg=>(eg??[]).map(U4=>({...U4,itemId:Ot.id,fieldKey:Wi.key,source:"assistant"}))).catch(()=>[]))}}Promise.all(Rr).then(Ot=>{Ce===kt.current&&Qn(Ot.flat())}).catch(()=>{Ce===kt.current&&Qn([])})},Z$)},[s,$,t,p]);let Si=p.getState(),Tx=C!==null,z4=["spytial-ed",l==="compact"?"spytial-ed--compact":"",h??""].filter(Boolean).join(" "),H4=(0,j.useMemo)(()=>Hb(t,$),[t,$]),Cx=Yb(r);return(0,Xe.jsxs)("section",{className:z4,style:Cx?$b(Cx):void 0,"aria-label":m,onKeyDown:Po,children:[(0,Xe.jsxs)("div",{className:"spytial-ed-toolbar",children:[(0,Xe.jsxs)("div",{className:"spytial-ed-viewtoggle",role:"tablist","aria-label":"Editor view",children:[(0,Xe.jsxs)("button",{type:"button",role:"tab","aria-selected":k==="builder",className:`spytial-ed-viewtoggle-btn${k==="builder"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:d,onClick:()=>R("builder"),children:["Builder",Tx?(0,Xe.jsx)("span",{className:"spytial-ed-diagnostic-badge spytial-ed-diagnostic-badge--warning",title:"Text has unapplied edits","aria-label":"Text has unapplied edits",children:"!"}):null]}),(0,Xe.jsx)("button",{type:"button",role:"tab","aria-selected":k==="code",className:`spytial-ed-viewtoggle-btn${k==="code"?" spytial-ed-viewtoggle-btn--active":""}`,disabled:d,onClick:()=>R("code"),children:"Code"})]}),(0,Xe.jsxs)("div",{className:"spytial-ed-toolbar-actions",children:[o?.suggest?(0,Xe.jsxs)("button",{type:"button",className:"spytial-ed-suggest-btn",title:"Suggest a layout for the current data",disabled:d||Wn.running,"aria-busy":Wn.running,onClick:Qm,children:[(0,Xe.jsx)("span",{"aria-hidden":"true",children:"\u2726"}),Wn.running?"Analyzing\u2026":"Suggest"]}):null,(0,Xe.jsxs)("div",{className:"spytial-ed-history",children:[(0,Xe.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Undo",title:"Undo (Cmd/Ctrl+Z)",disabled:d||!p.canUndo(),onClick:Qi,children:(0,Xe.jsx)("span",{"aria-hidden":"true",children:"\u21B6"})}),(0,Xe.jsx)("button",{type:"button",className:"spytial-ed-history-btn","aria-label":"Redo",title:"Redo (Shift+Cmd/Ctrl+Z)",disabled:d||!p.canRedo(),onClick:Mr,children:(0,Xe.jsx)("span",{"aria-hidden":"true",children:"\u21B7"})})]})]})]}),Wn.error!==null?(0,Xe.jsx)("p",{className:"spytial-ed-suggest-error",role:"alert",children:Wn.error}):null,Wn.result!==null?(0,Xe.jsx)(TS,{result:Wn.result,onDismiss:qo}):null,(0,Xe.jsx)("div",{className:"spytial-ed-body",children:k==="builder"?(0,Xe.jsx)(OS,{constraints:Si.constraints,directives:Si.directives,diagnostics:gt,options:{relationNames:Gt,typeNames:vi},selectorProps:Ls,onAddItem:Df,onUpdateParam:Xm,onUpdateComment:Wm,onToggleNegate:Zm,onDuplicate:Jm,onRemove:F,onMove:ne,disabled:d}):(0,Xe.jsx)(AS,{value:t,onChange:Xn,diagnostics:H4,hasUnappliedEdits:Tx,syntaxHighlighting:a,disabled:d})})]})};function J$(t){try{return{doc:ql.fromYaml(t),error:null}}catch(e){return{doc:new ql,error:CS(e)}}}function CS(t){return t instanceof as?{severity:"error",message:t.message,source:"yaml",...t.line!==void 0?{line:t.line}:{},...t.column!==void 0?{column:t.column}:{}}:{severity:"error",message:t instanceof Error?t.message:String(t),source:"yaml"}}function e7(t){return t.map(e=>`${e.severity}|${e.source}|${e.itemId??""}|${e.fieldKey??""}|${e.line??""}|${e.column??""}|${e.message}`).join(`
|
|
198
|
+
`)}function RR(t){return{id:t.id,type:t.type,params:{...t.params},...t.comment!==void 0?{comment:t.comment}:{}}}function NR(t){let e=cs(t);return{constraints:e.constraints.map(n=>RR(n)),directives:e.directives.map(n=>RR(n))}}var ppe=ad("constraint"),mpe=[...ad("directive"),"size","hideAtom"];var _R=be(rt()),DS=({yamlValue:t,value:e,onChange:n,isNoCodeView:i,onViewChange:r,constraints:s,setConstraints:o,directives:l,setDirectives:a,instance:c,domain:u,theme:f,selectorAssistant:h,layoutAssistant:d,density:m,syntaxHighlighting:g,onDiagnostics:b,className:p,disabled:y=!1,"aria-label":v="CND Layout Specification Interface"})=>{let S=e??t??"",w=i===void 0?void 0:i?"builder":"code",O=(0,sf.useCallback)(M=>{r?.(M==="builder")},[r]),k=(0,sf.useCallback)(M=>{if(n(M),o||a)try{let T=NR(M);o?.(()=>T.constraints),a?.(()=>T.directives)}catch{}},[n,o,a]),A=(0,sf.useMemo)(()=>{let M={value:S,onChange:k,defaultView:"builder",disabled:y,"aria-label":v};return w!==void 0&&(M.view=w,M.onViewChange=O),c!==void 0&&(M.instance=c),u!==void 0&&(M.domain=u),f!==void 0&&(M.theme=f),h!==void 0&&(M.selectorAssistant=h),d!==void 0&&(M.layoutAssistant=d),m!==void 0&&(M.density=m),g!==void 0&&(M.syntaxHighlighting=g),b!==void 0&&(M.onDiagnostics=b),p!==void 0&&(M.className=p),M},[S,k,w,O,c,u,f,h,d,m,g,b,p,y,v]);return(0,_R.jsx)(ES,{...A})};function bm(t){return t.tuples}function LR(t){return t.types[t.types.length-1]}function IR(t){return t.atoms}function Es(t){return t.meta!==void 0&&t.meta.builtin===!0}function vm(t,e,n){return typeof e=="string"&&(e=Sm(t,e)),typeof n!="string"&&(n=n.id),e.types.includes(n)}function Ds(t,e){let n=Eo(t).find(i=>i.id===e);if(!n)throw new Error(`Could not find atom with id ${e}`);return n}function Eo(t){return lf(t).map(IR).reduce((e,n)=>e.concat(n),[])}function BR(t,e){let n=Ds(t,e),i={...t.types},r={...t.relations},s={...t.skolems},o=t.types[n.type];if(o){let l=o.atoms.filter(a=>a.id!==e);l.length===0?delete i[o.id]:i[n.type]={...o,atoms:l};for(let[a,c]of Object.entries(t.relations)){let u=c.tuples.filter(f=>!f.atoms.includes(e));r[a]={...c,tuples:u}}for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!f.atoms.includes(e));s[a]={...c,tuples:u}}return{types:i,relations:r,skolems:s}}else throw new Error(`Could not find type for atom ${e}`)}function qR(t,e){let n={...t.types},i=n[e.type];if(i)n[e.type]={...i,atoms:[...i.atoms,e]};else{let r={_:"type",id:e.type,types:[e.type,"univ"],atoms:[e]};n[r.id]=r}return{...t,types:n}}function PR(t,e,n){let i=r7(t,e),r={...t.relations},s={...t.skolems},o=(a,c)=>a.atoms.length===c.atoms.length&&a.atoms.every((u,f)=>u===c.atoms[f]),l=i.tuples.filter(a=>!o(a,n));r[i.id]={...i,tuples:l};for(let[a,c]of Object.entries(t.skolems)){let u=c.tuples.filter(f=>!o(f,n));u.length===0?delete s[a]:s[a]={...c,tuples:u}}return{...t,relations:r,skolems:s}}function zR(t,e,n){let i=t.relations[e];if(!i){let o=Object.values(t.relations).filter(l=>l.name===e);o.length>1&&console.warn(`addInstanceRelationTuple: name "${e}" is ambiguous (${o.map(l=>l.id).join(", ")}); appending to the first. Use a qualified id (Sig<:field) to disambiguate.`),i=o[0]}let r={...t.relations},s={...t.skolems};return i?r[i.id]={...i,tuples:[...i.tuples,n]}:r[e]={id:e,name:e,tuples:[n],types:n.types,_:"relation"},{...t,relations:r,skolems:s}}function r7(t,e){let n=t.relations[e];if(n)return n;let i=Object.values(t.relations).filter(r=>r.name===e);if(i.length>1&&console.warn(`getInstanceRelation: name "${e}" is ambiguous (${i.map(r=>r.id).join(", ")}); returning the first. Use a qualified id (Sig<:field) to disambiguate.`),i.length>0)return i[0];throw new Error(`Could not find relation ${e}`)}function Oa(t){return Object.values(t.relations)}function of(t,e){let n=[];for(let i of Object.values(t.skolems))for(let r of i.tuples)if(r.atoms.includes(e)){n.push(i.name);break}return n}function Sm(t,e){let n=t.types[e];if(!n)throw new Error(`Could not find type with id ${e}`);return n}function lf(t){return Object.values(t.types)}function HR(t,e){return typeof e=="string"&&(e=Ds(t,e)),af(t,e).types.map(r=>Sm(t,r)).some(Es)}function af(t,e){if(typeof e=="string"&&(e=Ds(t,e)),!t.types[e.type])throw new Error(`The atom's type is not part of the instance: ${e.type}`);return t.types[e.type]}function UR(t,e){let n={};return e.forEach(i=>{let r=af(t,i),s=LR(r);if(!n[s])n[s]=i;else throw new Error(`Cannot project ${i} and ${n[s]}. Both are of type ${s}`)}),{types:s7(t,n),relations:o7(t,n),skolems:t.skolems}}function s7(t,e){let n={},i=Object.keys(e);for(let r in t.types){let s=t.types[r],o=i.some(l=>vm(t,s,l));n[r]={_:"type",id:s.id,types:s.types,atoms:o?[]:s.atoms,meta:s.meta}}return n}function o7(t,e){let n={},i=Object.keys(e),r=Object.values(e);for(let s in t.relations){let o=t.relations[s],l=o.types.some(c=>i.some(u=>vm(t,c,u))),a=l?l7(t,o.types,i):[];n[s]={_:"relation",id:o.id,name:o.name,types:l?MS(o.types,a):o.types,tuples:l?a7(o.tuples,a,r):o.tuples},l||(n[s]=o)}return n}function l7(t,e,n){let i=[];return e.forEach((r,s)=>{n.some(o=>vm(t,r,o))&&i.push(s)}),i}function a7(t,e,n){return t.filter(i=>i.atoms.some(r=>n.includes(r))).map(i=>({_:"tuple",types:MS(i.types,e),atoms:MS(i.atoms,e)})).filter(i=>i.atoms.length>1)}function MS(t,e){let n=[];for(let i=0;i<t.length;i++)e.includes(i)||n.push(t[i]);return n}function Do(t){return t.id}function RS(t,e){let n=t.id,i=e.atoms;return`${n}:${i.join("->")}`}var B4=be(I4());function Yre(t,e){return e<2?[0,0]:[0,e-1]}function q4(t,e,n){let i=new B4.Graph({directed:!0,multigraph:!0}),{nodeIds:r,edgeIds:s}=Kre(t,e,n);return Eo(t).forEach(o=>{let l=Do(o);r.has(l)&&i.setNode(l,l)}),Oa(t).forEach(o=>{bm(o).forEach(a=>{let c=RS(o,a),u=a.atoms,[f,h]=Yre(o.id,u.length),d=f?u[f]:u[0],m=h?u[h]:u[u.length-1];if(d&&m&&s.has(c)){let g=u.slice(1,-1).join(","),b=g.length>0?`[${g}]`:"",p=o.name+b,y=Do(Ds(t,d)),v=Do(Ds(t,m));i.setEdge(y,v,p,c)}})}),i}function Kre(t,e,n){let i=new Set,r=new Set;return Oa(t).forEach(s=>{bm(s).forEach(o=>{let l=o.atoms.map(u=>Ds(t,u)),[a,c]=Gre(s,l);a&&c&&(i.add(Do(a)),i.add(Do(c)),r.add(RS(s,o)))})}),Eo(t).forEach(s=>{let o=Do(s);i.has(o)||e||(!HR(t,s)||!n)&&i.add(o)}),{nodeIds:i,edgeIds:r}}function Gre(t,e){let n=e[0],i=e[e.length-1];return[n,i]}var Km=class t{constructor(e){this.eventListeners=new Map;this.alloyInstance=e,this.declaredTypeIds=new Set(Object.keys(e.types)),this.declaredRelationNames=new Set(Object.values(e.relations).map(n=>n.name))}isValidForgeIdentifier(e){return/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(e)}sanitizeForgeIdentifier(e,n){let i=e.replace(/[^A-Za-z0-9_$]/g,"_");i||(i="_"),/^[A-Za-z_$]/.test(i)||(i=`_${i}`);let r=i,s=1;for(;n.has(r);)r=`${i}_${s}`,s++;return n.add(r),r}addEventListener(e,n){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(n)}removeEventListener(e,n){let i=this.eventListeners.get(e);i&&i.delete(n)}emitEvent(e){let n=this.eventListeners.get(e.type);n&&n.forEach(i=>{try{i(e)}catch(r){console.error("Error in data instance event listener:",r)}})}getAtomType(e){let n=af(this.alloyInstance,e);return{id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=of(this.alloyInstance,i.id);return{id:i.id,label:i.id,type:i.type,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:Es(n)}}getTypes(){return lf(this.alloyInstance).map(n=>({id:n.id,types:n.types,atoms:n.atoms.map(i=>{let r=of(this.alloyInstance,i.id);return{id:i.id,type:i.type,label:i.id,labels:r.length>0?{skolems:r}:void 0}}),isBuiltin:Es(n)}))}getAtoms(){return Eo(this.alloyInstance).map(n=>{let i=of(this.alloyInstance,n.id);return{id:n.id,type:n.type,label:n.id,labels:i.length>0?{skolems:i}:void 0}})}getRelations(){return Oa(this.alloyInstance).map(n=>({id:n.id,name:n.name,types:n.types,tuples:n.tuples.map(i=>({atoms:i.atoms,types:i.types}))}))}applyProjections(e){let n=UR(this.alloyInstance,e);return new t(n)}generateGraph(e,n){return q4(this.alloyInstance,e,n)}getAlloyInstance(){return this.alloyInstance}reify(){let e="",i="inst builtinstance {",r="}",s=this.alloyInstance.types,o=new Set,l=new Map,a=[],c=[],u=new Set,f=new Set,h=new Set,d=p=>{let y=l.get(p);if(y)return y;let v=this.sanitizeForgeIdentifier(p,o);return l.set(p,v),v!==p&&a.push(`${p} -> ${v}`),v},m={};for(let p in s){let y=s[p];if(Es(y))continue;if(!this.declaredTypeIds.has(p)){y.atoms.length>0&&c.push(p);continue}let v=y.atoms;m[p]=v.map(S=>(h.add(S.id),`\`${d(S.id)}`))}let g=this.alloyInstance.relations,b={};for(let p in g){let y=g[p];if(!this.declaredRelationNames.has(y.name)||!this.isValidForgeIdentifier(y.name)){y.tuples.length>0&&u.add(y.name);continue}let S=y.tuples.filter(O=>{let k=O.atoms.every((A,M)=>{let T=s[O.types[M]];return T&&Es(T)||h.has(A)});return k||f.add(y.name),k}).map(O=>`(${O.atoms.map((A,M)=>{let T=s[O.types[M]];return T&&Es(T)?A:`\`${d(A)}`}).join("->")})`),w=y.name;b[w]=(b[w]??[]).concat(S)}for(let p in m){let y=m[p];y.length>0&&(e+=`${p} = ${y.join("+")}
|
|
199
|
+
`)}for(let p in b){let y=b[p];y.length>0?e+=`${p} = ${y.join("+")}
|
|
200
|
+
`:e+=`no ${p}
|
|
201
201
|
`}return c.length>0&&console.warn(`AlloyDataInstance.reify: dropped ${c.length} sig(s) not declared in the parsed spec (${c.join(", ")}); their atoms were omitted from the inst.`),u.size>0&&console.warn(`AlloyDataInstance.reify: dropped ${u.size} field(s) not declared in the parsed spec or not a valid Forge identifier (${[...u].join(", ")}); their tuples were omitted from the inst.`),f.size>0&&console.warn(`AlloyDataInstance.reify: dropped tuple(s) from declared field(s) (${[...f].join(", ")}) that referenced unbound atoms (atoms of a dropped/undeclared sig); they were omitted to avoid a dangling reference.`),a.length>0&&console.warn(`AlloyDataInstance.reify: rewrote ${a.length} atom id(s) to valid Forge identifiers (${a.join(", ")}).`),`${i}
|
|
202
202
|
${e}
|
|
203
|
-
${r}`}removeAtom(e){this.alloyInstance=
|
|
203
|
+
${r}`}removeAtom(e){this.alloyInstance=BR(this.alloyInstance,e),this.emitEvent({type:"atomRemoved",data:{atomId:e}})}addAtom(e){let n={_:"atom",id:e.id,type:e.type};this.alloyInstance=qR(this.alloyInstance,n),this.emitEvent({type:"atomAdded",data:{atom:e}})}addRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=zR(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleAdded",data:{relationId:e,tuple:n}})}removeRelationTuple(e,n){let i={_:"tuple",atoms:n.atoms,types:n.types};this.alloyInstance=PR(this.alloyInstance,e,i),this.emitEvent({type:"relationTupleRemoved",data:{relationId:e,tuple:n}})}addFromDataInstance(e,n){if(!Qre(e))return!1;let i=e.getAlloyInstance(),r=new Map;return Eo(i).forEach(s=>{let o=this.getAtomType(s.id).isBuiltin;if(n&&o){let a=this.getAtoms().find(c=>c.type===s.type&&c.label===s.id);if(a){r.set(s.id,a.id);return}}let l=`atom_${this.getAtoms().length+1}`;r.set(s.id,l),this.addAtom({id:l,type:s.type,label:s.id})}),Oa(i).forEach(s=>{s.tuples.forEach(o=>{let l={atoms:o.atoms.map(a=>r.get(a)||a),types:o.types};this.addRelationTuple(s.id,l)})}),lf(i).forEach(s=>{this.getTypes().find(l=>l.id===s.id)||(this.alloyInstance.types[s.id]={_:"type",id:s.id,types:s.types,atoms:s.atoms.map(l=>({_:"atom",id:r.get(l.id)||l.id,type:l.type})),meta:{builtin:!1,abstract:!1,enum:!1,one:!1,private:!1}})}),!0}};function Qre(t){return t instanceof Km}function Gm(){let e={types:{univ:{_:"type",id:"univ",types:[],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}},Int:{_:"type",id:"Int",types:["Int","univ"],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}},"seq/Int":{_:"type",id:"seq/Int",types:["seq/Int","univ"],atoms:[],meta:{builtin:!0,abstract:!1,enum:!1,one:!1,private:!1}}},relations:{},skolems:{}};return new Km(e)}var ee=be(rt()),Xre=()=>{let[t,e]=(0,On.useState)(()=>Gm());return(0,On.useEffect)(()=>{typeof window<"u"&&(window.currentInstance=t,window.updateFromBuilder&&window.updateFromBuilder())},[t]),(0,On.useEffect)(()=>{typeof window<"u"&&(window.updateBuilderInstance=i=>{e(i)},window.getCurrentInstanceFromReact=()=>t)},[t]),(0,ee.jsx)("div",{style:{height:"100%",overflow:"auto"},children:(0,ee.jsx)(I0,{instance:t,onChange:i=>{e(i),typeof window<"u"&&window.updateFromBuilder&&window.updateFromBuilder()},className:"integrated-demo-builder"})})},Wre=()=>{let[t,e]=(0,On.useState)(""),[n,i]=(0,On.useState)(!0),[r,s]=(0,On.useState)(()=>Gm());return(0,On.useEffect)(()=>{typeof window<"u"&&(window.getCurrentCNDSpecFromReact=()=>t)},[t]),(0,On.useEffect)(()=>{if(typeof window>"u")return;let l=window;l.currentInstance&&s(l.currentInstance);let a=l.updateLayoutInterfaceInstance;return l.updateLayoutInterfaceInstance=c=>{s(c),a?.(c)},()=>{l.updateLayoutInterfaceInstance=a}},[]),(0,ee.jsx)("div",{style:{height:"100%",overflow:"auto"},children:(0,ee.jsx)(DS,{value:t,onChange:l=>{e(l),typeof window<"u"&&window.updateFromCnDSpec&&window.updateFromCnDSpec()},instance:r,isNoCodeView:n,onViewChange:i})})};function P4(){let t=document.getElementById("instance-builder-container");t&&(0,Ox.createRoot)(t).render((0,ee.jsx)(Xre,{}));let e=document.getElementById("layout-interface-container");e&&(0,Ox.createRoot)(e).render((0,ee.jsx)(Wre,{})),console.log("Integrated demo components mounted")}var Zre=()=>{let[t,e]=(0,On.useState)(()=>Gm()),[n,i]=(0,On.useState)(""),[r,s]=(0,On.useState)("builder"),o=a=>{e(a)},l=async()=>{try{console.log("Rendering graph with:",{atoms:t.getAtoms().length,relations:t.getRelations().length,cndSpec:n.length})}catch(a){console.error("Error rendering graph:",a)}};return(0,ee.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100vh",padding:"20px"},children:[(0,ee.jsx)("h1",{children:"Full Integrated CND Demo"}),(0,ee.jsx)("div",{style:{display:"flex",borderBottom:"2px solid #ddd",marginBottom:"20px"},children:[{key:"builder",label:"Build Instance"},{key:"layout",label:"Configure Layout"},{key:"visualization",label:"Visualize"}].map(a=>(0,ee.jsx)("button",{onClick:()=>s(a.key),style:{padding:"15px 25px",border:"none",background:r===a.key?"#007acc":"transparent",color:r===a.key?"white":"#666",cursor:"pointer",fontSize:"16px",fontWeight:"bold"},children:a.label},a.key))}),(0,ee.jsxs)("div",{style:{flex:1,display:"flex",gap:"20px"},children:[r==="builder"&&(0,ee.jsxs)(ee.Fragment,{children:[(0,ee.jsxs)("div",{style:{flex:1},children:[(0,ee.jsx)("h3",{children:"Instance Builder"}),(0,ee.jsx)(I0,{instance:t,onChange:o})]}),(0,ee.jsxs)("div",{style:{flex:1},children:[(0,ee.jsx)("h3",{children:"Instance Summary"}),(0,ee.jsxs)("div",{style:{background:"#f8f9fa",padding:"15px",borderRadius:"4px"},children:[(0,ee.jsxs)("p",{children:[(0,ee.jsx)("strong",{children:"Atoms:"})," ",t.getAtoms().length]}),(0,ee.jsxs)("p",{children:[(0,ee.jsx)("strong",{children:"Relations:"})," ",t.getRelations().length]}),(0,ee.jsxs)("p",{children:[(0,ee.jsx)("strong",{children:"Total Tuples:"})," ",t.getRelations().reduce((a,c)=>a+c.tuples.length,0)]})]})]})]}),r==="layout"&&(0,ee.jsxs)("div",{style:{flex:1},children:[(0,ee.jsx)("h3",{children:"Layout Configuration"}),(0,ee.jsx)(DS,{value:n,onChange:i,instance:t})]}),r==="visualization"&&(0,ee.jsxs)("div",{style:{flex:1},children:[(0,ee.jsx)("h3",{children:"Visualization"}),(0,ee.jsxs)("div",{style:{textAlign:"center",padding:"40px"},children:[(0,ee.jsx)("button",{onClick:l,style:{background:"#007acc",color:"white",border:"none",padding:"15px 30px",borderRadius:"4px",fontSize:"16px",cursor:"pointer"},children:"Render Graph"}),(0,ee.jsxs)("div",{style:{marginTop:"20px",padding:"20px",border:"2px dashed #ddd",borderRadius:"8px",minHeight:"400px",background:"#fafafa"},children:[(0,ee.jsx)("p",{children:"Graph visualization would appear here"}),(0,ee.jsx)("p",{children:(0,ee.jsx)("em",{children:"Integrate with WebCola custom element"})})]})]})]})]})]})};typeof window<"u"&&window.addEventListener("load",()=>{setTimeout(P4,1e3)});return G4(Jre);})();
|
|
204
204
|
/*! Bundled license information:
|
|
205
205
|
|
|
206
206
|
react/cjs/react.production.js:
|