visual-node 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/app.d.ts +3 -0
- package/dist/app.js +44 -0
- package/dist/app.js.map +1 -0
- package/dist/codegen-helpers.d.ts +55 -0
- package/dist/codegen-helpers.js +142 -0
- package/dist/codegen-helpers.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +13 -0
- package/dist/config.js.map +1 -0
- package/dist/connect/compile-function-graph.service.d.ts +14 -0
- package/dist/connect/compile-function-graph.service.js +106 -0
- package/dist/connect/compile-function-graph.service.js.map +1 -0
- package/dist/connect/files.service.d.ts +7 -0
- package/dist/connect/files.service.js +175 -0
- package/dist/connect/files.service.js.map +1 -0
- package/dist/connect/node-registry-flow.service.d.ts +14 -0
- package/dist/connect/node-registry-flow.service.js +142 -0
- package/dist/connect/node-registry-flow.service.js.map +1 -0
- package/dist/connect/plugins.service.d.ts +24 -0
- package/dist/connect/plugins.service.js +73 -0
- package/dist/connect/plugins.service.js.map +1 -0
- package/dist/connect/run.service.d.ts +3 -0
- package/dist/connect/run.service.js +159 -0
- package/dist/connect/run.service.js.map +1 -0
- package/dist/connect/validate-generate.service.d.ts +19 -0
- package/dist/connect/validate-generate.service.js +102 -0
- package/dist/connect/validate-generate.service.js.map +1 -0
- package/dist/file-tree.d.ts +23 -0
- package/dist/file-tree.js +63 -0
- package/dist/file-tree.js.map +1 -0
- package/dist/flow-shape.d.ts +8 -0
- package/dist/flow-shape.js +13 -0
- package/dist/flow-shape.js.map +1 -0
- package/dist/path-safety.d.ts +12 -0
- package/dist/path-safety.js +26 -0
- package/dist/path-safety.js.map +1 -0
- package/dist/plugin-loading.d.ts +18 -0
- package/dist/plugin-loading.js +47 -0
- package/dist/plugin-loading.js.map +1 -0
- package/dist/plugin-readme.d.ts +9 -0
- package/dist/plugin-readme.js +235 -0
- package/dist/plugin-readme.js.map +1 -0
- package/dist/public/assets/index-6_2vDtnd.css +1 -0
- package/dist/public/assets/index-BpXY8lVq.js +101 -0
- package/dist/public/index.html +13 -0
- package/dist/runner.d.ts +23 -0
- package/dist/runner.js +65 -0
- package/dist/runner.js.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +34 -0
- package/dist/server.js.map +1 -0
- package/dist/static.d.ts +12 -0
- package/dist/static.js +28 -0
- package/dist/static.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
var QI=Object.defineProperty;var RI=(t,e,n)=>e in t?QI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var tn=(t,e,n)=>RI(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function bk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xk={exports:{}},Id={},vk={exports:{}},Oe={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var fc=Symbol.for("react.element"),MI=Symbol.for("react.portal"),LI=Symbol.for("react.fragment"),DI=Symbol.for("react.strict_mode"),ZI=Symbol.for("react.profiler"),VI=Symbol.for("react.provider"),jI=Symbol.for("react.context"),BI=Symbol.for("react.forward_ref"),FI=Symbol.for("react.suspense"),XI=Symbol.for("react.memo"),zI=Symbol.for("react.lazy"),Cb=Symbol.iterator;function WI(t){return t===null||typeof t!="object"?null:(t=Cb&&t[Cb]||t["@@iterator"],typeof t=="function"?t:null)}var wk={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sk=Object.assign,kk={};function sa(t,e,n){this.props=t,this.context=e,this.refs=kk,this.updater=n||wk}sa.prototype.isReactComponent={};sa.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};sa.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Ek(){}Ek.prototype=sa.prototype;function Q0(t,e,n){this.props=t,this.context=e,this.refs=kk,this.updater=n||wk}var R0=Q0.prototype=new Ek;R0.constructor=Q0;Sk(R0,sa.prototype);R0.isPureReactComponent=!0;var $b=Array.isArray,Tk=Object.prototype.hasOwnProperty,M0={current:null},Nk={key:!0,ref:!0,__self:!0,__source:!0};function Pk(t,e,n){var r,i={},s=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(s=""+e.key),e)Tk.call(e,r)&&!Nk.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:fc,type:t,key:s,ref:o,props:i,_owner:M0.current}}function UI(t,e){return{$$typeof:fc,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function L0(t){return typeof t=="object"&&t!==null&&t.$$typeof===fc}function YI(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var Ab=/\/+/g;function Mh(t,e){return typeof t=="object"&&t!==null&&t.key!=null?YI(""+t.key):e.toString(36)}function Bu(t,e,n,r,i){var s=typeof t;(s==="undefined"||s==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case fc:case MI:o=!0}}if(o)return o=t,i=i(o),t=r===""?"."+Mh(o,0):r,$b(i)?(n="",t!=null&&(n=t.replace(Ab,"$&/")+"/"),Bu(i,e,n,"",function(c){return c})):i!=null&&(L0(i)&&(i=UI(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Ab,"$&/")+"/")+t)),e.push(i)),1;if(o=0,r=r===""?".":r+":",$b(t))for(var a=0;a<t.length;a++){s=t[a];var l=r+Mh(s,a);o+=Bu(s,e,n,l,i)}else if(l=WI(t),typeof l=="function")for(t=l.call(t),a=0;!(s=t.next()).done;)s=s.value,l=r+Mh(s,a++),o+=Bu(s,e,n,l,i);else if(s==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function jc(t,e,n){if(t==null)return t;var r=[],i=0;return Bu(t,r,"","",function(s){return e.call(n,s,i++)}),r}function GI(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 Rt={current:null},Fu={transition:null},HI={ReactCurrentDispatcher:Rt,ReactCurrentBatchConfig:Fu,ReactCurrentOwner:M0};function _k(){throw Error("act(...) is not supported in production builds of React.")}Oe.Children={map:jc,forEach:function(t,e,n){jc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return jc(t,function(){e++}),e},toArray:function(t){return jc(t,function(e){return e})||[]},only:function(t){if(!L0(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Oe.Component=sa;Oe.Fragment=LI;Oe.Profiler=ZI;Oe.PureComponent=Q0;Oe.StrictMode=DI;Oe.Suspense=FI;Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=HI;Oe.act=_k;Oe.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=Sk({},t.props),i=t.key,s=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(s=e.ref,o=M0.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)Tk.call(e,l)&&!Nk.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:fc,type:t.type,key:i,ref:s,props:r,_owner:o}};Oe.createContext=function(t){return t={$$typeof:jI,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:VI,_context:t},t.Consumer=t};Oe.createElement=Pk;Oe.createFactory=function(t){var e=Pk.bind(null,t);return e.type=t,e};Oe.createRef=function(){return{current:null}};Oe.forwardRef=function(t){return{$$typeof:BI,render:t}};Oe.isValidElement=L0;Oe.lazy=function(t){return{$$typeof:zI,_payload:{_status:-1,_result:t},_init:GI}};Oe.memo=function(t,e){return{$$typeof:XI,type:t,compare:e===void 0?null:e}};Oe.startTransition=function(t){var e=Fu.transition;Fu.transition={};try{t()}finally{Fu.transition=e}};Oe.unstable_act=_k;Oe.useCallback=function(t,e){return Rt.current.useCallback(t,e)};Oe.useContext=function(t){return Rt.current.useContext(t)};Oe.useDebugValue=function(){};Oe.useDeferredValue=function(t){return Rt.current.useDeferredValue(t)};Oe.useEffect=function(t,e){return Rt.current.useEffect(t,e)};Oe.useId=function(){return Rt.current.useId()};Oe.useImperativeHandle=function(t,e,n){return Rt.current.useImperativeHandle(t,e,n)};Oe.useInsertionEffect=function(t,e){return Rt.current.useInsertionEffect(t,e)};Oe.useLayoutEffect=function(t,e){return Rt.current.useLayoutEffect(t,e)};Oe.useMemo=function(t,e){return Rt.current.useMemo(t,e)};Oe.useReducer=function(t,e,n){return Rt.current.useReducer(t,e,n)};Oe.useRef=function(t){return Rt.current.useRef(t)};Oe.useState=function(t){return Rt.current.useState(t)};Oe.useSyncExternalStore=function(t,e,n){return Rt.current.useSyncExternalStore(t,e,n)};Oe.useTransition=function(){return Rt.current.useTransition()};Oe.version="18.3.1";vk.exports=Oe;var Q=vk.exports;const D0=bk(Q);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var qI=Q,KI=Symbol.for("react.element"),JI=Symbol.for("react.fragment"),eQ=Object.prototype.hasOwnProperty,tQ=qI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,nQ={key:!0,ref:!0,__self:!0,__source:!0};function Ck(t,e,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)eQ.call(e,r)&&!nQ.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:KI,type:t,key:s,ref:o,props:i,_owner:tQ.current}}Id.Fragment=JI;Id.jsx=Ck;Id.jsxs=Ck;xk.exports=Id;var x=xk.exports,mm={},$k={exports:{}},mn={},Ak={exports:{}},Ik={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(t){function e(I,A){var D=I.length;I.push(A);e:for(;0<D;){var B=D-1>>>1,F=I[B];if(0<i(F,A))I[B]=A,I[D]=F,D=B;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var A=I[0],D=I.pop();if(D!==A){I[0]=D;e:for(var B=0,F=I.length,q=F>>>1;B<q;){var j=2*(B+1)-1,H=I[j],G=j+1,ne=I[G];if(0>i(H,D))G<F&&0>i(ne,H)?(I[B]=ne,I[G]=D,B=G):(I[B]=H,I[j]=D,B=j);else if(G<F&&0>i(ne,D))I[B]=ne,I[G]=D,B=G;else break e}}return A}function i(I,A){var D=I.sortIndex-A.sortIndex;return D!==0?D:I.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,f=null,d=3,h=!1,p=!1,m=!1,O=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(I){for(var A=n(c);A!==null;){if(A.callback===null)r(c);else if(A.startTime<=I)r(c),A.sortIndex=A.expirationTime,e(l,A);else break;A=n(c)}}function v(I){if(m=!1,y(I),!p)if(n(l)!==null)p=!0,R(S);else{var A=n(c);A!==null&&L(v,A.startTime-I)}}function S(I,A){p=!1,m&&(m=!1,g(k),k=-1),h=!0;var D=d;try{for(y(A),f=n(l);f!==null&&(!(f.expirationTime>A)||I&&!C());){var B=f.callback;if(typeof B=="function"){f.callback=null,d=f.priorityLevel;var F=B(f.expirationTime<=A);A=t.unstable_now(),typeof F=="function"?f.callback=F:f===n(l)&&r(l),y(A)}else r(l);f=n(l)}if(f!==null)var q=!0;else{var j=n(c);j!==null&&L(v,j.startTime-A),q=!1}return q}finally{f=null,d=D,h=!1}}var E=!1,w=null,k=-1,N=5,$=-1;function C(){return!(t.unstable_now()-$<N)}function _(){if(w!==null){var I=t.unstable_now();$=I;var A=!0;try{A=w(!0,I)}finally{A?V():(E=!1,w=null)}}else E=!1}var V;if(typeof b=="function")V=function(){b(_)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,M=P.port2;P.port1.onmessage=_,V=function(){M.postMessage(null)}}else V=function(){O(_,0)};function R(I){w=I,E||(E=!0,V())}function L(I,A){k=O(function(){I(t.unstable_now())},A)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(I){I.callback=null},t.unstable_continueExecution=function(){p||h||(p=!0,R(S))},t.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<I?Math.floor(1e3/I):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(l)},t.unstable_next=function(I){switch(d){case 1:case 2:case 3:var A=3;break;default:A=d}var D=d;d=A;try{return I()}finally{d=D}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(I,A){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var D=d;d=I;try{return A()}finally{d=D}},t.unstable_scheduleCallback=function(I,A,D){var B=t.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?B+D:B):D=B,I){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=D+F,I={id:u++,callback:A,priorityLevel:I,startTime:D,expirationTime:F,sortIndex:-1},D>B?(I.sortIndex=D,e(c,I),n(l)===null&&I===n(c)&&(m?(g(k),k=-1):m=!0,L(v,D-B))):(I.sortIndex=F,e(l,I),p||h||(p=!0,R(S))),I},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(I){var A=d;return function(){var D=d;d=A;try{return I.apply(this,arguments)}finally{d=D}}}})(Ik);Ak.exports=Ik;var rQ=Ak.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var iQ=Q,hn=rQ;function K(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Qk=new Set,fl={};function Zs(t,e){Ao(t,e),Ao(t+"Capture",e)}function Ao(t,e){for(fl[t]=e,t=0;t<e.length;t++)Qk.add(e[t])}var Hr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gm=Object.prototype.hasOwnProperty,sQ=/^[: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]*$/,Ib={},Qb={};function oQ(t){return gm.call(Qb,t)?!0:gm.call(Ib,t)?!1:sQ.test(t)?Qb[t]=!0:(Ib[t]=!0,!1)}function aQ(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function lQ(t,e,n,r){if(e===null||typeof e>"u"||aQ(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Mt(t,e,n,r,i,s,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=s,this.removeEmptyString=o}var vt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){vt[t]=new Mt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];vt[e]=new Mt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){vt[t]=new Mt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){vt[t]=new Mt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){vt[t]=new Mt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){vt[t]=new Mt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){vt[t]=new Mt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){vt[t]=new Mt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){vt[t]=new Mt(t,5,!1,t.toLowerCase(),null,!1,!1)});var Z0=/[\-:]([a-z])/g;function V0(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Z0,V0);vt[e]=new Mt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Z0,V0);vt[e]=new Mt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Z0,V0);vt[e]=new Mt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){vt[t]=new Mt(t,1,!1,t.toLowerCase(),null,!1,!1)});vt.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){vt[t]=new Mt(t,1,!1,t.toLowerCase(),null,!0,!0)});function j0(t,e,n,r){var i=vt.hasOwnProperty(e)?vt[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(lQ(e,n,i,r)&&(n=null),r||i===null?oQ(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var si=iQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Bc=Symbol.for("react.element"),qs=Symbol.for("react.portal"),Ks=Symbol.for("react.fragment"),B0=Symbol.for("react.strict_mode"),Om=Symbol.for("react.profiler"),Rk=Symbol.for("react.provider"),Mk=Symbol.for("react.context"),F0=Symbol.for("react.forward_ref"),ym=Symbol.for("react.suspense"),bm=Symbol.for("react.suspense_list"),X0=Symbol.for("react.memo"),di=Symbol.for("react.lazy"),Lk=Symbol.for("react.offscreen"),Rb=Symbol.iterator;function ma(t){return t===null||typeof t!="object"?null:(t=Rb&&t[Rb]||t["@@iterator"],typeof t=="function"?t:null)}var Be=Object.assign,Lh;function Ia(t){if(Lh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);Lh=e&&e[1]||""}return`
|
|
34
|
+
`+Lh+t}var Dh=!1;function Zh(t,e){if(!t||Dh)return"";Dh=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
35
|
+
`),s=r.stack.split(`
|
|
36
|
+
`),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
|
|
37
|
+
`+i[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{Dh=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ia(t):""}function cQ(t){switch(t.tag){case 5:return Ia(t.type);case 16:return Ia("Lazy");case 13:return Ia("Suspense");case 19:return Ia("SuspenseList");case 0:case 2:case 15:return t=Zh(t.type,!1),t;case 11:return t=Zh(t.type.render,!1),t;case 1:return t=Zh(t.type,!0),t;default:return""}}function xm(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ks:return"Fragment";case qs:return"Portal";case Om:return"Profiler";case B0:return"StrictMode";case ym:return"Suspense";case bm:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Mk:return(t.displayName||"Context")+".Consumer";case Rk:return(t._context.displayName||"Context")+".Provider";case F0:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X0:return e=t.displayName||null,e!==null?e:xm(t.type)||"Memo";case di:e=t._payload,t=t._init;try{return xm(t(e))}catch{}}return null}function uQ(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xm(e);case 8:return e===B0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ri(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Dk(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function fQ(t){var e=Dk(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Fc(t){t._valueTracker||(t._valueTracker=fQ(t))}function Zk(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Dk(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Of(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function vm(t,e){var n=e.checked;return Be({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Mb(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Ri(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Vk(t,e){e=e.checked,e!=null&&j0(t,"checked",e,!1)}function wm(t,e){Vk(t,e);var n=Ri(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Sm(t,e.type,n):e.hasOwnProperty("defaultValue")&&Sm(t,e.type,Ri(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Lb(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Sm(t,e,n){(e!=="number"||Of(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Qa=Array.isArray;function go(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Ri(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function km(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(K(91));return Be({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Db(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(K(92));if(Qa(n)){if(1<n.length)throw Error(K(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Ri(n)}}function jk(t,e){var n=Ri(e.value),r=Ri(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function Zb(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Bk(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Em(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Bk(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Xc,Fk=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Xc=Xc||document.createElement("div"),Xc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Xc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function dl(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Fa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},dQ=["Webkit","ms","Moz","O"];Object.keys(Fa).forEach(function(t){dQ.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Fa[e]=Fa[t]})});function Xk(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Fa.hasOwnProperty(t)&&Fa[t]?(""+e).trim():e+"px"}function zk(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Xk(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var hQ=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tm(t,e){if(e){if(hQ[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(K(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(K(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(K(61))}if(e.style!=null&&typeof e.style!="object")throw Error(K(62))}}function Nm(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Pm=null;function z0(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var _m=null,Oo=null,yo=null;function Vb(t){if(t=pc(t)){if(typeof _m!="function")throw Error(K(280));var e=t.stateNode;e&&(e=Dd(e),_m(t.stateNode,t.type,e))}}function Wk(t){Oo?yo?yo.push(t):yo=[t]:Oo=t}function Uk(){if(Oo){var t=Oo,e=yo;if(yo=Oo=null,Vb(t),e)for(t=0;t<e.length;t++)Vb(e[t])}}function Yk(t,e){return t(e)}function Gk(){}var Vh=!1;function Hk(t,e,n){if(Vh)return t(e,n);Vh=!0;try{return Yk(t,e,n)}finally{Vh=!1,(Oo!==null||yo!==null)&&(Gk(),Uk())}}function hl(t,e){var n=t.stateNode;if(n===null)return null;var r=Dd(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(K(231,e,typeof n));return n}var Cm=!1;if(Hr)try{var ga={};Object.defineProperty(ga,"passive",{get:function(){Cm=!0}}),window.addEventListener("test",ga,ga),window.removeEventListener("test",ga,ga)}catch{Cm=!1}function pQ(t,e,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var Xa=!1,yf=null,bf=!1,$m=null,mQ={onError:function(t){Xa=!0,yf=t}};function gQ(t,e,n,r,i,s,o,a,l){Xa=!1,yf=null,pQ.apply(mQ,arguments)}function OQ(t,e,n,r,i,s,o,a,l){if(gQ.apply(this,arguments),Xa){if(Xa){var c=yf;Xa=!1,yf=null}else throw Error(K(198));bf||(bf=!0,$m=c)}}function Vs(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function qk(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 jb(t){if(Vs(t)!==t)throw Error(K(188))}function yQ(t){var e=t.alternate;if(!e){if(e=Vs(t),e===null)throw Error(K(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return jb(i),t;if(s===r)return jb(i),e;s=s.sibling}throw Error(K(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(K(189))}}if(n.alternate!==r)throw Error(K(190))}if(n.tag!==3)throw Error(K(188));return n.stateNode.current===n?t:e}function Kk(t){return t=yQ(t),t!==null?Jk(t):null}function Jk(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Jk(t);if(e!==null)return e;t=t.sibling}return null}var eE=hn.unstable_scheduleCallback,Bb=hn.unstable_cancelCallback,bQ=hn.unstable_shouldYield,xQ=hn.unstable_requestPaint,He=hn.unstable_now,vQ=hn.unstable_getCurrentPriorityLevel,W0=hn.unstable_ImmediatePriority,tE=hn.unstable_UserBlockingPriority,xf=hn.unstable_NormalPriority,wQ=hn.unstable_LowPriority,nE=hn.unstable_IdlePriority,Qd=null,Sr=null;function SQ(t){if(Sr&&typeof Sr.onCommitFiberRoot=="function")try{Sr.onCommitFiberRoot(Qd,t,void 0,(t.current.flags&128)===128)}catch{}}var Un=Math.clz32?Math.clz32:TQ,kQ=Math.log,EQ=Math.LN2;function TQ(t){return t>>>=0,t===0?32:31-(kQ(t)/EQ|0)|0}var zc=64,Wc=4194304;function Ra(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function vf(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,s=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Ra(a):(s&=o,s!==0&&(r=Ra(s)))}else o=n&~i,o!==0?r=Ra(o):s!==0&&(r=Ra(s));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,s=e&-e,i>=s||i===16&&(s&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-Un(e),i=1<<n,r|=t[n],e&=~i;return r}function NQ(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function PQ(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-Un(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=NQ(a,e)):l<=e&&(t.expiredLanes|=a),s&=~a}}function Am(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function rE(){var t=zc;return zc<<=1,!(zc&4194240)&&(zc=64),t}function jh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function dc(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Un(e),t[e]=n}function _Q(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-Un(n),s=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~s}}function U0(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-Un(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var ke=0;function iE(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var sE,Y0,oE,aE,lE,Im=!1,Uc=[],Ei=null,Ti=null,Ni=null,pl=new Map,ml=new Map,Oi=[],CQ="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Fb(t,e){switch(t){case"focusin":case"focusout":Ei=null;break;case"dragenter":case"dragleave":Ti=null;break;case"mouseover":case"mouseout":Ni=null;break;case"pointerover":case"pointerout":pl.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ml.delete(e.pointerId)}}function Oa(t,e,n,r,i,s){return t===null||t.nativeEvent!==s?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},e!==null&&(e=pc(e),e!==null&&Y0(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function $Q(t,e,n,r,i){switch(e){case"focusin":return Ei=Oa(Ei,t,e,n,r,i),!0;case"dragenter":return Ti=Oa(Ti,t,e,n,r,i),!0;case"mouseover":return Ni=Oa(Ni,t,e,n,r,i),!0;case"pointerover":var s=i.pointerId;return pl.set(s,Oa(pl.get(s)||null,t,e,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,ml.set(s,Oa(ml.get(s)||null,t,e,n,r,i)),!0}return!1}function cE(t){var e=cs(t.target);if(e!==null){var n=Vs(e);if(n!==null){if(e=n.tag,e===13){if(e=qk(n),e!==null){t.blockedOn=e,lE(t.priority,function(){oE(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=Qm(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Pm=r,n.target.dispatchEvent(r),Pm=null}else return e=pc(n),e!==null&&Y0(e),t.blockedOn=n,!1;e.shift()}return!0}function Xb(t,e,n){Xu(t)&&n.delete(e)}function AQ(){Im=!1,Ei!==null&&Xu(Ei)&&(Ei=null),Ti!==null&&Xu(Ti)&&(Ti=null),Ni!==null&&Xu(Ni)&&(Ni=null),pl.forEach(Xb),ml.forEach(Xb)}function ya(t,e){t.blockedOn===e&&(t.blockedOn=null,Im||(Im=!0,hn.unstable_scheduleCallback(hn.unstable_NormalPriority,AQ)))}function gl(t){function e(i){return ya(i,t)}if(0<Uc.length){ya(Uc[0],t);for(var n=1;n<Uc.length;n++){var r=Uc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Ei!==null&&ya(Ei,t),Ti!==null&&ya(Ti,t),Ni!==null&&ya(Ni,t),pl.forEach(e),ml.forEach(e),n=0;n<Oi.length;n++)r=Oi[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Oi.length&&(n=Oi[0],n.blockedOn===null);)cE(n),n.blockedOn===null&&Oi.shift()}var bo=si.ReactCurrentBatchConfig,wf=!0;function IQ(t,e,n,r){var i=ke,s=bo.transition;bo.transition=null;try{ke=1,G0(t,e,n,r)}finally{ke=i,bo.transition=s}}function QQ(t,e,n,r){var i=ke,s=bo.transition;bo.transition=null;try{ke=4,G0(t,e,n,r)}finally{ke=i,bo.transition=s}}function G0(t,e,n,r){if(wf){var i=Qm(t,e,n,r);if(i===null)qh(t,e,r,Sf,n),Fb(t,r);else if($Q(i,t,e,n,r))r.stopPropagation();else if(Fb(t,r),e&4&&-1<CQ.indexOf(t)){for(;i!==null;){var s=pc(i);if(s!==null&&sE(s),s=Qm(t,e,n,r),s===null&&qh(t,e,r,Sf,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else qh(t,e,r,null,n)}}var Sf=null;function Qm(t,e,n,r){if(Sf=null,t=z0(r),t=cs(t),t!==null)if(e=Vs(t),e===null)t=null;else if(n=e.tag,n===13){if(t=qk(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 Sf=t,null}function uE(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(vQ()){case W0:return 1;case tE:return 4;case xf:case wQ:return 16;case nE:return 536870912;default:return 16}default:return 16}}var wi=null,H0=null,zu=null;function fE(){if(zu)return zu;var t,e=H0,n=e.length,r,i="value"in wi?wi.value:wi.textContent,s=i.length;for(t=0;t<n&&e[t]===i[t];t++);var o=n-t;for(r=1;r<=o&&e[n-r]===i[s-r];r++);return zu=i.slice(t,1<r?1-r:void 0)}function Wu(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 Yc(){return!0}function zb(){return!1}function gn(t){function e(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Yc:zb,this.isPropagationStopped=zb,this}return Be(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=Yc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yc)},persist:function(){},isPersistent:Yc}),e}var oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},q0=gn(oa),hc=Be({},oa,{view:0,detail:0}),RQ=gn(hc),Bh,Fh,ba,Rd=Be({},hc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:K0,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!==ba&&(ba&&t.type==="mousemove"?(Bh=t.screenX-ba.screenX,Fh=t.screenY-ba.screenY):Fh=Bh=0,ba=t),Bh)},movementY:function(t){return"movementY"in t?t.movementY:Fh}}),Wb=gn(Rd),MQ=Be({},Rd,{dataTransfer:0}),LQ=gn(MQ),DQ=Be({},hc,{relatedTarget:0}),Xh=gn(DQ),ZQ=Be({},oa,{animationName:0,elapsedTime:0,pseudoElement:0}),VQ=gn(ZQ),jQ=Be({},oa,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),BQ=gn(jQ),FQ=Be({},oa,{data:0}),Ub=gn(FQ),XQ={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zQ={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"},WQ={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function UQ(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=WQ[t])?!!e[t]:!1}function K0(){return UQ}var YQ=Be({},hc,{key:function(t){if(t.key){var e=XQ[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Wu(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?zQ[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:K0,charCode:function(t){return t.type==="keypress"?Wu(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Wu(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),GQ=gn(YQ),HQ=Be({},Rd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Yb=gn(HQ),qQ=Be({},hc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:K0}),KQ=gn(qQ),JQ=Be({},oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),eR=gn(JQ),tR=Be({},Rd,{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}),nR=gn(tR),rR=[9,13,27,32],J0=Hr&&"CompositionEvent"in window,za=null;Hr&&"documentMode"in document&&(za=document.documentMode);var iR=Hr&&"TextEvent"in window&&!za,dE=Hr&&(!J0||za&&8<za&&11>=za),Gb=" ",Hb=!1;function hE(t,e){switch(t){case"keyup":return rR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pE(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Js=!1;function sR(t,e){switch(t){case"compositionend":return pE(e);case"keypress":return e.which!==32?null:(Hb=!0,Gb);case"textInput":return t=e.data,t===Gb&&Hb?null:t;default:return null}}function oR(t,e){if(Js)return t==="compositionend"||!J0&&hE(t,e)?(t=fE(),zu=H0=wi=null,Js=!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 dE&&e.locale!=="ko"?null:e.data;default:return null}}var aR={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 qb(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!aR[t.type]:e==="textarea"}function mE(t,e,n,r){Wk(r),e=kf(e,"onChange"),0<e.length&&(n=new q0("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var Wa=null,Ol=null;function lR(t){TE(t,0)}function Md(t){var e=no(t);if(Zk(e))return t}function cR(t,e){if(t==="change")return e}var gE=!1;if(Hr){var zh;if(Hr){var Wh="oninput"in document;if(!Wh){var Kb=document.createElement("div");Kb.setAttribute("oninput","return;"),Wh=typeof Kb.oninput=="function"}zh=Wh}else zh=!1;gE=zh&&(!document.documentMode||9<document.documentMode)}function Jb(){Wa&&(Wa.detachEvent("onpropertychange",OE),Ol=Wa=null)}function OE(t){if(t.propertyName==="value"&&Md(Ol)){var e=[];mE(e,Ol,t,z0(t)),Hk(lR,e)}}function uR(t,e,n){t==="focusin"?(Jb(),Wa=e,Ol=n,Wa.attachEvent("onpropertychange",OE)):t==="focusout"&&Jb()}function fR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Md(Ol)}function dR(t,e){if(t==="click")return Md(e)}function hR(t,e){if(t==="input"||t==="change")return Md(e)}function pR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Gn=typeof Object.is=="function"?Object.is:pR;function yl(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),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!gm.call(e,i)||!Gn(t[i],e[i]))return!1}return!0}function ex(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function tx(t,e){var n=ex(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ex(n)}}function yE(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?yE(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function bE(){for(var t=window,e=Of();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Of(t.document)}return e}function eO(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function mR(t){var e=bE(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&yE(n.ownerDocument.documentElement,n)){if(r!==null&&eO(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!t.extend&&s>r&&(i=r,r=s,s=i),i=tx(n,s);var o=tx(n,r);i&&o&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),s>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var gR=Hr&&"documentMode"in document&&11>=document.documentMode,eo=null,Rm=null,Ua=null,Mm=!1;function nx(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Mm||eo==null||eo!==Of(r)||(r=eo,"selectionStart"in r&&eO(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ua&&yl(Ua,r)||(Ua=r,r=kf(Rm,"onSelect"),0<r.length&&(e=new q0("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=eo)))}function Gc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var to={animationend:Gc("Animation","AnimationEnd"),animationiteration:Gc("Animation","AnimationIteration"),animationstart:Gc("Animation","AnimationStart"),transitionend:Gc("Transition","TransitionEnd")},Uh={},xE={};Hr&&(xE=document.createElement("div").style,"AnimationEvent"in window||(delete to.animationend.animation,delete to.animationiteration.animation,delete to.animationstart.animation),"TransitionEvent"in window||delete to.transitionend.transition);function Ld(t){if(Uh[t])return Uh[t];if(!to[t])return t;var e=to[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in xE)return Uh[t]=e[n];return t}var vE=Ld("animationend"),wE=Ld("animationiteration"),SE=Ld("animationstart"),kE=Ld("transitionend"),EE=new Map,rx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Wi(t,e){EE.set(t,e),Zs(e,[t])}for(var Yh=0;Yh<rx.length;Yh++){var Gh=rx[Yh],OR=Gh.toLowerCase(),yR=Gh[0].toUpperCase()+Gh.slice(1);Wi(OR,"on"+yR)}Wi(vE,"onAnimationEnd");Wi(wE,"onAnimationIteration");Wi(SE,"onAnimationStart");Wi("dblclick","onDoubleClick");Wi("focusin","onFocus");Wi("focusout","onBlur");Wi(kE,"onTransitionEnd");Ao("onMouseEnter",["mouseout","mouseover"]);Ao("onMouseLeave",["mouseout","mouseover"]);Ao("onPointerEnter",["pointerout","pointerover"]);Ao("onPointerLeave",["pointerout","pointerover"]);Zs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Zs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Zs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Zs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Zs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Zs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ma="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(" "),bR=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ma));function ix(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,OQ(r,e,void 0,t),t.currentTarget=null}function TE(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var s=void 0;if(e)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;ix(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;ix(i,a,c),s=l}}}if(bf)throw t=$m,bf=!1,$m=null,t}function Ae(t,e){var n=e[jm];n===void 0&&(n=e[jm]=new Set);var r=t+"__bubble";n.has(r)||(NE(e,t,2,!1),n.add(r))}function Hh(t,e,n){var r=0;e&&(r|=4),NE(n,t,r,e)}var Hc="_reactListening"+Math.random().toString(36).slice(2);function bl(t){if(!t[Hc]){t[Hc]=!0,Qk.forEach(function(n){n!=="selectionchange"&&(bR.has(n)||Hh(n,!1,t),Hh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Hc]||(e[Hc]=!0,Hh("selectionchange",!1,e))}}function NE(t,e,n,r){switch(uE(e)){case 1:var i=IQ;break;case 4:i=QQ;break;default:i=G0}n=i.bind(null,e,n,t),i=void 0,!Cm||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function qh(t,e,n,r,i){var s=r;if(!(e&1)&&!(e&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=cs(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}Hk(function(){var c=s,u=z0(n),f=[];e:{var d=EE.get(t);if(d!==void 0){var h=q0,p=t;switch(t){case"keypress":if(Wu(n)===0)break e;case"keydown":case"keyup":h=GQ;break;case"focusin":p="focus",h=Xh;break;case"focusout":p="blur",h=Xh;break;case"beforeblur":case"afterblur":h=Xh;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":h=Wb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=LQ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=KQ;break;case vE:case wE:case SE:h=VQ;break;case kE:h=eR;break;case"scroll":h=RQ;break;case"wheel":h=nR;break;case"copy":case"cut":case"paste":h=BQ;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Yb}var m=(e&4)!==0,O=!m&&t==="scroll",g=m?d!==null?d+"Capture":null:d;m=[];for(var b=c,y;b!==null;){y=b;var v=y.stateNode;if(y.tag===5&&v!==null&&(y=v,g!==null&&(v=hl(b,g),v!=null&&m.push(xl(b,v,y)))),O)break;b=b.return}0<m.length&&(d=new h(d,p,null,n,u),f.push({event:d,listeners:m}))}}if(!(e&7)){e:{if(d=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",d&&n!==Pm&&(p=n.relatedTarget||n.fromElement)&&(cs(p)||p[qr]))break e;if((h||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=c,p=p?cs(p):null,p!==null&&(O=Vs(p),p!==O||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=c),h!==p)){if(m=Wb,v="onMouseLeave",g="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(m=Yb,v="onPointerLeave",g="onPointerEnter",b="pointer"),O=h==null?d:no(h),y=p==null?d:no(p),d=new m(v,b+"leave",h,n,u),d.target=O,d.relatedTarget=y,v=null,cs(u)===c&&(m=new m(g,b+"enter",p,n,u),m.target=y,m.relatedTarget=O,v=m),O=v,h&&p)t:{for(m=h,g=p,b=0,y=m;y;y=Fs(y))b++;for(y=0,v=g;v;v=Fs(v))y++;for(;0<b-y;)m=Fs(m),b--;for(;0<y-b;)g=Fs(g),y--;for(;b--;){if(m===g||g!==null&&m===g.alternate)break t;m=Fs(m),g=Fs(g)}m=null}else m=null;h!==null&&sx(f,d,h,m,!1),p!==null&&O!==null&&sx(f,O,p,m,!0)}}e:{if(d=c?no(c):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var S=cR;else if(qb(d))if(gE)S=hR;else{S=fR;var E=uR}else(h=d.nodeName)&&h.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(S=dR);if(S&&(S=S(t,c))){mE(f,S,n,u);break e}E&&E(t,d,c),t==="focusout"&&(E=d._wrapperState)&&E.controlled&&d.type==="number"&&Sm(d,"number",d.value)}switch(E=c?no(c):window,t){case"focusin":(qb(E)||E.contentEditable==="true")&&(eo=E,Rm=c,Ua=null);break;case"focusout":Ua=Rm=eo=null;break;case"mousedown":Mm=!0;break;case"contextmenu":case"mouseup":case"dragend":Mm=!1,nx(f,n,u);break;case"selectionchange":if(gR)break;case"keydown":case"keyup":nx(f,n,u)}var w;if(J0)e:{switch(t){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Js?hE(t,n)&&(k="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(dE&&n.locale!=="ko"&&(Js||k!=="onCompositionStart"?k==="onCompositionEnd"&&Js&&(w=fE()):(wi=u,H0="value"in wi?wi.value:wi.textContent,Js=!0)),E=kf(c,k),0<E.length&&(k=new Ub(k,t,null,n,u),f.push({event:k,listeners:E}),w?k.data=w:(w=pE(n),w!==null&&(k.data=w)))),(w=iR?sR(t,n):oR(t,n))&&(c=kf(c,"onBeforeInput"),0<c.length&&(u=new Ub("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=w))}TE(f,e)})}function xl(t,e,n){return{instance:t,listener:e,currentTarget:n}}function kf(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=hl(t,n),s!=null&&r.unshift(xl(t,s,i)),s=hl(t,e),s!=null&&r.push(xl(t,s,i))),t=t.return}return r}function Fs(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function sx(t,e,n,r,i){for(var s=e._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=hl(n,s),l!=null&&o.unshift(xl(n,l,a))):i||(l=hl(n,s),l!=null&&o.push(xl(n,l,a)))),n=n.return}o.length!==0&&t.push({event:e,listeners:o})}var xR=/\r\n?/g,vR=/\u0000|\uFFFD/g;function ox(t){return(typeof t=="string"?t:""+t).replace(xR,`
|
|
38
|
+
`).replace(vR,"")}function qc(t,e,n){if(e=ox(e),ox(t)!==e&&n)throw Error(K(425))}function Ef(){}var Lm=null,Dm=null;function Zm(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Vm=typeof setTimeout=="function"?setTimeout:void 0,wR=typeof clearTimeout=="function"?clearTimeout:void 0,ax=typeof Promise=="function"?Promise:void 0,SR=typeof queueMicrotask=="function"?queueMicrotask:typeof ax<"u"?function(t){return ax.resolve(null).then(t).catch(kR)}:Vm;function kR(t){setTimeout(function(){throw t})}function Kh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),gl(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);gl(e)}function Pi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function lx(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var aa=Math.random().toString(36).slice(2),pr="__reactFiber$"+aa,vl="__reactProps$"+aa,qr="__reactContainer$"+aa,jm="__reactEvents$"+aa,ER="__reactListeners$"+aa,TR="__reactHandles$"+aa;function cs(t){var e=t[pr];if(e)return e;for(var n=t.parentNode;n;){if(e=n[qr]||n[pr]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=lx(t);t!==null;){if(n=t[pr])return n;t=lx(t)}return e}t=n,n=t.parentNode}return null}function pc(t){return t=t[pr]||t[qr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function no(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(K(33))}function Dd(t){return t[vl]||null}var Bm=[],ro=-1;function Ui(t){return{current:t}}function Ie(t){0>ro||(t.current=Bm[ro],Bm[ro]=null,ro--)}function $e(t,e){ro++,Bm[ro]=t.current,t.current=e}var Mi={},Pt=Ui(Mi),Gt=Ui(!1),Ss=Mi;function Io(t,e){var n=t.type.contextTypes;if(!n)return Mi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=e[s];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ht(t){return t=t.childContextTypes,t!=null}function Tf(){Ie(Gt),Ie(Pt)}function cx(t,e,n){if(Pt.current!==Mi)throw Error(K(168));$e(Pt,e),$e(Gt,n)}function PE(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(K(108,uQ(t)||"Unknown",i));return Be({},n,r)}function Nf(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Mi,Ss=Pt.current,$e(Pt,t),$e(Gt,Gt.current),!0}function ux(t,e,n){var r=t.stateNode;if(!r)throw Error(K(169));n?(t=PE(t,e,Ss),r.__reactInternalMemoizedMergedChildContext=t,Ie(Gt),Ie(Pt),$e(Pt,t)):Ie(Gt),$e(Gt,n)}var Zr=null,Zd=!1,Jh=!1;function _E(t){Zr===null?Zr=[t]:Zr.push(t)}function NR(t){Zd=!0,_E(t)}function Yi(){if(!Jh&&Zr!==null){Jh=!0;var t=0,e=ke;try{var n=Zr;for(ke=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Zr=null,Zd=!1}catch(i){throw Zr!==null&&(Zr=Zr.slice(t+1)),eE(W0,Yi),i}finally{ke=e,Jh=!1}}return null}var io=[],so=0,Pf=null,_f=0,bn=[],xn=0,ks=null,Xr=1,zr="";function ns(t,e){io[so++]=_f,io[so++]=Pf,Pf=t,_f=e}function CE(t,e,n){bn[xn++]=Xr,bn[xn++]=zr,bn[xn++]=ks,ks=t;var r=Xr;t=zr;var i=32-Un(r)-1;r&=~(1<<i),n+=1;var s=32-Un(e)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xr=1<<32-Un(e)+i|n<<i|r,zr=s+t}else Xr=1<<s|n<<i|r,zr=t}function tO(t){t.return!==null&&(ns(t,1),CE(t,1,0))}function nO(t){for(;t===Pf;)Pf=io[--so],io[so]=null,_f=io[--so],io[so]=null;for(;t===ks;)ks=bn[--xn],bn[xn]=null,zr=bn[--xn],bn[xn]=null,Xr=bn[--xn],bn[xn]=null}var dn=null,un=null,Qe=!1,Dn=null;function $E(t,e){var n=Sn(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function fx(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,dn=t,un=Pi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,dn=t,un=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=ks!==null?{id:Xr,overflow:zr}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Sn(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,dn=t,un=null,!0):!1;default:return!1}}function Fm(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Xm(t){if(Qe){var e=un;if(e){var n=e;if(!fx(t,e)){if(Fm(t))throw Error(K(418));e=Pi(n.nextSibling);var r=dn;e&&fx(t,e)?$E(r,n):(t.flags=t.flags&-4097|2,Qe=!1,dn=t)}}else{if(Fm(t))throw Error(K(418));t.flags=t.flags&-4097|2,Qe=!1,dn=t}}}function dx(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;dn=t}function Kc(t){if(t!==dn)return!1;if(!Qe)return dx(t),Qe=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Zm(t.type,t.memoizedProps)),e&&(e=un)){if(Fm(t))throw AE(),Error(K(418));for(;e;)$E(t,e),e=Pi(e.nextSibling)}if(dx(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(K(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){un=Pi(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}un=null}}else un=dn?Pi(t.stateNode.nextSibling):null;return!0}function AE(){for(var t=un;t;)t=Pi(t.nextSibling)}function Qo(){un=dn=null,Qe=!1}function rO(t){Dn===null?Dn=[t]:Dn.push(t)}var PR=si.ReactCurrentBatchConfig;function xa(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(K(309));var r=n.stateNode}if(!r)throw Error(K(147,t));var i=r,s=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===s?e.ref:(e=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},e._stringRef=s,e)}if(typeof t!="string")throw Error(K(284));if(!n._owner)throw Error(K(290,t))}return t}function Jc(t,e){throw t=Object.prototype.toString.call(e),Error(K(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function hx(t){var e=t._init;return e(t._payload)}function IE(t){function e(g,b){if(t){var y=g.deletions;y===null?(g.deletions=[b],g.flags|=16):y.push(b)}}function n(g,b){if(!t)return null;for(;b!==null;)e(g,b),b=b.sibling;return null}function r(g,b){for(g=new Map;b!==null;)b.key!==null?g.set(b.key,b):g.set(b.index,b),b=b.sibling;return g}function i(g,b){return g=Ai(g,b),g.index=0,g.sibling=null,g}function s(g,b,y){return g.index=y,t?(y=g.alternate,y!==null?(y=y.index,y<b?(g.flags|=2,b):y):(g.flags|=2,b)):(g.flags|=1048576,b)}function o(g){return t&&g.alternate===null&&(g.flags|=2),g}function a(g,b,y,v){return b===null||b.tag!==6?(b=op(y,g.mode,v),b.return=g,b):(b=i(b,y),b.return=g,b)}function l(g,b,y,v){var S=y.type;return S===Ks?u(g,b,y.props.children,v,y.key):b!==null&&(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===di&&hx(S)===b.type)?(v=i(b,y.props),v.ref=xa(g,b,y),v.return=g,v):(v=Ju(y.type,y.key,y.props,null,g.mode,v),v.ref=xa(g,b,y),v.return=g,v)}function c(g,b,y,v){return b===null||b.tag!==4||b.stateNode.containerInfo!==y.containerInfo||b.stateNode.implementation!==y.implementation?(b=ap(y,g.mode,v),b.return=g,b):(b=i(b,y.children||[]),b.return=g,b)}function u(g,b,y,v,S){return b===null||b.tag!==7?(b=gs(y,g.mode,v,S),b.return=g,b):(b=i(b,y),b.return=g,b)}function f(g,b,y){if(typeof b=="string"&&b!==""||typeof b=="number")return b=op(""+b,g.mode,y),b.return=g,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Bc:return y=Ju(b.type,b.key,b.props,null,g.mode,y),y.ref=xa(g,null,b),y.return=g,y;case qs:return b=ap(b,g.mode,y),b.return=g,b;case di:var v=b._init;return f(g,v(b._payload),y)}if(Qa(b)||ma(b))return b=gs(b,g.mode,y,null),b.return=g,b;Jc(g,b)}return null}function d(g,b,y,v){var S=b!==null?b.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return S!==null?null:a(g,b,""+y,v);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Bc:return y.key===S?l(g,b,y,v):null;case qs:return y.key===S?c(g,b,y,v):null;case di:return S=y._init,d(g,b,S(y._payload),v)}if(Qa(y)||ma(y))return S!==null?null:u(g,b,y,v,null);Jc(g,y)}return null}function h(g,b,y,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return g=g.get(y)||null,a(b,g,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Bc:return g=g.get(v.key===null?y:v.key)||null,l(b,g,v,S);case qs:return g=g.get(v.key===null?y:v.key)||null,c(b,g,v,S);case di:var E=v._init;return h(g,b,y,E(v._payload),S)}if(Qa(v)||ma(v))return g=g.get(y)||null,u(b,g,v,S,null);Jc(b,v)}return null}function p(g,b,y,v){for(var S=null,E=null,w=b,k=b=0,N=null;w!==null&&k<y.length;k++){w.index>k?(N=w,w=null):N=w.sibling;var $=d(g,w,y[k],v);if($===null){w===null&&(w=N);break}t&&w&&$.alternate===null&&e(g,w),b=s($,b,k),E===null?S=$:E.sibling=$,E=$,w=N}if(k===y.length)return n(g,w),Qe&&ns(g,k),S;if(w===null){for(;k<y.length;k++)w=f(g,y[k],v),w!==null&&(b=s(w,b,k),E===null?S=w:E.sibling=w,E=w);return Qe&&ns(g,k),S}for(w=r(g,w);k<y.length;k++)N=h(w,g,k,y[k],v),N!==null&&(t&&N.alternate!==null&&w.delete(N.key===null?k:N.key),b=s(N,b,k),E===null?S=N:E.sibling=N,E=N);return t&&w.forEach(function(C){return e(g,C)}),Qe&&ns(g,k),S}function m(g,b,y,v){var S=ma(y);if(typeof S!="function")throw Error(K(150));if(y=S.call(y),y==null)throw Error(K(151));for(var E=S=null,w=b,k=b=0,N=null,$=y.next();w!==null&&!$.done;k++,$=y.next()){w.index>k?(N=w,w=null):N=w.sibling;var C=d(g,w,$.value,v);if(C===null){w===null&&(w=N);break}t&&w&&C.alternate===null&&e(g,w),b=s(C,b,k),E===null?S=C:E.sibling=C,E=C,w=N}if($.done)return n(g,w),Qe&&ns(g,k),S;if(w===null){for(;!$.done;k++,$=y.next())$=f(g,$.value,v),$!==null&&(b=s($,b,k),E===null?S=$:E.sibling=$,E=$);return Qe&&ns(g,k),S}for(w=r(g,w);!$.done;k++,$=y.next())$=h(w,g,k,$.value,v),$!==null&&(t&&$.alternate!==null&&w.delete($.key===null?k:$.key),b=s($,b,k),E===null?S=$:E.sibling=$,E=$);return t&&w.forEach(function(_){return e(g,_)}),Qe&&ns(g,k),S}function O(g,b,y,v){if(typeof y=="object"&&y!==null&&y.type===Ks&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Bc:e:{for(var S=y.key,E=b;E!==null;){if(E.key===S){if(S=y.type,S===Ks){if(E.tag===7){n(g,E.sibling),b=i(E,y.props.children),b.return=g,g=b;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===di&&hx(S)===E.type){n(g,E.sibling),b=i(E,y.props),b.ref=xa(g,E,y),b.return=g,g=b;break e}n(g,E);break}else e(g,E);E=E.sibling}y.type===Ks?(b=gs(y.props.children,g.mode,v,y.key),b.return=g,g=b):(v=Ju(y.type,y.key,y.props,null,g.mode,v),v.ref=xa(g,b,y),v.return=g,g=v)}return o(g);case qs:e:{for(E=y.key;b!==null;){if(b.key===E)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){n(g,b.sibling),b=i(b,y.children||[]),b.return=g,g=b;break e}else{n(g,b);break}else e(g,b);b=b.sibling}b=ap(y,g.mode,v),b.return=g,g=b}return o(g);case di:return E=y._init,O(g,b,E(y._payload),v)}if(Qa(y))return p(g,b,y,v);if(ma(y))return m(g,b,y,v);Jc(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(n(g,b.sibling),b=i(b,y),b.return=g,g=b):(n(g,b),b=op(y,g.mode,v),b.return=g,g=b),o(g)):n(g,b)}return O}var Ro=IE(!0),QE=IE(!1),Cf=Ui(null),$f=null,oo=null,iO=null;function sO(){iO=oo=$f=null}function oO(t){var e=Cf.current;Ie(Cf),t._currentValue=e}function zm(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function xo(t,e){$f=t,iO=oo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Xt=!0),t.firstContext=null)}function Pn(t){var e=t._currentValue;if(iO!==t)if(t={context:t,memoizedValue:e,next:null},oo===null){if($f===null)throw Error(K(308));oo=t,$f.dependencies={lanes:0,firstContext:t}}else oo=oo.next=t;return e}var us=null;function aO(t){us===null?us=[t]:us.push(t)}function RE(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,aO(e)):(n.next=i.next,i.next=n),e.interleaved=n,Kr(t,r)}function Kr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var hi=!1;function lO(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ME(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Yr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function _i(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,ve&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Kr(t,n)}return i=r.interleaved,i===null?(e.next=e,aO(r)):(e.next=i.next,i.next=e),r.interleaved=e,Kr(t,n)}function Uu(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,U0(t,n)}}function px(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=e:s=s.next=e}else i=s=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function Af(t,e,n,r){var i=t.updateQueue;hi=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=i.baseState;o=0,u=c=l=null,a=s;do{var d=a.lane,h=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=t,m=a;switch(d=e,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){f=p.call(h,f,d);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=Be({},f,d);break e;case 2:hi=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[a]:d.push(a))}else h={eventTime:h,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,o|=d;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;d=a,a=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do o|=i.lane,i=i.next;while(i!==e)}else s===null&&(i.shared.lanes=0);Ts|=o,t.lanes=o,t.memoizedState=f}}function mx(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(K(191,i));i.call(r)}}}var mc={},kr=Ui(mc),wl=Ui(mc),Sl=Ui(mc);function fs(t){if(t===mc)throw Error(K(174));return t}function cO(t,e){switch($e(Sl,e),$e(wl,t),$e(kr,mc),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Em(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Em(e,t)}Ie(kr),$e(kr,e)}function Mo(){Ie(kr),Ie(wl),Ie(Sl)}function LE(t){fs(Sl.current);var e=fs(kr.current),n=Em(e,t.type);e!==n&&($e(wl,t),$e(kr,n))}function uO(t){wl.current===t&&(Ie(kr),Ie(wl))}var Ze=Ui(0);function If(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var ep=[];function fO(){for(var t=0;t<ep.length;t++)ep[t]._workInProgressVersionPrimary=null;ep.length=0}var Yu=si.ReactCurrentDispatcher,tp=si.ReactCurrentBatchConfig,Es=0,je=null,rt=null,at=null,Qf=!1,Ya=!1,kl=0,_R=0;function kt(){throw Error(K(321))}function dO(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 hO(t,e,n,r,i,s){if(Es=s,je=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Yu.current=t===null||t.memoizedState===null?IR:QR,t=n(r,i),Ya){s=0;do{if(Ya=!1,kl=0,25<=s)throw Error(K(301));s+=1,at=rt=null,e.updateQueue=null,Yu.current=RR,t=n(r,i)}while(Ya)}if(Yu.current=Rf,e=rt!==null&&rt.next!==null,Es=0,at=rt=je=null,Qf=!1,e)throw Error(K(300));return t}function pO(){var t=kl!==0;return kl=0,t}function dr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?je.memoizedState=at=t:at=at.next=t,at}function _n(){if(rt===null){var t=je.alternate;t=t!==null?t.memoizedState:null}else t=rt.next;var e=at===null?je.memoizedState:at.next;if(e!==null)at=e,rt=t;else{if(t===null)throw Error(K(310));rt=t,t={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},at===null?je.memoizedState=at=t:at=at.next=t}return at}function El(t,e){return typeof e=="function"?e(t):e}function np(t){var e=_n(),n=e.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=t;var r=rt,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var u=c.lane;if((Es&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,je.lanes|=u,Ts|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Gn(r,e.memoizedState)||(Xt=!0),e.memoizedState=r,e.baseState=o,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do s=i.lane,je.lanes|=s,Ts|=s,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function rp(t){var e=_n(),n=e.queue;if(n===null)throw Error(K(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,s=e.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=t(s,o.action),o=o.next;while(o!==i);Gn(s,e.memoizedState)||(Xt=!0),e.memoizedState=s,e.baseQueue===null&&(e.baseState=s),n.lastRenderedState=s}return[s,r]}function DE(){}function ZE(t,e){var n=je,r=_n(),i=e(),s=!Gn(r.memoizedState,i);if(s&&(r.memoizedState=i,Xt=!0),r=r.queue,mO(BE.bind(null,n,r,t),[t]),r.getSnapshot!==e||s||at!==null&&at.memoizedState.tag&1){if(n.flags|=2048,Tl(9,jE.bind(null,n,r,i,e),void 0,null),ft===null)throw Error(K(349));Es&30||VE(n,e,i)}return i}function VE(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=je.updateQueue,e===null?(e={lastEffect:null,stores:null},je.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function jE(t,e,n,r){e.value=n,e.getSnapshot=r,FE(e)&&XE(t)}function BE(t,e,n){return n(function(){FE(e)&&XE(t)})}function FE(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!Gn(t,n)}catch{return!0}}function XE(t){var e=Kr(t,1);e!==null&&Yn(e,t,1,-1)}function gx(t){var e=dr();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:t},e.queue=t,t=t.dispatch=AR.bind(null,je,t),[e.memoizedState,t]}function Tl(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=je.updateQueue,e===null?(e={lastEffect:null,stores:null},je.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function zE(){return _n().memoizedState}function Gu(t,e,n,r){var i=dr();je.flags|=t,i.memoizedState=Tl(1|e,n,void 0,r===void 0?null:r)}function Vd(t,e,n,r){var i=_n();r=r===void 0?null:r;var s=void 0;if(rt!==null){var o=rt.memoizedState;if(s=o.destroy,r!==null&&dO(r,o.deps)){i.memoizedState=Tl(e,n,s,r);return}}je.flags|=t,i.memoizedState=Tl(1|e,n,s,r)}function Ox(t,e){return Gu(8390656,8,t,e)}function mO(t,e){return Vd(2048,8,t,e)}function WE(t,e){return Vd(4,2,t,e)}function UE(t,e){return Vd(4,4,t,e)}function YE(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function GE(t,e,n){return n=n!=null?n.concat([t]):null,Vd(4,4,YE.bind(null,e,t),n)}function gO(){}function HE(t,e){var n=_n();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&dO(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function qE(t,e){var n=_n();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&dO(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function KE(t,e,n){return Es&21?(Gn(n,e)||(n=rE(),je.lanes|=n,Ts|=n,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Xt=!0),t.memoizedState=n)}function CR(t,e){var n=ke;ke=n!==0&&4>n?n:4,t(!0);var r=tp.transition;tp.transition={};try{t(!1),e()}finally{ke=n,tp.transition=r}}function JE(){return _n().memoizedState}function $R(t,e,n){var r=$i(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},e2(t))t2(e,n);else if(n=RE(t,e,n,r),n!==null){var i=At();Yn(n,t,r,i),n2(n,e,r)}}function AR(t,e,n){var r=$i(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(e2(t))t2(e,i);else{var s=t.alternate;if(t.lanes===0&&(s===null||s.lanes===0)&&(s=e.lastRenderedReducer,s!==null))try{var o=e.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Gn(a,o)){var l=e.interleaved;l===null?(i.next=i,aO(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=RE(t,e,i,r),n!==null&&(i=At(),Yn(n,t,r,i),n2(n,e,r))}}function e2(t){var e=t.alternate;return t===je||e!==null&&e===je}function t2(t,e){Ya=Qf=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function n2(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,U0(t,n)}}var Rf={readContext:Pn,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},IR={readContext:Pn,useCallback:function(t,e){return dr().memoizedState=[t,e===void 0?null:e],t},useContext:Pn,useEffect:Ox,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Gu(4194308,4,YE.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Gu(4194308,4,t,e)},useInsertionEffect:function(t,e){return Gu(4,2,t,e)},useMemo:function(t,e){var n=dr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=dr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=$R.bind(null,je,t),[r.memoizedState,t]},useRef:function(t){var e=dr();return t={current:t},e.memoizedState=t},useState:gx,useDebugValue:gO,useDeferredValue:function(t){return dr().memoizedState=t},useTransition:function(){var t=gx(!1),e=t[0];return t=CR.bind(null,t[1]),dr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=je,i=dr();if(Qe){if(n===void 0)throw Error(K(407));n=n()}else{if(n=e(),ft===null)throw Error(K(349));Es&30||VE(r,e,n)}i.memoizedState=n;var s={value:n,getSnapshot:e};return i.queue=s,Ox(BE.bind(null,r,s,t),[t]),r.flags|=2048,Tl(9,jE.bind(null,r,s,n,e),void 0,null),n},useId:function(){var t=dr(),e=ft.identifierPrefix;if(Qe){var n=zr,r=Xr;n=(r&~(1<<32-Un(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=kl++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=_R++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},QR={readContext:Pn,useCallback:HE,useContext:Pn,useEffect:mO,useImperativeHandle:GE,useInsertionEffect:WE,useLayoutEffect:UE,useMemo:qE,useReducer:np,useRef:zE,useState:function(){return np(El)},useDebugValue:gO,useDeferredValue:function(t){var e=_n();return KE(e,rt.memoizedState,t)},useTransition:function(){var t=np(El)[0],e=_n().memoizedState;return[t,e]},useMutableSource:DE,useSyncExternalStore:ZE,useId:JE,unstable_isNewReconciler:!1},RR={readContext:Pn,useCallback:HE,useContext:Pn,useEffect:mO,useImperativeHandle:GE,useInsertionEffect:WE,useLayoutEffect:UE,useMemo:qE,useReducer:rp,useRef:zE,useState:function(){return rp(El)},useDebugValue:gO,useDeferredValue:function(t){var e=_n();return rt===null?e.memoizedState=t:KE(e,rt.memoizedState,t)},useTransition:function(){var t=rp(El)[0],e=_n().memoizedState;return[t,e]},useMutableSource:DE,useSyncExternalStore:ZE,useId:JE,unstable_isNewReconciler:!1};function Qn(t,e){if(t&&t.defaultProps){e=Be({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function Wm(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Be({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var jd={isMounted:function(t){return(t=t._reactInternals)?Vs(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=At(),i=$i(t),s=Yr(r,i);s.payload=e,n!=null&&(s.callback=n),e=_i(t,s,i),e!==null&&(Yn(e,t,i,r),Uu(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=At(),i=$i(t),s=Yr(r,i);s.tag=1,s.payload=e,n!=null&&(s.callback=n),e=_i(t,s,i),e!==null&&(Yn(e,t,i,r),Uu(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=At(),r=$i(t),i=Yr(n,r);i.tag=2,e!=null&&(i.callback=e),e=_i(t,i,r),e!==null&&(Yn(e,t,r,n),Uu(e,t,r))}};function yx(t,e,n,r,i,s,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,s,o):e.prototype&&e.prototype.isPureReactComponent?!yl(n,r)||!yl(i,s):!0}function r2(t,e,n){var r=!1,i=Mi,s=e.contextType;return typeof s=="object"&&s!==null?s=Pn(s):(i=Ht(e)?Ss:Pt.current,r=e.contextTypes,s=(r=r!=null)?Io(t,i):Mi),e=new e(n,s),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=jd,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=s),e}function bx(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&jd.enqueueReplaceState(e,e.state,null)}function Um(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},lO(t);var s=e.contextType;typeof s=="object"&&s!==null?i.context=Pn(s):(s=Ht(e)?Ss:Pt.current,i.context=Io(t,s)),i.state=t.memoizedState,s=e.getDerivedStateFromProps,typeof s=="function"&&(Wm(t,e,s,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&jd.enqueueReplaceState(i,i.state,null),Af(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Lo(t,e){try{var n="",r=e;do n+=cQ(r),r=r.return;while(r);var i=n}catch(s){i=`
|
|
39
|
+
Error generating stack: `+s.message+`
|
|
40
|
+
`+s.stack}return{value:t,source:e,stack:i,digest:null}}function ip(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function Ym(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var MR=typeof WeakMap=="function"?WeakMap:Map;function i2(t,e,n){n=Yr(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){Lf||(Lf=!0,ig=r),Ym(t,e)},n}function s2(t,e,n){n=Yr(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){Ym(t,e)}}var s=t.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Ym(t,e),typeof r!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function xx(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new MR;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=HR.bind(null,t,e,n),e.then(t,t))}function vx(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function wx(t,e,n,r,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Yr(-1,1),e.tag=2,_i(n,e,1))),n.lanes|=1),t)}var LR=si.ReactCurrentOwner,Xt=!1;function Ct(t,e,n,r){e.child=t===null?QE(e,null,n,r):Ro(e,t.child,n,r)}function Sx(t,e,n,r,i){n=n.render;var s=e.ref;return xo(e,i),r=hO(t,e,n,r,s,i),n=pO(),t!==null&&!Xt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Jr(t,e,i)):(Qe&&n&&tO(e),e.flags|=1,Ct(t,e,r,i),e.child)}function kx(t,e,n,r,i){if(t===null){var s=n.type;return typeof s=="function"&&!kO(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=s,o2(t,e,s,r,i)):(t=Ju(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(s=t.child,!(t.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:yl,n(o,r)&&t.ref===e.ref)return Jr(t,e,i)}return e.flags|=1,t=Ai(s,r),t.ref=e.ref,t.return=e,e.child=t}function o2(t,e,n,r,i){if(t!==null){var s=t.memoizedProps;if(yl(s,r)&&t.ref===e.ref)if(Xt=!1,e.pendingProps=r=s,(t.lanes&i)!==0)t.flags&131072&&(Xt=!0);else return e.lanes=t.lanes,Jr(t,e,i)}return Gm(t,e,n,r,i)}function a2(t,e,n){var r=e.pendingProps,i=r.children,s=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},$e(lo,an),an|=n;else{if(!(n&1073741824))return t=s!==null?s.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,$e(lo,an),an|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,$e(lo,an),an|=r}else s!==null?(r=s.baseLanes|n,e.memoizedState=null):r=n,$e(lo,an),an|=r;return Ct(t,e,i,n),e.child}function l2(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function Gm(t,e,n,r,i){var s=Ht(n)?Ss:Pt.current;return s=Io(e,s),xo(e,i),n=hO(t,e,n,r,s,i),r=pO(),t!==null&&!Xt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Jr(t,e,i)):(Qe&&r&&tO(e),e.flags|=1,Ct(t,e,n,i),e.child)}function Ex(t,e,n,r,i){if(Ht(n)){var s=!0;Nf(e)}else s=!1;if(xo(e,i),e.stateNode===null)Hu(t,e),r2(e,n,r),Um(e,n,r,i),r=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Pn(c):(c=Ht(n)?Ss:Pt.current,c=Io(e,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&bx(e,o,r,c),hi=!1;var d=e.memoizedState;o.state=d,Af(e,r,o,i),l=e.memoizedState,a!==r||d!==l||Gt.current||hi?(typeof u=="function"&&(Wm(e,n,u,r),l=e.memoizedState),(a=hi||yx(e,n,a,r,d,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,ME(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:Qn(e.type,a),o.props=c,f=e.pendingProps,d=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Pn(l):(l=Ht(n)?Ss:Pt.current,l=Io(e,l));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||d!==l)&&bx(e,o,r,l),hi=!1,d=e.memoizedState,o.state=d,Af(e,r,o,i);var p=e.memoizedState;a!==f||d!==p||Gt.current||hi?(typeof h=="function"&&(Wm(e,n,h,r),p=e.memoizedState),(c=hi||yx(e,n,c,r,d,p,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=p),o.props=r,o.state=p,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),r=!1)}return Hm(t,e,n,r,s,i)}function Hm(t,e,n,r,i,s){l2(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return i&&ux(e,n,!1),Jr(t,e,s);r=e.stateNode,LR.current=e;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=Ro(e,t.child,null,s),e.child=Ro(e,null,a,s)):Ct(t,e,a,s),e.memoizedState=r.state,i&&ux(e,n,!0),e.child}function c2(t){var e=t.stateNode;e.pendingContext?cx(t,e.pendingContext,e.pendingContext!==e.context):e.context&&cx(t,e.context,!1),cO(t,e.containerInfo)}function Tx(t,e,n,r,i){return Qo(),rO(i),e.flags|=256,Ct(t,e,n,r),e.child}var qm={dehydrated:null,treeContext:null,retryLane:0};function Km(t){return{baseLanes:t,cachePool:null,transitions:null}}function u2(t,e,n){var r=e.pendingProps,i=Ze.current,s=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(s=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),$e(Ze,i&1),t===null)return Xm(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,s?(r=e.mode,s=e.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Xd(o,r,0,null),t=gs(t,r,n,null),s.return=e,t.return=e,s.sibling=t,e.child=s,e.child.memoizedState=Km(n),e.memoizedState=qm,t):OO(e,o));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return DR(t,e,o,r,a,i,n);if(s){s=r.fallback,o=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Ai(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Ai(a,s):(s=gs(s,o,n,null),s.flags|=2),s.return=e,r.return=e,r.sibling=s,e.child=r,r=s,s=e.child,o=t.child.memoizedState,o=o===null?Km(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=t.childLanes&~n,e.memoizedState=qm,r}return s=t.child,t=s.sibling,r=Ai(s,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function OO(t,e){return e=Xd({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function eu(t,e,n,r){return r!==null&&rO(r),Ro(e,t.child,null,n),t=OO(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function DR(t,e,n,r,i,s,o){if(n)return e.flags&256?(e.flags&=-257,r=ip(Error(K(422))),eu(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(s=r.fallback,i=e.mode,r=Xd({mode:"visible",children:r.children},i,0,null),s=gs(s,i,o,null),s.flags|=2,r.return=e,s.return=e,r.sibling=s,e.child=r,e.mode&1&&Ro(e,t.child,null,o),e.child.memoizedState=Km(o),e.memoizedState=qm,s);if(!(e.mode&1))return eu(t,e,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(K(419)),r=ip(s,r,void 0),eu(t,e,o,r)}if(a=(o&t.childLanes)!==0,Xt||a){if(r=ft,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Kr(t,i),Yn(r,t,i,-1))}return SO(),r=ip(Error(K(421))),eu(t,e,o,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=qR.bind(null,t),i._reactRetry=e,null):(t=s.treeContext,un=Pi(i.nextSibling),dn=e,Qe=!0,Dn=null,t!==null&&(bn[xn++]=Xr,bn[xn++]=zr,bn[xn++]=ks,Xr=t.id,zr=t.overflow,ks=e),e=OO(e,r.children),e.flags|=4096,e)}function Nx(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),zm(t.return,e,n)}function sp(t,e,n,r,i){var s=t.memoizedState;s===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function f2(t,e,n){var r=e.pendingProps,i=r.revealOrder,s=r.tail;if(Ct(t,e,r.children,n),r=Ze.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Nx(t,n,e);else if(t.tag===19)Nx(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if($e(Ze,r),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&If(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),sp(e,!1,i,n,s);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&If(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}sp(e,!0,n,null,s);break;case"together":sp(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Hu(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Jr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ts|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(K(153));if(e.child!==null){for(t=e.child,n=Ai(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Ai(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function ZR(t,e,n){switch(e.tag){case 3:c2(e),Qo();break;case 5:LE(e);break;case 1:Ht(e.type)&&Nf(e);break;case 4:cO(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;$e(Cf,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?($e(Ze,Ze.current&1),e.flags|=128,null):n&e.child.childLanes?u2(t,e,n):($e(Ze,Ze.current&1),t=Jr(t,e,n),t!==null?t.sibling:null);$e(Ze,Ze.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return f2(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$e(Ze,Ze.current),r)break;return null;case 22:case 23:return e.lanes=0,a2(t,e,n)}return Jr(t,e,n)}var d2,Jm,h2,p2;d2=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Jm=function(){};h2=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,fs(kr.current);var s=null;switch(n){case"input":i=vm(t,i),r=vm(t,r),s=[];break;case"select":i=Be({},i,{value:void 0}),r=Be({},r,{value:void 0}),s=[];break;case"textarea":i=km(t,i),r=km(t,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=Ef)}Tm(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(fl.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(fl.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ae("scroll",t),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(e.updateQueue=c)&&(e.flags|=4)}};p2=function(t,e,n,r){n!==r&&(e.flags|=4)};function va(t,e){if(!Qe)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function Et(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function VR(t,e,n){var r=e.pendingProps;switch(nO(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(e),null;case 1:return Ht(e.type)&&Tf(),Et(e),null;case 3:return r=e.stateNode,Mo(),Ie(Gt),Ie(Pt),fO(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Kc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Dn!==null&&(ag(Dn),Dn=null))),Jm(t,e),Et(e),null;case 5:uO(e);var i=fs(Sl.current);if(n=e.type,t!==null&&e.stateNode!=null)h2(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(K(166));return Et(e),null}if(t=fs(kr.current),Kc(e)){r=e.stateNode,n=e.type;var s=e.memoizedProps;switch(r[pr]=e,r[vl]=s,t=(e.mode&1)!==0,n){case"dialog":Ae("cancel",r),Ae("close",r);break;case"iframe":case"object":case"embed":Ae("load",r);break;case"video":case"audio":for(i=0;i<Ma.length;i++)Ae(Ma[i],r);break;case"source":Ae("error",r);break;case"img":case"image":case"link":Ae("error",r),Ae("load",r);break;case"details":Ae("toggle",r);break;case"input":Mb(r,s),Ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Ae("invalid",r);break;case"textarea":Db(r,s),Ae("invalid",r)}Tm(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&qc(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&qc(r.textContent,a,t),i=["children",""+a]):fl.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Ae("scroll",r)}switch(n){case"input":Fc(r),Lb(r,s,!0);break;case"textarea":Fc(r),Zb(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Ef)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Bk(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[pr]=e,t[vl]=r,d2(t,e,!1,!1),e.stateNode=t;e:{switch(o=Nm(n,r),n){case"dialog":Ae("cancel",t),Ae("close",t),i=r;break;case"iframe":case"object":case"embed":Ae("load",t),i=r;break;case"video":case"audio":for(i=0;i<Ma.length;i++)Ae(Ma[i],t);i=r;break;case"source":Ae("error",t),i=r;break;case"img":case"image":case"link":Ae("error",t),Ae("load",t),i=r;break;case"details":Ae("toggle",t),i=r;break;case"input":Mb(t,r),i=vm(t,r),Ae("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Be({},r,{value:void 0}),Ae("invalid",t);break;case"textarea":Db(t,r),i=km(t,r),Ae("invalid",t);break;default:i=r}Tm(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?zk(t,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Fk(t,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&dl(t,l):typeof l=="number"&&dl(t,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(fl.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Ae("scroll",t):l!=null&&j0(t,s,l,o))}switch(n){case"input":Fc(t),Lb(t,r,!1);break;case"textarea":Fc(t),Zb(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Ri(r.value));break;case"select":t.multiple=!!r.multiple,s=r.value,s!=null?go(t,!!r.multiple,s,!1):r.defaultValue!=null&&go(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=Ef)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Et(e),null;case 6:if(t&&e.stateNode!=null)p2(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(K(166));if(n=fs(Sl.current),fs(kr.current),Kc(e)){if(r=e.stateNode,n=e.memoizedProps,r[pr]=e,(s=r.nodeValue!==n)&&(t=dn,t!==null))switch(t.tag){case 3:qc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&qc(r.nodeValue,n,(t.mode&1)!==0)}s&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[pr]=e,e.stateNode=r}return Et(e),null;case 13:if(Ie(Ze),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Qe&&un!==null&&e.mode&1&&!(e.flags&128))AE(),Qo(),e.flags|=98560,s=!1;else if(s=Kc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!s)throw Error(K(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(K(317));s[pr]=e}else Qo(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Et(e),s=!1}else Dn!==null&&(ag(Dn),Dn=null),s=!0;if(!s)return e.flags&65536?e:null}return e.flags&128?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,e.mode&1&&(t===null||Ze.current&1?st===0&&(st=3):SO())),e.updateQueue!==null&&(e.flags|=4),Et(e),null);case 4:return Mo(),Jm(t,e),t===null&&bl(e.stateNode.containerInfo),Et(e),null;case 10:return oO(e.type._context),Et(e),null;case 17:return Ht(e.type)&&Tf(),Et(e),null;case 19:if(Ie(Ze),s=e.memoizedState,s===null)return Et(e),null;if(r=(e.flags&128)!==0,o=s.rendering,o===null)if(r)va(s,!1);else{if(st!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=If(t),o!==null){for(e.flags|=128,va(s,!1),r=o.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)s=n,t=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=t,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,t=o.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return $e(Ze,Ze.current&1|2),e.child}t=t.sibling}s.tail!==null&&He()>Do&&(e.flags|=128,r=!0,va(s,!1),e.lanes=4194304)}else{if(!r)if(t=If(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),va(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!Qe)return Et(e),null}else 2*He()-s.renderingStartTime>Do&&n!==1073741824&&(e.flags|=128,r=!0,va(s,!1),e.lanes=4194304);s.isBackwards?(o.sibling=e.child,e.child=o):(n=s.last,n!==null?n.sibling=o:e.child=o,s.last=o)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=He(),e.sibling=null,n=Ze.current,$e(Ze,r?n&1|2:n&1),e):(Et(e),null);case 22:case 23:return wO(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?an&1073741824&&(Et(e),e.subtreeFlags&6&&(e.flags|=8192)):Et(e),null;case 24:return null;case 25:return null}throw Error(K(156,e.tag))}function jR(t,e){switch(nO(e),e.tag){case 1:return Ht(e.type)&&Tf(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Mo(),Ie(Gt),Ie(Pt),fO(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return uO(e),null;case 13:if(Ie(Ze),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(K(340));Qo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ie(Ze),null;case 4:return Mo(),null;case 10:return oO(e.type._context),null;case 22:case 23:return wO(),null;case 24:return null;default:return null}}var tu=!1,Nt=!1,BR=typeof WeakSet=="function"?WeakSet:Set,se=null;function ao(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(t,e,r)}else n.current=null}function eg(t,e,n){try{n()}catch(r){Xe(t,e,r)}}var Px=!1;function FR(t,e){if(Lm=wf,t=bE(),eO(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,f=t,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(a=o+i),f!==s||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===t)break t;if(d===n&&++c===i&&(a=o),d===s&&++u===r&&(l=o),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Dm={focusedElem:t,selectionRange:n},wf=!1,se=e;se!==null;)if(e=se,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,se=t;else for(;se!==null;){e=se;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,O=p.memoizedState,g=e.stateNode,b=g.getSnapshotBeforeUpdate(e.elementType===e.type?m:Qn(e.type,m),O);g.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(v){Xe(e,e.return,v)}if(t=e.sibling,t!==null){t.return=e.return,se=t;break}se=e.return}return p=Px,Px=!1,p}function Ga(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var s=i.destroy;i.destroy=void 0,s!==void 0&&eg(e,n,s)}i=i.next}while(i!==r)}}function Bd(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function tg(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function m2(t){var e=t.alternate;e!==null&&(t.alternate=null,m2(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[pr],delete e[vl],delete e[jm],delete e[ER],delete e[TR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function g2(t){return t.tag===5||t.tag===3||t.tag===4}function _x(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||g2(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function ng(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=Ef));else if(r!==4&&(t=t.child,t!==null))for(ng(t,e,n),t=t.sibling;t!==null;)ng(t,e,n),t=t.sibling}function rg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(rg(t,e,n),t=t.sibling;t!==null;)rg(t,e,n),t=t.sibling}var pt=null,Rn=!1;function li(t,e,n){for(n=n.child;n!==null;)O2(t,e,n),n=n.sibling}function O2(t,e,n){if(Sr&&typeof Sr.onCommitFiberUnmount=="function")try{Sr.onCommitFiberUnmount(Qd,n)}catch{}switch(n.tag){case 5:Nt||ao(n,e);case 6:var r=pt,i=Rn;pt=null,li(t,e,n),pt=r,Rn=i,pt!==null&&(Rn?(t=pt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):pt.removeChild(n.stateNode));break;case 18:pt!==null&&(Rn?(t=pt,n=n.stateNode,t.nodeType===8?Kh(t.parentNode,n):t.nodeType===1&&Kh(t,n),gl(t)):Kh(pt,n.stateNode));break;case 4:r=pt,i=Rn,pt=n.stateNode.containerInfo,Rn=!0,li(t,e,n),pt=r,Rn=i;break;case 0:case 11:case 14:case 15:if(!Nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&eg(n,e,o),i=i.next}while(i!==r)}li(t,e,n);break;case 1:if(!Nt&&(ao(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Xe(n,e,a)}li(t,e,n);break;case 21:li(t,e,n);break;case 22:n.mode&1?(Nt=(r=Nt)||n.memoizedState!==null,li(t,e,n),Nt=r):li(t,e,n);break;default:li(t,e,n)}}function Cx(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new BR),e.forEach(function(r){var i=KR.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function An(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:pt=a.stateNode,Rn=!1;break e;case 3:pt=a.stateNode.containerInfo,Rn=!0;break e;case 4:pt=a.stateNode.containerInfo,Rn=!0;break e}a=a.return}if(pt===null)throw Error(K(160));O2(s,o,i),pt=null,Rn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Xe(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)y2(e,t),e=e.sibling}function y2(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(An(e,t),or(t),r&4){try{Ga(3,t,t.return),Bd(3,t)}catch(m){Xe(t,t.return,m)}try{Ga(5,t,t.return)}catch(m){Xe(t,t.return,m)}}break;case 1:An(e,t),or(t),r&512&&n!==null&&ao(n,n.return);break;case 5:if(An(e,t),or(t),r&512&&n!==null&&ao(n,n.return),t.flags&32){var i=t.stateNode;try{dl(i,"")}catch(m){Xe(t,t.return,m)}}if(r&4&&(i=t.stateNode,i!=null)){var s=t.memoizedProps,o=n!==null?n.memoizedProps:s,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&Vk(i,s),Nm(a,o);var c=Nm(a,s);for(o=0;o<l.length;o+=2){var u=l[o],f=l[o+1];u==="style"?zk(i,f):u==="dangerouslySetInnerHTML"?Fk(i,f):u==="children"?dl(i,f):j0(i,u,f,c)}switch(a){case"input":wm(i,s);break;case"textarea":jk(i,s);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?go(i,!!s.multiple,h,!1):d!==!!s.multiple&&(s.defaultValue!=null?go(i,!!s.multiple,s.defaultValue,!0):go(i,!!s.multiple,s.multiple?[]:"",!1))}i[vl]=s}catch(m){Xe(t,t.return,m)}}break;case 6:if(An(e,t),or(t),r&4){if(t.stateNode===null)throw Error(K(162));i=t.stateNode,s=t.memoizedProps;try{i.nodeValue=s}catch(m){Xe(t,t.return,m)}}break;case 3:if(An(e,t),or(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{gl(e.containerInfo)}catch(m){Xe(t,t.return,m)}break;case 4:An(e,t),or(t);break;case 13:An(e,t),or(t),i=t.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(xO=He())),r&4&&Cx(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(Nt=(c=Nt)||u,An(e,t),Nt=c):An(e,t),or(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&t.mode&1)for(se=t,u=t.child;u!==null;){for(f=se=u;se!==null;){switch(d=se,h=d.child,d.tag){case 0:case 11:case 14:case 15:Ga(4,d,d.return);break;case 1:ao(d,d.return);var p=d.stateNode;if(typeof p.componentWillUnmount=="function"){r=d,n=d.return;try{e=r,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(m){Xe(r,n,m)}}break;case 5:ao(d,d.return);break;case 22:if(d.memoizedState!==null){Ax(f);continue}}h!==null?(h.return=d,se=h):Ax(f)}u=u.sibling}e:for(u=null,f=t;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Xk("display",o))}catch(m){Xe(t,t.return,m)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(m){Xe(t,t.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:An(e,t),or(t),r&4&&Cx(t);break;case 21:break;default:An(e,t),or(t)}}function or(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(g2(n)){var r=n;break e}n=n.return}throw Error(K(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(dl(i,""),r.flags&=-33);var s=_x(t);rg(t,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=_x(t);ng(t,a,o);break;default:throw Error(K(161))}}catch(l){Xe(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function XR(t,e,n){se=t,b2(t)}function b2(t,e,n){for(var r=(t.mode&1)!==0;se!==null;){var i=se,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||tu;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Nt;a=tu;var c=Nt;if(tu=o,(Nt=l)&&!c)for(se=i;se!==null;)o=se,l=o.child,o.tag===22&&o.memoizedState!==null?Ix(i):l!==null?(l.return=o,se=l):Ix(i);for(;s!==null;)se=s,b2(s),s=s.sibling;se=i,tu=a,Nt=c}$x(t)}else i.subtreeFlags&8772&&s!==null?(s.return=i,se=s):$x(t)}}function $x(t){for(;se!==null;){var e=se;if(e.flags&8772){var n=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Nt||Bd(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!Nt)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:Qn(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=e.updateQueue;s!==null&&mx(e,s,r);break;case 3:var o=e.updateQueue;if(o!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}mx(e,o,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&gl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(K(163))}Nt||e.flags&512&&tg(e)}catch(d){Xe(e,e.return,d)}}if(e===t){se=null;break}if(n=e.sibling,n!==null){n.return=e.return,se=n;break}se=e.return}}function Ax(t){for(;se!==null;){var e=se;if(e===t){se=null;break}var n=e.sibling;if(n!==null){n.return=e.return,se=n;break}se=e.return}}function Ix(t){for(;se!==null;){var e=se;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Bd(4,e)}catch(l){Xe(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Xe(e,i,l)}}var s=e.return;try{tg(e)}catch(l){Xe(e,s,l)}break;case 5:var o=e.return;try{tg(e)}catch(l){Xe(e,o,l)}}}catch(l){Xe(e,e.return,l)}if(e===t){se=null;break}var a=e.sibling;if(a!==null){a.return=e.return,se=a;break}se=e.return}}var zR=Math.ceil,Mf=si.ReactCurrentDispatcher,yO=si.ReactCurrentOwner,Nn=si.ReactCurrentBatchConfig,ve=0,ft=null,Je=null,bt=0,an=0,lo=Ui(0),st=0,Nl=null,Ts=0,Fd=0,bO=0,Ha=null,Vt=null,xO=0,Do=1/0,Mr=null,Lf=!1,ig=null,Ci=null,nu=!1,Si=null,Df=0,qa=0,sg=null,qu=-1,Ku=0;function At(){return ve&6?He():qu!==-1?qu:qu=He()}function $i(t){return t.mode&1?ve&2&&bt!==0?bt&-bt:PR.transition!==null?(Ku===0&&(Ku=rE()),Ku):(t=ke,t!==0||(t=window.event,t=t===void 0?16:uE(t.type)),t):1}function Yn(t,e,n,r){if(50<qa)throw qa=0,sg=null,Error(K(185));dc(t,n,r),(!(ve&2)||t!==ft)&&(t===ft&&(!(ve&2)&&(Fd|=n),st===4&&yi(t,bt)),qt(t,r),n===1&&ve===0&&!(e.mode&1)&&(Do=He()+500,Zd&&Yi()))}function qt(t,e){var n=t.callbackNode;PQ(t,e);var r=vf(t,t===ft?bt:0);if(r===0)n!==null&&Bb(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&Bb(n),e===1)t.tag===0?NR(Qx.bind(null,t)):_E(Qx.bind(null,t)),SR(function(){!(ve&6)&&Yi()}),n=null;else{switch(iE(r)){case 1:n=W0;break;case 4:n=tE;break;case 16:n=xf;break;case 536870912:n=nE;break;default:n=xf}n=N2(n,x2.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function x2(t,e){if(qu=-1,Ku=0,ve&6)throw Error(K(327));var n=t.callbackNode;if(vo()&&t.callbackNode!==n)return null;var r=vf(t,t===ft?bt:0);if(r===0)return null;if(r&30||r&t.expiredLanes||e)e=Zf(t,r);else{e=r;var i=ve;ve|=2;var s=w2();(ft!==t||bt!==e)&&(Mr=null,Do=He()+500,ms(t,e));do try{YR();break}catch(a){v2(t,a)}while(!0);sO(),Mf.current=s,ve=i,Je!==null?e=0:(ft=null,bt=0,e=st)}if(e!==0){if(e===2&&(i=Am(t),i!==0&&(r=i,e=og(t,i))),e===1)throw n=Nl,ms(t,0),yi(t,r),qt(t,He()),n;if(e===6)yi(t,r);else{if(i=t.current.alternate,!(r&30)&&!WR(i)&&(e=Zf(t,r),e===2&&(s=Am(t),s!==0&&(r=s,e=og(t,s))),e===1))throw n=Nl,ms(t,0),yi(t,r),qt(t,He()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(K(345));case 2:rs(t,Vt,Mr);break;case 3:if(yi(t,r),(r&130023424)===r&&(e=xO+500-He(),10<e)){if(vf(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){At(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Vm(rs.bind(null,t,Vt,Mr),e);break}rs(t,Vt,Mr);break;case 4:if(yi(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var o=31-Un(r);s=1<<o,o=e[o],o>i&&(i=o),r&=~s}if(r=i,r=He()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zR(r/1960))-r,10<r){t.timeoutHandle=Vm(rs.bind(null,t,Vt,Mr),r);break}rs(t,Vt,Mr);break;case 5:rs(t,Vt,Mr);break;default:throw Error(K(329))}}}return qt(t,He()),t.callbackNode===n?x2.bind(null,t):null}function og(t,e){var n=Ha;return t.current.memoizedState.isDehydrated&&(ms(t,e).flags|=256),t=Zf(t,e),t!==2&&(e=Vt,Vt=n,e!==null&&ag(e)),t}function ag(t){Vt===null?Vt=t:Vt.push.apply(Vt,t)}function WR(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Gn(s(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function yi(t,e){for(e&=~bO,e&=~Fd,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-Un(e),r=1<<n;t[n]=-1,e&=~r}}function Qx(t){if(ve&6)throw Error(K(327));vo();var e=vf(t,0);if(!(e&1))return qt(t,He()),null;var n=Zf(t,e);if(t.tag!==0&&n===2){var r=Am(t);r!==0&&(e=r,n=og(t,r))}if(n===1)throw n=Nl,ms(t,0),yi(t,e),qt(t,He()),n;if(n===6)throw Error(K(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,rs(t,Vt,Mr),qt(t,He()),null}function vO(t,e){var n=ve;ve|=1;try{return t(e)}finally{ve=n,ve===0&&(Do=He()+500,Zd&&Yi())}}function Ns(t){Si!==null&&Si.tag===0&&!(ve&6)&&vo();var e=ve;ve|=1;var n=Nn.transition,r=ke;try{if(Nn.transition=null,ke=1,t)return t()}finally{ke=r,Nn.transition=n,ve=e,!(ve&6)&&Yi()}}function wO(){an=lo.current,Ie(lo)}function ms(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,wR(n)),Je!==null)for(n=Je.return;n!==null;){var r=n;switch(nO(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Tf();break;case 3:Mo(),Ie(Gt),Ie(Pt),fO();break;case 5:uO(r);break;case 4:Mo();break;case 13:Ie(Ze);break;case 19:Ie(Ze);break;case 10:oO(r.type._context);break;case 22:case 23:wO()}n=n.return}if(ft=t,Je=t=Ai(t.current,null),bt=an=e,st=0,Nl=null,bO=Fd=Ts=0,Vt=Ha=null,us!==null){for(e=0;e<us.length;e++)if(n=us[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}us=null}return t}function v2(t,e){do{var n=Je;try{if(sO(),Yu.current=Rf,Qf){for(var r=je.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Qf=!1}if(Es=0,at=rt=je=null,Ya=!1,kl=0,yO.current=null,n===null||n.return===null){st=1,Nl=e,Je=null;break}e:{var s=t,o=n.return,a=n,l=e;if(e=bt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=vx(o);if(h!==null){h.flags&=-257,wx(h,o,a,s,e),h.mode&1&&xx(s,c,e),e=h,l=c;var p=e.updateQueue;if(p===null){var m=new Set;m.add(l),e.updateQueue=m}else p.add(l);break e}else{if(!(e&1)){xx(s,c,e),SO();break e}l=Error(K(426))}}else if(Qe&&a.mode&1){var O=vx(o);if(O!==null){!(O.flags&65536)&&(O.flags|=256),wx(O,o,a,s,e),rO(Lo(l,a));break e}}s=l=Lo(l,a),st!==4&&(st=2),Ha===null?Ha=[s]:Ha.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,e&=-e,s.lanes|=e;var g=i2(s,l,e);px(s,g);break e;case 1:a=l;var b=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof b.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ci===null||!Ci.has(y)))){s.flags|=65536,e&=-e,s.lanes|=e;var v=s2(s,a,e);px(s,v);break e}}s=s.return}while(s!==null)}k2(n)}catch(S){e=S,Je===n&&n!==null&&(Je=n=n.return);continue}break}while(!0)}function w2(){var t=Mf.current;return Mf.current=Rf,t===null?Rf:t}function SO(){(st===0||st===3||st===2)&&(st=4),ft===null||!(Ts&268435455)&&!(Fd&268435455)||yi(ft,bt)}function Zf(t,e){var n=ve;ve|=2;var r=w2();(ft!==t||bt!==e)&&(Mr=null,ms(t,e));do try{UR();break}catch(i){v2(t,i)}while(!0);if(sO(),ve=n,Mf.current=r,Je!==null)throw Error(K(261));return ft=null,bt=0,st}function UR(){for(;Je!==null;)S2(Je)}function YR(){for(;Je!==null&&!bQ();)S2(Je)}function S2(t){var e=T2(t.alternate,t,an);t.memoizedProps=t.pendingProps,e===null?k2(t):Je=e,yO.current=null}function k2(t){var e=t;do{var n=e.alternate;if(t=e.return,e.flags&32768){if(n=jR(n,e),n!==null){n.flags&=32767,Je=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{st=6,Je=null;return}}else if(n=VR(n,e,an),n!==null){Je=n;return}if(e=e.sibling,e!==null){Je=e;return}Je=e=t}while(e!==null);st===0&&(st=5)}function rs(t,e,n){var r=ke,i=Nn.transition;try{Nn.transition=null,ke=1,GR(t,e,n,r)}finally{Nn.transition=i,ke=r}return null}function GR(t,e,n,r){do vo();while(Si!==null);if(ve&6)throw Error(K(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(K(177));t.callbackNode=null,t.callbackPriority=0;var s=n.lanes|n.childLanes;if(_Q(t,s),t===ft&&(Je=ft=null,bt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||nu||(nu=!0,N2(xf,function(){return vo(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Nn.transition,Nn.transition=null;var o=ke;ke=1;var a=ve;ve|=4,yO.current=null,FR(t,n),y2(n,t),mR(Dm),wf=!!Lm,Dm=Lm=null,t.current=n,XR(n),xQ(),ve=a,ke=o,Nn.transition=s}else t.current=n;if(nu&&(nu=!1,Si=t,Df=i),s=t.pendingLanes,s===0&&(Ci=null),SQ(n.stateNode),qt(t,He()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Lf)throw Lf=!1,t=ig,ig=null,t;return Df&1&&t.tag!==0&&vo(),s=t.pendingLanes,s&1?t===sg?qa++:(qa=0,sg=t):qa=0,Yi(),null}function vo(){if(Si!==null){var t=iE(Df),e=Nn.transition,n=ke;try{if(Nn.transition=null,ke=16>t?16:t,Si===null)var r=!1;else{if(t=Si,Si=null,Df=0,ve&6)throw Error(K(331));var i=ve;for(ve|=4,se=t.current;se!==null;){var s=se,o=s.child;if(se.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(se=c;se!==null;){var u=se;switch(u.tag){case 0:case 11:case 15:Ga(8,u,s)}var f=u.child;if(f!==null)f.return=u,se=f;else for(;se!==null;){u=se;var d=u.sibling,h=u.return;if(m2(u),u===c){se=null;break}if(d!==null){d.return=h,se=d;break}se=h}}}var p=s.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var O=m.sibling;m.sibling=null,m=O}while(m!==null)}}se=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,se=o;else e:for(;se!==null;){if(s=se,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Ga(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,se=g;break e}se=s.return}}var b=t.current;for(se=b;se!==null;){o=se;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,se=y;else e:for(o=b;se!==null;){if(a=se,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Bd(9,a)}}catch(S){Xe(a,a.return,S)}if(a===o){se=null;break e}var v=a.sibling;if(v!==null){v.return=a.return,se=v;break e}se=a.return}}if(ve=i,Yi(),Sr&&typeof Sr.onPostCommitFiberRoot=="function")try{Sr.onPostCommitFiberRoot(Qd,t)}catch{}r=!0}return r}finally{ke=n,Nn.transition=e}}return!1}function Rx(t,e,n){e=Lo(n,e),e=i2(t,e,1),t=_i(t,e,1),e=At(),t!==null&&(dc(t,1,e),qt(t,e))}function Xe(t,e,n){if(t.tag===3)Rx(t,t,n);else for(;e!==null;){if(e.tag===3){Rx(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ci===null||!Ci.has(r))){t=Lo(n,t),t=s2(e,t,1),e=_i(e,t,1),t=At(),e!==null&&(dc(e,1,t),qt(e,t));break}}e=e.return}}function HR(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=At(),t.pingedLanes|=t.suspendedLanes&n,ft===t&&(bt&n)===n&&(st===4||st===3&&(bt&130023424)===bt&&500>He()-xO?ms(t,0):bO|=n),qt(t,e)}function E2(t,e){e===0&&(t.mode&1?(e=Wc,Wc<<=1,!(Wc&130023424)&&(Wc=4194304)):e=1);var n=At();t=Kr(t,e),t!==null&&(dc(t,e,n),qt(t,n))}function qR(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),E2(t,n)}function KR(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(e),E2(t,n)}var T2;T2=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Gt.current)Xt=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Xt=!1,ZR(t,e,n);Xt=!!(t.flags&131072)}else Xt=!1,Qe&&e.flags&1048576&&CE(e,_f,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Hu(t,e),t=e.pendingProps;var i=Io(e,Pt.current);xo(e,n),i=hO(null,e,r,t,i,n);var s=pO();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ht(r)?(s=!0,Nf(e)):s=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,lO(e),i.updater=jd,e.stateNode=i,i._reactInternals=e,Um(e,r,t,n),e=Hm(null,e,r,!0,s,n)):(e.tag=0,Qe&&s&&tO(e),Ct(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Hu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=e3(r),t=Qn(r,t),i){case 0:e=Gm(null,e,r,t,n);break e;case 1:e=Ex(null,e,r,t,n);break e;case 11:e=Sx(null,e,r,t,n);break e;case 14:e=kx(null,e,r,Qn(r.type,t),n);break e}throw Error(K(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Qn(r,i),Gm(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Qn(r,i),Ex(t,e,r,i,n);case 3:e:{if(c2(e),t===null)throw Error(K(387));r=e.pendingProps,s=e.memoizedState,i=s.element,ME(t,e),Af(e,r,null,n);var o=e.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=s,e.memoizedState=s,e.flags&256){i=Lo(Error(K(423)),e),e=Tx(t,e,r,n,i);break e}else if(r!==i){i=Lo(Error(K(424)),e),e=Tx(t,e,r,n,i);break e}else for(un=Pi(e.stateNode.containerInfo.firstChild),dn=e,Qe=!0,Dn=null,n=QE(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qo(),r===i){e=Jr(t,e,n);break e}Ct(t,e,r,n)}e=e.child}return e;case 5:return LE(e),t===null&&Xm(e),r=e.type,i=e.pendingProps,s=t!==null?t.memoizedProps:null,o=i.children,Zm(r,i)?o=null:s!==null&&Zm(r,s)&&(e.flags|=32),l2(t,e),Ct(t,e,o,n),e.child;case 6:return t===null&&Xm(e),null;case 13:return u2(t,e,n);case 4:return cO(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Ro(e,null,r,n):Ct(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Qn(r,i),Sx(t,e,r,i,n);case 7:return Ct(t,e,e.pendingProps,n),e.child;case 8:return Ct(t,e,e.pendingProps.children,n),e.child;case 12:return Ct(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,o=i.value,$e(Cf,r._currentValue),r._currentValue=o,s!==null)if(Gn(s.value,o)){if(s.children===i.children&&!Gt.current){e=Jr(t,e,n);break e}}else for(s=e.child,s!==null&&(s.return=e);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Yr(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),zm(s.return,n,e),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===e.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(K(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),zm(o,n,e),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===e){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ct(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,xo(e,n),i=Pn(i),r=r(i),e.flags|=1,Ct(t,e,r,n),e.child;case 14:return r=e.type,i=Qn(r,e.pendingProps),i=Qn(r.type,i),kx(t,e,r,i,n);case 15:return o2(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Qn(r,i),Hu(t,e),e.tag=1,Ht(r)?(t=!0,Nf(e)):t=!1,xo(e,n),r2(e,r,i),Um(e,r,i,n),Hm(null,e,r,!0,t,n);case 19:return f2(t,e,n);case 22:return a2(t,e,n)}throw Error(K(156,e.tag))};function N2(t,e){return eE(t,e)}function JR(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(t,e,n,r){return new JR(t,e,n,r)}function kO(t){return t=t.prototype,!(!t||!t.isReactComponent)}function e3(t){if(typeof t=="function")return kO(t)?1:0;if(t!=null){if(t=t.$$typeof,t===F0)return 11;if(t===X0)return 14}return 2}function Ai(t,e){var n=t.alternate;return n===null?(n=Sn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ju(t,e,n,r,i,s){var o=2;if(r=t,typeof t=="function")kO(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Ks:return gs(n.children,i,s,e);case B0:o=8,i|=8;break;case Om:return t=Sn(12,n,e,i|2),t.elementType=Om,t.lanes=s,t;case ym:return t=Sn(13,n,e,i),t.elementType=ym,t.lanes=s,t;case bm:return t=Sn(19,n,e,i),t.elementType=bm,t.lanes=s,t;case Lk:return Xd(n,i,s,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Rk:o=10;break e;case Mk:o=9;break e;case F0:o=11;break e;case X0:o=14;break e;case di:o=16,r=null;break e}throw Error(K(130,t==null?t:typeof t,""))}return e=Sn(o,n,e,i),e.elementType=t,e.type=r,e.lanes=s,e}function gs(t,e,n,r){return t=Sn(7,t,r,e),t.lanes=n,t}function Xd(t,e,n,r){return t=Sn(22,t,r,e),t.elementType=Lk,t.lanes=n,t.stateNode={isHidden:!1},t}function op(t,e,n){return t=Sn(6,t,null,e),t.lanes=n,t}function ap(t,e,n){return e=Sn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function t3(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jh(0),this.expirationTimes=jh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function EO(t,e,n,r,i,s,o,a,l){return t=new t3(t,e,n,a,l),e===1?(e=1,s===!0&&(e|=8)):e=0,s=Sn(3,null,null,e),t.current=s,s.stateNode=t,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},lO(s),t}function n3(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qs,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function P2(t){if(!t)return Mi;t=t._reactInternals;e:{if(Vs(t)!==t||t.tag!==1)throw Error(K(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ht(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(K(171))}if(t.tag===1){var n=t.type;if(Ht(n))return PE(t,n,e)}return e}function _2(t,e,n,r,i,s,o,a,l){return t=EO(n,r,!0,t,i,s,o,a,l),t.context=P2(null),n=t.current,r=At(),i=$i(n),s=Yr(r,i),s.callback=e??null,_i(n,s,i),t.current.lanes=i,dc(t,i,r),qt(t,r),t}function zd(t,e,n,r){var i=e.current,s=At(),o=$i(i);return n=P2(n),e.context===null?e.context=n:e.pendingContext=n,e=Yr(s,o),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=_i(i,e,o),t!==null&&(Yn(t,i,o,s),Uu(t,i,o)),o}function Vf(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Mx(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function TO(t,e){Mx(t,e),(t=t.alternate)&&Mx(t,e)}function r3(){return null}var C2=typeof reportError=="function"?reportError:function(t){console.error(t)};function NO(t){this._internalRoot=t}Wd.prototype.render=NO.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(K(409));zd(t,e,null,null)};Wd.prototype.unmount=NO.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ns(function(){zd(null,t,null,null)}),e[qr]=null}};function Wd(t){this._internalRoot=t}Wd.prototype.unstable_scheduleHydration=function(t){if(t){var e=aE();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Oi.length&&e!==0&&e<Oi[n].priority;n++);Oi.splice(n,0,t),n===0&&cE(t)}};function PO(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ud(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Lx(){}function i3(t,e,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=Vf(o);s.call(c)}}var o=_2(e,r,t,0,null,!1,!1,"",Lx);return t._reactRootContainer=o,t[qr]=o.current,bl(t.nodeType===8?t.parentNode:t),Ns(),o}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Vf(l);a.call(c)}}var l=EO(t,0,!1,null,null,!1,!1,"",Lx);return t._reactRootContainer=l,t[qr]=l.current,bl(t.nodeType===8?t.parentNode:t),Ns(function(){zd(e,l,n,r)}),l}function Yd(t,e,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Vf(o);a.call(l)}}zd(e,o,t,i)}else o=i3(n,e,t,i,r);return Vf(o)}sE=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=Ra(e.pendingLanes);n!==0&&(U0(e,n|1),qt(e,He()),!(ve&6)&&(Do=He()+500,Yi()))}break;case 13:Ns(function(){var r=Kr(t,1);if(r!==null){var i=At();Yn(r,t,1,i)}}),TO(t,1)}};Y0=function(t){if(t.tag===13){var e=Kr(t,134217728);if(e!==null){var n=At();Yn(e,t,134217728,n)}TO(t,134217728)}};oE=function(t){if(t.tag===13){var e=$i(t),n=Kr(t,e);if(n!==null){var r=At();Yn(n,t,e,r)}TO(t,e)}};aE=function(){return ke};lE=function(t,e){var n=ke;try{return ke=t,e()}finally{ke=n}};_m=function(t,e,n){switch(e){case"input":if(wm(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Dd(r);if(!i)throw Error(K(90));Zk(r),wm(r,i)}}}break;case"textarea":jk(t,n);break;case"select":e=n.value,e!=null&&go(t,!!n.multiple,e,!1)}};Yk=vO;Gk=Ns;var s3={usingClientEntryPoint:!1,Events:[pc,no,Dd,Wk,Uk,vO]},wa={findFiberByHostInstance:cs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},o3={bundleType:wa.bundleType,version:wa.version,rendererPackageName:wa.rendererPackageName,rendererConfig:wa.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:si.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Kk(t),t===null?null:t.stateNode},findFiberByHostInstance:wa.findFiberByHostInstance||r3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ru=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ru.isDisabled&&ru.supportsFiber)try{Qd=ru.inject(o3),Sr=ru}catch{}}mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s3;mn.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!PO(e))throw Error(K(200));return n3(t,e,null,n)};mn.createRoot=function(t,e){if(!PO(t))throw Error(K(299));var n=!1,r="",i=C2;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=EO(t,1,!1,null,null,n,!1,r,i),t[qr]=e.current,bl(t.nodeType===8?t.parentNode:t),new NO(e)};mn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(K(188)):(t=Object.keys(t).join(","),Error(K(268,t)));return t=Kk(e),t=t===null?null:t.stateNode,t};mn.flushSync=function(t){return Ns(t)};mn.hydrate=function(t,e,n){if(!Ud(e))throw Error(K(200));return Yd(null,t,e,!0,n)};mn.hydrateRoot=function(t,e,n){if(!PO(t))throw Error(K(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=C2;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),e=_2(e,null,t,1,n??null,i,!1,s,o),t[qr]=e.current,bl(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Wd(e)};mn.render=function(t,e,n){if(!Ud(e))throw Error(K(200));return Yd(null,t,e,!1,n)};mn.unmountComponentAtNode=function(t){if(!Ud(t))throw Error(K(40));return t._reactRootContainer?(Ns(function(){Yd(null,null,t,!1,function(){t._reactRootContainer=null,t[qr]=null})}),!0):!1};mn.unstable_batchedUpdates=vO;mn.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Ud(n))throw Error(K(200));if(t==null||t._reactInternals===void 0)throw Error(K(38));return Yd(t,e,n,!1,r)};mn.version="18.3.1-next-f1338f8080-20240426";function $2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($2)}catch(t){console.error(t)}}$2(),$k.exports=mn;var A2=$k.exports,Dx=A2;mm.createRoot=Dx.createRoot,mm.hydrateRoot=Dx.hydrateRoot;function tt(t){if(typeof t=="string"||typeof t=="number")return""+t;let e="";if(Array.isArray(t))for(let n=0,r;n<t.length;n++)(r=tt(t[n]))!==""&&(e+=(e&&" ")+r);else for(let n in t)t[n]&&(e+=(e&&" ")+n);return e}var a3={value:()=>{}};function Gd(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ef(n)}function ef(t){this._=t}function l3(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ef.prototype=Gd.prototype={constructor:ef,on:function(t,e){var n=this._,r=l3(t+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(t=r[s]).type)&&(i=c3(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<o;)if(i=(t=r[s]).type)n[i]=Zx(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Zx(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ef(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,s=r.length;i<s;++i)r[i].value.apply(e,n)}};function c3(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Zx(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=a3,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var lg="http://www.w3.org/1999/xhtml";const Vx={svg:"http://www.w3.org/2000/svg",xhtml:lg,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Hd(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Vx.hasOwnProperty(e)?{space:Vx[e],local:t}:t}function u3(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===lg&&e.documentElement.namespaceURI===lg?e.createElement(t):e.createElementNS(n,t)}}function f3(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function I2(t){var e=Hd(t);return(e.local?f3:u3)(e)}function d3(){}function _O(t){return t==null?d3:function(){return this.querySelector(t)}}function h3(t){typeof t!="function"&&(t=_O(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=new Array(o),l,c,u=0;u<o;++u)(l=s[u])&&(c=t.call(l,l.__data__,u,s))&&("__data__"in l&&(c.__data__=l.__data__),a[u]=c);return new pn(r,this._parents)}function p3(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function m3(){return[]}function Q2(t){return t==null?m3:function(){return this.querySelectorAll(t)}}function g3(t){return function(){return p3(t.apply(this,arguments))}}function O3(t){typeof t=="function"?t=g3(t):t=Q2(t);for(var e=this._groups,n=e.length,r=[],i=[],s=0;s<n;++s)for(var o=e[s],a=o.length,l,c=0;c<a;++c)(l=o[c])&&(r.push(t.call(l,l.__data__,c,o)),i.push(l));return new pn(r,i)}function R2(t){return function(){return this.matches(t)}}function M2(t){return function(e){return e.matches(t)}}var y3=Array.prototype.find;function b3(t){return function(){return y3.call(this.children,t)}}function x3(){return this.firstElementChild}function v3(t){return this.select(t==null?x3:b3(typeof t=="function"?t:M2(t)))}var w3=Array.prototype.filter;function S3(){return Array.from(this.children)}function k3(t){return function(){return w3.call(this.children,t)}}function E3(t){return this.selectAll(t==null?S3:k3(typeof t=="function"?t:M2(t)))}function T3(t){typeof t!="function"&&(t=R2(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=[],l,c=0;c<o;++c)(l=s[c])&&t.call(l,l.__data__,c,s)&&a.push(l);return new pn(r,this._parents)}function L2(t){return new Array(t.length)}function N3(){return new pn(this._enter||this._groups.map(L2),this._parents)}function jf(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}jf.prototype={constructor:jf,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function P3(t){return function(){return t}}function _3(t,e,n,r,i,s){for(var o=0,a,l=e.length,c=s.length;o<c;++o)(a=e[o])?(a.__data__=s[o],r[o]=a):n[o]=new jf(t,s[o]);for(;o<l;++o)(a=e[o])&&(i[o]=a)}function C3(t,e,n,r,i,s,o){var a,l,c=new Map,u=e.length,f=s.length,d=new Array(u),h;for(a=0;a<u;++a)(l=e[a])&&(d[a]=h=o.call(l,l.__data__,a,e)+"",c.has(h)?i[a]=l:c.set(h,l));for(a=0;a<f;++a)h=o.call(t,s[a],a,s)+"",(l=c.get(h))?(r[a]=l,l.__data__=s[a],c.delete(h)):n[a]=new jf(t,s[a]);for(a=0;a<u;++a)(l=e[a])&&c.get(d[a])===l&&(i[a]=l)}function $3(t){return t.__data__}function A3(t,e){if(!arguments.length)return Array.from(this,$3);var n=e?C3:_3,r=this._parents,i=this._groups;typeof t!="function"&&(t=P3(t));for(var s=i.length,o=new Array(s),a=new Array(s),l=new Array(s),c=0;c<s;++c){var u=r[c],f=i[c],d=f.length,h=I3(t.call(u,u&&u.__data__,c,r)),p=h.length,m=a[c]=new Array(p),O=o[c]=new Array(p),g=l[c]=new Array(d);n(u,f,m,O,g,h,e);for(var b=0,y=0,v,S;b<p;++b)if(v=m[b]){for(b>=y&&(y=b+1);!(S=O[y])&&++y<p;);v._next=S||null}}return o=new pn(o,r),o._enter=a,o._exit=l,o}function I3(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Q3(){return new pn(this._exit||this._groups.map(L2),this._parents)}function R3(t,e,n){var r=this.enter(),i=this,s=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function M3(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,s=r.length,o=Math.min(i,s),a=new Array(i),l=0;l<o;++l)for(var c=n[l],u=r[l],f=c.length,d=a[l]=new Array(f),h,p=0;p<f;++p)(h=c[p]||u[p])&&(d[p]=h);for(;l<i;++l)a[l]=n[l];return new pn(a,this._parents)}function L3(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function D3(t){t||(t=Z3);function e(f,d){return f&&d?t(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],a=o.length,l=i[s]=new Array(a),c,u=0;u<a;++u)(c=o[u])&&(l[u]=c);l.sort(e)}return new pn(i,this._parents).order()}function Z3(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function V3(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function j3(){return Array.from(this)}function B3(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function F3(){let t=0;for(const e of this)++t;return t}function X3(){return!this.node()}function z3(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,o=i.length,a;s<o;++s)(a=i[s])&&t.call(a,a.__data__,s,i);return this}function W3(t){return function(){this.removeAttribute(t)}}function U3(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Y3(t,e){return function(){this.setAttribute(t,e)}}function G3(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function H3(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function q3(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function K3(t,e){var n=Hd(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?U3:W3:typeof e=="function"?n.local?q3:H3:n.local?G3:Y3)(n,e))}function D2(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function J3(t){return function(){this.style.removeProperty(t)}}function eM(t,e,n){return function(){this.style.setProperty(t,e,n)}}function tM(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function nM(t,e,n){return arguments.length>1?this.each((e==null?J3:typeof e=="function"?tM:eM)(t,e,n??"")):Zo(this.node(),t)}function Zo(t,e){return t.style.getPropertyValue(e)||D2(t).getComputedStyle(t,null).getPropertyValue(e)}function rM(t){return function(){delete this[t]}}function iM(t,e){return function(){this[t]=e}}function sM(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function oM(t,e){return arguments.length>1?this.each((e==null?rM:typeof e=="function"?sM:iM)(t,e)):this.node()[t]}function Z2(t){return t.trim().split(/^|\s+/)}function CO(t){return t.classList||new V2(t)}function V2(t){this._node=t,this._names=Z2(t.getAttribute("class")||"")}V2.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function j2(t,e){for(var n=CO(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function B2(t,e){for(var n=CO(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function aM(t){return function(){j2(this,t)}}function lM(t){return function(){B2(this,t)}}function cM(t,e){return function(){(e.apply(this,arguments)?j2:B2)(this,t)}}function uM(t,e){var n=Z2(t+"");if(arguments.length<2){for(var r=CO(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?cM:e?aM:lM)(n,e))}function fM(){this.textContent=""}function dM(t){return function(){this.textContent=t}}function hM(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function pM(t){return arguments.length?this.each(t==null?fM:(typeof t=="function"?hM:dM)(t)):this.node().textContent}function mM(){this.innerHTML=""}function gM(t){return function(){this.innerHTML=t}}function OM(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function yM(t){return arguments.length?this.each(t==null?mM:(typeof t=="function"?OM:gM)(t)):this.node().innerHTML}function bM(){this.nextSibling&&this.parentNode.appendChild(this)}function xM(){return this.each(bM)}function vM(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function wM(){return this.each(vM)}function SM(t){var e=typeof t=="function"?t:I2(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function kM(){return null}function EM(t,e){var n=typeof t=="function"?t:I2(t),r=e==null?kM:typeof e=="function"?e:_O(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function TM(){var t=this.parentNode;t&&t.removeChild(this)}function NM(){return this.each(TM)}function PM(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function _M(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function CM(t){return this.select(t?_M:PM)}function $M(t){return arguments.length?this.property("__data__",t):this.node().__data__}function AM(t){return function(e){t.call(this,e,this.__data__)}}function IM(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function QM(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++r]=s;++r?e.length=r:delete this.__on}}}function RM(t,e,n){return function(){var r=this.__on,i,s=AM(e);if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function MM(t,e,n){var r=IM(t+""),i,s=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,u;l<c;++l)for(i=0,u=a[l];i<s;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(a=e?RM:QM,i=0;i<s;++i)this.each(a(r[i],e,n));return this}function F2(t,e,n){var r=D2(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function LM(t,e){return function(){return F2(this,t,e)}}function DM(t,e){return function(){return F2(this,t,e.apply(this,arguments))}}function ZM(t,e){return this.each((typeof e=="function"?DM:LM)(t,e))}function*VM(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var X2=[null];function pn(t,e){this._groups=t,this._parents=e}function gc(){return new pn([[document.documentElement]],X2)}function jM(){return this}pn.prototype=gc.prototype={constructor:pn,select:h3,selectAll:O3,selectChild:v3,selectChildren:E3,filter:T3,data:A3,enter:N3,exit:Q3,join:R3,merge:M3,selection:jM,order:L3,sort:D3,call:V3,nodes:j3,node:B3,size:F3,empty:X3,each:z3,attr:K3,style:nM,property:oM,classed:uM,text:pM,html:yM,raise:xM,lower:wM,append:SM,insert:EM,remove:NM,clone:CM,datum:$M,on:MM,dispatch:ZM,[Symbol.iterator]:VM};function cn(t){return typeof t=="string"?new pn([[document.querySelector(t)]],[document.documentElement]):new pn([[t]],X2)}function BM(t){let e;for(;e=t.sourceEvent;)t=e;return t}function Mn(t,e){if(t=BM(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const FM={passive:!1},Pl={capture:!0,passive:!1};function lp(t){t.stopImmediatePropagation()}function wo(t){t.preventDefault(),t.stopImmediatePropagation()}function z2(t){var e=t.document.documentElement,n=cn(t).on("dragstart.drag",wo,Pl);"onselectstart"in e?n.on("selectstart.drag",wo,Pl):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function W2(t,e){var n=t.document.documentElement,r=cn(t).on("dragstart.drag",null);e&&(r.on("click.drag",wo,Pl),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const iu=t=>()=>t;function cg(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:s,x:o,y:a,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}cg.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function XM(t){return!t.ctrlKey&&!t.button}function zM(){return this.parentNode}function WM(t,e){return e??{x:t.x,y:t.y}}function UM(){return navigator.maxTouchPoints||"ontouchstart"in this}function U2(){var t=XM,e=zM,n=WM,r=UM,i={},s=Gd("start","drag","end"),o=0,a,l,c,u,f=0;function d(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",O).on("touchmove.drag",g,FM).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,S){if(!(u||!t.call(this,v,S))){var E=y(this,e.call(this,v,S),v,S,"mouse");E&&(cn(v.view).on("mousemove.drag",p,Pl).on("mouseup.drag",m,Pl),z2(v.view),lp(v),c=!1,a=v.clientX,l=v.clientY,E("start",v))}}function p(v){if(wo(v),!c){var S=v.clientX-a,E=v.clientY-l;c=S*S+E*E>f}i.mouse("drag",v)}function m(v){cn(v.view).on("mousemove.drag mouseup.drag",null),W2(v.view,c),wo(v),i.mouse("end",v)}function O(v,S){if(t.call(this,v,S)){var E=v.changedTouches,w=e.call(this,v,S),k=E.length,N,$;for(N=0;N<k;++N)($=y(this,w,v,S,E[N].identifier,E[N]))&&(lp(v),$("start",v,E[N]))}}function g(v){var S=v.changedTouches,E=S.length,w,k;for(w=0;w<E;++w)(k=i[S[w].identifier])&&(wo(v),k("drag",v,S[w]))}function b(v){var S=v.changedTouches,E=S.length,w,k;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),w=0;w<E;++w)(k=i[S[w].identifier])&&(lp(v),k("end",v,S[w]))}function y(v,S,E,w,k,N){var $=s.copy(),C=Mn(N||E,S),_,V,P;if((P=n.call(v,new cg("beforestart",{sourceEvent:E,target:d,identifier:k,active:o,x:C[0],y:C[1],dx:0,dy:0,dispatch:$}),w))!=null)return _=P.x-C[0]||0,V=P.y-C[1]||0,function M(R,L,I){var A=C,D;switch(R){case"start":i[k]=M,D=o++;break;case"end":delete i[k],--o;case"drag":C=Mn(I||L,S),D=o;break}$.call(R,v,new cg(R,{sourceEvent:L,subject:P,target:d,identifier:k,active:D,x:C[0]+_,y:C[1]+V,dx:C[0]-A[0],dy:C[1]-A[1],dispatch:$}),w)}}return d.filter=function(v){return arguments.length?(t=typeof v=="function"?v:iu(!!v),d):t},d.container=function(v){return arguments.length?(e=typeof v=="function"?v:iu(v),d):e},d.subject=function(v){return arguments.length?(n=typeof v=="function"?v:iu(v),d):n},d.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:iu(!!v),d):r},d.on=function(){var v=s.on.apply(s,arguments);return v===s?d:v},d.clickDistance=function(v){return arguments.length?(f=(v=+v)*v,d):Math.sqrt(f)},d}function $O(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Y2(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Oc(){}var _l=.7,Bf=1/_l,So="\\s*([+-]?\\d+)\\s*",Cl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Er="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",YM=/^#([0-9a-f]{3,8})$/,GM=new RegExp(`^rgb\\(${So},${So},${So}\\)$`),HM=new RegExp(`^rgb\\(${Er},${Er},${Er}\\)$`),qM=new RegExp(`^rgba\\(${So},${So},${So},${Cl}\\)$`),KM=new RegExp(`^rgba\\(${Er},${Er},${Er},${Cl}\\)$`),JM=new RegExp(`^hsl\\(${Cl},${Er},${Er}\\)$`),e5=new RegExp(`^hsla\\(${Cl},${Er},${Er},${Cl}\\)$`),jx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$O(Oc,Ps,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Bx,formatHex:Bx,formatHex8:t5,formatHsl:n5,formatRgb:Fx,toString:Fx});function Bx(){return this.rgb().formatHex()}function t5(){return this.rgb().formatHex8()}function n5(){return G2(this).formatHsl()}function Fx(){return this.rgb().formatRgb()}function Ps(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=YM.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Xx(e):n===3?new zt(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?su(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?su(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=GM.exec(t))?new zt(e[1],e[2],e[3],1):(e=HM.exec(t))?new zt(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=qM.exec(t))?su(e[1],e[2],e[3],e[4]):(e=KM.exec(t))?su(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=JM.exec(t))?Ux(e[1],e[2]/100,e[3]/100,1):(e=e5.exec(t))?Ux(e[1],e[2]/100,e[3]/100,e[4]):jx.hasOwnProperty(t)?Xx(jx[t]):t==="transparent"?new zt(NaN,NaN,NaN,0):null}function Xx(t){return new zt(t>>16&255,t>>8&255,t&255,1)}function su(t,e,n,r){return r<=0&&(t=e=n=NaN),new zt(t,e,n,r)}function r5(t){return t instanceof Oc||(t=Ps(t)),t?(t=t.rgb(),new zt(t.r,t.g,t.b,t.opacity)):new zt}function ug(t,e,n,r){return arguments.length===1?r5(t):new zt(t,e,n,r??1)}function zt(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}$O(zt,ug,Y2(Oc,{brighter(t){return t=t==null?Bf:Math.pow(Bf,t),new zt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?_l:Math.pow(_l,t),new zt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new zt(Os(this.r),Os(this.g),Os(this.b),Ff(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:zx,formatHex:zx,formatHex8:i5,formatRgb:Wx,toString:Wx}));function zx(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}`}function i5(){return`#${ds(this.r)}${ds(this.g)}${ds(this.b)}${ds((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wx(){const t=Ff(this.opacity);return`${t===1?"rgb(":"rgba("}${Os(this.r)}, ${Os(this.g)}, ${Os(this.b)}${t===1?")":`, ${t})`}`}function Ff(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Os(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ds(t){return t=Os(t),(t<16?"0":"")+t.toString(16)}function Ux(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new jn(t,e,n,r)}function G2(t){if(t instanceof jn)return new jn(t.h,t.s,t.l,t.opacity);if(t instanceof Oc||(t=Ps(t)),!t)return new jn;if(t instanceof jn)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=NaN,a=s-i,l=(s+i)/2;return a?(e===s?o=(n-r)/a+(n<r)*6:n===s?o=(r-e)/a+2:o=(e-n)/a+4,a/=l<.5?s+i:2-s-i,o*=60):a=l>0&&l<1?0:o,new jn(o,a,l,t.opacity)}function s5(t,e,n,r){return arguments.length===1?G2(t):new jn(t,e,n,r??1)}function jn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}$O(jn,s5,Y2(Oc,{brighter(t){return t=t==null?Bf:Math.pow(Bf,t),new jn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?_l:Math.pow(_l,t),new jn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new zt(cp(t>=240?t-240:t+120,i,r),cp(t,i,r),cp(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new jn(Yx(this.h),ou(this.s),ou(this.l),Ff(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ff(this.opacity);return`${t===1?"hsl(":"hsla("}${Yx(this.h)}, ${ou(this.s)*100}%, ${ou(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Yx(t){return t=(t||0)%360,t<0?t+360:t}function ou(t){return Math.max(0,Math.min(1,t||0))}function cp(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const AO=t=>()=>t;function o5(t,e){return function(n){return t+n*e}}function a5(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function l5(t){return(t=+t)==1?H2:function(e,n){return n-e?a5(e,n,t):AO(isNaN(e)?n:e)}}function H2(t,e){var n=e-t;return n?o5(t,n):AO(isNaN(t)?e:t)}const Xf=function t(e){var n=l5(e);function r(i,s){var o=n((i=ug(i)).r,(s=ug(s)).r),a=n(i.g,s.g),l=n(i.b,s.b),c=H2(i.opacity,s.opacity);return function(u){return i.r=o(u),i.g=a(u),i.b=l(u),i.opacity=c(u),i+""}}return r.gamma=t,r}(1);function c5(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,r=e.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=t[i]*(1-s)+e[i]*s;return r}}function u5(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function f5(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0,i=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)i[o]=Ka(t[o],e[o]);for(;o<n;++o)s[o]=e[o];return function(a){for(o=0;o<r;++o)s[o]=i[o](a);return s}}function d5(t,e){var n=new Date;return t=+t,e=+e,function(r){return n.setTime(t*(1-r)+e*r),n}}function hr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function h5(t,e){var n={},r={},i;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(i in e)i in t?n[i]=Ka(t[i],e[i]):r[i]=e[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var fg=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,up=new RegExp(fg.source,"g");function p5(t){return function(){return t}}function m5(t){return function(e){return t(e)+""}}function q2(t,e){var n=fg.lastIndex=up.lastIndex=0,r,i,s,o=-1,a=[],l=[];for(t=t+"",e=e+"";(r=fg.exec(t))&&(i=up.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:hr(r,i)})),n=up.lastIndex;return n<e.length&&(s=e.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?l[0]?m5(l[0].x):p5(e):(e=l.length,function(c){for(var u=0,f;u<e;++u)a[(f=l[u]).i]=f.x(c);return a.join("")})}function Ka(t,e){var n=typeof e,r;return e==null||n==="boolean"?AO(e):(n==="number"?hr:n==="string"?(r=Ps(e))?(e=r,Xf):q2:e instanceof Ps?Xf:e instanceof Date?d5:u5(e)?c5:Array.isArray(e)?f5:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?h5:hr)(t,e)}var Gx=180/Math.PI,dg={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function K2(t,e,n,r,i,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(e,t)*Gx,skewX:Math.atan(l)*Gx,scaleX:o,scaleY:a}}var au;function g5(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?dg:K2(e.a,e.b,e.c,e.d,e.e,e.f)}function O5(t){return t==null||(au||(au=document.createElementNS("http://www.w3.org/2000/svg","g")),au.setAttribute("transform",t),!(t=au.transform.baseVal.consolidate()))?dg:(t=t.matrix,K2(t.a,t.b,t.c,t.d,t.e,t.f))}function J2(t,e,n,r){function i(c){return c.length?c.pop()+" ":""}function s(c,u,f,d,h,p){if(c!==f||u!==d){var m=h.push("translate(",null,e,null,n);p.push({i:m-4,x:hr(c,f)},{i:m-2,x:hr(u,d)})}else(f||d)&&h.push("translate("+f+e+d+n)}function o(c,u,f,d){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:hr(c,u)})):u&&f.push(i(f)+"rotate("+u+r)}function a(c,u,f,d){c!==u?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:hr(c,u)}):u&&f.push(i(f)+"skewX("+u+r)}function l(c,u,f,d,h,p){if(c!==f||u!==d){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:hr(c,f)},{i:m-2,x:hr(u,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(c,u){var f=[],d=[];return c=t(c),u=t(u),s(c.translateX,c.translateY,u.translateX,u.translateY,f,d),o(c.rotate,u.rotate,f,d),a(c.skewX,u.skewX,f,d),l(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,d),c=u=null,function(h){for(var p=-1,m=d.length,O;++p<m;)f[(O=d[p]).i]=O.x(h);return f.join("")}}}var y5=J2(g5,"px, ","px)","deg)"),b5=J2(O5,", ",")",")"),x5=1e-12;function Hx(t){return((t=Math.exp(t))+1/t)/2}function v5(t){return((t=Math.exp(t))-1/t)/2}function w5(t){return((t=Math.exp(2*t))-1)/(t+1)}const tf=function t(e,n,r){function i(s,o){var a=s[0],l=s[1],c=s[2],u=o[0],f=o[1],d=o[2],h=u-a,p=f-l,m=h*h+p*p,O,g;if(m<x5)g=Math.log(d/c)/e,O=function(w){return[a+w*h,l+w*p,c*Math.exp(e*w*g)]};else{var b=Math.sqrt(m),y=(d*d-c*c+r*m)/(2*c*n*b),v=(d*d-c*c-r*m)/(2*d*n*b),S=Math.log(Math.sqrt(y*y+1)-y),E=Math.log(Math.sqrt(v*v+1)-v);g=(E-S)/e,O=function(w){var k=w*g,N=Hx(S),$=c/(n*b)*(N*w5(e*k+S)-v5(S));return[a+$*h,l+$*p,c*N/Hx(e*k+S)]}}return O.duration=g*1e3*e/Math.SQRT2,O}return i.rho=function(s){var o=Math.max(.001,+s),a=o*o,l=a*a;return t(o,a,l)},i}(Math.SQRT2,2,4);var Vo=0,La=0,Sa=0,eT=1e3,zf,Da,Wf=0,_s=0,qd=0,$l=typeof performance=="object"&&performance.now?performance:Date,tT=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function IO(){return _s||(tT(S5),_s=$l.now()+qd)}function S5(){_s=0}function Uf(){this._call=this._time=this._next=null}Uf.prototype=nT.prototype={constructor:Uf,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?IO():+n)+(e==null?0:+e),!this._next&&Da!==this&&(Da?Da._next=this:zf=this,Da=this),this._call=t,this._time=n,hg()},stop:function(){this._call&&(this._call=null,this._time=1/0,hg())}};function nT(t,e,n){var r=new Uf;return r.restart(t,e,n),r}function k5(){IO(),++Vo;for(var t=zf,e;t;)(e=_s-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Vo}function qx(){_s=(Wf=$l.now())+qd,Vo=La=0;try{k5()}finally{Vo=0,T5(),_s=0}}function E5(){var t=$l.now(),e=t-Wf;e>eT&&(qd-=e,Wf=t)}function T5(){for(var t,e=zf,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:zf=n);Da=t,hg(r)}function hg(t){if(!Vo){La&&(La=clearTimeout(La));var e=t-_s;e>24?(t<1/0&&(La=setTimeout(qx,t-$l.now()-qd)),Sa&&(Sa=clearInterval(Sa))):(Sa||(Wf=$l.now(),Sa=setInterval(E5,eT)),Vo=1,tT(qx))}}function Kx(t,e,n){var r=new Uf;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var N5=Gd("start","end","cancel","interrupt"),P5=[],rT=0,Jx=1,pg=2,nf=3,e1=4,mg=5,rf=6;function Kd(t,e,n,r,i,s){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;_5(t,n,{name:e,index:r,group:i,on:N5,tween:P5,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:rT})}function QO(t,e){var n=Jn(t,e);if(n.state>rT)throw new Error("too late; already scheduled");return n}function _r(t,e){var n=Jn(t,e);if(n.state>nf)throw new Error("too late; already running");return n}function Jn(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function _5(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=nT(s,0,n.time);function s(c){n.state=Jx,n.timer.restart(o,n.delay,n.time),n.delay<=c&&o(c-n.delay)}function o(c){var u,f,d,h;if(n.state!==Jx)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===nf)return Kx(o);h.state===e1?(h.state=rf,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete r[u]):+u<e&&(h.state=rf,h.timer.stop(),h.on.call("cancel",t,t.__data__,h.index,h.group),delete r[u])}if(Kx(function(){n.state===nf&&(n.state=e1,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=pg,n.on.call("start",t,t.__data__,n.index,n.group),n.state===pg){for(n.state=nf,i=new Array(d=n.tween.length),u=0,f=-1;u<d;++u)(h=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=h);i.length=f+1}}function a(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=mg,1),f=-1,d=i.length;++f<d;)i[f].call(t,u);n.state===mg&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=rf,n.timer.stop(),delete r[e];for(var c in r)return;delete t.__transition}}function sf(t,e){var n=t.__transition,r,i,s=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){s=!1;continue}i=r.state>pg&&r.state<mg,r.state=rf,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}s&&delete t.__transition}}function C5(t){return this.each(function(){sf(this,t)})}function $5(t,e){var n,r;return function(){var i=_r(this,t),s=i.tween;if(s!==n){r=n=s;for(var o=0,a=r.length;o<a;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function A5(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=_r(this,t),o=s.tween;if(o!==r){i=(r=o).slice();for(var a={name:e,value:n},l=0,c=i.length;l<c;++l)if(i[l].name===e){i[l]=a;break}l===c&&i.push(a)}s.tween=i}}function I5(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Jn(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?$5:A5)(n,t,e))}function RO(t,e,n){var r=t._id;return t.each(function(){var i=_r(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Jn(i,r).value[e]}}function iT(t,e){var n;return(typeof e=="number"?hr:e instanceof Ps?Xf:(n=Ps(e))?(e=n,Xf):q2)(t,e)}function Q5(t){return function(){this.removeAttribute(t)}}function R5(t){return function(){this.removeAttributeNS(t.space,t.local)}}function M5(t,e,n){var r,i=n+"",s;return function(){var o=this.getAttribute(t);return o===i?null:o===r?s:s=e(r=o,n)}}function L5(t,e,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?s:s=e(r=o,n)}}function D5(t,e,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=e(r=o,a)))}}function Z5(t,e,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=e(r=o,a)))}}function V5(t,e){var n=Hd(t),r=n==="transform"?b5:iT;return this.attrTween(t,typeof e=="function"?(n.local?Z5:D5)(n,r,RO(this,"attr."+t,e)):e==null?(n.local?R5:Q5)(n):(n.local?L5:M5)(n,r,e))}function j5(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function B5(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function F5(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&B5(t,s)),n}return i._value=e,i}function X5(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&j5(t,s)),n}return i._value=e,i}function z5(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Hd(t);return this.tween(n,(r.local?F5:X5)(r,e))}function W5(t,e){return function(){QO(this,t).delay=+e.apply(this,arguments)}}function U5(t,e){return e=+e,function(){QO(this,t).delay=e}}function Y5(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?W5:U5)(e,t)):Jn(this.node(),e).delay}function G5(t,e){return function(){_r(this,t).duration=+e.apply(this,arguments)}}function H5(t,e){return e=+e,function(){_r(this,t).duration=e}}function q5(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?G5:H5)(e,t)):Jn(this.node(),e).duration}function K5(t,e){if(typeof e!="function")throw new Error;return function(){_r(this,t).ease=e}}function J5(t){var e=this._id;return arguments.length?this.each(K5(e,t)):Jn(this.node(),e).ease}function eL(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;_r(this,t).ease=n}}function tL(t){if(typeof t!="function")throw new Error;return this.each(eL(this._id,t))}function nL(t){typeof t!="function"&&(t=R2(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=[],l,c=0;c<o;++c)(l=s[c])&&t.call(l,l.__data__,c,s)&&a.push(l);return new ei(r,this._parents,this._name,this._id)}function rL(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,s=Math.min(r,i),o=new Array(r),a=0;a<s;++a)for(var l=e[a],c=n[a],u=l.length,f=o[a]=new Array(u),d,h=0;h<u;++h)(d=l[h]||c[h])&&(f[h]=d);for(;a<r;++a)o[a]=e[a];return new ei(o,this._parents,this._name,this._id)}function iL(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function sL(t,e,n){var r,i,s=iL(e)?QO:_r;return function(){var o=s(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(e,n),o.on=i}}function oL(t,e){var n=this._id;return arguments.length<2?Jn(this.node(),n).on.on(t):this.each(sL(n,t,e))}function aL(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function lL(){return this.on("end.remove",aL(this._id))}function cL(t){var e=this._name,n=this._id;typeof t!="function"&&(t=_O(t));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var a=r[o],l=a.length,c=s[o]=new Array(l),u,f,d=0;d<l;++d)(u=a[d])&&(f=t.call(u,u.__data__,d,a))&&("__data__"in u&&(f.__data__=u.__data__),c[d]=f,Kd(c[d],e,n,d,c,Jn(u,n)));return new ei(s,this._parents,e,n)}function uL(t){var e=this._name,n=this._id;typeof t!="function"&&(t=Q2(t));for(var r=this._groups,i=r.length,s=[],o=[],a=0;a<i;++a)for(var l=r[a],c=l.length,u,f=0;f<c;++f)if(u=l[f]){for(var d=t.call(u,u.__data__,f,l),h,p=Jn(u,n),m=0,O=d.length;m<O;++m)(h=d[m])&&Kd(h,e,n,m,d,p);s.push(d),o.push(u)}return new ei(s,o,e,n)}var fL=gc.prototype.constructor;function dL(){return new fL(this._groups,this._parents)}function hL(t,e){var n,r,i;return function(){var s=Zo(this,t),o=(this.style.removeProperty(t),Zo(this,t));return s===o?null:s===n&&o===r?i:i=e(n=s,r=o)}}function sT(t){return function(){this.style.removeProperty(t)}}function pL(t,e,n){var r,i=n+"",s;return function(){var o=Zo(this,t);return o===i?null:o===r?s:s=e(r=o,n)}}function mL(t,e,n){var r,i,s;return function(){var o=Zo(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),Zo(this,t))),o===l?null:o===r&&l===i?s:(i=l,s=e(r=o,a))}}function gL(t,e){var n,r,i,s="style."+e,o="end."+s,a;return function(){var l=_r(this,t),c=l.on,u=l.value[s]==null?a||(a=sT(e)):void 0;(c!==n||i!==u)&&(r=(n=c).copy()).on(o,i=u),l.on=r}}function OL(t,e,n){var r=(t+="")=="transform"?y5:iT;return e==null?this.styleTween(t,hL(t,r)).on("end.style."+t,sT(t)):typeof e=="function"?this.styleTween(t,mL(t,r,RO(this,"style."+t,e))).each(gL(this._id,t)):this.styleTween(t,pL(t,r,e),n).on("end.style."+t,null)}function yL(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function bL(t,e,n){var r,i;function s(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&yL(t,o,n)),r}return s._value=e,s}function xL(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,bL(t,e,n??""))}function vL(t){return function(){this.textContent=t}}function wL(t){return function(){var e=t(this);this.textContent=e??""}}function SL(t){return this.tween("text",typeof t=="function"?wL(RO(this,"text",t)):vL(t==null?"":t+""))}function kL(t){return function(e){this.textContent=t.call(this,e)}}function EL(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&kL(i)),e}return r._value=t,r}function TL(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,EL(t))}function NL(){for(var t=this._name,e=this._id,n=oT(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,c=0;c<a;++c)if(l=o[c]){var u=Jn(l,e);Kd(l,t,n,c,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ei(r,this._parents,t,n)}function PL(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var a={value:o},l={value:function(){--i===0&&s()}};n.each(function(){var c=_r(this,r),u=c.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),c.on=e}),i===0&&s()})}var _L=0;function ei(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function oT(){return++_L}var Rr=gc.prototype;ei.prototype={constructor:ei,select:cL,selectAll:uL,selectChild:Rr.selectChild,selectChildren:Rr.selectChildren,filter:nL,merge:rL,selection:dL,transition:NL,call:Rr.call,nodes:Rr.nodes,node:Rr.node,size:Rr.size,empty:Rr.empty,each:Rr.each,on:oL,attr:V5,attrTween:z5,style:OL,styleTween:xL,text:SL,textTween:TL,remove:lL,tween:I5,delay:Y5,duration:q5,ease:J5,easeVarying:tL,end:PL,[Symbol.iterator]:Rr[Symbol.iterator]};function CL(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var $L={time:null,delay:0,duration:250,ease:CL};function AL(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function IL(t){var e,n;t instanceof ei?(e=t._id,t=t._name):(e=oT(),(n=$L).time=IO(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,c=0;c<a;++c)(l=o[c])&&Kd(l,t,e,c,o,n||AL(l,e));return new ei(r,this._parents,t,e)}gc.prototype.interrupt=C5;gc.prototype.transition=IL;const lu=t=>()=>t;function QL(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Wr(t,e,n){this.k=t,this.x=e,this.y=n}Wr.prototype={constructor:Wr,scale:function(t){return t===1?this:new Wr(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new Wr(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Jd=new Wr(1,0,0);aT.prototype=Wr.prototype;function aT(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Jd;return t.__zoom}function fp(t){t.stopImmediatePropagation()}function ka(t){t.preventDefault(),t.stopImmediatePropagation()}function RL(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function ML(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function t1(){return this.__zoom||Jd}function LL(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function DL(){return navigator.maxTouchPoints||"ontouchstart"in this}function ZL(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function lT(){var t=RL,e=ML,n=ZL,r=LL,i=DL,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=tf,c=Gd("start","zoom","end"),u,f,d,h=500,p=150,m=0,O=10;function g(P){P.property("__zoom",t1).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",$).filter(i).on("touchstart.zoom",C).on("touchmove.zoom",_).on("touchend.zoom touchcancel.zoom",V).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(P,M,R,L){var I=P.selection?P.selection():P;I.property("__zoom",t1),P!==I?S(P,M,R,L):I.interrupt().each(function(){E(this,arguments).event(L).start().zoom(null,typeof M=="function"?M.apply(this,arguments):M).end()})},g.scaleBy=function(P,M,R,L){g.scaleTo(P,function(){var I=this.__zoom.k,A=typeof M=="function"?M.apply(this,arguments):M;return I*A},R,L)},g.scaleTo=function(P,M,R,L){g.transform(P,function(){var I=e.apply(this,arguments),A=this.__zoom,D=R==null?v(I):typeof R=="function"?R.apply(this,arguments):R,B=A.invert(D),F=typeof M=="function"?M.apply(this,arguments):M;return n(y(b(A,F),D,B),I,o)},R,L)},g.translateBy=function(P,M,R,L){g.transform(P,function(){return n(this.__zoom.translate(typeof M=="function"?M.apply(this,arguments):M,typeof R=="function"?R.apply(this,arguments):R),e.apply(this,arguments),o)},null,L)},g.translateTo=function(P,M,R,L,I){g.transform(P,function(){var A=e.apply(this,arguments),D=this.__zoom,B=L==null?v(A):typeof L=="function"?L.apply(this,arguments):L;return n(Jd.translate(B[0],B[1]).scale(D.k).translate(typeof M=="function"?-M.apply(this,arguments):-M,typeof R=="function"?-R.apply(this,arguments):-R),A,o)},L,I)};function b(P,M){return M=Math.max(s[0],Math.min(s[1],M)),M===P.k?P:new Wr(M,P.x,P.y)}function y(P,M,R){var L=M[0]-R[0]*P.k,I=M[1]-R[1]*P.k;return L===P.x&&I===P.y?P:new Wr(P.k,L,I)}function v(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,M,R,L){P.on("start.zoom",function(){E(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(L).end()}).tween("zoom",function(){var I=this,A=arguments,D=E(I,A).event(L),B=e.apply(I,A),F=R==null?v(B):typeof R=="function"?R.apply(I,A):R,q=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),j=I.__zoom,H=typeof M=="function"?M.apply(I,A):M,G=l(j.invert(F).concat(q/j.k),H.invert(F).concat(q/H.k));return function(ne){if(ne===1)ne=H;else{var z=G(ne),J=q/z[2];ne=new Wr(J,F[0]-z[0]*J,F[1]-z[1]*J)}D.zoom(null,ne)}})}function E(P,M,R){return!R&&P.__zooming||new w(P,M)}function w(P,M){this.that=P,this.args=M,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,M),this.taps=0}w.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,M){return this.mouse&&P!=="mouse"&&(this.mouse[1]=M.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=M.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=M.invert(this.touch1[0])),this.that.__zoom=M,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var M=cn(this.that).datum();c.call(P,this.that,new QL(P,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:c}),M)}};function k(P,...M){if(!t.apply(this,arguments))return;var R=E(this,M).event(P),L=this.__zoom,I=Math.max(s[0],Math.min(s[1],L.k*Math.pow(2,r.apply(this,arguments)))),A=Mn(P);if(R.wheel)(R.mouse[0][0]!==A[0]||R.mouse[0][1]!==A[1])&&(R.mouse[1]=L.invert(R.mouse[0]=A)),clearTimeout(R.wheel);else{if(L.k===I)return;R.mouse=[A,L.invert(A)],sf(this),R.start()}ka(P),R.wheel=setTimeout(D,p),R.zoom("mouse",n(y(b(L,I),R.mouse[0],R.mouse[1]),R.extent,o));function D(){R.wheel=null,R.end()}}function N(P,...M){if(d||!t.apply(this,arguments))return;var R=P.currentTarget,L=E(this,M,!0).event(P),I=cn(P.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",q,!0),A=Mn(P,R),D=P.clientX,B=P.clientY;z2(P.view),fp(P),L.mouse=[A,this.__zoom.invert(A)],sf(this),L.start();function F(j){if(ka(j),!L.moved){var H=j.clientX-D,G=j.clientY-B;L.moved=H*H+G*G>m}L.event(j).zoom("mouse",n(y(L.that.__zoom,L.mouse[0]=Mn(j,R),L.mouse[1]),L.extent,o))}function q(j){I.on("mousemove.zoom mouseup.zoom",null),W2(j.view,L.moved),ka(j),L.event(j).end()}}function $(P,...M){if(t.apply(this,arguments)){var R=this.__zoom,L=Mn(P.changedTouches?P.changedTouches[0]:P,this),I=R.invert(L),A=R.k*(P.shiftKey?.5:2),D=n(y(b(R,A),L,I),e.apply(this,M),o);ka(P),a>0?cn(this).transition().duration(a).call(S,D,L,P):cn(this).call(g.transform,D,L,P)}}function C(P,...M){if(t.apply(this,arguments)){var R=P.touches,L=R.length,I=E(this,M,P.changedTouches.length===L).event(P),A,D,B,F;for(fp(P),D=0;D<L;++D)B=R[D],F=Mn(B,this),F=[F,this.__zoom.invert(F),B.identifier],I.touch0?!I.touch1&&I.touch0[2]!==F[2]&&(I.touch1=F,I.taps=0):(I.touch0=F,A=!0,I.taps=1+!!u);u&&(u=clearTimeout(u)),A&&(I.taps<2&&(f=F[0],u=setTimeout(function(){u=null},h)),sf(this),I.start())}}function _(P,...M){if(this.__zooming){var R=E(this,M).event(P),L=P.changedTouches,I=L.length,A,D,B,F;for(ka(P),A=0;A<I;++A)D=L[A],B=Mn(D,this),R.touch0&&R.touch0[2]===D.identifier?R.touch0[0]=B:R.touch1&&R.touch1[2]===D.identifier&&(R.touch1[0]=B);if(D=R.that.__zoom,R.touch1){var q=R.touch0[0],j=R.touch0[1],H=R.touch1[0],G=R.touch1[1],ne=(ne=H[0]-q[0])*ne+(ne=H[1]-q[1])*ne,z=(z=G[0]-j[0])*z+(z=G[1]-j[1])*z;D=b(D,Math.sqrt(ne/z)),B=[(q[0]+H[0])/2,(q[1]+H[1])/2],F=[(j[0]+G[0])/2,(j[1]+G[1])/2]}else if(R.touch0)B=R.touch0[0],F=R.touch0[1];else return;R.zoom("touch",n(y(D,B,F),R.extent,o))}}function V(P,...M){if(this.__zooming){var R=E(this,M).event(P),L=P.changedTouches,I=L.length,A,D;for(fp(P),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),A=0;A<I;++A)D=L[A],R.touch0&&R.touch0[2]===D.identifier?delete R.touch0:R.touch1&&R.touch1[2]===D.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(D=Mn(D,this),Math.hypot(f[0]-D[0],f[1]-D[1])<O)){var B=cn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return g.wheelDelta=function(P){return arguments.length?(r=typeof P=="function"?P:lu(+P),g):r},g.filter=function(P){return arguments.length?(t=typeof P=="function"?P:lu(!!P),g):t},g.touchable=function(P){return arguments.length?(i=typeof P=="function"?P:lu(!!P),g):i},g.extent=function(P){return arguments.length?(e=typeof P=="function"?P:lu([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),g):e},g.scaleExtent=function(P){return arguments.length?(s[0]=+P[0],s[1]=+P[1],g):[s[0],s[1]]},g.translateExtent=function(P){return arguments.length?(o[0][0]=+P[0][0],o[1][0]=+P[1][0],o[0][1]=+P[0][1],o[1][1]=+P[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(P){return arguments.length?(n=P,g):n},g.duration=function(P){return arguments.length?(a=+P,g):a},g.interpolate=function(P){return arguments.length?(l=P,g):l},g.on=function(){var P=c.on.apply(c,arguments);return P===c?g:P},g.clickDistance=function(P){return arguments.length?(m=(P=+P)*P,g):Math.sqrt(m)},g.tapDistance=function(P){return arguments.length?(O=+P,g):O},g}const Hn={error001:(t="react")=>`Seems like you have not used ${t==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${t}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:e,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${t} handle id: "${t==="source"?n:r}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Al=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],cT=["Enter"," ","Escape"],uT={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:t,x:e,y:n})=>`Moved selected node ${t}. New position, x: ${e}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var jo;(function(t){t.Strict="strict",t.Loose="loose"})(jo||(jo={}));var ys;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(ys||(ys={}));var Il;(function(t){t.Partial="partial",t.Full="full"})(Il||(Il={}));const fT={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var bi;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(bi||(bi={}));var Yf;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(Yf||(Yf={}));var ce;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(ce||(ce={}));const n1={[ce.Left]:ce.Right,[ce.Right]:ce.Left,[ce.Top]:ce.Bottom,[ce.Bottom]:ce.Top};function dT(t){return t===null?null:t?"valid":"invalid"}const hT=t=>"id"in t&&"source"in t&&"target"in t,VL=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),MO=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),yc=(t,e=[0,0])=>{const{width:n,height:r}=oi(t),i=t.origin??e,s=n*i[0],o=r*i[1];return{x:t.position.x-s,y:t.position.y-o}},jL=(t,e={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const n=t.reduce((r,i)=>{const s=typeof i=="string";let o=!e.nodeLookup&&!s?i:void 0;e.nodeLookup&&(o=s?e.nodeLookup.get(i):MO(i)?i:e.nodeLookup.get(i.id));const a=o?Gf(o,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return eh(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return th(n)},bc=(t,e={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return t.forEach(i=>{(e.filter===void 0||e.filter(i))&&(n=eh(n,Gf(i)),r=!0)}),r?th(n):{x:0,y:0,width:0,height:0}},LO=(t,e,[n,r,i]=[0,0,1],s=!1,o=!1)=>{const a=(e.x-n)/i,l=(e.y-r)/i,c=e.width/i,u=e.height/i,f=[];for(const d of t.values()){const{measured:h,selectable:p=!0,hidden:m=!1}=d;if(o&&!p||m)continue;const O=h.width??d.width??d.initialWidth??0,g=h.height??d.height??d.initialHeight??0,{x:b,y}=d.internals.positionAbsolute,v=OT(a,l,c,u,b,y,O,g),S=O*g,E=s&&v>0;(!d.internals.handleBounds||E||v>=S||d.dragging)&&f.push(d)}return f},BL=(t,e)=>{const n=new Set;return t.forEach(r=>{n.add(r.id)}),e.filter(r=>n.has(r.source)||n.has(r.target))};function FL(t,e){const n=new Map,r=e!=null&&e.nodes?new Set(e.nodes.map(i=>i.id)):null;return t.forEach(i=>{i.measured.width&&i.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function XL({nodes:t,width:e,height:n,panZoom:r,minZoom:i,maxZoom:s},o){if(t.size===0)return!0;const a=FL(t,o),l=bc(a),c=ZO(l,e,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await r.setViewport(c,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),!0}function pT({nodeId:t,nextPosition:e,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const o=n.get(t),a=o.parentId?n.get(o.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},u=o.origin??r;let f=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!a)s==null||s("005",Hn.error005());else{const h=a.measured.width,p=a.measured.height;h&&p&&(f=[[l,c],[l+h,c+p]])}else a&&$s(o.extent)&&(f=[[o.extent[0][0]+l,o.extent[0][1]+c],[o.extent[1][0]+l,o.extent[1][1]+c]]);const d=$s(f)?Cs(e,f,o.measured):e;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",Hn.error015())),{position:{x:d.x-l+(o.measured.width??0)*u[0],y:d.y-c+(o.measured.height??0)*u[1]},positionAbsolute:d}}async function zL({nodesToRemove:t=[],edgesToRemove:e=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(t.map(d=>d.id)),o=[];for(const d of n){if(d.deletable===!1)continue;const h=s.has(d.id),p=!h&&d.parentId&&o.find(m=>m.id===d.parentId);(h||p)&&o.push(d)}const a=new Set(e.map(d=>d.id)),l=r.filter(d=>d.deletable!==!1),u=BL(o,l);for(const d of l)a.has(d.id)&&!u.find(p=>p.id===d.id)&&u.push(d);if(!i)return{edges:u,nodes:o};const f=await i({nodes:o,edges:u});return typeof f=="boolean"?f?{edges:u,nodes:o}:{edges:[],nodes:[]}:f}const Bo=(t,e=0,n=1)=>Math.min(Math.max(t,e),n),Cs=(t={x:0,y:0},e,n)=>({x:Bo(t.x,e[0][0],e[1][0]-((n==null?void 0:n.width)??0)),y:Bo(t.y,e[0][1],e[1][1]-((n==null?void 0:n.height)??0))});function mT(t,e,n){const{width:r,height:i}=oi(n),{x:s,y:o}=n.internals.positionAbsolute;return Cs(t,[[s,o],[s+r,o+i]],e)}const r1=(t,e,n)=>t<e?Bo(Math.abs(t-e),1,e)/e:t>n?-Bo(Math.abs(t-n),1,e)/e:0,DO=(t,e,n=15,r=40)=>{const i=r1(t.x,r,e.width-r)*n,s=r1(t.y,r,e.height-r)*n;return[i,s]},eh=(t,e)=>({x:Math.min(t.x,e.x),y:Math.min(t.y,e.y),x2:Math.max(t.x2,e.x2),y2:Math.max(t.y2,e.y2)}),gg=({x:t,y:e,width:n,height:r})=>({x:t,y:e,x2:t+n,y2:e+r}),th=({x:t,y:e,x2:n,y2:r})=>({x:t,y:e,width:n-t,height:r-e}),Ql=(t,e=[0,0])=>{var i,s;const{x:n,y:r}=MO(t)?t.internals.positionAbsolute:yc(t,e);return{x:n,y:r,width:((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0,height:((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0}},Gf=(t,e=[0,0])=>{var i,s;const{x:n,y:r}=MO(t)?t.internals.positionAbsolute:yc(t,e);return{x:n,y:r,x2:n+(((i=t.measured)==null?void 0:i.width)??t.width??t.initialWidth??0),y2:r+(((s=t.measured)==null?void 0:s.height)??t.height??t.initialHeight??0)}},gT=(t,e)=>th(eh(gg(t),gg(e))),OT=(t,e,n,r,i,s,o,a)=>{const l=Math.max(0,Math.min(t+n,i+o)-Math.max(t,i)),c=Math.max(0,Math.min(e+r,s+a)-Math.max(e,s));return Math.ceil(l*c)},Hf=(t,e)=>OT(t.x,t.y,t.width,t.height,e.x,e.y,e.width,e.height),i1=t=>Fn(t.width)&&Fn(t.height)&&Fn(t.x)&&Fn(t.y),Fn=t=>!isNaN(t)&&isFinite(t),yT=(t,e)=>(n,r)=>{},xc=(t,e=[1,1])=>({x:e[0]*Math.round(t.x/e[0]),y:e[1]*Math.round(t.y/e[1])}),vc=({x:t,y:e},[n,r,i],s=!1,o=[1,1])=>{const a={x:(t-n)/i,y:(e-r)/i};return s?xc(a,o):a},Fo=({x:t,y:e},[n,r,i])=>({x:t*i+n,y:e*i+r});function Xs(t,e){if(typeof t=="number")return Math.floor((e-e/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(n)}if(typeof t=="string"&&t.endsWith("%")){const n=parseFloat(t);if(!Number.isNaN(n))return Math.floor(e*n*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function WL(t,e,n){if(typeof t=="string"||typeof t=="number"){const r=Xs(t,n),i=Xs(t,e);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof t=="object"){const r=Xs(t.top??t.y??0,n),i=Xs(t.bottom??t.y??0,n),s=Xs(t.left??t.x??0,e),o=Xs(t.right??t.x??0,e);return{top:r,right:o,bottom:i,left:s,x:s+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function UL(t,e,n,r,i,s){const{x:o,y:a}=Fo(t,[e,n,r]),{x:l,y:c}=Fo({x:t.x+t.width,y:t.y+t.height},[e,n,r]),u=i-l,f=s-c;return{left:Math.floor(o),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(f)}}const ZO=(t,e,n,r,i,s)=>{const o=WL(s,e,n),a=(e-o.x)/t.width,l=(n-o.y)/t.height,c=Math.min(a,l),u=Bo(c,r,i),f=t.x+t.width/2,d=t.y+t.height/2,h=e/2-f*u,p=n/2-d*u,m=UL(t,h,p,u,e,n),O={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:h-O.left+O.right,y:p-O.top+O.bottom,zoom:u}},Rl=()=>{var t;return typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)==null?void 0:t.indexOf("Mac"))>=0};function $s(t){return t!=null&&t!=="parent"}function oi(t){var e,n;return{width:((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth??0,height:((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight??0}}function bT(t){var e,n;return(((e=t.measured)==null?void 0:e.width)??t.width??t.initialWidth)!==void 0&&(((n=t.measured)==null?void 0:n.height)??t.height??t.initialHeight)!==void 0}function xT(t,e={width:0,height:0},n,r,i){const s={...t},o=r.get(n);if(o){const a=o.origin||i;s.x+=o.internals.positionAbsolute.x-(e.width??0)*a[0],s.y+=o.internals.positionAbsolute.y-(e.height??0)*a[1]}return s}function s1(t,e){if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0}function YL(){let t,e;return{promise:new Promise((r,i)=>{t=r,e=i}),resolve:t,reject:e}}function GL(t){return{...uT,...t||{}}}function Ja(t,{snapGrid:e=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:o}=Xn(t),a=vc({x:s-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:l,y:c}=n?xc(a,e):a;return{xSnapped:l,ySnapped:c,...a}}const VO=t=>({width:t.offsetWidth,height:t.offsetHeight}),vT=t=>{var e;return((e=t==null?void 0:t.getRootNode)==null?void 0:e.call(t))||(window==null?void 0:window.document)},HL=["INPUT","SELECT","TEXTAREA"];function wT(t){var r,i;const e=((i=(r=t.composedPath)==null?void 0:r.call(t))==null?void 0:i[0])||t.target;return(e==null?void 0:e.nodeType)!==1?!1:HL.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const ST=t=>"clientX"in t,Xn=(t,e)=>{var s,o;const n=ST(t),r=n?t.clientX:(s=t.touches)==null?void 0:s[0].clientX,i=n?t.clientY:(o=t.touches)==null?void 0:o[0].clientY;return{x:r-((e==null?void 0:e.left)??0),y:i-((e==null?void 0:e.top)??0)}},o1=(t,e,n,r,i)=>{const s=e.querySelectorAll(`.${t}`);return!s||!s.length?null:Array.from(s).map(o=>{const a=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:t,nodeId:i,position:o.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...VO(o)}})};function kT({sourceX:t,sourceY:e,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:o,targetControlY:a}){const l=t*.125+i*.375+o*.375+n*.125,c=e*.125+s*.375+a*.375+r*.125,u=Math.abs(l-t),f=Math.abs(c-e);return[l,c,u,f]}function cu(t,e){return t>=0?.5*t:e*25*Math.sqrt(-t)}function a1({pos:t,x1:e,y1:n,x2:r,y2:i,c:s}){switch(t){case ce.Left:return[e-cu(e-r,s),n];case ce.Right:return[e+cu(r-e,s),n];case ce.Top:return[e,n-cu(n-i,s)];case ce.Bottom:return[e,n+cu(i-n,s)]}}function jO({sourceX:t,sourceY:e,sourcePosition:n=ce.Bottom,targetX:r,targetY:i,targetPosition:s=ce.Top,curvature:o=.25}){const[a,l]=a1({pos:n,x1:t,y1:e,x2:r,y2:i,c:o}),[c,u]=a1({pos:s,x1:r,y1:i,x2:t,y2:e,c:o}),[f,d,h,p]=kT({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${t},${e} C${a},${l} ${c},${u} ${r},${i}`,f,d,h,p]}function ET({sourceX:t,sourceY:e,targetX:n,targetY:r}){const i=Math.abs(n-t)/2,s=n<t?n+i:n-i,o=Math.abs(r-e)/2,a=r<e?r+o:r-o;return[s,a,i,o]}function qL({sourceNode:t,targetNode:e,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const o=i&&n?r+1e3:r,a=Math.max(t.parentId||i&&t.selected?t.internals.z:0,e.parentId||i&&e.selected?e.internals.z:0);return o+a}function KL({sourceNode:t,targetNode:e,width:n,height:r,transform:i}){const s=eh(Gf(t),Gf(e));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Hf(o,th(s))>0}const JL=({source:t,sourceHandle:e,target:n,targetHandle:r})=>`xy-edge__${t}${e||""}-${n}${r||""}`,eD=(t,e)=>e.some(n=>n.source===t.source&&n.target===t.target&&(n.sourceHandle===t.sourceHandle||!n.sourceHandle&&!t.sourceHandle)&&(n.targetHandle===t.targetHandle||!n.targetHandle&&!t.targetHandle)),tD=(t,e,n={})=>{var s;if(!t.source||!t.target)return(s=n.onError)==null||s.call(n,"006",Hn.error006()),e;const r=n.getEdgeId||JL;let i;return hT(t)?i={...t}:i={...t,id:r(t)},eD(i,e)?e:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,e.concat(i))};function TT({sourceX:t,sourceY:e,targetX:n,targetY:r}){const[i,s,o,a]=ET({sourceX:t,sourceY:e,targetX:n,targetY:r});return[`M ${t},${e}L ${n},${r}`,i,s,o,a]}const l1={[ce.Left]:{x:-1,y:0},[ce.Right]:{x:1,y:0},[ce.Top]:{x:0,y:-1},[ce.Bottom]:{x:0,y:1}},nD=({source:t,sourcePosition:e=ce.Bottom,target:n})=>e===ce.Left||e===ce.Right?t.x<n.x?{x:1,y:0}:{x:-1,y:0}:t.y<n.y?{x:0,y:1}:{x:0,y:-1},c1=(t,e)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2));function rD({source:t,sourcePosition:e=ce.Bottom,target:n,targetPosition:r=ce.Top,center:i,offset:s,stepPosition:o}){const a=l1[e],l=l1[r],c={x:t.x+a.x*s,y:t.y+a.y*s},u={x:n.x+l.x*s,y:n.y+l.y*s},f=nD({source:c,sourcePosition:e,target:u}),d=f.x!==0?"x":"y",h=f[d];let p=[],m,O;const g={x:0,y:0},b={x:0,y:0},[,,y,v]=ET({sourceX:t.x,sourceY:t.y,targetX:n.x,targetY:n.y});if(a[d]*l[d]===-1){d==="x"?(m=i.x??c.x+(u.x-c.x)*o,O=i.y??(c.y+u.y)/2):(m=i.x??(c.x+u.x)/2,O=i.y??c.y+(u.y-c.y)*o);const k=[{x:m,y:c.y},{x:m,y:u.y}],N=[{x:c.x,y:O},{x:u.x,y:O}];a[d]===h?p=d==="x"?k:N:p=d==="x"?N:k}else{const k=[{x:c.x,y:u.y}],N=[{x:u.x,y:c.y}];if(d==="x"?p=a.x===h?N:k:p=a.y===h?k:N,e===r){const P=Math.abs(t[d]-n[d]);if(P<=s){const M=Math.min(s-1,s-P);a[d]===h?g[d]=(c[d]>t[d]?-1:1)*M:b[d]=(u[d]>n[d]?-1:1)*M}}if(e!==r){const P=d==="x"?"y":"x",M=a[d]===l[P],R=c[P]>u[P],L=c[P]<u[P];(a[d]===1&&(!M&&R||M&&L)||a[d]!==1&&(!M&&L||M&&R))&&(p=d==="x"?k:N)}const $={x:c.x+g.x,y:c.y+g.y},C={x:u.x+b.x,y:u.y+b.y},_=Math.max(Math.abs($.x-p[0].x),Math.abs(C.x-p[0].x)),V=Math.max(Math.abs($.y-p[0].y),Math.abs(C.y-p[0].y));_>=V?(m=($.x+C.x)/2,O=p[0].y):(m=p[0].x,O=($.y+C.y)/2)}const S={x:c.x+g.x,y:c.y+g.y},E={x:u.x+b.x,y:u.y+b.y};return[[t,...S.x!==p[0].x||S.y!==p[0].y?[S]:[],...p,...E.x!==p[p.length-1].x||E.y!==p[p.length-1].y?[E]:[],n],m,O,y,v]}function iD(t,e,n,r){const i=Math.min(c1(t,e)/2,c1(e,n)/2,r),{x:s,y:o}=e;if(t.x===s&&s===n.x||t.y===o&&o===n.y)return`L${s} ${o}`;if(t.y===o){const c=t.x<n.x?-1:1,u=t.y<n.y?1:-1;return`L ${s+i*c},${o}Q ${s},${o} ${s},${o+i*u}`}const a=t.x<n.x?1:-1,l=t.y<n.y?-1:1;return`L ${s},${o+i*l}Q ${s},${o} ${s+i*a},${o}`}function Og({sourceX:t,sourceY:e,sourcePosition:n=ce.Bottom,targetX:r,targetY:i,targetPosition:s=ce.Top,borderRadius:o=5,centerX:a,centerY:l,offset:c=20,stepPosition:u=.5}){const[f,d,h,p,m]=rD({source:{x:t,y:e},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:a,y:l},offset:c,stepPosition:u});let O=`M${f[0].x} ${f[0].y}`;for(let g=1;g<f.length-1;g++)O+=iD(f[g-1],f[g],f[g+1],o);return O+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[O,d,h,p,m]}function u1(t){var e;return t&&!!(t.internals.handleBounds||(e=t.handles)!=null&&e.length)&&!!(t.measured.width||t.width||t.initialWidth)}function sD(t){var f;const{sourceNode:e,targetNode:n}=t;if(!u1(e)||!u1(n))return null;const r=e.internals.handleBounds||f1(e.handles),i=n.internals.handleBounds||f1(n.handles),s=d1((r==null?void 0:r.source)??[],t.sourceHandle),o=d1(t.connectionMode===jo.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),t.targetHandle);if(!s||!o)return(f=t.onError)==null||f.call(t,"008",Hn.error008(s?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const a=(s==null?void 0:s.position)||ce.Bottom,l=(o==null?void 0:o.position)||ce.Top,c=As(e,s,a),u=As(n,o,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function f1(t){if(!t)return null;const e=[],n=[];for(const r of t)r.width=r.width??1,r.height=r.height??1,r.type==="source"?e.push(r):r.type==="target"&&n.push(r);return{source:e,target:n}}function As(t,e,n=ce.Left,r=!1){const i=((e==null?void 0:e.x)??0)+t.internals.positionAbsolute.x,s=((e==null?void 0:e.y)??0)+t.internals.positionAbsolute.y,{width:o,height:a}=e??oi(t);if(r)return{x:i+o/2,y:s+a/2};switch((e==null?void 0:e.position)??n){case ce.Top:return{x:i+o/2,y:s};case ce.Right:return{x:i+o,y:s+a/2};case ce.Bottom:return{x:i+o/2,y:s+a};case ce.Left:return{x:i,y:s+a/2}}}function d1(t,e){return t&&(e?t.find(n=>n.id===e):t[0])||null}function yg(t,e){return t?typeof t=="string"?t:`${e?`${e}__`:""}${Object.keys(t).sort().map(r=>`${r}=${t[r]}`).join("&")}`:""}function oD(t,{id:e,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return t.reduce((o,a)=>([a.markerStart||r,a.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){const c=yg(l,e);s.has(c)||(o.push({id:c,color:l.color||n,...l}),s.add(c))}}),o),[]).sort((o,a)=>o.id.localeCompare(a.id))}const NT=1e3,aD=10,BO={nodeOrigin:[0,0],nodeExtent:Al,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},lD={...BO,checkEquality:!0};function FO(t,e){const n={...t};for(const r in e)e[r]!==void 0&&(n[r]=e[r]);return n}function cD(t,e,n){const r=FO(BO,n);for(const i of t.values())if(i.parentId)zO(i,t,e,r);else{const s=yc(i,r.nodeOrigin),o=$s(i.extent)?i.extent:r.nodeExtent,a=Cs(s,o,oi(i));i.internals.positionAbsolute=a}}function uD(t,e){if(!t.handles)return t.measured?e==null?void 0:e.internals.handleBounds:void 0;const n=[],r=[];for(const i of t.handles){const s={id:i.id,width:i.width??1,height:i.height??1,nodeId:t.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function XO(t){return t==="manual"}function bg(t,e,n,r={}){var u,f;const i=FO(lD,r),s={i:0},o=new Map(e),a=i!=null&&i.elevateNodesOnSelect&&!XO(i.zIndexMode)?NT:0;let l=t.length>0,c=!1;e.clear(),n.clear();for(const d of t){let h=o.get(d.id);if(i.checkEquality&&d===(h==null?void 0:h.internals.userNode))e.set(d.id,h);else{const p=yc(d,i.nodeOrigin),m=$s(d.extent)?d.extent:i.nodeExtent,O=Cs(p,m,oi(d));h={...i.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:O,handleBounds:uD(d,h),z:PT(d,a,i.zIndexMode),userNode:d}},e.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(l=!1),d.parentId&&zO(h,e,n,r,s),c||(c=d.selected??!1)}return{nodesInitialized:l,hasSelectedNodes:c}}function fD(t,e){if(!t.parentId)return;const n=e.get(t.parentId);n?n.set(t.id,t):e.set(t.parentId,new Map([[t.id,t]]))}function zO(t,e,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:a,zIndexMode:l}=FO(BO,r),c=t.parentId,u=e.get(c);if(!u){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}fD(t,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*aD),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);const f=s&&!XO(l)?NT:0,{x:d,y:h,z:p}=dD(t,u,o,a,f,l),{positionAbsolute:m}=t.internals,O=d!==m.x||h!==m.y;(O||p!==t.internals.z)&&e.set(t.id,{...t,internals:{...t.internals,positionAbsolute:O?{x:d,y:h}:m,z:p}})}function PT(t,e,n){const r=Fn(t.zIndex)?t.zIndex:0;return XO(n)?r:r+(t.selected?e:0)}function dD(t,e,n,r,i,s){const{x:o,y:a}=e.internals.positionAbsolute,l=oi(t),c=yc(t,n),u=$s(t.extent)?Cs(c,t.extent,l):c;let f=Cs({x:o+u.x,y:a+u.y},r,l);t.extent==="parent"&&(f=mT(f,l,e));const d=PT(t,i,s),h=e.internals.z??0;return{x:f.x,y:f.y,z:h>=d?h+1:d}}function WO(t,e,n,r=[0,0]){var o;const i=[],s=new Map;for(const a of t){const l=e.get(a.parentId);if(!l)continue;const c=((o=s.get(a.parentId))==null?void 0:o.expandedRect)??Ql(l),u=gT(c,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},c)=>{var y;const u=l.internals.positionAbsolute,f=oi(l),d=l.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,m=Math.max(f.width,Math.round(a.width)),O=Math.max(f.height,Math.round(a.height)),g=(m-f.width)*d[0],b=(O-f.height)*d[1];(h>0||p>0||g||b)&&(i.push({id:c,type:"position",position:{x:l.position.x-h+g,y:l.position.y-p+b}}),(y=n.get(c))==null||y.forEach(v=>{t.some(S=>S.id===v.id)||i.push({id:v.id,type:"position",position:{x:v.position.x+h,y:v.position.y+p}})})),(f.width<a.width||f.height<a.height||h||p)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:m+(h?d[0]*h-g:0),height:O+(p?d[1]*p-b:0)}})}),i}function hD(t,e,n,r,i,s,o){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(a),{m22:f}=new window.DOMMatrixReadOnly(u.transform),d=[];for(const h of t.values()){const p=e.get(h.id);if(!p)continue;if(p.hidden){e.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const m=VO(h.nodeElement),O=p.measured.width!==m.width||p.measured.height!==m.height;if(!!(m.width&&m.height&&(O||!p.internals.handleBounds||h.force))){const b=h.nodeElement.getBoundingClientRect(),y=$s(p.extent)?p.extent:s;let{positionAbsolute:v}=p.internals;p.parentId&&p.extent==="parent"?v=mT(v,m,e.get(p.parentId)):y&&(v=Cs(v,y,m));const S={...p,measured:m,internals:{...p.internals,positionAbsolute:v,handleBounds:{source:o1("source",h.nodeElement,b,f,p.id),target:o1("target",h.nodeElement,b,f,p.id)}}};e.set(p.id,S),p.parentId&&zO(S,e,n,{nodeOrigin:i,zIndexMode:o}),l=!0,O&&(c.push({id:p.id,type:"dimensions",dimensions:m}),p.expandParent&&p.parentId&&d.push({id:p.id,parentId:p.parentId,rect:Ql(S,i)}))}}if(d.length>0){const h=WO(d,e,n,i);c.push(...h)}return{changes:c,updatedInternals:l}}async function pD({delta:t,panZoom:e,transform:n,translateExtent:r,width:i,height:s}){if(!e||!t.x&&!t.y)return!1;const o=await e.setViewportConstrained({x:n[0]+t.x,y:n[1]+t.y,zoom:n[2]},[[0,0],[i,s]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function h1(t,e,n,r,i,s){let o=i;const a=r.get(o)||new Map;r.set(o,a.set(n,e)),o=`${i}-${t}`;const l=r.get(o)||new Map;if(r.set(o,l.set(n,e)),s){o=`${i}-${t}-${s}`;const c=r.get(o)||new Map;r.set(o,c.set(n,e))}}function _T(t,e,n){t.clear(),e.clear();for(const r of n){const{source:i,target:s,sourceHandle:o=null,targetHandle:a=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:a},c=`${i}-${o}--${s}-${a}`,u=`${s}-${a}--${i}-${o}`;h1("source",l,u,t,i,o),h1("target",l,c,t,s,a),e.set(r.id,r)}}function CT(t,e){if(!t.parentId)return!1;const n=e.get(t.parentId);return n?n.selected?!0:CT(n,e):!1}function p1(t,e,n){var i;let r=t;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,e))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function mD(t,e,n,r){const i=new Map;for(const[s,o]of t)if((o.selected||o.id===r)&&(!o.parentId||!CT(o,t))&&(o.draggable||e&&typeof o.draggable>"u")){const a=t.get(s);a&&i.set(s,{id:s,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function dp({nodeId:t,dragItems:e,nodeLookup:n,dragging:r=!0}){var o,a,l;const i=[];for(const[c,u]of e){const f=(o=n.get(c))==null?void 0:o.internals.userNode;f&&i.push({...f,position:u.position,dragging:r})}if(!t)return[i[0],i];const s=(a=n.get(t))==null?void 0:a.internals.userNode;return[s?{...s,position:((l=e.get(t))==null?void 0:l.position)||s.position,dragging:r}:i[0],i]}function gD({dragItems:t,snapGrid:e,x:n,y:r}){const i=t.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},o=xc(s,e);return{x:o.x-s.x,y:o.y-s.y}}function OD({onNodeMouseDown:t,getStoreItems:e,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},o=0,a=new Map,l=!1,c={x:0,y:0},u=null,f=!1,d=null,h=!1,p=!1,m=null;function O({noDragClassName:b,handleSelector:y,domNode:v,isSelectable:S,nodeId:E,nodeClickDistance:w=0}){d=cn(v);function k({x:_,y:V}){const{nodeLookup:P,nodeExtent:M,snapGrid:R,snapToGrid:L,nodeOrigin:I,onNodeDrag:A,onSelectionDrag:D,onError:B,updateNodePositions:F}=e();s={x:_,y:V};let q=!1;const j=a.size>1,H=j&&M?gg(bc(a)):null,G=j&&L?gD({dragItems:a,snapGrid:R,x:_,y:V}):null;for(const[ne,z]of a){if(!P.has(ne))continue;let J={x:_-z.distance.x,y:V-z.distance.y};L&&(J=G?{x:Math.round(J.x+G.x),y:Math.round(J.y+G.y)}:xc(J,R));let ue=null;if(j&&M&&!z.extent&&H){const{positionAbsolute:X}=z.internals,ae=X.x-H.x+M[0][0],de=X.x+z.measured.width-H.x2+M[1][0],pe=X.y-H.y+M[0][1],we=X.y+z.measured.height-H.y2+M[1][1];ue=[[ae,pe],[de,we]]}const{position:fe,positionAbsolute:oe}=pT({nodeId:ne,nextPosition:J,nodeLookup:P,nodeExtent:ue||M,nodeOrigin:I,onError:B});q=q||z.position.x!==fe.x||z.position.y!==fe.y,z.position=fe,z.internals.positionAbsolute=oe}if(p=p||q,!!q&&(F(a,!0),m&&(r||A||!E&&D))){const[ne,z]=dp({nodeId:E,dragItems:a,nodeLookup:P});r==null||r(m,a,ne,z),A==null||A(m,ne,z),E||D==null||D(m,z)}}async function N(){if(!u)return;const{transform:_,panBy:V,autoPanSpeed:P,autoPanOnNodeDrag:M}=e();if(!M){l=!1,cancelAnimationFrame(o);return}const[R,L]=DO(c,u,P);(R!==0||L!==0)&&(s.x=(s.x??0)-R/_[2],s.y=(s.y??0)-L/_[2],await V({x:R,y:L})&&k(s)),o=requestAnimationFrame(N)}function $(_){var j;const{nodeLookup:V,multiSelectionActive:P,nodesDraggable:M,transform:R,snapGrid:L,snapToGrid:I,selectNodesOnDrag:A,onNodeDragStart:D,onSelectionDragStart:B,unselectNodesAndEdges:F}=e();f=!0,(!A||!S)&&!P&&E&&((j=V.get(E))!=null&&j.selected||F()),S&&A&&E&&(t==null||t(E));const q=Ja(_.sourceEvent,{transform:R,snapGrid:L,snapToGrid:I,containerBounds:u});if(s=q,a=mD(V,M,q,E),a.size>0&&(n||D||!E&&B)){const[H,G]=dp({nodeId:E,dragItems:a,nodeLookup:V});n==null||n(_.sourceEvent,a,H,G),D==null||D(_.sourceEvent,H,G),E||B==null||B(_.sourceEvent,G)}}const C=U2().clickDistance(w).on("start",_=>{const{domNode:V,nodeDragThreshold:P,transform:M,snapGrid:R,snapToGrid:L}=e();u=(V==null?void 0:V.getBoundingClientRect())||null,h=!1,p=!1,m=_.sourceEvent,P===0&&$(_),s=Ja(_.sourceEvent,{transform:M,snapGrid:R,snapToGrid:L,containerBounds:u}),c=Xn(_.sourceEvent,u)}).on("drag",_=>{const{autoPanOnNodeDrag:V,transform:P,snapGrid:M,snapToGrid:R,nodeDragThreshold:L,nodeLookup:I}=e(),A=Ja(_.sourceEvent,{transform:P,snapGrid:M,snapToGrid:R,containerBounds:u});if(m=_.sourceEvent,(_.sourceEvent.type==="touchmove"&&_.sourceEvent.touches.length>1||E&&!I.has(E))&&(h=!0),!h){if(!l&&V&&f&&(l=!0,N()),!f){const D=Xn(_.sourceEvent,u),B=D.x-c.x,F=D.y-c.y;Math.sqrt(B*B+F*F)>L&&$(_)}(s.x!==A.xSnapped||s.y!==A.ySnapped)&&a&&f&&(c=Xn(_.sourceEvent,u),k(A))}}).on("end",_=>{if(!f||h){h&&a.size>0&&e().updateNodePositions(a,!1);return}if(l=!1,f=!1,cancelAnimationFrame(o),a.size>0){const{nodeLookup:V,updateNodePositions:P,onNodeDragStop:M,onSelectionDragStop:R}=e();if(p&&(P(a,!1),p=!1),i||M||!E&&R){const[L,I]=dp({nodeId:E,dragItems:a,nodeLookup:V,dragging:!1});i==null||i(_.sourceEvent,a,L,I),M==null||M(_.sourceEvent,L,I),E||R==null||R(_.sourceEvent,I)}}}).filter(_=>{const V=_.target;return!_.button&&(!b||!p1(V,`.${b}`,v))&&(!y||p1(V,y,v))});d.call(C)}function g(){d==null||d.on(".drag",null)}return{update:O,destroy:g}}function yD(t,e,n){const r=[],i={x:t.x-n,y:t.y-n,width:n*2,height:n*2};for(const s of e.values())Hf(i,Ql(s))>0&&r.push(s);return r}const bD=250;function xD(t,e,n,r){var a,l;let i=[],s=1/0;const o=yD(t,n,e+bD);for(const c of o){const u=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const f of u){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:h}=As(c,f,f.position,!0),p=Math.sqrt(Math.pow(d-t.x,2)+Math.pow(h-t.y,2));p>e||(p<s?(i=[{...f,x:d,y:h}],s=p):p===s&&i.push({...f,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){const c=r.type==="source"?"target":"source";return i.find(u=>u.type===c)??i[0]}return i[0]}function $T(t,e,n,r,i,s=!1){var c,u,f;const o=r.get(t);if(!o)return null;const a=i==="strict"?(c=o.internals.handleBounds)==null?void 0:c[e]:[...((u=o.internals.handleBounds)==null?void 0:u.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],l=(n?a==null?void 0:a.find(d=>d.id===n):a==null?void 0:a[0])??null;return l&&s?{...l,...As(o,l,l.position,!0)}:l}function AT(t,e){return t||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function vD(t,e){let n=null;return e?n=!0:t&&!e&&(n=!1),n}const IT=()=>!0;function wD(t,{connectionMode:e,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:f,panBy:d,cancelConnection:h,onConnectStart:p,onConnect:m,onConnectEnd:O,isValidConnection:g=IT,onReconnectEnd:b,updateConnection:y,getTransform:v,getFromHandle:S,autoPanSpeed:E,dragThreshold:w=1,handleDomNode:k}){const N=vT(t.target);let $=0,C;const{x:_,y:V}=Xn(t),P=AT(s,k),M=a==null?void 0:a.getBoundingClientRect();let R=!1;if(!M||!P)return;const L=$T(i,P,r,l,e);if(!L)return;let I=Xn(t,M),A=!1,D=null,B=!1,F=null;function q(){if(!u||!M)return;const[fe,oe]=DO(I,M,E);d({x:fe,y:oe}),$=requestAnimationFrame(q)}const j={...L,nodeId:i,type:P,position:L.position},H=l.get(i);let ne={inProgress:!0,isValid:null,from:As(H,j,ce.Left,!0),fromHandle:j,fromPosition:j.position,fromNode:H,to:I,toHandle:null,toPosition:n1[j.position],toNode:null,pointer:I};function z(){R=!0,y(ne),p==null||p(t,{nodeId:i,handleId:r,handleType:P})}w===0&&z();function J(fe){if(!R){const{x:we,y:St}=Xn(fe),ir=we-_,sr=St-V;if(!(ir*ir+sr*sr>w*w))return;z()}if(!S()||!j){ue(fe);return}const oe=v();I=Xn(fe,M),C=xD(vc(I,oe,!1,[1,1]),n,l,j),A||(q(),A=!0);const X=QT(fe,{handle:C,connectionMode:e,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:g,doc:N,lib:c,flowId:f,nodeLookup:l});F=X.handleDomNode,D=X.connection,B=vD(!!C,X.isValid);const ae=l.get(i),de=ae?As(ae,j,ce.Left,!0):ne.from,pe={...ne,from:de,isValid:B,to:X.toHandle&&B?Fo({x:X.toHandle.x,y:X.toHandle.y},oe):I,toHandle:X.toHandle,toPosition:B&&X.toHandle?X.toHandle.position:n1[j.position],toNode:X.toHandle?l.get(X.toHandle.nodeId):null,pointer:I};y(pe),ne=pe}function ue(fe){if(!("touches"in fe&&fe.touches.length>0)){if(R){(C||F)&&D&&B&&(m==null||m(D));const{inProgress:oe,...X}=ne,ae={...X,toPosition:ne.toHandle?ne.toPosition:null};O==null||O(fe,ae),s&&(b==null||b(fe,ae))}h(),cancelAnimationFrame($),A=!1,B=!1,D=null,F=null,N.removeEventListener("mousemove",J),N.removeEventListener("mouseup",ue),N.removeEventListener("touchmove",J),N.removeEventListener("touchend",ue)}}N.addEventListener("mousemove",J),N.addEventListener("mouseup",ue),N.addEventListener("touchmove",J),N.addEventListener("touchend",ue)}function QT(t,{handle:e,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:a,flowId:l,isValidConnection:c=IT,nodeLookup:u}){const f=s==="target",d=e?o.querySelector(`.${a}-flow__handle[data-id="${l}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:h,y:p}=Xn(t),m=o.elementFromPoint(h,p),O=m!=null&&m.classList.contains(`${a}-flow__handle`)?m:d,g={handleDomNode:O,isValid:!1,connection:null,toHandle:null};if(O){const b=AT(void 0,O),y=O.getAttribute("data-nodeid"),v=O.getAttribute("data-handleid"),S=O.classList.contains("connectable"),E=O.classList.contains("connectableend");if(!y||!b)return g;const w={source:f?y:r,sourceHandle:f?v:i,target:f?r:y,targetHandle:f?i:v};g.connection=w;const N=S&&E&&(n===jo.Strict?f&&b==="source"||!f&&b==="target":y!==r||v!==i);g.isValid=N&&c(w),g.toHandle=$T(y,b,v,u,n,!0)}return g}const xg={onPointerDown:wD,isValid:QT};function SD({domNode:t,panZoom:e,getTransform:n,getViewScale:r}){const i=cn(t);function s({translateExtent:a,width:l,height:c,zoomStep:u=1,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const p=y=>{if(y.sourceEvent.type!=="wheel"||!e)return;const v=n(),S=y.sourceEvent.ctrlKey&&Rl()?10:1,E=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*u,w=v[2]*Math.pow(2,E*S);e.scaleTo(w)};let m=[0,0];const O=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(m=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},g=y=>{const v=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!e)return;const S=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],E=[S[0]-m[0],S[1]-m[1]];m=S;const w=r()*Math.max(v[2],Math.log(v[2]))*(h?-1:1),k={x:v[0]-E[0]*w,y:v[1]-E[1]*w},N=[[0,0],[l,c]];e.setViewportConstrained({x:k.x,y:k.y,zoom:v[2]},N,a)},b=lT().on("start",O).on("zoom",f?g:null).on("zoom.wheel",d?p:null);i.call(b,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:Mn}}const nh=t=>({x:t.x,y:t.y,zoom:t.k}),hp=({x:t,y:e,zoom:n})=>Jd.translate(t,e).scale(n),co=(t,e)=>t.target.closest(`.${e}`),RT=(t,e)=>e===2&&Array.isArray(t)&&t.includes(2),kD=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,pp=(t,e=0,n=kD,r=()=>{})=>{const i=typeof e=="number"&&e>0;return i||r(),i?t.transition().duration(e).ease(n).on("end",r):t},MT=t=>{const e=t.ctrlKey&&Rl()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*e};function ED({zoomPanValues:t,noWheelClassName:e,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(co(u,e))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(u.ctrlKey&&o){const O=Mn(u),g=MT(u),b=f*Math.pow(2,g);r.scaleTo(n,b,O,u);return}const d=u.deltaMode===1?20:1;let h=i===ys.Vertical?0:u.deltaX*d,p=i===ys.Horizontal?0:u.deltaY*d;!Rl()&&u.shiftKey&&i!==ys.Vertical&&(h=u.deltaY*d,p=0),r.translateBy(n,-(h/f)*s,-(p/f)*s,{internal:!0});const m=nh(n.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(l==null||l(u,m),t.panScrollTimeout=setTimeout(()=>{c==null||c(u,m),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,a==null||a(u,m))}}function TD({noWheelClassName:t,preventScrolling:e,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",o=!e&&s&&!r.ctrlKey,a=co(r,t);if(r.ctrlKey&&s&&a&&r.preventDefault(),o||a)return null;r.preventDefault(),n.call(this,r,i)}}function ND({zoomPanValues:t,onDraggingChange:e,onPanZoomStart:n}){return r=>{var s,o,a;if((s=r.sourceEvent)!=null&&s.internal)return;const i=nh(r.transform);t.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,t.isZoomingOrPanning=!0,t.prevViewport=i,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&e(!0),n&&(n==null||n(r.sourceEvent,i))}}function PD({zoomPanValues:t,panOnDrag:e,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,a;t.usedRightMouseButton=!!(n&&RT(e,t.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((a=s.sourceEvent)!=null&&a.internal)&&(i==null||i(s.sourceEvent,nh(s.transform)))}}function _D({zoomPanValues:t,panOnDrag:e,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return o=>{var a;if(!((a=o.sourceEvent)!=null&&a.internal)&&(t.isZoomingOrPanning=!1,s&&RT(e,t.mouseButton??0)&&!t.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),t.usedRightMouseButton=!1,r(!1),i)){const l=nh(o.transform);t.prevViewport=l,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,l)},n?150:0)}}}function CD({zoomActivationKeyPressed:t,zoomOnScroll:e,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:u}){return f=>{var O;const d=t||e,h=n&&f.ctrlKey,p=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(co(f,`${c}-flow__node`)||co(f,`${c}-flow__edge`)))return!0;if(!r&&!d&&!i&&!s&&!n||o||u&&!p||co(f,a)&&p||co(f,l)&&(!p||i&&p&&!t)||!n&&f.ctrlKey&&p)return!1;if(!n&&f.type==="touchstart"&&((O=f.touches)==null?void 0:O.length)>1)return f.preventDefault(),!1;if(!d&&!i&&!h&&p||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const m=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||p)&&m}}function $D({domNode:t,minZoom:e,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=t.getBoundingClientRect(),f=lT().scaleExtent([e,n]).translateExtent(r),d=cn(t).call(f);b({x:i.x,y:i.y,zoom:Bo(i.zoom,e,n)},[[0,0],[u.width,u.height]],r);const h=d.on("wheel.zoom"),p=d.on("dblclick.zoom");f.wheelDelta(MT);async function m(C,_){return d?new Promise(V=>{f==null||f.interpolate((_==null?void 0:_.interpolate)==="linear"?Ka:tf).transform(pp(d,_==null?void 0:_.duration,_==null?void 0:_.ease,()=>V(!0)),C)}):!1}function O({noWheelClassName:C,noPanClassName:_,onPaneContextMenu:V,userSelectionActive:P,panOnScroll:M,panOnDrag:R,panOnScrollMode:L,panOnScrollSpeed:I,preventScrolling:A,zoomOnPinch:D,zoomOnScroll:B,zoomOnDoubleClick:F,zoomActivationKeyPressed:q,lib:j,onTransformChange:H,connectionInProgress:G,paneClickDistance:ne,selectionOnDrag:z}){P&&!c.isZoomingOrPanning&&g();const J=M&&!q&&!P;f.clickDistance(z?1/0:!Fn(ne)||ne<0?0:ne);const ue=J?ED({zoomPanValues:c,noWheelClassName:C,d3Selection:d,d3Zoom:f,panOnScrollMode:L,panOnScrollSpeed:I,zoomOnPinch:D,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:a}):TD({noWheelClassName:C,preventScrolling:A,d3ZoomHandler:h});d.on("wheel.zoom",ue,{passive:!1});const fe=ND({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:o});f.on("start",fe);const oe=PD({zoomPanValues:c,panOnDrag:R,onPaneContextMenu:!!V,onPanZoom:s,onTransformChange:H});f.on("zoom",oe);const X=_D({zoomPanValues:c,panOnDrag:R,panOnScroll:M,onPaneContextMenu:V,onPanZoomEnd:a,onDraggingChange:l});f.on("end",X);const ae=CD({zoomActivationKeyPressed:q,panOnDrag:R,zoomOnScroll:B,panOnScroll:M,zoomOnDoubleClick:F,zoomOnPinch:D,userSelectionActive:P,noPanClassName:_,noWheelClassName:C,lib:j,connectionInProgress:G});f.filter(ae),F?d.on("dblclick.zoom",p):d.on("dblclick.zoom",null)}function g(){f.on("zoom",null)}async function b(C,_,V){const P=hp(C),M=f==null?void 0:f.constrain()(P,_,V);return M&&await m(M),M}async function y(C,_){const V=hp(C);return await m(V,_),V}function v(C){if(d){const _=hp(C),V=d.property("__zoom");(V.k!==C.zoom||V.x!==C.x||V.y!==C.y)&&(f==null||f.transform(d,_,null,{sync:!0}))}}function S(){const C=d?aT(d.node()):{x:0,y:0,k:1};return{x:C.x,y:C.y,zoom:C.k}}async function E(C,_){return d?new Promise(V=>{f==null||f.interpolate((_==null?void 0:_.interpolate)==="linear"?Ka:tf).scaleTo(pp(d,_==null?void 0:_.duration,_==null?void 0:_.ease,()=>V(!0)),C)}):!1}async function w(C,_){return d?new Promise(V=>{f==null||f.interpolate((_==null?void 0:_.interpolate)==="linear"?Ka:tf).scaleBy(pp(d,_==null?void 0:_.duration,_==null?void 0:_.ease,()=>V(!0)),C)}):!1}function k(C){f==null||f.scaleExtent(C)}function N(C){f==null||f.translateExtent(C)}function $(C){const _=!Fn(C)||C<0?0:C;f==null||f.clickDistance(_)}return{update:O,destroy:g,setViewport:y,setViewportConstrained:b,getViewport:S,scaleTo:E,scaleBy:w,setScaleExtent:k,setTranslateExtent:N,syncViewport:v,setClickDistance:$}}var Xo;(function(t){t.Line="line",t.Handle="handle"})(Xo||(Xo={}));function AD({width:t,prevWidth:e,height:n,prevHeight:r,affectsX:i,affectsY:s}){const o=t-e,a=n-r,l=[o>0?1:o<0?-1:0,a>0?1:a<0?-1:0];return o&&i&&(l[0]=l[0]*-1),a&&s&&(l[1]=l[1]*-1),l}function m1(t){const e=t.includes("right")||t.includes("left"),n=t.includes("bottom")||t.includes("top"),r=t.includes("left"),i=t.includes("top");return{isHorizontal:e,isVertical:n,affectsX:r,affectsY:i}}function ci(t,e){return Math.max(0,e-t)}function ui(t,e){return Math.max(0,t-e)}function uu(t,e,n){return Math.max(0,e-t,t-n)}function g1(t,e){return t?!e:e}function ID(t,e,n,r,i,s,o,a){let{affectsX:l,affectsY:c}=e;const{isHorizontal:u,isVertical:f}=e,d=u&&f,{xSnapped:h,ySnapped:p}=n,{minWidth:m,maxWidth:O,minHeight:g,maxHeight:b}=r,{x:y,y:v,width:S,height:E,aspectRatio:w}=t;let k=Math.floor(u?h-t.pointerX:0),N=Math.floor(f?p-t.pointerY:0);const $=S+(l?-k:k),C=E+(c?-N:N),_=-s[0]*S,V=-s[1]*E;let P=uu($,m,O),M=uu(C,g,b);if(o){let I=0,A=0;l&&k<0?I=ci(y+k+_,o[0][0]):!l&&k>0&&(I=ui(y+$+_,o[1][0])),c&&N<0?A=ci(v+N+V,o[0][1]):!c&&N>0&&(A=ui(v+C+V,o[1][1])),P=Math.max(P,I),M=Math.max(M,A)}if(a){let I=0,A=0;l&&k>0?I=ui(y+k,a[0][0]):!l&&k<0&&(I=ci(y+$,a[1][0])),c&&N>0?A=ui(v+N,a[0][1]):!c&&N<0&&(A=ci(v+C,a[1][1])),P=Math.max(P,I),M=Math.max(M,A)}if(i){if(u){const I=uu($/w,g,b)*w;if(P=Math.max(P,I),o){let A=0;!l&&!c||l&&!c&&d?A=ui(v+V+$/w,o[1][1])*w:A=ci(v+V+(l?k:-k)/w,o[0][1])*w,P=Math.max(P,A)}if(a){let A=0;!l&&!c||l&&!c&&d?A=ci(v+$/w,a[1][1])*w:A=ui(v+(l?k:-k)/w,a[0][1])*w,P=Math.max(P,A)}}if(f){const I=uu(C*w,m,O)/w;if(M=Math.max(M,I),o){let A=0;!l&&!c||c&&!l&&d?A=ui(y+C*w+_,o[1][0])/w:A=ci(y+(c?N:-N)*w+_,o[0][0])/w,M=Math.max(M,A)}if(a){let A=0;!l&&!c||c&&!l&&d?A=ci(y+C*w,a[1][0])/w:A=ui(y+(c?N:-N)*w,a[0][0])/w,M=Math.max(M,A)}}}N=N+(N<0?M:-M),k=k+(k<0?P:-P),i&&(d?$>C*w?N=(g1(l,c)?-k:k)/w:k=(g1(l,c)?-N:N)*w:u?(N=k/w,c=l):(k=N*w,l=c));const R=l?y+k:y,L=c?v+N:v;return{width:S+(l?-k:k),height:E+(c?-N:N),x:s[0]*k*(l?-1:1)+R,y:s[1]*N*(c?-1:1)+L}}const LT={width:0,height:0,x:0,y:0},QD={...LT,pointerX:0,pointerY:0,aspectRatio:1};function RD(t,e,n){const r=e.position.x+t.position.x,i=e.position.y+t.position.y,s=t.measured.width??0,o=t.measured.height??0,a=n[0]*s,l=n[1]*o;return[[r-a,i-l],[r+s-a,i+o-l]]}function MD({domNode:t,nodeId:e,getStoreItems:n,onChange:r,onEnd:i}){const s=cn(t);let o={controlDirection:m1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:u,keepAspectRatio:f,resizeDirection:d,onResizeStart:h,onResize:p,onResizeEnd:m,shouldResize:O}){let g={...LT},b={...QD};o={boundaries:u,resizeDirection:d,keepAspectRatio:f,controlDirection:m1(c)};let y,v=null,S=[],E,w,k,N=!1;const $=U2().on("start",C=>{const{nodeLookup:_,transform:V,snapGrid:P,snapToGrid:M,nodeOrigin:R,paneDomNode:L}=n();if(y=_.get(e),!y)return;v=(L==null?void 0:L.getBoundingClientRect())??null;const{xSnapped:I,ySnapped:A}=Ja(C.sourceEvent,{transform:V,snapGrid:P,snapToGrid:M,containerBounds:v});g={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},b={...g,pointerX:I,pointerY:A,aspectRatio:g.width/g.height},E=void 0,w=$s(y.extent)?y.extent:void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(E=_.get(y.parentId)),E&&y.extent==="parent"&&(w=[[0,0],[E.measured.width,E.measured.height]]),S=[],k=void 0;for(const[D,B]of _)if(B.parentId===e&&(S.push({id:D,position:{...B.position},extent:B.extent}),B.extent==="parent"||B.expandParent)){const F=RD(B,y,B.origin??R);k?k=[[Math.min(F[0][0],k[0][0]),Math.min(F[0][1],k[0][1])],[Math.max(F[1][0],k[1][0]),Math.max(F[1][1],k[1][1])]]:k=F}h==null||h(C,{...g})}).on("drag",C=>{const{transform:_,snapGrid:V,snapToGrid:P,nodeOrigin:M}=n(),R=Ja(C.sourceEvent,{transform:_,snapGrid:V,snapToGrid:P,containerBounds:v}),L=[];if(!y)return;const{x:I,y:A,width:D,height:B}=g,F={},q=y.origin??M,{width:j,height:H,x:G,y:ne}=ID(b,o.controlDirection,R,o.boundaries,o.keepAspectRatio,q,w,k),z=j!==D,J=H!==B,ue=G!==I&&z,fe=ne!==A&&J;if(!ue&&!fe&&!z&&!J)return;if((ue||fe||q[0]===1||q[1]===1)&&(F.x=ue?G:g.x,F.y=fe?ne:g.y,g.x=F.x,g.y=F.y,S.length>0)){const de=G-I,pe=ne-A;for(const we of S)we.position={x:we.position.x-de+q[0]*(j-D),y:we.position.y-pe+q[1]*(H-B)},L.push(we)}if((z||J)&&(F.width=z&&(!o.resizeDirection||o.resizeDirection==="horizontal")?j:g.width,F.height=J&&(!o.resizeDirection||o.resizeDirection==="vertical")?H:g.height,g.width=F.width,g.height=F.height),E&&y.expandParent){const de=q[0]*(F.width??0);F.x&&F.x<de&&(g.x=de,b.x=b.x-(F.x-de));const pe=q[1]*(F.height??0);F.y&&F.y<pe&&(g.y=pe,b.y=b.y-(F.y-pe))}const oe=AD({width:g.width,prevWidth:D,height:g.height,prevHeight:B,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),X={...g,direction:oe};(O==null?void 0:O(C,X))!==!1&&(N=!0,p==null||p(C,X),r(F,L))}).on("end",C=>{N&&(m==null||m(C,{...g}),i==null||i({...g}),N=!1)});s.call($)}function l(){s.on(".drag",null)}return{update:a,destroy:l}}var DT={exports:{}},ZT={},VT={exports:{}},jT={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var zo=Q;function LD(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var DD=typeof Object.is=="function"?Object.is:LD,ZD=zo.useState,VD=zo.useEffect,jD=zo.useLayoutEffect,BD=zo.useDebugValue;function FD(t,e){var n=e(),r=ZD({inst:{value:n,getSnapshot:e}}),i=r[0].inst,s=r[1];return jD(function(){i.value=n,i.getSnapshot=e,mp(i)&&s({inst:i})},[t,n,e]),VD(function(){return mp(i)&&s({inst:i}),t(function(){mp(i)&&s({inst:i})})},[t]),BD(n),n}function mp(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!DD(t,n)}catch{return!0}}function XD(t,e){return e()}var zD=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?XD:FD;jT.useSyncExternalStore=zo.useSyncExternalStore!==void 0?zo.useSyncExternalStore:zD;VT.exports=jT;var WD=VT.exports;/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var rh=Q,UD=WD;function YD(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var GD=typeof Object.is=="function"?Object.is:YD,HD=UD.useSyncExternalStore,qD=rh.useRef,KD=rh.useEffect,JD=rh.useMemo,eZ=rh.useDebugValue;ZT.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var s=qD(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=JD(function(){function l(h){if(!c){if(c=!0,u=h,h=r(h),i!==void 0&&o.hasValue){var p=o.value;if(i(p,h))return f=p}return f=h}if(p=f,GD(u,h))return p;var m=r(h);return i!==void 0&&i(p,m)?(u=h,p):(u=h,f=m)}var c=!1,u,f,d=n===void 0?null:n;return[function(){return l(e())},d===null?void 0:function(){return l(d())}]},[e,n,r,i]);var a=HD(t,s[0],s[1]);return KD(function(){o.hasValue=!0,o.value=a},[a]),eZ(a),a};DT.exports=ZT;var tZ=DT.exports;const BT=bk(tZ),nZ={},O1=t=>{let e;const n=new Set,r=(u,f)=>{const d=typeof u=="function"?u(e):u;if(!Object.is(d,e)){const h=e;e=f??(typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(p=>p(e,h))}},i=()=>e,l={setState:r,getState:i,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(nZ?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=e=t(r,i,l);return l},FT=t=>t?O1(t):O1,{useDebugValue:rZ}=D0,{useSyncExternalStoreWithSelector:iZ}=BT,sZ=t=>t;function XT(t,e=sZ,n){const r=iZ(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return rZ(r),r}const y1=(t,e)=>{const n=FT(t),r=(i,s=e)=>XT(n,i,s);return Object.assign(r,n),r},oZ=(t,e)=>t?y1(t,e):y1;function Le(t,e){if(Object.is(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(const[r,i]of t)if(!Object.is(i,e.get(r)))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0}const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(e,r)||!Object.is(t[r],e[r]))return!1;return!0}const ih=Q.createContext(null),aZ=ih.Provider,zT=Hn.error001("react");function be(t,e){const n=Q.useContext(ih);if(n===null)throw new Error(zT);return XT(n,t,e)}function De(){const t=Q.useContext(ih);if(t===null)throw new Error(zT);return Q.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const b1={display:"none"},lZ={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},WT="react-flow__node-desc",UT="react-flow__edge-desc",cZ="react-flow__aria-live",uZ=t=>t.ariaLiveMessage,fZ=t=>t.ariaLabelConfig;function dZ({rfId:t}){const e=be(uZ);return x.jsx("div",{id:`${cZ}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:lZ,children:e})}function hZ({rfId:t,disableKeyboardA11y:e}){const n=be(fZ);return x.jsxs(x.Fragment,{children:[x.jsx("div",{id:`${WT}-${t}`,style:b1,children:e?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),x.jsx("div",{id:`${UT}-${t}`,style:b1,children:n["edge.a11yDescription.default"]}),!e&&x.jsx(dZ,{rfId:t})]})}const wc=Q.forwardRef(({position:t="top-left",children:e,className:n,style:r,...i},s)=>{const o=`${t}`.split("-");return x.jsx("div",{className:tt(["react-flow__panel",n,...o]),style:r,ref:s,...i,children:e})});wc.displayName="Panel";const x1="https://reactflow.dev?utm_source=attribution";function pZ({proOptions:t,position:e="bottom-right"}){return t!=null&&t.hideAttribution?null:x.jsx(wc,{position:e,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${x1}`,children:x.jsx("a",{href:x1,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const mZ=t=>{const e=[],n=[];for(const[,r]of t.nodeLookup)r.selected&&e.push(r.internals.userNode);for(const[,r]of t.edgeLookup)r.selected&&n.push(r);return{selectedNodes:e,selectedEdges:n}},fu=t=>t.id;function gZ(t,e){return Le(t.selectedNodes.map(fu),e.selectedNodes.map(fu))&&Le(t.selectedEdges.map(fu),e.selectedEdges.map(fu))}function OZ({onSelectionChange:t}){const e=De(),{selectedNodes:n,selectedEdges:r}=be(mZ,gZ);return Q.useEffect(()=>{const i={nodes:n,edges:r};t==null||t(i),e.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,t]),null}const yZ=t=>!!t.onSelectionChangeHandlers;function bZ({onSelectionChange:t}){const e=be(yZ);return t||e?x.jsx(OZ,{onSelectionChange:t}):null}const YT=[0,0],xZ={x:0,y:0,zoom:1},vZ=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],v1=[...vZ,"rfId"],wZ=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),w1={translateExtent:Al,nodeOrigin:YT,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function SZ(t){const{setNodes:e,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:o,reset:a,setDefaultNodesAndEdges:l}=be(wZ,Le),c=De();Q.useEffect(()=>(l(t.defaultNodes,t.defaultEdges),()=>{u.current=w1,a()}),[]);const u=Q.useRef(w1);return Q.useEffect(()=>{for(const f of v1){const d=t[f],h=u.current[f];d!==h&&(typeof t[f]>"u"||(f==="nodes"?e(d):f==="edges"?n(d):f==="minZoom"?r(d):f==="maxZoom"?i(d):f==="translateExtent"?s(d):f==="nodeExtent"?o(d):f==="ariaLabelConfig"?c.setState({ariaLabelConfig:GL(d)}):f==="fitView"?c.setState({fitViewQueued:d}):f==="fitViewOptions"?c.setState({fitViewOptions:d}):c.setState({[f]:d})))}u.current=t},v1.map(f=>t[f])),null}function S1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function kZ(t){var r;const[e,n]=Q.useState(t==="system"?null:t);return Q.useEffect(()=>{if(t!=="system"){n(t);return}const i=S1(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[t]),e!==null?e:(r=S1())!=null&&r.matches?"dark":"light"}const k1=typeof document<"u"?document:null;function Ml(t=null,e={target:k1,actInsideInputWithModifier:!0}){const[n,r]=Q.useState(!1),i=Q.useRef(!1),s=Q.useRef(new Set([])),[o,a]=Q.useMemo(()=>{if(t!==null){const c=(Array.isArray(t)?t:[t]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
|
|
57
|
+
`).replace(`
|
|
58
|
+
|
|
59
|
+
`,`
|
|
60
|
+
+`).split(`
|
|
61
|
+
`)),u=c.reduce((f,d)=>f.concat(...d),[]);return[c,u]}return[[],[]]},[t]);return Q.useEffect(()=>{const l=(e==null?void 0:e.target)??k1,c=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const u=h=>{var O,g;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!c)&&wT(h))return!1;const m=T1(h.code,a);if(s.current.add(h[m]),E1(o,s.current,!1)){const b=((g=(O=h.composedPath)==null?void 0:O.call(h))==null?void 0:g[0])||h.target,y=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";e.preventDefault!==!1&&(i.current||!y)&&h.preventDefault(),r(!0)}},f=h=>{const p=T1(h.code,a);E1(o,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(h[p]),h.key==="Meta"&&s.current.clear(),i.current=!1},d=()=>{s.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",u),l==null||l.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{l==null||l.removeEventListener("keydown",u),l==null||l.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[t,r]),n}function E1(t,e,n){return t.filter(r=>n||r.length===e.size).some(r=>r.every(i=>e.has(i)))}function T1(t,e){return e.includes(t)?"code":"key"}const EZ=()=>{const t=De();return Q.useMemo(()=>({zoomIn:async e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,e):!1},zoomOut:async e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,e):!1},zoomTo:async(e,n)=>{const{panZoom:r}=t.getState();return r?r.scaleTo(e,n):!1},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[r,i,s],panZoom:o}=t.getState();return o?(await o.setViewport({x:e.x??r,y:e.y??i,zoom:e.zoom??s},n),!0):!1},getViewport:()=>{const[e,n,r]=t.getState().transform;return{x:e,y:n,zoom:r}},setCenter:async(e,n,r)=>t.getState().setCenter(e,n,r),fitBounds:async(e,n)=>{const{width:r,height:i,minZoom:s,maxZoom:o,panZoom:a}=t.getState(),l=ZO(e,r,i,s,o,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(e,n={})=>{const{transform:r,snapGrid:i,snapToGrid:s,domNode:o}=t.getState();if(!o)return e;const{x:a,y:l}=o.getBoundingClientRect(),c={x:e.x-a,y:e.y-l},u=n.snapGrid??i,f=n.snapToGrid??s;return vc(c,r,f,u)},flowToScreenPosition:e=>{const{transform:n,domNode:r}=t.getState();if(!r)return e;const{x:i,y:s}=r.getBoundingClientRect(),o=Fo(e,n);return{x:o.x+i,y:o.y+s}}}),[])};function GT(t,e){const n=[],r=new Map,i=[];for(const s of t)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const o=r.get(s.id);o?o.push(s):r.set(s.id,[s])}for(const s of e){const o=r.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const a={...s};for(const l of o)TZ(l,a);n.push(a)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function TZ(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function UO(t,e){return GT(t,e)}function YO(t,e){return GT(t,e)}function is(t,e){return{id:t,type:"select",selected:e}}function uo(t,e=new Set,n=!1){const r=[];for(const[i,s]of t){const o=e.has(i);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),r.push(is(s.id,o)))}return r}function N1({items:t=[],lookup:e}){var i;const n=[],r=new Map(t.map(s=>[s.id,s]));for(const[s,o]of t.entries()){const a=e.get(o.id),l=((i=a==null?void 0:a.internals)==null?void 0:i.userNode)??a;l!==void 0&&l!==o&&n.push({id:o.id,item:o,type:"replace"}),l===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of e)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function P1(t){return{id:t.id,type:"remove"}}const NZ=yT();function GO(t,e,n={}){return tD(t,e,{...n,onError:n.onError??NZ})}const _1=t=>VL(t),PZ=t=>hT(t);function HT(t){return Q.forwardRef(t)}const _Z=typeof window<"u"?Q.useLayoutEffect:Q.useEffect;function C1(t){const[e,n]=Q.useState(BigInt(0)),[r]=Q.useState(()=>CZ(()=>n(i=>i+BigInt(1))));return _Z(()=>{const i=r.get();i.length&&(t(i),r.reset())},[e]),r}function CZ(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const qT=Q.createContext(null);function $Z({children:t}){const e=De(),n=Q.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:u,onNodesChange:f,nodeLookup:d,fitViewQueued:h,onNodesChangeMiddlewareMap:p}=e.getState();let m=l;for(const g of a)m=typeof g=="function"?g(m):g;let O=N1({items:m,lookup:d});for(const g of p.values())O=g(O);u&&c(m),O.length>0?f==null||f(O):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:b,setNodes:y}=e.getState();g&&y(b)})},[]),r=C1(n),i=Q.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:u,onEdgesChange:f,edgeLookup:d}=e.getState();let h=l;for(const p of a)h=typeof p=="function"?p(h):p;u?c(h):f&&f(N1({items:h,lookup:d}))},[]),s=C1(i),o=Q.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return x.jsx(qT.Provider,{value:o,children:t})}function AZ(){const t=Q.useContext(qT);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const IZ=t=>!!t.panZoom;function Sc(){const t=EZ(),e=De(),n=AZ(),r=be(IZ),i=Q.useMemo(()=>{const s=f=>e.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},a=f=>{n.edgeQueue.push(f)},l=f=>{var g,b;const{nodeLookup:d,nodeOrigin:h}=e.getState(),p=_1(f)?f:d.get(f.id),m=p.parentId?xT(p.position,p.measured,p.parentId,d,h):p.position,O={...p,position:m,width:((g=p.measured)==null?void 0:g.width)??p.width,height:((b=p.measured)==null?void 0:b.height)??p.height};return Ql(O)},c=(f,d,h={replace:!1})=>{o(p=>p.map(m=>{if(m.id===f){const O=typeof d=="function"?d(m):d;return h.replace&&_1(O)?O:{...m,...O}}return m}))},u=(f,d,h={replace:!1})=>{a(p=>p.map(m=>{if(m.id===f){const O=typeof d=="function"?d(m):d;return h.replace&&PZ(O)?O:{...m,...O}}return m}))};return{getNodes:()=>e.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=s(f))==null?void 0:d.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:f=[]}=e.getState();return f.map(d=>({...d}))},getEdge:f=>e.getState().edgeLookup.get(f),setNodes:o,setEdges:a,addNodes:f=>{const d=Array.isArray(f)?f:[f];n.nodeQueue.push(h=>[...h,...d])},addEdges:f=>{const d=Array.isArray(f)?f:[f];n.edgeQueue.push(h=>[...h,...d])},toObject:()=>{const{nodes:f=[],edges:d=[],transform:h}=e.getState(),[p,m,O]=h;return{nodes:f.map(g=>({...g})),edges:d.map(g=>({...g})),viewport:{x:p,y:m,zoom:O}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:h,edges:p,onNodesDelete:m,onEdgesDelete:O,triggerNodeChanges:g,triggerEdgeChanges:b,onDelete:y,onBeforeDelete:v}=e.getState(),{nodes:S,edges:E}=await zL({nodesToRemove:f,edgesToRemove:d,nodes:h,edges:p,onBeforeDelete:v}),w=E.length>0,k=S.length>0;if(w){const N=E.map(P1);O==null||O(E),b(N)}if(k){const N=S.map(P1);m==null||m(S),g(N)}return(k||w)&&(y==null||y({nodes:S,edges:E})),{deletedNodes:S,deletedEdges:E}},getIntersectingNodes:(f,d=!0,h)=>{const p=i1(f),m=p?f:l(f),O=h!==void 0;return m?(h||e.getState().nodes).filter(g=>{const b=e.getState().nodeLookup.get(g.id);if(b&&!p&&(g.id===f.id||!b.internals.positionAbsolute))return!1;const y=Ql(O?g:b),v=Hf(y,m);return d&&v>0||v>=y.width*y.height||v>=m.width*m.height}):[]},isNodeIntersecting:(f,d,h=!0)=>{const m=i1(f)?f:l(f);if(!m)return!1;const O=Hf(m,d);return h&&O>0||O>=d.width*d.height||O>=m.width*m.height},updateNode:c,updateNodeData:(f,d,h={replace:!1})=>{c(f,p=>{const m=typeof d=="function"?d(p):d;return h.replace?{...p,data:m}:{...p,data:{...p.data,...m}}},h)},updateEdge:u,updateEdgeData:(f,d,h={replace:!1})=>{u(f,p=>{const m=typeof d=="function"?d(p):d;return h.replace?{...p,data:m}:{...p,data:{...p.data,...m}}},h)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:h}=e.getState();return jL(f,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:f,id:d,nodeId:h})=>{var p;return Array.from(((p=e.getState().connectionLookup.get(`${h}-${f}${d?`-${d}`:""}`))==null?void 0:p.values())??[])},getNodeConnections:({type:f,handleId:d,nodeId:h})=>{var p;return Array.from(((p=e.getState().connectionLookup.get(`${h}${f?d?`-${f}-${d}`:`-${f}`:""}`))==null?void 0:p.values())??[])},fitView:async f=>{const d=e.getState().fitViewResolver??YL();return e.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(h=>[...h]),d.promise}}},[]);return Q.useMemo(()=>({...i,...t,viewportInitialized:r}),[r])}const $1=t=>t.selected,QZ=typeof window<"u"?window:void 0;function RZ({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=De(),{deleteElements:r}=Sc(),i=Ml(t,{actInsideInputWithModifier:!1}),s=Ml(e,{target:QZ});Q.useEffect(()=>{if(i){const{edges:o,nodes:a}=n.getState();r({nodes:a.filter($1),edges:o.filter($1)}),n.setState({nodesSelectionActive:!1})}},[i]),Q.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function MZ(t){const e=De();Q.useEffect(()=>{const n=()=>{var i,s,o,a;if(!t.current||!(((s=(i=t.current).checkVisibility)==null?void 0:s.call(i))??!0))return!1;const r=VO(t.current);(r.height===0||r.width===0)&&((a=(o=e.getState()).onError)==null||a.call(o,"004",Hn.error004())),e.setState({width:r.width||500,height:r.height||500})};if(t.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(t.current),()=>{window.removeEventListener("resize",n),r&&t.current&&r.unobserve(t.current)}}},[])}const sh={position:"absolute",width:"100%",height:"100%",top:0,left:0},LZ=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function DZ({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=ys.Free,zoomOnDoubleClick:o=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:u,maxZoom:f,zoomActivationKeyCode:d,preventScrolling:h=!0,children:p,noWheelClassName:m,noPanClassName:O,onViewportChange:g,isControlledViewport:b,paneClickDistance:y,selectionOnDrag:v}){const S=De(),E=Q.useRef(null),{userSelectionActive:w,lib:k,connectionInProgress:N}=be(LZ,Le),$=Ml(d),C=Q.useRef();MZ(E);const _=Q.useCallback(V=>{g==null||g({x:V[0],y:V[1],zoom:V[2]}),b||S.setState({transform:V})},[g,b]);return Q.useEffect(()=>{if(E.current){C.current=$D({domNode:E.current,minZoom:u,maxZoom:f,translateExtent:c,viewport:l,onDraggingChange:R=>S.setState(L=>L.paneDragging===R?L:{paneDragging:R}),onPanZoomStart:(R,L)=>{const{onViewportChangeStart:I,onMoveStart:A}=S.getState();A==null||A(R,L),I==null||I(L)},onPanZoom:(R,L)=>{const{onViewportChange:I,onMove:A}=S.getState();A==null||A(R,L),I==null||I(L)},onPanZoomEnd:(R,L)=>{const{onViewportChangeEnd:I,onMoveEnd:A}=S.getState();A==null||A(R,L),I==null||I(L)}});const{x:V,y:P,zoom:M}=C.current.getViewport();return S.setState({panZoom:C.current,transform:[V,P,M],domNode:E.current.closest(".react-flow")}),()=>{var R;(R=C.current)==null||R.destroy()}}},[]),Q.useEffect(()=>{var V;(V=C.current)==null||V.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:a,zoomActivationKeyPressed:$,preventScrolling:h,noPanClassName:O,userSelectionActive:w,noWheelClassName:m,lib:k,onTransformChange:_,connectionInProgress:N,selectionOnDrag:v,paneClickDistance:y})},[t,e,n,r,i,s,o,a,$,h,O,w,m,k,_,N,v,y]),x.jsx("div",{className:"react-flow__renderer",ref:E,style:sh,children:p})}const ZZ=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function VZ(){const{userSelectionActive:t,userSelectionRect:e}=be(ZZ,Le);return t&&e?x.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const gp=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},jZ=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,dragging:t.paneDragging,panBy:t.panBy,autoPanSpeed:t.autoPanSpeed});function BZ({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Il.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:a,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:p,children:m}){const O=Q.useRef(0),g=De(),{userSelectionActive:b,elementsSelectable:y,dragging:v,panBy:S,autoPanSpeed:E}=be(jZ,Le),w=y&&(t||b),k=Q.useRef(null),N=Q.useRef(),$=Q.useRef(new Set),C=Q.useRef(new Set),_=Q.useRef(!1),V=Q.useRef(!1),P=Q.useRef({x:0,y:0}),M=Q.useRef(!1),R=z=>{if(V.current||_.current||g.getState().connection.inProgress){V.current=!1,_.current=!1;return}c==null||c(z),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},L=z=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){z.preventDefault();return}u==null||u(z)},I=f?z=>f(z):void 0,A=z=>{V.current&&(z.stopPropagation(),V.current=!1)},D=z=>{var we,St;const{domNode:J,transform:ue}=g.getState();if(N.current=J==null?void 0:J.getBoundingClientRect(),!N.current)return;const fe=z.target===k.current;if(!fe&&!!z.target.closest(".nokey")||!t||!(o&&fe||e)||z.button!==0||!z.isPrimary)return;(St=(we=z.target)==null?void 0:we.setPointerCapture)==null||St.call(we,z.pointerId),V.current=!1;const{x:ae,y:de}=Xn(z.nativeEvent,N.current),pe=vc({x:ae,y:de},ue);g.setState({userSelectionRect:{width:0,height:0,startX:pe.x,startY:pe.y,x:ae,y:de}}),fe||(z.stopPropagation(),z.preventDefault())};function B(z,J){const{userSelectionRect:ue}=g.getState();if(!ue)return;const{transform:fe,nodeLookup:oe,edgeLookup:X,connectionLookup:ae,triggerNodeChanges:de,triggerEdgeChanges:pe,defaultEdgeOptions:we}=g.getState(),St={x:ue.startX,y:ue.startY},{x:ir,y:sr}=Fo(St,fe),Ar={startX:St.x,startY:St.y,x:z<ir?z:ir,y:J<sr?J:sr,width:Math.abs(z-ir),height:Math.abs(J-sr)},pa=$.current,Ki=C.current;$.current=new Set(LO(oe,Ar,fe,n===Il.Partial,!0).map($n=>$n.id)),C.current=new Set;const Ji=(we==null?void 0:we.selectable)??!0;for(const $n of $.current){const Ir=ae.get($n);if(Ir)for(const{edgeId:Qr}of Ir.values()){const es=X.get(Qr);es&&(es.selectable??Ji)&&C.current.add(Qr)}}if(!s1(pa,$.current)){const $n=uo(oe,$.current,!0);de($n)}if(!s1(Ki,C.current)){const $n=uo(X,C.current);pe($n)}g.setState({userSelectionRect:Ar,userSelectionActive:!0,nodesSelectionActive:!1})}function F(){if(!i||!N.current)return;const[z,J]=DO(P.current,N.current,E);S({x:z,y:J}).then(ue=>{if(!V.current||!ue){O.current=requestAnimationFrame(F);return}const{x:fe,y:oe}=P.current;B(fe,oe),O.current=requestAnimationFrame(F)})}const q=()=>{cancelAnimationFrame(O.current),O.current=0,M.current=!1};Q.useEffect(()=>()=>q(),[]);const j=z=>{const{userSelectionRect:J,transform:ue,resetSelectedElements:fe}=g.getState();if(!N.current||!J)return;const{x:oe,y:X}=Xn(z.nativeEvent,N.current);P.current={x:oe,y:X};const ae=Fo({x:J.startX,y:J.startY},ue);if(!V.current){const de=e?0:s;if(Math.hypot(oe-ae.x,X-ae.y)<=de)return;fe(),a==null||a(z)}V.current=!0,M.current||(F(),M.current=!0),B(oe,X)},H=z=>{var J,ue;if(!w){z.target===k.current&&g.getState().connection.inProgress&&(_.current=!0);return}z.button===0&&((ue=(J=z.target)==null?void 0:J.releasePointerCapture)==null||ue.call(J,z.pointerId),!b&&z.target===k.current&&g.getState().userSelectionRect&&(R==null||R(z)),g.setState({userSelectionActive:!1,userSelectionRect:null}),V.current&&(l==null||l(z),g.setState({nodesSelectionActive:$.current.size>0})),q())},G=z=>{var J,ue;(ue=(J=z.target)==null?void 0:J.releasePointerCapture)==null||ue.call(J,z.pointerId),q()},ne=r===!0||Array.isArray(r)&&r.includes(0);return x.jsxs("div",{className:tt(["react-flow__pane",{draggable:ne,dragging:v,selection:t}]),onClick:w?void 0:gp(R,k),onContextMenu:gp(L,k),onWheel:gp(I,k),onPointerEnter:w?void 0:d,onPointerMove:w?j:h,onPointerUp:H,onPointerCancel:w?G:void 0,onPointerDownCapture:w?D:void 0,onClickCapture:w?A:void 0,onPointerLeave:p,ref:k,style:sh,children:[m,x.jsx(VZ,{})]})}function vg({id:t,store:e,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:a,onError:l}=e.getState(),c=a.get(t);if(!c){l==null||l("012",Hn.error012(t));return}e.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&o)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):i([t])}function KT({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:o}){const a=De(),[l,c]=Q.useState(!1),u=Q.useRef();return Q.useEffect(()=>{u.current=OD({getStoreItems:()=>a.getState(),onNodeMouseDown:f=>{vg({id:f,store:a,nodeRef:t})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),Q.useEffect(()=>{if(!(e||!t.current||!u.current))return u.current.update({noDragClassName:n,handleSelector:r,domNode:t.current,isSelectable:s,nodeId:i,nodeClickDistance:o}),()=>{var f;(f=u.current)==null||f.destroy()}},[n,r,e,s,t,i,o]),l}const FZ=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function JT(){const t=De();return Q.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:o,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:u}=t.getState(),f=new Map,d=FZ(o),h=i?s[0]:5,p=i?s[1]:5,m=n.direction.x*h*n.factor,O=n.direction.y*p*n.factor;for(const[,g]of c){if(!d(g))continue;let b={x:g.internals.positionAbsolute.x+m,y:g.internals.positionAbsolute.y+O};i&&(b=xc(b,s));const{position:y,positionAbsolute:v}=pT({nodeId:g.id,nextPosition:b,nodeLookup:c,nodeExtent:r,nodeOrigin:u,onError:a});g.position=y,g.internals.positionAbsolute=v,f.set(g.id,g)}l(f)},[])}const HO=Q.createContext(null),XZ=HO.Provider;HO.Consumer;const eN=()=>Q.useContext(HO),zZ=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),tN=Q.createContext(null);function WZ({children:t}){const e=be(zZ,Le);return x.jsx(tN.Provider,{value:e,children:t})}function UZ(){const t=Q.useContext(tN);if(!t)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return t}const YZ={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},GZ=(t,e,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:o}=r,{fromHandle:a,toHandle:l,isValid:c}=o;if(!a&&!i)return YZ;const u=(l==null?void 0:l.nodeId)===t&&(l==null?void 0:l.id)===e&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===t&&(a==null?void 0:a.id)===e&&(a==null?void 0:a.type)===n,connectingTo:u,clickConnecting:(i==null?void 0:i.nodeId)===t&&(i==null?void 0:i.id)===e&&(i==null?void 0:i.type)===n,isPossibleEndHandle:s===jo.Strict?(a==null?void 0:a.type)!==n:t!==(a==null?void 0:a.nodeId)||e!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!i,valid:u&&c}};function HZ({type:t="source",position:e=ce.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:o,onConnect:a,children:l,className:c,onMouseDown:u,onTouchStart:f,...d},h){var M,R;const p=o||null,m=t==="target",O=De(),g=eN(),{connectOnClick:b,noPanClassName:y,rfId:v}=UZ(),{connectingFrom:S,connectingTo:E,clickConnecting:w,isPossibleEndHandle:k,connectionInProcess:N,clickConnectionInProcess:$,valid:C}=be(GZ(g,p,t),Le);g||(R=(M=O.getState()).onError)==null||R.call(M,"010",Hn.error010());const _=L=>{const{defaultEdgeOptions:I,onConnect:A,hasDefaultEdges:D}=O.getState(),B={...I,...L};if(D){const{edges:F,setEdges:q,onError:j}=O.getState();q(GO(B,F,{onError:j}))}A==null||A(B),a==null||a(B)},V=L=>{if(!g)return;const I=ST(L.nativeEvent);if(i&&(I&&L.button===0||!I)){const A=O.getState();xg.onPointerDown(L.nativeEvent,{handleDomNode:L.currentTarget,autoPanOnConnect:A.autoPanOnConnect,connectionMode:A.connectionMode,connectionRadius:A.connectionRadius,domNode:A.domNode,nodeLookup:A.nodeLookup,lib:A.lib,isTarget:m,handleId:p,nodeId:g,flowId:A.rfId,panBy:A.panBy,cancelConnection:A.cancelConnection,onConnectStart:A.onConnectStart,onConnectEnd:(...D)=>{var B,F;return(F=(B=O.getState()).onConnectEnd)==null?void 0:F.call(B,...D)},updateConnection:A.updateConnection,onConnect:_,isValidConnection:n||((...D)=>{var B,F;return((F=(B=O.getState()).isValidConnection)==null?void 0:F.call(B,...D))??!0}),getTransform:()=>O.getState().transform,getFromHandle:()=>O.getState().connection.fromHandle,autoPanSpeed:A.autoPanSpeed,dragThreshold:A.connectionDragThreshold})}I?u==null||u(L):f==null||f(L)},P=L=>{const{onClickConnectStart:I,onClickConnectEnd:A,connectionClickStartHandle:D,connectionMode:B,isValidConnection:F,lib:q,rfId:j,nodeLookup:H,connection:G}=O.getState();if(!g||!D&&!i)return;if(!D){I==null||I(L.nativeEvent,{nodeId:g,handleId:p,handleType:t}),O.setState({connectionClickStartHandle:{nodeId:g,type:t,id:p}});return}const ne=vT(L.target),z=n||F,{connection:J,isValid:ue}=xg.isValid(L.nativeEvent,{handle:{nodeId:g,id:p,type:t},connectionMode:B,fromNodeId:D.nodeId,fromHandleId:D.id||null,fromType:D.type,isValidConnection:z,flowId:j,doc:ne,lib:q,nodeLookup:H});ue&&J&&_(J);const fe=structuredClone(G);delete fe.inProgress,fe.toPosition=fe.toHandle?fe.toHandle.position:null,A==null||A(L,fe),O.setState({connectionClickStartHandle:null})};return x.jsx("div",{"data-handleid":p,"data-nodeid":g,"data-handlepos":e,"data-id":`${v}-${g}-${p}-${t}`,className:tt(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",y,c,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:s,clickconnecting:w,connectingfrom:S,connectingto:E,valid:C,connectionindicator:r&&(!N||k)&&(N||$?s:i)}]),onMouseDown:V,onTouchStart:V,onClick:b?P:void 0,ref:h,...d,children:l})}const Wo=Q.memo(HT(HZ));function qZ({data:t,isConnectable:e,sourcePosition:n=ce.Bottom}){return x.jsxs(x.Fragment,{children:[t==null?void 0:t.label,x.jsx(Wo,{type:"source",position:n,isConnectable:e})]})}function KZ({data:t,isConnectable:e,targetPosition:n=ce.Top,sourcePosition:r=ce.Bottom}){return x.jsxs(x.Fragment,{children:[x.jsx(Wo,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,x.jsx(Wo,{type:"source",position:r,isConnectable:e})]})}function JZ(){return null}function e4({data:t,isConnectable:e,targetPosition:n=ce.Top}){return x.jsxs(x.Fragment,{children:[x.jsx(Wo,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const qf={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},A1={input:qZ,default:KZ,output:e4,group:JZ};function t4(t){var e,n,r,i;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((r=t.style)==null?void 0:r.width),height:t.height??((i=t.style)==null?void 0:i.height)}}const n4=t=>{const{width:e,height:n,x:r,y:i}=bc(t.nodeLookup,{filter:s=>!!s.selected});return{width:Fn(e)?e:null,height:Fn(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${r}px,${i}px)`}};function r4({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const r=De(),{width:i,height:s,transformString:o,userSelectionActive:a}=be(n4,Le),l=JT(),c=Q.useRef(null);Q.useEffect(()=>{var h;n||(h=c.current)==null||h.focus({preventScroll:!0})},[n]);const u=!a&&i!==null&&s!==null;if(KT({nodeRef:c,disabled:!u}),!u)return null;const f=t?h=>{const p=r.getState().nodes.filter(m=>m.selected);t(h,p)}:void 0,d=h=>{Object.prototype.hasOwnProperty.call(qf,h.key)&&(h.preventDefault(),l({direction:qf[h.key],factor:h.shiftKey?4:1}))};return x.jsx("div",{className:tt(["react-flow__nodesselection","react-flow__container",e]),style:{transform:o},children:x.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:i,height:s}})})}const I1=typeof window<"u"?window:void 0,i4=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function nN({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:u,selectionMode:f,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:m,zoomActivationKeyCode:O,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:y,panOnScroll:v,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:w,panOnDrag:k,autoPanOnSelection:N,defaultViewport:$,translateExtent:C,minZoom:_,maxZoom:V,preventScrolling:P,onSelectionContextMenu:M,noWheelClassName:R,noPanClassName:L,disableKeyboardA11y:I,onViewportChange:A,isControlledViewport:D}){const{nodesSelectionActive:B,userSelectionActive:F}=be(i4,Le),q=Ml(c,{target:I1}),j=Ml(m,{target:I1}),H=j||k,G=j||v,ne=u&&H!==!0,z=q||F||ne;return RZ({deleteKeyCode:l,multiSelectionKeyCode:p}),x.jsx(DZ,{onPaneContextMenu:s,elementsSelectable:g,zoomOnScroll:b,zoomOnPinch:y,panOnScroll:G,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:w,panOnDrag:!q&&H,defaultViewport:$,translateExtent:C,minZoom:_,maxZoom:V,zoomActivationKeyCode:O,preventScrolling:P,noWheelClassName:R,noPanClassName:L,onViewportChange:A,isControlledViewport:D,paneClickDistance:a,selectionOnDrag:ne,children:x.jsxs(BZ,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:H,autoPanOnSelection:N,isSelecting:!!z,selectionMode:f,selectionKeyPressed:q,paneClickDistance:a,selectionOnDrag:ne,children:[t,B&&x.jsx(r4,{onSelectionContextMenu:M,noPanClassName:L,disableKeyboardA11y:I})]})})}nN.displayName="FlowRenderer";const s4=Q.memo(nN),o4=t=>e=>t?LO(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function a4(t){return be(Q.useCallback(o4(t),[t]),Le)}const l4=t=>t.updateNodeInternals;function c4(){const t=be(l4),[e]=Q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),t(r)}));return Q.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function u4({node:t,nodeType:e,hasDimensions:n,resizeObserver:r}){const i=De(),s=Q.useRef(null),o=Q.useRef(null),a=Q.useRef(t.sourcePosition),l=Q.useRef(t.targetPosition),c=Q.useRef(e),u=n&&!!t.internals.handleBounds;return Q.useEffect(()=>{s.current&&!t.hidden&&(!u||o.current!==s.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(s.current),o.current=s.current)},[u,t.hidden]),Q.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),Q.useEffect(()=>{if(s.current){const f=c.current!==e,d=a.current!==t.sourcePosition,h=l.current!==t.targetPosition;(f||d||h)&&(c.current=e,a.current=t.sourcePosition,l.current=t.targetPosition,i.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:s.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),s}function f4({id:t,onClick:e,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:o,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:u,resizeObserver:f,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:p,rfId:m,nodeTypes:O,nodeClickDistance:g,onError:b}){const{node:y,internals:v,isParent:S}=be(z=>{const J=z.nodeLookup.get(t),ue=z.parentLookup.has(t);return{node:J,internals:J.internals,isParent:ue}},Le);let E=y.type||"default",w=(O==null?void 0:O[E])||A1[E];w===void 0&&(b==null||b("003",Hn.error003(E)),E="default",w=(O==null?void 0:O.default)||A1.default);const k=!!(y.draggable||a&&typeof y.draggable>"u"),N=!!(y.selectable||l&&typeof y.selectable>"u"),$=!!(y.connectable||c&&typeof y.connectable>"u"),C=!!(y.focusable||u&&typeof y.focusable>"u"),_=De(),V=bT(y),P=u4({node:y,nodeType:E,hasDimensions:V,resizeObserver:f}),M=KT({nodeRef:P,disabled:y.hidden||!k,noDragClassName:d,handleSelector:y.dragHandle,nodeId:t,isSelectable:N,nodeClickDistance:g}),R=JT();if(y.hidden)return null;const L=oi(y),I=t4(y),A=N||k||e||n||r||i,D=n?z=>n(z,{...v.userNode}):void 0,B=r?z=>r(z,{...v.userNode}):void 0,F=i?z=>i(z,{...v.userNode}):void 0,q=s?z=>s(z,{...v.userNode}):void 0,j=o?z=>o(z,{...v.userNode}):void 0,H=z=>{const{selectNodesOnDrag:J,nodeDragThreshold:ue}=_.getState();N&&(!J||!k||ue>0)&&vg({id:t,store:_,nodeRef:P}),e&&e(z,{...v.userNode})},G=z=>{if(!(wT(z.nativeEvent)||p)){if(cT.includes(z.key)&&N){const J=z.key==="Escape";vg({id:t,store:_,unselect:J,nodeRef:P})}else if(k&&y.selected&&Object.prototype.hasOwnProperty.call(qf,z.key)){z.preventDefault();const{ariaLabelConfig:J}=_.getState();_.setState({ariaLiveMessage:J["node.a11yDescription.ariaLiveMessage"]({direction:z.key.replace("Arrow","").toLowerCase(),x:~~v.positionAbsolute.x,y:~~v.positionAbsolute.y})}),R({direction:qf[z.key],factor:z.shiftKey?4:1})}}},ne=()=>{var ae;if(p||!((ae=P.current)!=null&&ae.matches(":focus-visible")))return;const{transform:z,width:J,height:ue,autoPanOnNodeFocus:fe,setCenter:oe}=_.getState();if(!fe)return;LO(new Map([[t,y]]),{x:0,y:0,width:J,height:ue},z,!0).length>0||oe(y.position.x+L.width/2,y.position.y+L.height/2,{zoom:z[2]})};return x.jsx("div",{className:tt(["react-flow__node",`react-flow__node-${E}`,{[h]:k},y.className,{selected:y.selected,selectable:N,parent:S,draggable:k,dragging:M}]),ref:P,style:{zIndex:v.z,transform:`translate(${v.positionAbsolute.x}px,${v.positionAbsolute.y}px)`,pointerEvents:A?"all":"none",visibility:V?"visible":"hidden",...y.style,...I},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:D,onMouseMove:B,onMouseLeave:F,onContextMenu:q,onClick:H,onDoubleClick:j,onKeyDown:C?G:void 0,tabIndex:C?0:void 0,onFocus:C?ne:void 0,role:y.ariaRole??(C?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${WT}-${m}`,"aria-label":y.ariaLabel,...y.domAttributes,children:x.jsx(XZ,{value:t,children:x.jsx(w,{id:t,data:y.data,type:E,positionAbsoluteX:v.positionAbsolute.x,positionAbsoluteY:v.positionAbsolute.y,selected:y.selected??!1,selectable:N,draggable:k,deletable:y.deletable??!0,isConnectable:$,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:M,dragHandle:y.dragHandle,zIndex:v.z,parentId:y.parentId,...L})})})}var d4=Q.memo(f4);const h4=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function rN(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=be(h4,Le),o=a4(t.onlyRenderVisibleElements),a=c4();return x.jsx("div",{className:"react-flow__nodes",style:sh,children:o.map(l=>x.jsx(d4,{id:l,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:t.nodeClickDistance,onError:s},l))})}rN.displayName="NodeRenderer";const p4=Q.memo(rN);function m4(t){return be(Q.useCallback(n=>{if(!t)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);s&&o&&KL({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[t]),Le)}const g4=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return x.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},O4=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return x.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Q1={[Yf.Arrow]:g4,[Yf.ArrowClosed]:O4};function y4(t){const e=De();return Q.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(Q1,t)?Q1[t]:((s=(i=e.getState()).onError)==null||s.call(i,"009",Hn.error009(t)),null)},[t])}const b4=({id:t,type:e,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:a="auto-start-reverse"})=>{const l=y4(e);return l?x.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:a,refX:"0",refY:"0",children:x.jsx(l,{color:n,strokeWidth:o})}):null},iN=({defaultColor:t,rfId:e})=>{const n=be(s=>s.edges),r=be(s=>s.defaultEdgeOptions),i=Q.useMemo(()=>oD(n,{id:e,defaultColor:t,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,e,t]);return i.length?x.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:x.jsx("defs",{children:i.map(s=>x.jsx(b4,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};iN.displayName="MarkerDefinitions";var x4=Q.memo(iN);function sN({x:t,y:e,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...u}){const[f,d]=Q.useState({x:1,y:0,width:0,height:0}),h=tt(["react-flow__edge-textwrapper",c]),p=Q.useRef(null);return Q.useEffect(()=>{if(p.current){const m=p.current.getBBox();d({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),n?x.jsxs("g",{transform:`translate(${t-f.width/2} ${e-f.height/2})`,className:h,visibility:f.width?"visible":"hidden",...u,children:[i&&x.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:a,ry:a}),x.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:r,children:n}),l]}):null}sN.displayName="EdgeText";const v4=Q.memo(sN);function kc({path:t,labelX:e,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return x.jsxs(x.Fragment,{children:[x.jsx("path",{...u,d:t,fill:"none",className:tt(["react-flow__edge-path",u.className])}),c?x.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&Fn(e)&&Fn(n)?x.jsx(v4,{x:e,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function R1({pos:t,x1:e,y1:n,x2:r,y2:i}){return t===ce.Left||t===ce.Right?[.5*(e+r),n]:[e,.5*(n+i)]}function oN({sourceX:t,sourceY:e,sourcePosition:n=ce.Bottom,targetX:r,targetY:i,targetPosition:s=ce.Top}){const[o,a]=R1({pos:n,x1:t,y1:e,x2:r,y2:i}),[l,c]=R1({pos:s,x1:r,y1:i,x2:t,y2:e}),[u,f,d,h]=kT({sourceX:t,sourceY:e,targetX:r,targetY:i,sourceControlX:o,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${t},${e} C${o},${a} ${l},${c} ${r},${i}`,u,f,d,h]}function aN(t){return Q.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o,targetPosition:a,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:O,interactionWidth:g})=>{const[b,y,v]=oN({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:a}),S=t.isInternal?void 0:e;return x.jsx(kc,{id:S,path:b,labelX:y,labelY:v,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:O,interactionWidth:g})})}const w4=aN({isInternal:!1}),lN=aN({isInternal:!0});w4.displayName="SimpleBezierEdge";lN.displayName="SimpleBezierEdgeInternal";function cN(t){return Q.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,sourcePosition:h=ce.Bottom,targetPosition:p=ce.Top,markerEnd:m,markerStart:O,pathOptions:g,interactionWidth:b})=>{const[y,v,S]=Og({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:s,targetPosition:p,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),E=t.isInternal?void 0:e;return x.jsx(kc,{id:E,path:y,labelX:v,labelY:S,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:m,markerStart:O,interactionWidth:b})})}const uN=cN({isInternal:!1}),fN=cN({isInternal:!0});uN.displayName="SmoothStepEdge";fN.displayName="SmoothStepEdgeInternal";function dN(t){return Q.memo(({id:e,...n})=>{var i;const r=t.isInternal?void 0:e;return x.jsx(uN,{...n,id:r,pathOptions:Q.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const S4=dN({isInternal:!1}),hN=dN({isInternal:!0});S4.displayName="StepEdge";hN.displayName="StepEdgeInternal";function pN(t){return Q.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[O,g,b]=TT({sourceX:n,sourceY:r,targetX:i,targetY:s}),y=t.isInternal?void 0:e;return x.jsx(kc,{id:y,path:O,labelX:g,labelY:b,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:m})})}const k4=pN({isInternal:!1}),mN=pN({isInternal:!0});k4.displayName="StraightEdge";mN.displayName="StraightEdgeInternal";function gN(t){return Q.memo(({id:e,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=ce.Bottom,targetPosition:a=ce.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:O,pathOptions:g,interactionWidth:b})=>{const[y,v,S]=jO({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:a,curvature:g==null?void 0:g.curvature}),E=t.isInternal?void 0:e;return x.jsx(kc,{id:E,path:y,labelX:v,labelY:S,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:m,markerStart:O,interactionWidth:b})})}const E4=gN({isInternal:!1}),ON=gN({isInternal:!0});E4.displayName="BezierEdge";ON.displayName="BezierEdgeInternal";const M1={default:ON,straight:mN,step:hN,smoothstep:fN,simplebezier:lN},L1={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},T4=(t,e,n)=>n===ce.Left?t-e:n===ce.Right?t+e:t,N4=(t,e,n)=>n===ce.Top?t-e:n===ce.Bottom?t+e:t,D1="react-flow__edgeupdater";function Z1({position:t,centerX:e,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:o,type:a}){return x.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:o,className:tt([D1,`${D1}-${a}`]),cx:T4(e,r,t),cy:N4(n,r,t),r,stroke:"transparent",fill:"transparent"})}function P4({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:o,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:f,setReconnecting:d,setUpdateHover:h}){const p=De(),m=(v,S)=>{if(v.button!==0)return;const{autoPanOnConnect:E,domNode:w,connectionMode:k,connectionRadius:N,lib:$,onConnectStart:C,cancelConnection:_,nodeLookup:V,rfId:P,panBy:M,updateConnection:R}=p.getState(),L=S.type==="target",I=(B,F)=>{d(!1),f==null||f(B,n,S.type,F)},A=B=>c==null?void 0:c(n,B),D=(B,F)=>{d(!0),u==null||u(v,n,S.type),C==null||C(B,F)};xg.onPointerDown(v.nativeEvent,{autoPanOnConnect:E,connectionMode:k,connectionRadius:N,domNode:w,handleId:S.id,nodeId:S.nodeId,nodeLookup:V,isTarget:L,edgeUpdaterType:S.type,lib:$,flowId:P,cancelConnection:_,panBy:M,isValidConnection:(...B)=>{var F,q;return((q=(F=p.getState()).isValidConnection)==null?void 0:q.call(F,...B))??!0},onConnect:A,onConnectStart:D,onConnectEnd:(...B)=>{var F,q;return(q=(F=p.getState()).onConnectEnd)==null?void 0:q.call(F,...B)},onReconnectEnd:I,updateConnection:R,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:v.currentTarget})},O=v=>m(v,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=v=>m(v,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),b=()=>h(!0),y=()=>h(!1);return x.jsxs(x.Fragment,{children:[(t===!0||t==="source")&&x.jsx(Z1,{position:a,centerX:r,centerY:i,radius:e,onMouseDown:O,onMouseEnter:b,onMouseOut:y,type:"source"}),(t===!0||t==="target")&&x.jsx(Z1,{position:l,centerX:s,centerY:o,radius:e,onMouseDown:g,onMouseEnter:b,onMouseOut:y,type:"target"})]})}function _4({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:o,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,rfId:p,edgeTypes:m,noPanClassName:O,onError:g,disableKeyboardA11y:b}){let y=be(oe=>oe.edgeLookup.get(t));const v=be(oe=>oe.defaultEdgeOptions);y=v?{...v,...y}:y;let S=y.type||"default",E=(m==null?void 0:m[S])||M1[S];E===void 0&&(g==null||g("011",Hn.error011(S)),S="default",E=(m==null?void 0:m.default)||M1.default);const w=!!(y.focusable||e&&typeof y.focusable>"u"),k=typeof f<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),N=!!(y.selectable||r&&typeof y.selectable>"u"),$=Q.useRef(null),[C,_]=Q.useState(!1),[V,P]=Q.useState(!1),M=De(),{zIndex:R=y.zIndex,sourceX:L,sourceY:I,targetX:A,targetY:D,sourcePosition:B,targetPosition:F}=be(Q.useCallback(oe=>{const X=oe.nodeLookup.get(y.source),ae=oe.nodeLookup.get(y.target);if(!X||!ae)return L1;const de=sD({id:t,sourceNode:X,targetNode:ae,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:oe.connectionMode,onError:g}),pe=qL({selected:y.selected,zIndex:y.zIndex,sourceNode:X,targetNode:ae,elevateOnSelect:oe.elevateEdgesOnSelect,zIndexMode:oe.zIndexMode});return{...de||L1,zIndex:pe}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),Le),q=Q.useMemo(()=>y.markerStart?`url('#${yg(y.markerStart,p)}')`:void 0,[y.markerStart,p]),j=Q.useMemo(()=>y.markerEnd?`url('#${yg(y.markerEnd,p)}')`:void 0,[y.markerEnd,p]);if(y.hidden||L===null||I===null||A===null||D===null)return null;const H=oe=>{var pe;const{addSelectedEdges:X,unselectNodesAndEdges:ae,multiSelectionActive:de}=M.getState();N&&(M.setState({nodesSelectionActive:!1}),y.selected&&de?(ae({nodes:[],edges:[y]}),(pe=$.current)==null||pe.blur()):X([t])),i&&i(oe,y)},G=s?oe=>{s(oe,{...y})}:void 0,ne=o?oe=>{o(oe,{...y})}:void 0,z=a?oe=>{a(oe,{...y})}:void 0,J=l?oe=>{l(oe,{...y})}:void 0,ue=c?oe=>{c(oe,{...y})}:void 0,fe=oe=>{var X;if(!b&&cT.includes(oe.key)&&N){const{unselectNodesAndEdges:ae,addSelectedEdges:de}=M.getState();oe.key==="Escape"?((X=$.current)==null||X.blur(),ae({edges:[y]})):de([t])}};return x.jsx("svg",{style:{zIndex:R},children:x.jsxs("g",{className:tt(["react-flow__edge",`react-flow__edge-${S}`,y.className,O,{selected:y.selected,animated:y.animated,inactive:!N&&!i,updating:C,selectable:N}]),onClick:H,onDoubleClick:G,onContextMenu:ne,onMouseEnter:z,onMouseMove:J,onMouseLeave:ue,onKeyDown:w?fe:void 0,tabIndex:w?0:void 0,role:y.ariaRole??(w?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":w?`${UT}-${p}`:void 0,ref:$,...y.domAttributes,children:[!V&&x.jsx(E,{id:t,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:N,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:L,sourceY:I,targetX:A,targetY:D,sourcePosition:B,targetPosition:F,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:q,markerEnd:j,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),k&&x.jsx(P4,{edge:y,isReconnectable:k,reconnectRadius:u,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,sourceX:L,sourceY:I,targetX:A,targetY:D,sourcePosition:B,targetPosition:F,setUpdateHover:_,setReconnecting:P})]})})}var C4=Q.memo(_4);const $4=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function yN({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:u,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:m}){const{edgesFocusable:O,edgesReconnectable:g,elementsSelectable:b,onError:y}=be($4,Le),v=m4(e);return x.jsxs("div",{className:"react-flow__edges",children:[x.jsx(x4,{defaultColor:t,rfId:n}),v.map(S=>x.jsx(C4,{id:S,edgesFocusable:O,edgesReconnectable:g,elementsSelectable:b,noPanClassName:i,onReconnect:s,onContextMenu:o,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:u,reconnectRadius:f,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:m},S))]})}yN.displayName="EdgeRenderer";const A4=Q.memo(yN),I4=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function Q4({children:t}){const e=be(I4);return x.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function R4(t){const e=Sc(),n=Q.useRef(!1);Q.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const M4=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function L4(t){const e=be(M4),n=De();return Q.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function D4(t){return t.connection.inProgress?{...t.connection,to:vc(t.connection.to,t.transform)}:{...t.connection}}function Z4(t){return D4}function V4(t){const e=Z4();return be(e,Le)}const j4=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function B4({containerStyle:t,style:e,type:n,component:r}){const{nodesConnectable:i,width:s,height:o,isValid:a,inProgress:l}=be(j4,Le);return!(s&&i&&l)?null:x.jsx("svg",{style:t,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:x.jsx("g",{className:tt(["react-flow__connection",dT(a)]),children:x.jsx(bN,{style:e,type:n,CustomComponent:r,isValid:a})})})}const bN=({style:t,type:e=bi.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:o,fromHandle:a,fromPosition:l,to:c,toNode:u,toHandle:f,toPosition:d,pointer:h}=V4();if(!i)return;if(n)return x.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:o,fromHandle:a,fromX:s.x,fromY:s.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:d,connectionStatus:dT(r),toNode:u,toHandle:f,pointer:h});let p="";const m={sourceX:s.x,sourceY:s.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:d};switch(e){case bi.Bezier:[p]=jO(m);break;case bi.SimpleBezier:[p]=oN(m);break;case bi.Step:[p]=Og({...m,borderRadius:0});break;case bi.SmoothStep:[p]=Og(m);break;default:[p]=TT(m)}return x.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:t})};bN.displayName="ConnectionLine";const F4={};function V1(t=F4){Q.useRef(t),De(),Q.useEffect(()=>{},[t])}function X4(){De(),Q.useRef(!1),Q.useEffect(()=>{},[])}function xN({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:m,connectionLineComponent:O,connectionLineContainerStyle:g,selectionKeyCode:b,selectionOnDrag:y,selectionMode:v,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:w,deleteKeyCode:k,onlyRenderVisibleElements:N,elementsSelectable:$,defaultViewport:C,translateExtent:_,minZoom:V,maxZoom:P,preventScrolling:M,defaultMarkerColor:R,zoomOnScroll:L,zoomOnPinch:I,panOnScroll:A,panOnScrollSpeed:D,panOnScrollMode:B,zoomOnDoubleClick:F,panOnDrag:q,autoPanOnSelection:j,onPaneClick:H,onPaneMouseEnter:G,onPaneMouseMove:ne,onPaneMouseLeave:z,onPaneScroll:J,onPaneContextMenu:ue,paneClickDistance:fe,nodeClickDistance:oe,onEdgeContextMenu:X,onEdgeMouseEnter:ae,onEdgeMouseMove:de,onEdgeMouseLeave:pe,reconnectRadius:we,onReconnect:St,onReconnectStart:ir,onReconnectEnd:sr,noDragClassName:Ar,noWheelClassName:pa,noPanClassName:Ki,disableKeyboardA11y:Ji,nodeExtent:$n,rfId:Ir,viewport:Qr,onViewportChange:es}){return V1(t),V1(e),X4(),R4(n),L4(Qr),x.jsx(s4,{onPaneClick:H,onPaneMouseEnter:G,onPaneMouseMove:ne,onPaneMouseLeave:z,onPaneContextMenu:ue,onPaneScroll:J,paneClickDistance:fe,deleteKeyCode:k,selectionKeyCode:b,selectionOnDrag:y,selectionMode:v,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:w,elementsSelectable:$,zoomOnScroll:L,zoomOnPinch:I,zoomOnDoubleClick:F,panOnScroll:A,panOnScrollSpeed:D,panOnScrollMode:B,panOnDrag:q,autoPanOnSelection:j,defaultViewport:C,translateExtent:_,minZoom:V,maxZoom:P,onSelectionContextMenu:f,preventScrolling:M,noDragClassName:Ar,noWheelClassName:pa,noPanClassName:Ki,disableKeyboardA11y:Ji,onViewportChange:es,isControlledViewport:!!Qr,children:x.jsxs(Q4,{children:[x.jsx(A4,{edgeTypes:e,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:St,onReconnectStart:ir,onReconnectEnd:sr,onlyRenderVisibleElements:N,onEdgeContextMenu:X,onEdgeMouseEnter:ae,onEdgeMouseMove:de,onEdgeMouseLeave:pe,reconnectRadius:we,defaultMarkerColor:R,noPanClassName:Ki,disableKeyboardA11y:Ji,rfId:Ir}),x.jsx(B4,{style:m,type:p,component:O,containerStyle:g}),x.jsx("div",{className:"react-flow__edgelabel-renderer"}),x.jsx(p4,{nodeTypes:t,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:u,nodeClickDistance:oe,onlyRenderVisibleElements:N,noPanClassName:Ki,noDragClassName:Ar,disableKeyboardA11y:Ji,nodeExtent:$n,rfId:Ir}),x.jsx("div",{className:"react-flow__viewport-portal"})]})})}xN.displayName="GraphView";const z4=Q.memo(xN),W4=yT(),j1=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:f,zIndexMode:d="basic"}={})=>{const h=new Map,p=new Map,m=new Map,O=new Map,g=r??e??[],b=n??t??[],y=u??[0,0],v=f??Al;_T(m,O,g);const{nodesInitialized:S}=bg(b,h,p,{nodeOrigin:y,nodeExtent:v,zIndexMode:d});let E=[0,0,1];if(o&&i&&s){const w=bc(h,{filter:C=>!!((C.width||C.initialWidth)&&(C.height||C.initialHeight))}),{x:k,y:N,zoom:$}=ZO(w,i,s,l,c,(a==null?void 0:a.padding)??.1);E=[k,N,$]}return{rfId:"1",width:i??0,height:s??0,transform:E,nodes:b,nodesInitialized:S,nodeLookup:h,parentLookup:p,edges:g,edgeLookup:O,connectionLookup:m,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:Al,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:jo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:a,fitViewResolver:null,connection:{...fT},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:W4,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:uT,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},U4=({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d})=>oZ((h,p)=>{async function m(){const{nodeLookup:O,panZoom:g,fitViewOptions:b,fitViewResolver:y,width:v,height:S,minZoom:E,maxZoom:w}=p();g&&(await XL({nodes:O,width:v,height:S,panZoom:g,minZoom:E,maxZoom:w},b),y==null||y.resolve(!0),h({fitViewResolver:null}))}return{...j1({nodes:t,edges:e,width:i,height:s,fitView:o,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:d}),setNodes:O=>{const{nodeLookup:g,parentLookup:b,nodeOrigin:y,elevateNodesOnSelect:v,fitViewQueued:S,zIndexMode:E,nodesSelectionActive:w}=p(),{nodesInitialized:k,hasSelectedNodes:N}=bg(O,g,b,{nodeOrigin:y,nodeExtent:f,elevateNodesOnSelect:v,checkEquality:!0,zIndexMode:E}),$=w&&N;S&&k?(m(),h({nodes:O,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:$})):h({nodes:O,nodesInitialized:k,nodesSelectionActive:$})},setEdges:O=>{const{connectionLookup:g,edgeLookup:b}=p();_T(g,b,O),h({edges:O})},setDefaultNodesAndEdges:(O,g)=>{if(O){const{setNodes:b}=p();b(O),h({hasDefaultNodes:!0})}if(g){const{setEdges:b}=p();b(g),h({hasDefaultEdges:!0})}},updateNodeInternals:O=>{const{triggerNodeChanges:g,nodeLookup:b,parentLookup:y,domNode:v,nodeOrigin:S,nodeExtent:E,debug:w,fitViewQueued:k,zIndexMode:N}=p(),{changes:$,updatedInternals:C}=hD(O,b,y,v,S,E,N);C&&(cD(b,y,{nodeOrigin:S,nodeExtent:E,zIndexMode:N}),k?(m(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),($==null?void 0:$.length)>0&&(w&&console.log("React Flow: trigger node changes",$),g==null||g($)))},updateNodePositions:(O,g=!1)=>{const b=[];let y=[];const{nodeLookup:v,triggerNodeChanges:S,connection:E,updateConnection:w,onNodesChangeMiddlewareMap:k}=p();for(const[N,$]of O){const C=v.get(N),_=!!(C!=null&&C.expandParent&&(C!=null&&C.parentId)&&($!=null&&$.position)),V={id:N,type:"position",position:_?{x:Math.max(0,$.position.x),y:Math.max(0,$.position.y)}:$.position,dragging:g};if(C&&E.inProgress&&E.fromNode.id===C.id){const P=As(C,E.fromHandle,ce.Left,!0);w({...E,from:P})}_&&C.parentId&&b.push({id:N,parentId:C.parentId,rect:{...$.internals.positionAbsolute,width:$.measured.width??0,height:$.measured.height??0}}),y.push(V)}if(b.length>0){const{parentLookup:N,nodeOrigin:$}=p(),C=WO(b,v,N,$);y.push(...C)}for(const N of k.values())y=N(y);S(y)},triggerNodeChanges:O=>{const{onNodesChange:g,setNodes:b,nodes:y,hasDefaultNodes:v,debug:S}=p();if(O!=null&&O.length){if(v){const E=UO(O,y);b(E)}S&&console.log("React Flow: trigger node changes",O),g==null||g(O)}},triggerEdgeChanges:O=>{const{onEdgesChange:g,setEdges:b,edges:y,hasDefaultEdges:v,debug:S}=p();if(O!=null&&O.length){if(v){const E=YO(O,y);b(E)}S&&console.log("React Flow: trigger edge changes",O),g==null||g(O)}},addSelectedNodes:O=>{const{multiSelectionActive:g,edgeLookup:b,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=p();if(g){const E=O.map(w=>is(w,!0));v(E);return}v(uo(y,new Set([...O]),!0)),S(uo(b))},addSelectedEdges:O=>{const{multiSelectionActive:g,edgeLookup:b,nodeLookup:y,triggerNodeChanges:v,triggerEdgeChanges:S}=p();if(g){const E=O.map(w=>is(w,!0));S(E);return}S(uo(b,new Set([...O]))),v(uo(y,new Set,!0))},unselectNodesAndEdges:({nodes:O,edges:g}={})=>{const{edges:b,nodes:y,nodeLookup:v,triggerNodeChanges:S,triggerEdgeChanges:E}=p(),w=O||y,k=g||b,N=[];for(const C of w){if(!C.selected)continue;const _=v.get(C.id);_&&(_.selected=!1),N.push(is(C.id,!1))}const $=[];for(const C of k)C.selected&&$.push(is(C.id,!1));S(N),E($)},setMinZoom:O=>{const{panZoom:g,maxZoom:b}=p();g==null||g.setScaleExtent([O,b]),h({minZoom:O})},setMaxZoom:O=>{const{panZoom:g,minZoom:b}=p();g==null||g.setScaleExtent([b,O]),h({maxZoom:O})},setTranslateExtent:O=>{var g;(g=p().panZoom)==null||g.setTranslateExtent(O),h({translateExtent:O})},resetSelectedElements:()=>{const{edges:O,nodes:g,triggerNodeChanges:b,triggerEdgeChanges:y,elementsSelectable:v}=p();if(!v)return;const S=g.reduce((w,k)=>k.selected?[...w,is(k.id,!1)]:w,[]),E=O.reduce((w,k)=>k.selected?[...w,is(k.id,!1)]:w,[]);b(S),y(E)},setNodeExtent:O=>{const{nodes:g,nodeLookup:b,parentLookup:y,nodeOrigin:v,elevateNodesOnSelect:S,nodeExtent:E,zIndexMode:w}=p();O[0][0]===E[0][0]&&O[0][1]===E[0][1]&&O[1][0]===E[1][0]&&O[1][1]===E[1][1]||(bg(g,b,y,{nodeOrigin:v,nodeExtent:O,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:w}),h({nodeExtent:O}))},panBy:O=>{const{transform:g,width:b,height:y,panZoom:v,translateExtent:S}=p();return pD({delta:O,panZoom:v,transform:g,translateExtent:S,width:b,height:y})},setCenter:async(O,g,b)=>{const{width:y,height:v,maxZoom:S,panZoom:E}=p();if(!E)return!1;const w=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:S;return await E.setViewport({x:y/2-O*w,y:v/2-g*w,zoom:w},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),!0},cancelConnection:()=>{h({connection:{...fT}})},updateConnection:O=>{h({connection:O})},reset:()=>h({...j1()})}},Object.is);function qO({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:o,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:u,nodeExtent:f,zIndexMode:d,children:h}){const[p]=Q.useState(()=>U4({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:c,minZoom:o,maxZoom:a,fitViewOptions:l,nodeOrigin:u,nodeExtent:f,zIndexMode:d}));return x.jsx(aZ,{value:p,children:x.jsx($Z,{children:x.jsx(WZ,{children:h})})})}function Y4({children:t,nodes:e,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:o,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:h}){return Q.useContext(ih)?x.jsx(x.Fragment,{children:t}):x.jsx(qO,{initialNodes:e,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:o,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:u,nodeOrigin:f,nodeExtent:d,zIndexMode:h,children:t})}const G4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function H4({nodes:t,edges:e,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:o,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:O,onClickConnectEnd:g,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:E,onNodeDragStart:w,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:$,onEdgesDelete:C,onDelete:_,onSelectionChange:V,onSelectionDragStart:P,onSelectionDrag:M,onSelectionDragStop:R,onSelectionContextMenu:L,onSelectionStart:I,onSelectionEnd:A,onBeforeDelete:D,connectionMode:B,connectionLineType:F=bi.Bezier,connectionLineStyle:q,connectionLineComponent:j,connectionLineContainerStyle:H,deleteKeyCode:G="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:z=!1,selectionMode:J=Il.Full,panActivationKeyCode:ue="Space",multiSelectionKeyCode:fe=Rl()?"Meta":"Control",zoomActivationKeyCode:oe=Rl()?"Meta":"Control",snapToGrid:X,snapGrid:ae,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:pe,nodesDraggable:we,autoPanOnNodeFocus:St,nodesConnectable:ir,nodesFocusable:sr,nodeOrigin:Ar=YT,edgesFocusable:pa,edgesReconnectable:Ki,elementsSelectable:Ji=!0,defaultViewport:$n=xZ,minZoom:Ir=.5,maxZoom:Qr=2,translateExtent:es=Al,preventScrolling:CA=!0,nodeExtent:Qh,defaultMarkerColor:$A="#b1b1b7",zoomOnScroll:AA=!0,zoomOnPinch:IA=!0,panOnScroll:QA=!1,panOnScrollSpeed:RA=.5,panOnScrollMode:MA=ys.Free,zoomOnDoubleClick:LA=!0,panOnDrag:DA=!0,onPaneClick:ZA,onPaneMouseEnter:VA,onPaneMouseMove:jA,onPaneMouseLeave:BA,onPaneScroll:FA,onPaneContextMenu:XA,paneClickDistance:zA=1,nodeClickDistance:WA=0,children:UA,onReconnect:YA,onReconnectStart:GA,onReconnectEnd:HA,onEdgeContextMenu:qA,onEdgeDoubleClick:KA,onEdgeMouseEnter:JA,onEdgeMouseMove:eI,onEdgeMouseLeave:tI,reconnectRadius:nI=10,onNodesChange:rI,onEdgesChange:iI,noDragClassName:sI="nodrag",noWheelClassName:oI="nowheel",noPanClassName:Sb="nopan",fitView:kb,fitViewOptions:Eb,connectOnClick:aI,attributionPosition:lI,proOptions:cI,defaultEdgeOptions:uI,elevateNodesOnSelect:fI=!0,elevateEdgesOnSelect:dI=!1,disableKeyboardA11y:Tb=!1,autoPanOnConnect:hI,autoPanOnNodeDrag:pI,autoPanOnSelection:mI=!0,autoPanSpeed:gI,connectionRadius:OI,isValidConnection:yI,onError:bI,style:xI,id:Nb,nodeDragThreshold:vI,connectionDragThreshold:wI,viewport:SI,onViewportChange:kI,width:EI,height:TI,colorMode:NI="light",debug:PI,onScroll:Vc,ariaLabelConfig:_I,zIndexMode:Pb="basic",...CI},$I){const Rh=Nb||"1",AI=kZ(NI),II=Q.useCallback(_b=>{_b.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Vc==null||Vc(_b)},[Vc]);return x.jsx("div",{"data-testid":"rf__wrapper",...CI,onScroll:II,style:{...xI,...G4},ref:$I,className:tt(["react-flow",i,AI]),id:Nb,role:"application",children:x.jsxs(Y4,{nodes:t,edges:e,width:EI,height:TI,fitView:kb,fitViewOptions:Eb,minZoom:Ir,maxZoom:Qr,nodeOrigin:Ar,nodeExtent:Qh,zIndexMode:Pb,children:[x.jsx(SZ,{nodes:t,edges:e,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:O,onClickConnectEnd:g,nodesDraggable:we,autoPanOnNodeFocus:St,nodesConnectable:ir,nodesFocusable:sr,edgesFocusable:pa,edgesReconnectable:Ki,elementsSelectable:Ji,elevateNodesOnSelect:fI,elevateEdgesOnSelect:dI,minZoom:Ir,maxZoom:Qr,nodeExtent:Qh,onNodesChange:rI,onEdgesChange:iI,snapToGrid:X,snapGrid:ae,connectionMode:B,translateExtent:es,connectOnClick:aI,defaultEdgeOptions:uI,fitView:kb,fitViewOptions:Eb,onNodesDelete:$,onEdgesDelete:C,onDelete:_,onNodeDragStart:w,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:M,onSelectionDragStart:P,onSelectionDragStop:R,onMove:u,onMoveStart:f,onMoveEnd:d,noPanClassName:Sb,nodeOrigin:Ar,rfId:Rh,autoPanOnConnect:hI,autoPanOnNodeDrag:pI,autoPanSpeed:gI,onError:bI,connectionRadius:OI,isValidConnection:yI,selectNodesOnDrag:pe,nodeDragThreshold:vI,connectionDragThreshold:wI,onBeforeDelete:D,debug:PI,ariaLabelConfig:_I,zIndexMode:Pb}),x.jsx(z4,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:b,onNodeMouseMove:y,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:E,nodeTypes:s,edgeTypes:o,connectionLineType:F,connectionLineStyle:q,connectionLineComponent:j,connectionLineContainerStyle:H,selectionKeyCode:ne,selectionOnDrag:z,selectionMode:J,deleteKeyCode:G,multiSelectionKeyCode:fe,panActivationKeyCode:ue,zoomActivationKeyCode:oe,onlyRenderVisibleElements:de,defaultViewport:$n,translateExtent:es,minZoom:Ir,maxZoom:Qr,preventScrolling:CA,zoomOnScroll:AA,zoomOnPinch:IA,zoomOnDoubleClick:LA,panOnScroll:QA,panOnScrollSpeed:RA,panOnScrollMode:MA,panOnDrag:DA,autoPanOnSelection:mI,onPaneClick:ZA,onPaneMouseEnter:VA,onPaneMouseMove:jA,onPaneMouseLeave:BA,onPaneScroll:FA,onPaneContextMenu:XA,paneClickDistance:zA,nodeClickDistance:WA,onSelectionContextMenu:L,onSelectionStart:I,onSelectionEnd:A,onReconnect:YA,onReconnectStart:GA,onReconnectEnd:HA,onEdgeContextMenu:qA,onEdgeDoubleClick:KA,onEdgeMouseEnter:JA,onEdgeMouseMove:eI,onEdgeMouseLeave:tI,reconnectRadius:nI,defaultMarkerColor:$A,noDragClassName:sI,noWheelClassName:oI,noPanClassName:Sb,rfId:Rh,disableKeyboardA11y:Tb,nodeExtent:Qh,viewport:SI,onViewportChange:kI}),x.jsx(bZ,{onSelectionChange:V}),UA,x.jsx(pZ,{proOptions:cI,position:lI}),x.jsx(hZ,{rfId:Rh,disableKeyboardA11y:Tb})]})})}var vN=HT(H4);const q4=t=>{var e;return(e=t.domNode)==null?void 0:e.querySelector(".react-flow__edgelabel-renderer")};function K4({children:t}){const e=be(q4);return e?A2.createPortal(t,e):null}function J4({dimensions:t,lineWidth:e,variant:n,className:r}){return x.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:tt(["react-flow__background-pattern",n,r])})}function eV({radius:t,className:e}){return x.jsx("circle",{cx:t,cy:t,r:t,className:tt(["react-flow__background-pattern","dots",e])})}var Tr;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Tr||(Tr={}));const tV={[Tr.Dots]:1,[Tr.Lines]:1,[Tr.Cross]:6},nV=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function wN({id:t,variant:e=Tr.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:o,bgColor:a,style:l,className:c,patternClassName:u}){const f=Q.useRef(null),{transform:d,patternId:h}=be(nV,Le),p=r||tV[e],m=e===Tr.Dots,O=e===Tr.Cross,g=Array.isArray(n)?n:[n,n],b=[g[0]*d[2]||1,g[1]*d[2]||1],y=p*d[2],v=Array.isArray(s)?s:[s,s],S=O?[y,y]:b,E=[v[0]*d[2]||1+S[0]/2,v[1]*d[2]||1+S[1]/2],w=`${h}${t||""}`;return x.jsxs("svg",{className:tt(["react-flow__background",c]),style:{...l,...sh,"--xy-background-color-props":a,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[x.jsx("pattern",{id:w,x:d[0]%b[0],y:d[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:m?x.jsx(eV,{radius:y/2,className:u}):x.jsx(J4,{dimensions:S,lineWidth:i,variant:e,className:u})}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${w})`})]})}wN.displayName="Background";const SN=Q.memo(wN);function rV(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function iV(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function sV(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function oV(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function aV(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:x.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function du({children:t,className:e,...n}){return x.jsx("button",{type:"button",className:tt(["react-flow__controls-button",e]),...n,children:t})}const lV=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function kN({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:o,onFitView:a,onInteractiveChange:l,className:c,children:u,position:f="bottom-left",orientation:d="vertical","aria-label":h}){const p=De(),{isInteractive:m,minZoomReached:O,maxZoomReached:g,ariaLabelConfig:b}=be(lV,Le),{zoomIn:y,zoomOut:v,fitView:S}=Sc(),E=()=>{y(),s==null||s()},w=()=>{v(),o==null||o()},k=()=>{S(i),a==null||a()},N=()=>{p.setState({nodesDraggable:!m,nodesConnectable:!m,elementsSelectable:!m}),l==null||l(!m)},$=d==="horizontal"?"horizontal":"vertical";return x.jsxs(wc,{className:tt(["react-flow__controls",$,c]),position:f,style:t,"data-testid":"rf__controls","aria-label":h??b["controls.ariaLabel"],children:[e&&x.jsxs(x.Fragment,{children:[x.jsx(du,{onClick:E,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:g,children:x.jsx(rV,{})}),x.jsx(du,{onClick:w,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:O,children:x.jsx(iV,{})})]}),n&&x.jsx(du,{className:"react-flow__controls-fitview",onClick:k,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:x.jsx(sV,{})}),r&&x.jsx(du,{className:"react-flow__controls-interactive",onClick:N,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:m?x.jsx(aV,{}):x.jsx(oV,{})}),u]})}kN.displayName="Controls";const EN=Q.memo(kN);function cV({id:t,x:e,y:n,width:r,height:i,style:s,color:o,strokeColor:a,strokeWidth:l,className:c,borderRadius:u,shapeRendering:f,selected:d,onClick:h}){const{background:p,backgroundColor:m}=s||{},O=o||p||m;return x.jsx("rect",{className:tt(["react-flow__minimap-node",{selected:d},c]),x:e,y:n,rx:u,ry:u,width:r,height:i,style:{fill:O,stroke:a,strokeWidth:l},shapeRendering:f,onClick:h?g=>h(g,t):void 0})}const uV=Q.memo(cV),fV=t=>t.nodes.map(e=>e.id),Op=t=>t instanceof Function?t:()=>t;function dV({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=uV,onClick:o}){const a=be(fV,Le),l=Op(e),c=Op(t),u=Op(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return x.jsx(x.Fragment,{children:a.map(d=>x.jsx(pV,{id:d,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:o,shapeRendering:f},d))})}function hV({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:a,onClick:l}){const{node:c,x:u,y:f,width:d,height:h}=be(p=>{const m=p.nodeLookup.get(t);if(!m)return{node:void 0,x:0,y:0,width:0,height:0};const O=m.internals.userNode,{x:g,y:b}=m.internals.positionAbsolute,{width:y,height:v}=oi(O);return{node:O,x:g,y:b,width:y,height:v}},Le);return!c||c.hidden||!bT(c)?null:x.jsx(a,{x:u,y:f,width:d,height:h,style:c.style,selected:!!c.selected,className:r(c),color:e(c),borderRadius:i,strokeColor:n(c),strokeWidth:s,shapeRendering:o,onClick:l,id:c.id})}const pV=Q.memo(hV);var mV=Q.memo(dV);const gV=200,OV=150,yV=t=>!t.hidden,bV=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?gT(bc(t.nodeLookup,{filter:yV}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},xV="react-flow__minimap-desc";function TN({style:t,className:e,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:u,maskStrokeWidth:f,position:d="bottom-right",onClick:h,onNodeClick:p,pannable:m=!1,zoomable:O=!1,ariaLabel:g,inversePan:b,zoomStep:y=1,offsetScale:v=5}){const S=De(),E=Q.useRef(null),{boundingRect:w,viewBB:k,rfId:N,panZoom:$,translateExtent:C,flowWidth:_,flowHeight:V,ariaLabelConfig:P}=be(bV,Le),M=(t==null?void 0:t.width)??gV,R=(t==null?void 0:t.height)??OV,L=w.width/M,I=w.height/R,A=Math.max(L,I),D=A*M,B=A*R,F=v*A,q=w.x-(D-w.width)/2-F,j=w.y-(B-w.height)/2-F,H=D+F*2,G=B+F*2,ne=`${xV}-${N}`,z=Q.useRef(0),J=Q.useRef();z.current=A,Q.useEffect(()=>{if(E.current&&$)return J.current=SD({domNode:E.current,panZoom:$,getTransform:()=>S.getState().transform,getViewScale:()=>z.current}),()=>{var X;(X=J.current)==null||X.destroy()}},[$]),Q.useEffect(()=>{var X;(X=J.current)==null||X.update({translateExtent:C,width:_,height:V,inversePan:b,pannable:m,zoomStep:y,zoomable:O})},[m,O,b,y,C,_,V]);const ue=h?X=>{var pe;const[ae,de]=((pe=J.current)==null?void 0:pe.pointer(X))||[0,0];h(X,{x:ae,y:de})}:void 0,fe=p?Q.useCallback((X,ae)=>{const de=S.getState().nodeLookup.get(ae).internals.userNode;p(X,de)},[]):void 0,oe=g??P["minimap.ariaLabel"];return x.jsx(wc,{position:d,style:{...t,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*A:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:tt(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:x.jsxs("svg",{width:M,height:R,viewBox:`${q} ${j} ${H} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:E,onClick:ue,children:[oe&&x.jsx("title",{id:ne,children:oe}),x.jsx(mV,{onClick:fe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:a}),x.jsx("path",{className:"react-flow__minimap-mask",d:`M${q-F},${j-F}h${H+F*2}v${G+F*2}h${-H-F*2}z
|
|
62
|
+
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}TN.displayName="MiniMap";Q.memo(TN);const vV=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,wV={[Xo.Line]:"right",[Xo.Handle]:"bottom-right"};function SV({nodeId:t,position:e,variant:n=Xo.Handle,className:r,style:i=void 0,children:s,color:o,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:h=!0,shouldResize:p,onResizeStart:m,onResize:O,onResizeEnd:g}){const b=eN(),y=typeof t=="string"?t:b,v=De(),S=Q.useRef(null),E=n===Xo.Handle,w=be(Q.useCallback(vV(E&&h),[E,h]),Le),k=Q.useRef(null),N=e??wV[n];Q.useEffect(()=>{if(!(!S.current||!y))return k.current||(k.current=MD({domNode:S.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:C,transform:_,snapGrid:V,snapToGrid:P,nodeOrigin:M,domNode:R}=v.getState();return{nodeLookup:C,transform:_,snapGrid:V,snapToGrid:P,nodeOrigin:M,paneDomNode:R}},onChange:(C,_)=>{const{triggerNodeChanges:V,nodeLookup:P,parentLookup:M,nodeOrigin:R}=v.getState(),L=[],I={x:C.x,y:C.y},A=P.get(y);if(A&&A.expandParent&&A.parentId){const D=A.origin??R,B=C.width??A.measured.width??0,F=C.height??A.measured.height??0,q={id:A.id,parentId:A.parentId,rect:{width:B,height:F,...xT({x:C.x??A.position.x,y:C.y??A.position.y},{width:B,height:F},A.parentId,P,D)}},j=WO([q],P,M,R);L.push(...j),I.x=C.x?Math.max(D[0]*B,C.x):void 0,I.y=C.y?Math.max(D[1]*F,C.y):void 0}if(I.x!==void 0&&I.y!==void 0){const D={id:y,type:"position",position:{...I}};L.push(D)}if(C.width!==void 0&&C.height!==void 0){const B={id:y,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:C.width,height:C.height}};L.push(B)}for(const D of _){const B={...D,type:"position"};L.push(B)}V(L)},onEnd:({width:C,height:_})=>{const V={id:y,type:"dimensions",resizing:!1,dimensions:{width:C,height:_}};v.getState().triggerNodeChanges([V])}})),k.current.update({controlPosition:N,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:u},keepAspectRatio:f,resizeDirection:d,onResizeStart:m,onResize:O,onResizeEnd:g,shouldResize:p}),()=>{var C;(C=k.current)==null||C.destroy()}},[N,a,l,c,u,f,m,O,g,p]);const $=N.split("-");return x.jsx("div",{className:tt(["react-flow__resize-control","nodrag",...$,n,r]),ref:S,style:{...i,scale:w,...o&&{[E?"backgroundColor":"borderColor"]:o}},children:s})}Q.memo(SV);const NN={},{useDebugValue:kV}=D0,{useSyncExternalStoreWithSelector:EV}=BT;let B1=!1;const TV=t=>t;function NV(t,e=TV,n){(NN?"production":void 0)!=="production"&&n&&!B1&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),B1=!0);const r=EV(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return kV(r),r}const F1=t=>{(NN?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?FT(t):t,n=(r,i)=>NV(e,r,i);return Object.assign(n,e),n},KO=t=>t?F1(t):F1;var Se;(function(t){t[t.Canceled=1]="Canceled",t[t.Unknown=2]="Unknown",t[t.InvalidArgument=3]="InvalidArgument",t[t.DeadlineExceeded=4]="DeadlineExceeded",t[t.NotFound=5]="NotFound",t[t.AlreadyExists=6]="AlreadyExists",t[t.PermissionDenied=7]="PermissionDenied",t[t.ResourceExhausted=8]="ResourceExhausted",t[t.FailedPrecondition=9]="FailedPrecondition",t[t.Aborted=10]="Aborted",t[t.OutOfRange=11]="OutOfRange",t[t.Unimplemented=12]="Unimplemented",t[t.Internal=13]="Internal",t[t.Unavailable=14]="Unavailable",t[t.DataLoss=15]="DataLoss",t[t.Unauthenticated=16]="Unauthenticated"})(Se||(Se={}));function JO(t,e){return t!==null&&typeof t=="object"&&"$typeName"in t&&typeof t.$typeName=="string"?e===void 0?!0:e.typeName===t.$typeName:!1}var Z;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(Z||(Z={}));function PV(){let t=0,e=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<<r,!(i&128))return this.assertBounds(),[t,e]}let n=this.buf[this.pos++];if(t|=(n&15)<<28,e=(n&112)>>4,!(n&128))return this.assertBounds(),[t,e];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<r,!(i&128))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}function yp(t,e,n){for(let s=0;s<28;s=s+7){const o=t>>>s,a=!(!(o>>>7)&&e==0),l=(a?o|128:o)&255;if(n.push(l),!a)return}const r=t>>>28&15|(e&7)<<4,i=!!(e>>3);if(n.push((i?r|128:r)&255),!!i){for(let s=3;s<31;s=s+7){const o=e>>>s,a=!!(o>>>7),l=(a?o|128:o)&255;if(n.push(l),!a)return}n.push(e>>>31&1)}}const of=4294967296;function X1(t){const e=t[0]==="-";e&&(t=t.slice(1));const n=1e6;let r=0,i=0;function s(o,a){const l=Number(t.slice(o,a));i*=n,r=r*n+l,r>=of&&(i=i+(r/of|0),r=r%of)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?_N(r,i):ey(r,i)}function _V(t,e){let n=ey(t,e);const r=n.hi&2147483648;r&&(n=_N(n.lo,n.hi));const i=PN(n.lo,n.hi);return r?"-"+i:i}function PN(t,e){if({lo:t,hi:e}=CV(t,e),e<=2097151)return String(of*e+t);const n=t&16777215,r=(t>>>24|e<<8)&16777215,i=e>>16&65535;let s=n+r*6777216+i*6710656,o=r+i*8147497,a=i*2;const l=1e7;return s>=l&&(o+=Math.floor(s/l),s%=l),o>=l&&(a+=Math.floor(o/l),o%=l),a.toString()+z1(o)+z1(s)}function CV(t,e){return{lo:t>>>0,hi:e>>>0}}function ey(t,e){return{lo:t|0,hi:e|0}}function _N(t,e){return e=~e,t?t=~t+1:e+=1,ey(t,e)}const z1=t=>{const e=String(t);return"0000000".slice(e.length)+e};function wg(t,e){if(t>=0){for(;t>127;)e.push(t&127|128),t=t>>>7;e.push(t)}else{for(let n=0;n<9;n++)e.push(t&127|128),t=t>>7;e.push(1)}}function $V(){let t=this.buf[this.pos++],e=t&127;if(!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<7,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<14,!(t&128))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(t&127)<<21,!(t&128))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(t&15)<<28;for(let n=5;t&128&&n<10;n++)t=this.buf[this.pos++];if(t&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var W1={};const Re=AV();function AV(){const t=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof t.getBigInt64=="function"&&typeof t.getBigUint64=="function"&&typeof t.setBigInt64=="function"&&typeof t.setBigUint64=="function"&&(!!globalThis.Deno||!!globalThis.Bun||typeof process!="object"||typeof W1!="object"||W1.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),i=BigInt("0"),s=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(o){const a=typeof o=="bigint"?o:BigInt(o);if(a>r||a<n)throw new Error(`invalid int64: ${o}`);return a},uParse(o){const a=typeof o=="bigint"?o:BigInt(o);if(a>s||a<i)throw new Error(`invalid uint64: ${o}`);return a},enc(o){return t.setBigInt64(0,this.parse(o),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},uEnc(o){return t.setBigInt64(0,this.uParse(o),!0),{lo:t.getInt32(0,!0),hi:t.getInt32(4,!0)}},dec(o,a){return t.setInt32(0,o,!0),t.setInt32(4,a,!0),t.getBigInt64(0,!0)},uDec(o,a){return t.setInt32(0,o,!0),t.setInt32(4,a,!0),t.getBigUint64(0,!0)}}}return{zero:"0",supported:!1,parse(n){return typeof n!="string"&&(n=n.toString()),U1(n),n},uParse(n){return typeof n!="string"&&(n=n.toString()),Y1(n),n},enc(n){return typeof n!="string"&&(n=n.toString()),U1(n),X1(n)},uEnc(n){return typeof n!="string"&&(n=n.toString()),Y1(n),X1(n)},dec(n,r){return _V(n,r)},uDec(n,r){return PN(n,r)}}}function U1(t){if(!/^-?[0-9]+$/.test(t))throw new Error("invalid int64: "+t)}function Y1(t){if(!/^[0-9]+$/.test(t))throw new Error("invalid uint64: "+t)}function Uo(t,e){switch(t){case Z.STRING:return"";case Z.BOOL:return!1;case Z.DOUBLE:case Z.FLOAT:return 0;case Z.INT64:case Z.UINT64:case Z.SFIXED64:case Z.FIXED64:case Z.SINT64:return e?"0":Re.zero;case Z.BYTES:return new Uint8Array(0);default:return 0}}function IV(t,e){switch(t){case Z.BOOL:return e===!1;case Z.STRING:return e==="";case Z.BYTES:return e instanceof Uint8Array&&!e.byteLength;case Z.DOUBLE:case Z.FLOAT:return Object.is(e,0);default:return e==0}}const CN=2,Ur=Symbol.for("reflect unsafe local");function $N(t,e){const n=t[e.localName].case;return n===void 0?n:e.fields.find(r=>r.localName===n)}function QV(t,e){const n=e.localName;if(e.oneof)return t[e.oneof.localName].case===n;if(e.presence!=CN)return t[n]!==void 0&&Object.prototype.hasOwnProperty.call(t,n);switch(e.fieldKind){case"list":return t[n].length>0;case"map":return Object.keys(t[n]).length>0;case"scalar":return!IV(e.scalar,t[n]);case"enum":return t[n]!==e.enum.values[0].number}throw new Error("message field with implicit presence")}function Ll(t,e){return Object.prototype.hasOwnProperty.call(t,e)&&t[e]!==void 0}function AN(t,e){if(e.oneof){const n=t[e.oneof.localName];return n.case===e.localName?n.value:void 0}return t[e.localName]}function IN(t,e,n){e.oneof?t[e.oneof.localName]={case:e.localName,value:n}:t[e.localName]=n}function RV(t,e){const n=e.localName;if(e.oneof){const r=e.oneof.localName;t[r].case===n&&(t[r]={case:void 0})}else if(e.presence!=CN)delete t[n];else switch(e.fieldKind){case"map":t[n]={};break;case"list":t[n]=[];break;case"enum":t[n]=e.enum.values[0].number;break;case"scalar":t[n]=Uo(e.scalar,e.longAsString);break}}function Li(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function ty(t,e){var n,r,i,s;if(Li(t)&&Ur in t&&"add"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){const o=e,a=t.field();return o.listKind==a.listKind&&o.scalar===a.scalar&&((n=o.message)===null||n===void 0?void 0:n.typeName)===((r=a.message)===null||r===void 0?void 0:r.typeName)&&((i=o.enum)===null||i===void 0?void 0:i.typeName)===((s=a.enum)===null||s===void 0?void 0:s.typeName)}return!0}return!1}function ny(t,e){var n,r,i,s;if(Li(t)&&Ur in t&&"has"in t&&"field"in t&&typeof t.field=="function"){if(e!==void 0){const o=e,a=t.field();return o.mapKey===a.mapKey&&o.mapKind==a.mapKind&&o.scalar===a.scalar&&((n=o.message)===null||n===void 0?void 0:n.typeName)===((r=a.message)===null||r===void 0?void 0:r.typeName)&&((i=o.enum)===null||i===void 0?void 0:i.typeName)===((s=a.enum)===null||s===void 0?void 0:s.typeName)}return!0}return!1}function ry(t,e){return Li(t)&&Ur in t&&"desc"in t&&Li(t.desc)&&t.desc.kind==="message"&&(e===void 0||t.desc.typeName==e.typeName)}function MV(t){return RN(t.$typeName)}function la(t){const e=t.fields[0];return RN(t.typeName)&&e!==void 0&&e.fieldKind=="scalar"&&e.name=="value"&&e.number==1}function QN(t){switch(t.typeName){case"google.protobuf.Any":case"google.protobuf.Timestamp":case"google.protobuf.Duration":case"google.protobuf.FieldMask":case"google.protobuf.Struct":case"google.protobuf.Value":case"google.protobuf.ListValue":return!0;default:return la(t)}}function RN(t){return t.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(t.substring(16))}const LV=999,DV=998,af=2;function qn(t,e){if(JO(e,t))return e;const n=FV(t);return e!==void 0&&ZV(t,n,e),n}function ZV(t,e,n){for(const r of t.members){let i=n[r.localName];if(i==null)continue;let s;if(r.kind=="oneof"){const o=$N(n,r);if(!o)continue;s=o,i=AN(n,o)}else s=r;switch(s.fieldKind){case"message":i=iy(s,i);break;case"scalar":i=MN(s,i);break;case"list":i=jV(s,i);break;case"map":i=VV(s,i);break}IN(e,s,i)}return e}function MN(t,e){return t.scalar==Z.BYTES?sy(e):e}function VV(t,e){if(Li(e)){if(t.scalar==Z.BYTES)return G1(e,sy);if(t.mapKind=="message")return G1(e,n=>iy(t,n))}return e}function jV(t,e){if(Array.isArray(e)){if(t.scalar==Z.BYTES)return e.map(sy);if(t.listKind=="message")return e.map(n=>iy(t,n))}return e}function iy(t,e){if(t.fieldKind=="message"&&!t.oneof&&la(t.message))return MN(t.message.fields[0],e);if(Li(e)){if(t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!=="google.protobuf.Value")return e;if(!JO(e,t.message))return qn(t.message,e)}return e}function sy(t){return Array.isArray(t)?new Uint8Array(t):t}function G1(t,e){const n={};for(const r of Object.entries(t))n[r[0]]=e(r[1]);return n}const BV=Symbol(),H1=new WeakMap;function FV(t){let e;if(XV(t)){const n=H1.get(t);let r,i;if(n)({prototype:r,members:i}=n);else{r={},i=new Set;for(const s of t.members)s.kind!="oneof"&&(s.fieldKind!="scalar"&&s.fieldKind!="enum"||s.presence!=af&&(i.add(s),r[s.localName]=bp(s)));H1.set(t,{prototype:r,members:i})}e=Object.create(r),e.$typeName=t.typeName;for(const s of t.members)i.has(s)||s.kind=="field"&&(s.fieldKind=="message"||(s.fieldKind=="scalar"||s.fieldKind=="enum")&&s.presence!=af)||(e[s.localName]=bp(s))}else{e={$typeName:t.typeName};for(const n of t.members)(n.kind=="oneof"||n.presence==af)&&(e[n.localName]=bp(n))}return e}function XV(t){switch(t.file.edition){case LV:return!1;case DV:return!0;default:return t.fields.some(e=>e.presence!=af&&e.fieldKind!="message"&&!e.oneof)}}function bp(t){if(t.kind=="oneof")return{case:void 0};if(t.fieldKind=="list")return[];if(t.fieldKind=="map")return{};if(t.fieldKind=="message")return BV;const e=t.getDefaultValue();return e!==void 0?t.fieldKind=="scalar"&&t.longAsString?e.toString():e:t.fieldKind=="scalar"?Uo(t.scalar,t.longAsString):t.enum.values[0].number}const zV=["FieldValueInvalidError","FieldListRangeError","ForeignFieldError"];class It extends Error{constructor(e,n,r="FieldValueInvalidError"){super(n),this.name=r,this.field=()=>e}}function WV(t){return t instanceof Error&&zV.includes(t.name)&&"field"in t&&typeof t.field=="function"}const xp=Symbol.for("@bufbuild/protobuf/text-encoding");function oy(){if(globalThis[xp]==null){const t=new globalThis.TextEncoder,e=new globalThis.TextDecoder;let n;globalThis[xp]={encodeUtf8(r){return t.encode(r)},decodeUtf8(r,i){return i?(n===void 0&&(n=new globalThis.TextDecoder("utf-8",{fatal:!0})),n.decode(r)):e.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[xp]}var qe;(function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"})(qe||(qe={}));const LN=34028234663852886e22,DN=-34028234663852886e22,ZN=4294967295,VN=2147483647,jN=-2147483648;class BN{constructor(e=oy().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let i=0;i<this.chunks.length;i++)e+=this.chunks[i].length;let n=new Uint8Array(e),r=0;for(let i=0;i<this.chunks.length;i++)n.set(this.chunks[i],r),r+=this.chunks[i].length;return this.chunks=[],n}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),n=this.stack.pop();if(!n)throw new Error("invalid state, fork stack empty");return this.chunks=n.chunks,this.buf=n.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,n){return this.uint32((e<<3|n)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(q1(e);e>127;)this.buf.push(e&127|128),e=e>>>7;return this.buf.push(e),this}int32(e){return vp(e),wg(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let n=this.encodeUtf8(e);return this.uint32(n.byteLength),this.raw(n)}float(e){UV(e);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,e,!0),this.raw(n)}double(e){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,e,!0),this.raw(n)}fixed32(e){q1(e);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,e,!0),this.raw(n)}sfixed32(e){vp(e);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,e,!0),this.raw(n)}sint32(e){return vp(e),e=(e<<1^e>>31)>>>0,wg(e,this.buf),this}sfixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Re.enc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(e){let n=new Uint8Array(8),r=new DataView(n.buffer),i=Re.uEnc(e);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(e){let n=Re.enc(e);return yp(n.lo,n.hi,this.buf),this}sint64(e){const n=Re.enc(e),r=n.hi>>31,i=n.lo<<1^r,s=(n.hi<<1|n.lo>>>31)^r;return yp(i,s,this.buf),this}uint64(e){const n=Re.uEnc(e);return yp(n.lo,n.hi,this.buf),this}}class ay{constructor(e,n=oy().decodeUtf8){this.decodeUtf8=n,this.varint64=PV,this.uint32=$V,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){const e=this.pos,n=this.uint32(),r=this.pos-e;if(r>5||r==5&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");const i=n>>>3,s=n&7;if(i<=0||s>5)throw new Error("illegal tag: field no "+i+" wire type "+s);return[i,s]}skip(e,n,r=100){let i=this.pos;switch(e){case qe.Varint:for(;this.buf[this.pos++]&128;);break;case qe.Bit64:this.pos+=4;case qe.Bit32:this.pos+=4;break;case qe.LengthDelimited:let s=this.uint32();this.pos+=s;break;case qe.StartGroup:if(r<=0)throw new Error("maximum recursion depth reached");for(;;){const[o,a]=this.tag();if(a===qe.EndGroup){if(n!==void 0&&o!==n)throw new Error("invalid end group tag");break}this.skip(a,o,r-1)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return Re.dec(...this.varint64())}uint64(){return Re.uDec(...this.varint64())}sint64(){let[e,n]=this.varint64(),r=-(e&1);return e=(e>>>1|(n&1)<<31)^r,n=n>>>1^r,Re.dec(e,n)}bool(){let[e,n]=this.varint64();return e!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return Re.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return Re.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),n=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(n,n+e)}string(e){return this.decodeUtf8(this.bytes(),e)}}function vp(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid int32: "+typeof t);if(!Number.isInteger(t)||t>VN||t<jN)throw new Error("invalid int32: "+t)}function q1(t){if(typeof t=="string")t=Number(t);else if(typeof t!="number")throw new Error("invalid uint32: "+typeof t);if(!Number.isInteger(t)||t>ZN||t<0)throw new Error("invalid uint32: "+t)}function UV(t){if(typeof t=="string"){const e=t;if(t=Number(t),Number.isNaN(t)&&e!=="NaN")throw new Error("invalid float32: "+e)}else if(typeof t!="number")throw new Error("invalid float32: "+typeof t);if(Number.isFinite(t)&&(t>LN||t<DN))throw new Error("invalid float32: "+t)}function ss(t,e){const n=t.fieldKind=="list"?ty(e,t):t.fieldKind=="map"?ny(e,t):ly(t,e);if(n===!0)return;let r;switch(t.fieldKind){case"list":r=`expected ${XN(t)}, got ${dt(e)}`;break;case"map":r=`expected ${zN(t)}, got ${dt(e)}`;break;default:r=Kf(t,e,n)}return new It(t,r)}function K1(t,e,n){const r=ly(t,n);if(r!==!0)return new It(t,`list item #${e+1}: ${Kf(t,n,r)}`)}function YV(t,e,n){const r=Sg(e,t.mapKey);if(r!==!0)return new It(t,`invalid map key: ${Kf({scalar:t.mapKey},e,r)}`);const i=ly(t,n);if(i!==!0)return new It(t,`map entry ${dt(e)}: ${Kf(t,n,i)}`)}function ly(t,e){return t.scalar!==void 0?Sg(e,t.scalar):t.enum!==void 0?t.enum.open?Sg(e,Z.INT32):t.enum.values.some(n=>n.number===e):ry(e,t.message)}function Sg(t,e){switch(e){case Z.DOUBLE:return typeof t=="number";case Z.FLOAT:return typeof t!="number"?!1:Number.isNaN(t)||!Number.isFinite(t)?!0:t>LN||t<DN?`${t.toFixed()} out of range`:!0;case Z.INT32:case Z.SFIXED32:case Z.SINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>VN||t<jN?`${t.toFixed()} out of range`:!0;case Z.FIXED32:case Z.UINT32:return typeof t!="number"||!Number.isInteger(t)?!1:t>ZN||t<0?`${t.toFixed()} out of range`:!0;case Z.BOOL:return typeof t=="boolean";case Z.STRING:return typeof t!="string"?!1:oy().checkUtf8(t)||"invalid UTF8";case Z.BYTES:return t instanceof Uint8Array;case Z.INT64:case Z.SFIXED64:case Z.SINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return Re.parse(t),!0}catch{return`${t} out of range`}return!1;case Z.FIXED64:case Z.UINT64:if(typeof t=="bigint"||typeof t=="number"||typeof t=="string"&&t.length>0)try{return Re.uParse(t),!0}catch{return`${t} out of range`}return!1}}function Kf(t,e,n){return n=typeof n=="string"?`: ${n}`:`, got ${dt(e)}`,t.scalar!==void 0?`expected ${GV(t.scalar)}`+n:t.enum!==void 0?`expected ${t.enum.toString()}`+n:`expected ${FN(t.message)}`+n}function dt(t){switch(typeof t){case"object":return t===null?"null":t instanceof Uint8Array?`Uint8Array(${t.length})`:Array.isArray(t)?`Array(${t.length})`:ty(t)?XN(t.field()):ny(t)?zN(t.field()):ry(t)?FN(t.desc):JO(t)?`message ${t.$typeName}`:"object";case"string":return t.length>30?"string":`"${t.split('"').join('\\"')}"`;case"boolean":return String(t);case"number":return String(t);case"bigint":return String(t)+"n";default:return typeof t}}function FN(t){return`ReflectMessage (${t.typeName})`}function XN(t){switch(t.listKind){case"message":return`ReflectList (${t.message.toString()})`;case"enum":return`ReflectList (${t.enum.toString()})`;case"scalar":return`ReflectList (${Z[t.scalar]})`}}function zN(t){switch(t.mapKind){case"message":return`ReflectMap (${Z[t.mapKey]}, ${t.message.toString()})`;case"enum":return`ReflectMap (${Z[t.mapKey]}, ${t.enum.toString()})`;case"scalar":return`ReflectMap (${Z[t.mapKey]}, ${Z[t.scalar]})`}}function GV(t){switch(t){case Z.STRING:return"string";case Z.BOOL:return"boolean";case Z.INT64:case Z.SINT64:case Z.SFIXED64:return"bigint (int64)";case Z.UINT64:case Z.FIXED64:return"bigint (uint64)";case Z.BYTES:return"Uint8Array";case Z.DOUBLE:return"number (float64)";case Z.FLOAT:return"number (float32)";case Z.FIXED32:case Z.UINT32:return"number (uint32)";case Z.INT32:case Z.SFIXED32:case Z.SINT32:return"number (int32)"}}function er(t,e,n=!0){return new WN(t,e,n)}const J1=new WeakMap;class WN{get sortedFields(){const e=J1.get(this.desc);if(e)return e;const n=this.desc.fields.concat().sort((r,i)=>r.number-i.number);return J1.set(this.desc,n),n}constructor(e,n,r=!0){this.lists=new Map,this.maps=new Map,this.check=r,this.desc=e,this.message=this[Ur]=n??qn(e),this.fields=e.fields,this.oneofs=e.oneofs,this.members=e.members}findNumber(e){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(n=>[n.number,n]))),this._fieldsByNumber.get(e)}oneofCase(e){return Ea(this.message,e),$N(this.message,e)}isSet(e){return Ea(this.message,e),QV(this.message,e)}clear(e){Ea(this.message,e),RV(this.message,e)}get(e){Ea(this.message,e);const n=AN(this.message,e);switch(e.fieldKind){case"list":let r=this.lists.get(e);return(!r||r[Ur]!==n)&&this.lists.set(e,r=new HV(e,n,this.check)),r;case"map":let i=this.maps.get(e);return(!i||i[Ur]!==n)&&this.maps.set(e,i=new qV(e,n,this.check)),i;case"message":return uy(e,n,this.check);case"scalar":return n===void 0?Uo(e.scalar,!1):fy(e,n);case"enum":return n??e.enum.values[0].number}}set(e,n){if(Ea(this.message,e),this.check){const i=ss(e,n);if(i)throw i}let r;e.fieldKind=="message"?r=cy(e,n):ny(n)||ty(n)?r=n[Ur]:r=dy(e,n),IN(this.message,e,r)}getUnknown(){return this.message.$unknown}setUnknown(e){this.message.$unknown=e}}function Ea(t,e){if(e.parent.typeName!==t.$typeName)throw new It(e,`cannot use ${e.toString()} with message ${t.$typeName}`,"ForeignFieldError")}class HV{field(){return this._field}get size(){return this._arr.length}constructor(e,n,r){this._field=e,this._arr=this[Ur]=n,this.check=r}get(e){const n=this._arr[e];return n===void 0?void 0:wp(this._field,n,this.check)}set(e,n){if(e<0||e>=this._arr.length)throw new It(this._field,`list item #${e+1}: out of range`);if(this.check){const r=K1(this._field,e,n);if(r)throw r}this._arr[e]=ev(this._field,n)}add(e){if(this.check){const n=K1(this._field,this._arr.length,e);if(n)throw n}this._arr.push(ev(this._field,e))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const e of this._arr)yield wp(this._field,e,this.check)}*entries(){for(let e=0;e<this._arr.length;e++)yield[e,wp(this._field,this._arr[e],this.check)]}}class qV{constructor(e,n,r=!0){this.obj=this[Ur]=n??{},this.check=r,this._field=e}field(){return this._field}set(e,n){if(this.check){const r=YV(this._field,e,n);if(r)throw r}return this.obj[hu(e)]=KV(this._field,n),this}delete(e){const n=hu(e),r=Object.prototype.hasOwnProperty.call(this.obj,n);return r&&delete this.obj[n],r}clear(){for(const e of Object.keys(this.obj))delete this.obj[e]}get(e){let n=this.obj[hu(e)];return n!==void 0&&(n=Sp(this._field,n,this.check)),n}has(e){return Object.prototype.hasOwnProperty.call(this.obj,hu(e))}*keys(){for(const e of Object.keys(this.obj))yield tv(e,this._field.mapKey)}*entries(){for(const e of Object.entries(this.obj))yield[tv(e[0],this._field.mapKey),Sp(this._field,e[1],this.check)]}[Symbol.iterator](){return this.entries()}get size(){return Object.keys(this.obj).length}*values(){for(const e of Object.values(this.obj))yield Sp(this._field,e,this.check)}forEach(e,n){for(const r of this.entries())e.call(n,r[1],r[0],this)}}function cy(t,e){return ry(e)?MV(e.message)&&!t.oneof&&t.fieldKind=="message"?e.message.value:e.desc.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"?YN(e.message):e.message:e}function uy(t,e,n){return e!==void 0&&(la(t.message)&&!t.oneof&&t.fieldKind=="message"?e={$typeName:t.message.typeName,value:fy(t.message.fields[0],e)}:t.message.typeName=="google.protobuf.Struct"&&t.parent.typeName!="google.protobuf.Value"&&Li(e)&&(e=UN(e))),new WN(t.message,e,n)}function ev(t,e){return t.listKind=="message"?cy(t,e):dy(t,e)}function wp(t,e,n){return t.listKind=="message"?uy(t,e,n):fy(t,e)}function KV(t,e){return t.mapKind=="message"?cy(t,e):dy(t,e)}function Sp(t,e,n){return t.mapKind=="message"?uy(t,e,n):e}function hu(t){return typeof t=="string"||typeof t=="number"?t:String(t)}function tv(t,e){switch(e){case Z.STRING:return t;case Z.INT32:case Z.FIXED32:case Z.UINT32:case Z.SFIXED32:case Z.SINT32:{const n=Number.parseInt(t);if(Number.isFinite(n))return n;break}case Z.BOOL:switch(t){case"true":return!0;case"false":return!1}break;case Z.UINT64:case Z.FIXED64:try{return Re.uParse(t)}catch{}break;default:try{return Re.parse(t)}catch{}break}return t}function fy(t,e){switch(t.scalar){case Z.INT64:case Z.SFIXED64:case Z.SINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=Re.parse(e));break;case Z.FIXED64:case Z.UINT64:"longAsString"in t&&t.longAsString&&typeof e=="string"&&(e=Re.uParse(e));break}return e}function dy(t,e){switch(t.scalar){case Z.INT64:case Z.SFIXED64:case Z.SINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Re.parse(e));break;case Z.FIXED64:case Z.UINT64:"longAsString"in t&&t.longAsString?e=String(e):(typeof e=="string"||typeof e=="number")&&(e=Re.uParse(e));break}return e}function UN(t){const e={$typeName:"google.protobuf.Struct",fields:{}};if(Li(t))for(const[n,r]of Object.entries(t))e.fields[n]=HN(r);return e}function YN(t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=GN(r);return e}function GN(t){switch(t.kind.case){case"structValue":return YN(t.kind.value);case"listValue":return t.kind.value.values.map(GN);case"nullValue":case void 0:return null;default:return t.kind.value}}function HN(t){const e={$typeName:"google.protobuf.Value",kind:{case:void 0}};switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:0};else if(Array.isArray(t)){const n={$typeName:"google.protobuf.ListValue",values:[]};if(Array.isArray(t))for(const r of t)n.values.push(HN(r));e.kind={case:"listValue",value:n}}else e.kind={case:"structValue",value:UN(t)};break}return e}function hy(t){const e=JV();let n=t.length*3/4;t[t.length-2]=="="?n-=2:t[t.length-1]=="="&&(n-=1);let r=new Uint8Array(n),i=0,s=0,o,a=0;for(let l=0;l<t.length;l++){if(o=e[t.charCodeAt(l)],o===void 0)switch(t[l]){case"=":s=0;case`
|
|
63
|
+
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string")}switch(s){case 0:a=o,s=1;break;case 1:r[i++]=a<<2|(o&48)>>4,a=o,s=2;break;case 2:r[i++]=(a&15)<<4|(o&60)>>2,a=o,s=3;break;case 3:r[i++]=(a&3)<<6|o,s=0;break}}if(s==1)throw Error("invalid base64 string");return r.subarray(0,i)}function qN(t,e="std"){const n=KN(e),r=e=="std";let i="",s=0,o,a=0;for(let l=0;l<t.length;l++)switch(o=t[l],s){case 0:i+=n[o>>2],a=(o&3)<<4,s=1;break;case 1:i+=n[a|o>>4],a=(o&15)<<2,s=2;break;case 2:i+=n[a|o>>6],i+=n[o&63],s=0;break}return s&&(i+=n[a],r&&(i+="=",s==1&&(i+="="))),i}let pu,nv,zs;function KN(t){return pu||(pu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),nv=pu.slice(0,-2).concat("-","_")),t=="url"?nv:pu}function JV(){if(!zs){zs=[];const t=KN("std");for(let e=0;e<t.length;e++)zs[t[e].charCodeAt(0)]=e;zs[45]=t.indexOf("+"),zs[95]=t.indexOf("/")}return zs}function Yo(t){let e=!1;const n=[];for(let r=0;r<t.length;r++){let i=t.charAt(r);switch(i){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n.push(i),e=!1;break;default:e&&(e=!1,i=i.toUpperCase()),n.push(i);break}}return n.join("")}function JN(t){return t.replace(/[A-Z]/g,e=>"_"+e.toLowerCase())}const ej=new Set(["constructor","toString","toJSON","valueOf"]);function Dl(t){return ej.has(t)?t+"$":t}function py(t){for(const e of t.field)Ll(e,"jsonName")||(e.jsonName=Yo(e.name));t.nestedType.forEach(py)}function tj(t,e){const n=t.values.find(r=>r.name===e);if(!n)throw new Error(`cannot parse ${t} default value: ${e}`);return n.number}function nj(t,e){switch(t){case Z.STRING:return e;case Z.BYTES:{const n=rj(e);if(n===!1)throw new Error(`cannot parse ${Z[t]} default value: ${e}`);return n}case Z.INT64:case Z.SFIXED64:case Z.SINT64:return Re.parse(e);case Z.UINT64:case Z.FIXED64:return Re.uParse(e);case Z.DOUBLE:case Z.FLOAT:switch(e){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(e)}case Z.BOOL:return e==="true";case Z.INT32:case Z.UINT32:case Z.SINT32:case Z.FIXED32:case Z.SFIXED32:return parseInt(e,10)}}function rj(t){const e=[],n={tail:t,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(r){if(this.tail.length>=r){const i=this.tail.substring(0,r);return this.tail=this.tail.substring(r),i}return!1}};for(;n.next();)switch(n.c){case"\\":if(n.next())switch(n.c){case"\\":e.push(n.c.charCodeAt(0));break;case"b":e.push(8);break;case"f":e.push(12);break;case"n":e.push(10);break;case"r":e.push(13);break;case"t":e.push(9);break;case"v":e.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const r=n.c,i=n.take(2);if(i===!1)return!1;const s=parseInt(r+i,8);if(Number.isNaN(s))return!1;e.push(s);break}case"x":{const r=n.c,i=n.take(2);if(i===!1)return!1;const s=parseInt(r+i,16);if(Number.isNaN(s))return!1;e.push(s);break}case"u":{const r=n.c,i=n.take(4);if(i===!1)return!1;const s=parseInt(r+i,16);if(Number.isNaN(s))return!1;const o=new Uint8Array(4);new DataView(o.buffer).setInt32(0,s,!0),e.push(o[0],o[1],o[2],o[3]);break}case"U":{const r=n.c,i=n.take(8);if(i===!1)return!1;const s=Re.uEnc(r+i),o=new Uint8Array(8),a=new DataView(o.buffer);a.setInt32(0,s.lo,!0),a.setInt32(4,s.hi,!0),e.push(o[0],o[1],o[2],o[3],o[4],o[5],o[6],o[7]);break}}break;default:e.push(n.c.charCodeAt(0))}return new Uint8Array(e)}function*kg(t){switch(t.kind){case"file":for(const e of t.messages)yield e,yield*kg(e);yield*t.enums,yield*t.services,yield*t.extensions;break;case"message":for(const e of t.nestedMessages)yield e,yield*kg(e);yield*t.nestedEnums,yield*t.nestedExtensions;break}}function eP(...t){const e=ij();if(!t.length)return e;if("$typeName"in t[0]&&t[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const r of t[0].file)ov(r,e);return e}if("$typeName"in t[0]){let o=function(a){const l=[];for(const c of a.dependency){if(e.getFile(c)!=null||s.has(c))continue;const u=i(c);if(!u)throw new Error(`Unable to resolve ${c}, imported by ${a.name}`);"kind"in u?e.addFile(u,!1,!0):(s.add(u.name),l.push(u))}return l.concat(...l.map(o))};var n=o;const r=t[0],i=t[1],s=new Set;for(const a of[r,...o(r)].reverse())ov(a,e)}else for(const r of t)for(const i of r.files)e.addFile(i);return e}function ij(){const t=new Map,e=new Map,n=new Map;return{kind:"registry",types:t,extendees:e,[Symbol.iterator](){return t.values()},get files(){return n.values()},addFile(r,i,s){if(n.set(r.proto.name,r),!i)for(const o of kg(r))this.add(o);if(s)for(const o of r.dependencies)this.addFile(o,i,s)},add(r){if(r.kind=="extension"){let i=e.get(r.extendee.typeName);i||e.set(r.extendee.typeName,i=new Map),i.set(r.number,r)}t.set(r.typeName,r)},get(r){return t.get(r)},getFile(r){return n.get(r)},getMessage(r){const i=t.get(r);return(i==null?void 0:i.kind)=="message"?i:void 0},getEnum(r){const i=t.get(r);return(i==null?void 0:i.kind)=="enum"?i:void 0},getExtension(r){const i=t.get(r);return(i==null?void 0:i.kind)=="extension"?i:void 0},getExtensionFor(r,i){var s;return(s=e.get(r.typeName))===null||s===void 0?void 0:s.get(i)},getService(r){const i=t.get(r);return(i==null?void 0:i.kind)=="service"?i:void 0}}}const sj=998,oj=999,aj=9999,lj=9,Zl=10,el=11,cj=12,rv=14,my=3,uj=2,iv=1,fj=0,kp=1,sv=2,dj=3,hj=1,pj=2,mj=1,gj=2,Oj=1001,tP={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function ov(t,e){var n,r;const i={kind:"file",proto:t,deprecated:(r=(n=t.options)===null||n===void 0?void 0:n.deprecated)!==null&&r!==void 0?r:!1,edition:vj(t),name:t.name.replace(/\.proto$/,""),dependencies:wj(t,e),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${t.name}`}},s=new Map,o={get(a){return s.get(a)},add(a){var l;Zn(((l=a.proto.options)===null||l===void 0?void 0:l.mapEntry)===!0),s.set(a.typeName,a)}};for(const a of t.enumType)nP(a,i,void 0,e);for(const a of t.messageType)rP(a,i,void 0,e,o);for(const a of t.service)yj(a,i,e);Eg(i,e);for(const a of s.values())Tg(a,e,o);for(const a of i.messages)Tg(a,e,o),Eg(a,e);e.addFile(i,!0)}function Eg(t,e){switch(t.kind){case"file":for(const n of t.proto.extension){const r=Ng(n,t,e);t.extensions.push(r),e.add(r)}break;case"message":for(const n of t.proto.extension){const r=Ng(n,t,e);t.nestedExtensions.push(r),e.add(r)}for(const n of t.nestedMessages)Eg(n,e);break}}function Tg(t,e,n){const r=t.proto.oneofDecl.map(s=>xj(s,t)),i=new Set;for(const s of t.proto.field){const o=Ej(s,r),a=Ng(s,t,e,o,n);t.fields.push(a),t.field[a.localName]=a,o===void 0?t.members.push(a):(o.fields.push(a),i.has(o)||(i.add(o),t.members.push(o)))}for(const s of r.filter(o=>i.has(o)))t.oneofs.push(s);for(const s of t.nestedMessages)Tg(s,e,n)}function nP(t,e,n,r){var i,s,o,a,l;const c=Sj(t.name,t.value),u={kind:"enum",proto:t,deprecated:(s=(i=t.options)===null||i===void 0?void 0:i.deprecated)!==null&&s!==void 0?s:!1,file:e,parent:n,open:!0,name:t.name,typeName:oh(t,n,e),value:{},values:[],sharedPrefix:c,toString(){return`enum ${this.typeName}`}};u.open=_j(u),r.add(u);for(const f of t.value){const d=f.name;u.values.push(u.value[f.number]={kind:"enum_value",proto:f,deprecated:(a=(o=f.options)===null||o===void 0?void 0:o.deprecated)!==null&&a!==void 0?a:!1,parent:u,name:d,localName:Dl(c==null?d:d.substring(c.length)),number:f.number,toString(){return`enum value ${u.typeName}.${d}`}})}((l=n==null?void 0:n.nestedEnums)!==null&&l!==void 0?l:e.enums).push(u)}function rP(t,e,n,r,i){var s,o,a,l;const c={kind:"message",proto:t,deprecated:(o=(s=t.options)===null||s===void 0?void 0:s.deprecated)!==null&&o!==void 0?o:!1,file:e,parent:n,name:t.name,typeName:oh(t,n,e),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((a=t.options)===null||a===void 0?void 0:a.mapEntry)===!0?i.add(c):(((l=n==null?void 0:n.nestedMessages)!==null&&l!==void 0?l:e.messages).push(c),r.add(c));for(const u of t.enumType)nP(u,e,c,r);for(const u of t.nestedType)rP(u,e,c,r,i)}function yj(t,e,n){var r,i;const s={kind:"service",proto:t,deprecated:(i=(r=t.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,file:e,name:t.name,typeName:oh(t,void 0,e),methods:[],method:{},toString(){return`service ${this.typeName}`}};e.services.push(s),n.add(s);for(const o of t.method){const a=bj(o,s,n);s.methods.push(a),s.method[a.localName]=a}}function bj(t,e,n){var r,i,s,o;let a;t.clientStreaming&&t.serverStreaming?a="bidi_streaming":t.clientStreaming?a="client_streaming":t.serverStreaming?a="server_streaming":a="unary";const l=n.getMessage(Lr(t.inputType)),c=n.getMessage(Lr(t.outputType));Zn(l,`invalid MethodDescriptorProto: input_type ${t.inputType} not found`),Zn(c,`invalid MethodDescriptorProto: output_type ${t.inputType} not found`);const u=t.name;return{kind:"rpc",proto:t,deprecated:(i=(r=t.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,parent:e,name:u,localName:Dl(u.length?Dl(u[0].toLowerCase()+u.substring(1)):u),methodKind:a,input:l,output:c,idempotency:(o=(s=t.options)===null||s===void 0?void 0:s.idempotencyLevel)!==null&&o!==void 0?o:fj,toString(){return`rpc ${e.typeName}.${u}`}}}function xj(t,e){return{kind:"oneof",proto:t,deprecated:!1,parent:e,fields:[],name:t.name,localName:Dl(Yo(t.name)),toString(){return`oneof ${e.typeName}.${this.name}`}}}function Ng(t,e,n,r,i){var s,o,a;const l=i===void 0,c={kind:"field",proto:t,deprecated:(o=(s=t.options)===null||s===void 0?void 0:s.deprecated)!==null&&o!==void 0?o:!1,name:t.name,number:t.number,scalar:void 0,message:void 0,enum:void 0,presence:Tj(t,r,l,e),utf8Validation:Cj(t,e),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(l){const h=e.kind=="file"?e:e.file,p=e.kind=="file"?void 0:e,m=oh(t,p,h);c.kind="extension",c.file=h,c.parent=p,c.oneof=void 0,c.typeName=m,c.jsonName=`[${m}]`,c.toString=()=>`extension ${m}`;const O=n.getMessage(Lr(t.extendee));Zn(O,`invalid FieldDescriptorProto: extendee ${t.extendee} not found`),c.extendee=O}else{const h=e;Zn(h.kind=="message"),c.parent=h,c.oneof=r,c.localName=r?Yo(t.name):Dl(Yo(t.name)),c.jsonName=t.jsonName,c.toString=()=>`field ${h.typeName}.${t.name}`}const u=t.label,f=t.type,d=(a=t.options)===null||a===void 0?void 0:a.jstype;if(u===my){const h=f==el?i==null?void 0:i.get(Lr(t.typeName)):void 0;if(h){c.fieldKind="map";const{key:p,value:m}=Pj(h);return c.mapKey=p.scalar,c.mapKind=m.fieldKind,c.message=m.message,c.delimitedEncoding=!1,c.enum=m.enum,c.scalar=m.scalar,c}switch(c.fieldKind="list",f){case el:case Zl:c.listKind="message",c.message=n.getMessage(Lr(t.typeName)),Zn(c.message),c.delimitedEncoding=av(t,e);break;case rv:c.listKind="enum",c.enum=n.getEnum(Lr(t.typeName)),Zn(c.enum);break;default:c.listKind="scalar",c.scalar=f,c.longAsString=d==iv;break}return c.packed=Nj(t,e),c}switch(f){case el:case Zl:c.fieldKind="message",c.message=n.getMessage(Lr(t.typeName)),Zn(c.message,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),c.delimitedEncoding=av(t,e),c.getDefaultValue=()=>{};break;case rv:{const h=n.getEnum(Lr(t.typeName));Zn(h!==void 0,`invalid FieldDescriptorProto: type_name ${t.typeName} not found`),c.fieldKind="enum",c.enum=n.getEnum(Lr(t.typeName)),c.getDefaultValue=()=>Ll(t,"defaultValue")?tj(h,t.defaultValue):void 0;break}default:{c.fieldKind="scalar",c.scalar=f,c.longAsString=d==iv,c.getDefaultValue=()=>Ll(t,"defaultValue")?nj(f,t.defaultValue):void 0;break}}return c}function vj(t){switch(t.syntax){case"":case"proto2":return sj;case"proto3":return oj;case"editions":if(t.edition===aj)return Oj;if(t.edition in tP)return t.edition;throw new Error(`${t.name}: unsupported edition`);default:throw new Error(`${t.name}: unsupported syntax "${t.syntax}"`)}}function wj(t,e){return t.dependency.map(n=>{const r=e.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${t.name}`);return r})}function Sj(t,e){const n=kj(t)+"_";for(const r of e){if(!r.name.toLowerCase().startsWith(n))return;const i=r.name.substring(n.length);if(i.length==0||/^\d/.test(i))return}return n}function kj(t){return(t.substring(0,1)+t.substring(1).replace(/[A-Z]/g,e=>"_"+e)).toLowerCase()}function oh(t,e,n){let r;return e?r=`${e.typeName}.${t.name}`:n.proto.package.length>0?r=`${n.proto.package}.${t.name}`:r=`${t.name}`,r}function Lr(t){return t.startsWith(".")?t.substring(1):t}function Ej(t,e){if(!Ll(t,"oneofIndex")||t.proto3Optional)return;const n=e[t.oneofIndex];return Zn(n,`invalid FieldDescriptorProto: oneof #${t.oneofIndex} for field #${t.number} not found`),n}function Tj(t,e,n,r){if(t.label==uj)return dj;if(t.label==my)return sv;if(e||t.proto3Optional||n)return kp;const i=Is("fieldPresence",{proto:t,parent:r});return i==sv&&(t.type==el||t.type==Zl)?kp:i}function Nj(t,e){if(t.label!=my)return!1;switch(t.type){case lj:case cj:case Zl:case el:return!1}const n=t.options;return n&&Ll(n,"packed")?n.packed:hj==Is("repeatedFieldEncoding",{proto:t,parent:e})}function Pj(t){const e=t.fields.find(r=>r.number===1),n=t.fields.find(r=>r.number===2);return Zn(e&&e.fieldKind=="scalar"&&e.scalar!=Z.BYTES&&e.scalar!=Z.FLOAT&&e.scalar!=Z.DOUBLE&&n&&n.fieldKind!="list"&&n.fieldKind!="map"),{key:e,value:n}}function _j(t){var e;return mj==Is("enumType",{proto:t.proto,parent:(e=t.parent)!==null&&e!==void 0?e:t.file})}function av(t,e){return t.type==Zl?!0:pj==Is("messageEncoding",{proto:t,parent:e})}function Cj(t,e){return gj==Is("utf8Validation",{proto:t,parent:e})}function Is(t,e){var n,r;const i=(n=e.proto.options)===null||n===void 0?void 0:n.features;if(i){const s=i[t];if(s!=0)return s}if("kind"in e){if(e.kind=="message")return Is(t,(r=e.parent)!==null&&r!==void 0?r:e.file);const s=tP[e.edition];if(!s)throw new Error(`feature default for edition ${e.edition} not found`);return s[t]}return Is(t,e.parent)}function Zn(t,e){if(!t)throw new Error(e)}function $j(t){const e=Aj(t);return e.messageType.forEach(py),eP(e,()=>{}).getFile(e.name)}function Aj(t){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},t),{messageType:t.messageType.map(iP),enumType:t.enumType.map(sP)}))}function iP(t){var e,n,r,i,s,o,a,l;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:t.name,field:(n=(e=t.field)===null||e===void 0?void 0:e.map(Ij))!==null&&n!==void 0?n:[],extension:[],nestedType:(i=(r=t.nestedType)===null||r===void 0?void 0:r.map(iP))!==null&&i!==void 0?i:[],enumType:(o=(s=t.enumType)===null||s===void 0?void 0:s.map(sP))!==null&&o!==void 0?o:[],extensionRange:(l=(a=t.extensionRange)===null||a===void 0?void 0:a.map(u=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},u)))!==null&&l!==void 0?l:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function Ij(t){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},t),{options:t.options?Qj(t.options):void 0}))}function Qj(t){var e,n,r;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},t),{targets:(e=t.targets)!==null&&e!==void 0?e:[],editionDefaults:(r=(n=t.editionDefaults)===null||n===void 0?void 0:n.map(s=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},s)))!==null&&r!==void 0?r:[],uninterpretedOption:[]}))}function sP(t){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:t.name,reservedName:[],reservedRange:[],value:t.value.map(n=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},n))})}function Ec(t,e,...n){return n.reduce((r,i)=>r.nestedMessages[i],t.messages[e])}const Rj=$j({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false",options:{}},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"removal_error",number:5,type:9,label:1}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_UNSTABLE",number:9999},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),Mj=Ec(Rj,1);var lv;(function(t){t[t.DECLARATION=0]="DECLARATION",t[t.UNVERIFIED=1]="UNVERIFIED"})(lv||(lv={}));var cv;(function(t){t[t.DOUBLE=1]="DOUBLE",t[t.FLOAT=2]="FLOAT",t[t.INT64=3]="INT64",t[t.UINT64=4]="UINT64",t[t.INT32=5]="INT32",t[t.FIXED64=6]="FIXED64",t[t.FIXED32=7]="FIXED32",t[t.BOOL=8]="BOOL",t[t.STRING=9]="STRING",t[t.GROUP=10]="GROUP",t[t.MESSAGE=11]="MESSAGE",t[t.BYTES=12]="BYTES",t[t.UINT32=13]="UINT32",t[t.ENUM=14]="ENUM",t[t.SFIXED32=15]="SFIXED32",t[t.SFIXED64=16]="SFIXED64",t[t.SINT32=17]="SINT32",t[t.SINT64=18]="SINT64"})(cv||(cv={}));var uv;(function(t){t[t.OPTIONAL=1]="OPTIONAL",t[t.REPEATED=3]="REPEATED",t[t.REQUIRED=2]="REQUIRED"})(uv||(uv={}));var fv;(function(t){t[t.SPEED=1]="SPEED",t[t.CODE_SIZE=2]="CODE_SIZE",t[t.LITE_RUNTIME=3]="LITE_RUNTIME"})(fv||(fv={}));var dv;(function(t){t[t.STRING=0]="STRING",t[t.CORD=1]="CORD",t[t.STRING_PIECE=2]="STRING_PIECE"})(dv||(dv={}));var hv;(function(t){t[t.JS_NORMAL=0]="JS_NORMAL",t[t.JS_STRING=1]="JS_STRING",t[t.JS_NUMBER=2]="JS_NUMBER"})(hv||(hv={}));var pv;(function(t){t[t.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",t[t.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",t[t.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(pv||(pv={}));var mv;(function(t){t[t.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",t[t.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",t[t.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",t[t.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",t[t.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",t[t.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",t[t.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",t[t.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",t[t.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",t[t.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(mv||(mv={}));var Pg;(function(t){t[t.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",t[t.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",t[t.IDEMPOTENT=2]="IDEMPOTENT"})(Pg||(Pg={}));var gv;(function(t){t[t.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",t[t.EXPORT_ALL=1]="EXPORT_ALL",t[t.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",t[t.LOCAL_ALL=3]="LOCAL_ALL",t[t.STRICT=4]="STRICT"})(gv||(gv={}));var Ov;(function(t){t[t.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",t[t.EXPLICIT=1]="EXPLICIT",t[t.IMPLICIT=2]="IMPLICIT",t[t.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(Ov||(Ov={}));var yv;(function(t){t[t.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",t[t.OPEN=1]="OPEN",t[t.CLOSED=2]="CLOSED"})(yv||(yv={}));var bv;(function(t){t[t.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",t[t.PACKED=1]="PACKED",t[t.EXPANDED=2]="EXPANDED"})(bv||(bv={}));var xv;(function(t){t[t.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",t[t.VERIFY=2]="VERIFY",t[t.NONE=3]="NONE"})(xv||(xv={}));var vv;(function(t){t[t.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",t[t.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",t[t.DELIMITED=2]="DELIMITED"})(vv||(vv={}));var wv;(function(t){t[t.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",t[t.ALLOW=1]="ALLOW",t[t.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(wv||(wv={}));var Sv;(function(t){t[t.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",t[t.STYLE2024=1]="STYLE2024",t[t.STYLE_LEGACY=2]="STYLE_LEGACY"})(Sv||(Sv={}));var kv;(function(t){t[t.NONE=0]="NONE",t[t.SET=1]="SET",t[t.ALIAS=2]="ALIAS"})(kv||(kv={}));var Ev;(function(t){t[t.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",t[t.EDITION_LEGACY=900]="EDITION_LEGACY",t[t.EDITION_PROTO2=998]="EDITION_PROTO2",t[t.EDITION_PROTO3=999]="EDITION_PROTO3",t[t.EDITION_2023=1e3]="EDITION_2023",t[t.EDITION_2024=1001]="EDITION_2024",t[t.EDITION_UNSTABLE=9999]="EDITION_UNSTABLE",t[t.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",t[t.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",t[t.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",t[t.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",t[t.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",t[t.EDITION_MAX=2147483647]="EDITION_MAX"})(Ev||(Ev={}));var Tv;(function(t){t[t.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",t[t.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",t[t.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(Tv||(Tv={}));function oP(t){return Object.assign(Object.assign({readUnknownFields:!0,recursionLimit:100},t),{depth:0})}function ah(t,e,n){const r=er(t,void 0,!1);return aP(r,new ay(e),oP(n),!1,e.byteLength),r.message}function aP(t,e,n,r,i){var s;if(++n.depth>n.recursionLimit)throw new Error(`cannot decode ${t.desc} from binary: maximum recursion depth of ${n.recursionLimit} reached`);const o=r?e.len:e.pos+i;let a,l;const c=(s=t.getUnknown())!==null&&s!==void 0?s:[];for(;e.pos<o&&([a,l]=e.tag(),!(r&&l==qe.EndGroup));){const u=t.findNumber(a);if(!u){const f=n.recursionLimit-n.depth,d=e.skip(l,a,f);n.readUnknownFields&&c.push({no:a,wireType:l,data:d});continue}lP(t,e,u,l,n)}if(r&&(l!=qe.EndGroup||a!==i))throw new Error("invalid end group tag");c.length>0&&t.setUnknown(c),n.depth--}function lP(t,e,n,r,i){var s;switch(n.fieldKind){case"scalar":t.set(n,Go(e,n.scalar,n.utf8Validation));break;case"enum":const o=Go(e,Z.INT32);if(n.enum.open)t.set(n,o);else if(n.enum.values.some(l=>l.number===o))t.set(n,o);else if(i.readUnknownFields){const l=[];wg(o,l);const c=(s=t.getUnknown())!==null&&s!==void 0?s:[];c.push({no:n.number,wireType:r,data:new Uint8Array(l)}),t.setUnknown(c)}break;case"message":t.set(n,gy(e,i,n,t.get(n)));break;case"list":Dj(e,r,t.get(n),i);break;case"map":Lj(e,t.get(n),i);break}}function Lj(t,e,n){const r=e.field();let i,s;const o=t.uint32(),a=t.pos+o;for(;t.pos<a;){const[l]=t.tag();switch(l){case 1:i=Go(t,r.mapKey,r.utf8Validation);break;case 2:switch(r.mapKind){case"scalar":s=Go(t,r.scalar,r.utf8Validation);break;case"enum":s=t.int32();break;case"message":s=gy(t,n,r);break}break}}if(i===void 0&&(i=Uo(r.mapKey,!1)),s===void 0)switch(r.mapKind){case"scalar":s=Uo(r.scalar,!1);break;case"enum":s=r.enum.values[0].number;break;case"message":s=er(r.message,void 0,!1);break}e.set(i,s)}function Dj(t,e,n,r){var i;const s=n.field();if(s.listKind==="message"){n.add(gy(t,r,s));return}const o=(i=s.scalar)!==null&&i!==void 0?i:Z.INT32;if(!(e==qe.LengthDelimited&&o!=Z.STRING&&o!=Z.BYTES)){n.add(Go(t,o,s.utf8Validation));return}const l=t.uint32()+t.pos;for(;t.pos<l;)n.add(Go(t,o,s.utf8Validation))}function gy(t,e,n,r){const i=n.delimitedEncoding,s=r??er(n.message,void 0,!1);return aP(s,t,e,i,i?n.number:t.uint32()),s}function Go(t,e,n=!1){switch(e){case Z.STRING:return t.string(n);case Z.BOOL:return t.bool();case Z.DOUBLE:return t.double();case Z.FLOAT:return t.float();case Z.INT32:return t.int32();case Z.INT64:return t.int64();case Z.UINT64:return t.uint64();case Z.FIXED64:return t.fixed64();case Z.BYTES:return t.bytes();case Z.FIXED32:return t.fixed32();case Z.SFIXED32:return t.sfixed32();case Z.SFIXED64:return t.sfixed64();case Z.SINT64:return t.sint64();case Z.UINT32:return t.uint32();case Z.SINT32:return t.sint32()}}function Oy(t,e){var n;const r=ah(Mj,hy(t));return r.messageType.forEach(py),r.dependency=(n=e==null?void 0:e.map(s=>s.proto.name))!==null&&n!==void 0?n:[],eP(r,s=>e==null?void 0:e.find(o=>o.proto.name===s)).getFile(r.name)}const Zj=Oy("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Vj=Ec(Zj,0),jj=3,Nv={writeUnknownFields:!0};function Bj(t){return t?Object.assign(Object.assign({},Nv),t):Nv}function cP(t,e,n){return Jf(new BN,Bj(n),er(t,e)).finish()}function Jf(t,e,n){var r;for(const i of n.sortedFields){if(!n.isSet(i)){if(i.presence==jj)throw new Error(`cannot encode ${i} to binary: required field not set`);continue}uP(t,e,n,i)}if(e.writeUnknownFields)for(const{no:i,wireType:s,data:o}of(r=n.getUnknown())!==null&&r!==void 0?r:[])t.tag(i,s).raw(o);return t}function uP(t,e,n,r){var i;switch(r.fieldKind){case"scalar":case"enum":ed(t,n.desc.typeName,r.name,(i=r.scalar)!==null&&i!==void 0?i:Z.INT32,r.number,n.get(r));break;case"list":Fj(t,e,r,n.get(r));break;case"message":fP(t,e,r,n.get(r));break;case"map":for(const[s,o]of n.get(r))Xj(t,e,r,s,o);break}}function ed(t,e,n,r,i,s){dP(t.tag(i,zj(r)),e,n,r,s)}function fP(t,e,n,r){n.delimitedEncoding?Jf(t.tag(n.number,qe.StartGroup),e,r).tag(n.number,qe.EndGroup):Jf(t.tag(n.number,qe.LengthDelimited).fork(),e,r).join()}function Fj(t,e,n,r){var i;if(n.listKind=="message"){for(const o of r)fP(t,e,n,o);return}const s=(i=n.scalar)!==null&&i!==void 0?i:Z.INT32;if(n.packed){if(!r.size)return;t.tag(n.number,qe.LengthDelimited).fork();for(const o of r)dP(t,n.parent.typeName,n.name,s,o);t.join();return}for(const o of r)ed(t,n.parent.typeName,n.name,s,n.number,o)}function Xj(t,e,n,r,i){var s;switch(t.tag(n.number,qe.LengthDelimited).fork(),ed(t,n.parent.typeName,n.name,n.mapKey,1,r),n.mapKind){case"scalar":case"enum":ed(t,n.parent.typeName,n.name,(s=n.scalar)!==null&&s!==void 0?s:Z.INT32,2,i);break;case"message":Jf(t.tag(2,qe.LengthDelimited).fork(),e,i).join();break}t.join()}function dP(t,e,n,r,i){try{switch(r){case Z.STRING:t.string(i);break;case Z.BOOL:t.bool(i);break;case Z.DOUBLE:t.double(i);break;case Z.FLOAT:t.float(i);break;case Z.INT32:t.int32(i);break;case Z.INT64:t.int64(i);break;case Z.UINT64:t.uint64(i);break;case Z.FIXED64:t.fixed64(i);break;case Z.BYTES:t.bytes(i);break;case Z.FIXED32:t.fixed32(i);break;case Z.SFIXED32:t.sfixed32(i);break;case Z.SFIXED64:t.sfixed64(i);break;case Z.SINT64:t.sint64(i);break;case Z.UINT32:t.uint32(i);break;case Z.SINT32:t.sint32(i);break}}catch(s){throw s instanceof Error?new Error(`cannot encode field ${e}.${n} to binary: ${s.message}`):s}}function zj(t){switch(t){case Z.BYTES:case Z.STRING:return qe.LengthDelimited;case Z.DOUBLE:case Z.FIXED64:case Z.SFIXED64:return qe.Bit64;case Z.FIXED32:case Z.SFIXED32:case Z.FLOAT:return qe.Bit32;default:return qe.Varint}}function Wj(t,e,n){let r=!1;return n||(n=qn(Vj),r=!0),n.value=cP(t,e),n.typeUrl=Gj(e.$typeName),r?n:void 0}function Uj(t,e){if(t.typeUrl==="")return!1;const n=typeof e=="string"?e:e.typeName,r=hP(t.typeUrl);return n===r}function Yj(t,e){if(t.typeUrl==="")return;const n=e.kind=="message"?e:e.getMessage(hP(t.typeUrl));if(!(!n||!Uj(t,n)))return ah(n,t.value)}function Gj(t){return`type.googleapis.com/${t}`}function hP(t){const e=t.lastIndexOf("/"),n=e>=0?t.substring(e+1):t;if(!n.length)throw new Error(`invalid type url: ${t}`);return n}const lh=Oy("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),Hj=Ec(lh,0),pP=Ec(lh,1),qj=Ec(lh,2);var _g;(function(t){t[t.NULL_VALUE=0]="NULL_VALUE"})(_g||(_g={}));function Kj(t,e,n){mP(e,t);const r=eB(t.$unknown,e),[i,s,o]=ch(e),a=oP(n);for(const l of r)lP(i,new ay(l.data),s,l.wireType,a);return o()}function Jj(t,e,n){var r;mP(e,t);const i=((r=t.$unknown)!==null&&r!==void 0?r:[]).filter(c=>c.no!==e.number),[s,o]=ch(e,n),a=new BN;uP(a,{writeUnknownFields:!0},s,o);const l=new ay(a.finish());for(;l.pos<l.len;){const[c,u]=l.tag(),f=l.skip(u,c);i.push({no:c,wireType:u,data:f})}t.$unknown=i}function eB(t,e){if(t===void 0)return[];if(e.fieldKind==="enum"||e.fieldKind==="scalar"){for(let n=t.length-1;n>=0;--n)if(t[n].no==e.number)return[t[n]];return[]}return t.filter(n=>n.no===e.number)}function ch(t,e){const n=t.typeName,r=Object.assign(Object.assign({},t),{kind:"field",parent:t.extendee,localName:n}),i=Object.assign(Object.assign({},t.extendee),{fields:[r],members:[r],oneofs:[]}),s=qn(i,e!==void 0?{[n]:e}:void 0);return[er(i,s),r,()=>{const o=s[n];if(o===void 0){const a=t.message;return la(a)?Uo(a.fields[0].scalar,a.fields[0].longAsString):qn(a)}return o}]}function mP(t,e){if(t.extendee.typeName!=e.$typeName)throw new Error(`extension ${t.typeName} can only be applied to message ${t.extendee.typeName}`)}const tB=3,nB=2,Pv={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function rB(t){return t?Object.assign(Object.assign({},Pv),t):Pv}function iB(t,e,n){return Tc(er(t,e),rB(n))}function sB(t,e,n){var r;const i=iB(t,e,n);return JSON.stringify(i,null,(r=n==null?void 0:n.prettySpaces)!==null&&r!==void 0?r:0)}function Tc(t,e){var n;const r=gP(t,e);if(r!==void 0)return r;const i={};for(const s of t.sortedFields){if(!t.isSet(s)){if(s.presence==tB)throw new Error(`cannot encode ${s} to JSON: required field not set`);if(!e.alwaysEmitImplicit||s.presence!==nB)continue}const o=_v(s,t.get(s),e);o!==void 0&&(i[lB(s,e)]=o)}if(e.registry){const s=new Set;for(const{no:o}of(n=t.getUnknown())!==null&&n!==void 0?n:[])if(!s.has(o)){s.add(o);const a=e.registry.getExtensionFor(t.desc,o);if(!a)continue;const l=Kj(t.message,a),[c,u]=ch(a,l),f=_v(u,c.get(u),e);f!==void 0&&(i[a.jsonName]=f)}}return i}function _v(t,e,n){switch(t.fieldKind){case"scalar":return uh(t,e);case"message":return Tc(e,n);case"enum":return yy(t.enum,e,n.enumAsInteger);case"list":return aB(e,n);case"map":return oB(e,n)}}function oB(t,e){const n=t.field(),r={};switch(n.mapKind){case"scalar":for(const[i,s]of t)r[i]=uh(n,s);break;case"message":for(const[i,s]of t)r[i]=Tc(s,e);break;case"enum":for(const[i,s]of t)r[i]=yy(n.enum,s,e.enumAsInteger);break}return e.alwaysEmitImplicit||t.size>0?r:void 0}function aB(t,e){const n=t.field(),r=[];switch(n.listKind){case"scalar":for(const i of t)r.push(uh(n,i));break;case"enum":for(const i of t)r.push(yy(n.enum,i,e.enumAsInteger));break;case"message":for(const i of t)r.push(Tc(i,e));break}return e.alwaysEmitImplicit||r.length>0?r:void 0}function yy(t,e,n){var r;if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: expected number, got ${dt(e)}`);if(t.typeName=="google.protobuf.NullValue")return null;if(n)return e;const i=t.value[e];return(r=i==null?void 0:i.name)!==null&&r!==void 0?r:e}function uh(t,e){var n,r,i,s,o,a;switch(t.scalar){case Z.INT32:case Z.SFIXED32:case Z.SINT32:case Z.FIXED32:case Z.UINT32:if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: ${(n=ss(t,e))===null||n===void 0?void 0:n.message}`);return e;case Z.FLOAT:case Z.DOUBLE:if(typeof e!="number")throw new Error(`cannot encode ${t} to JSON: ${(r=ss(t,e))===null||r===void 0?void 0:r.message}`);return Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case Z.STRING:if(typeof e!="string")throw new Error(`cannot encode ${t} to JSON: ${(i=ss(t,e))===null||i===void 0?void 0:i.message}`);return e;case Z.BOOL:if(typeof e!="boolean")throw new Error(`cannot encode ${t} to JSON: ${(s=ss(t,e))===null||s===void 0?void 0:s.message}`);return e;case Z.UINT64:case Z.FIXED64:case Z.INT64:case Z.SFIXED64:case Z.SINT64:if(typeof e=="bigint"||typeof e=="string"||typeof e=="number"&&Number.isInteger(e))return e.toString();throw new Error(`cannot encode ${t} to JSON: ${(o=ss(t,e))===null||o===void 0?void 0:o.message}`);case Z.BYTES:if(e instanceof Uint8Array)return qN(e);throw new Error(`cannot encode ${t} to JSON: ${(a=ss(t,e))===null||a===void 0?void 0:a.message}`)}}function lB(t,e){return e.useProtoFieldName?t.name:t.jsonName}function gP(t,e){if(t.desc.typeName.startsWith("google.protobuf."))switch(t.desc.typeName){case"google.protobuf.Any":return cB(t.message,e);case"google.protobuf.Timestamp":return dB(t.message);case"google.protobuf.Duration":return uB(t.message);case"google.protobuf.FieldMask":return fB(t.message);case"google.protobuf.Struct":return OP(t.message);case"google.protobuf.Value":return by(t.message);case"google.protobuf.ListValue":return yP(t.message);default:if(la(t.desc)){const n=t.desc.fields[0];return uh(n,t.get(n))}return}}function cB(t,e){if(t.typeUrl==="")return{};const{registry:n}=e;let r,i;if(n&&(r=Yj(t,n),r&&(i=n.getMessage(r.$typeName))),!i||!r)throw new Error(`cannot encode message ${t.$typeName} to JSON: "${t.typeUrl}" is not in the type registry`);const s=er(i,r),o=QN(i)?{value:gP(s,e)}:Tc(s,e);return o["@type"]=t.typeUrl,o}function uB(t){const e=Number(t.seconds),n=t.nanos;if(e>315576e6||e<-315576e6)throw new Error(`cannot encode message ${t.$typeName} to JSON: value out of range`);if(e>0&&n<0||e<0&&n>0)throw new Error(`cannot encode message ${t.$typeName} to JSON: nanos sign must match seconds sign`);let r=t.seconds.toString();if(n!==0){let i=Math.abs(n).toString();i="0".repeat(9-i.length)+i,i.substring(3)==="000000"?i=i.substring(0,3):i.substring(6)==="000"&&(i=i.substring(0,6)),r+="."+i,n<0&&e==0&&(r="-"+r)}return r+"s"}function fB(t){return t.paths.map(e=>{if(JN(Yo(e))!==e)throw new Error(`cannot encode message ${t.$typeName} to JSON: lowerCamelCase of path name "${e}" is irreversible`);return Yo(e)}).join(",")}function OP(t){const e={};for(const[n,r]of Object.entries(t.fields))e[n]=by(r);return e}function by(t){switch(t.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(t.kind.value))throw new Error(`${t.$typeName} cannot be NaN or Infinity`);return t.kind.value;case"boolValue":return t.kind.value;case"stringValue":return t.kind.value;case"structValue":return OP(t.kind.value);case"listValue":return yP(t.kind.value);default:throw new Error(`${t.$typeName} must have a value`)}}function yP(t){return t.values.map(by)}function dB(t){const e=Number(t.seconds)*1e3;if(e<Date.parse("0001-01-01T00:00:00Z")||e>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${t.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(t.nanos<0)throw new Error(`cannot encode message ${t.$typeName} to JSON: nanos must not be negative`);if(t.nanos>999999999)throw new Error(`cannot encode message ${t.$typeName} to JSON: nanos must not be greater than 99999999`);let n="Z";if(t.nanos>0){const r=(t.nanos+1e9).toString().substring(1);r.substring(3)==="000000"?n="."+r.substring(0,3)+"Z":r.substring(6)==="000"?n="."+r.substring(0,6)+"Z":n="."+r+"Z"}return new Date(e).toISOString().replace(".000Z",n)}function hB(t){return Object.assign(Object.assign({ignoreUnknownFields:!1,recursionLimit:100},t),{depth:0})}function pB(t,e,n){return bP(t,wB(e,t.typeName),n)}function bP(t,e,n){const r=er(t);try{Vl(r,e,hB(n))}catch(i){throw WV(i)?new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i}):i}return r.message}const Ep=new WeakMap;function mB(t,e){var n;if(!Ep.has(t)){const r=new Map;for(const i of t.fields)r.set(i.name,i).set(i.jsonName,i);Ep.set(t,r)}return(n=Ep.get(t))===null||n===void 0?void 0:n.get(e)}function Vl(t,e,n){var r;if(++n.depth>n.recursionLimit)throw new Error(`cannot decode ${t.desc} from JSON: maximum recursion depth of ${n.recursionLimit} reached`);if(kB(t,e,n)){n.depth--;return}if(e==null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode ${t.desc} from JSON: ${dt(e)}`);const i=new Map,s=new Set;for(const[o,a]of Object.entries(e)){const l=mB(t.desc,o);if(l){if(s.has(l))throw new It(l,"set multiple times");if(s.add(l),l.oneof&&a===null&&l.fieldKind=="scalar")continue;if(l.oneof){const c=i.get(l.oneof);if(c!==void 0)throw new It(l.oneof,`oneof set multiple times by ${c.name} and ${l.name}`);i.set(l.oneof,l)}Cv(t,l,a,n)}else{let c;if(o.startsWith("[")&&o.endsWith("]")&&(c=(r=n.registry)===null||r===void 0?void 0:r.getExtension(o.substring(1,o.length-1)))&&c.extendee.typeName===t.desc.typeName){const[u,f,d]=ch(c);Cv(u,f,a,n),Jj(t.message,c,d())}if(!c&&!n.ignoreUnknownFields)throw new Error(`cannot decode ${t.desc} from JSON: key "${o}" is unknown`)}}n.depth--}function Cv(t,e,n,r){switch(e.fieldKind){case"scalar":xB(t,e,n);break;case"enum":bB(t,e,n,r);break;case"message":yB(t,e,n,r);break;case"list":OB(t.get(e),n,r);break;case"map":gB(t.get(e),n,r);break}}function xP(t,e,n){if(t.scalar&&e!==null)return xy(t,e);if(t.message&&!td(t,e)){const r=er(t.message);return Vl(r,e,n),r}if(t.enum&&!td(t,e))return vP(t.enum,e,n.ignoreUnknownFields);throw new It(t,`${t.fieldKind==="list"?"list item":"map value"} must not be null`)}function gB(t,e,n){if(e===null)return;const r=t.field();if(typeof e!="object"||Array.isArray(e))throw new It(r,"expected object, got "+dt(e));const i=new Set;for(const[s,o]of Object.entries(e)){const a=vB(r.mapKey,s);if(i.has(a))throw new It(r,`duplicate map key "${s}"`);i.add(a);const l=xP(r,o,n);l!==fh&&t.set(a,l)}}function OB(t,e,n){if(e===null)return;const r=t.field();if(!Array.isArray(e))throw new It(r,"expected Array, got "+dt(e));for(const i of e){const s=xP(r,i,n);s!==fh&&t.add(s)}}function yB(t,e,n,r){if(td(e,n)){t.clear(e);return}const i=t.isSet(e)?t.get(e):er(e.message);Vl(i,n,r),t.set(e,i)}function bB(t,e,n,r){if(td(e,n)){t.clear(e);return}const i=vP(e.enum,n,r.ignoreUnknownFields);i!==fh&&t.set(e,i)}function xB(t,e,n){n===null?t.clear(e):t.set(e,xy(e,n))}function td(t,e){var n,r;return e===null&&((n=t.message)===null||n===void 0?void 0:n.typeName)!="google.protobuf.Value"&&((r=t.enum)===null||r===void 0?void 0:r.typeName)!="google.protobuf.NullValue"}const fh=Symbol();function vP(t,e,n){if(e===null)return t.values[0].number;switch(typeof e){case"number":if(Number.isInteger(e))return e;break;case"string":const r=t.values.find(i=>i.name===e);if(r!==void 0)return r.number;if(n)return fh;break}throw new Error(`cannot decode ${t} from JSON: ${dt(e)}`)}function xy(t,e){switch(t.scalar){case Z.DOUBLE:case Z.FLOAT:if(e==="NaN")return NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof e=="number"){if(Number.isNaN(e))throw new It(t,"unexpected NaN number");if(!Number.isFinite(e))throw new It(t,"unexpected infinite number");break}if(typeof e=="string"){if(e===""||e.trim().length!==e.length)break;const n=Number(e);if(!Number.isFinite(n))break;return n}break;case Z.INT32:case Z.FIXED32:case Z.SFIXED32:case Z.SINT32:case Z.UINT32:return wP(e);case Z.BYTES:if(typeof e=="string"){if(e==="")return new Uint8Array(0);try{return hy(e)}catch(n){const r=n instanceof Error?n.message:String(n);throw new It(t,r)}}break}return e}function vB(t,e){switch(t){case Z.BOOL:switch(e){case"true":return!0;case"false":return!1}return e;case Z.INT32:case Z.FIXED32:case Z.UINT32:case Z.SFIXED32:case Z.SINT32:return wP(e);case Z.INT64:case Z.SINT64:case Z.SFIXED64:case Z.UINT64:case Z.FIXED64:return/^-?0+$/.test(e)?"0":e.replace(/^(-?)0+(?=\d)/,"$1");default:return e}}function wP(t){if(typeof t=="string"){if(t===""||t.trim().length!==t.length)return t;const e=Number(t);return Number.isNaN(e)?t:e}return t}function wB(t,e){let n;try{n=JSON.parse(t)}catch(r){const i=r instanceof Error?r.message:String(r);throw new Error(`cannot decode message ${e} from JSON: ${i}`,{cause:r})}return SB(t,e),n}function SB(t,e){const n=[];let r=!1,i=0;for(;i<t.length;)switch(t[i]){case"{":n.push(new Set),r=!0,i++;break;case"[":n.push(null),r=!1,i++;break;case"}":case"]":n.pop(),r=!1,i++;break;case",":r=n[n.length-1]!=null,i++;break;case":":r=!1,i++;break;case'"':{const s=i++;let o=!1;for(;i<t.length;){if(t[i]=="\\"){o=!0,i+=2;continue}if(t[i]=='"')break;i++}const a=i++,l=n[n.length-1];if(r&&l){const c=o?JSON.parse(t.substring(s,a+1)):t.substring(s+1,a);if(l.has(c))throw new Error(`cannot decode message ${e} from JSON: duplicate object key "${c}"`);l.add(c)}r=!1;break}default:i++;break}}function kB(t,e,n){if(!t.desc.typeName.startsWith("google.protobuf."))return!1;switch(t.desc.typeName){case"google.protobuf.Any":return EB(t.message,e,n),!0;case"google.protobuf.Timestamp":return TB(t.message,e),!0;case"google.protobuf.Duration":return NB(t.message,e),!0;case"google.protobuf.FieldMask":return PB(t.message,e),!0;case"google.protobuf.Struct":return SP(t.message,e,n),!0;case"google.protobuf.Value":return vy(t.message,e,n),!0;case"google.protobuf.ListValue":return kP(t.message,e,n),!0;default:if(la(t.desc)){const r=t.desc.fields[0];return e===null?t.clear(r):t.set(r,xy(r,e)),!0}return!1}}function EB(t,e,n){var r;if(e===null||Array.isArray(e)||typeof e!="object")throw new Error(`cannot decode message ${t.$typeName} from JSON: expected object but got ${dt(e)}`);if(Object.keys(e).length==0)return;const i=e["@type"];if(typeof i!="string"||i=="")throw new Error(`cannot decode message ${t.$typeName} from JSON: "@type" is empty`);const s=i.includes("/")?i.substring(i.lastIndexOf("/")+1):i;if(!s.length)throw new Error(`cannot decode message ${t.$typeName} from JSON: "@type" is invalid`);const o=(r=n.registry)===null||r===void 0?void 0:r.getMessage(s);if(!o)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${i} is not in the type registry`);const a=er(o);if(QN(o)&&Object.prototype.hasOwnProperty.call(e,"value")){const l=e.value;Vl(a,l,n)}else{const l=Object.assign({},e);delete l["@type"],Vl(a,l,n)}Wj(a.desc,a.message,t)}function TB(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${dt(e)}`);const n=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error(`cannot decode message ${t.$typeName} from JSON: invalid RFC 3339 string`);const r=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(r))throw new Error(`cannot decode message ${t.$typeName} from JSON: invalid RFC 3339 string`);if(r<Date.parse("0001-01-01T00:00:00Z")||r>Date.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${t.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);t.seconds=Re.parse(r/1e3),t.nanos=0,n[7]&&(t.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9)}function NB(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${dt(e)}`);const n=e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${dt(e)}`);const r=Number(n[1]);if(r>315576e6||r<-315576e6)throw new Error(`cannot decode message ${t.$typeName} from JSON: ${dt(e)}`);if(t.seconds=Re.parse(r),typeof n[2]!="string")return;const i=n[2]+"0".repeat(9-n[2].length);t.nanos=parseInt(i),(r<0||Object.is(r,-0))&&(t.nanos=-t.nanos)}function PB(t,e){if(typeof e!="string")throw new Error(`cannot decode message ${t.$typeName} from JSON: ${dt(e)}`);e!==""&&(t.paths=e.split(",").map(n=>{if(n.includes("_"))throw new Error(`cannot decode message ${t.$typeName} from JSON: path names must be lowerCamelCase`);return JN(n)}))}function SP(t,e,n){if(typeof e!="object"||e==null||Array.isArray(e))throw new Error(`cannot decode message ${t.$typeName} from JSON ${dt(e)}`);for(const[r,i]of Object.entries(e)){const s=qn(pP);vy(s,i,n),t.fields[r]=s}}function vy(t,e,n){if(++n.depth>n.recursionLimit)throw new Error(`cannot decode ${t.$typeName} from JSON: maximum recursion depth of ${n.recursionLimit} reached`);switch(typeof e){case"number":t.kind={case:"numberValue",value:e};break;case"string":t.kind={case:"stringValue",value:e};break;case"boolean":t.kind={case:"boolValue",value:e};break;case"object":if(e===null)t.kind={case:"nullValue",value:_g.NULL_VALUE};else if(Array.isArray(e)){const r=qn(qj);kP(r,e,n),t.kind={case:"listValue",value:r}}else{const r=qn(Hj);SP(r,e,n),t.kind={case:"structValue",value:r}}break;default:throw new Error(`cannot decode message ${t.$typeName} from JSON ${dt(e)}`)}return n.depth--,t}function kP(t,e,n){if(!Array.isArray(e))throw new Error(`cannot decode message ${t.$typeName} from JSON ${dt(e)}`);for(const r of e){const i=qn(pP);vy(i,r,n),t.values.push(i)}}function Cg(t){const e=Se[t];return typeof e!="string"?t.toString():e[0].toLowerCase()+e.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}let mu;function _B(t){if(!mu){mu={};for(const e of Object.values(Se))typeof e!="string"&&(mu[Cg(e)]=e)}return mu[t]}class ze extends Error{constructor(e,n=Se.Unknown,r,i,s){super(CB(e,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=e,this.code=n,this.metadata=new Headers(r??{}),this.details=i??[],this.cause=s}static from(e,n=Se.Unknown){return e instanceof ze?e:e instanceof Error?e.name=="AbortError"||e.name=="TimeoutError"?new ze(e.message,Se.Canceled):new ze(e.message,n,void 0,void 0,e):new ze(String(e),n,void 0,void 0,e)}static[Symbol.hasInstance](e){return e instanceof Error?Object.getPrototypeOf(e)===ze.prototype?!0:e.name==="ConnectError"&&"code"in e&&typeof e.code=="number"&&"metadata"in e&&"details"in e&&Array.isArray(e.details)&&"rawMessage"in e&&typeof e.rawMessage=="string"&&"cause"in e:!1}findDetails(e){const n=e.kind==="message"?{getMessage:i=>i===e.typeName?e:void 0}:e,r=[];for(const i of this.details){if("desc"in i){n.getMessage(i.desc.typeName)&&r.push(qn(i.desc,i.value));continue}const s=n.getMessage(i.type);if(s)try{r.push(ah(s,i.value))}catch{}}return r}}function CB(t,e){return t.length?`[${Cg(e)}] ${t}`:`[${Cg(e)}]`}function $B(...t){const e=new Headers;for(const n of t)n.forEach((r,i)=>{e.append(i,r)});return e}function AB(t,e){const n={};for(const r of t.methods){const i=e(r);i!=null&&(n[r.localName]=i)}return n}const $v=1;function IB(t,e,n=!1){if(e>t){let r=`message size is larger than configured readMaxBytes ${t}`;throw n&&(r=`message size ${e} is larger than configured readMaxBytes ${t}`),new ze(r,Se.ResourceExhausted)}}function QB(t){return new RB(t)}class RB{constructor(e){this.readMaxBytes=e,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((e,n)=>e+n.byteLength,0)}decode(e){this.buf.push(e);const n=[];for(;;){let r=this.pop();if(!r)break;n.push(r)}return n}pop(){if(!(!this.env&&(this.env=this.head(),!this.env))&&this.cons(this.env.data)){const e=this.env;return this.env=void 0,e}}head(){if(!this.cons(this.header))return;const e=this.headerView.getUint8(0),n=this.headerView.getUint32(1);return IB(this.readMaxBytes,n,!0),{flags:e,data:new Uint8Array(n)}}cons(e){const n=e.byteLength;if(this.byteLength<n)return!1;let r=0;for(;r<n;){const i=this.buf.shift();i.byteLength>n-r?(e.set(i.subarray(0,n-r),r),this.buf.unshift(i.subarray(n-r)),r+=n-r):(e.set(i,r),r+=i.byteLength)}return!0}}function MB(t){let e;const n=QB(4294967295);return new ReadableStream({start(){e=t.getReader()},async pull(r){let i=!1;for(;!i;){const s=await e.read();if(s.done)n.byteLength>0&&r.error(new ze("protocol error: incomplete envelope",Se.InvalidArgument)),r.close();else for(const o of n.decode(s.value))r.enqueue(o),i=!0}}})}function LB(t,e){const n=new Uint8Array(e.length+5);n.set(e,5);const r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,t),r.setUint32(1,e.length),n}var DB=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}},jl=function(t){return this instanceof jl?(this.v=t,this):new jl(t)},ZB=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(p){return Promise.resolve(p).then(h,f)}}function a(h,p){r[h]&&(i[h]=function(m){return new Promise(function(O,g){s.push([h,m,O,g])>1||l(h,m)})},p&&(i[h]=p(i[h])))}function l(h,p){try{c(r[h](p))}catch(m){d(s[0][3],m)}}function c(h){h.value instanceof jl?Promise.resolve(h.value.v).then(u,f):d(s[0][2],h)}function u(h){l("next",h)}function f(h){l("throw",h)}function d(h,p){h(p),s.shift(),s.length&&l(s[0][0],s[0][1])}},VB=function(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=t[i]?function(o){return(n=!n)?{value:jl(t[i](o)),done:!1}:s?s(o):o}:s}};function jB(t){return ZB(this,arguments,function*(){yield jl(yield*VB(DB(t)))})}var EP=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),i(a,l,o.done,o.value)})}}function i(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}},Ho=function(t){return this instanceof Ho?(this.v=t,this):new Ho(t)},BB=function(t){var e,n;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=t[i]?function(o){return(n=!n)?{value:Ho(t[i](o)),done:!1}:s?s(o):o}:s}},FB=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(p){return Promise.resolve(p).then(h,f)}}function a(h,p){r[h]&&(i[h]=function(m){return new Promise(function(O,g){s.push([h,m,O,g])>1||l(h,m)})},p&&(i[h]=p(i[h])))}function l(h,p){try{c(r[h](p))}catch(m){d(s[0][3],m)}}function c(h){h.value instanceof Ho?Promise.resolve(h.value.v).then(u,f):d(s[0][2],h)}function u(h){l("next",h)}function f(h){l("throw",h)}function d(h,p){h(p),s.shift(),s.length&&l(s[0][0],s[0][1])}};function XB(t,e){return AB(t,n=>{switch(n.methodKind){case"unary":return zB(e,n);case"server_streaming":return WB(e,n);case"client_streaming":return UB(e,n);case"bidi_streaming":return YB(e,n);default:return null}})}function zB(t,e){return async(n,r)=>{var i,s;const o=await t.unary(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues);return(i=r==null?void 0:r.onHeader)===null||i===void 0||i.call(r,o.header),(s=r==null?void 0:r.onTrailer)===null||s===void 0||s.call(r,o.trailer),o.message}}function WB(t,e){return(n,r)=>TP(t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,jB([n]),r==null?void 0:r.contextValues),r)}function UB(t,e){return async(n,r)=>{var i,s,o,a,l,c;const u=await t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues);(l=r==null?void 0:r.onHeader)===null||l===void 0||l.call(r,u.header);let f,d=0;try{for(var h=!0,p=EP(u.message),m;m=await p.next(),i=m.done,!i;h=!0)a=m.value,h=!1,f=a,d++}catch(O){s={error:O}}finally{try{!h&&!i&&(o=p.return)&&await o.call(p)}finally{if(s)throw s.error}}if(!f)throw new ze("protocol error: missing response message",Se.Unimplemented);if(d>1)throw new ze("protocol error: received extra messages for client streaming method",Se.Unimplemented);return(c=r==null?void 0:r.onTrailer)===null||c===void 0||c.call(r,u.trailer),f}}function YB(t,e){return(n,r)=>TP(t.stream(e,r==null?void 0:r.signal,r==null?void 0:r.timeoutMs,r==null?void 0:r.headers,n,r==null?void 0:r.contextValues),r)}function TP(t,e){const n=function(){return FB(this,arguments,function*(){var r,i;const s=yield Ho(t);(r=e==null?void 0:e.onHeader)===null||r===void 0||r.call(e,s.header),yield Ho(yield*BB(EP(s.message))),(i=e==null?void 0:e.onTrailer)===null||i===void 0||i.call(e,s.trailer)})}()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function GB(...t){const e=new AbortController,n=t.filter(i=>i!==void 0).concat(e.signal);for(const i of n){if(i.aborted){r.apply(i);break}i.addEventListener("abort",r)}function r(){e.signal.aborted||e.abort(NP(this));for(const i of n)i.removeEventListener("abort",r)}return e}function HB(t){const e=new AbortController,n=()=>{e.abort(new ze("the operation timed out",Se.DeadlineExceeded))};let r;return t!==void 0&&(t<=0?n():r=setTimeout(n,t)),{signal:e.signal,cleanup:()=>clearTimeout(r)}}function NP(t){if(!t.aborted)return;if(t.reason!==void 0)return t.reason;const e=new Error("This operation was aborted");return e.name="AbortError",e}function Av(){return{get(t){return t.id in this?this[t.id]:t.defaultValue},set(t,e){return this[t.id]=e,this},delete(t){return delete this[t.id],this}}}function qB(t,e,...n){if(n.length>0)throw new Error;return t.services[e]}function Iv(t,e){return t.toString().replace(/\/?$/,`/${e.parent.typeName}/${e.name}`)}function PP(t,e){return qn(t,e)}function KB(t,e){function n(r){return r.done===!0?r:{done:r.done,value:PP(t,r.value)}}return{[Symbol.asyncIterator](){const r=e[Symbol.asyncIterator](),i={next:()=>r.next().then(n)};return r.throw!==void 0&&(i.throw=s=>r.throw(s).then(n)),r.return!==void 0&&(i.return=s=>r.return(s).then(n)),i}}}function _P(t,e){if(!e)return t;for(const n of e.concat().reverse())t=n(t);return t}function CP(t){var e;const n=Object.assign({},t);return(e=n.ignoreUnknownFields)!==null&&e!==void 0||(n.ignoreUnknownFields=!0),n}function Qv(t,e,n,r){const i=e?Rv(t.input,r):Mv(t.input,n);return{parse:(e?Rv(t.output,r):Mv(t.output,n)).parse,serialize:i.serialize}}function Rv(t,e){return{parse(n){try{return ah(t,n,e)}catch(r){const i=r instanceof Error?r.message:String(r);throw new ze(`parse binary: ${i}`,Se.Internal)}},serialize(n){try{return cP(t,n,e)}catch(r){const i=r instanceof Error?r.message:String(r);throw new ze(`serialize binary: ${i}`,Se.Internal)}}}}function Mv(t,e){var n,r;const i=(n=e==null?void 0:e.textEncoder)!==null&&n!==void 0?n:new TextEncoder,s=(r=e==null?void 0:e.textDecoder)!==null&&r!==void 0?r:new TextDecoder,o=CP(e);return{parse(a){try{const l=s.decode(a);return pB(t,l,o)}catch(l){throw ze.from(l,Se.InvalidArgument)}},serialize(a){try{const l=sB(t,a,o);return i.encode(l)}catch(l){throw ze.from(l,Se.Internal)}}}}const JB=/^application\/(connect\+)?(?:(json)(?:; ?charset=utf-?8)?|(proto))$/i,eF="application/proto",tF="application/json",nF="application/connect+proto",rF="application/connect+json";function iF(t){const e=t==null?void 0:t.match(JB);if(!e)return;const n=!!e[1],r=!!e[3];return{stream:n,binary:r}}function $P(t,e,n){var r;if(e&&new Headers(e).forEach((a,l)=>n.metadata.append(l,a)),typeof t!="object"||t==null||Array.isArray(t))throw n;let i=n.code;"code"in t&&typeof t.code=="string"&&(i=(r=_B(t.code))!==null&&r!==void 0?r:i);const s=t.message;if(s!=null&&typeof s!="string")throw n;const o=new ze(s??"",i,e);if("details"in t&&Array.isArray(t.details))for(const a of t.details){if(a===null||typeof a!="object"||Array.isArray(a)||typeof a.type!="string"||typeof a.value!="string")throw n;try{o.details.push({type:a.type,value:hy(a.value),debug:a.debug})}catch{throw n}}return o}const Lv=2;function sF(t){const e=new ze("invalid end stream",Se.Unknown);let n;try{n=JSON.parse(typeof t=="string"?t:new TextDecoder().decode(t))}catch{throw e}if(typeof n!="object"||n==null||Array.isArray(n))throw e;const r=new Headers;if("metadata"in n){if(typeof n.metadata!="object"||n.metadata==null||Array.isArray(n.metadata))throw e;for(const[s,o]of Object.entries(n.metadata)){if(!Array.isArray(o)||o.some(a=>typeof a!="string"))throw e;for(const a of o)r.append(s,a)}}const i="error"in n&&n.error!=null?$P(n.error,r,e):void 0;return{metadata:r,error:i}}const nd="Content-Type",oF="Content-Length",Dv="Content-Encoding",aF="Accept-Encoding",lF="Connect-Timeout-Ms",AP="Connect-Protocol-Version",cF="User-Agent";function uF(t){switch(t){case 400:return Se.Internal;case 401:return Se.Unauthenticated;case 403:return Se.PermissionDenied;case 404:return Se.Unimplemented;case 429:return Se.Unavailable;case 502:return Se.Unavailable;case 503:return Se.Unavailable;case 504:return Se.Unavailable;default:return Se.Unknown}}function Zv(t){const e=new Headers,n=new Headers;return t.forEach((r,i)=>{i.toLowerCase().startsWith("trailer-")?n.append(i.substring(8),r):e.append(i,r)}),[e,n]}const IP="1";function Vv(t,e,n,r,i){const s=new Headers(r??{});return n!==void 0&&s.set(lF,`${n}`),s.set(nd,t=="unary"?e?eF:tF:e?nF:rF),s.set(AP,IP),s.has(cF),s}function jv(t,e,n,r){const i=r.get(nd),s=iF(i);if(n!==200){const a=new ze(`HTTP ${n}`,uF(n),r);if(t=="unary"&&s&&!s.binary)return{isUnaryError:!0,unaryError:a};throw a}const o={binary:e,stream:t!=="unary"};if((s==null?void 0:s.binary)!==o.binary||s.stream!==o.stream)throw new ze(`unsupported content type ${i}`,s===void 0?Se.Unknown:Se.Internal,r);return{isUnaryError:!1}}const Bv="application/";function fF(t,e){return e?qN(t,"url"):encodeURIComponent(new TextDecoder().decode(t))}function dF(t,e,n){let r=`?connect=v${IP}`,i="";const s=t.header.get(Dv);s!==null&&s!=="identity"&&(i="&compression="+encodeURIComponent(s),n=!0),n&&(r+="&base64=1"),r+=i;const o=t.header.get(nd);(o==null?void 0:o.indexOf(Bv))===0&&(r+="&encoding="+encodeURIComponent(o.slice(Bv.length))),r+="&message="+fF(e,n);const a=t.url+r,l=new Headers(t.header);for(const c of[AP,nd,oF,Dv,aF])l.delete(c);return Object.assign(Object.assign({},t),{requestMethod:"GET",url:a,header:l})}function hF(t){const e=_P(t.next,t.interceptors),[n,r,i]=QP(t),s=Object.assign(Object.assign({},t.req),{message:PP(t.req.method.input,t.req.message),signal:n});return e(s).then(o=>(i(),o),r)}function pF(t){const e=_P(t.next,t.interceptors),[n,r,i]=QP(t),s=Object.assign(Object.assign({},t.req),{message:KB(t.req.method.input,t.req.message),signal:n});let o=!1;return n.addEventListener("abort",function(){var a,l;const c=t.req.message[Symbol.asyncIterator]();o||(a=c.throw)===null||a===void 0||a.call(c,this.reason).catch(()=>{}),(l=c.return)===null||l===void 0||l.call(c).catch(()=>{})}),e(s).then(a=>Object.assign(Object.assign({},a),{message:{[Symbol.asyncIterator](){const l=a.message[Symbol.asyncIterator]();return{next(){return l.next().then(c=>(c.done==!0&&(o=!0,i()),c),r)}}}}}),r)}function QP(t){const{signal:e,cleanup:n}=HB(t.timeoutMs),r=GB(t.signal,e);return[r.signal,function(s){const o=r.signal.aborted?ze.from(NP(r.signal),Se.Canceled):ze.from(s);return r.abort(o),n(),Promise.reject(o)},function(){n(),r.abort()}]}function mF(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}var Bl=function(t){return this instanceof Bl?(this.v=t,this):new Bl(t)},gF=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(h){return function(p){return Promise.resolve(p).then(h,f)}}function a(h,p){r[h]&&(i[h]=function(m){return new Promise(function(O,g){s.push([h,m,O,g])>1||l(h,m)})},p&&(i[h]=p(i[h])))}function l(h,p){try{c(r[h](p))}catch(m){d(s[0][3],m)}}function c(h){h.value instanceof Bl?Promise.resolve(h.value.v).then(u,f):d(s[0][2],h)}function u(h){l("next",h)}function f(h){l("throw",h)}function d(h,p){h(p),s.shift(),s.length&&l(s[0][0],s[0][1])}};const Fv={redirect:"error"};function OF(t){var e;mF();const n=(e=t.useBinaryFormat)!==null&&e!==void 0?e:!1;return{async unary(r,i,s,o,a,l){const{serialize:c,parse:u}=Qv(r,n,t.jsonOptions,t.binaryOptions);return s=s===void 0?t.defaultTimeoutMs:s<=0?void 0:s,await hF({interceptors:t.interceptors,signal:i,timeoutMs:s,req:{stream:!1,service:r.parent,method:r,requestMethod:"POST",url:Iv(t.baseUrl,r),header:Vv(r.methodKind,n,s,o,!1),contextValues:l??Av(),message:a},next:async f=>{var d;const h=t.useHttpGet===!0&&r.idempotency===Pg.NO_SIDE_EFFECTS;let p=null;h?f=dF(f,c(f.message),n):p=c(f.message);const O=await((d=t.fetch)!==null&&d!==void 0?d:globalThis.fetch)(f.url,Object.assign(Object.assign({},Fv),{method:f.requestMethod,headers:f.header,signal:f.signal,body:p})),{isUnaryError:g,unaryError:b}=jv(r.methodKind,n,O.status,O.headers);if(g)throw $P(await O.json(),$B(...Zv(O.headers)),b);const[y,v]=Zv(O.headers);return{stream:!1,service:r.parent,method:r,header:y,message:n?u(new Uint8Array(await O.arrayBuffer())):bP(r.output,await O.json(),CP(t.jsonOptions)),trailer:v}}})},async stream(r,i,s,o,a,l){const{serialize:c,parse:u}=Qv(r,n,t.jsonOptions,t.binaryOptions);function f(h,p,m,O){return gF(this,arguments,function*(){const b=MB(h).getReader();let y=!1;for(;;){const v=yield Bl(b.read());if(v.done)break;const{flags:S,data:E}=v.value;if((S&$v)===$v)throw new ze("protocol error: received unsupported compressed output",Se.Internal);if((S&Lv)===Lv){y=!0;const w=sF(E);if(w.error){const k=w.error;throw m.forEach((N,$)=>{k.metadata.append($,N)}),k}w.metadata.forEach((k,N)=>p.set(N,k));continue}yield yield Bl(u(E))}if("throwIfAborted"in O&&O.throwIfAborted(),!y)throw"missing EndStreamResponse"})}async function d(h){if(r.methodKind!="server_streaming")throw"The fetch API does not support streaming request bodies";const p=await h[Symbol.asyncIterator]().next();if(p.done==!0)throw"missing request message";return LB(0,c(p.value))}return s=s===void 0?t.defaultTimeoutMs:s<=0?void 0:s,await pF({interceptors:t.interceptors,timeoutMs:s,signal:i,req:{stream:!0,service:r.parent,method:r,requestMethod:"POST",url:Iv(t.baseUrl,r),header:Vv(r.methodKind,n,s,o,!1),contextValues:l??Av(),message:a},next:async h=>{var p;const O=await((p=t.fetch)!==null&&p!==void 0?p:globalThis.fetch)(h.url,Object.assign(Object.assign({},Fv),{method:h.requestMethod,headers:h.header,signal:h.signal,body:await d(h.message)}));if(jv(r.methodKind,n,O.status,O.headers),O.body===null)throw"missing response body";const g=new Headers;return Object.assign(Object.assign({},h),{header:O.headers,trailer:g,message:f(O.body,g,O.headers,h.signal)})}})}}}const Tp=2,mr=4,Br=4,js=4,pi=new Int32Array(2),Xv=new Float32Array(pi.buffer),zv=new Float64Array(pi.buffer),gu=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1;var $g;(function(t){t[t.UTF8_BYTES=1]="UTF8_BYTES",t[t.UTF16_STRING=2]="UTF16_STRING"})($g||($g={}));class Fl{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new Fl(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return pi[0]=this.readInt32(e),Xv[0]}readFloat64(e){return pi[gu?0:1]=this.readInt32(e),pi[gu?1:0]=this.readInt32(e+4),zv[0]}writeInt8(e,n){this.bytes_[e]=n}writeUint8(e,n){this.bytes_[e]=n}writeInt16(e,n){this.bytes_[e]=n,this.bytes_[e+1]=n>>8}writeUint16(e,n){this.bytes_[e]=n,this.bytes_[e+1]=n>>8}writeInt32(e,n){this.bytes_[e]=n,this.bytes_[e+1]=n>>8,this.bytes_[e+2]=n>>16,this.bytes_[e+3]=n>>24}writeUint32(e,n){this.bytes_[e]=n,this.bytes_[e+1]=n>>8,this.bytes_[e+2]=n>>16,this.bytes_[e+3]=n>>24}writeInt64(e,n){this.writeInt32(e,Number(BigInt.asIntN(32,n))),this.writeInt32(e+4,Number(BigInt.asIntN(32,n>>BigInt(32))))}writeUint64(e,n){this.writeUint32(e,Number(BigInt.asUintN(32,n))),this.writeUint32(e+4,Number(BigInt.asUintN(32,n>>BigInt(32))))}writeFloat32(e,n){Xv[0]=n,this.writeInt32(e,pi[0])}writeFloat64(e,n){zv[0]=n,this.writeInt32(e,pi[gu?0:1]),this.writeInt32(e+4,pi[gu?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+mr+Br)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let n=0;n<Br;n++)e+=String.fromCharCode(this.readInt8(this.position_+mr+n));return e}__offset(e,n){const r=e-this.readInt32(e);return n<this.readInt16(r)?this.readInt16(r+n):0}__union(e,n){return e.bb_pos=n+this.readInt32(n),e.bb=this,e}__string(e,n){e+=this.readInt32(e);const r=this.readInt32(e);e+=mr;const i=this.bytes_.subarray(e,e+r);return n===$g.UTF8_BYTES?i:this.text_decoder_.decode(i)}__union_with_string(e,n){return typeof e=="string"?this.__string(n):this.__union(e,n)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+mr}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=Br)throw new Error("FlatBuffers: file identifier must be length "+Br);for(let n=0;n<Br;n++)if(e.charCodeAt(n)!=this.readInt8(this.position()+mr+n))return!1;return!0}createScalarList(e,n){const r=[];for(let i=0;i<n;++i){const s=e(i);s!==null&&r.push(s)}return r}createObjList(e,n){const r=[];for(let i=0;i<n;++i){const s=e(i);s!==null&&r.push(s.unpack())}return r}}let yF=class RP{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let n;e?n=e:n=1024,this.bb=Fl.allocate(n),this.space=n}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,n){e>this.minalign&&(this.minalign=e);const r=~(this.bb.capacity()-this.space+n)+1&e-1;for(;this.space<r+e+n;){const i=this.bb.capacity();this.bb=RP.growByteBuffer(this.bb),this.space+=this.bb.capacity()-i}this.pad(r)}pad(e){for(let n=0;n<e;n++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,n,r){(this.force_defaults||n!=r)&&(this.addInt8(n),this.slot(e))}addFieldInt16(e,n,r){(this.force_defaults||n!=r)&&(this.addInt16(n),this.slot(e))}addFieldInt32(e,n,r){(this.force_defaults||n!=r)&&(this.addInt32(n),this.slot(e))}addFieldInt64(e,n,r){(this.force_defaults||n!==r)&&(this.addInt64(n),this.slot(e))}addFieldFloat32(e,n,r){(this.force_defaults||n!=r)&&(this.addFloat32(n),this.slot(e))}addFieldFloat64(e,n,r){(this.force_defaults||n!=r)&&(this.addFloat64(n),this.slot(e))}addFieldOffset(e,n,r){(this.force_defaults||n!=r)&&(this.addOffset(n),this.slot(e))}addFieldStruct(e,n,r){n!=r&&(this.nested(n),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){const n=e.capacity();if(n&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");const r=n<<1,i=Fl.allocate(r);return i.setPosition(r-n),i.bytes().set(e.bytes(),r-n),i}addOffset(e){this.prep(mr,0),this.writeInt32(this.offset()-e+mr)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let n=0;n<e;n++)this.vtable[n]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);const e=this.offset();let n=this.vtable_in_use-1;for(;n>=0&&this.vtable[n]==0;n--);const r=n+1;for(;n>=0;n--)this.addInt16(this.vtable[n]!=0?e-this.vtable[n]:0);const i=2;this.addInt16(e-this.object_start);const s=(r+i)*Tp;this.addInt16(s);let o=0;const a=this.space;e:for(n=0;n<this.vtables.length;n++){const l=this.bb.capacity()-this.vtables[n];if(s==this.bb.readInt16(l)){for(let c=Tp;c<s;c+=Tp)if(this.bb.readInt16(a+c)!=this.bb.readInt16(l+c))continue e;o=this.vtables[n];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,n,r){const i=r?js:0;if(n){const s=n;if(this.prep(this.minalign,mr+Br+i),s.length!=Br)throw new TypeError("FlatBuffers: file identifier must be length "+Br);for(let o=Br-1;o>=0;o--)this.writeInt8(s.charCodeAt(o))}this.prep(this.minalign,mr+i),this.addOffset(e),i&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,n){this.finish(e,n,!0)}requiredField(e,n){const r=this.bb.capacity()-e,i=r-this.bb.readInt32(r);if(!(n<this.bb.readInt16(i)&&this.bb.readInt16(i+n)!=0))throw new TypeError("FlatBuffers: field "+n+" must be set")}startVector(e,n,r){this.notNested(),this.vector_num_elems=n,this.prep(mr,e*n),this.prep(r,e*n)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);const n=this.createString(e);return this.string_maps.set(e,n),n}createString(e){if(e==null)return 0;let n;return e instanceof Uint8Array?n=e:n=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,n.length,1),this.bb.setPosition(this.space-=n.length),this.bb.bytes().set(n,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){const n=[];for(let r=0;r<e.length;++r){const i=e[r];if(i!==null)n.push(this.createObjectOffset(i));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return n}createStructOffsetList(e,n){return n(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}};var wy={},dh={},Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.BitWidth=void 0;var Wv;(function(t){t[t.WIDTH8=0]="WIDTH8",t[t.WIDTH16=1]="WIDTH16",t[t.WIDTH32=2]="WIDTH32",t[t.WIDTH64=3]="WIDTH64"})(Wv||(Gi.BitWidth=Wv={}));var gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.paddingSize=gt.fromByteWidth=gt.uwidth=gt.fwidth=gt.iwidth=gt.toByteWidth=void 0;const Wt=Gi;function bF(t){return 1<<t}gt.toByteWidth=bF;function xF(t){return t>=-128&&t<=127?Wt.BitWidth.WIDTH8:t>=-32768&&t<=32767?Wt.BitWidth.WIDTH16:t>=-2147483648&&t<=2147483647?Wt.BitWidth.WIDTH32:Wt.BitWidth.WIDTH64}gt.iwidth=xF;function vF(t){return t===Math.fround(t)?Wt.BitWidth.WIDTH32:Wt.BitWidth.WIDTH64}gt.fwidth=vF;function wF(t){return t<=255?Wt.BitWidth.WIDTH8:t<=65535?Wt.BitWidth.WIDTH16:t<=4294967295?Wt.BitWidth.WIDTH32:Wt.BitWidth.WIDTH64}gt.uwidth=wF;function SF(t){return t===1?Wt.BitWidth.WIDTH8:t===2?Wt.BitWidth.WIDTH16:t===4?Wt.BitWidth.WIDTH32:Wt.BitWidth.WIDTH64}gt.fromByteWidth=SF;function kF(t,e){return~t+1&e-1}gt.paddingSize=kF;var Di={};Object.defineProperty(Di,"__esModule",{value:!0});Di.toUTF8Array=Di.fromUTF8Array=void 0;function EF(t){return new TextDecoder().decode(t)}Di.fromUTF8Array=EF;function TF(t){return new TextEncoder().encode(t)}Di.toUTF8Array=TF;var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.ValueType=void 0;var Uv;(function(t){t[t.NULL=0]="NULL",t[t.INT=1]="INT",t[t.UINT=2]="UINT",t[t.FLOAT=3]="FLOAT",t[t.KEY=4]="KEY",t[t.STRING=5]="STRING",t[t.INDIRECT_INT=6]="INDIRECT_INT",t[t.INDIRECT_UINT=7]="INDIRECT_UINT",t[t.INDIRECT_FLOAT=8]="INDIRECT_FLOAT",t[t.MAP=9]="MAP",t[t.VECTOR=10]="VECTOR",t[t.VECTOR_INT=11]="VECTOR_INT",t[t.VECTOR_UINT=12]="VECTOR_UINT",t[t.VECTOR_FLOAT=13]="VECTOR_FLOAT",t[t.VECTOR_KEY=14]="VECTOR_KEY",t[t.VECTOR_STRING_DEPRECATED=15]="VECTOR_STRING_DEPRECATED",t[t.VECTOR_INT2=16]="VECTOR_INT2",t[t.VECTOR_UINT2=17]="VECTOR_UINT2",t[t.VECTOR_FLOAT2=18]="VECTOR_FLOAT2",t[t.VECTOR_INT3=19]="VECTOR_INT3",t[t.VECTOR_UINT3=20]="VECTOR_UINT3",t[t.VECTOR_FLOAT3=21]="VECTOR_FLOAT3",t[t.VECTOR_INT4=22]="VECTOR_INT4",t[t.VECTOR_UINT4=23]="VECTOR_UINT4",t[t.VECTOR_FLOAT4=24]="VECTOR_FLOAT4",t[t.BLOB=25]="BLOB",t[t.BOOL=26]="BOOL",t[t.VECTOR_BOOL=36]="VECTOR_BOOL"})(Uv||(Bs.ValueType=Uv={}));var Ee={};Object.defineProperty(Ee,"__esModule",{value:!0});Ee.packedType=Ee.fixedTypedVectorElementSize=Ee.fixedTypedVectorElementType=Ee.typedVectorElementType=Ee.toTypedVector=Ee.isAVector=Ee.isFixedTypedVector=Ee.isTypedVector=Ee.isTypedVectorElement=Ee.isIndirectNumber=Ee.isNumber=Ee.isInline=void 0;const Ne=Bs;function NF(t){return t===Ne.ValueType.BOOL||t<=Ne.ValueType.FLOAT}Ee.isInline=NF;function PF(t){return t>=Ne.ValueType.INT&&t<=Ne.ValueType.FLOAT}Ee.isNumber=PF;function _F(t){return t>=Ne.ValueType.INDIRECT_INT&&t<=Ne.ValueType.INDIRECT_FLOAT}Ee.isIndirectNumber=_F;function CF(t){return t===Ne.ValueType.BOOL||t>=Ne.ValueType.INT&&t<=Ne.ValueType.STRING}Ee.isTypedVectorElement=CF;function MP(t){return t===Ne.ValueType.VECTOR_BOOL||t>=Ne.ValueType.VECTOR_INT&&t<=Ne.ValueType.VECTOR_STRING_DEPRECATED}Ee.isTypedVector=MP;function LP(t){return t>=Ne.ValueType.VECTOR_INT2&&t<=Ne.ValueType.VECTOR_FLOAT4}Ee.isFixedTypedVector=LP;function $F(t){return MP(t)||LP(t)||t===Ne.ValueType.VECTOR}Ee.isAVector=$F;function AF(t,e){if(e===0)return t-Ne.ValueType.INT+Ne.ValueType.VECTOR_INT;if(e===2)return t-Ne.ValueType.INT+Ne.ValueType.VECTOR_INT2;if(e===3)return t-Ne.ValueType.INT+Ne.ValueType.VECTOR_INT3;if(e===4)return t-Ne.ValueType.INT+Ne.ValueType.VECTOR_INT4;throw"Unexpected length "+e}Ee.toTypedVector=AF;function IF(t){return t-Ne.ValueType.VECTOR_INT+Ne.ValueType.INT}Ee.typedVectorElementType=IF;function QF(t){return(t-Ne.ValueType.VECTOR_INT2)%3+Ne.ValueType.INT}Ee.fixedTypedVectorElementType=QF;function RF(t){return((t-Ne.ValueType.VECTOR_INT2)/3>>0)+2}Ee.fixedTypedVectorElementSize=RF;function MF(t,e){return e|t<<2}Ee.packedType=MF;var hh={};Object.defineProperty(hh,"__esModule",{value:!0});hh.StackValue=void 0;const Np=Gi,Ou=gt,Ta=Bs,yu=Ee;class LF{constructor(e,n,r,i=null,s=0){this.builder=e,this.type=n,this.width=r,this.value=i,this.offset=s}elementWidth(e,n){if((0,yu.isInline)(this.type))return this.width;for(let r=0;r<4;r++){const i=1<<r,o=e+(0,Ou.paddingSize)(e,i)+n*i-this.offset,a=(0,Ou.uwidth)(o);if(1<<a===i)return a}throw`Element is unknown. Size: ${e} at index: ${n}. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new`}writeToBuffer(e){const n=this.builder.computeOffset(e);if(this.type===Ta.ValueType.FLOAT)this.width===Np.BitWidth.WIDTH32?this.builder.view.setFloat32(this.builder.offset,this.value,!0):this.builder.view.setFloat64(this.builder.offset,this.value,!0);else if(this.type===Ta.ValueType.INT){const r=(0,Ou.fromByteWidth)(e);this.builder.pushInt(this.value,r)}else if(this.type===Ta.ValueType.UINT){const r=(0,Ou.fromByteWidth)(e);this.builder.pushUInt(this.value,r)}else if(this.type===Ta.ValueType.NULL)this.builder.pushInt(0,this.width);else if(this.type===Ta.ValueType.BOOL)this.builder.pushInt(this.value?1:0,this.width);else throw`Unexpected type: ${this.type}. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new`;this.offset=n}storedWidth(e=Np.BitWidth.WIDTH8){return(0,yu.isInline)(this.type)?Math.max(e,this.width):this.width}storedPackedType(e=Np.BitWidth.WIDTH8){return(0,yu.packedType)(this.type,this.storedWidth(e))}isOffset(){return!(0,yu.isInline)(this.type)}}hh.StackValue=LF;Object.defineProperty(dh,"__esModule",{value:!0});dh.Builder=void 0;const In=Gi,ar=gt,Yv=Di,nt=Bs,Pp=Ee,Ws=hh;class DF{constructor(e=2048,n=!0,r=!0,i=!0){this.dedupStrings=n,this.dedupKeys=r,this.dedupKeyVectors=i,this.stack=[],this.stackPointers=[],this.offset=0,this.finished=!1,this.stringLookup={},this.keyLookup={},this.keyVectorLookup={},this.indirectIntLookup={},this.indirectUIntLookup={},this.indirectFloatLookup={},this.buffer=new ArrayBuffer(e>0?e:2048),this.view=new DataView(this.buffer)}align(e){const n=(0,ar.toByteWidth)(e);return this.offset+=(0,ar.paddingSize)(this.offset,n),n}computeOffset(e){const n=this.offset+e;let r=this.buffer.byteLength;const i=r;for(;r<n;)r<<=1;if(i<r){const s=this.buffer;this.buffer=new ArrayBuffer(r),this.view=new DataView(this.buffer),new Uint8Array(this.buffer).set(new Uint8Array(s),0)}return n}pushInt(e,n){if(n===In.BitWidth.WIDTH8)this.view.setInt8(this.offset,e);else if(n===In.BitWidth.WIDTH16)this.view.setInt16(this.offset,e,!0);else if(n===In.BitWidth.WIDTH32)this.view.setInt32(this.offset,e,!0);else if(n===In.BitWidth.WIDTH64)this.view.setBigInt64(this.offset,BigInt(e),!0);else throw`Unexpected width: ${n} for value: ${e}`}pushUInt(e,n){if(n===In.BitWidth.WIDTH8)this.view.setUint8(this.offset,e);else if(n===In.BitWidth.WIDTH16)this.view.setUint16(this.offset,e,!0);else if(n===In.BitWidth.WIDTH32)this.view.setUint32(this.offset,e,!0);else if(n===In.BitWidth.WIDTH64)this.view.setBigUint64(this.offset,BigInt(e),!0);else throw`Unexpected width: ${n} for value: ${e}`}writeInt(e,n){const r=this.computeOffset(n);this.pushInt(e,(0,ar.fromByteWidth)(n)),this.offset=r}writeUInt(e,n){const r=this.computeOffset(n);this.pushUInt(e,(0,ar.fromByteWidth)(n)),this.offset=r}writeBlob(e){const n=e.byteLength,r=(0,ar.uwidth)(n),i=this.align(r);this.writeUInt(n,i);const s=this.offset,o=this.computeOffset(n);new Uint8Array(this.buffer).set(new Uint8Array(e),s),this.stack.push(this.offsetStackValue(s,nt.ValueType.BLOB,r)),this.offset=o}writeString(e){if(this.dedupStrings&&Object.prototype.hasOwnProperty.call(this.stringLookup,e)){this.stack.push(this.stringLookup[e]);return}const n=(0,Yv.toUTF8Array)(e),r=n.length,i=(0,ar.uwidth)(r),s=this.align(i);this.writeUInt(r,s);const o=this.offset,a=this.computeOffset(r+1);new Uint8Array(this.buffer).set(n,o);const l=this.offsetStackValue(o,nt.ValueType.STRING,i);this.stack.push(l),this.dedupStrings&&(this.stringLookup[e]=l),this.offset=a}writeKey(e){if(this.dedupKeys&&Object.prototype.hasOwnProperty.call(this.keyLookup,e)){this.stack.push(this.keyLookup[e]);return}const n=(0,Yv.toUTF8Array)(e),r=n.length,i=this.computeOffset(r+1);new Uint8Array(this.buffer).set(n,this.offset);const s=this.offsetStackValue(this.offset,nt.ValueType.KEY,In.BitWidth.WIDTH8);this.stack.push(s),this.dedupKeys&&(this.keyLookup[e]=s),this.offset=i}writeStackValue(e,n){const r=this.computeOffset(n);if(e.isOffset()){const i=this.offset-e.offset;if(n===8||BigInt(i)<BigInt(1)<<BigInt(n*8))this.writeUInt(i,n);else throw`Unexpected size ${n}. This might be a bug. Please create an issue https://github.com/google/flatbuffers/issues/new`}else e.writeToBuffer(n);this.offset=r}integrityCheckOnValueAddition(){if(this.finished)throw"Adding values after finish is prohibited";if(this.stackPointers.length!==0&&this.stackPointers[this.stackPointers.length-1].isVector===!1&&this.stack[this.stack.length-1].type!==nt.ValueType.KEY)throw"Adding value to a map before adding a key is prohibited"}integrityCheckOnKeyAddition(){if(this.finished)throw"Adding values after finish is prohibited";if(this.stackPointers.length===0||this.stackPointers[this.stackPointers.length-1].isVector)throw"Adding key before starting a map is prohibited"}startVector(){this.stackPointers.push({stackPosition:this.stack.length,isVector:!0})}startMap(e=!1){this.stackPointers.push({stackPosition:this.stack.length,isVector:!1,presorted:e})}endVector(e){const n=this.stack.length-e.stackPosition,r=this.createVector(e.stackPosition,n,1);this.stack.splice(e.stackPosition,n),this.stack.push(r)}endMap(e){e.presorted||this.sort(e);let n="";for(let o=e.stackPosition;o<this.stack.length;o+=2)n+=`,${this.stack[o].offset}`;const r=this.stack.length-e.stackPosition>>1;this.dedupKeyVectors&&!Object.prototype.hasOwnProperty.call(this.keyVectorLookup,n)&&(this.keyVectorLookup[n]=this.createVector(e.stackPosition,r,2));const i=this.dedupKeyVectors?this.keyVectorLookup[n]:this.createVector(e.stackPosition,r,2),s=this.createVector(e.stackPosition+1,r,2,i);this.stack.splice(e.stackPosition,r<<1),this.stack.push(s)}sort(e){const n=this.view,r=this.stack;function i(u,f){if(u.type!==nt.ValueType.KEY||f.type!==nt.ValueType.KEY)throw`Stack values are not keys ${u} | ${f}. Check if you combined [addKey] with add... method calls properly.`;let d,h,p=0;do{if(d=n.getUint8(u.offset+p),h=n.getUint8(f.offset+p),h<d)return!0;if(d<h)return!1;p+=1}while(d!==0&&h!==0);return!1}function s(u,f,d){if(f===d)return;const h=u[f],p=u[f+1];u[f]=u[d],u[f+1]=u[d+1],u[d]=h,u[d+1]=p}function o(){for(let u=e.stackPosition;u<r.length;u+=2){let f=u;for(let d=u+2;d<r.length;d+=2)i(r[f],r[d])&&(f=d);f!==u&&s(r,f,u)}}function a(u,f){if(u.type!==nt.ValueType.KEY||f.type!==nt.ValueType.KEY)throw`Stack values are not keys ${u} | ${f}. Check if you combined [addKey] with add... method calls properly.`;if(u.offset===f.offset)return!1;let d,h,p=0;do{if(d=n.getUint8(u.offset+p),h=n.getUint8(f.offset+p),d<h)return!0;if(h<d)return!1;p+=1}while(d!==0&&h!==0);return!1}function l(u,f){if(u<f){const d=u+(f-u>>2)*2,h=r[d];let p=u,m=f;do{for(;a(r[p],h);)p+=2;for(;a(h,r[m]);)m-=2;p<=m&&(s(r,p,m),p+=2,m-=2)}while(p<=m);l(u,m),l(p,f)}}let c=!0;for(let u=e.stackPosition;u<this.stack.length-2;u+=2)if(i(this.stack[u],this.stack[u+2])){c=!1;break}c||(this.stack.length-e.stackPosition>40?l(e.stackPosition,this.stack.length-2):o())}end(){if(this.stackPointers.length<1)return;const e=this.stackPointers.pop();e.isVector?this.endVector(e):this.endMap(e)}createVector(e,n,r,i=null){let s=(0,ar.uwidth)(n),o=1;if(i!==null){const d=i.elementWidth(this.offset,0);d>s&&(s=d),o+=2}let a=nt.ValueType.KEY,l=i===null;for(let d=e;d<this.stack.length;d+=r){const h=this.stack[d].elementWidth(this.offset,d+o);h>s&&(s=h),d===e?(a=this.stack[d].type,l=l&&(0,Pp.isTypedVectorElement)(a)):a!==this.stack[d].type&&(l=!1)}const c=this.align(s),u=l&&(0,Pp.isNumber)(a)&&n>=2&&n<=4;i!==null&&(this.writeStackValue(i,c),this.writeUInt(1<<i.width,c)),u||this.writeUInt(n,c);const f=this.offset;for(let d=e;d<this.stack.length;d+=r)this.writeStackValue(this.stack[d],c);if(!l)for(let d=e;d<this.stack.length;d+=r)this.writeUInt(this.stack[d].storedPackedType(),1);if(i!==null)return this.offsetStackValue(f,nt.ValueType.MAP,s);if(l){const d=(0,Pp.toTypedVector)(a,u?n:0);return this.offsetStackValue(f,d,s)}return this.offsetStackValue(f,nt.ValueType.VECTOR,s)}nullStackValue(){return new Ws.StackValue(this,nt.ValueType.NULL,In.BitWidth.WIDTH8)}boolStackValue(e){return new Ws.StackValue(this,nt.ValueType.BOOL,In.BitWidth.WIDTH8,e)}intStackValue(e){return new Ws.StackValue(this,nt.ValueType.INT,(0,ar.iwidth)(e),e)}uintStackValue(e){return new Ws.StackValue(this,nt.ValueType.UINT,(0,ar.uwidth)(e),e)}floatStackValue(e){return new Ws.StackValue(this,nt.ValueType.FLOAT,(0,ar.fwidth)(e),e)}offsetStackValue(e,n,r){return new Ws.StackValue(this,n,r,null,e)}finishBuffer(){if(this.stack.length!==1)throw`Stack has to be exactly 1, but it is ${this.stack.length}. You have to end all started vectors and maps before calling [finish]`;const e=this.stack[0],n=this.align(e.elementWidth(this.offset,0));this.writeStackValue(e,n),this.writeUInt(e.storedPackedType(),1),this.writeUInt(n,1),this.finished=!0}add(e){if(this.integrityCheckOnValueAddition(),typeof e>"u")throw"You need to provide a value";if(e===null)this.stack.push(this.nullStackValue());else if(typeof e=="boolean")this.stack.push(this.boolStackValue(e));else if(typeof e=="bigint")this.stack.push(this.intStackValue(e));else if(typeof e=="number")Number.isInteger(e)?this.stack.push(this.intStackValue(e)):this.stack.push(this.floatStackValue(e));else if(ArrayBuffer.isView(e))this.writeBlob(e.buffer);else if(typeof e=="string"||e instanceof String)this.writeString(e);else if(Array.isArray(e)){this.startVector();for(let n=0;n<e.length;n++)this.add(e[n]);this.end()}else if(typeof e=="object"){const n=Object.getOwnPropertyNames(e).sort();this.startMap(!0);for(let r=0;r<n.length;r++){const i=n[r];this.addKey(i),this.add(e[i])}this.end()}else throw`Unexpected value input ${e}`}finish(){this.finished||this.finishBuffer();const e=this.buffer.slice(0,this.offset);return new Uint8Array(e)}isFinished(){return this.finished}addKey(e){this.integrityCheckOnKeyAddition(),this.writeKey(e)}addInt(e,n=!1,r=!1){if(this.integrityCheckOnValueAddition(),!n){this.stack.push(this.intStackValue(e));return}if(r&&Object.prototype.hasOwnProperty.call(this.indirectIntLookup,e)){this.stack.push(this.indirectIntLookup[e]);return}const i=this.intStackValue(e),s=this.align(i.width),o=this.computeOffset(s),a=this.offset;i.writeToBuffer(s);const l=this.offsetStackValue(a,nt.ValueType.INDIRECT_INT,i.width);this.stack.push(l),this.offset=o,r&&(this.indirectIntLookup[e]=l)}addUInt(e,n=!1,r=!1){if(this.integrityCheckOnValueAddition(),!n){this.stack.push(this.uintStackValue(e));return}if(r&&Object.prototype.hasOwnProperty.call(this.indirectUIntLookup,e)){this.stack.push(this.indirectUIntLookup[e]);return}const i=this.uintStackValue(e),s=this.align(i.width),o=this.computeOffset(s),a=this.offset;i.writeToBuffer(s);const l=this.offsetStackValue(a,nt.ValueType.INDIRECT_UINT,i.width);this.stack.push(l),this.offset=o,r&&(this.indirectUIntLookup[e]=l)}addFloat(e,n=!1,r=!1){if(this.integrityCheckOnValueAddition(),!n){this.stack.push(this.floatStackValue(e));return}if(r&&Object.prototype.hasOwnProperty.call(this.indirectFloatLookup,e)){this.stack.push(this.indirectFloatLookup[e]);return}const i=this.floatStackValue(e),s=this.align(i.width),o=this.computeOffset(s),a=this.offset;i.writeToBuffer(s);const l=this.offsetStackValue(a,nt.ValueType.INDIRECT_FLOAT,i.width);this.stack.push(l),this.offset=o,r&&(this.indirectFloatLookup[e]=l)}}dh.Builder=DF;var Qs={},lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.keyForIndex=lt.diffKeys=lt.keyIndex=lt.indirect=lt.readFloat=lt.readUInt=lt.readInt=lt.validateOffset=void 0;const Gv=Gi,Xl=gt,DP=Di;function ZF(t,e,n){if(t.byteLength<=e+n||e&(0,Xl.toByteWidth)(n)-1)throw"Bad offset: "+e+", width: "+n}lt.validateOffset=ZF;function VF(t,e,n){return n<2?n<1?t.getInt8(e):t.getInt16(e,!0):n<3?t.getInt32(e,!0):t.setBigInt64===void 0?BigInt(t.getUint32(e,!0))+(BigInt(t.getUint32(e+4,!0))<<BigInt(32)):t.getBigInt64(e,!0)}lt.readInt=VF;function Ii(t,e,n){return n<2?n<1?t.getUint8(e):t.getUint16(e,!0):n<3?t.getUint32(e,!0):t.getBigUint64===void 0?BigInt(t.getUint32(e,!0))+(BigInt(t.getUint32(e+4,!0))<<BigInt(32)):t.getBigUint64(e,!0)}lt.readUInt=Ii;function jF(t,e,n){if(n<Gv.BitWidth.WIDTH32)throw"Bad width: "+n;return n===Gv.BitWidth.WIDTH32?t.getFloat32(e,!0):t.getFloat64(e,!0)}lt.readFloat=jF;function Sy(t,e,n){const r=Ii(t,e,n);return e-r}lt.indirect=Sy;function BF(t,e,n,r,i,s){const o=(0,DP.toUTF8Array)(t),a=Sy(e,n,r)-i*3,l=(0,Xl.fromByteWidth)(i),c=a-Number(Ii(e,a,l)),u=Number(Ii(e,a+i,l));let f=0,d=s-1;for(;f<=d;){const h=d+f>>1,p=ZP(o,h,e,c,u);if(p===0)return h;p<0?d=h-1:f=h+1}return null}lt.keyIndex=BF;function ZP(t,e,n,r,i){const s=r+e*i,o=s-Number(Ii(n,s,(0,Xl.fromByteWidth)(i)));for(let a=0;a<t.length;a++){const l=t[a]-n.getUint8(o+a);if(l!==0)return l}return n.getUint8(o+t.length)===0?0:-1}lt.diffKeys=ZP;function FF(t,e,n,r,i){const s=Sy(e,n,r)-i*3,o=(0,Xl.fromByteWidth)(i),a=s-Number(Ii(e,s,o)),l=Number(Ii(e,s+i,o)),c=a+t*l,u=c-Number(Ii(e,c,(0,Xl.fromByteWidth)(l)));let f=0;for(;e.getUint8(u+f)!==0;)f++;return(0,DP.fromUTF8Array)(new Uint8Array(e.buffer,u,f))}lt.keyForIndex=FF;Object.defineProperty(Qs,"__esModule",{value:!0});Qs.Reference=Qs.toReference=void 0;const Dr=gt,Ye=Bs,nn=Ee,Fe=lt,XF=Di,Hv=Gi;function zF(t){const e=t.byteLength;if(e<3)throw"Buffer needs to be bigger than 3";const n=new DataView(t),r=n.getUint8(e-1),i=n.getUint8(e-2),s=(0,Dr.fromByteWidth)(r),o=e-r-2;return new Nc(n,o,s,i,"/")}Qs.toReference=zF;function qv(t,e,n,r,i,s,o,a){const l=(0,Fe.indirect)(n,r,i),c=l+t*s,u=n.getUint8(l+o*s+t);return new Nc(n,c,(0,Dr.fromByteWidth)(s),u,`${a}/${e}`)}class Nc{constructor(e,n,r,i,s){this.dataView=e,this.offset=n,this.parentWidth=r,this.packedType=i,this.path=s,this._length=-1,this.byteWidth=1<<(i&3),this.valueType=i>>2}isNull(){return this.valueType===Ye.ValueType.NULL}isNumber(){return(0,nn.isNumber)(this.valueType)||(0,nn.isIndirectNumber)(this.valueType)}isFloat(){return Ye.ValueType.FLOAT===this.valueType||Ye.ValueType.INDIRECT_FLOAT===this.valueType}isInt(){return this.isNumber()&&!this.isFloat()}isString(){return Ye.ValueType.STRING===this.valueType||Ye.ValueType.KEY===this.valueType}isBool(){return Ye.ValueType.BOOL===this.valueType}isBlob(){return Ye.ValueType.BLOB===this.valueType}isVector(){return(0,nn.isAVector)(this.valueType)}isMap(){return Ye.ValueType.MAP===this.valueType}boolValue(){return this.isBool()?(0,Fe.readInt)(this.dataView,this.offset,this.parentWidth)>0:null}intValue(){return this.valueType===Ye.ValueType.INT?(0,Fe.readInt)(this.dataView,this.offset,this.parentWidth):this.valueType===Ye.ValueType.UINT?(0,Fe.readUInt)(this.dataView,this.offset,this.parentWidth):this.valueType===Ye.ValueType.INDIRECT_INT?(0,Fe.readInt)(this.dataView,(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth),(0,Dr.fromByteWidth)(this.byteWidth)):this.valueType===Ye.ValueType.INDIRECT_UINT?(0,Fe.readUInt)(this.dataView,(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth),(0,Dr.fromByteWidth)(this.byteWidth)):null}floatValue(){return this.valueType===Ye.ValueType.FLOAT?(0,Fe.readFloat)(this.dataView,this.offset,this.parentWidth):this.valueType===Ye.ValueType.INDIRECT_FLOAT?(0,Fe.readFloat)(this.dataView,(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth),(0,Dr.fromByteWidth)(this.byteWidth)):null}numericValue(){return this.floatValue()||this.intValue()}stringValue(){if(this.valueType===Ye.ValueType.STRING||this.valueType===Ye.ValueType.KEY){const e=(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth);return(0,XF.fromUTF8Array)(new Uint8Array(this.dataView.buffer,e,this.length()))}return null}blobValue(){if(this.isBlob()){const e=(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth);return new Uint8Array(this.dataView.buffer,e,this.length())}return null}get(e){const n=this.length();if(Number.isInteger(e)&&(0,nn.isAVector)(this.valueType)){if(e>=n||e<0)throw`Key: [${e}] is not applicable on ${this.path} of ${this.valueType} length: ${n}`;const r=(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth),i=r+e*this.byteWidth;let s=this.dataView.getUint8(r+n*this.byteWidth+e);if((0,nn.isTypedVector)(this.valueType)){const o=(0,nn.typedVectorElementType)(this.valueType);s=(0,nn.packedType)(o,Hv.BitWidth.WIDTH8)}else if((0,nn.isFixedTypedVector)(this.valueType)){const o=(0,nn.fixedTypedVectorElementType)(this.valueType);s=(0,nn.packedType)(o,Hv.BitWidth.WIDTH8)}return new Nc(this.dataView,i,(0,Dr.fromByteWidth)(this.byteWidth),s,`${this.path}[${e}]`)}if(typeof e=="string"){const r=(0,Fe.keyIndex)(e,this.dataView,this.offset,this.parentWidth,this.byteWidth,n);if(r!==null)return qv(r,e,this.dataView,this.offset,this.parentWidth,this.byteWidth,n,this.path)}throw`Key [${e}] is not applicable on ${this.path} of ${this.valueType}`}length(){let e;if(this._length>-1)return this._length;if((0,nn.isFixedTypedVector)(this.valueType))this._length=(0,nn.fixedTypedVectorElementSize)(this.valueType);else if(this.valueType===Ye.ValueType.BLOB||this.valueType===Ye.ValueType.MAP||(0,nn.isAVector)(this.valueType))this._length=(0,Fe.readUInt)(this.dataView,(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth)-this.byteWidth,(0,Dr.fromByteWidth)(this.byteWidth));else if(this.valueType===Ye.ValueType.NULL)this._length=0;else if(this.valueType===Ye.ValueType.STRING){const n=(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth);let r=this.byteWidth;for(e=(0,Fe.readUInt)(this.dataView,n-r,(0,Dr.fromByteWidth)(this.byteWidth));this.dataView.getInt8(n+e)!==0;)r<<=1,e=(0,Fe.readUInt)(this.dataView,n-r,(0,Dr.fromByteWidth)(this.byteWidth));this._length=e}else if(this.valueType===Ye.ValueType.KEY){const n=(0,Fe.indirect)(this.dataView,this.offset,this.parentWidth);for(e=1;this.dataView.getInt8(n+e)!==0;)e++;this._length=e}else this._length=1;return Number(this._length)}toObject(){const e=this.length();if(this.isVector()){const n=[];for(let r=0;r<e;r++)n.push(this.get(r).toObject());return n}if(this.isMap()){const n={};for(let r=0;r<e;r++){const i=(0,Fe.keyForIndex)(r,this.dataView,this.offset,this.parentWidth,this.byteWidth);n[i]=qv(r,i,this.dataView,this.offset,this.parentWidth,this.byteWidth,e,this.path).toObject()}return n}return this.isNull()?null:this.isBool()?this.boolValue():this.isNumber()?this.numericValue():this.blobValue()||this.stringValue()}}Qs.Reference=Nc;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=t.toObject=t.builder=t.toReference=void 0;const e=dh,n=Qs;var r=Qs;Object.defineProperty(t,"toReference",{enumerable:!0,get:function(){return r.toReference}});function i(){return new e.Builder}t.builder=i;function s(a){return(0,n.toReference)(a).toObject()}t.toObject=s;function o(a,l=2048,c=!0,u=!0,f=!0){const d=new e.Builder(l>0?l:2048,c,u,f);return d.add(a),d.finish()}t.encode=o})(wy);class On{constructor(){tn(this,"bb",null);tn(this,"bb_pos",0)}__init(e,n){return this.bb_pos=e,this.bb=n,this}static getRootAsFlowEdge(e,n){return(n||new On).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFlowEdge(e,n){return e.setPosition(e.position()+js),(n||new On).__init(e.readInt32(e.position())+e.position(),e)}id(e){const n=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+n,e)}source(e){const n=this.bb.__offset(this.bb_pos,6);return this.bb.__string(this.bb_pos+n,e)}sourceHandle(e){const n=this.bb.__offset(this.bb_pos,8);return n?this.bb.__string(this.bb_pos+n,e):null}target(e){const n=this.bb.__offset(this.bb_pos,10);return this.bb.__string(this.bb_pos+n,e)}targetHandle(e){const n=this.bb.__offset(this.bb_pos,12);return n?this.bb.__string(this.bb_pos+n,e):null}static startFlowEdge(e){e.startObject(5)}static addId(e,n){e.addFieldOffset(0,n,0)}static addSource(e,n){e.addFieldOffset(1,n,0)}static addSourceHandle(e,n){e.addFieldOffset(2,n,0)}static addTarget(e,n){e.addFieldOffset(3,n,0)}static addTargetHandle(e,n){e.addFieldOffset(4,n,0)}static endFlowEdge(e){const n=e.endObject();return e.requiredField(n,4),e.requiredField(n,6),e.requiredField(n,10),n}static createFlowEdge(e,n,r,i,s,o){return On.startFlowEdge(e),On.addId(e,n),On.addSource(e,r),On.addSourceHandle(e,i),On.addTarget(e,s),On.addTargetHandle(e,o),On.endFlowEdge(e)}}class vn{constructor(){tn(this,"bb",null);tn(this,"bb_pos",0)}__init(e,n){return this.bb_pos=e,this.bb=n,this}static getRootAsPosition(e,n){return(n||new vn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsPosition(e,n){return e.setPosition(e.position()+js),(n||new vn).__init(e.readInt32(e.position())+e.position(),e)}x(){const e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readFloat64(this.bb_pos+e):0}y(){const e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readFloat64(this.bb_pos+e):0}static startPosition(e){e.startObject(2)}static addX(e,n){e.addFieldFloat64(0,n,0)}static addY(e,n){e.addFieldFloat64(1,n,0)}static endPosition(e){return e.endObject()}static createPosition(e,n,r){return vn.startPosition(e),vn.addX(e,n),vn.addY(e,r),vn.endPosition(e)}}class Ln{constructor(){tn(this,"bb",null);tn(this,"bb_pos",0)}__init(e,n){return this.bb_pos=e,this.bb=n,this}static getRootAsFlowNode(e,n){return(n||new Ln).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFlowNode(e,n){return e.setPosition(e.position()+js),(n||new Ln).__init(e.readInt32(e.position())+e.position(),e)}id(e){const n=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+n,e)}type(e){const n=this.bb.__offset(this.bb_pos,6);return this.bb.__string(this.bb_pos+n,e)}position(e){const n=this.bb.__offset(this.bb_pos,8);return n?(e||new vn).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}data(e){const n=this.bb.__offset(this.bb_pos,10);return n?this.bb.readUint8(this.bb.__vector(this.bb_pos+n)+e):0}dataLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}dataArray(){const e=this.bb.__offset(this.bb_pos,10);return e?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startFlowNode(e){e.startObject(4)}static addId(e,n){e.addFieldOffset(0,n,0)}static addType(e,n){e.addFieldOffset(1,n,0)}static addPosition(e,n){e.addFieldOffset(2,n,0)}static addData(e,n){e.addFieldOffset(3,n,0)}static createDataVector(e,n){e.startVector(1,n.length,1);for(let r=n.length-1;r>=0;r--)e.addInt8(n[r]);return e.endVector()}static startDataVector(e,n){e.startVector(1,n,1)}static endFlowNode(e){const n=e.endObject();return e.requiredField(n,4),e.requiredField(n,6),n}}class Vr{constructor(){tn(this,"bb",null);tn(this,"bb_pos",0)}__init(e,n){return this.bb_pos=e,this.bb=n,this}static getRootAsMeta(e,n){return(n||new Vr).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMeta(e,n){return e.setPosition(e.position()+js),(n||new Vr).__init(e.readInt32(e.position())+e.position(),e)}name(e){const n=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+n,e)}target(e){const n=this.bb.__offset(this.bb_pos,6);return this.bb.__string(this.bb_pos+n,e)}static startMeta(e){e.startObject(2)}static addName(e,n){e.addFieldOffset(0,n,0)}static addTarget(e,n){e.addFieldOffset(1,n,0)}static endMeta(e){const n=e.endObject();return e.requiredField(n,4),e.requiredField(n,6),n}static createMeta(e,n,r){return Vr.startMeta(e),Vr.addName(e,n),Vr.addTarget(e,r),Vr.endMeta(e)}}class yn{constructor(){tn(this,"bb",null);tn(this,"bb_pos",0)}__init(e,n){return this.bb_pos=e,this.bb=n,this}static getRootAsVariable(e,n){return(n||new yn).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsVariable(e,n){return e.setPosition(e.position()+js),(n||new yn).__init(e.readInt32(e.position())+e.position(),e)}id(e){const n=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+n,e)}name(e){const n=this.bb.__offset(this.bb_pos,6);return this.bb.__string(this.bb_pos+n,e)}keyword(e){const n=this.bb.__offset(this.bb_pos,8);return this.bb.__string(this.bb_pos+n,e)}dataType(e){const n=this.bb.__offset(this.bb_pos,10);return this.bb.__string(this.bb_pos+n,e)}defaultValue(e){const n=this.bb.__offset(this.bb_pos,12);return n?this.bb.__string(this.bb_pos+n,e):null}static startVariable(e){e.startObject(5)}static addId(e,n){e.addFieldOffset(0,n,0)}static addName(e,n){e.addFieldOffset(1,n,0)}static addKeyword(e,n){e.addFieldOffset(2,n,0)}static addDataType(e,n){e.addFieldOffset(3,n,0)}static addDefaultValue(e,n){e.addFieldOffset(4,n,0)}static endVariable(e){const n=e.endObject();return e.requiredField(n,4),e.requiredField(n,6),e.requiredField(n,8),e.requiredField(n,10),n}static createVariable(e,n,r,i,s,o){return yn.startVariable(e),yn.addId(e,n),yn.addName(e,r),yn.addKeyword(e,i),yn.addDataType(e,s),yn.addDefaultValue(e,o),yn.endVariable(e)}}class Zt{constructor(){tn(this,"bb",null);tn(this,"bb_pos",0)}__init(e,n){return this.bb_pos=e,this.bb=n,this}static getRootAsFlow(e,n){return(n||new Zt).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFlow(e,n){return e.setPosition(e.position()+js),(n||new Zt).__init(e.readInt32(e.position())+e.position(),e)}static bufferHasIdentifier(e){return e.__has_identifier("FSFL")}version(e){const n=this.bb.__offset(this.bb_pos,4);return this.bb.__string(this.bb_pos+n,e)}meta(e){const n=this.bb.__offset(this.bb_pos,6);return n?(e||new Vr).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null}nodes(e,n){const r=this.bb.__offset(this.bb_pos,8);return r?(n||new Ln).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}nodesLength(){const e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}edges(e,n){const r=this.bb.__offset(this.bb_pos,10);return r?(n||new On).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}edgesLength(){const e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}variables(e,n){const r=this.bb.__offset(this.bb_pos,12);return r?(n||new yn).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+e*4),this.bb):null}variablesLength(){const e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFlow(e){e.startObject(5)}static addVersion(e,n){e.addFieldOffset(0,n,0)}static addMeta(e,n){e.addFieldOffset(1,n,0)}static addNodes(e,n){e.addFieldOffset(2,n,0)}static createNodesVector(e,n){e.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)e.addOffset(n[r]);return e.endVector()}static startNodesVector(e,n){e.startVector(4,n,4)}static addEdges(e,n){e.addFieldOffset(3,n,0)}static createEdgesVector(e,n){e.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)e.addOffset(n[r]);return e.endVector()}static startEdgesVector(e,n){e.startVector(4,n,4)}static addVariables(e,n){e.addFieldOffset(4,n,0)}static createVariablesVector(e,n){e.startVector(4,n.length,4);for(let r=n.length-1;r>=0;r--)e.addOffset(n[r]);return e.endVector()}static startVariablesVector(e,n){e.startVector(4,n,4)}static endFlow(e){const n=e.endObject();return e.requiredField(n,4),n}static finishFlowBuffer(e,n){e.finish(n,"FSFL")}static finishSizePrefixedFlowBuffer(e,n){e.finish(n,"FSFL",!0)}}const Ag="FSFL";function WF(t,e,n){return vn.startPosition(t),vn.addX(t,e),vn.addY(t,n),vn.endPosition(t)}function UF(t,e){var a,l;const n=wy.encode(e.data??{}),r=Ln.createDataVector(t,n),i=t.createString(e.id??""),s=t.createString(e.type??""),o=WF(t,((a=e.position)==null?void 0:a.x)??0,((l=e.position)==null?void 0:l.y)??0);return Ln.startFlowNode(t),Ln.addId(t,i),Ln.addType(t,s),Ln.addPosition(t,o),Ln.addData(t,r),Ln.endFlowNode(t)}function YF(t,e){const n=t.createString(e.id??""),r=t.createString(e.source??""),i=e.sourceHandle!==void 0?t.createString(e.sourceHandle):0,s=t.createString(e.target??""),o=e.targetHandle!==void 0?t.createString(e.targetHandle):0;return On.createFlowEdge(t,n,r,i,s,o)}function GF(t,e){const n=t.createString(e.id??""),r=t.createString(e.name??""),i=t.createString(e.keyword??"let"),s=t.createString(e.dataType??"string"),o=e.defaultValue!==void 0?t.createString(e.defaultValue):0;return yn.createVariable(t,n,r,i,s,o)}function VP(t){var h,p;const e=new yF(1024),n=e.createString(t.version??""),r=e.createString(((h=t.meta)==null?void 0:h.name)??""),i=e.createString(((p=t.meta)==null?void 0:p.target)??""),s=Vr.createMeta(e,r,i),o=t.nodes.map(m=>UF(e,m)),a=Zt.createNodesVector(e,o),l=t.edges.map(m=>YF(e,m)),c=Zt.createEdgesVector(e,l),u=(t.variables??[]).map(m=>GF(e,m)),f=Zt.createVariablesVector(e,u);Zt.startFlow(e),Zt.addVersion(e,n),Zt.addMeta(e,s),Zt.addNodes(e,a),Zt.addEdges(e,c),Zt.addVariables(e,f);const d=Zt.endFlow(e);return e.finish(d,Ag),e.asUint8Array()}function jP(t){if(t.length<8)throw new Error(`not a valid FlowServer FlatBuffers file: only ${t.length} bytes (too short)`);const e=new Fl(t);if(!e.__has_identifier(Ag))throw new Error(`not a valid FlowServer FlatBuffers file: missing or mismatched file identifier (expected "${Ag}") — this file may still be in the old JSON format and need migration (see scripts/migrate-blueprints.mjs)`);const n=Zt.getRootAsFlow(e),r=[];for(let a=0;a<n.nodesLength();a++){const l=n.nodes(a);if(!l)continue;const c=l.dataArray(),u=c&&c.length>0?wy.toObject(c.slice().buffer):{},f=l.position();r.push({id:l.id(),type:l.type(),position:{x:f?f.x():0,y:f?f.y():0},data:u})}const i=[];for(let a=0;a<n.edgesLength();a++){const l=n.edges(a);if(!l)continue;const c=l.sourceHandle(),u=l.targetHandle(),f={id:l.id(),source:l.source(),target:l.target()};c!==null&&(f.sourceHandle=c),u!==null&&(f.targetHandle=u),i.push(f)}const s=[];for(let a=0;a<n.variablesLength();a++){const l=n.variables(a);if(!l)continue;const c=l.defaultValue(),u=l.dataType(),f={id:l.id(),name:l.name(),keyword:l.keyword(),dataType:u||"string"};c!==null&&(f.defaultValue=c),s.push(f)}const o=n.meta();return{version:n.version(),meta:{name:o?o.name():"",target:o?o.target():"express"},nodes:r,edges:i,variables:s}}const HF=Oy("ChpmbG93c2VydmVyL3YxL2VkaXRvci5wcm90bxINZmxvd3NlcnZlci52MSJlCg9WYWxpZGF0aW9uRXJyb3ISDwoHbm9kZV9pZBgBIAEoCRIZChFibHVlcHJpbnRfbm9kZV9pZBgCIAEoCRIPCgdtZXNzYWdlGAMgASgJEhUKDXJlbGF0aXZlX3BhdGgYBCABKAkiOQoOUG9ydERlZmluaXRpb24SCgoCaWQYASABKAkSDQoFbGFiZWwYAiABKAkSDAoEa2luZBgDIAEoCSKFAQoLQ29uZmlnRmllbGQSCwoDa2V5GAEgASgJEg0KBWxhYmVsGAIgASgJEgwKBHR5cGUYAyABKAkSDwoHb3B0aW9ucxgEIAMoCRItCg1kZWZhdWx0X3ZhbHVlGAUgASgLMhYuZ29vZ2xlLnByb3RvYnVmLlZhbHVlEgwKBGhpbnQYBiABKAki5gEKDk5vZGVEZWZpbml0aW9uEgwKBHR5cGUYASABKAkSEAoIY2F0ZWdvcnkYAiABKAkSDQoFbGFiZWwYAyABKAkSEwoLZGVzY3JpcHRpb24YBCABKAkSLQoGaW5wdXRzGAUgAygLMh0uZmxvd3NlcnZlci52MS5Qb3J0RGVmaW5pdGlvbhIuCgdvdXRwdXRzGAYgAygLMh0uZmxvd3NlcnZlci52MS5Qb3J0RGVmaW5pdGlvbhIxCg1jb25maWdfc2NoZW1hGAcgAygLMhouZmxvd3NlcnZlci52MS5Db25maWdGaWVsZCInChZHZXROb2RlUmVnaXN0cnlSZXF1ZXN0Eg0KBXNjb3BlGAEgASgJIk0KF0dldE5vZ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sdWdpblJlcXVlc3QaJC5mbG93c2VydmVyLnYxLkluc3RhbGxQbHVnaW5SZXNwb25zZWIGcHJvdG8z",[lh]);var Ig;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.FILE=1]="FILE",t[t.FOLDER=2]="FOLDER"})(Ig||(Ig={}));const qF=qB(HF,0),KF=OF({baseUrl:"/api"}),Lt=XB(qF,KF);function JF(t){return{nodeId:t.nodeId||void 0,blueprintNodeId:t.blueprintNodeId||void 0,message:t.message}}function ky(t){return{relativePath:t.relativePath,nodeId:t.nodeId||void 0,message:t.message}}function eX(t){if(!(!t||t.kind.case===void 0))switch(t.kind.case){case"nullValue":return null;case"stringValue":case"numberValue":case"boolValue":return t.kind.value;default:return}}function Kv(t){return{id:t.id,label:t.label,kind:t.kind===""?void 0:t.kind}}function tX(t){return{key:t.key,label:t.label,type:t.type,options:t.options,default:eX(t.defaultValue),hint:t.hint}}function nX(t){return{type:t.type,category:t.category,label:t.label,description:t.description,inputs:t.inputs.map(Kv),outputs:t.outputs.map(Kv),configSchema:t.configSchema.map(tX)}}function BP(t){return t.kind===Ig.FOLDER?{type:"folder",name:t.name,relativePath:t.relativePath,children:t.children.map(BP)}:{type:"file",name:t.name,relativePath:t.relativePath}}async function Ey(t){return(await Lt.getNodeRegistry({scope:t??""})).definitions.map(nX)}async function rX(t){const e=await Lt.validateFlow({flatbufferFlow:VP(t)});return{valid:e.valid,errors:e.errors.map(JF)}}async function iX(){const t=await Lt.startRun({});switch(t.result.case){case"started":return{running:!0};case"validationFailure":return{valid:!1,errors:t.result.value.errors.map(ky)};case"error":return{error:t.result.value};default:throw new Error("StartRun response had no recognized result")}}async function sX(){await Lt.stopRun({})}function oX(t,e){const n=new AbortController;return(async()=>{try{for await(const r of Lt.runLogs({},{signal:n.signal}))r.event.case==="log"?t(r.event.value):r.event.case==="exit"&&e(r.event.value.code??null)}catch{}})(),()=>n.abort()}async function aX(){return(await Lt.listFiles({})).tree.map(BP)}async function lX(t){return{ok:!0,path:(await Lt.createFolder({path:t})).path}}async function cX(t){const e=await Lt.createBlueprint({path:t});return{ok:!0,path:e.path,flow:jP(e.flatbufferFlow)}}async function FP(t){const e=await Lt.getBlueprint({path:t});return jP(e.flatbufferFlow)}async function uX(t,e){await Lt.saveBlueprint({path:t,flatbufferFlow:VP(e)})}async function fX(t,e){await Lt.renamePath({from:t,to:e})}async function dX(t){await Lt.deletePath({path:t})}async function hX(){const t=await Lt.compileProject({}),e=t.results.map(n=>({relativePath:n.relativePath,code:n.code}));return t.valid?{valid:!0,results:e}:{valid:!1,results:e,errors:t.errors.map(ky)}}async function pX(){const t=await Lt.writeCompiledProject({});return t.valid?{written:!0,files:t.files.map(e=>({relativePath:e.relativePath,outputPath:e.outputPath}))}:{valid:!1,errors:t.errors.map(ky)}}async function mX(t){const e=await Lt.installPlugin({pluginJson:t});return{ok:e.ok,type:e.type,relativePath:e.relativePath,errors:e.errors}}function gX(t){return{nodes:t.nodes.map(e=>({id:e.id,type:e.type,position:e.position,data:e.data})),edges:t.edges.map(e=>({id:e.id,source:e.source,target:e.target,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle,type:"flow-edge"}))}}function Jv(t,e,n,r){return{version:"1",meta:n,nodes:t.map(i=>({id:i.id,type:i.type,position:i.position,data:i.data??{}})),edges:e.map(i=>({id:i.id,source:i.source,target:i.target,sourceHandle:i.sourceHandle??void 0,targetHandle:i.targetHandle??void 0})),variables:r}}const XP=new Set(["operators.and","operators.nand","operators.or","operators.nor","operators.xor"]),OX=new Set(["operators.add","operators.subtract","operators.multiply","operators.divide","operators.modulo","operators.equal","operators.notEqual","operators.greaterThan","operators.lessThan","operators.greaterOrEqual","operators.lessOrEqual"]),yX=new Set(["operators.and","operators.nand","operators.or","operators.nor","operators.xor","operators.not","controlFlow.branch"]),bX=new Set(["controlFlow.switch","variable.set"]);function zP(t){return t?OX.has(t)?"number":yX.has(t)?"boolean":bX.has(t)?"text":null:null}function xX(t,e){return t==="controlFlow.switch"?["selection"]:t==="controlFlow.branch"?["condition"]:e.inputs.filter(n=>n.kind!=="exec").map(n=>n.id)}function rd(t,e){const n=zP(t);if(!n)return;const r=xX(t,e);if(r.length===0)return;const i=n==="number"?0:n==="boolean"?!1:"0";return Object.fromEntries(r.map(s=>[s,i]))}function Pc(t){return Array.isArray(t==null?void 0:t.cases)?t.cases:[]}function WP(t,e,n){if(t==="logic.functionCall")return[...n.inputs,...String((e==null?void 0:e.params)??"").split(",").map(r=>r.trim()).filter(r=>r.length>0).map((r,i)=>({id:`param-${i}`,label:r}))];if(t&&XP.has(t)){const r=Array.isArray(e==null?void 0:e.extraInputs)?e.extraInputs:[];return[...n.inputs,...r.map(i=>({id:i,label:""}))]}return n.inputs}function UP(t,e,n){return t==="logic.graphEntry"?[...n.outputs,...(Array.isArray(e==null?void 0:e.params)?e.params:[]).map(r=>({id:r,label:r}))]:t==="controlFlow.switch"?[...Pc(e).map(r=>({id:`case-${r.id}`,label:String(r.value),kind:"exec"})),...n.outputs]:n.outputs}function YP(t){var i,s;const e=Array.isArray((i=t.data)==null?void 0:i.extraInputs)?t.data.extraInputs:[],n=Number(((s=t.data)==null?void 0:s.nextInputSeq)??0),r=`extra-${n}`;return{...t,data:{...t.data,extraInputs:[...e,r],nextInputSeq:n+1}}}function GP(t,e,n,r){return{nodes:n.map(i=>{var s;return i.id===t?{...i,data:{...i.data,extraInputs:(Array.isArray((s=i.data)==null?void 0:s.extraInputs)?i.data.extraInputs:[]).filter(o=>o!==e)}}:i}),edges:r.filter(i=>!(i.target===t&&i.targetHandle===e))}}function HP(t){var i;const e=Pc(t.data),n=Number(((i=t.data)==null?void 0:i.nextCaseSeq)??0),r={id:String(n),value:0};return{...t,data:{...t.data,cases:[...e,r],nextCaseSeq:n+1}}}function qP(t,e,n,r){const i=`case-${e}`;return{nodes:n.map(s=>s.id===t?{...s,data:{...s.data,cases:Pc(s.data).filter(o=>o.id!==e)}}:s),edges:r.filter(s=>!(s.source===t&&s.sourceHandle===i))}}function KP(t,e,n,r){return r.map(i=>i.id===t?{...i,data:{...i.data,cases:Pc(i.data).map(s=>s.id===e?{...s,value:n}:s)}}:i)}let Qg=1;function _p(t){return`${t.replace(/\./g,"_")}_${Qg++}`}let Rg=1;function vX(){return`edge_${Rg++}`}let Mg=1;function wX(){return`variable_${Mg++}`}function SX(t,e){for(const n of t){const r=/_(\d+)$/.exec(n.id);r&&(Qg=Math.max(Qg,Number(r[1])+1))}for(const n of e){const r=/^edge_(\d+)$/.exec(n.id);r&&(Rg=Math.max(Rg,Number(r[1])+1))}}function kX(t){for(const e of t){const n=/_(\d+)$/.exec(e.id);n&&(Mg=Math.max(Mg,Number(n[1])+1))}}const EX={name:"flowserver-app",target:"express"};function TX(t){var n,r,i;const e=new Set;for(const s of t)s.type==="logic.function"?e.add(String(((n=s.data)==null?void 0:n.name)??"").trim()):s.type==="logic.require"?e.add(String(((r=s.data)==null?void 0:r.variableName)??"").trim()):s.type==="logic.functionCall"&&e.add(String(((i=s.data)==null?void 0:i.resultVariable)??"").trim());return e.delete(""),e}function NX(t,e){const n=TX(e),r=`${t}Result`;if(!n.has(r))return r;let i=2;for(;n.has(`${r}${i}`);)i++;return`${r}${i}`}async function ew(t){const e=await Ey(),n=Object.fromEntries(e.map(r=>[r.type,r]));t({nodeDefinitions:n})}const PX=500;let Cp,fi;function id(t){return t.compiledAtRevision!==t.projectRevision}const U=KO((t,e)=>({nodes:[],edges:[],meta:EX,variables:[],currentFilePath:null,nodeDefinitions:{},selectedNodeId:null,validationErrors:[],compiledResults:null,compileErrors:[],projectRevision:0,compiledAtRevision:null,isCompiling:!1,isWritingAll:!1,lastWrittenFiles:null,selectedPreviewFile:null,isPreviewOpen:!1,isNodeBrowserOpen:!1,isErrorLogOpen:!1,expandedCodeField:null,openFunctionGraphNodeId:null,isLoading:!1,isSaving:!1,isDirty:!1,lastError:null,isServerRunning:!1,isStartingServer:!1,isStoppingServer:!1,serverLogs:[],bootstrap:async()=>{t({isLoading:!0,lastError:null});try{await ew(t),t({isLoading:!1})}catch(n){t({isLoading:!1,lastError:n.message})}},openFile:async n=>{if(!(e().isDirty&&!window.confirm("You have unsaved changes in the current file. Discard them and switch?"))){t({isLoading:!0,lastError:null});try{const r=await FP(n),{nodes:i,edges:s}=gX(r);SX(i,s);const o=r.variables??[];kX(o),t({nodes:i,edges:s,meta:r.meta,variables:o,currentFilePath:n,selectedNodeId:null,validationErrors:[],isDirty:!1,isLoading:!1}),e().runValidation()}catch(r){t({isLoading:!1,lastError:r.message})}}},onNodesChange:n=>{const r=n.some(i=>i.type!=="select"&&i.type!=="dimensions");t({nodes:UO(n,e().nodes),isDirty:e().isDirty||r}),e().runValidation()},onEdgesChange:n=>{const r=n.some(i=>i.type!=="select");t({edges:YO(n,e().edges),isDirty:e().isDirty||r}),e().runValidation()},onConnect:n=>{n.source!==n.target&&(t({edges:GO({...n,id:vX(),type:"flow-edge"},e().edges),isDirty:!0}),e().runValidation())},addNodeFromPalette:(n,r)=>{const i=e().nodeDefinitions[n];if(!i)return;const s=Object.fromEntries(i.configSchema.map(l=>[l.key,l.default])),o=rd(n,i);o&&(s.literals=o);const a={id:_p(n),type:n,position:r,data:s};t({nodes:[...e().nodes,a],isDirty:!0}),e().runValidation()},addNodeFromBrowser:n=>{const r=e().nodes.length,i={x:120+r%4*260,y:100+Math.floor(r/4)*180};e().addNodeFromPalette(n,i)},addFunctionCallNode:(n,r)=>{const{nodes:i}=e(),s=r??{x:120+i.length%4*260,y:100+Math.floor(i.length/4)*180},o={id:_p("logic.functionCall"),type:"logic.functionCall",position:s,data:{requirePath:n.requirePath,variableName:n.variableName,functionName:n.functionName,params:n.params,resultVariable:NX(n.functionName,i)}};t({nodes:[...i,o],isDirty:!0}),e().runValidation()},addVariableNode:(n,r,i)=>{const s=r==="get"?"variable.get":"variable.set",o={variableId:n},a=e().nodeDefinitions[s];if(a){const c=rd(s,a);c&&(o.literals=c)}const l={id:_p(s),type:s,position:i,data:o};t({nodes:[...e().nodes,l],isDirty:!0}),e().runValidation()},openNodeBrowser:()=>t({isNodeBrowserOpen:!0}),closeNodeBrowser:()=>t({isNodeBrowserOpen:!1}),updateNodeConfig:(n,r,i)=>{t({nodes:e().nodes.map(s=>s.id===n?{...s,data:{...s.data,[r]:i}}:s),isDirty:!0}),e().runValidation()},addInputPin:n=>{t({nodes:e().nodes.map(r=>r.id===n?YP(r):r),isDirty:!0}),e().runValidation()},removeInputPin:(n,r)=>{const{nodes:i,edges:s}=GP(n,r,e().nodes,e().edges);t({nodes:i,edges:s,isDirty:!0}),e().runValidation()},addSwitchCasePin:n=>{t({nodes:e().nodes.map(r=>r.id===n?HP(r):r),isDirty:!0}),e().runValidation()},removeSwitchCasePin:(n,r)=>{const{nodes:i,edges:s}=qP(n,r,e().nodes,e().edges);t({nodes:i,edges:s,isDirty:!0}),e().runValidation()},updateSwitchCaseValue:(n,r,i)=>{t({nodes:KP(n,r,i,e().nodes),isDirty:!0}),e().runValidation()},selectNode:n=>t({selectedNodeId:n}),deleteSelectedNode:()=>{const{selectedNodeId:n}=e();n&&(t({nodes:e().nodes.filter(r=>r.id!==n),edges:e().edges.filter(r=>r.source!==n&&r.target!==n),selectedNodeId:null,isDirty:!0}),e().runValidation())},deleteEdge:n=>{t({edges:e().edges.filter(r=>r.id!==n),isDirty:!0}),e().runValidation()},addVariable:()=>{const{variables:n}=e(),r=new Set(n.map(a=>a.name));let i="variable",s=1;for(;r.has(i);)s+=1,i=`variable${s}`;const o={id:wX(),name:i,keyword:"let",dataType:"string",defaultValue:""};t({variables:[...n,o],isDirty:!0}),e().runValidation()},renameVariable:(n,r)=>{t({variables:e().variables.map(i=>i.id===n?{...i,name:r}:i),isDirty:!0}),e().runValidation()},setVariableKeyword:(n,r)=>{t({variables:e().variables.map(i=>i.id===n?{...i,keyword:r}:i),isDirty:!0}),e().runValidation()},setVariableDataType:(n,r)=>{t({variables:e().variables.map(i=>i.id===n?{...i,dataType:r}:i),isDirty:!0}),e().runValidation()},setVariableDefault:(n,r)=>{t({variables:e().variables.map(i=>i.id===n?{...i,defaultValue:r}:i),isDirty:!0}),e().runValidation()},removeVariable:n=>{t({variables:e().variables.filter(r=>r.id!==n),isDirty:!0}),e().runValidation()},saveFlow:async()=>{const{currentFilePath:n}=e();if(n){t({isSaving:!0,lastError:null});try{const{nodes:r,edges:i,meta:s,variables:o}=e();await uX(n,Jv(r,i,s,o)),t({isSaving:!1,isDirty:!1}),e().bumpProjectRevision()}catch(r){t({isSaving:!1,lastError:r.message})}}},runValidation:()=>(Cp&&clearTimeout(Cp),new Promise(n=>{Cp=setTimeout(async()=>{try{const{nodes:r,edges:i,meta:s,variables:o}=e(),a=await rX(Jv(r,i,s,o));t({validationErrors:a.errors})}catch{}n()},500)})),bumpProjectRevision:()=>t(n=>({projectRevision:n.projectRevision+1})),compileProject:async()=>{var n;t({isCompiling:!0,lastError:null});try{const r=await hX(),i=e().projectRevision;t({isCompiling:!1,compiledResults:r.results,compileErrors:r.valid?[]:r.errors,compiledAtRevision:i,selectedPreviewFile:((n=r.results[0])==null?void 0:n.relativePath)??null,isPreviewOpen:r.valid?!0:e().isPreviewOpen,isErrorLogOpen:r.valid?e().isErrorLogOpen:!0})}catch(r){t({isCompiling:!1,lastError:r.message})}},writeProjectToDisk:async()=>{if(id(e()))return t({lastError:"Project files changed since last compile — click Compile again before writing."}),!1;t({isWritingAll:!0,lastError:null});try{const n=await pX();return!("written"in n)||!n.written?(t({isWritingAll:!1,compileErrors:n.errors}),!1):(t({isWritingAll:!1,lastWrittenFiles:n.files}),!0)}catch(n){return t({isWritingAll:!1,lastError:n.message}),!1}},selectPreviewFile:n=>t({selectedPreviewFile:n}),openPreview:()=>t({isPreviewOpen:!0}),closePreview:()=>t({isPreviewOpen:!1}),toggleErrorLog:()=>t(n=>({isErrorLogOpen:!n.isErrorLogOpen})),closeErrorLog:()=>t({isErrorLogOpen:!1}),openCodeExpand:(n,r,i)=>t({expandedCodeField:{nodeId:n,fieldKey:r,fieldLabel:i}}),closeCodeExpand:()=>t({expandedCodeField:null}),openFunctionGraph:n=>t({openFunctionGraphNodeId:n}),closeFunctionGraph:()=>t({openFunctionGraphNodeId:null}),startServer:async()=>{if(id(e()))return t({lastError:"Project files changed since last compile — click Compile again before running."}),!1;t({isStartingServer:!0,lastError:null,serverLogs:[]});try{const n=await iX();return"running"in n?(fi==null||fi(),fi=oX(r=>{t(i=>({serverLogs:[...i.serverLogs,r].slice(-PX)}))},()=>{t({isServerRunning:!1})}),t({isStartingServer:!1,isServerRunning:!0}),!0):"errors"in n?(t({isStartingServer:!1,compileErrors:n.errors,isErrorLogOpen:!0}),!1):(t({isStartingServer:!1,lastError:n.error}),!1)}catch(n){return t({isStartingServer:!1,lastError:n.message}),!1}},stopServer:async()=>{t({isStoppingServer:!0,lastError:null});try{await sX(),fi==null||fi(),fi=void 0,t({isStoppingServer:!1,isServerRunning:!1})}catch(n){t({isStoppingServer:!1,lastError:n.message})}},installPlugin:async n=>{t({lastError:null});try{const r=await mX(n);return r.ok?(await ew(t),!0):(t({lastError:r.errors.join(`
|
|
64
|
+
`)}),!1)}catch(r){return t({lastError:r.message}),!1}}})),_X={schemaVersion:1,type:"plugin.httpRequest",category:"logic",label:"HTTP Request",description:'Makes an HTTP request via axios and exposes the response. Duplicate this file, change "type" to something unique, and adjust the fields below to wrap a different npm package.',inputs:[{id:"in",label:"In",kind:"exec"},{id:"body",label:"Body",kind:"value"}],outputs:[{id:"out",label:"Out",kind:"exec"},{id:"response",label:"Response",kind:"value"}],configSchema:[{key:"url",label:"URL",type:"text",default:"https://api.example.com"},{key:"method",label:"Method",type:"select",options:["GET","POST","PUT","DELETE"],default:"GET"}],npmDependencies:{axios:"^1.7.0"},async:!0,codegen:{imports:['const axios = require("axios");'],body:"const {{result}} = await axios({ method: {{config.method}}, url: {{config.url}}, data: {{body}} });"}};function CX(){const t=JSON.stringify(_X,null,2),e=new Blob([t],{type:"application/json"}),n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download="http-request.node.json",r.click(),URL.revokeObjectURL(n)}function $X(){const t=U(_=>_.isDirty),e=U(_=>_.isSaving),n=U(_=>_.isCompiling),r=U(_=>_.validationErrors),i=U(_=>_.compiledResults),s=U(_=>_.currentFilePath),o=U(_=>_.lastError),a=U(_=>_.saveFlow),l=U(_=>_.compileProject),c=U(_=>_.openPreview),u=U(_=>_.openNodeBrowser),f=U(_=>_.compileErrors),d=U(_=>_.toggleErrorLog),h=U(_=>_.isServerRunning),p=U(_=>_.isStartingServer),m=U(_=>_.isStoppingServer),O=U(_=>_.startServer),g=U(_=>_.stopServer),b=U(id),y=U(_=>_.installPlugin),v=Q.useRef(null);async function S(_){var M;const V=(M=_.target.files)==null?void 0:M[0];if(_.target.value="",!V)return;const P=new Uint8Array(await V.arrayBuffer());await y(P)}const E=r.length>0,w=r.length+f.length,k=n||s===null||t,N=s===null?"Open a file first":t?"Save your changes before compiling — Compile always reads the project from disk":"Compile the whole project to Express code",$=E||p||b,C=E?`Fix ${r.length} issue(s) before running: ${r[0].message}`:b?"Click Compile first — Run Server always runs the last compiled project from disk":"Compile the whole project to disk and run its entry file";return x.jsxs("div",{className:"flex h-12 items-center gap-2 border-b border-black/60 bg-[#242424] px-3",children:[x.jsx("span",{className:"mr-2 text-sm font-bold tracking-wide text-neutral-100",children:"FlowServer"}),x.jsx("span",{className:"mr-2 text-xs text-neutral-500",children:s??"No file open"}),x.jsx("button",{onClick:a,disabled:e,className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700 disabled:opacity-50",children:e?"Saving…":t?"Save*":"Save"}),x.jsx("button",{onClick:u,className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",children:"Browse Nodes"}),x.jsx("input",{ref:v,type:"file",accept:".json",style:{display:"none"},onChange:S}),x.jsx("button",{onClick:()=>{var _;return(_=v.current)==null?void 0:_.click()},title:"Upload a .node.json plugin spec — see docs/phase9-npm-package-support-plan.md",className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",children:"Install Plugin"}),x.jsx("button",{onClick:CX,title:"Download a worked example plugin spec (HTTP Request via axios) to use as a starting point",className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",children:"Download Plugin Template"}),x.jsx("button",{onClick:()=>l(),disabled:k,title:N,className:"rounded bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:n?"Compiling…":"Compile"}),x.jsx("button",{onClick:c,disabled:i===null,className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700 disabled:opacity-50",children:"Preview"}),h?x.jsx("button",{onClick:()=>g(),disabled:m,className:"rounded bg-red-600 px-3 py-1 text-xs font-medium text-white hover:bg-red-700 disabled:opacity-50",children:m?"Stopping…":"Stop Server"}):x.jsx("button",{onClick:()=>O(),disabled:$,title:C,className:"rounded border border-green-600 px-3 py-1 text-xs font-medium text-green-400 hover:bg-green-600/10 disabled:opacity-50",children:p?"Starting…":"Run Server"}),x.jsxs("button",{onClick:d,className:"ml-auto flex items-center gap-1.5 rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",title:"Show validation and compile errors",children:["Problems",w>0&&x.jsx("span",{className:"rounded-full bg-red-600 px-1.5 py-0.5 text-[10px] font-bold leading-none text-white",children:w})]}),o&&x.jsx("span",{className:"text-xs text-red-400",children:o})]})}function tw(t,e){return t?`${t}/${e}`:e}const Vn=KO((t,e)=>({tree:[],isLoading:!1,lastError:null,expandedPaths:new Set,refreshTree:async()=>{t({isLoading:!0,lastError:null});try{const n=await aX();t({tree:n,isLoading:!1})}catch(n){t({isLoading:!1,lastError:n.message})}},toggleExpanded:n=>{const r=new Set(e().expandedPaths);r.has(n)?r.delete(n):r.add(n),t({expandedPaths:r})},collapseAll:()=>t({expandedPaths:new Set}),createFolder:async(n,r)=>{const i=tw(n,r);try{return await lX(i),await e().refreshTree(),U.getState().bumpProjectRevision(),!0}catch(s){return t({lastError:s.message}),!1}},createBlueprint:async(n,r)=>{const i=tw(n,r);try{const s=await cX(i);return await e().refreshTree(),U.getState().bumpProjectRevision(),s.path}catch(s){return t({lastError:s.message}),null}},renamePath:async(n,r)=>{try{return await fX(n,r),await e().refreshTree(),U.getState().bumpProjectRevision(),!0}catch(i){return t({lastError:i.message}),!1}},deletePath:async n=>{try{return await dX(n),await e().refreshTree(),U.getState().bumpProjectRevision(),!0}catch(r){return t({lastError:r.message}),!1}}}));function ph({initial:t,min:e,max:n,axis:r,invert:i=!1}){const[s,o]=Q.useState(t),a=Q.useRef(t);a.current=s;const l=Q.useCallback(c=>{c.preventDefault();const u=r==="x"?c.clientX:c.clientY,f=a.current,d=document.body.style.cursor,h=document.body.style.userSelect,p=O=>{const b=(r==="x"?O.clientX:O.clientY)-u,y=i?-b:b;o(Math.min(n,Math.max(e,f+y)))},m=()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",m),document.body.style.cursor=d,document.body.style.userSelect=h};window.addEventListener("mousemove",p),window.addEventListener("mouseup",m),document.body.style.cursor=r==="x"?"col-resize":"row-resize",document.body.style.userSelect="none"},[r,i,e,n]);return{size:s,onMouseDown:l}}function ko({axis:t,onMouseDown:e}){return x.jsx("div",{onMouseDown:e,className:t==="x"?"w-1 shrink-0 cursor-col-resize bg-black/60 hover:bg-sky-500/70 active:bg-sky-500/70":"h-1 shrink-0 cursor-row-resize bg-black/60 hover:bg-sky-500/70 active:bg-sky-500/70"})}function AX(t,e){return t?`${t}/${e}`:e}function IX(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function JP({node:t,depth:e,selectedFolderPath:n,onSelectFolder:r}){const i=Vn(m=>m.expandedPaths),s=Vn(m=>m.toggleExpanded),o=Vn(m=>m.renamePath),a=Vn(m=>m.deletePath),l=U(m=>m.currentFilePath),c=U(m=>m.openFile),u=e*12,f=m=>{m.stopPropagation();const O=window.prompt("Rename to:",t.name);if(!O||O===t.name)return;const g=AX(IX(t.relativePath),O);o(t.relativePath,g)},d=m=>{m.stopPropagation();const O=t.type==="folder"?`Delete folder "${t.name}" and everything inside it?`:`Delete file "${t.name}"?`;window.confirm(O)&&a(t.relativePath)};if(t.type==="folder"){const m=i.has(t.relativePath),O=n===t.relativePath;return x.jsxs("div",{children:[x.jsxs("div",{onClick:g=>{g.stopPropagation(),s(t.relativePath),r(t.relativePath)},style:{paddingLeft:u},className:`group flex cursor-pointer items-center gap-1 py-1 pr-2 text-xs hover:bg-neutral-700 ${O?"bg-neutral-700/70":""}`,children:[x.jsx("span",{className:"w-3 shrink-0 text-neutral-500",children:m?"▾":"▸"}),x.jsx("span",{className:"truncate text-neutral-200",children:t.name}),x.jsxs("span",{className:"ml-auto flex shrink-0 gap-1 opacity-0 group-hover:opacity-100",children:[x.jsx("button",{onClick:f,title:"Rename",className:"rounded px-1 text-neutral-400 hover:text-neutral-100",children:"✎"}),x.jsx("button",{onClick:d,title:"Delete",className:"rounded px-1 text-neutral-400 hover:text-red-400",children:"🗑"})]})]}),m&&t.children.map(g=>x.jsx(JP,{node:g,depth:e+1,selectedFolderPath:n,onSelectFolder:r},g.relativePath))]})}const h=t.name.endsWith(".blueprint"),p=t.relativePath===l;return x.jsxs("div",{onClick:m=>{m.stopPropagation(),h&&c(t.relativePath)},style:{paddingLeft:u+14},className:`group flex items-center gap-1 py-1 pr-2 text-xs ${h?"cursor-pointer hover:bg-neutral-700":"cursor-default opacity-50"} ${p?"bg-sky-700/40":""}`,children:[x.jsx("span",{className:"truncate text-neutral-200",children:t.name}),x.jsxs("span",{className:"ml-auto flex shrink-0 gap-1 opacity-0 group-hover:opacity-100",children:[x.jsx("button",{onClick:f,title:"Rename",className:"rounded px-1 text-neutral-400 hover:text-neutral-100",children:"✎"}),x.jsx("button",{onClick:d,title:"Delete",className:"rounded px-1 text-neutral-400 hover:text-red-400",children:"🗑"})]})]})}function QX(){const t=Vn(h=>h.tree),e=Vn(h=>h.refreshTree),n=Vn(h=>h.collapseAll),r=Vn(h=>h.createFolder),i=Vn(h=>h.createBlueprint),s=Vn(h=>h.lastError),o=U(h=>h.openFile),[a,l]=Q.useState(null),{size:c,onMouseDown:u}=ph({initial:224,min:160,max:480,axis:"x"});Q.useEffect(()=>{e()},[e]);const f=async()=>{const h=window.prompt("File name (e.g. server.blueprint):");if(!h)return;const p=h.trim();if(!p)return;const m=p.endsWith(".blueprint")?p:`${p}.blueprint`,O=await i(a??"",m);O&&o(O)},d=async()=>{const h=window.prompt("Folder name:");if(!h)return;const p=h.trim();p&&await r(a??"",p)};return x.jsxs("div",{className:"flex h-full shrink-0",style:{width:c},children:[x.jsxs("div",{className:"flex h-full min-w-0 flex-1 flex-col overflow-y-auto border-r border-black/60 bg-[#1f1f1f]",children:[x.jsxs("div",{className:"flex items-center justify-between px-3 pt-3",children:[x.jsx("h2",{className:"text-xs font-semibold uppercase tracking-wide text-neutral-500",children:"Explorer"}),x.jsxs("div",{className:"flex gap-1 text-[11px] text-neutral-400",children:[x.jsx("button",{onClick:f,title:"New File",className:"rounded px-1 hover:text-neutral-100",children:"+File"}),x.jsx("button",{onClick:d,title:"New Folder",className:"rounded px-1 hover:text-neutral-100",children:"+Folder"}),x.jsx("button",{onClick:()=>e(),title:"Refresh",className:"rounded px-1 hover:text-neutral-100",children:"⟳"}),x.jsx("button",{onClick:n,title:"Collapse All",className:"rounded px-1 hover:text-neutral-100",children:"⊟"})]})]}),s&&x.jsx("p",{className:"px-3 pt-1 text-[11px] text-red-400",children:s}),x.jsx("div",{onClick:()=>l(null),className:`mt-2 flex-1 ${a===null?"bg-neutral-800/40":""}`,children:t.map(h=>x.jsx(JP,{node:h,depth:0,selectedFolderPath:a,onSelectFolder:l},h.relativePath))})]}),x.jsx(ko,{axis:"x",onMouseDown:u})]})}function zl(){return zl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},zl.apply(null,arguments)}function RX(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}let Lg=[],e_=[];(()=>{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?e_:Lg).push(n=n+t[e])})();function MX(t){if(t<768)return!1;for(let e=0,n=Lg.length;;){let r=e+n>>1;if(t<Lg[r])n=r;else if(t>=e_[r])e=r+1;else return!0;if(e==n)return!1}}function nw(t){return t>=127462&&t<=127487}const rw=8205;function LX(t,e,n=!0,r=!0){return(n?t_:DX)(t,e,r)}function t_(t,e,n){if(e==t.length)return e;e&&n_(t.charCodeAt(e))&&r_(t.charCodeAt(e-1))&&e--;let r=$p(t,e);for(e+=iw(r);e<t.length;){let i=$p(t,e);if(r==rw||i==rw||n&&MX(i))e+=iw(i),r=i;else if(nw(i)){let s=0,o=e-2;for(;o>=0&&nw($p(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function DX(t,e,n){for(;e>1;){let r=t_(t,e-2,n);if(r<e)return r;e--}return 0}function $p(t,e){let n=t.charCodeAt(e);if(!r_(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return n_(r)?(n-55296<<10)+(r-56320)+65536:n}function n_(t){return t>=56320&&t<57344}function r_(t){return t>=55296&&t<56320}function iw(t){return t<65536?1:2}class xe{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=qo(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),gr.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=qo(this,e,n);let r=[];return this.decompose(e,n,r,0),gr.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new tl(this),s=new tl(e);for(let o=n,a=n;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new tl(this,e)}iterRange(e,n=this.length){return new i_(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new s_(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?xe.empty:e.length<=32?new Ge(e):gr.from(Ge.split(e,[]))}}class Ge extends xe{constructor(e,n=ZX(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((n?r:a)>=e)return new VX(i,a,r,o);i=a+1,r++}}decompose(e,n,r,i){let s=e<=0&&n>=this.length?this:new Ge(sw(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=lf(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new Ge(a,o.length+s.length));else{let l=a.length>>1;r.push(new Ge(a.slice(0,l)),new Ge(a.slice(l)))}}else r.push(s)}replace(e,n,r){if(!(r instanceof Ge))return super.replace(e,n,r);[e,n]=qo(this,e,n);let i=lf(this.text,lf(r.text,sw(this.text,0,e)),n),s=this.length+r.length-(n-e);return i.length<=32?new Ge(i,s):gr.from(Ge.split(i,[]),s)}sliceString(e,n=this.length,r=`
|
|
65
|
+
`){[e,n]=qo(this,e,n);let i="";for(let s=0,o=0;s<=n&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&n>s&&(i+=a.slice(Math.max(0,e-s),n-s)),s=l+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(n.push(new Ge(r,i)),r=[],i=-1);return i>-1&&n.push(new Ge(r,i)),n}}class gr extends xe{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((n?l:a)>=e)return o.lineInner(e,n,r,i);i=a+1,r=l+1}}decompose(e,n,r,i){for(let s=0,o=0;o<=n&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&n>=o){let c=i&((o<=e?1:0)|(l>=n?2:0));o>=e&&l<=n&&!c?r.push(a):a.decompose(e-o,n-o,r,c)}o=l+1}}replace(e,n,r){if([e,n]=qo(this,e,n),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&n<=a){let l=o.replace(e-s,n-s,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new gr(u,this.length-(n-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
|
|
66
|
+
`){[e,n]=qo(this,e,n);let i="";for(let s=0,o=0;s<this.children.length&&o<=n;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&n>o&&(i+=a.sliceString(e-o,n-o,r)),o=l+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof gr))return 0;let r=0,[i,s,o,a]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,s+=n){if(i==o||s==a)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,n);r+=l.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let p of e)p.flatten(h);return new Ge(h,n)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,u=[];function f(h){let p;if(h.lines>s&&h instanceof gr)for(let m of h.children)f(m);else h.lines>o&&(l>o||!l)?(d(),a.push(h)):h instanceof Ge&&l&&(p=u[u.length-1])instanceof Ge&&h.lines+p.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new Ge(p.text.concat(h.text),p.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:gr.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new gr(a,n)}}xe.empty=new Ge([""],0);function ZX(t){let e=-1;for(let n of t)e+=n.length+1;return e}function lf(t,e,n=0,r=1e9){for(let i=0,s=0,o=!0;s<t.length&&i<=r;s++){let a=t[s],l=i+a.length;l>=n&&(l>r&&(a=a.slice(0,r-i)),i<n&&(a=a.slice(n-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function sw(t,e,n){return lf(t,[""],e,n)}class tl{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 Ge?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof Ge?i.text.length:i.children.length;if(o==(n>0?a:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
|
|
67
|
+
`,this;e--}else if(i instanceof Ge){let l=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,l.length>Math.max(0,e))return this.value=e==0?l:n>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(n<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(n>0?1:(l instanceof Ge?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class i_{constructor(e,n,r){this.value="",this.done=!1,this.cursor=new tl(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class s_{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(xe.prototype[Symbol.iterator]=function(){return this.iter()},tl.prototype[Symbol.iterator]=i_.prototype[Symbol.iterator]=s_.prototype[Symbol.iterator]=function(){return this});class VX{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function qo(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function ut(t,e,n=!0,r=!0){return LX(t,e,n,r)}function jX(t){return t>=56320&&t<57344}function BX(t){return t>=55296&&t<56320}function jt(t,e){let n=t.charCodeAt(e);if(!BX(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return jX(r)?(n-55296<<10)+(r-56320)+65536:n}function Ty(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Or(t){return t<65536?1:2}const Dg=/\r\n?|\n/;var yt=function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t}(yt||(yt={}));class Nr{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let s=this.sections[n++],o=this.sections[n++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,n=!1){Zg(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new Nr(e)}composeDesc(e){return this.empty?e:e.empty?this:o_(this,e)}mapDesc(e,n=!1){return e.empty?this:Vg(this,e,n)}mapPos(e,n=-1,r=yt.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(r!=yt.Simple&&c>=e&&(r==yt.TrackDel&&i<e&&c>e||r==yt.TrackBefore&&i<e||r==yt.TrackAfter&&c>e))return null;if(c>e||c==e&&n<0&&!a)return e==i||n<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=n&&a>=e)return i<e&&a>n?"cover":!0;i=a}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Nr(e)}static create(e){return new Nr(e)}}class it extends Nr{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 Zg(this,(n,r,i,s,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return Vg(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,s=0;i<n.length;i+=2){let o=n[i],a=n[i+1];if(a>=0){n[i]=a,n[i+1]=o;let l=i>>1;for(;r.length<l;)r.push(xe.empty);r.push(o?e.slice(s,s+o):xe.empty)}s+=o}return new it(n,r)}compose(e){return this.empty?e:e.empty?this:o_(this,e,!0)}map(e,n=!1){return e.empty?this:Vg(this,e,n,!0)}iterChanges(e,n=!1){Zg(this,e,n)}get desc(){return Nr.create(this.sections)}filter(e){let n=[],r=[],i=[],s=new Wl(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,l-a);Tt(i,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;Tt(n,u,f),f>0&&ki(r,n,s.text),s.forward(u),a+=u}let c=e[o++];for(;a<c;){if(s.done)break e;let u=Math.min(s.len,c-a);Tt(n,u,-1),Tt(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),a+=u}}return{changes:new it(n,r),filtered:Nr.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],s=[],o=0,a=null;function l(u=!1){if(!u&&!i.length)return;o<n&&Tt(i,n-o,-1);let f=new it(i,s);a=a?a.compose(f.map(a)):f,i=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof it){if(u.length!=n)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${n})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:f,to:d=f,insert:h}=u;if(f>d||f<0||d>n)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${n})`);let p=h?typeof h=="string"?xe.of(h.split(r||Dg)):h:xe.empty,m=p.length;if(f==d&&m==0)return;f<o&&l(),f>o&&Tt(i,f-o,-1),Tt(i,d-f,m),ki(s,i,p),o=d}}return c(e),l(!a),a}static empty(e){return new it(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")n.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)n.push(s[0],0);else{for(;r.length<i;)r.push(xe.empty);r[i]=xe.of(s.slice(1)),n.push(s[0],r[i].length)}}}return new it(n,r)}static createSet(e,n){return new it(e,n)}}function Tt(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function ki(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(xe.empty);t.push(n)}}function Zg(t,e,n){let r=t.inserted;for(let i=0,s=0,o=0;o<t.sections.length;){let a=t.sections[o++],l=t.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,u=s,f=xe.empty;for(;c+=a,u+=l,l&&r&&(f=f.append(r[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],l=t.sections[o++];e(i,c,s,u,f),i=c,s=u}}}function Vg(t,e,n,r=!1){let i=[],s=r?[]:null,o=new Wl(t),a=new Wl(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);Tt(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!n))){let c=a.len;for(Tt(i,a.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(Tt(i,0,o.ins),s&&ki(s,i,o.text),l=o.i),o.forward(u),c-=u}a.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;Tt(i,c,l<o.i?o.ins:0),s&&l<o.i&&ki(s,i,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&a.done)return s?it.createSet(i,s):Nr.create(i);throw new Error("Mismatched change set lengths")}}}function o_(t,e,n=!1){let r=[],i=n?[]:null,s=new Wl(t),o=new Wl(e);for(let a=!1;;){if(s.done&&o.done)return i?it.createSet(r,i):Nr.create(r);if(s.ins==0)Tt(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)Tt(r,0,o.ins,a),i&&ki(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=r.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;Tt(r,l,u,a),i&&u&&ki(i,r,o.text)}else o.ins==-1?(Tt(r,s.off?0:s.len,l,a),i&&ki(i,r,s.textBit(l))):(Tt(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&ki(i,r,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||r.length>c),s.forward2(l),o.forward(l)}}}}class Wl{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?xe.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?xe.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class xi{constructor(e,n,r,i){this.from=e,this.to=n,this.flags=r,this.goalColumn=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new xi(r,i,this.flags,this.goalColumn)}extend(e,n=e,r=0){if(e<=this.anchor&&n>=this.anchor)return W.range(e,n,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return W.range(this.anchor,i,void 0,void 0,r)}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 W.range(e.anchor,e.head)}static create(e,n,r,i){return new xi(e,n,r,i)}}class W{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:W.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new W([this.main],0)}addRange(e,n=!0){return W.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,W.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new W(e.ranges.map(n=>xi.fromJSON(n)),e.main)}static single(e,n=e){return new W([W.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return W.normalized(e.slice(),n);r=s.to}return new W(e,n)}static cursor(e,n=0,r,i){return xi.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r)),i)}static range(e,n,r,i,s){let o=i==null?7:Math.min(6,i);return!s&&e!=n&&(s=n<e?1:-1),s&&(o|=s<0?8:16),n<e?xi.create(n,e,o|32,r):xi.create(e,n,o,r)}static undirectionalRange(e,n){return xi.create(e,n,64,void 0)}static normalized(e,n=0){let r=e[n];e.sort((i,s)=>i.from-s.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=n&&n--,e.splice(--i,2,s.anchor>s.head?W.range(l,a):W.range(a,l))}}return new W(e,n)}}function a_(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Ny=0;class re{constructor(e,n,r,i,s){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Ny++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new re(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:Py),!!e.static,e.enables)}of(e){return new cf([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new cf(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new cf(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function Py(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class cf{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Ny++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:((n=e[f.id])!==null&&n!==void 0?n:1)&1||u.push(e[f.id]);return{create(f){return f.values[o]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||jg(f,u)){let h=r(f);if(a?!ow(h,f.values[o],i):!i(h,f.values[o]))return f.values[o]=h,1}return 0},reconfigure:(f,d)=>{let h,p=d.config.address[s];if(p!=null){let m=od(d,p);if(this.dependencies.every(O=>O instanceof re?d.facet(O)===f.facet(O):O instanceof wt?d.field(O,!1)==f.field(O,!1):!0)||(a?ow(h=r(f),m,i):i(h=r(f),m)))return f.values[o]=m,0}else h=r(f);return f.values[o]=h,1}}}}function ow(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function jg(t,e){let n=!1;for(let r of e)nl(t,r)&1&&(n=!0);return n}function FX(t,e,n){let r=n.map(l=>t[l.id]),i=n.map(l=>l.type),s=r.filter(l=>!(l&1)),o=t[e.id]>>1;function a(l){let c=[];for(let u=0;u<r.length;u++){let f=od(l,r[u]);if(i[u]==2)for(let d of f)c.push(d);else c.push(f)}return e.combine(c)}return{create(l){for(let c of r)nl(l,c);return l.values[o]=a(l),1},update(l,c){if(!jg(l,s))return 0;let u=a(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=jg(l,r),f=c.config.facets[e.id],d=c.facet(e);if(f&&!u&&Py(n,f))return l.values[o]=d,0;let h=a(l);return e.compare(h,d)?(l.values[o]=d,0):(l.values[o]=h,1)}}}const bu=re.define({static:!0});class wt{constructor(e,n,r,i,s){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let n=new wt(Ny++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(bu).find(r=>r.field==this);return((n==null?void 0:n.create)||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let s=r.values[n],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let s=r.facet(bu),o=i.facet(bu),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[n]=a.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,bu.of({field:this,create:e})]}get extension(){return this}}const as={lowest:4,low:3,default:2,high:1,highest:0};function Na(t){return e=>new l_(e,t)}const Hi={highest:Na(as.highest),high:Na(as.high),default:Na(as.default),low:Na(as.low),lowest:Na(as.lowest)};class l_{constructor(e,n){this.inner=e,this.prec=n}}class mh{of(e){return new Bg(this,e)}reconfigure(e){return mh.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Bg{constructor(e,n){this.compartment=e,this.inner=n}}class sd{constructor(e,n,r,i,s,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],s=Object.create(null),o=new Map;for(let d of XX(e,n,o))d instanceof wt?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r==null?void 0:r.config.facets;for(let d in s){let h=s[d],p=h[0].facet,m=u&&u[d]||[];if(h.every(O=>O.type==0))if(a[p.id]=l.length<<1|1,Py(m,h))l.push(r.facet(p));else{let O=p.combine(h.map(g=>g.value));l.push(r&&p.compare(O,r.facet(p))?r.facet(p):O)}else{for(let O of h)O.type==0?(a[O.id]=l.length<<1|1,l.push(O.value)):(a[O.id]=c.length<<1,c.push(g=>O.dynamicSlot(g)));a[p.id]=c.length<<1,c.push(O=>FX(O,p,h))}}let f=c.map(d=>d(a));return new sd(e,o,f,a,l,s)}}function XX(t,e,n){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof Bg&&n.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof Bg){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,a)}else if(o instanceof l_)s(o.inner,o.prec);else if(o instanceof wt)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof cf)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,as.default);else{let c=o.extension;if(!c)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,a)}}return s(t,as.default),r.reduce((o,a)=>o.concat(a))}function nl(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function od(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const c_=re.define(),Fg=re.define({combine:t=>t.some(e=>e),static:!0}),u_=re.define({combine:t=>t.length?t[0]:void 0,static:!0}),f_=re.define(),d_=re.define(),h_=re.define(),p_=re.define({combine:t=>t.length?t[0]:!1});class Cr{constructor(e,n){this.type=e,this.value=n}static define(){return new zX}}class zX{of(e){return new Cr(this,e)}}class WX{constructor(e){this.map=e}of(e){return new he(this,e)}}class he{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 he(this.type,n)}is(e){return this.type==e}static define(e={}){return new WX(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(n);s&&r.push(s)}return r}}he.reconfigure=he.define();he.appendConfig=he.define();class et{constructor(e,n,r,i,s,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&a_(r,n.newLength),s.some(a=>a.type==et.time)||(this.annotations=s.concat(et.time.of(Date.now())))}static create(e,n,r,i,s,o){return new et(e,n,r,i,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(et.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}et.time=Cr.define();et.userEvent=Cr.define();et.addToHistory=Cr.define();et.remote=Cr.define();function UX(t,e){let n=[];for(let r=0,i=0;;){let s,o;if(r<t.length&&(i==e.length||e[i]>=t[r]))s=t[r++],o=t[r++];else if(i<e.length)s=e[i++],o=e[i++];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 m_(t,e,n){var r;let i,s,o;return n?(i=e.changes,s=it.empty(e.changes.length),o=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:he.mapEffects(t.effects,i).concat(he.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function Xg(t,e,n){let r=e.selection,i=Eo(e.annotations);return e.userEvent&&(i=i.concat(et.userEvent.of(e.userEvent))),{changes:e.changes instanceof it?e.changes:it.of(e.changes||[],n,t.facet(u_)),selection:r&&(r instanceof W?r:W.single(r.anchor,r.head)),effects:Eo(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function g_(t,e,n){let r=Xg(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;r=m_(r,Xg(t,e[s],o?r.changes.newLength:t.doc.length),o)}let i=et.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return GX(n?YX(i):i)}function YX(t){let e=t.startState,n=!0;for(let i of e.facet(f_)){let s=i(t);if(s===!1){n=!1;break}Array.isArray(s)&&(n=n===!0?s:UX(n,s))}if(n!==!0){let i,s;if(n===!1)s=t.changes.invertedDesc,i=it.empty(e.doc.length);else{let o=t.changes.filter(n);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}t=et.create(e,i,t.selection&&t.selection.map(s),he.mapEffects(t.effects,s),t.annotations,t.scrollIntoView)}let r=e.facet(d_);for(let i=r.length-1;i>=0;i--){let s=r[i](t);s instanceof et?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof et?t=s[0]:t=g_(e,Eo(s),!1)}return t}function GX(t){let e=t.startState,n=e.facet(h_),r=t;for(let i=n.length-1;i>=0;i--){let s=n[i](t);s&&Object.keys(s).length&&(r=m_(r,Xg(e,s,t.changes.newLength),!0))}return r==t?t:et.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const HX=[];function Eo(t){return t==null?HX:Array.isArray(t)?t:[t]}var Me=function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t}(Me||(Me={}));const qX=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let zg;try{zg=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function KX(t){if(zg)return zg.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||qX.test(n)))return!0}return!1}function JX(t){return e=>{if(!/\S/.test(e))return Me.Space;if(KX(e))return Me.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return Me.Word;return Me.Other}}class ye{constructor(e,n,r,i,s,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)nl(this,a<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return nl(this,r),od(this,r)}update(...e){return g_(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let a of e.effects)a.is(mh.reconfigure)?(n&&(i=new Map,n.compartments.forEach((l,c)=>i.set(c,l)),n=null),i.set(a.value.compartment,a.value.extension)):a.is(he.reconfigure)?(n=null,r=a.value):a.is(he.appendConfig)&&(n=null,r=Eo(r).concat(a.value));let s;n?s=e.startState.values.slice():(n=sd.resolve(r,i,this),s=new ye(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(Fg)?e.newSelection:e.newSelection.asSingle();new ye(n,e.newDoc,o,s,(a,l)=>l.update(a,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:W.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),s=[r.range],o=Eo(r.effects);for(let a=1;a<n.ranges.length;a++){let l=e(n.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(u);let f=i.mapDesc(c,!0);s.push(l.range.map(f)),i=i.compose(u),o=he.mapEffects(o,u).concat(he.mapEffects(Eo(l.effects),f))}return{changes:i,selection:W.create(s,n.mainIndex),effects:o}}changes(e=[]){return e instanceof it?e:it.of(e,this.doc.length,this.facet(ye.lineSeparator))}toText(e){return xe.of(e.split(this.facet(ye.lineSeparator)||Dg))}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:(nl(this,n),od(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof wt&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],a=e[s];i.push(o.init(l=>o.spec.fromJSON(a,l)))}}return ye.create({doc:e.doc,selection:W.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=sd.resolve(e.extensions||[],new Map),r=e.doc instanceof xe?e.doc:xe.of((e.doc||"").split(n.staticFacet(ye.lineSeparator)||Dg)),i=e.selection?e.selection instanceof W?e.selection:W.single(e.selection.anchor,e.selection.head):W.single(0);return a_(i,r.length),n.staticFacet(Fg)||(i=i.asSingle()),new ye(n,r,i,n.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(ye.tabSize)}get lineBreak(){return this.facet(ye.lineSeparator)||`
|
|
68
|
+
`}get readOnly(){return this.facet(p_)}phrase(e,...n){for(let r of this.facet(ye.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return n.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>n.length?r:n[s-1]})),e}languageDataAt(e,n,r=-1){let i=[];for(let s of this.facet(c_))for(let o of s(this,n,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let n=this.languageDataAt("wordChars",e);return JX(n.length?n[0]:"")}wordAt(e){let{text:n,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=ut(n,o,!1);if(s(n.slice(l,o))!=Me.Word)break;o=l}for(;a<i;){let l=ut(n,a);if(s(n.slice(a,l))!=Me.Word)break;a=l}return o==a?null:W.range(o+r,a+r)}}ye.allowMultipleSelections=Fg;ye.tabSize=re.define({combine:t=>t.length?t[0]:4});ye.lineSeparator=u_;ye.readOnly=p_;ye.phrases=re.define({compare(t,e){let n=Object.keys(t),r=Object.keys(e);return n.length==r.length&&n.every(i=>t[i]==e[i])}});ye.languageData=c_;ye.changeFilter=f_;ye.transactionFilter=d_;ye.transactionExtender=h_;mh.reconfigure=he.define();function $r(t,e,n={}){let r={};for(let i of t)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(n,s))r[s]=n[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class Zi{eq(e){return this==e}range(e,n=e){return Wg.create(e,n,this)}}Zi.prototype.startSide=Zi.prototype.endSide=0;Zi.prototype.point=!1;Zi.prototype.mapMode=yt.TrackDel;function _y(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Wg=class O_{constructor(e,n,r){this.from=e,this.to=n,this.value=r}static create(e,n,r){return new O_(e,n,r)}};function Ug(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Cy{constructor(e,n,r,i){this.from=e,this.to=n,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,n,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-n;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,n,r,i){for(let s=this.findIndex(n,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,n){let r=[],i=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,f=this.to[l]+e,d,h;if(u==f){let p=n.mapPos(u,c.startSide,c.mapMode);if(p==null||(d=h=p,c.startSide!=c.endSide&&(h=n.mapPos(u,c.endSide),h<d)))continue}else if(d=n.mapPos(u,c.startSide),h=n.mapPos(f,c.endSide),d>h||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-o),s.push(h-o))}return{mapped:r.length?new Cy(i,s,r,a):null,pos:o}}}class ge{constructor(e,n,r,i){this.chunkPos=e,this.chunk=n,this.nextLayer=r,this.maxPoint=i}static create(e,n,r,i){return new ge(e,n,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let n of this.chunk)e+=n.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:n=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(n.length==0&&!o)return this;if(r&&(n=n.slice().sort(Ug)),this.isEmpty)return n.length?ge.of(n):this;let a=new y_(this,null,-1).goto(0),l=0,c=[],u=new ti;for(;a.value||l<n.length;)if(l<n.length&&(a.from-n[l].from||a.startSide-n[l].value.startSide)>=0){let f=n[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==n.length||this.chunkEnd(a.chunkIndex)<n[l].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(Wg.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?ge.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let n=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),n.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:f}=l.map(a,e);u&&(i=Math.max(i,u.maxPoint),n.push(u),r.push(f))}}let s=this.nextLayer.map(e);return n.length==0?s:new ge(r,n,s||ge.empty,i)}between(e,n,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(n>=s&&e<=s+o.length&&o.between(s,e-s,n-s,r)===!1)return}this.nextLayer.between(e,n,r)}}iter(e=0){return Ul.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,n=0){return Ul.from(e).goto(n)}static compare(e,n,r,i,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=n.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=aw(o,a,r),c=new Pa(o,l,s),u=new Pa(a,l,s);r.iterGaps((f,d,h)=>lw(c,f,u,d,h,i)),r.empty&&r.length==0&&lw(c,0,u,0,0,i)}static eq(e,n,r=0,i){i==null&&(i=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 a=aw(s,o),l=new Pa(s,a,0).goto(r),c=new Pa(o,a,0).goto(r);for(;;){if(l.to!=c.to||!Yg(l.active,c.active)||l.point&&(!c.point||!_y(l.point,c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,n,r,i,s=-1){let o=new Pa(e,null,s).goto(n),a=n,l=o.openStart;for(;;){let c=Math.min(o.to,r);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,l);i.point(a,c,o.point,u,f,o.pointRank),l=Math.min(o.openEnd(c),u.length)}else c>a&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,n=!1){let r=new ti;for(let i of e instanceof Wg?[e]:n?ez(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return ge.empty;let n=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=ge.empty;i=i.nextLayer)n=new ge(i.chunkPos,i.chunk,n,Math.max(i.maxPoint,n.maxPoint));return n}}ge.empty=new ge([],[],null,-1);function ez(t){if(t.length>1)for(let e=t[0],n=1;n<t.length;n++){let r=t[n];if(Ug(e,r)>0)return t.slice().sort(Ug);e=r}return t}ge.empty.nextLayer=ge.empty;class ti{finishChunk(e){this.chunks.push(new Cy(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,n,r){this.addInner(e,n,r)||(this.nextLayer||(this.nextLayer=new ti)).add(e,n,r)}addInner(e,n,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-e)),!0)}addChunk(e,n){if((e-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(e);let r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+e,this.lastTo=n.to[r]+e,!0}finish(){return this.finishInner(ge.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let n=ge.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,n}}function aw(t,e,n){let r=new Map;for(let s of t)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=r.get(s.chunk[o]);a!=null&&(n?n.mapPos(a):a)==s.chunkPos[o]&&!(n!=null&&n.touchesRange(a,a+s.chunk[o].length))&&i.add(s.chunk[o])}return i}class y_{constructor(e,n,r,i=0){this.layer=e,this.skip=n,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,n=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,n,!1),this}gotoInner(e,n,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],n,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,n){(this.to-e||this.endSide-n)<0&&this.gotoInner(e,n,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],n=this.layer.chunk[this.chunkIndex],r=e+n.from[this.rangeIndex];if(this.from=r,this.to=e+n.to[this.rangeIndex],this.value=n.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Ul{constructor(e){this.heap=e}static from(e,n=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new y_(o,n,r,s));return i.length==1?i[0]:new Ul(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,n=-1e9){for(let r of this.heap)r.goto(e,n);for(let r=this.heap.length>>1;r>=0;r--)Ap(this.heap,r);return this.next(),this}forward(e,n){for(let r of this.heap)r.forward(e,n);for(let r=this.heap.length>>1;r>=0;r--)Ap(this.heap,r);(this.to-e||this.value.endSide-n)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ap(this.heap,0)}}}function Ap(t,e){for(let n=t[e];;){let r=(e<<1)+1;if(r>=t.length)break;let i=t[r];if(r+1<t.length&&i.compare(t[r+1])>=0&&(i=t[r+1],r++),n.compare(i)<0)break;t[r]=n,t[e]=i,e=r}}class Pa{constructor(e,n,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ul.from(e,n,r)}goto(e,n=-1e9){return this.cursor.goto(e,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=n,this.openStart=-1,this.next(),this}forward(e,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(e,n)}removeActive(e){xu(this.active,e),xu(this.activeTo,e),xu(this.activeRank,e),this.minActive=cw(this.active,this.activeTo)}addActive(e){let n=0,{value:r,to:i,rank:s}=this.cursor;for(;n<this.activeRank.length&&(s-this.activeRank[n]||i-this.activeTo[n])>0;)n++;vu(this.active,n,r),vu(this.activeTo,n,i),vu(this.activeRank,n,s),e&&vu(e,n,this.cursor.from),this.minActive=cw(this.active,this.activeTo)}next(){let e=this.to,n=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&xu(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(n&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=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(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let n=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}openEnd(e){let n=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)n++;return n}}function lw(t,e,n,r,i,s){t.goto(e),n.goto(r);let o=r+i,a=r,l=r-e,c=!!s.boundChange;for(let u=!1;;){let f=t.to+l-n.to,d=f||t.endSide-n.endSide,h=d<0?t.to+l:n.to,p=Math.min(h,o);if(t.point||n.point?(t.point&&n.point&&_y(t.point,n.point)&&Yg(t.activeForPoint(t.to),n.activeForPoint(n.to))||s.comparePoint(a,p,t.point,n.point),u=!1):(u&&s.boundChange(a),p>a&&!Yg(t.active,n.active)&&s.compareRange(a,p,t.active,n.active),c&&p<o&&(f||t.openEnd(h)!=n.openEnd(h))&&(u=!0)),h>o)break;a=h,d<=0&&t.next(),d>=0&&n.next()}}function Yg(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n]&&!_y(t[n],e[n]))return!1;return!0}function xu(t,e){for(let n=e,r=t.length-1;n<r;n++)t[n]=t[n+1];t.pop()}function vu(t,e,n){for(let r=t.length-1;r>=e;r--)t[r+1]=t[r];t[e]=n}function cw(t,e){let n=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||t[i].endSide-t[n].endSide)<0&&(n=i,r=e[i]);return n}function ca(t,e,n=t.length){let r=0;for(let i=0;i<n&&i<t.length;)t.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=ut(t,i));return r}function Gg(t,e,n,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==t.length)break;s+=t.charCodeAt(i)==9?n-s%n:1,i=ut(t,i)}return r===!0?-1:t.length}const Hg="ͼ",uw=typeof Symbol>"u"?"__"+Hg:Symbol.for(Hg),qg=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),fw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Vi{constructor(e,n){this.rules=[];let{finish:r}=n||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(o[0]+";");for(let h in a){let p=a[h];if(/&/.test(h))s(h.split(/,\s*/).map(m=>o.map(O=>m.replace(/&/,O))).reduce((m,O)=>m.concat(O)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((r&&!f&&!c?o.map(r):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
69
|
+
`)}static newName(){let e=fw[uw]||1;return fw[uw]=e+1,Hg+e.toString(36)}static mount(e,n,r){let i=e[qg],s=r&&r.nonce;i?s&&i.setNonce(s):i=new tz(e,s),i.mount(Array.isArray(n)?n:[n],e)}}let dw=new Map;class tz{constructor(e,n){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=dw.get(r);if(s)return e[qg]=s;this.sheet=new i.CSSStyleSheet,dw.set(r,this)}else this.styleTag=r.createElement("style"),n&&this.styleTag.setAttribute("nonce",n);this.modules=[],e[qg]=this}mount(e,n){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(r)n.adoptedStyleSheets.indexOf(this.sheet)<0&&(n.adoptedStyleSheets=[this.sheet,...n.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
|
|
70
|
+
`;this.styleTag.textContent=o;let a=n.head||n;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ji={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:"'"},Yl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},nz=typeof navigator<"u"&&/Mac/.test(navigator.platform),rz=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ot=0;Ot<10;Ot++)ji[48+Ot]=ji[96+Ot]=String(Ot);for(var Ot=1;Ot<=24;Ot++)ji[Ot+111]="F"+Ot;for(var Ot=65;Ot<=90;Ot++)ji[Ot]=String.fromCharCode(Ot+32),Yl[Ot]=String.fromCharCode(Ot);for(var Ip in ji)Yl.hasOwnProperty(Ip)||(Yl[Ip]=ji[Ip]);function iz(t){var e=nz&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||rz&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Yl:ji)[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 Te(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&typeof n=="object"&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i=="string"?t.setAttribute(r,i):i!=null&&(t[r]=i)}e++}for(;e<arguments.length;e++)b_(t,arguments[e]);return t}function b_(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++)b_(t,e[n]);else throw new RangeError("Unsupported child node: "+e)}let $t=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Kg=typeof document<"u"?document:{documentElement:{style:{}}};const Jg=/Edge\/(\d+)/.exec($t.userAgent),x_=/MSIE \d/.test($t.userAgent),e0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($t.userAgent),gh=!!(x_||e0||Jg),hw=!gh&&/gecko\/(\d+)/i.test($t.userAgent),Qp=!gh&&/Chrome\/(\d+)/.exec($t.userAgent),pw="webkitFontSmoothing"in Kg.documentElement.style,t0=!gh&&/Apple Computer/.test($t.vendor),mw=t0&&(/Mobile\/\w+/.test($t.userAgent)||$t.maxTouchPoints>2);var ie={mac:mw||/Mac/.test($t.platform),windows:/Win/.test($t.platform),linux:/Linux|X11/.test($t.platform),ie:gh,ie_version:x_?Kg.documentMode||6:e0?+e0[1]:Jg?+Jg[1]:0,gecko:hw,gecko_version:hw?+(/Firefox\/(\d+)/.exec($t.userAgent)||[0,0])[1]:0,chrome:!!Qp,chrome_version:Qp?+Qp[1]:0,ios:mw,android:/Android\b/.test($t.userAgent),webkit:pw,webkit_version:pw?+(/\bAppleWebKit\/(\d+)/.exec($t.userAgent)||[0,0])[1]:0,safari:t0,safari_version:t0?+(/\bVersion\/(\d+(\.\d+)?)/.exec($t.userAgent)||[0,0])[1]:0,tabSize:Kg.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function $y(t,e){for(let n in t)n=="class"&&e.class?e.class+=" "+t.class:n=="style"&&e.style?e.style+=";"+t.style:e[n]=t[n];return e}const ad=Object.create(null);function Ay(t,e,n){if(t==e)return!0;t||(t=ad),e||(e=ad);let r=Object.keys(t),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=n&&(i.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function sz(t,e){for(let n=t.attributes.length-1;n>=0;n--){let r=t.attributes[n].name;e[r]==null&&t.removeAttribute(r)}for(let n in e){let r=e[n];n=="style"?t.style.cssText=r:t.getAttribute(n)!=r&&t.setAttribute(n,r)}}function gw(t,e,n){let r=!1;if(e)for(let i in e)n&&i in n||(r=!0,i=="style"?t.style.cssText="":t.removeAttribute(i));if(n)for(let i in n)e&&e[i]==n[i]||(r=!0,i=="style"?t.style.cssText=n[i]:t.setAttribute(i,n[i]));return r}function oz(t){let e=Object.create(null);for(let n=0;n<t.attributes.length;n++){let r=t.attributes[n];e[r.name]=r.value}return e}class tr{eq(e){return!1}updateDOM(e,n,r){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,n,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var xt=function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t}(xt||(xt={}));class le extends Zi{constructor(e,n,r,i){super(),this.startSide=e,this.endSide=n,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new _c(e)}static widget(e){let n=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return n+=r&&!e.inlineOrder?n>0?3e8:-4e8:n>0?1e8:-1e8,new Rs(e,n,n,r,e.widget||null,!1)}static replace(e){let n=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=v_(e,n);r=(s?n?-3e8:-1:5e8)-1,i=(o?n?2e8:1:-6e8)+1}return new Rs(e,r,i,n,e.widget||null,!0)}static line(e){return new Cc(e)}static set(e,n=!1){return ge.of(e,n)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}le.none=ge.empty;class _c extends le{constructor(e){let{start:n,end:r}=v_(e);super(n?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?$y(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||ad}eq(e){return this==e||e instanceof _c&&this.tagName==e.tagName&&Ay(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)}}_c.prototype.point=!1;class Cc extends le{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Cc&&this.spec.class==e.spec.class&&Ay(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)}}Cc.prototype.mapMode=yt.TrackBefore;Cc.prototype.point=!0;class Rs extends le{constructor(e,n,r,i,s,o){super(n,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?n<=0?yt.TrackBefore:yt.TrackAfter:yt.TrackDel}get type(){return this.startSide!=this.endSide?xt.WidgetRange:this.startSide<=0?xt.WidgetBefore:xt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Rs&&az(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)}}Rs.prototype.point=!0;function v_(t,e=!1){let{inclusiveStart:n,inclusiveEnd:r}=t;return n==null&&(n=t.inclusive),r==null&&(r=t.inclusive),{start:n??e,end:r??e}}function az(t,e){return t==e||!!(t&&e&&t.compare(e))}function To(t,e,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=t?n[i]=Math.max(n[i],e):n.push(t,e)}class Gl extends Zi{constructor(e,n,r){super(),this.tagName=e,this.attributes=n,this.rank=r}eq(e){return e==this||e instanceof Gl&&this.tagName==e.tagName&&Ay(this.attributes,e.attributes)}static create(e){return new Gl(e.tagName,e.attributes||ad,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,n=!1){return ge.of(e,n)}}Gl.prototype.startSide=Gl.prototype.endSide=-1;function Hl(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function n0(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function rl(t,e){if(!e.anchorNode)return!1;try{return n0(t,e.anchorNode)}catch{return!1}}function il(t){return t.nodeType==3?Kl(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function sl(t,e,n,r){return n?Ow(t,e,n,r,-1)||Ow(t,e,n,r,1):!1}function Bi(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function ld(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Ow(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ni(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=Bi(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=i<0?ni(t):0}else return!1}}function ni(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ql(t,e){let n=e?t.left:t.right;return{left:n,right:n,top:t.top,bottom:t.bottom}}function lz(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 w_(t,e){let n=e.width/t.offsetWidth,r=e.height/t.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.width-t.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-t.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function cz(t,e,n,r,i,s,o,a){let l=t.ownerDocument,c=l.defaultView||window;for(let u=t,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,p=1,m=1;if(h)d=lz(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 b=u.getBoundingClientRect();({scaleX:p,scaleY:m}=w_(u,b)),d={left:b.left,right:b.left+u.clientWidth*p,top:b.top,bottom:b.top+u.clientHeight*m}}let O=0,g=0;if(i=="nearest")e.top<d.top+o?(g=e.top-(d.top+o),n>0&&e.bottom>d.bottom+g&&(g=e.bottom-d.bottom+o)):e.bottom>d.bottom-o&&(g=e.bottom-d.bottom+o,n<0&&e.top-g<d.top&&(g=e.top-(d.top+o)));else{let b=e.bottom-e.top,y=d.bottom-d.top;g=(i=="center"&&b<=y?e.top+b/2-y/2:i=="start"||i=="center"&&n<0?e.top-o:e.bottom-y+o)-d.top}if(r=="nearest"?e.left<d.left+s?(O=e.left-(d.left+s),n>0&&e.right>d.right+O&&(O=e.right-d.right+s)):e.right>d.right-s&&(O=e.right-d.right+s,n<0&&e.left<d.left+O&&(O=e.left-(d.left+s))):O=(r=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:r=="start"==a?e.left-s:e.right-(d.right-d.left)+s)-d.left,O||g)if(h)c.scrollBy(O,g);else{let b=0,y=0;if(g){let v=u.scrollTop;u.scrollTop+=g/m,y=(u.scrollTop-v)*m}if(O){let v=u.scrollLeft;u.scrollLeft+=O/p,b=(u.scrollLeft-v)*p}e={left:e.left-b,top:e.top-y,right:e.right-b,bottom:e.bottom-y},b&&Math.abs(b-O)<1&&(r="nearest"),y&&Math.abs(y-g)<1&&(i="nearest")}if(h)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function S_(t,e=!0){let n=t.ownerDocument,r=null,i=null;for(let s=t.parentNode;s&&!(s==n.body||(!e||r)&&i);)if(s.nodeType==1)!i&&s.scrollHeight>s.clientHeight&&(i=s),e&&!r&&s.scrollWidth>s.clientWidth&&(r=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:r,y:i}}class uz{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:n,focusNode:r}=e;this.set(n,Math.min(e.anchorOffset,n?ni(n):0),r,Math.min(e.focusOffset,r?ni(r):0))}set(e,n,r,i){this.anchorNode=e,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}let os=null;ie.safari&&ie.safari_version>=26&&(os=!1);function k_(t){if(t.setActive)return t.setActive();if(os)return t.focus(os);let e=[];for(let n=t;n&&(e.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(t.focus(os==null?{get preventScroll(){return os={preventScroll:!0},!0}}:void 0),!os){os=!1;for(let n=0;n<e.length;){let r=e[n++],i=e[n++],s=e[n++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let yw;function Kl(t,e,n=e){let r=yw||(yw=document.createRange());return r.setEnd(t,n),r.setStart(t,e),r}function No(t,e,n,r){let i={key:e,code:e,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,t.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,t.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function fz(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function dz(t,e){let n=e.focusNode,r=e.focusOffset;if(!n||e.anchorNode!=n||e.anchorOffset!=r)return!1;for(r=Math.min(r,ni(n));;)if(r){if(n.nodeType!=1)return!1;let i=n.childNodes[r-1];i.contentEditable=="false"?r--:(n=i,r=ni(n))}else{if(n==t)return!0;r=Bi(n),n=n.parentNode}}function E_(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 T_(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r>0)return{node:n,offset:r};if(n.nodeType==1&&r>0){if(n.contentEditable=="false")return null;n=n.childNodes[r-1],r=ni(n)}else if(n.parentNode&&!ld(n))r=Bi(n),n=n.parentNode;else return null}}function N_(t,e){for(let n=t,r=e;;){if(n.nodeType==3&&r<n.nodeValue.length)return{node:n,offset:r};if(n.nodeType==1&&r<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!ld(n))r=Bi(n)+1,n=n.parentNode;else return null}}class zn{constructor(e,n,r=!0){this.node=e,this.offset=n,this.precise=r}static before(e,n){return new zn(e.parentNode,Bi(e),n)}static after(e,n){return new zn(e.parentNode,Bi(e)+1,n)}}var _e=function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t}(_e||(_e={}));const Ms=_e.LTR,Iy=_e.RTL;function P_(t){let e=[];for(let n=0;n<t.length;n++)e.push(1<<+t[n]);return e}const hz=P_("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),pz=P_("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),r0=Object.create(null),lr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),n=t.charCodeAt(1);r0[e]=n,r0[n]=-e}function __(t){return t<=247?hz[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?pz[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const mz=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class br{get dir(){return this.level%2?Iy:Ms}constructor(e,n,r){this.from=e,this.to=n,this.level=r}side(e,n){return this.dir==n==e?this.to:this.from}forward(e,n){return e==(this.dir==n)}static find(e,n,r,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=n&&a.to>=n){if(a.level==r)return o;(s<0||(i!=0?i<0?a.from<n:a.to>n:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function C_(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++){let r=t[n],i=e[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!C_(r.inner,i.inner))return!1}return!0}const Pe=[];function gz(t,e,n,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,a=s<r.length?r[s].from:n,l=s?256:i;for(let c=o,u=l,f=l;c<a;c++){let d=__(t.charCodeAt(c));d==512?d=u:d==8&&f==4&&(d=16),Pe[c]=d==4?2:d,d&7&&(f=d),u=d}for(let c=o,u=l,f=l;c<a;c++){let d=Pe[c];if(d==128)c<a-1&&u==Pe[c+1]&&u&24?d=Pe[c]=u:Pe[c]=256;else if(d==64){let h=c+1;for(;h<a&&Pe[h]==64;)h++;let p=c&&u==8||h<n&&Pe[h]==8?f==1?1:8:256;for(let m=c;m<h;m++)Pe[m]=p;c=h-1}else d==8&&f==1&&(Pe[c]=1);u=d,d&7&&(f=d)}}}function Oz(t,e,n,r,i){let s=i==1?2:1;for(let o=0,a=0,l=0;o<=r.length;o++){let c=o?r[o-1].to:e,u=o<r.length?r[o].from:n;for(let f=c,d,h,p;f<u;f++)if(h=r0[d=t.charCodeAt(f)])if(h<0){for(let m=a-3;m>=0;m-=3)if(lr[m+1]==-h){let O=lr[m+2],g=O&2?i:O&4?O&1?s:i:0;g&&(Pe[f]=Pe[lr[m]]=g),a=m;break}}else{if(lr.length==189)break;lr[a++]=f,lr[a++]=d,lr[a++]=l}else if((p=Pe[f])==2||p==1){let m=p==i;l=m?0:1;for(let O=a-3;O>=0;O-=3){let g=lr[O+2];if(g&2)break;if(m)lr[O+2]|=2;else{if(g&4)break;lr[O+2]|=4}}}}}function yz(t,e,n,r){for(let i=0,s=r;i<=n.length;i++){let o=i?n[i-1].to:t,a=i<n.length?n[i].from:e;for(let l=o;l<a;){let c=Pe[l];if(c==256){let u=l+1;for(;;)if(u==a){if(i==n.length)break;u=n[i++].to,a=i<n.length?n[i].from:e}else if(Pe[u]==256)u++;else break;let f=s==1,d=(u<e?Pe[u]:r)==1,h=f==d?f?1:2:r;for(let p=u,m=i,O=m?n[m-1].to:t;p>l;)p==O&&(p=n[--m].from,O=m?n[m-1].to:t),Pe[--p]=h;l=u}else s=c,l++}}}function i0(t,e,n,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;l<n;){let u=!0,f=!1;if(c==s.length||l<s[c].from){let m=Pe[l];m!=a&&(u=!1,f=m==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c<s.length&&p==s[c].from){if(f)break e;let m=s[c];if(!u)for(let O=m.to,g=c+1;;){if(O==n)break e;if(g<s.length&&s[g].from==O)O=s[g++].to;else{if(Pe[O]==a)break e;break}}if(c++,d)d.push(m);else{m.from>l&&o.push(new br(l,m.from,h));let O=m.direction==Ms!=!(h%2);s0(t,O?r+1:r,i,m.inner,m.from,m.to,o),l=m.to}p=m.to}else{if(p==n||(u?Pe[p]!=a:Pe[p]==a))break;p++}d?i0(t,l,p,r+1,i,d,o):l<p&&o.push(new br(l,p,h)),l=p}else for(let l=n,c=s.length;l>e;){let u=!0,f=!1;if(!c||l>s[c-1].to){let m=Pe[l-1];m!=a&&(u=!1,f=m==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,p=l;e:for(;;)if(c&&p==s[c-1].to){if(f)break e;let m=s[--c];if(!u)for(let O=m.from,g=c;;){if(O==e)break e;if(g&&s[g-1].to==O)O=s[--g].from;else{if(Pe[O-1]==a)break e;break}}if(d)d.push(m);else{m.to<l&&o.push(new br(m.to,l,h));let O=m.direction==Ms!=!(h%2);s0(t,O?r+1:r,i,m.inner,m.from,m.to,o),l=m.from}p=m.from}else{if(p==e||(u?Pe[p-1]!=a:Pe[p-1]==a))break;p--}d?i0(t,p,l,r+1,i,d,o):p<l&&o.push(new br(p,l,h)),l=p}}function s0(t,e,n,r,i,s,o){let a=e%2?2:1;gz(t,i,s,r,a),Oz(t,i,s,r,a),yz(i,s,r,a),i0(t,i,s,e,n,r,o)}function bz(t,e,n){if(!t)return[new br(0,0,e==Iy?1:0)];if(e==Ms&&!n.length&&!mz.test(t))return $_(t.length);if(n.length)for(;t.length>Pe.length;)Pe[Pe.length]=256;let r=[],i=e==Ms?0:1;return s0(t,i,i,n,0,t.length,r),r}function $_(t){return[new br(0,t,0)]}let A_="";function xz(t,e,n,r,i){var s;let o=r.head-t.from,a=br.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],c=l.side(i,n);if(o==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!i,n),c=l.side(i,n)}let u=ut(t.text,o,l.forward(i,n));(u<l.from||u>l.to)&&(u=c),A_=t.text.slice(Math.min(o,u),Math.max(o,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)<l.level?W.cursor(f.side(!i,n)+t.from,f.forward(i,n)?1:-1,f.level):W.cursor(u+t.from,l.forward(i,n)?-1:1,l.level)}function vz(t,e,n){for(let r=e;r<n;r++){let i=__(t.charCodeAt(r));if(i==1)return Ms;if(i==2||i==4)return Iy}return Ms}const I_=re.define(),Q_=re.define(),R_=re.define(),M_=re.define(),o0=re.define(),L_=re.define(),D_=re.define(),Qy=re.define(),Ry=re.define(),Z_=re.define({combine:t=>t.some(e=>e)}),V_=re.define({combine:t=>t.some(e=>e)}),j_=re.define();class Po{constructor(e,n,r,i,s,o=!1){this.range=e,this.y=n,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Po(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 Po(W.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const wu=he.define({map:(t,e)=>t.map(e)}),B_=he.define();function Ut(t,e,n){let r=t.facet(M_);r.length?r[0](e):window.onerror&&window.onerror(String(e),n,void 0,void 0,e)||(n?console.error(n+":",e):console.error(e))}const Fr=re.define({combine:t=>t.length?t[0]:!0});let wz=0;const fo=re.define({combine(t){return t.filter((e,n)=>{for(let r=0;r<n;r++)if(t[r].plugin==e.plugin)return!1;return!0})}});class Ue{constructor(e,n,r,i,s){this.id=e,this.create=n,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(fo.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(fo.of({plugin:this,arg:e}))}static define(e,n){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=n||{};return new Ue(wz++,e,r,i,a=>{let l=[];return o&&l.push(Oh.of(c=>{let u=c.plugin(a);return u?o(u):le.none})),s&&l.push(s(a)),l})}static fromClass(e,n){return Ue.define((r,i)=>new e(r,i),n)}}class Rp{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(r){if(Ut(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(n){Ut(e.state,n,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Ut(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const F_=re.define(),My=re.define(),Oh=re.define(),X_=re.define(),Ly=re.define(),$c=re.define(),z_=re.define();function bw(t,e){let n=t.state.facet(z_);if(!n.length)return n;let r=n.map(s=>s instanceof Function?s(t):s),i=[];return ge.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let c=s-e.from,u=o-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,p;if(h==null&&(h=vz(e.text,c,u)),l>0&&f.length&&(p=f[f.length-1]).to==c&&p.direction==h)p.to=u,f=p.inner;else{let m={from:c,to:u,direction:h,inner:[]};f.push(m),f=m.inner}}}}),i}const W_=re.define();function Dy(t){let e=0,n=0,r=0,i=0;for(let s of t.state.facet(W_)){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&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:n,top:r,bottom:i}}const Za=re.define();class kn{constructor(e,n,r,i){this.fromA=e,this.toA=n,this.fromB=r,this.toB=i}join(e){return new kn(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let n=e.length,r=this;for(;n>0;n--){let i=e[n-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(n-1,1)}}return e.splice(n,0,r),e}static extendWithRanges(e,n){if(n.length==0)return e;let r=[];for(let i=0,s=0,o=0;;){let a=i<e.length?e[i].fromB:1e9,l=s<n.length?n[s]:1e9,c=Math.min(a,l);if(c==1e9)break;let u=c+o,f=c,d=u;for(;;)if(s<n.length&&n[s]<=f){let h=n[s+1];s+=2,f=Math.max(f,h);for(let p=i;p<e.length&&e[p].fromB<=f;p++)o=e[p].toA-e[p].toB;d=Math.max(d,h+o)}else if(i<e.length&&e[i].fromB<=f){let h=e[i++];f=Math.max(f,h.toB),d=Math.max(d,h.toA),o=h.toA-h.toB}else break;r.push(new kn(u,d,c,f))}return r}}class cd{constructor(e,n,r){this.view=e,this.state=n,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=it.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new kn(s,o,a,l))),this.changedRanges=i}static create(e,n,r){return new cd(e,n,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const Sz=[];class We{constructor(e,n,r=0){this.dom=e,this.length=n,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Sz}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&&sz(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 r=n;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,n){return null}domPosFor(e,n){let r=Bi(this.dom),i=this.length?e>0:n>0;return new zn(this.parent.dom,r+(i?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 bh)return e;return null}static get(e){return e.cmTile}}class yh extends We{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,r=null,i,s=(e==null?void 0:e.node)==n?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,i=r?r.nextSibling:n.firstChild,s&&i!=a.dom&&(s.written=!0),a.dom.parentNode==n)for(;i&&i!=a.dom;)i=xw(i);else n.insertBefore(a.dom,i);r=a.dom}for(i=r?r.nextSibling:n.firstChild,s&&i&&(s.written=!0);i;)i=xw(i);this.length=o}}function xw(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class bh extends yh{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=We.get(e);if(n&&this.owns(n))return n;e=e.parentNode}}blockTiles(e){for(let n=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!n.length)return;r=r.parent,r.breakAfter&&s++,i=n.pop()}else{let o=r.children[i++];if(o instanceof Gr)n.push(i),r=o,i=0;else{let a=s+o.length,l=e(o,s);if(l!==void 0)return l;s=a+o.breakAfter}}}resolveBlock(e,n){let r,i=-1,s,o=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(e>=l&&e<=c){if(a.isWidget()&&n>=-1&&n<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(l<e||e==c&&(n<-1?a.length:a.covers(1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=e-l),(c>e||e==l&&(n>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-l)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&n<0||!s?{tile:r,offset:i}:{tile:s,offset:o}}}class Gr extends yh{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 r=new Gr(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class Ko extends yh{constructor(e,n){super(e),this.attrs=n}isLine(){return!0}static start(e,n,r){let i=new Ko(n||document.createElement("div"),e);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,n,r){let i=null,s=-1,o=null,a=-1;function l(u,f){for(let d=0,h=0;d<u.children.length&&h<=f;d++){let p=u.children[d],m=h+p.length;m>=f&&(p.isComposite()?l(p,f-h):(!o||o.isHidden&&(n>0||r&&Ez(o,p)))&&(m>f||p.flags&32)?(o=p,a=f-h):(h<f||p.flags&16&&!p.isHidden)&&(i=p,s=f-h)),h=m}}l(this,e);let c=(n<0?i:o)||i||o;return c?{tile:c,offset:c==i?s:a}:null}coordsIn(e,n){let r=this.resolveInline(e,n,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),n):kz(this)}domIn(e,n){let r=this.resolveInline(e,n);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new zn(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:n);let o=r.tile.parent,a=!1;for(let l of o.children){if(a)return new zn(l.dom,0);l==r.tile&&(a=!0)}}return new zn(this.dom,0)}}function kz(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let n=il(e);return n[n.length-1]||null}function Ez(t,e){let n=t.coordsIn(0,1),r=e.coordsIn(0,1);return n&&r&&r.top<n.bottom}class Ft extends yh{constructor(e,n){super(e),this.mark=n}get domAttrs(){return this.mark.attrs}static of(e,n){let r=new Ft(n||document.createElement(e.tagName),e);return n||(r.flags|=4),r}}class hs extends We{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){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&n<0||e==r&&n>=0?ie.chrome||ie.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):n<0?i--:s<r&&s++;let a=Kl(this.dom,i,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:n>=0)?0:a.length-1];return ie.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?ql(l,o<0):l||null}static of(e,n){let r=new hs(n||document.createTextNode(e),e);return n||(r.flags|=2),r}}class Ls extends We{constructor(e,n,r,i){super(e,n,i),this.widget=r}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,r){let i=this.widget.coordsAt(this.dom,e,n);if(i)return i;if(r)return ql(this.dom.getBoundingClientRect(),this.length?e==0:n<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?s.length-1:0;o=s[l],!(e>0?l==0:l==s.length-1||o.top<o.bottom);l+=a?-1:1);return ql(o,!a)}}get overrideDOMText(){if(!this.length)return xe.empty;let{root:e}=this;if(!e)return xe.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,r,i,s){return s||(s=e.toDOM(n),e.editable||(s.contentEditable="false")),new Ls(s,r,e,i)}}class ud extends We{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 xe.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Tz{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,n,r){let{tile:i,index:s,beforeBreak:o,parents:a}=this;for(;e||n>0;)if(i.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==i.children.length){if(!e&&!a.length)break;r&&r.leave(i),o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++}else{let l=i.children[s],c=l.breakAfter;(n>0?l.length<=e:l.length<e)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(o=!!c,s++,e-=l.length):(a.push({tile:i,index:s}),i=l,s=0,r&&l.isComposite()&&r.enter(l))}else if(s==i.length)o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++;else if(e){let l=Math.min(e,i.length-s);r&&r.skip(i,s,s+l),e-=l,s+=l}else break;return this.tile=i,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Nz{constructor(e,n,r,i){this.from=e,this.to=n,this.wrapper=r,this.rank=i}}class Pz{constructor(e,n,r){this.cache=e,this.root=n,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,n,r,i){var s;this.flushBuffer();let o=this.ensureMarks(n,r),a=o.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=o.children[o.children.length-1]=new hs(a.dom,a.text+e);l.parent=o}else o.append(i||hs.of(e,(s=this.cache.find(hs))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,n){let r=this.curLine;r.dom!=n.line.dom&&(r.setDOM(this.cache.reused.has(n.line)?Mp(n.line.dom):n.line.dom),this.cache.reused.set(n.line,2));let i=r;for(let a=n.marks.length-1;a>=0;a--){let l=n.marks[a],c=i.lastChild;if(c instanceof Ft&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(Mp(l.dom)),i=c;else{if(this.cache.reused.get(l)){let f=We.get(l.dom);f&&f.setDOM(Mp(l.dom))}let u=Ft.of(l.mark,l.dom);i.append(u),i=u}this.cache.reused.set(l,2)}let s=We.get(e.text);s&&this.cache.reused.set(s,2);let o=new hs(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,i.append(o)}addInlineWidget(e,n,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(n,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,n,r){this.flushBuffer(),this.ensureMarks(n,r).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 r;e||(e=U_);let i=Ko.start(e,n||((r=this.cache.find(Ko))===null||r===void 0?void 0:r.dom),!!n);this.getBlockPos().append(this.lastBlock=this.curLine=i)}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 r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(n>0&&(a=i.lastChild)&&a instanceof Ft&&a.mark.eq(o))i=a,n--;else{let l=Ft.of(o,(r=this.cache.find(Ft,c=>c.mark.eq(o)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,n=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!vw(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(ie.ios&&vw(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Lp,0,32)||new Ls(Lp.toDOM(),0,Lp,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,r=new Nz(e.from,e.to,e.value,n),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-r.rank||this.wrappers[i-1].to-r.to)<0;)i--;this.wrappers.splice(i,0,r)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let n=this.root;for(let r of this.wrappers){let i=n.lastChild;if(r.from<this.pos&&i instanceof Gr&&i.wrapper.eq(r.wrapper))n=i;else{let s=Gr.of(r.wrapper,(e=this.cache.find(Gr,o=>o.wrapper.eq(r.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),r=this.cache.find(ud,void 0,1);return r&&(r.flags=n),r||new ud(n)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class _z{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:i,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=i;let a=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,a)}let n=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,n);return this.textOff=n,r}}const fd=[Ls,Ko,hs,Ft,ud,Gr,bh];for(let t=0;t<fd.length;t++)fd[t].bucket=t;class Cz{constructor(e){this.view=e,this.buckets=fd.map(()=>[]),this.index=fd.map(()=>0),this.reused=new Map}add(e){let n=e.constructor.bucket,r=this.buckets[n];r.length<6?r.push(e):r[this.index[n]=(this.index[n]+1)%6]=e}find(e,n,r=2){let i=e.bucket,s=this.buckets[i],o=this.index[i];for(let a=s.length-1;a>=0;a--){let l=(a+o)%s.length,c=s[l];if((!n||n(c))&&!this.reused.has(c))return s.splice(l,1),l<o&&this.index[i]--,this.reused.set(c,r),c}return null}findWidget(e,n,r){let i=this.buckets[0];if(i.length)for(let s=0,o=0;;s++){if(s==i.length){if(o)return null;o=1,s=0}let a=i[s];if(!this.reused.has(a)&&(o==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view,a.widget)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,a.widget==e&&a.length==n&&(a.flags&497)==r?(this.reused.set(a,1),a):(this.reused.set(a,2),new Ls(a.dom,n,e,a.flags&-498|r))}}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}}class $z{constructor(e,n,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new Cz(e),this.text=new _z(e.state.doc),this.builder=new Pz(this.cache,new bh(e,e.contentDOM),ge.iter(r)),this.cache.reused.set(n,2),this.old=new Tz(n),this.reuseWalker={skip:(o,a,l)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,n){let r=n&&this.getCompositionContext(n.text);for(let i=0,s=0,o=0;;){let a=o<e.length?e[o++]:null,l=a?a.fromA:this.old.root.length;if(l>i){let c=l-i;this.preserve(c,!o,!a),i=l,s+=c}if(!a)break;n&&a.fromA<=n.range.fromA&&a.toA>=n.range.toA?(this.forward(a.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,r),this.text.skip(n.range.toB-n.range.fromB),this.forward(n.range.fromA,a.toA),this.emit(n.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(s,a.toB)),s=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,n,r){let i=Qz(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,a,l)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a<o.length?Ls.of(o.widget,this.view,l-a,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,i,s),s=i.length)}else if(o.isText())this.builder.ensureLine(null),!a&&l==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,i,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(a,l),i,s)),s=i.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof ud)this.cache.add(o);else if(o instanceof Ft)this.builder.ensureLine(null),this.builder.addMark(o,i,s),this.cache.reused.set(o,1),s=i.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 Ft&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=s=0):o instanceof Ft&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,n){let r=null,i=this.builder,s=0,o=ge.spans(this.decorations,e,n,{point:(a,l,c,u,f,d)=>{if(c instanceof Rs){if(this.disallowBlockEffectsFor[d]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)i.continueWidget(l-a);else{let h=c.widget||(c.block?Jo.block:Jo.inline),p=Az(c),m=this.cache.findWidget(h,l-a,p)||Ls.of(h,this.view,l-a,p);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(m)):(i.ensureLine(r),i.addInlineWidget(m,u,f))}r=null}else r=Iz(r,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let f=a;f<l;){let d=this.text.next(Math.min(512,l-f));d==null?(i.addLineStartIfNotCovered(r),i.addBreak(),f++):(i.ensureLine(r),i.addText(d,c,f==a?u:c.length),f+=d.length),r=null}s=c.length}});this.openWidget=o>s,this.openWidget||i.addLineStartIfNotCovered(r),this.openMarks=o}forward(e,n,r=1){n-e<=10?this.old.advance(n-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(n-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let n=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=We.get(i);if(i==this.view.contentDOM)break;s instanceof Ft?n.push(s):s!=null&&s.isLine()?r=s:s instanceof Gr||(i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Ko(i,U_):r||n.push(Ft.of(new _c({tagName:i.nodeName.toLowerCase(),attributes:oz(i)}),i)))}return{line:r,marks:n}}}function vw(t,e){let n=r=>{for(let i of r.children)if((e?i.isText():i.length)||n(i))return!0;return!1};return n(t)}function Az(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}const U_={class:"cm-line"};function Iz(t,e){let n=e.spec.attributes,r=e.spec.class;return!n&&!r||(t||(t={class:"cm-line"}),n&&$y(n,t),r&&(t.class+=" "+r)),t}function Qz(t){let e=[];for(let n=t.parents.length;n>1;n--){let r=n==t.parents.length?t.tile:t.parents[n].tile;r instanceof Ft&&e.push(r.mark)}return e}function Mp(t){let e=We.get(t);return e&&e.setDOM(t.cloneNode()),t}class Jo extends tr{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}}Jo.inline=new Jo("span");Jo.block=new Jo("div");const Lp=new class extends tr{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class ww{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=le.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 bh(e,e.contentDOM),this.updateInner([new kn(0,0,0,e.state.doc.length)],null)}update(e){var n;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.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 i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((n=this.domChanged)===null||n===void 0)&&n.newSel?i=this.domChanged.newSel.head:!Fz(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?Mz(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;r=new kn(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(ie.ie||ie.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=Zz(o,this.decorations,e.changes);l.length&&(r=kn.extendWithRanges(r,l));let c=jz(a,this.blockWrappers,e.changes);return c.length&&(r=kn.extendWithRanges(r,c)),s&&!r.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,n){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(n||e.length){let o=this.tile,a=new $z(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);n&&We.get(n.text)&&a.cache.reused.set(We.get(n.text),2),this.tile=a.run(e,n),a0(o,a.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=ie.chrome||ie.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];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 Dp&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let n of e.transactions)for(let r of n.effects)r.is(B_)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,n=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,o=!s&&!(this.view.state.facet(Fr)||r.tabIndex>-1)&&rl(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||n||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),ie.gecko&&l.empty&&!this.hasComposition&&Rz(c)){let d=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(d,c.node.childNodes[c.offset]||null)),c=u=new zn(d,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!sl(c.node,c.offset,f.anchorNode,f.anchorOffset)||!sl(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,l))&&(this.view.observer.ignore(()=>{ie.android&&ie.chrome&&r.contains(f.focusNode)&&Bz(f.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let d=Hl(this.view.root);if(d)if(l.empty){if(ie.gecko){let h=Lz(c.node,c.offset);if(h&&h!=3){let p=(h==1?T_:N_)(c.node,c.offset);p&&(c=new zn(p.node,p.offset))}}d.collapse(c.node,c.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(c.node,c.offset);try{d.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),h.setEnd(u.node,u.offset),h.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(h)}o&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new zn(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new zn(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,n){return this.hasComposition&&n.empty&&sl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==n.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,n=e.state.selection.main,r=Hl(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!n.empty||!n.assoc||!r.modify)return;let o=this.lineAt(n.head,n.assoc);if(!o)return;let a=o.posAtStart;if(n.head==a||n.head==a+o.length)return;let l=this.coordsAt(n.head,-1),c=this.coordsAt(n.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(n.head+n.assoc,n.assoc);r.collapse(u.node,u.offset),r.modify("move",n.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=n.from&&r.collapse(i,s)}posFromDOM(e,n){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[n];else{let o=ni(e)==0?0:n==0?-1:1;for(;;){let a=e.parentNode;if(a==r.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!We.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let o=0,a=i;;o++){let l=r.children[o];if(l.dom==s)return a;a+=l.length+l.breakAfter}}else return r.isText()?e==r.dom?i+n:i+(n?r.length:0):i}domAtPos(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.domPosFor(e,n):r.domIn(i,n)}inlineDOMNearPos(e,n){let r,i=-1,s=!1,o,a=-1,l=!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&&(r=c,i=e-u,s=f<e),f>=e&&!o&&(o=c,a=e-u,l=u>e),u>e&&o)return!0}}),!r&&!o?this.domAtPos(e,n):(s&&o?r=null:l&&r&&(o=null),r&&n<0||!o?r.domIn(i,n):o.domIn(a,n))}coordsAt(e,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,n);return r.isWidget()?r.widget instanceof Dp?null:r.coordsInWidget(i,n,!0):r.coordsIn(i,n)}lineAt(e,n){let{tile:r}=this.tile.resolveBlock(e,n);return r.isLine()?r:null}coordsForChar(e){let{tile:n,offset:r}=this.tile.resolveBlock(e,1);if(!n.isLine())return null;function i(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let l=i(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(s.isText()&&o<s.length){let a=ut(s.text,o);if(a==o)return null;let l=Kl(s.dom,o,a).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return i(n,r)}measureVisibleLineHeights(e){let n=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==_e.LTR,c=0,u=(f,d,h)=>{for(let p=0;p<f.children.length&&!(d>i);p++){let m=f.children[p],O=d+m.length,g=m.dom.getBoundingClientRect(),{height:b}=g;if(h&&!p&&(c+=g.top-h.top),m instanceof Gr)O>r&&u(m,d,g);else if(d>=r&&(c>0&&n.push(-c),n.push(b+c),c=0,o)){let y=m.dom.lastChild,v=y?il(y):[];if(v.length){let S=v[v.length-1],E=l?S.right-g.left:g.right-S.left;E>a&&(a=E,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=O)}}h&&p==f.children.length-1&&(c+=h.bottom-g.bottom),d=O+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 a=0,l;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=il(c.dom);if(u.length!=1)return;a+=u[0].width,l=u[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let n=document.createElement("div"),r,i,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=il(n.firstChild)[0];r=n.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,n.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],n=this.view.viewState;for(let r=0,i=0;;i++){let s=i==n.viewports.length?null:n.viewports[i],o=s?s.from-1:this.view.state.doc.length;if(o>r){let a=(n.lineBlockAt(o).bottom-n.lineBlockAt(r).top)/this.view.scaleY;e.push(le.replace({widget:new Dp(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return le.set(e)}updateDeco(){let e=1,n=this.view.state.facet(Oh).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(Ly).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,n.push(ge.join(i))),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(X_).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var n;if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(j_))try{if(u(this.view,e.range,e))return!0}catch(f){Ut(this.view.state,f,"scroll handler")}let{range:r}=e,i=this.coordsAt(r.head,(n=r.assoc)!==null&&n!==void 0?n:r.empty?0:r.head>r.anchor?-1:1),s;if(!i)return;!r.empty&&(s=this.coordsAt(r.anchor,r.anchor>r.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let o=Dy(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(cz(this.view.scrollDOM,a,r.head<r.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,c),-c),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 u=this.view.docView.lineAt(r.head,1);u&&u.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let n=r=>r.isWidget()||r.children.some(n);return n(this.tile.resolveBlock(e,1).tile)}destroy(){a0(this.tile)}}function a0(t,e){let n=e==null?void 0:e.get(t);if(n!=1){n==null&&t.destroy();for(let r of t.children)a0(r,e)}}function Rz(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 Y_(t,e){let n=t.observer.selectionRange;if(!n.focusNode)return null;let r=T_(n.focusNode,n.focusOffset),i=N_(n.focusNode,n.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=We.get(i.node);if(!a||a.isText()&&a.text!=i.node.nodeValue)s=i;else if(t.docView.lastCompositionAfterCursor){let l=We.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(s=i)}}if(t.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function Mz(t,e,n){let r=Y_(t,n);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||t.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc;return{range:new kn(l.mapPos(s),l.mapPos(o),s,o),text:i}}function Lz(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e<t.childNodes.length&&t.childNodes[e].contentEditable=="false"?2:0)}let Dz=class{constructor(){this.changes=[]}compareRange(e,n){To(e,n,this.changes)}comparePoint(e,n){To(e,n,this.changes)}boundChange(e){To(e,e,this.changes)}};function Zz(t,e,n){let r=new Dz;return ge.compare(t,e,n,r),r.changes}class Vz{constructor(){this.changes=[]}compareRange(e,n){To(e,n,this.changes)}comparePoint(){}boundChange(e){To(e,e,this.changes)}}function jz(t,e,n){let r=new Vz;return ge.compare(t,e,n,r),r.changes}function Bz(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 Fz(t,e){let n=!1;return e&&t.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(n=!0)}),n}class Dp extends tr{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 Xz(t,e,n=1){let r=t.charCategorizer(e),i=t.doc.lineAt(e),s=e-i.from;if(i.length==0)return W.cursor(e);s==0?n=1:s==i.length&&(n=-1);let o=s,a=s;n<0?o=ut(i.text,s,!1):a=ut(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let c=ut(i.text,o,!1);if(r(i.text.slice(c,o))!=l)break;o=c}for(;a<i.length;){let c=ut(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return W.undirectionalRange(o+i.from,a+i.from)}function zz(t,e,n,r,i){let s=Math.round((r-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&n.height>t.defaultLineHeight*1.5){let a=t.viewState.heightOracle.textHeight,l=Math.floor((i-n.top-(t.defaultLineHeight-a)*.5)/a);s+=l*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(n.from,n.to);return n.from+Gg(o,s,t.state.tabSize)}function l0(t,e,n){let r=t.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==xt.Text&&(i.type!=s.type||(n<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function Wz(t,e,n,r){let i=l0(t,e.head,e.assoc||-1),s=!r||i.type!=xt.Text||!(t.lineWrapping||i.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),a=t.textDirectionAt(i.from),l=t.posAtCoords({x:n==(a==_e.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return W.cursor(l,n?-1:1)}return W.cursor(n?i.to:i.from,n?-1:1)}function Sw(t,e,n,r){let i=t.state.doc.lineAt(e.head),s=t.bidiSpans(i),o=t.textDirectionAt(i.from);for(let a=e,l=null;;){let c=xz(i,s,o,a,n),u=A_;if(!c){if(i.number==(n?t.state.doc.lines:1))return a;u=`
|
|
71
|
+
`,i=t.state.doc.line(i.number+(n?1:-1)),s=t.bidiSpans(i),c=t.visualLineSide(i,!n)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function Uz(t,e,n){let r=t.state.charCategorizer(e),i=r(n);return s=>{let o=r(s);return i==Me.Space&&(i=o),i==o}}function Yz(t,e,n,r){let i=e.head,s=n?1:-1;if(i==(n?t.state.doc.length:0))return W.cursor(i,e.assoc);let o=e.goalColumn,a,l=t.contentDOM.getBoundingClientRect(),c=t.coordsAtPos(i,e.assoc||((e.empty?n:e.head==e.from)?1:-1)),u=t.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let p=t.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,t.defaultCharacterWidth*(i-p.from))),a=(s<0?p.top:p.bottom)+u}let f=l.left+o,d=t.viewState.heightOracle.textHeight>>1,h=r??d;for(let p=0;;p+=d){let m=a+(h+p)*s,O=c0(t,{x:f,y:m},!1,s);if(n?m>l.bottom:m<l.top)return W.cursor(O.pos,O.assoc);let g=t.coordsAtPos(O.pos,O.assoc),b=g?(g.top+g.bottom)/2:0;if(!g||(n?b>a:b<a))return W.cursor(O.pos,O.assoc,void 0,o)}}function ol(t,e,n){for(;;){let r=0;for(let i of t)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=r||n||(e-s<o-e?-1:1);e=l<0?s:o,r=l}});if(!r)return e}}function G_(t,e){let n=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=ol(t,i.from,0);o!=i.from&&(s=W.cursor(o,-1))}else{let o=ol(t,i.from,-1),a=ol(t,i.to,1);(o!=i.from||a!=i.to)&&(i.undirectional?s=W.undirectionalRange(i.from,i.to):s=W.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(n||(n=e.ranges.slice()),n[r]=s)}return n?W.create(n,e.mainIndex):e}function Zp(t,e,n){let r=ol(t.state.facet($c).map(i=>i(t)),n.from,e.head>n.from?-1:1);return r==n.from?n:W.cursor(r,r<n.from?1:-1)}class yr{constructor(e,n){this.pos=e,this.assoc=n}}function c0(t,e,n,r){let i=t.contentDOM.getBoundingClientRect(),s=i.top+t.viewState.paddingTop,{x:o,y:a}=e,l=a-s,c;for(;;){if(l<0)return new yr(0,1);if(l>t.viewState.docHeight)return new yr(t.state.doc.length,-1);if(c=t.elementAtHeight(l),r==null)break;if(c.type==xt.Text){if(r<0?c.to<t.viewport.from:c.from>t.viewport.to)break;let d=t.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(d&&(r<0?d.top<=l+s:d.bottom>=l+s))break}let f=t.viewState.heightOracle.textHeight/2;l=r>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==xt.Text){let f=zz(t,i,c,o,a);return new yr(f,f==c.from?1:-1)}}if(c.type!=xt.Text)return l<(c.top+c.bottom)/2?new yr(c.from,1):new yr(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 Gz(t,o,a,t.textDirectionAt(c.from)).scanTile(u,c.from)}class Gz{constructor(e,n,r,i){this.view=e,this.x=n,this.y=r,this.baseDir=i,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:r,spans:i}=this.bidiSpansAt(e);return i[br.find(i,e-r.from,-1,n)].level==this.baseDir}dirAt(e,n){let{line:r,spans:i}=this.bidiSpansAt(e);return i[br.find(i,e-r.from,-1,n)].dir}bidiIn(e,n){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<n)}scan(e,n,r=!1){let i=0,s=e.length-1,o=new Set,a=this.bidiIn(e[0],e[s]),l,c,u=-1,f=1e9,d;e:for(;i<s;){let p=s-i,m=i+s>>1;t:if(o.has(m)){let g=i+Math.floor(Math.random()*p);for(let b=0;b<p;b++){if(!o.has(g)){m=g;break t}g++,g==s&&(g=i)}break e}o.add(m);let O=n(m);if(O)for(let g=0;g<O.length;g++){let b=O[g],y=0;if(!(b.width==0&&O.length>1)){if(b.bottom<this.y)(!l||l.bottom<b.bottom)&&(l=b),y=1;else if(b.top>this.y)(!c||c.top>b.top)&&(c=b),y=-1;else{let v=b.left>this.x?this.x-b.left:b.right<this.x?this.x-b.right:0,S=Math.abs(v);S<f&&(u=m,f=S,d=b),v&&(y=v<0==(this.baseDir==_e.LTR)?-1:1)}y==-1&&(!a||this.baseDirAt(e[m],1))?s=m:y==1&&(!a||this.baseDirAt(e[m+1],-1))&&(i=m+1)}}}if(!d){if(!c&&!l)return{i:e[0],after:!1};let p=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(p.top+p.bottom)/2,this.scan(e,n,!0)}if(f&&!r){let{top:p,bottom:m}=d;if(l&&l.bottom>(p+p+m)/3)return this.y=l.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 h=(a?this.dirAt(e[u],1):this.baseDir)==_e.LTR;return{i:u,after:this.x>(d.left+d.right)/2==h}}scanText(e,n){let r=[];for(let s=0;s<e.length;s=ut(e.text,s))r.push(n+s);r.push(n+e.length);let i=this.scan(r,s=>{let o=r[s]-n,a=r[s+1]-n;return Kl(e.dom,o,a).getClientRects()});return i.after?new yr(r[i.i+1],-1):new yr(r[i.i],1)}scanTile(e,n){if(!e.length)return new yr(n,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,n);if(a.isComposite())return this.scanTile(a,n)}let r=[n];for(let a=0,l=n;a<e.children.length;a++)r.push(l+=e.children[a].length);let i=this.scan(r,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Kl(l.dom,0,l.length)).getClientRects()}),s=e.children[i.i],o=r[i.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):i.after?new yr(r[i.i+1],-1):new yr(o,1)}}const Ys="";class Hz{constructor(e,n){this.points=e,this.view=n,this.text="",this.lineSeparator=n.state.facet(ye.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ys}readRange(e,n){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=We.get(i),a=i.nextSibling;if(a==n){o!=null&&o.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=We.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:ld(i))||ld(a)&&(i.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!Kz(a,n)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}readTextNode(e){let n=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,n.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=n.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(n))&&(s=a.index,o=a[0].length),this.append(n.slice(r,s<0?n.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){let n=We.get(e),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,n){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==n&&(r.pos=this.text.length)}findPointInside(e,n){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(qz(e,r.node,r.offset)?n:0))}}function qz(t,e,n){for(;;){if(!e||n<ni(e))return!1;if(e==t)return!0;n=Bi(e)+1,e=e.parentNode}}function Kz(t,e){let n;for(;!(t==e||!t);t=t.nextSibling){let r=We.get(t);if(!(r!=null&&r.isWidget()))return!1;r&&(n||(n=[])).push(r)}if(n)for(let r of n){let i=r.overrideDOMText;if(i!=null&&i.length)return!1}return!0}class kw{constructor(e,n){this.node=e,this.offset=n,this.pos=-1}}class Jz{constructor(e,n,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=n>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=H_(e.docView.tile,n,r,0))){let l=s||o?[]:t6(e),c=new Hz(l,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=n6(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!n0(e.contentDOM,l.focusNode)?a.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!n0(e.contentDOM,l.anchorNode)?a.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),f=e.viewport;if((ie.ios||ie.chrome)&&c!=u&&Math.min(c,u)<=a.main.from&&Math.max(c,u)>=a.main.to&&(f.from>0||f.to<e.state.doc.length)){let d=Math.min(c,u),h=Math.max(c,u),p=f.from-d,m=f.to-h;(p==0||p==1||d==0)&&(m==0||m==-1||h==e.state.doc.length)&&(c=0,u=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(W.range(u,c));else if(e.lineWrapping&&u==c&&!(a.main.empty&&a.main.head==c)&&e.inputState.lastTouchTime>Date.now()-100){let d=e.coordsAtPos(c,-1),h=0;d&&(h=e.inputState.lastTouchY<=d.bottom?-1:1),this.newSel=W.create([W.cursor(c,h)])}else this.newSel=W.single(u,c)}}}function H_(t,e,n,r){if(t.isComposite()){let i=-1,s=-1,o=-1,a=-1;for(let l=0,c=r,u=r;l<t.children.length;l++){let f=t.children[l],d=c+f.length;if(c<e&&d>n)return H_(f,e,n,c);if(d>=e&&i==-1&&(i=l,s=c),c>n&&f.dom.parentNode==t.dom){o=l,a=u;break}u=d,c=d+f.breakAfter}return{from:s,to:a<0?r+t.length:a,startDOM:(i?t.children[i-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:r,to:r+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function q_(t,e){let n,{newSel:r}=e,{state:i}=t,s=i.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,c=s.from,u=null;(o===8||ie.android&&e.text.length<l-a)&&(c=s.to,u="end");let f=i.doc.sliceString(a,l,Ys),d,h;!s.empty&&s.from>=a&&s.to<=l&&(e.typeOver||f!=e.text)&&f.slice(0,s.from-a)==e.text.slice(0,s.from-a)&&f.slice(s.to-a)==e.text.slice(d=e.text.length-(f.length-(s.to-a)))?n={from:s.from,to:s.to,insert:xe.of(e.text.slice(s.from-a,d).split(Ys))}:(h=K_(f,e.text,c-a,u))&&(ie.chrome&&o==13&&h.toB==h.from+2&&e.text.slice(h.from,h.toB)==Ys+Ys&&h.toB--,n={from:a+h.from,to:a+h.toA,insert:xe.of(e.text.slice(h.from,h.toB).split(Ys))})}else r&&(!t.hasFocus&&i.facet(Fr)||dd(r,s))&&(r=null);if(!n&&!r)return!1;if((ie.mac||ie.android)&&n&&n.from==n.to&&n.from==s.head-1&&/^\. ?$/.test(n.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=W.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:xe.of([n.insert.toString().replace("."," ")])}):i.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:i.toText(t.inputState.insertingText)}:ie.chrome&&n&&n.from==n.to&&n.from==s.head&&n.insert.toString()==`
|
|
72
|
+
`&&t.lineWrapping&&(r&&(r=W.single(r.main.anchor-1,r.main.head-1)),n={from:s.from,to:s.to,insert:xe.of([" "])}),n)return Zy(t,n,r,o);if(r&&!dd(r,s)){let a=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(a=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(r=G_(i.facet($c).map(c=>c(t)),r))),t.dispatch({selection:r,scrollIntoView:a,userEvent:l}),!0}else return!1}function Zy(t,e,n,r=-1){if(ie.ios&&t.inputState.flushIOSKey(e))return!0;let i=t.state.selection.main;if(ie.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&t.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&No(t.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&No(t.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&No(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,a=()=>o||(o=e6(t,e,n));return t.state.facet(L_).some(l=>l(t,e.from,e.to,s,a))||t.dispatch(a()),!0}function e6(t,e,n){let r,i=t.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let l=e.from<s.from?-1:1,c=l<0?s.from:s.to,u=ol(i.facet($c).map(f=>f(t)),c,l);e.from==u&&(o=u)}if(o>-1)r={changes:e,selection:W.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 l=s.from<e.from?i.sliceDoc(s.from,e.from):"",c=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(t.state.toText(l+e.insert.sliceString(0,void 0,t.state.lineBreak)+c))}else{let l=i.changes(e),c=n&&n.main.to<=l.newLength?n.main:void 0;if(i.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,d=n&&Y_(t,n.main.head);if(d){let p=e.insert.length-(e.to-e.from);f={from:d.from,to:d.to-p}}else f=t.state.doc.lineAt(s.head);let h=s.to-e.to;r=i.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:l,range:c||p.map(l)};let m=p.to-h,O=m-u.length;if(t.state.sliceDoc(O,m)!=u||m>=f.from&&O<=f.to)return{range:p};let g=i.changes({from:O,to:m,insert:e.insert}),b=p.to-s.to;return{changes:g,range:c?W.range(Math.max(0,c.anchor+b),Math.max(0,c.head+b)):p.map(g)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let a="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,a+=".compose",t.inputState.compositionFirstChange&&(a+=".start",t.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function K_(t,e,n,r){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&t.length==e.length)return null;let o=t.length,a=e.length;for(;o>0&&a>0&&t.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));n-=o+l-s}if(o<s&&t.length<e.length){let l=n<=s&&n>=o?s-n:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=n<=s&&n>=a?s-n:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function t6(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}=t.observer.selectionRange;return n&&(e.push(new kw(n,r)),(i!=n||s!=r)&&e.push(new kw(i,s))),e}function n6(t,e){if(t.length==0)return null;let n=t[0].pos,r=t.length==2?t[1].pos:n;return n>-1&&r>-1?W.single(n+e,r+e):null}function dd(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class r6{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,ie.safari&&e.contentDOM.addEventListener("input",()=>null),ie.gecko&&b6(e.contentDOM.ownerDocument)}handleEvent(e){!d6(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 r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,n);for(let i of r.handlers){if(n.defaultPrevented)break;if(i(this.view,n)){n.preventDefault();break}}}}ensureHandlers(e){let n=s6(e),r=this.handlers,i=this.view.contentDOM;for(let s in n)if(s!="scroll"){let o=!n[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!n[s]&&i.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&&eC.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),ie.android&&ie.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(ie.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(J_.some(n=>n.keyCode==e.keyCode)&&!e.ctrlKey||o6.indexOf(e.key)>-1&&e.ctrlKey)){let n={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return n.shiftKey&&ie.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&i6(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,No(this.view.contentDOM,n.key,n.keyCode,n.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:ie.safari&&!ie.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 i6(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function Ew(t,e){return(n,r)=>{try{return e.call(t,r,n)}catch(i){Ut(n.state,i)}}}function s6(t){let e=Object.create(null);function n(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of t){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&n(a).handlers.push(Ew(r.value,l))}if(o)for(let a in o){let l=o[a];l&&n(a).observers.push(Ew(r.value,l))}}for(let r in Kn)n(r).handlers.push(Kn[r]);for(let r in Jt)n(r).observers.push(Jt[r]);return e}const J_=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],o6="dthko",eC=[16,17,18,20,91,92,224,225],Su=6;function ku(t){return Math.max(0,t)*.7+8}function a6(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class l6{constructor(e,n,r,i){this.view=e,this.startEvent=n,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParents=S_(e.contentDOM),this.atoms=e.state.facet($c).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(ye.allowMultipleSelections)&&c6(e,n),this.dragging=f6(e,n)&&rC(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&&a6(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let n=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Dy(this.view);e.clientX-l.left<=i+Su?n=-ku(i-e.clientX):e.clientX+l.right>=o-Su&&(n=ku(e.clientX-o)),e.clientY-l.top<=s+Su?r=-ku(s-e.clientY):e.clientY+l.bottom>=a-Su&&(r=ku(e.clientY-a)),this.setScrollSpeed(n,r)}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,r=G_(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(n.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(n=>n.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function c6(t,e){let n=t.state.facet(I_);return n.length?n[0](e):ie.mac?e.metaKey:e.ctrlKey}function u6(t,e){let n=t.state.facet(Q_);return n.length?n[0](e):ie.mac?!e.altKey:!e.ctrlKey}function f6(t,e){let{main:n}=t.state.selection;if(n.empty)return!1;let r=Hl(t.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function d6(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target,r;n!=t.contentDOM;n=n.parentNode)if(!n||n.nodeType==11||(r=We.get(n))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Kn=Object.create(null),Jt=Object.create(null),tC=ie.ie&&ie.ie_version<15||ie.ios&&ie.webkit_version<604;function h6(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(),nC(t,n.value)},50)}function xh(t,e,n){for(let r of t.facet(e))n=r(n,t);return n}function nC(t,e){e=xh(t.state,Qy,e);let{state:n}=t,r,i=1,s=n.toText(e),o=s.lines==n.selection.ranges.length;if(u0!=null&&n.selection.ranges.every(l=>l.empty)&&u0==s.toString()){let l=-1;r=n.changeByRange(c=>{let u=n.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=n.toText((o?s.line(i++).text:e)+n.lineBreak);return{changes:{from:u.from,insert:f},range:W.cursor(c.from+f.length)}})}else o?r=n.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:W.cursor(l.from+c.length)}}):r=n.replaceSelection(s);t.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}Jt.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Jt.wheel=Jt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};Kn.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Jt.touchstart=(t,e)=>{let n=t.inputState,r=e.targetTouches[0];n.lastTouchTime=Date.now(),r&&(n.lastTouchX=r.clientX,n.lastTouchY=r.clientY),n.setSelectionOrigin("select.pointer")};Jt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Kn.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let r of t.state.facet(R_))if(n=r(t,e),n)break;if(!n&&e.button==0&&(n=m6(t,e)),n){let r=!t.hasFocus;t.inputState.startMouseSelection(new l6(t,e,n,r)),r&&t.observer.ignore(()=>{k_(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let i=t.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function Tw(t,e,n,r){if(r==1)return W.cursor(e,n);if(r==2)return Xz(t.state,e,n);{let i=t.docView.lineAt(e,n),s=t.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<t.state.doc.length&&a==s.to&&a++,W.undirectionalRange(o,a)}}const p6=ie.ie&&ie.ie_version<=11;let Nw=null,Pw=0,_w=0;function rC(t){if(!p6)return t.detail;let e=Nw,n=_w;return Nw=t,_w=Date.now(),Pw=!e||n>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Pw+1)%3:1}function m6(t,e){let n=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=rC(e),i=t.state.selection;return{update(s){s.docChanged&&(n.pos=s.changes.mapPos(n.pos),i=i.map(s.changes))},get(s,o,a){let l=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=Tw(t,l.pos,l.assoc,r);if(n.pos!=l.pos&&!o){let f=Tw(t,n.pos,n.assoc,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d<u.from?W.range(d,h,u.assoc):W.range(h,d,u.assoc)}return o?i.replaceRange(i.main.extend(u.from,u.to,u.assoc)):a&&r==1&&i.ranges.length>1&&(c=g6(i,l.pos))?c:a?i.addRange(u):W.create([u])}}}function g6(t,e){for(let n=0;n<t.ranges.length;n++){let{from:r,to:i}=t.ranges[n];if(r<=e&&i>=e)return W.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}Kn.dragstart=(t,e)=>{let{selection:{main:n}}=t.state;if(e.target.draggable){let i=t.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,o=s+i.length;(s>=n.to||o<=n.from)&&(n=W.undirectionalRange(s,o))}}let{inputState:r}=t;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=n,e.dataTransfer&&(e.dataTransfer.setData("Text",xh(t.state,Ry,t.state.sliceDoc(n.from,n.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Kn.dragend=t=>(t.inputState.draggedContent=null,!1);function Cw(t,e,n,r){if(n=xh(t.state,Qy,n),!n)return;let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=r&&s&&u6(t,e)?{from:s.from,to:s.to}:null,a={from:i,insert:n},l=t.state.changes(o?[o,a]:a);t.focus(),t.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Kn.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let n=e.dataTransfer.files;if(n&&n.length){let r=Array(n.length),i=0,s=()=>{++i==n.length&&Cw(t,e,r.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<n.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(n[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Cw(t,e,r,!0),!0}return!1};Kn.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let n=tC?null:e.clipboardData;return n?(nC(t,n.getData("text/plain")||n.getData("text/uri-list")),!0):(h6(t),!1)};function O6(t,e){let n=t.dom.parentNode;if(!n)return;let r=n.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),t.focus()},50)}function y6(t){let e=[],n=[],r=!1;for(let i of t.selection.ranges)i.empty||(e.push(t.sliceDoc(i.from,i.to)),n.push(i));if(!e.length){let i=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>i&&(e.push(o.text),n.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),i=o.number}r=!0}return{text:xh(t,Ry,e.join(t.lineBreak)),ranges:n,linewise:r}}let u0=null;Kn.copy=Kn.cut=(t,e)=>{if(!rl(t.contentDOM,t.observer.selectionRange))return!1;let{text:n,ranges:r,linewise:i}=y6(t.state);if(!n&&!i)return!1;u0=i?n:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=tC?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",n),!0):(O6(t,n),!1)};const iC=Cr.define();function sC(t,e){let n=[];for(let r of t.facet(D_)){let i=r(t,e);i&&n.push(i)}return n.length?t.update({effects:n,annotations:iC.of(!0)}):null}function oC(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let n=sC(t.state,e);n?t.dispatch(n):t.update([])}},10)}Jt.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),oC(t)};Jt.blur=t=>{t.observer.clearSelectionRange(),oC(t)};Jt.compositionstart=Jt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Jt.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,ie.chrome&&ie.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};Jt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Kn.beforeinput=(t,e)=>{var n,r;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 a=o[0],l=t.posAtDOM(a.startContainer,a.startOffset),c=t.posAtDOM(a.endContainer,a.endOffset);return Zy(t,{from:l,to:c,insert:t.state.toText(s)},null),!0}}let i;if(ie.chrome&&ie.android&&(i=J_.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.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 ie.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),ie.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>Jt.compositionend(t,e),20),!1};const $w=new Set;function b6(t){$w.has(t)||($w.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Aw=["pre-wrap","normal","pre-line","break-spaces"];let ea=!1;function Iw(){ea=!1}class x6{constructor(e){this.lineWrapping=e,this.doc=xe.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,n){let r=this.doc.lineAt(n).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Aw.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(n=!0,this.heightSamples[Math.floor(i*10)]=!0)}return n}refresh(e,n,r,i,s,o){let a=Aw.indexOf(e)>-1,l=Math.abs(n-this.lineHeight)>.3||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){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 l}}class v6{constructor(e,n){this.from=e,this.heights=n,this.index=0}get more(){return this.index<this.heights.length}}class Bn{constructor(e,n,r,i,s){this.from=e,this.length=n,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?xt.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 Rs?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 Bn(this.from,this.length+e.length,this.top,this.height+e.height,n)}}var Ce=function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t}(Ce||(Ce={}));const uf=.001;class Qt{constructor(e,n,r=2){this.length=e,this.height=n,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>uf&&(ea=!0),this.height=e)}replace(e,n,r){return Qt.of(r)}decomposeLeft(e,n){n.push(this)}decomposeRight(e,n){n.push(this)}applyChanges(e,n,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=s.lineAt(l,Ce.ByPosNoHeight,r.setDoc(n),0,0),h=d.to>=c?d:s.lineAt(c,Ce.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,l<d.from&&(d=s.lineAt(l,Ce.ByPosNoHeight,r,0,0));u+=d.from-l,l=d.from;let p=Vy.build(r.setDoc(o),e,u,f);s=hd(s,s.replace(l,c,p))}return s.updateHeight(r,0)}static empty(){return new ln(0,0,0)}static of(e){if(e.length==1)return e[0];let n=0,r=e.length,i=0,s=0;for(;;)if(n==r)if(i>s*2){let a=e[n-1];a.break?e.splice(--n,1,a.left,null,a.right):e.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[n++];a&&(i+=a.size)}else{let a=e[--r];a&&(s+=a.size)}let o=0;return e[n-1]==null?(o=1,n--):e[n]==null&&(o=1,r++),new S6(Qt.of(e.slice(0,n)),o,Qt.of(e.slice(r)))}}function hd(t,e){return t==e?t:(t.constructor!=e.constructor&&(ea=!0),e)}Qt.prototype.size=1;const w6=le.replace({});class aC extends Qt{constructor(e,n,r){super(e,n),this.deco=r,this.spaceAbove=0}mainBlock(e,n){return new Bn(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,n,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new Bn(i,0,r,this.spaceAbove,w6):this.mainBlock(r,i)}lineAt(e,n,r,i,s){let o=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(o):o}forEachLine(e,n,r,i,s,o){e<=s+this.length&&n>=s&&o(this.lineAt(0,Ce.ByPos,r,i,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,r=!1,i){return i&&i.from<=n&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ln extends aC{constructor(e,n,r){super(e,n,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,n){return new Bn(n,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,n,r){let i=r[0];return r.length==1&&(i instanceof ln||i instanceof mt&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof mt?i=new ln(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):Qt.of(r)}updateHeight(e,n=0,r=!1,i){return i&&i.from<=n&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class mt extends Qt{constructor(e){super(e,0)}heightMetrics(e,n){let r=e.doc.lineAt(n).number,i=e.doc.lineAt(n+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,n,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(n,i);if(n.lineWrapping){let c=i+(e<n.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=n.doc.lineAt(c),f=a+u.length*l,d=Math.max(r,e-f/2);return new Bn(u.from,u.length,d,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-r)/a))),{from:u,length:f}=n.doc.line(s+c);return new Bn(u,f,r+a*c,a,0)}}lineAt(e,n,r,i,s){if(n==Ce.ByHeight)return this.blockAt(e,r,i,s);if(n==Ce.ByPosNoHeight){let{from:h,to:p}=r.doc.lineAt(e);return new Bn(h,p-h,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(r,s),c=r.doc.lineAt(e),u=a+c.length*l,f=c.number-o,d=i+a*f+l*(c.from-s-f);return new Bn(c.from,c.length,Math.max(i,Math.min(d,i+this.height-u)),u,0)}forEachLine(e,n,r,i,s,o){e=Math.max(e,s),n=Math.min(n,s+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,s);for(let u=e,f=i;u<=n;){let d=r.doc.lineAt(u);if(u==e){let p=d.number-a;f+=l*p+c*(e-s-p)}let h=l+c*d.length;o(new Bn(d.from,d.length,f,h,0)),f+=h,u=d.to+1}}replace(e,n,r){let i=this.length-n;if(i>0){let s=r[r.length-1];s instanceof mt?r[r.length-1]=new mt(s.length+i):r.push(null,new mt(i-1))}if(e>0){let s=r[0];s instanceof mt?r[0]=new mt(e+s.length):r.unshift(new mt(e-1),null)}return Qt.of(r)}decomposeLeft(e,n){n.push(new mt(e-1),null)}decomposeRight(e,n){n.push(null,new mt(this.length-e-1))}updateHeight(e,n=0,r=!1,i){let s=n+this.length;if(i&&i.from<=n+this.length&&i.more){let o=[],a=Math.max(n,i.from),l=-1;for(i.from>n&&o.push(new mt(i.from-n-1).updateHeight(e,n));a<=s&&i.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let f=i.heights[i.index++],d=0;f<0&&(d=-f,f=i.heights[i.index++]),l==-1?l=f:Math.abs(f-l)>=uf&&(l=-2);let h=new ln(u,f,d);h.outdated=!1,o.push(h),a+=u+1}a<=s&&o.push(null,new mt(s-a).updateHeight(e,a));let c=Qt.of(o);return(l<0||Math.abs(c.height-this.height)>=uf||Math.abs(l-this.heightMetrics(e,n).perLine)>=uf)&&(ea=!0),hd(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(n,n+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class S6 extends Qt{constructor(e,n,r){super(e.length+n+r.length,e.height+r.height,n|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,n,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,n,r,i):this.right.blockAt(e,n,s,i+this.left.length+this.break)}lineAt(e,n,r,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,l=n==Ce.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,n,r,i,s):this.right.lineAt(e,n,r,o,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=n==Ce.ByPosNoHeight?Ce.ByPosNoHeight:Ce.ByPos;return l?c.join(this.right.lineAt(a,u,r,o,a)):this.left.lineAt(a,u,r,i,s).join(c)}forEachLine(e,n,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,n,r,i,s,o),n>=l&&this.right.forEachLine(e,n,r,a,l,o);else{let c=this.lineAt(l,Ce.ByPos,r,i,s);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,s,o),c.to>=e&&c.from<=n&&o(c),n>c.to&&this.right.forEachLine(c.to+1,n,r,a,l,o)}}replace(e,n,r){let i=this.left.length+this.break;if(n<i)return this.balanced(this.left.replace(e,n,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,n-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&Qw(s,o-1),n<this.length){let a=s.length;this.decomposeRight(n,s),Qw(s,a)}return Qt.of(s)}decomposeLeft(e,n){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,n);n.push(this.left),this.break&&(r++,e>=r&&n.push(null)),e>r&&this.right.decomposeLeft(e-r,n)}decomposeRight(e,n){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,n);e<r&&this.left.decomposeRight(e,n),this.break&&e<i&&n.push(null),n.push(this.right)}balanced(e,n){return e.size>2*n.size||n.size>2*e.size?Qt.of(this.break?[e,null,n]:[e,n]):(this.left=hd(this.left,e),this.right=hd(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,r=!1,i){let{left:s,right:o}=this,a=n+s.length+this.break,l=null;return i&&i.from<=n+s.length&&i.more?l=s=s.updateHeight(e,n,r,i):s.updateHeight(e,n,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?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 Qw(t,e){let n,r;t[e]==null&&(n=t[e-1])instanceof mt&&(r=t[e+1])instanceof mt&&t.splice(e-1,3,new mt(n.length+1+r.length))}const k6=5;class Vy{constructor(e,n){this.pos=e,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,n){if(this.lineStart>-1){let r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof ln?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ln(r-this.pos,-1,0)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}point(e,n,r){if(e<n||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=n-e;r.block?this.addBlock(new aC(o,i,r)):(o||s||i>=k6)&&this.addLineDeco(i,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 ln(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,n){let r=new mt(n-e);return this.oracle.doc.lineAt(e).to==n&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ln)return e;let n=new ln(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,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}finish(e){let n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(n instanceof ln)&&!this.isCovered?this.nodes.push(new ln(0,-1,0)):(this.writtenTo<this.pos||n==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof ln&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,n,r,i){let s=new Vy(r,e);return ge.spans(n,r,i,s,0),s.finish(r)}}function E6(t,e,n){let r=new T6;return ge.compare(t,e,n,r,0),r.changes}class T6{constructor(){this.changes=[]}compareRange(){}comparePoint(e,n,r,i){(e<n||r&&r.heightRelevant||i&&i.heightRelevant)&&To(e,n,this.changes,5)}}function N6(t,e){let n=t.getBoundingClientRect(),r=t.ownerDocument,i=r.defaultView||window,s=Math.max(0,n.left),o=Math.min(i.innerWidth,n.right),a=Math.max(0,n.top),l=Math.min(i.innerHeight,n.bottom);for(let c=t.parentNode;c&&c!=r.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 d=u.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(c==t.parentNode?i.innerHeight:l,d.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:a-(n.top+e),bottom:Math.max(a,l)-(n.top+e)}}function P6(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 _6(t,e){let n=t.getBoundingClientRect();return{left:0,right:n.right-n.left,top:e,bottom:n.bottom-(n.top+e)}}class Vp{constructor(e,n,r,i){this.from=e,this.to=n,this.size=r,this.displaySize=i}static same(e,n){if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=n[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,n){return le.replace({widget:new C6(this.displaySize*(n?e.scaleY:e.scaleX),n)}).range(this.from,this.to)}}class C6 extends tr{constructor(e,n){super(),this.size=e,this.vertical=n}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Rw{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=Mw,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=_e.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let r=n.facet(My).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new x6(r),this.stateDeco=Lw(n),this.heightMap=Qt.empty().applyChanges(this.stateDeco,xe.empty,this.heightOracle.setDoc(n.doc),[new kn(0,0,0,n.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=le.set(this.lineGaps.map(i=>i.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let r=0;r<=1;r++){let i=r?n.head:n.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new Eu(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Mw:new jy(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(Va(e,this.scaler))})}update(e,n=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=Lw(this.state);let i=e.changedRanges,s=kn.extendWithRanges(i,E6(r,this.stateDeco,e?e.changes:it.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Iw(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||ea)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(n&&(n.range.head<l.from||n.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,n));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,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(V_)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,n=e.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?_e.RTL:_e.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",a=n.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:S,scaleY:E}=w_(n,a);(S>.005&&Math.abs(this.scaleX-S)>.005||E>.005&&Math.abs(this.scaleY-E)>.005)&&(this.scaleX=S,this.scaleY=E,c|=16,o=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let h=S_(this.view.contentDOM,!1).y;h!=this.scrollParent&&(this.scrollParent=h,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=E_(this.scrollParent||e.win);let m=(this.printing?_6:N6)(n,this.paddingTop),O=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(l=!0)),!this.inView&&!this.scrollTarget&&!P6(e.dom))return 0;let y=a.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(o=!0),o||i.lineWrapping&&Math.abs(y-this.contentDOMWidth)>i.charWidth){let{lineHeight:E,charWidth:w,textHeight:k}=e.docView.measureTextSize();o=E>0&&i.refresh(s,E,w,k,Math.max(5,y/w),S),o&&(e.docView.minWidth=0,c|=16)}O>0&&g>0?u=Math.max(O,g):O<0&&g<0&&(u=Math.min(O,g)),Iw();for(let E of this.viewports){let w=E.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(E);this.heightMap=(o?Qt.empty().applyChanges(this.stateDeco,xe.empty,this.heightOracle,[new kn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new v6(E.from,w))}ea&&(c|=2)}let v=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return v&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||v)&&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 r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new Eu(i.lineAt(o-r*1e3,Ce.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,Ce.ByHeight,s,0,0).to);if(n){let{head:c}=n.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,Ce.ByPos,s,0,0),d;n.y=="center"?d=(f.top+f.bottom)/2-u/2:n.y=="start"||n.y=="nearest"&&c<l.from?d=f.top:d=f.bottom-u,l=new Eu(i.lineAt(d-1e3/2,Ce.ByHeight,s,0,0).from,i.lineAt(d+u+1e3/2,Ce.ByHeight,s,0,0).to)}}return l}mapViewport(e,n){let r=n.mapPos(e.from,-1),i=n.mapPos(e.to,1);return new Eu(this.heightMap.lineAt(r,Ce.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,Ce.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:n},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,Ce.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(n,Ce.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(n==this.state.doc.length||s>=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,n){if(!e.length||n.empty)return e;let r=[];for(let i of e)n.touchesRange(i.from,i.to)||r.push(new Vp(n.mapPos(i.from),n.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,n){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=_e.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-u<s)return;let p=this.state.selection.main,m=[p.from];p.empty||m.push(p.to);for(let g of m)if(g>u&&g<f){l(u,g-10,d,h),l(g+10,f,d,h);return}let O=A6(e,g=>g.from>=d.from&&g.to<=d.to&&Math.abs(g.from-u)<s&&Math.abs(g.to-f)<s&&!m.some(b=>g.from<b&&g.to>b));if(!O){if(f<d.to&&n&&r&&n.visibleRanges.some(y=>y.from<=f&&y.to>=f)){let y=n.moveToLineBoundary(W.cursor(f),!1,!0).head;y>u&&(f=y)}let g=this.gapSize(d,u,f,h),b=r||g<2e6?g:2e6;O=new Vp(u,f,g,b)}a.push(O)},c=u=>{if(u.length<o||u.type!=xt.Text)return;let f=$6(u.from,u.to,this.stateDeco);if(f.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,h,p;if(r){let m=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,O,g;if(d!=null){let b=Nu(f,d),y=((this.visibleBottom-this.visibleTop)/2+m)/u.height;O=b-y,g=b+y}else O=(this.visibleTop-u.top-m)/u.height,g=(this.visibleBottom-u.top+m)/u.height;h=Tu(f,O),p=Tu(f,g)}else{let m=f.total*this.heightOracle.charWidth,O=i*this.heightOracle.charWidth,g=0;if(m>2e6)for(let E of e)E.from>=u.from&&E.from<u.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+g<this.pixelViewport.left&&(g=E.size-E.displaySize);let b=this.pixelViewport.left+g,y=this.pixelViewport.right+g,v,S;if(d!=null){let E=Nu(f,d),w=((y-b)/2+O)/m;v=E-w,S=E+w}else v=(b-O)/m,S=(y+O)/m;h=Tu(f,v),p=Tu(f,S)}h>u.from&&l(u.from,h,u,f),p<u.to&&l(p,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return a}gapSize(e,n,r,i){let s=Nu(i,r)-Nu(i,n);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){Vp.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=le.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 r=[];ge.spans(n,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],a=r[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(n=>n.from<=e&&n.to>=e)||Va(this.heightMap.lineAt(e,Ce.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)||Va(this.heightMap.lineAt(this.scaler.fromDOM(e),Ce.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 Va(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Eu{constructor(e,n){this.from=e,this.to=n}}function $6(t,e,n){let r=[],i=t,s=0;return ge.spans(n,t,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Tu({total:t,ranges:e},n){if(n<=0)return e[0].from;if(n>=1)return e[e.length-1].to;let r=Math.floor(t*n);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function Nu(t,e){let n=0;for(let{from:r,to:i}of t.ranges){if(e<=i){n+=e-r;break}n+=i-r}return n/t.total}function A6(t,e){for(let n of t)if(e(n))return n}const Mw={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Lw(t){let e=t.facet(Oh).filter(r=>typeof r!="function"),n=t.facet(Ly).filter(r=>typeof r!="function");return n.length&&e.push(ge.join(n)),e}class jy{constructor(e,n,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let c=n.lineAt(a,Ce.ByPos,e,0,0).top,u=n.lineAt(l,Ce.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let n=0,r=0,i=0;;n++){let s=n<this.viewports.length?this.viewports[n]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof jy?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((n,r)=>n.from==e.viewports[r].from&&n.to==e.viewports[r].to):!1}}function Va(t,e){if(e.scale==1)return t;let n=e.toDOM(t.top),r=e.toDOM(t.bottom);return new Bn(t.from,t.length,n,r-n,Array.isArray(t._content)?t._content.map(i=>Va(i,e)):t._content)}const Pu=re.define({combine:t=>t.join(" ")}),f0=re.define({combine:t=>t.indexOf(!0)>-1}),d0=Vi.newName(),lC=Vi.newName(),cC=Vi.newName(),uC={"&light":"."+lC,"&dark":"."+cC};function h0(t,e,n){return new Vi(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return t;if(!n||!n[i])throw new RangeError(`Unsupported selector: ${i}`);return n[i]}):t+" "+r}})}const I6=h0("."+d0,{"&":{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"}},uC),Q6={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jp=ie.ie&&ie.ie_version<=11;class R6{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new uz,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 r of n)this.queue.push(r);(ie.ie&&ie.ie_version<=11||ie.ios&&e.composing)&&n.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&ie.android&&e.constructor.EDIT_CONTEXT!==!1&&!(ie.chrome&&ie.chrome_version<126)&&(this.editContext=new L6(e),e.state.facet(Fr)&&(e.contentDOM.editContext=this.editContext.editContext)),jp&&(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,r)=>n!=e[r]))){this.gapIntersection.disconnect();for(let n of e)this.gapIntersection.observe(n);this.gaps=e}}onSelectionChange(e){let n=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Fr)?r.root.activeElement!=this.dom:!rl(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){n||(this.selectionChanged=!1);return}(ie.ie&&ie.ie_version<=11||ie.android&&ie.chrome)&&!r.state.selection.main.empty&&i.focusNode&&sl(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,n=Hl(e.root);if(!n)return!1;let r=ie.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&M6(this.view,n)||n;if(!r||this.selectionRange.eq(r))return!1;let i=rl(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&dz(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,n){this.selectionRange.set(e.node,e.offset,n.node,n.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,n=null;for(let r=this.dom;r;)if(r.nodeType==1)!n&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:n||(n=this.scrollTargets.slice(0,e)),n&&n.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!n&&(n=this.scrollTargets.slice(0,e)),n){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=n)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,Q6),jp&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),jp&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,n){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&No(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:n,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let n=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),n==-1?{from:n,to:r}=o:(n=Math.min(o.from,n),r=Math.max(o.to,r)))}return{from:n,to:r,typeOver:i}}readChange(){let{from:e,to:n,typeOver:r}=this.processRecords(),i=this.selectionChanged&&rl(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Jz(this.view,e,n,r);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 r=this.view.state,i=q_(this.view,n);return this.view.state==r&&(n.domChanged||n.newSel&&!dd(this.view.state.selection,n.newSel.main))&&this.view.update([]),i}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 r=Dw(n,e.previousSibling||e.target.previousSibling,-1),i=Dw(n,e.nextSibling||e.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),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(Fr)!=e.state.facet(Fr)&&(e.view.contentDOM.editContext=e.state.facet(Fr)?this.editContext.editContext:null))}destroy(){var e,n,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Dw(t,e,n){for(;e;){let r=We.get(e);if(r&&r.parent==t)return r;let i=e.parentNode;e=i!=t.dom?i:n>0?e.nextSibling:e.previousSibling}return null}function Zw(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return sl(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function M6(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Zw(t,i)}let n=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",r,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",r,!0),n?Zw(t,n):null}class L6{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=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&s<this.from?a=s:l==this.to&&s>this.to&&(l=s);let u=K_(e.state.sliceDoc(a,l),r.text,(c?i.from:i.to)-a,c?"end":null);if(!u){let d=W.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));dd(d,i)||e.dispatch({selection:d,userEvent:"select"});return}let f={from:u.from+a,to:u.toA+a,insert:xe.of(r.text.slice(u.from,u.toB).split(`
|
|
73
|
+
`))};if((ie.mac||ie.android)&&f.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:xe.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);Zy(e,f,W.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}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,r.updateRangeStart-1),Math.min(n.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}n.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(le.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:B_.of(le.set(i))})},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:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)n.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let i=Hl(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let n=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(r)return;let u=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,n+=u,this.to+=u;return}else i=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){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}n+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let n=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.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,r=this.toContextPos(Math.max(this.from,Math.min(this.to,n.anchor))),i=this.toContextPos(n.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}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 r=this.composing;return r&&r.drifted?r.editorBase+(e-r.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])}}class ee{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:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||fz(e.parent)||document,this.viewState=new Rw(this,e.state||ye.create(e)),e.scrollTo&&e.scrollTo.is(wu)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(fo).map(i=>new Rp(i));for(let i of this.plugins)i.update(this);this.observer=new R6(this),this.inputState=new r6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new ww(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 et?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(n,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let n=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(iC))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=sC(s,o),l||(a=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(ye.phrases)!=this.state.facet(ye.phrases))return this.setState(s);i=cd.create(this,s,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection,{x:p,y:m}=this.state.facet(ee.cursorScrollMargin);f=new Po(h.empty?h:W.cursor(h.head,h.head>h.anchor?-1:1),"nearest","nearest",m,p)}for(let h of d.effects)h.is(wu)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=pd.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),n=this.docView.update(i),this.state.facet(Za)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Pu)!=i.state.facet(Pu)&&(this.viewState.mustMeasureContent=!0),(n||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),n&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(o0))try{d(i)}catch(h){Ut(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!q_(this,u)&&c.force&&No(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 r of this.plugins)r.destroy(this);this.viewState=new Rw(this,e),this.plugins=e.facet(fo).map(r=>new Rp(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new ww(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(fo),r=e.state.facet(fo);if(n!=r){let i=[];for(let s of r){let o=n.indexOf(s);if(o<0)i.push(new Rp(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);n!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let n=e.value;if(n&&n.docViewUpdate)try{n.docViewUpdate(this)}catch(r){Ut(this.state,r,"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,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(E_(r||this.win))s=-1,o=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);s=h.from,o=h.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(p){return Ut(this.state,p),Vw}}),f=cd.create(this,this.state,[]),d=!1;f.flags|=l,n?n.flags|=l:n=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h<c.length;h++)if(u[h]!=Vw)try{let p=c[h];p.write&&p.write(u[h],this)}catch(p){Ut(this.state,p)}if(d&&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)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+p,r?r.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(n&&!n.empty)for(let a of this.state.facet(o0))a(n)}get themeClasses(){return d0+" "+(this.state.facet(f0)?cC:lC)+" "+this.state.facet(Pu)}updateAttrs(){let e=jw(this,F_,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),n={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Fr)?"true":"false",class:"cm-content",style:`${ie.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(n["aria-readonly"]="true"),jw(this,My,n);let r=this.observer.ignore(()=>{let i=gw(this.contentDOM,this.contentAttrs,n),s=gw(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=n,r}showAnnouncements(e){let n=!0;for(let r of e)for(let i of r.effects)if(i.is(ee.announce)){n&&(this.announceDOM.textContent=""),n=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Za);let e=this.state.facet(ee.cspNonce);Vi.mount(this.root,this.styleModules.concat(I6).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(r=>r.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,r){return Zp(this,e,Sw(this,e,n,r))}moveByGroup(e,n){return Zp(this,e,Sw(this,e,n,r=>Uz(this,e.head,r)))}visualLineSide(e,n){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[n?r.length-1:0];return W.cursor(s.side(n,i)+e.from,s.forward(!n,i)?1:-1)}moveToLineBoundary(e,n,r=!0){return Wz(this,e,n,r)}moveVertically(e,n,r){return Zp(this,e,Yz(this,e,n,r))}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 r=c0(this,e,n);return r&&r.pos}posAndSideAtCoords(e,n=!0){return this.readMeasured(),c0(this,e,n)}coordsAtPos(e,n=1){this.readMeasured();let r=this.docView.coordsAt(e,n);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[br.find(s,e-i.from,-1,n)];return ql(r,o.dir==_e.LTR==n>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Z_)||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>D6)return $_(e.length);let n=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==n&&(s.fresh||C_(s.isolates,r=bw(this,e))))return s.order;r||(r=bw(this,e));let i=bz(e.text,n,r);return this.bidiCache.push(new pd(e.from,e.to,n,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||ie.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{k_(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 r,i,s,o;return wu.of(new Po(typeof e=="number"?W.cursor(e):e,(r=n.y)!==null&&r!==void 0?r:"nearest",(i=n.x)!==null&&i!==void 0?i:"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,r=this.viewState.scrollAnchorAt(e);return wu.of(new Po(W.cursor(r.from),"start","start",r.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 Ue.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Ue.define(()=>({}),{eventObservers:e})}static theme(e,n){let r=Vi.newName(),i=[Pu.of(r),Za.of(h0(`.${r}`,e))];return n&&n.dark&&i.push(f0.of(!0)),i}static baseTheme(e){return Hi.lowest(Za.of(h0("."+d0,e,uC)))}static findFromDOM(e){var n;let r=e.querySelector(".cm-content"),i=r&&We.get(r)||We.get(e);return((n=i==null?void 0:i.root)===null||n===void 0?void 0:n.view)||null}}ee.styleModule=Za;ee.inputHandler=L_;ee.clipboardInputFilter=Qy;ee.clipboardOutputFilter=Ry;ee.scrollHandler=j_;ee.focusChangeEffect=D_;ee.perLineTextDirection=Z_;ee.exceptionSink=M_;ee.updateListener=o0;ee.editable=Fr;ee.mouseSelectionStyle=R_;ee.dragMovesSelection=Q_;ee.clickAddsSelectionRange=I_;ee.decorations=Oh;ee.blockWrappers=X_;ee.outerDecorations=Ly;ee.atomicRanges=$c;ee.bidiIsolatedRanges=z_;ee.cursorScrollMargin=re.define({combine:t=>{let e=5,n=5;for(let r of t)typeof r=="number"?e=n=r:{x:e,y:n}=r;return{x:e,y:n}}});ee.scrollMargins=W_;ee.darkTheme=f0;ee.cspNonce=re.define({combine:t=>t.length?t[0]:""});ee.contentAttributes=My;ee.editorAttributes=F_;ee.lineWrapping=ee.contentAttributes.of({class:"cm-lineWrapping"});ee.announce=he.define();const D6=4096,Vw={};class pd{constructor(e,n,r,i,s,o){this.from=e,this.to=n,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,n){if(n.empty&&!e.some(s=>s.fresh))return e;let r=[],i=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==i&&!n.touchesRange(o.from,o.to)&&r.push(new pd(n.mapPos(o.from,1),n.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function jw(t,e,n){for(let r=t.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(t):s;o&&$y(o,n)}return n}const Z6=ie.mac?"mac":ie.windows?"win":ie.linux?"linux":"key";function V6(t,e){const n=t.split(/-(?!$)/);let r=n[n.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;l<n.length-1;++l){const c=n[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!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"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function _u(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n!==!1&&e.shiftKey&&(t="Shift-"+t),t}const j6=Hi.default(ee.domEventHandlers({keydown(t,e){return dC(fC(e.state),t,e,"editor")}})),Ac=re.define({enables:j6}),Bw=new WeakMap;function fC(t){let e=t.facet(Ac),n=Bw.get(e);return n||Bw.set(e,n=X6(e.reduce((r,i)=>r.concat(i),[]))),n}function B6(t,e,n){return dC(fC(t.state),e,t,n)}let vi=null;const F6=4e3;function X6(t,e=Z6){let n=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,u)=>{var f,d;let h=n[o]||(n[o]=Object.create(null)),p=a.split(/ (?!$)/).map(g=>V6(g,e));for(let g=1;g<p.length;g++){let b=p.slice(0,g).join(" ");i(b,!0),h[b]||(h[b]={preventDefault:!0,stopPropagation:!1,run:[y=>{let v=vi={view:y,prefix:b,scope:o};return setTimeout(()=>{vi==v&&(vi=null)},F6),!0}]})}let m=p.join(" ");i(m,!1);let O=h[m]||(h[m]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&O.run.push(l),c&&(O.preventDefault=!0),u&&(O.stopPropagation=!0)};for(let o of t){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=n[c]||(n[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in u)u[d].run.push(h=>f(h,p0))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return n}let p0=null;function dC(t,e,n,r){p0=e;let i=iz(e),s=jt(i,0),o=Or(s)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;vi&&vi.view==n&&vi.scope==r&&(a=vi.prefix+" ",eC.indexOf(e.keyCode)<0&&(c=!0,vi=null));let f=new Set,d=O=>{if(O){for(let g of O.run)if(!f.has(g)&&(f.add(g),g(n)))return O.stopPropagation&&(u=!0),!0;O.preventDefault&&(O.stopPropagation&&(u=!0),c=!0)}return!1},h=t[r],p,m;return h&&(d(h[a+_u(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(ie.windows&&e.ctrlKey&&e.altKey)&&!(ie.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=ji[e.keyCode])&&p!=i?(d(h[a+_u(p,e,!0)])||e.shiftKey&&(m=Yl[e.keyCode])!=i&&m!=p&&d(h[a+_u(m,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(h[a+_u(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),p0=null,l}class bs{constructor(e,n,r,i,s){this.className=e,this.left=n,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,n){return n.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,n,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=hC(e);return[new bs(n,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return z6(e,n,r)}}function hC(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==_e.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Fw(t,e,n,r){let i=t.coordsAtPos(e,n*2);if(!i)return r;let s=t.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=t.posAtCoords({x:s.left+1,y:o}),l=t.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function z6(t,e,n){if(n.to<=t.viewport.from||n.from>=t.viewport.to)return[];let r=Math.max(n.from,t.viewport.from),i=Math.min(n.to,t.viewport.to),s=t.textDirection==_e.LTR,o=t.contentDOM,a=o.getBoundingClientRect(),l=hC(t),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),h=l0(t,r,1),p=l0(t,i,-1),m=h.type==xt.Text?h:null,O=p.type==xt.Text?p:null;if(m&&(t.lineWrapping||h.widgetLineBreaks)&&(m=Fw(t,r,1,m)),O&&(t.lineWrapping||p.widgetLineBreaks)&&(O=Fw(t,i,-1,O)),m&&O&&m.from==O.from&&m.to==O.to)return b(y(n.from,n.to,m));{let S=m?y(n.from,null,m):v(h,!1),E=O?y(null,n.to,O):v(p,!0),w=[];return(m||h).to<(O||p).from-(m&&O?1:0)||h.widgetLineBreaks>1&&S.bottom+t.defaultLineHeight/2<E.top?w.push(g(f,S.bottom,d,E.top)):S.bottom<E.top&&t.elementAtHeight((S.bottom+E.top)/2).type==xt.Text&&(S.bottom=E.top=(S.bottom+E.top)/2),b(S).concat(w).concat(b(E))}function g(S,E,w,k){return new bs(e,S-l.left,E-l.top,Math.max(0,w-S),k-E)}function b({top:S,bottom:E,horizontal:w}){let k=[];for(let N=0;N<w.length;N+=2)k.push(g(w[N],S,w[N+1],E));return k}function y(S,E,w){let k=1e9,N=-1e9,$=[];function C(P,M,R,L,I){let A=t.coordsAtPos(P,P==w.to?-2:2),D=t.coordsAtPos(R,R==w.from?2:-2);!A||!D||(k=Math.min(A.top,D.top,k),N=Math.max(A.bottom,D.bottom,N),I==_e.LTR?$.push(s&&M?f:A.left,s&&L?d:D.right):$.push(!s&&L?f:D.left,!s&&M?d:A.right))}let _=S??w.from,V=E??w.to;for(let P of t.visibleRanges)if(P.to>_&&P.from<V)for(let M=Math.max(P.from,_),R=Math.min(P.to,V);;){let L=t.state.doc.lineAt(M);for(let I of t.bidiSpans(L)){let A=I.from+L.from,D=I.to+L.from;if(A>=R)break;D>M&&C(Math.max(A,M),S==null&&A<=_,Math.min(D,R),E==null&&D>=V,I.dir)}if(M=L.to+1,M>=R)break}return $.length==0&&C(_,S==null,V,E==null,t.textDirection),{top:k,bottom:N,horizontal:$}}function v(S,E){let w=a.top+(E?S.top:S.bottom);return{top:w,bottom:w,horizontal:[]}}}function W6(t,e){return t.constructor==e.constructor&&t.eq(e)}class U6{constructor(e,n){this.view=e,this.layer=n,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,e)}update(e){e.startState.facet(ff)!=e.state.facet(ff)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let n=0,r=e.facet(ff);for(;n<r.length&&r[n]!=this.layer;)n++;this.dom.style.zIndex=String((this.layer.above?150:-1)-n)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:n}=this.view;(e!=this.scaleX||n!=this.scaleY)&&(this.scaleX=e,this.scaleY=n,this.dom.style.transform=`scale(${1/e}, ${1/n})`)}draw(e){if(e.length!=this.drawn.length||e.some((n,r)=>!W6(n,this.drawn[r]))){let n=this.dom.firstChild,r=0;for(let i of e)i.update&&n&&i.constructor&&this.drawn[r].constructor&&i.update(n,this.drawn[r])?(n=n.nextSibling,r++):this.dom.insertBefore(i.draw(),n);for(;n;){let i=n.nextSibling;n.remove(),n=i}this.drawn=e,ie.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const ff=re.define();function pC(t){return[Ue.define(e=>new U6(e,t)),ff.of(t)]}const ta=re.define({combine(t){return $r(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,n)=>Math.min(e,n),drawRangeCursor:(e,n)=>e||n})}});function Y6(t={}){return[ta.of(t),G6,H6,q6,V_.of(!0)]}function mC(t){return t.startState.facet(ta)!=t.state.facet(ta)}const G6=pC({above:!0,markers(t){let{state:e}=t,n=e.facet(ta),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||n.drawRangeCursor&&!(s&&ie.ios&&n.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:W.cursor(i.head,i.assoc);for(let l of bs.forRange(t,o,a))r.push(l)}}return r},update(t,e){t.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let n=mC(t);return n&&Xw(t.state,e),t.docChanged||t.selectionSet||n},mount(t,e){Xw(e.state,t)},class:"cm-cursorLayer"});function Xw(t,e){e.style.animationDuration=t.facet(ta).cursorBlinkRate+"ms"}const H6=pC({above:!1,markers(t){let e=[],{main:n,ranges:r}=t.state.selection;for(let i of r)if(!i.empty)for(let s of bs.forRange(t,"cm-selectionBackground",i))e.push(s);if(ie.ios&&!n.empty&&t.state.facet(ta).iosSelectionHandles){for(let i of bs.forRange(t,"cm-selectionHandle cm-selectionHandle-start",W.cursor(n.from,1)))e.push(i);for(let i of bs.forRange(t,"cm-selectionHandle cm-selectionHandle-end",W.cursor(n.to,1)))e.push(i)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||mC(t)},class:"cm-selectionLayer"}),q6=Hi.highest(ee.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),gC=he.define({map(t,e){return t==null?null:e.mapPos(t)}}),ja=wt.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((n,r)=>r.is(gC)?r.value:n,t)}}),K6=Ue.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let n=t.state.field(ja);n==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(ja)!=n||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(ja),n=e!=null&&t.coordsAtPos(e);if(!n)return null;let r=t.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+t.scrollDOM.scrollLeft*t.scaleX,top:n.top-r.top+t.scrollDOM.scrollTop*t.scaleY,height:n.bottom-n.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:n}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/n+"px",this.cursor.style.height=t.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(ja)!=t&&this.view.dispatch({effects:gC.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function J6(){return[ja,K6]}function zw(t,e,n,r,i){e.lastIndex=0;for(let s=t.iterRange(n,r),o=n,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function e9(t,e){let n=t.visibleRanges;if(n.length==1&&n[0].from==t.viewport.from&&n[0].to==t.viewport.to)return n;let r=[];for(let{from:i,to:s}of n)i=Math.max(t.state.doc.lineAt(i).from,i-e),s=Math.min(t.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class t9{constructor(e){const{regexp:n,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let f=r(a,l,c);f&&u(c,c+a[0].length,f)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let n=new ti,r=n.add.bind(n);for(let{from:i,to:s}of e9(e,this.maxLength))zw(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return n.finish()}updateDeco(e,n){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,n.map(e.changes),r,i):n}updateRange(e,n,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>=o){let l=e.state.doc.lineAt(o),c=l.to<a?e.state.doc.lineAt(a):l,u=Math.max(s.from,l.from),f=Math.min(s.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){f=a;break}}let d=[],h,p=(m,O,g)=>d.push(g.range(m,O));if(l==c)for(this.regexp.lastIndex=u-l.from;(h=this.regexp.exec(l.text))&&h.index<f-l.from;)this.addMatch(h,e,h.index+l.from,p);else zw(e.state.doc,this.regexp,u,f,(m,O)=>this.addMatch(O,e,m,p));n=n.update({filterFrom:u,filterTo:f,filter:(m,O)=>m<u||O>f,add:d})}}return n}}const m0=/x/.unicode!=null?"gu":"g",n9=new RegExp(`[\0-\b
|
|
74
|
+
--\u2028\u2029\uFEFF-]`,m0),r9={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Bp=null;function i9(){var t;if(Bp==null&&typeof document<"u"&&document.body){let e=document.body.style;Bp=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Bp||!1}const df=re.define({combine(t){let e=$r(t,{render:null,specialChars:n9,addSpecialChars:null});return(e.replaceTabs=!i9())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,m0)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,m0)),e}});function s9(t={}){return[df.of(t),o9()]}let Ww=null;function o9(){return Ww||(Ww=Ue.fromClass(class{constructor(t){this.view=t,this.decorations=le.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(df)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new t9({regexp:t.specialChars,decoration:(e,n,r)=>{let{doc:i}=n.state,s=jt(e[0],0);if(s==9){let o=i.lineAt(r),a=n.state.tabSize,l=ca(o.text,a,r-o.from);return le.replace({widget:new u9((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=le.replace({widget:new c9(t,s)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(df);t.startState.facet(df)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const a9="•";function l9(t){return t>=32?a9:t==10?"":String.fromCharCode(9216+t)}class c9 extends tr{constructor(e,n){super(),this.options=e,this.code=n}eq(e){return e.code==this.code}toDOM(e){let n=l9(this.code),r=e.state.phrase("Control character")+" "+(r9[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,n);if(i)return i;let s=document.createElement("span");return s.textContent=n,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class u9 extends tr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function f9(){return h9}const d9=le.line({class:"cm-activeLine"}),h9=Ue.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=-1,n=[];for(let r of t.state.selection.ranges){let i=t.lineBlockAt(r.head);i.from>e&&(n.push(d9.range(i.from)),e=i.from)}return le.set(n)}},{decorations:t=>t.decorations});class p9 extends tr{constructor(e){super(),this.content=e}toDOM(e){let n=document.createElement("span");return n.className="cm-placeholder",n.style.pointerEvents="none",n.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),n.setAttribute("aria-hidden","true"),n}coordsAt(e){let n=e.firstChild?il(e.firstChild):[];if(!n.length)return null;let r=window.getComputedStyle(e.parentNode),i=ql(n[0],r.direction!="rtl"),s=parseInt(r.lineHeight);return i.bottom-i.top>s*1.5?{left:i.left,right:i.right,top:i.top,bottom:i.top+s}:i}ignoreEvent(){return!1}}function m9(t){let e=Ue.fromClass(class{constructor(n){this.view=n,this.placeholder=t?le.set([le.widget({widget:new p9(t),side:1}).range(0)]):le.none}get decorations(){return this.view.state.doc.length?le.none:this.placeholder}},{decorations:n=>n.decorations});return typeof t=="string"?[e,ee.contentAttributes.of({"aria-placeholder":t})]:e}const g0=2e3;function g9(t,e,n){let r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),s=[];if(e.off>g0||n.off>g0||e.col<0||n.col<0){let o=Math.min(e.off,n.off),a=Math.max(e.off,n.off);for(let l=r;l<=i;l++){let c=t.doc.line(l);c.length<=a&&s.push(W.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,n.col),a=Math.max(e.col,n.col);for(let l=r;l<=i;l++){let c=t.doc.line(l),u=Gg(c.text,o,t.tabSize,!0);if(u<0)s.push(W.cursor(c.to));else{let f=Gg(c.text,a,t.tabSize);s.push(W.range(c.from+u,c.from+f))}}}return s}function O9(t,e){let n=t.coordsAtPos(t.viewport.from);return n?Math.round(Math.abs((n.left-e)/t.defaultCharacterWidth)):-1}function Uw(t,e){let n=t.posAtCoords({x:e.clientX,y:e.clientY},!1),r=t.state.doc.lineAt(n),i=n-r.from,s=i>g0?-1:i==r.length?O9(t,e.clientX):ca(r.text,t.state.tabSize,n-r.from);return{line:r.number,col:s,off:i}}function y9(t,e){let n=Uw(t,e),r=t.state.selection;return n?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(n.line).from),o=i.state.doc.lineAt(s);n={line:o.number,col:n.col,off:Math.min(n.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let a=Uw(t,i);if(!a)return r;let l=g9(t.state,n,a);return l.length?o?W.create(l.concat(r.ranges)):W.create(l):r}}:null}function b9(t){let e=n=>n.altKey&&n.button==0;return ee.mouseSelectionStyle.of((n,r)=>e(r)?y9(n,r):null)}const x9={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},v9={style:"cursor: crosshair"};function w9(t={}){let[e,n]=x9[t.key||"Alt"],r=Ue.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||n(i))},keyup(i){(i.keyCode==e||!n(i))&&this.set(!1)},mousemove(i){this.set(n(i))}}});return[r,ee.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?v9:null})]}const Cu="-10000px";class OC{constructor(e,n,r,i){this.facet=n,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(n),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,n){var r;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=n?[]:null;for(let l=0;l<s.length;l++){let c=s[l],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let d=this.tooltips[f];d&&d.create==c.create&&(u=f)}if(u<0)o[l]=this.createTooltipView(c,l?o[l-1]:null),a&&(a[l]=!!c.above);else{let f=o[l]=this.tooltipViews[u];a&&(a[l]=n[u]),f.update&&f.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return n&&(a.forEach((l,c)=>n[c]=l),n.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function S9(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Fp=re.define({combine:t=>{var e,n,r;return{position:ie.ios?"absolute":((e=t.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((n=t.find(i=>i.parent))===null||n===void 0?void 0:n.parent)||null,tooltipSpace:((r=t.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||S9}}}),Yw=new WeakMap,By=Ue.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(Fp);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 OC(t,Fy,(n,r)=>this.createTooltip(n,r),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,r=t.state.facet(Fp);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;n=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(t,e){let n=t.create(this.view),r=e?e.dom:null;if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",n.dom.appendChild(i)}return n.dom.style.position=this.position,n.dom.style.top=Cu,n.dom.style.left="0px",this.container.insertBefore(n.dom,r),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 r of this.manager.tooltipViews)r.dom.remove(),(t=r.destroy)===null||t===void 0||t.call(r);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(ie.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 r=this.view.scrollDOM.getBoundingClientRect(),i=Dy(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Fp).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:n}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:n,space:r,scaleX:i,scaleY:s}=t,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,f=t.pos[a],d=t.size[a];if(!f||l.clip!==!1&&(f.bottom<=Math.max(n.top,r.top)||f.top>=Math.min(n.bottom,r.bottom)||f.right<Math.max(n.left,r.left)-.1||f.left>Math.min(n.right,r.right)+.1)){u.style.top=Cu;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,p=h?7:0,m=d.right-d.left,O=(e=Yw.get(c))!==null&&e!==void 0?e:d.bottom-d.top,g=c.offset||E9,b=this.view.textDirection==_e.LTR,y=d.width>r.right-r.left?b?r.left:r.right-d.width:b?Math.max(r.left,Math.min(f.left-(h?14:0)+g.x,r.right-m)):Math.min(Math.max(r.left,f.left-m+(h?14:0)-g.x),r.right-m),v=this.above[a];!l.strictSide&&(v?f.top-O-p-g.y<r.top:f.bottom+O+p+g.y>r.bottom)&&v==r.bottom-f.bottom>f.top-r.top&&(v=this.above[a]=!v);let S=(v?f.top-r.top:r.bottom-f.bottom)-p;if(S<O&&c.resize!==!1){if(S<this.view.defaultLineHeight){u.style.top=Cu;continue}Yw.set(c,O),u.style.height=(O=S)/s+"px"}else u.style.height&&(u.style.height="");let E=v?f.top-O-p-g.y:f.bottom+p+g.y,w=y+m;if(c.overlap!==!0)for(let k of o)k.left<w&&k.right>y&&k.top<E+O&&k.bottom>E&&(E=v?k.top-O-2-p:k.bottom+p+2);if(this.position=="absolute"?(u.style.top=(E-t.parent.top)/s+"px",Gw(u,(y-t.parent.left)/i)):(u.style.top=E/s+"px",Gw(u,y/i)),h){let k=f.left+(b?g.x:-g.x)-(y+14-7);h.style.left=k/i+"px"}c.overlap!==!0&&o.push({left:y,top:E,right:w,bottom:E+O}),u.classList.toggle("cm-tooltip-above",v),u.classList.toggle("cm-tooltip-below",!v),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=Cu}},{eventObservers:{scroll(){this.maybeMeasure()}}});function Gw(t,e){let n=parseInt(t.style.left,10);(isNaN(n)||Math.abs(e-n)>1)&&(t.style.left=e+"px")}const k9=ee.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:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),E9={x:0,y:0},Fy=re.define({enables:[By,k9]}),md=re.define({combine:t=>t.reduce((e,n)=>e.concat(n),[])});class vh{static create(e){return new vh(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new OC(e,md,(n,r)=>this.createHostedView(n,r),n=>n.dom.remove())}createHostedView(e,n){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,n?n.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let n of this.manager.tooltipViews)n.mount&&n.mount(e);this.mounted=!0}positioned(e){for(let n of this.manager.tooltipViews)n.positioned&&n.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let n of this.manager.tooltipViews)(e=n.destroy)===null||e===void 0||e.call(n)}passProp(e){let n;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(n===void 0)n=i;else if(n!==i)return}}return n}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const T9=Fy.compute([md],t=>{let e=t.facet(md);return e.length===0?null:{pos:Math.min(...e.map(n=>n.pos)),end:Math.max(...e.map(n=>{var r;return(r=n.end)!==null&&r!==void 0?r:n.pos})),create:vh.create,above:e[0].above,arrow:e.some(n=>n.arrow)}}),yC=re.define();class N9{constructor(e,n,r,i,s,o){this.view=e,this.source=n,this.field=r,this.locked=i,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,r=e.docView.tile.nearest(n.target);if(!r)return;let i,s=1;if(r.isWidget())i=r.posAtStart;else{if(i=e.posAtCoords(n),i==null)return;let o=e.coordsAtPos(i);if(!o||n.y<o.top||n.y>o.bottom||n.x<o.left-e.defaultCharacterWidth||n.x>o.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),l=a&&a.dir==_e.RTL?-1:1;s=n.x<o.left?-l:l}this.activateHover(e,i,s)}activateHover(e,n,r,i){let s=this.source(e,n,r),o=a=>{if(a&&!(Array.isArray(a)&&!a.length)){let l=Array.isArray(a)?a:[a];i&&this.locked.set(l,i),e.dispatch({effects:this.setHover.of(l)})}};if(s&&"then"in s){let a=this.pending={pos:n};s.then(l=>{this.pending==a&&(this.pending=null,o(l))},l=>Ut(e.state,l,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(By),n=e?e.manager.tooltips.findIndex(r=>r.create==vh.create):-1;return n>-1?e.manager.tooltipViews[n]:null}mousemove(e){var n,r;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:i,tooltip:s}=this;if(i.length&&!this.locked.has(i)&&s&&!P9(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(r=(n=i[0])===null||n===void 0?void 0:n.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!_9(this.view,o,a,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:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let n=r=>{e.removeEventListener("mouseleave",n);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(r.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)}}const $u=4;function P9(t,e){let{left:n,right:r,top:i,bottom:s}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=n-$u&&e.clientX<=r+$u&&e.clientY>=i-$u&&e.clientY<=s+$u}function _9(t,e,n,r,i,s){let o=t.scrollDOM.getBoundingClientRect(),a=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,a)<i)return!1;let l=t.posAtCoords({x:r,y:i},!1);return l>=e&&l<=n}function C9(t,e={}){let n=he.define(),r=new WeakMap,i=wt.define({create(){return[]},update(o,a){let l=r.get(o);if(o.length&&(e.hideOnChange&&(a.docChanged||a.selection)?o=[]:l&&l(a)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(a,c)))),a.docChanged&&o.length){let c=[];for(let u of o){let f=a.changes.mapPos(u.pos,-1,yt.TrackDel);if(f!=null){let d=Object.assign(Object.create(null),u);d.pos=f,d.end!=null&&(d.end=a.changes.mapPos(d.end)),c.push(d)}}o=c}for(let c of a.effects)c.is(n)&&(o=c.value,l=void 0),(c.is(A9)&&!c.value||c.value==i)&&(o=[]);return o.length&&l&&r.set(o,l),o},provide:o=>md.from(o)});const s=Ue.define(o=>new N9(o,t,i,r,n,e.hoverTime||300));return{active:i,extension:[i,s,yC.of(s),T9]}}function $9(t,e,n,r={}){var i;let s=t.state.facet(yC).map(o=>t.plugin(o)).filter(o=>!!o);if(r.tooltip&&r.tooltip.active){let o=s.find(a=>a.field==r.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(t,e,n,(i=r.until)!==null&&i!==void 0?i:()=>!1)}function bC(t,e){let n=t.plugin(By);if(!n)return null;let r=n.manager.tooltips.indexOf(e);return r<0?null:n.manager.tooltipViews[r]}const A9=he.define(),Hw=re.define({combine(t){let e,n;for(let r of t)e=e||r.topContainer,n=n||r.bottomContainer;return{topContainer:e,bottomContainer:n}}});function Xy(t,e){let n=t.plugin(xC),r=n?n.specs.indexOf(e):-1;return r>-1?n.panels[r]:null}const xC=Ue.fromClass(class{constructor(t){this.input=t.state.facet(Jl),this.specs=this.input.filter(n=>n),this.panels=this.specs.map(n=>n(t));let e=t.state.facet(Hw);this.top=new Au(t,!0,e.topContainer),this.bottom=new Au(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(Hw);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Au(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Au(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=t.state.facet(Jl);if(n!=this.input){let r=n.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(t.view),a.push(u)):(u=this.panels[c],u.update&&u.update(t)),i.push(u),(u.top?s:o).push(u)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ee.scrollMargins.of(e=>{let n=e.plugin(t);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}})});class Au{constructor(e,n,r){this.view=e,this.top=n,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let n of this.panels)n.destroy&&e.indexOf(n)<0&&n.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let n=this.container||this.view.dom;n.insertBefore(this.dom,this.top?n.firstChild:null)}let e=this.dom.firstChild;for(let n of this.panels)if(n.dom.parentNode==this.dom){for(;e!=n.dom;)e=qw(e);e=e.nextSibling}else this.dom.insertBefore(n.dom,e);for(;e;)e=qw(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 qw(t){let e=t.nextSibling;return t.remove(),e}const Jl=re.define({enables:xC});function I9(t,e){let n,r=new Promise(o=>n=o),i=o=>Q9(o,e,n);t.state.field(Xp,!1)?t.dispatch({effects:vC.of(i)}):t.dispatch({effects:he.appendConfig.of(Xp.init(()=>[i]))});let s=wC.of(i);return{close:s,result:r.then(o=>((t.win.queueMicrotask||(l=>t.win.setTimeout(l,10)))(()=>{t.state.field(Xp).indexOf(i)>-1&&t.dispatch({effects:s})}),o))}}const Xp=wt.define({create(){return[]},update(t,e){for(let n of e.effects)n.is(vC)?t=[n.value].concat(t):n.is(wC)&&(t=t.filter(r=>r!=n.value));return t},provide:t=>Jl.computeN([t],e=>e.field(t))}),vC=he.define(),wC=he.define();function Q9(t,e,n){let r=e.content?e.content(t,()=>o(null)):null;if(!r){if(r=Te("form"),e.input){let a=Te("input",e.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(Te("label",(e.label||"")+": ",a))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(Te("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a<i.length;a++){let l=i[a];l.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(l))}),l.addEventListener("submit",c=>{c.preventDefault(),o(l)})}let s=Te("div",r,Te("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(a){s.contains(s.ownerDocument.activeElement)&&t.focus(),n(a)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let a;typeof e.focus=="string"?a=r.querySelector(e.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class ri extends Zi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ri.prototype.elementClass="";ri.prototype.toDOM=void 0;ri.prototype.mapMode=yt.TrackBefore;ri.prototype.startSide=ri.prototype.endSide=-1;ri.prototype.point=!0;const hf=re.define(),R9=re.define(),M9={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ge.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},al=re.define();function L9(t){return[SC(),al.of({...M9,...t})]}const Kw=re.define({combine:t=>t.some(e=>e)});function SC(t){return[D9]}const D9=Ue.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(al).map(e=>new eS(t,e)),this.fixed=!t.state.facet(Kw);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,r=Math.min(e.to,n.to)-Math.max(e.from,n.from);this.syncGutters(r<(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(Kw)!=!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=ge.iter(this.view.state.facet(hf),this.view.viewport.from),r=[],i=this.gutters.map(s=>new Z9(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==xt.Text&&o){O0(n,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==xt.Text){O0(n,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)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(al),n=t.state.facet(al),r=t.docChanged||t.heightChanged||t.viewportChanged||!ge.eq(t.startState.facet(hf),t.state.facet(hf),t.view.viewport.from,t.view.viewport.to);if(e==n)for(let i of this.gutters)i.update(t)&&(r=!0);else{r=!0;let i=[];for(let s of n){let o=e.indexOf(s);o<0?i.push(new eS(this.view,s)):(this.gutters[o].update(t),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ee.scrollMargins.of(e=>{let n=e.plugin(t);if(!n||n.gutters.length==0||!n.fixed)return null;let r=n.dom.offsetWidth*e.scaleX,i=n.domAfter?n.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==_e.LTR?{left:r,right:i}:{right:r,left:i}})});function Jw(t){return Array.isArray(t)?t:[t]}function O0(t,e,n){for(;t.value&&t.from<=n;)t.from==n&&e.push(t.value),t.next()}class Z9{constructor(e,n,r){this.gutter=e,this.height=r,this.i=0,this.cursor=ge.iter(e.markers,n.from)}addElement(e,n,r){let{gutter:i}=this,s=(n.top-this.height)/e.scaleY,o=n.height/e.scaleY;if(this.i==i.elements.length){let a=new kC(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=n.bottom,this.i++}line(e,n,r){let i=[];O0(this.cursor,i,n.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,n,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,n,i)}widget(e,n){let r=this.gutter.config.widgetMarker(e,n.widget,n),i=r?[r]:null;for(let s of e.state.facet(R9)){let o=s(e,n.widget,n);o&&(i||(i=[])).push(o)}i&&this.addElement(e,n,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let n=e.elements.pop();e.dom.removeChild(n.dom),n.destroy()}}}class eS{constructor(e,n){this.view=e,this.config=n,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in n.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);n.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Jw(n.markers(e)),n.initialSpacer&&(this.spacer=new kC(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=Jw(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!ge.eq(this.markers,n,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class kC{constructor(e,n,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,n,r,i)}update(e,n,r,i){this.height!=n&&(this.height=n,this.dom.style.height=n+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),V9(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,n){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<n.length?n[s++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(l)){a=f,c=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=r,this.markers=n}destroy(){this.setMarkers(null,[])}}function V9(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].compare(e[n]))return!1;return!0}const j9=re.define(),B9=re.define(),ho=re.define({combine(t){return $r(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,n){let r=Object.assign({},e);for(let i in n){let s=r[i],o=n[i];r[i]=s?(a,l,c)=>s(a,l,c)||o(a,l,c):o}return r}})}});class zp extends ri{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Wp(t,e){return t.state.facet(ho).formatNumber(e,t.state)}const F9=al.compute([ho],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(j9)},lineMarker(e,n,r){return r.some(i=>i.toDOM)?null:new zp(Wp(e,e.state.doc.lineAt(n.from).number))},widgetMarker:(e,n,r)=>{for(let i of e.state.facet(B9)){let s=i(e,n,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(ho)!=e.state.facet(ho),initialSpacer(e){return new zp(Wp(e,tS(e.state.doc.lines)))},updateSpacer(e,n){let r=Wp(n.view,tS(n.view.state.doc.lines));return r==e.number?e:new zp(r)},domEventHandlers:t.facet(ho).domEventHandlers,side:"before"}));function X9(t={}){return[ho.of(t),SC(),F9]}function tS(t){let e=9;for(;e<t;)e=e*10+9;return e}const z9=new class extends ri{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},W9=hf.compute(["selection"],t=>{let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.head).from;i>n&&(n=i,e.push(z9.range(i)))}return ge.of(e)});function U9(){return W9}const EC=1024;let Y9=0;class Up{constructor(e,n){this.from=e,this.to=n}}class me{constructor(e={}){this.id=Y9++,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=en.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}me.closedBy=new me({deserialize:t=>t.split(" ")});me.openedBy=new me({deserialize:t=>t.split(" ")});me.group=new me({deserialize:t=>t.split(" ")});me.isolate=new me({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});me.contextHash=new me({perNode:!0});me.lookAhead=new me({perNode:!0});me.mounted=new me({perNode:!0});class ll{constructor(e,n,r,i=!1){this.tree=e,this.overlay=n,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[me.mounted.id]}}const G9=Object.create(null);class en{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):G9,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new en(e.name||"",n,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),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 i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(me.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(me.group),s=-1;s<(i?i.length:0);s++){let o=n[s<0?r.name:i[s]];if(o)return o}}}}en.none=new en("",Object.create(null),0,8);class zy{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let a=o[1],l=o[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}n.push(i?new en(r.name,i,r.id,r.flags):r)}return new zy(n)}}const Iu=new WeakMap,nS=new WeakMap;var Ve;(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"})(Ve||(Ve={}));class Ke{constructor(e,n,r,i,s){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=ll.get(this);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new b0(this.topNode,e)}cursorAt(e,n=0,r=0){let i=Iu.get(this)||this.topNode,s=new b0(i);return s.moveTo(e,n),Iu.set(this,s._tree),s}get topNode(){return new Kt(this,0,0,null)}resolve(e,n=0){let r=ec(Iu.get(this)||this.topNode,e,n,!1);return Iu.set(this,r),r}resolveInner(e,n=0){let r=ec(nS.get(this)||this.topNode,e,n,!0);return nS.set(this,r),r}resolveStack(e,n=0){return K9(this,e,n)}iterate(e){let{enter:n,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&Ve.IncludeAnonymous)>0;for(let l=this.cursor(o|Ve.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||n(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.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:Yy(en.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new Ke(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new Ke(en.none,n,r,i)))}static build(e){return J9(e)}}Ke.empty=new Ke(en.none,[],[],0);class Wy{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 Wy(this.buffer,this.index)}}class Fi{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return en.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,n,r,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=n&&!(TC(s,i,o[l+1],o[l+2])&&(a=l,r>0));l=o[l+3]);return a}slice(e,n,r){let i=this.buffer,s=new Uint16Array(n-e),o=0;for(let a=e,l=0;a<n;){s[l++]=i[a++],s[l++]=i[a++]-r;let c=s[l++]=i[a++]-r;s[l++]=i[a++]-e,o=Math.max(o,c)}return new Fi(s,o,this.set)}}function TC(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function ec(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let o=!r&&t instanceof Kt&&t.index<0?null:t.parent;if(!o)return t;t=o}let s=r?0:Ve.IgnoreOverlays;if(r)for(let o=t,a=o.parent;a;o=a,a=o.parent)o instanceof Kt&&o.index<0&&((i=a.enter(e,n,s))===null||i===void 0?void 0:i.from)!=o.from&&(t=a);for(;;){let o=t.enter(e,n,s);if(!o)return t;t=o}}class NC{cursor(e=0){return new b0(this,e)}getChild(e,n=null,r=null){let i=rS(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return rS(this,e,n,r)}resolve(e,n=0){return ec(this,e,n,!1)}resolveInner(e,n=0){return ec(this,e,n,!0)}matchContext(e){return y0(this.parent,e)}enterUnfinishedNodesBefore(e){let n=this.childBefore(e),r=this;for(;n;){let i=n.lastChild;if(!i||i.to!=n.to)break;i.type.isError&&i.from==i.to?(r=n,n=i.prevSibling):n=i}return r}get node(){return this}get next(){return this.parent}}class Kt extends NC{constructor(e,n,r,i){super(),this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=n>0?a.length:-1;e!=c;e+=n){let u=a[e],f=l[e]+o.from,d;if(!(!(s&Ve.EnterBracketed&&u instanceof Ke&&(d=ll.get(u))&&!d.overlay&&d.bracketed&&r>=f&&r<=f+u.length)&&!TC(i,r,f,f+u.length))){if(u instanceof Fi){if(s&Ve.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,r-f,i);if(h>-1)return new xr(new H9(o,u,e,f),null,h)}else if(s&Ve.IncludeAnonymous||!u.type.isAnonymous||Uy(u)){let h;if(!(s&Ve.IgnoreMounts)&&(h=ll.get(u))&&!h.overlay)return new Kt(h.tree,f,e,o);let p=new Kt(u,f,e,o);return s&Ve.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(n<0?u.children.length-1:0,n,r,i,s)}}}if(s&Ve.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,r=0){let i;if(!(r&Ve.IgnoreOverlays)&&(i=ll.get(this._tree))&&i.overlay){let s=e-this.from,o=r&Ve.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((n>0||o?a<=s:a<s)&&(n<0||o?l>=s:l>s))return new Kt(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function rS(t,e,n,r){let i=t.cursor(),s=[];if(!i.firstChild())return s;if(n!=null){for(let o=!1;!o;)if(o=i.type.is(n),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function y0(t,e,n=e.length-1){for(let r=t;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class H9{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class xr extends NC{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,n,r){super(),this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,n,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return s<0?null:new xr(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,r=0){if(r&Ve.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return s<0?null:new xr(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 xr(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 xr(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),n.push(0)}return new Ke(this.type,e,n,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function PC(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 r=n instanceof Kt&&n.index<0?null:n.parent,i=t.slice();return r?i[e]=r:i.splice(e,1),new q9(i,n)}class q9{constructor(e,n){this.heads=e,this.node=n}get next(){return PC(this.heads)}}function K9(t,e,n){let r=t.resolveInner(e,n),i=null;for(let s=r instanceof Kt?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,n)),s=o}else{let o=ll.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new Kt(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(ec(a,e,n,!1))}}return i?PC(i):r}class b0{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&~Ve.EnterBracketed,e instanceof Kt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Kt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);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,r=this.mode){return this.buffer?r&Ve.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ve.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ve.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let s=n+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&Ve.IncludeAnonymous||a instanceof Fi||!a.type.isAnonymous||Uy(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;n=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)n=new xr(this.buffer,n,this.stack[i]);return this.bufferNode=new xr(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&n&&n(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return y0(this.node.parent,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return y0(this._tree,e,i);let o=r[n.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function Uy(t){return t.children.some(e=>e instanceof Fi||!e.type.isAnonymous||Uy(e))}function J9(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=EC,reused:s=[],minRepeatType:o=r.types.length}=t,a=Array.isArray(n)?new Wy(n,n.length):n,l=r.types,c=0,u=0;function f(S,E,w,k,N,$){let{id:C,start:_,end:V,size:P}=a,M=u,R=c;if(P<0)if(a.next(),P==-1){let B=s[C];w.push(B),k.push(_-S);return}else if(P==-3){c=C;return}else if(P==-4){u=C;return}else throw new RangeError(`Unrecognized record size: ${P}`);let L=l[C],I,A,D=_-S;if(V-_<=i&&(A=O(a.pos-E,N))){let B=new Uint16Array(A.size-A.skip),F=a.pos-A.size,q=B.length;for(;a.pos>F;)q=g(A.start,B,q);I=new Fi(B,V-A.start,r),D=A.start-S}else{let B=a.pos-P;a.next();let F=[],q=[],j=C>=o?C:-1,H=0,G=V;for(;a.pos>B;)j>=0&&a.id==j&&a.size>=0?(a.end<=G-i&&(p(F,q,_,H,a.end,G,j,M,R),H=F.length,G=a.end),a.next()):$>2500?d(_,B,F,q):f(_,B,F,q,j,$+1);if(j>=0&&H>0&&H<F.length&&p(F,q,_,H,_,G,j,M,R),F.reverse(),q.reverse(),j>-1&&H>0){let ne=h(L,R);I=Yy(L,F,q,0,F.length,0,V-_,ne,ne)}else I=m(L,F,q,V-_,M-V,R)}w.push(I),k.push(D)}function d(S,E,w,k){let N=[],$=0,C=-1;for(;a.pos>E;){let{id:_,start:V,end:P,size:M}=a;if(M>4)a.next();else{if(C>-1&&V<C)break;C<0&&(C=P-i),N.push(_,V,P),$++,a.next()}}if($){let _=new Uint16Array($*4),V=N[N.length-2];for(let P=N.length-3,M=0;P>=0;P-=3)_[M++]=N[P],_[M++]=N[P+1]-V,_[M++]=N[P+2]-V,_[M++]=M;w.push(new Fi(_,N[2]-V,r)),k.push(V-S)}}function h(S,E){return(w,k,N)=>{let $=0,C=w.length-1,_,V;if(C>=0&&(_=w[C])instanceof Ke){if(!C&&_.type==S&&_.length==N)return _;(V=_.prop(me.lookAhead))&&($=k[C]+_.length+V)}return m(S,w,k,N,$,E)}}function p(S,E,w,k,N,$,C,_,V){let P=[],M=[];for(;S.length>k;)P.push(S.pop()),M.push(E.pop()+w-N);S.push(m(r.types[C],P,M,$-N,_-$,V)),E.push(N-w)}function m(S,E,w,k,N,$,C){if($){let _=[me.contextHash,$];C=C?[_].concat(C):[_]}if(N>25){let _=[me.lookAhead,N];C=C?[_].concat(C):[_]}return new Ke(S,E,w,k,C)}function O(S,E){let w=a.fork(),k=0,N=0,$=0,C=w.end-i,_={size:0,start:0,skip:0};e:for(let V=w.pos-S;w.pos>V;){let P=w.size;if(w.id==E&&P>=0){_.size=k,_.start=N,_.skip=$,$+=4,k+=4,w.next();continue}let M=w.pos-P;if(P<0||M<V||w.start<C)break;let R=w.id>=o?4:0,L=w.start;for(w.next();w.pos>M;){if(w.size<0)if(w.size==-3||w.size==-4)R+=4;else break e;else w.id>=o&&(R+=4);w.next()}N=L,k+=P,$+=R}return(E<0||k==S)&&(_.size=k,_.start=N,_.skip=$),_.size>4?_:void 0}function g(S,E,w){let{id:k,start:N,end:$,size:C}=a;if(a.next(),C>=0&&k<o){let _=w;if(C>4){let V=a.pos-(C-4);for(;a.pos>V;)w=g(S,E,w)}E[--w]=_,E[--w]=$-S,E[--w]=N-S,E[--w]=k}else C==-3?c=k:C==-4&&(u=k);return w}let b=[],y=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,b,y,-1,0);let v=(e=t.length)!==null&&e!==void 0?e:b.length?y[0]+b[0].length:0;return new Ke(l[t.topID],b.reverse(),y.reverse(),v)}const iS=new WeakMap;function pf(t,e){if(!t.isAnonymous||e instanceof Fi||e.type!=t)return 1;let n=iS.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof Ke)){n=1;break}n+=pf(t,r)}iS.set(e,n)}return n}function Yy(t,e,n,r,i,s,o,a,l){let c=0;for(let p=r;p<i;p++)c+=pf(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],d=[];function h(p,m,O,g,b){for(let y=O;y<g;){let v=y,S=m[y],E=pf(t,p[y]);for(y++;y<g;y++){let w=pf(t,p[y]);if(E+w>=u)break;E+=w}if(y==v+1){if(E>u){let w=p[v];h(w.children,w.positions,0,w.children.length,m[v]+b);continue}f.push(p[v])}else{let w=m[y-1]+p[y-1].length-S;f.push(Yy(t,p,m,v,y,S,w,null,l))}d.push(S+b-s)}}return h(e,n,r,i,0),(a||l)(f,d,o)}class e8{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof xr?this.setBuffer(e.context.buffer,e.index,n):e instanceof Kt&&this.map.set(e.tree,n)}get(e){return e instanceof xr?this.getBuffer(e.context.buffer,e.index):e instanceof Kt?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class xs{constructor(e,n,r,i,s=!1,o=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,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=[],r=!1){let i=[new xs(0,e.length,e,0,!1,r)];for(let s of n)s.to>e.length&&i.push(s);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;o&&o.from<f;){let d=o;if(l>=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,p=Math.min(d.to,f)-c;d=h>=p?null:new xs(h,p,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class _C{startParse(e,n,r){return typeof e=="string"&&(e=new t8(e)),r=r?r.length?r.map(i=>new Up(i.from,i.to)):[new Up(0,0)]:[new Up(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let s=i.advance();if(s)return s}}}class t8{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)}}new me({perNode:!0});let n8=0;class wn{constructor(e,n,r,i){this.name=e,this.set=n,this.base=r,this.modified=i,this.id=n8++}toString(){let{name:e}=this;for(let n of this.modified)n.name&&(e=`${n.name}(${e})`);return e}static define(e,n){let r=typeof e=="string"?e:"?";if(e instanceof wn&&(n=e),n!=null&&n.base)throw new Error("Can not derive from a modified tag");let i=new wn(r,[],null,[]);if(i.set.push(i),n)for(let s of n.set)i.set.push(s);return i}static defineModifier(e){let n=new gd(e);return r=>r.modified.indexOf(n)>-1?r:gd.get(r.base||r,r.modified.concat(n).sort((i,s)=>i.id-s.id))}}let r8=0;class gd{constructor(e){this.name=e,this.instances=[],this.id=r8++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&i8(n,a.modified));if(r)return r;let i=[],s=new wn(e.name,i,e,n);for(let a of n)a.instances.push(s);let o=s8(n);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(gd.get(a,l));return s}}function i8(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function s8(t){let e=[[]];for(let n=0;n<t.length;n++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(t[n]));return e.sort((n,r)=>r.length-n.length)}function Gy(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let s=[],o=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){o=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new tc(r,o,l>0?s.slice(0,l):null);e[c]=u.sort(e[c])}}return CC.add(e)}const CC=new me({combine(t,e){let n,r,i;for(;t||e;){if(!t||e&&t.depth>=e.depth?(i=e,e=e.next):(i=t,t=t.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let s=new tc(i.tags,i.mode,i.context);n?n.next=s:r=s,n=s}return r}});class tc{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}tc.empty=new tc([],2,null);function $C(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:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let l of a.set){let c=n[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function o8(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function a8(t,e,n,r=0,i=t.length){let s=new l8(r,Array.isArray(e)?e:[e],n);s.highlightRange(t.cursor(),r,i,"",s.highlighters),s.flush(i)}class l8{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=n)return;o.isTop&&(s=this.highlighters.filter(h=>!h.scope||h.scope(o)));let c=i,u=c8(e)||tc.empty,f=o8(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(n,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(me.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),p=this.highlighters.filter(O=>!O.scope||O.scope(d.tree.type)),m=e.firstChild();for(let O=0,g=a;;O++){let b=O<d.overlay.length?d.overlay[O]:null,y=b?b.from+a:l,v=Math.max(n,g),S=Math.min(r,y);if(v<S&&m)for(;e.from<S&&(this.highlightRange(e,v,S,i,s),this.startSpan(Math.min(S,e.to),c),!(e.to>=y||!e.nextSibling())););if(!b||y>r)break;g=b.to+a,g>n&&(this.highlightRange(h.cursor(),Math.max(n,b.from+a),Math.min(r,g),"",p),this.startSpan(Math.min(r,g),c))}m&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function c8(t){let e=t.type.prop(CC);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const te=wn.define,Qu=te(),mi=te(),sS=te(mi),oS=te(mi),gi=te(),Ru=te(gi),Yp=te(gi),fr=te(),ts=te(fr),cr=te(),ur=te(),x0=te(),_a=te(x0),Mu=te(),T={comment:Qu,lineComment:te(Qu),blockComment:te(Qu),docComment:te(Qu),name:mi,variableName:te(mi),typeName:sS,tagName:te(sS),propertyName:oS,attributeName:te(oS),className:te(mi),labelName:te(mi),namespace:te(mi),macroName:te(mi),literal:gi,string:Ru,docString:te(Ru),character:te(Ru),attributeValue:te(Ru),number:Yp,integer:te(Yp),float:te(Yp),bool:te(gi),regexp:te(gi),escape:te(gi),color:te(gi),url:te(gi),keyword:cr,self:te(cr),null:te(cr),atom:te(cr),unit:te(cr),modifier:te(cr),operatorKeyword:te(cr),controlKeyword:te(cr),definitionKeyword:te(cr),moduleKeyword:te(cr),operator:ur,derefOperator:te(ur),arithmeticOperator:te(ur),logicOperator:te(ur),bitwiseOperator:te(ur),compareOperator:te(ur),updateOperator:te(ur),definitionOperator:te(ur),typeOperator:te(ur),controlOperator:te(ur),punctuation:x0,separator:te(x0),bracket:_a,angleBracket:te(_a),squareBracket:te(_a),paren:te(_a),brace:te(_a),content:fr,heading:ts,heading1:te(ts),heading2:te(ts),heading3:te(ts),heading4:te(ts),heading5:te(ts),heading6:te(ts),contentSeparator:te(fr),list:te(fr),quote:te(fr),emphasis:te(fr),strong:te(fr),link:te(fr),monospace:te(fr),strikethrough:te(fr),inserted:te(),deleted:te(),changed:te(),invalid:te(),meta:Mu,documentMeta:te(Mu),annotation:te(Mu),processingInstruction:te(Mu),definition:wn.defineModifier("definition"),constant:wn.defineModifier("constant"),function:wn.defineModifier("function"),standard:wn.defineModifier("standard"),local:wn.defineModifier("local"),special:wn.defineModifier("special")};for(let t in T){let e=T[t];e instanceof wn&&(e.name=t)}$C([{tag:T.link,class:"tok-link"},{tag:T.heading,class:"tok-heading"},{tag:T.emphasis,class:"tok-emphasis"},{tag:T.strong,class:"tok-strong"},{tag:T.keyword,class:"tok-keyword"},{tag:T.atom,class:"tok-atom"},{tag:T.bool,class:"tok-bool"},{tag:T.url,class:"tok-url"},{tag:T.labelName,class:"tok-labelName"},{tag:T.inserted,class:"tok-inserted"},{tag:T.deleted,class:"tok-deleted"},{tag:T.literal,class:"tok-literal"},{tag:T.string,class:"tok-string"},{tag:T.number,class:"tok-number"},{tag:[T.regexp,T.escape,T.special(T.string)],class:"tok-string2"},{tag:T.variableName,class:"tok-variableName"},{tag:T.local(T.variableName),class:"tok-variableName tok-local"},{tag:T.definition(T.variableName),class:"tok-variableName tok-definition"},{tag:T.special(T.variableName),class:"tok-variableName2"},{tag:T.definition(T.propertyName),class:"tok-propertyName tok-definition"},{tag:T.typeName,class:"tok-typeName"},{tag:T.namespace,class:"tok-namespace"},{tag:T.className,class:"tok-className"},{tag:T.macroName,class:"tok-macroName"},{tag:T.propertyName,class:"tok-propertyName"},{tag:T.operator,class:"tok-operator"},{tag:T.comment,class:"tok-comment"},{tag:T.meta,class:"tok-meta"},{tag:T.invalid,class:"tok-invalid"},{tag:T.punctuation,class:"tok-punctuation"}]);var Gp;const po=new me;function AC(t){return re.define({combine:t?e=>e.concat(t):void 0})}const Hy=new me;class Wn{constructor(e,n,r=[],i=""){this.data=e,this.name=i,ye.prototype.hasOwnProperty("tree")||Object.defineProperty(ye.prototype,"tree",{get(){return ot(this)}}),this.parser=n,this.extension=[Xi.of(this),ye.languageData.of((s,o,a)=>{let l=aS(s,o,a),c=l.type.prop(po);if(!c)return[];let u=s.facet(c),f=l.type.prop(Hy);if(f){let d=l.resolve(o-l.from,a);for(let h of f)if(h.test(d,s)){let p=s.facet(h.facet);return h.type=="replace"?p:p.concat(u)}}return u})].concat(r)}isActiveAt(e,n,r=-1){return aS(e,n,r).type.prop(po)==this.data}findRegions(e){let n=e.facet(Xi);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(po)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(me.mounted);if(a){if(a.tree.prop(po)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof Ke&&i(c,s.positions[l]+o)}};return i(ot(e),0),r}get allowsNesting(){return!0}}Wn.setState=he.define();function aS(t,e,n){let r=t.facet(Xi),i=ot(t).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,n,Ve.ExcludeBuffers|Ve.EnterBracketed))s.type.isTop&&(i=s);return i}class nc extends Wn{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=AC(e.languageData);return new nc(n,e.parser.configure({props:[po.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new nc(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ot(t){let e=t.field(Wn.state,!1);return e?e.tree:Ke.empty}class u8{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let Ca=null;class Od{constructor(e,n,r=[],i,s,o,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new Od(e,n,[],Ke.empty,0,r,[],null)}startParse(){return this.parser.startParse(new u8(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=Ke.empty&&this.isDone(n??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(xs.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(xs.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=Ca;Ca=this;try{return e()}finally{Ca=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=lS(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=xs.applyChanges(r,l),i=Ke.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&a.push({from:u,to:f})}}}return new Od(this.parser,n,r,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=lS(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends _C{createParse(n,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=Ca;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new Ke(en.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 Ca}}function lS(t,e,n){return xs.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class na{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new na(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=Od.create(e.facet(Xi).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new na(r)}}Wn.state=wt.define({create:na.init,update(t,e){for(let n of e.effects)if(n.is(Wn.setState))return n.value;return e.startState.facet(Xi)!=e.state.facet(Xi)?na.init(e.state):t.apply(e)}});let IC=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(IC=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const Hp=typeof navigator<"u"&&(!((Gp=navigator.scheduling)===null||Gp===void 0)&&Gp.isInputPending)?()=>navigator.scheduling.isInputPending():null,f8=Ue.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=IC(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(Wn.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Hp?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+1e3,l=s.context.work(()=>Hp&&Hp()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Wn.setState.of(new na(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ut(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()}}}),Xi=re.define({combine(t){return t.length?t[0]:null},enables:t=>[Wn.state,f8,ee.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class QC{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}const d8=re.define(),Ic=re.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 yd(t){let e=t.facet(Ic);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function rc(t,e){let n="",r=t.tabSize,i=t.facet(Ic)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let s=0;s<e;s++)n+=i;return n}function qy(t,e){t instanceof ye&&(t=new wh(t));for(let r of t.state.facet(d8)){let i=r(t,e);if(i!==void 0)return i}let n=ot(t.state);return n.length>=e?h8(t,n,e):null}class wh{constructor(e,n={}){this.state=e,this.options=n,this.unit=yd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,n=e.length){return ca(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Ky=new me;function h8(t,e,n){let r=e.resolveStack(n),i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return RC(r,t,n)}function RC(t,e,n){for(let r=t;r;r=r.next){let i=m8(r.node);if(i)return i(Jy.create(e,n,r))}return 0}function p8(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function m8(t){let e=t.type.prop(Ky);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(me.closedBy))){let i=t.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>MC(o,!0,1,void 0,s&&!p8(o)?i.from:void 0)}return t.parent==null?g8:null}function g8(){return 0}class Jy extends wh{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.context=r}get node(){return this.context.node}static create(e,n,r){return new Jy(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let n=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(n.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(O8(r,e))break;n=this.state.doc.lineAt(r.from)}return this.lineIndent(n.from)}continue(){return RC(this.context.next,this.base,this.pos)}}function O8(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function y8(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,s=t.state.doc.lineAt(n.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+c}}a=l.to}}function b8({closing:t,align:e=!0,units:n=1}){return r=>MC(r,e,n,t)}function MC(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==t.pos+o,l=e?y8(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const x8=t=>t.baseIndent;function cl({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const v8=200;function w8(){return ye.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+v8)return t;let s=n.sliceString(i.from,r);if(!e.some(c=>c.test(s)))return t;let{state:o}=t,a=-1,l=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=qy(o,u.from);if(f==null)continue;let d=/^\s*/.exec(u.text)[0],h=rc(o,f);d!=h&&l.push({from:u.from,to:u.from+d.length,insert:h})}return l.length?[t,{changes:l,sequential:!0}]:t})}const S8=re.define(),eb=new me;function LC(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function k8(t,e,n){let r=ot(t);if(r.length<n)return null;let i=r.resolveStack(n,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=n||a.from>n)continue;if(s&&a.from<e)break;let l=a.type.prop(eb);if(l&&(a.to<r.length-50||r.length==t.doc.length||!E8(a))){let c=l(a,t);c&&c.from<=n&&c.from>=e&&c.to>n&&(s=c)}}return s}function E8(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function bd(t,e,n){for(let r of t.facet(S8)){let i=r(t,e,n);if(i)return i}return k8(t,e,n)}function DC(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const Sh=he.define({map:DC}),Qc=he.define({map:DC});function ZC(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const Ds=wt.define({create(){return le.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>t=cS(t,r,i)),t=t.map(e.changes);let n=[];for(let r of e.effects)r.is(Sh)&&!T8(t,r.value.from,r.value.to)?n.push(r.value):r.is(Qc)&&(t=t.update({filter:(i,s)=>r.value.from!=i||r.value.to!=s,filterFrom:r.value.from,filterTo:r.value.to}));if(n.length){let{preparePlaceholder:r}=e.state.facet(BC),i=n.map(s=>(r?le.replace({widget:new I8(r(e.state,s))}):uS).range(s.from,s.to));t=t.update({add:i})}return e.selection&&(t=cS(t,e.selection.main.head)),t},provide:t=>ee.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(uS.range(r,i))}return le.set(e,!0)}});function cS(t,e,n=e){let r=!1;return t.between(e,n,(i,s)=>{i<n&&s>e&&(r=!0)}),r?t.update({filterFrom:e,filterTo:n,filter:(i,s)=>i>=n||s<=e}):t}function xd(t,e,n){var r;let i=null;return(r=t.field(Ds,!1))===null||r===void 0||r.between(e,n,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function T8(t,e,n){let r=!1;return t.between(e,e,(i,s)=>{i==e&&s==n&&(r=!0)}),r}function VC(t,e){return t.field(Ds,!1)?e:e.concat(he.appendConfig.of(FC()))}const N8=t=>{for(let e of ZC(t)){let n=bd(t.state,e.from,e.to);if(n)return t.dispatch({effects:VC(t.state,[Sh.of(n),jC(t,n)])}),!0}return!1},P8=t=>{if(!t.state.field(Ds,!1))return!1;let e=[];for(let n of ZC(t)){let r=xd(t.state,n.from,n.to);r&&e.push(Qc.of(r),jC(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function jC(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ee.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const _8=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),s=bd(e,i.from,i.to);s&&n.push(Sh.of(s)),r=(s?t.lineBlockAt(s.to):i).to+1}return n.length&&t.dispatch({effects:VC(t.state,n)}),!!n.length},C8=t=>{let e=t.state.field(Ds,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(Qc.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},$8=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:N8},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:P8},{key:"Ctrl-Alt-[",run:_8},{key:"Ctrl-Alt-]",run:C8}],A8={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},BC=re.define({combine(t){return $r(t,A8)}});function FC(t){return[Ds,M8]}function XC(t,e){let{state:n}=t,r=n.facet(BC),i=o=>{let a=t.lineBlockAt(t.posAtDOM(o.target)),l=xd(t.state,a.from,a.to);l&&t.dispatch({effects:Qc.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const uS=le.replace({widget:new class extends tr{toDOM(t){return XC(t,null)}}});class I8 extends tr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return XC(e,this.value)}}const Q8={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class qp extends ri{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function R8(t={}){let e={...Q8,...t},n=new qp(e,!0),r=new qp(e,!1),i=Ue.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Xi)!=o.state.facet(Xi)||o.startState.field(Ds,!1)!=o.state.field(Ds,!1)||ot(o.startState)!=ot(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new ti;for(let l of o.viewportLineBlocks){let c=xd(o.state,l.from,l.to)?r:bd(o.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:s}=e;return[i,L9({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||ge.empty},initialSpacer(){return new qp(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let c=xd(o.state,a.from,a.to);if(c)return o.dispatch({effects:Qc.of(c)}),!0;let u=bd(o.state,a.from,a.to);return u?(o.dispatch({effects:Sh.of(u)}),!0):!1}}}),FC()]}const M8=ee.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class ua{constructor(e,n){this.specs=e;let r;function i(a){let l=Vi.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,o=n.scope;this.scope=o instanceof Wn?a=>a.prop(po)==o.data:o?a=>a==o:void 0,this.style=$C(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new Vi(r):null,this.themeType=n.themeType}static define(e,n){return new ua(e,n||{})}}const v0=re.define(),zC=re.define({combine(t){return t.length?[t[0]]:null}});function Kp(t){let e=t.facet(v0);return e.length?e:t.facet(zC)}function tb(t,e){let n=[D8],r;return t instanceof ua&&(t.module&&n.push(ee.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(zC.of(t)):r?n.push(v0.computeN([ee.darkTheme],i=>i.facet(ee.darkTheme)==(r=="dark")?[t]:[])):n.push(v0.of(t)),n}class L8{constructor(e){this.markCache=Object.create(null),this.tree=ot(e.state),this.decorations=this.buildDeco(e,Kp(e.state)),this.decoratedTo=e.viewport.to}update(e){let n=ot(e.state),r=Kp(e.state),i=r!=Kp(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);n.length<s.to&&!i&&n.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,n){if(!n||!this.tree.length)return le.none;let r=new ti;for(let{from:i,to:s}of e.visibleRanges)a8(this.tree,n,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=le.mark({class:l})))},i,s);return r.finish()}}const D8=Hi.high(Ue.fromClass(L8,{decorations:t=>t.decorations})),Z8=ua.define([{tag:T.meta,color:"#404740"},{tag:T.link,textDecoration:"underline"},{tag:T.heading,textDecoration:"underline",fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strong,fontWeight:"bold"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.keyword,color:"#708"},{tag:[T.atom,T.bool,T.url,T.contentSeparator,T.labelName],color:"#219"},{tag:[T.literal,T.inserted],color:"#164"},{tag:[T.string,T.deleted],color:"#a11"},{tag:[T.regexp,T.escape,T.special(T.string)],color:"#e40"},{tag:T.definition(T.variableName),color:"#00f"},{tag:T.local(T.variableName),color:"#30a"},{tag:[T.typeName,T.namespace],color:"#085"},{tag:T.className,color:"#167"},{tag:[T.special(T.variableName),T.macroName],color:"#256"},{tag:T.definition(T.propertyName),color:"#00c"},{tag:T.comment,color:"#940"},{tag:T.invalid,color:"#f00"}]),V8=ee.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),WC=1e4,UC="()[]{}",YC=re.define({combine(t){return $r(t,{afterCursor:!0,brackets:UC,maxScanDistance:WC,renderMatch:F8})}}),j8=le.mark({class:"cm-matchingBracket"}),B8=le.mark({class:"cm-nonmatchingBracket"});function F8(t){let e=[],n=t.matched?j8:B8;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}function fS(t){let e=[],n=t.facet(YC);for(let r of t.selection.ranges){if(!r.empty)continue;let i=vr(t,r.head,-1,n)||r.head>0&&vr(t,r.head-1,1,n)||n.afterCursor&&(vr(t,r.head,1,n)||r.head<t.doc.length&&vr(t,r.head+1,-1,n));i&&(e=e.concat(n.renderMatch(i,t)))}return le.set(e,!0)}const X8=Ue.fromClass(class{constructor(t){this.paused=!1,this.decorations=fS(t.state)}update(t){(t.docChanged||t.selectionSet||this.paused)&&(t.view.composing?(this.decorations=this.decorations.map(t.changes),this.paused=!0):(this.decorations=fS(t.state),this.paused=!1))}},{decorations:t=>t.decorations}),z8=[X8,V8];function W8(t={}){return[YC.of(t),z8]}const U8=new me;function w0(t,e,n){let r=t.prop(e<0?me.openedBy:me.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function S0(t){let e=t.type.prop(U8);return e?e(t.node):t}function vr(t,e,n,r={}){let i=r.maxScanDistance||WC,s=r.brackets||UC,o=ot(t),a=o.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=w0(l.type,n,s);if(c&&l.from<l.to){let u=S0(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return Y8(t,e,n,l,u,c,s)}}return G8(t,e,n,o,a.type,i,s)}function Y8(t,e,n,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=S0(u);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(w0(u.type,n,o))c++;else if(w0(u.type,-n,o)){if(c==0){let f=S0(u);return{start:l,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:l,matched:!1}}function G8(t,e,n,r,i,s,o){if(n<0?!e:e==t.doc.length)return null;let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%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 d=0;!u.next().done&&d<=s;){let h=u.value;n<0&&(d+=h.length);let p=e+d*n;for(let m=n>0?0:h.length-1,O=n>0?h.length:-1;m!=O;m+=n){let g=o.indexOf(h[m]);if(!(g<0||r.resolveInner(p+m,1).type!=i))if(g%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+m,to:p+m+1},matched:g>>1==l>>1};f--}}n>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}const H8=Object.create(null),dS=[en.none],hS=[],pS=Object.create(null),q8=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"]])q8[t]=K8(H8,e);function Jp(t,e){hS.indexOf(t)>-1||(hS.push(t),console.warn(e))}function K8(t,e){let n=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=t[c]||T[c];u?typeof u=="function"?l.length?l=l.map(u):Jp(c,`Modifier ${c} used at start of tag`):l.length?Jp(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Jp(c,`Unknown highlighting tag ${c}`)}for(let c of l)n.push(c)}if(!n.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+n.map(a=>a.id),s=pS[i];if(s)return s.id;let o=pS[i]=en.define({id:dS.length,name:r,props:[Gy({[r]:n})]});return dS.push(o),o.id}_e.RTL,_e.LTR;const J8=t=>{let{state:e}=t,n=e.doc.lineAt(e.selection.main.from),r=rb(t.state,n.from);return r.line?eW(t):r.block?nW(t):!1};function nb(t,e){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=t(e,n);return i?(r(n.update(i)),!0):!1}}const eW=nb(sW,0),tW=nb(GC,0),nW=nb((t,e)=>GC(t,e,iW(e)),0);function rb(t,e){let n=t.languageDataAt("commentTokens",e,1);return n.length?n[0]:{}}const $a=50;function rW(t,{open:e,close:n},r,i){let s=t.sliceDoc(r-$a,r),o=t.sliceDoc(i,i+$a),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+n.length)==n)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*$a?u=f=t.sliceDoc(r,i):(u=t.sliceDoc(r,r+$a),f=t.sliceDoc(i-$a,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,p=f.length-h-n.length;return u.slice(d,d+e.length)==e&&f.slice(p,p+n.length)==n?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-n.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function iW(t){let e=[];for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),i=n.to<=r.to?r:t.doc.lineAt(n.to);i.from>r.from&&i.from==n.to&&(i=n.to==r.to+1?r:t.doc.lineAt(n.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function GC(t,e,n=e.selection.ranges){let r=n.map(s=>rb(e,s.from).block);if(!r.every(s=>s))return null;let i=n.map((s,o)=>rW(e,r[o],s.from,s.to));if(t!=2&&!i.every(s=>s))return{changes:e.changes(n.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(t!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let l=r[o],{open:c,close:u}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:s}}return null}function sW(t,e,n=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:o}of n){let a=r.length,l=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=rb(e,f.from).line,!c))continue e;if(f.from>i&&(s==o||o>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,p=f.text.slice(d,d+c.length)==c?d:-1;d<f.text.length&&d<l&&(l=d),r.push({line:f,comment:p,token:c,indent:d,empty:h,single:!1})}u=f.to+1}if(l<1e9)for(let u=a;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==a+1&&(r[a].single=!0)}if(t!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let c=o.from+a,u=c+l.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const k0=Cr.define(),oW=Cr.define(),aW=re.define(),HC=re.define({combine(t){return $r(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,n)=>n},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,n)=>(r,i)=>e(r,i)||n(r,i)})}}),qC=wt.define({create(){return wr.empty},update(t,e){let n=e.state.facet(HC),r=e.annotation(k0);if(r){let l=Yt.fromTransaction(e,r.selection),c=r.side,u=c==0?t.undone:t.done;return l?u=vd(u,u.length,n.minDepth,l):u=e$(u,e.startState.selection),new wr(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(oW);if((i=="full"||i=="before")&&(t=t.isolate()),e.annotation(et.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=Yt.fromTransaction(e),o=e.annotation(et.time),a=e.annotation(et.userEvent);return s?t=t.addChanges(s,o,a,n,e):e.selection&&(t=t.addSelection(e.startState.selection,o,a,n.newGroupDelay)),(i=="full"||i=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new wr(t.done.map(Yt.fromJSON),t.undone.map(Yt.fromJSON))}});function lW(t={}){return[qC,HC.of(t),ee.domEventHandlers({beforeinput(e,n){let r=e.inputType=="historyUndo"?KC:e.inputType=="historyRedo"?E0:null;return r?(e.preventDefault(),r(n)):!1}})]}function kh(t,e){return function({state:n,dispatch:r}){if(!e&&n.readOnly)return!1;let i=n.field(qC,!1);if(!i)return!1;let s=i.pop(t,n,e);return s?(r(s),!0):!1}}const KC=kh(0,!1),E0=kh(1,!1),cW=kh(0,!0),uW=kh(1,!0);class Yt{constructor(e,n,r,i,s){this.changes=e,this.effects=n,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new Yt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,n,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(n=this.mapped)===null||n===void 0?void 0:n.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Yt(e.changes&&it.fromJSON(e.changes),[],e.mapped&&Nr.fromJSON(e.mapped),e.startSelection&&W.fromJSON(e.startSelection),e.selectionsAfter.map(W.fromJSON))}static fromTransaction(e,n){let r=En;for(let i of e.startState.facet(aW)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new Yt(e.changes.invert(e.startState.doc),r,void 0,n||e.startState.selection,En)}static selection(e){return new Yt(void 0,En,void 0,void 0,e)}}function vd(t,e,n,r){let i=e+1>n+20?e-n-1:0,s=t.slice(i,e);return s.push(r),s}function fW(t,e){let n=[],r=!1;return t.iterChangedRanges((i,s)=>n.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l<n.length;){let c=n[l++],u=n[l++];a>=c&&o<=u&&(r=!0)}}),r}function dW(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((n,r)=>n.empty!=e.ranges[r].empty).length===0}function JC(t,e){return t.length?e.length?t.concat(e):t:e}const En=[],hW=200;function e$(t,e){if(t.length){let n=t[t.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-hW));return r.length&&r[r.length-1].eq(e)?t:(r.push(e),vd(t,t.length-1,1e9,n.setSelAfter(r)))}else return[Yt.selection([e])]}function pW(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 em(t,e){if(!t.length)return t;let n=t.length,r=En;for(;n;){let i=mW(t[n-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=t.slice(0,n);return s[n-1]=i,s}else e=i.mapped,n--,r=i.selectionsAfter}return r.length?[Yt.selection(r)]:En}function mW(t,e,n){let r=JC(t.selectionsAfter.length?t.selectionsAfter.map(a=>a.map(e)):En,n);if(!t.changes)return Yt.selection(r);let i=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new Yt(i,he.mapEffects(t.effects,e),o,t.startSelection.map(s),r)}const gW=/^(input\.type|delete)($|\.)/;class wr{constructor(e,n,r=0,i=void 0){this.done=e,this.undone=n,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new wr(this.done,this.undone):this}addChanges(e,n,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||gW.test(r))&&(!a.selectionsAfter.length&&n-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,fW(a.changes,e.changes))||r=="input.type.compose")?o=vd(o,o.length-1,i.minDepth,new Yt(e.changes.compose(a.changes),JC(he.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,En)):o=vd(o,o.length,i.minDepth,e),new wr(o,En,n,r)}addSelection(e,n,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:En;return s.length>0&&n-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&dW(s[s.length-1],e)?this:new wr(e$(this.done,e),this.undone,n,r)}addMapping(e){return new wr(em(this.done,e),em(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,n,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):n.selection);if(r&&s.selectionsAfter.length)return n.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:k0.of({side:e,rest:pW(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?En:i.slice(0,i.length-1);return s.mapped&&(a=em(a,s.mapped)),n.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:k0.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}wr.empty=new wr(En,En);const OW=[{key:"Mod-z",run:KC,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:E0,preventDefault:!0},{linux:"Ctrl-Shift-z",run:E0,preventDefault:!0},{key:"Mod-u",run:cW,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:uW,preventDefault:!0}];function fa(t,e){return W.create(t.ranges.map(e),t.mainIndex)}function nr(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function rr({state:t,dispatch:e},n){let r=fa(t.selection,n);return r.eq(t.selection,!0)?!1:(e(nr(t,r)),!0)}function Eh(t,e){return W.cursor(e?t.to:t.from)}function t$(t,e){return rr(t,n=>n.empty?t.moveByChar(n,e):Eh(n,e))}function _t(t){return t.textDirectionAt(t.state.selection.main.head)==_e.LTR}const n$=t=>t$(t,!_t(t)),r$=t=>t$(t,_t(t));function i$(t,e){return rr(t,n=>n.empty?t.moveByGroup(n,e):Eh(n,e))}const yW=t=>i$(t,!_t(t)),bW=t=>i$(t,_t(t));function xW(t,e,n){if(e.type.prop(n))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function Th(t,e,n){let r=ot(t).resolveInner(e.head),i=n?me.closedBy:me.openedBy;for(let l=e.head;;){let c=n?r.childAfter(l):r.childBefore(l);if(!c)break;xW(t,c,i)?r=c:l=n?c.to:c.from}let s=r.type.prop(i),o,a;return s&&(o=n?vr(t,r.from,1):vr(t,r.to,-1))&&o.matched?a=n?o.end.to:o.end.from:a=n?r.to:r.from,W.cursor(a,n?-1:1)}const vW=t=>rr(t,e=>Th(t.state,e,!_t(t))),wW=t=>rr(t,e=>Th(t.state,e,_t(t)));function s$(t,e){return rr(t,n=>{if(!n.empty)return Eh(n,e);let r=t.moveVertically(n,e);return r.head!=n.head?r:t.moveToLineBoundary(n,e)})}const o$=t=>s$(t,!1),a$=t=>s$(t,!0);function l$(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,n=0,r=0,i;if(e){for(let s of t.state.facet(ee.scrollMargins)){let o=s(t);o!=null&&o.top&&(n=Math.max(o==null?void 0:o.top,n)),o!=null&&o.bottom&&(r=Math.max(o==null?void 0:o.bottom,r))}i=t.scrollDOM.clientHeight-n-r}else i=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:e,height:Math.max(t.defaultLineHeight,i-5)}}function c$(t,e){let n=l$(t),{state:r}=t,i=fa(r.selection,o=>o.empty?t.moveVertically(o,e,n.height):Eh(o,e));if(i.eq(r.selection))return!1;let s;if(n.selfScroll){let o=t.coordsAtPos(r.selection.main.head),a=t.scrollDOM.getBoundingClientRect(),l=a.top+n.marginTop,c=a.bottom-n.marginBottom;o&&o.top>l&&o.bottom<c&&(s=ee.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-l}))}return t.dispatch(nr(r,i),{effects:s}),!0}const mS=t=>c$(t,!1),T0=t=>c$(t,!0);function qi(t,e,n){let r=t.lineBlockAt(e.head),i=t.moveToLineBoundary(e,n);if(i.head==e.head&&i.head!=(n?r.to:r.from)&&(i=t.moveToLineBoundary(e,n,!1)),!n&&i.head==r.from&&r.length){let s=/^\s*/.exec(t.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=W.cursor(r.from+s))}return i}const SW=t=>rr(t,e=>qi(t,e,!0)),kW=t=>rr(t,e=>qi(t,e,!1)),EW=t=>rr(t,e=>qi(t,e,!_t(t))),TW=t=>rr(t,e=>qi(t,e,_t(t))),NW=t=>rr(t,e=>W.cursor(t.lineBlockAt(e.head).from,1)),PW=t=>rr(t,e=>W.cursor(t.lineBlockAt(e.head).to,-1));function _W(t,e,n){let r=!1,i=fa(t.selection,s=>{let o=vr(t,s.head,-1)||vr(t,s.head,1)||s.head>0&&vr(t,s.head-1,1)||s.head<t.doc.length&&vr(t,s.head+1,-1);if(!o||!o.end)return s;r=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return W.cursor(a)});return r?(e(nr(t,i)),!0):!1}const CW=({state:t,dispatch:e})=>_W(t,e);function Cn(t,e,n){let r=fa(t.state.selection,i=>{i.undirectional&&i.head>=i.anchor!=e&&(i=W.range(i.head,i.anchor));let s=n(i);return W.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return r.eq(t.state.selection)?!1:(t.dispatch(nr(t.state,r)),!0)}function u$(t,e){return Cn(t,e,n=>t.moveByChar(n,e))}const f$=t=>u$(t,!_t(t)),d$=t=>u$(t,_t(t));function h$(t,e){return Cn(t,e,n=>t.moveByGroup(n,e))}const $W=t=>h$(t,!_t(t)),AW=t=>h$(t,_t(t)),IW=t=>{let e=!_t(t);return Cn(t,e,n=>Th(t.state,n,e))},QW=t=>{let e=_t(t);return Cn(t,e,n=>Th(t.state,n,e))};function p$(t,e){return Cn(t,e,n=>t.moveVertically(n,e))}const m$=t=>p$(t,!1),g$=t=>p$(t,!0);function O$(t,e){return Cn(t,e,n=>t.moveVertically(n,e,l$(t).height))}const gS=t=>O$(t,!1),OS=t=>O$(t,!0),RW=t=>Cn(t,!0,e=>qi(t,e,!0)),MW=t=>Cn(t,!1,e=>qi(t,e,!1)),LW=t=>{let e=!_t(t);return Cn(t,e,n=>qi(t,n,e))},DW=t=>{let e=_t(t);return Cn(t,e,n=>qi(t,n,e))},ZW=t=>Cn(t,!1,e=>W.cursor(t.lineBlockAt(e.head).from)),VW=t=>Cn(t,!0,e=>W.cursor(t.lineBlockAt(e.head).to)),yS=({state:t,dispatch:e})=>(e(nr(t,{anchor:0})),!0),bS=({state:t,dispatch:e})=>(e(nr(t,{anchor:t.doc.length})),!0),xS=({state:t,dispatch:e})=>(e(nr(t,{anchor:t.selection.main.anchor,head:0})),!0),vS=({state:t,dispatch:e})=>(e(nr(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),jW=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),BW=({state:t,dispatch:e})=>{let n=Nh(t).map(({from:r,to:i})=>W.range(r,Math.min(i+1,t.doc.length)));return e(t.update({selection:W.create(n),userEvent:"select"})),!0},FW=({state:t,dispatch:e})=>{let n=fa(t.selection,r=>{let i=ot(t),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.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:a}=o;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return W.range(a.to,a.from)}return r});return n.eq(t.selection)?!1:(e(nr(t,n)),!0)};function y$(t,e){let{state:n}=t,r=n.selection,i=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 a=s;;){let l=t.moveVertically(a,e);if(l.head<o.from||l.head>o.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(t.dispatch(nr(n,W.create(i,i.length-1))),!0)}const XW=t=>y$(t,!1),zW=t=>y$(t,!0),WW=({state:t,dispatch:e})=>{let n=t.selection,r=null;return n.ranges.length>1?r=W.create([n.main]):n.main.empty||(r=W.create([W.cursor(n.main.head)])),r?(e(nr(t,r)),!0):!1};function Rc(t,e){if(t.state.readOnly)return!1;let n="delete.selection",{state:r}=t,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(n="delete.backward",l=Lu(t,l,!1)):l>o&&(n="delete.forward",l=Lu(t,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Lu(t,o,!1),a=Lu(t,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:W.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(t.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:n=="delete.selection"?ee.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Lu(t,e,n){if(t instanceof ee)for(let r of t.state.facet(ee.atomicRanges).map(i=>i(t)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=n?s:i)});return e}const b$=(t,e,n)=>Rc(t,r=>{let i=r.from,{state:s}=t,o=s.doc.lineAt(i),a,l;if(n&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]==" ")return i-1;let c=ca(a,s.tabSize),u=c%yd(s)||yd(s);for(let f=0;f<u&&a[a.length-1-f]==" ";f++)i--;l=i}else l=ut(o.text,i-o.from,e,e)+o.from,l==i&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,i-o.from))&&(l=ut(o.text,l-o.from,!1,!1)+o.from);return l}),N0=t=>b$(t,!1,!0),x$=t=>b$(t,!0,!1),v$=(t,e)=>Rc(t,n=>{let r=n.head,{state:i}=t,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==n.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=ut(s.text,r-s.from,e)+s.from,c=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),u=o(c);if(a!=null&&u!=a)break;(c!=" "||r!=n.head)&&(a=u),r=l}return r}),w$=t=>v$(t,!1),UW=t=>v$(t,!0),YW=t=>Rc(t,e=>{let n=t.lineBlockAt(e.head).to;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),GW=t=>Rc(t,e=>{let n=t.moveToLineBoundary(e,!1).head;return e.head>n?n:Math.max(0,e.head-1)}),HW=t=>Rc(t,e=>{let n=t.moveToLineBoundary(e,!0).head;return e.head<n?n:Math.min(t.state.doc.length,e.head+1)}),qW=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:xe.of(["",""])},range:W.cursor(r.from)}));return e(t.update(n,{scrollIntoView:!0,userEvent:"input"})),!0},KW=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=t.changeByRange(r=>{if(!r.empty||r.from==0||r.from==t.doc.length)return{range:r};let i=r.from,s=t.doc.lineAt(i),o=i==s.from?i-1:ut(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:ut(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:t.doc.slice(i,a).append(t.doc.slice(o,i))},range:W.cursor(a)}});return n.changes.empty?!1:(e(t.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Nh(t){let e=[],n=-1;for(let r of t.selection.ranges){let i=t.doc.lineAt(r.from),s=t.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=t.doc.lineAt(r.to-1)),n>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return e}function S$(t,e,n){if(t.readOnly)return!1;let r=[],i=[];for(let s of Nh(t)){if(n?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(n?s.to+1:s.from-1),a=o.length+1;if(n){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let l of s.ranges)i.push(W.range(Math.min(t.doc.length,l.anchor+a),Math.min(t.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let l of s.ranges)i.push(W.range(l.anchor-a,l.head-a))}}return r.length?(e(t.update({changes:r,scrollIntoView:!0,selection:W.create(i,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const JW=({state:t,dispatch:e})=>S$(t,e,!1),eU=({state:t,dispatch:e})=>S$(t,e,!0);function k$(t,e,n){if(t.readOnly)return!1;let r=[];for(let s of Nh(t))n?r.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):r.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let i=t.changes(r);return e(t.update({changes:i,selection:t.selection.map(i,n?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const tU=({state:t,dispatch:e})=>k$(t,e,!1),nU=({state:t,dispatch:e})=>k$(t,e,!0),rU=t=>{if(t.state.readOnly)return!1;let{state:e}=t,n=e.changes(Nh(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=fa(e.selection,i=>{let s;if(t.lineWrapping){let o=t.lineBlockAt(i.head),a=t.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+t.documentTop-a.bottom+t.defaultLineHeight/2)}return t.moveVertically(i,!0,s)}).map(n);return t.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function iU(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let n=ot(t).resolveInner(e),r=n.childBefore(e),i=n.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(me.closedBy))&&s.indexOf(i.name)>-1&&t.doc.lineAt(r.to).from==t.doc.lineAt(i.from).from&&!/\S/.test(t.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const wS=E$(!1),sU=E$(!0);function E$(t){return({state:e,dispatch:n})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!t&&s==o&&iU(e,s);t&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new wh(e,{simulateBreak:s,simulateDoubleBreak:!!l}),u=qy(c,s);for(u==null&&(u=ca(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let f=["",rc(e,u)];return l&&f.push(rc(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:xe.of(f)},range:W.cursor(s+1+f[1].length)}});return n(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function ib(t,e){let n=-1;return t.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=t.doc.lineAt(o);a.number>n&&(r.empty||r.to>a.from)&&(e(a,i,r),n=a.number),o=a.to+1}let s=t.changes(i);return{changes:i,range:W.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const oU=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=Object.create(null),r=new wh(t,{overrideIndentation:s=>{let o=n[s];return o??-1}}),i=ib(t,(s,o,a)=>{let l=qy(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],u=rc(t,l);(c!=u||a.from<s.from+c.length)&&(n[s.from]=l,o.push({from:s.from,to:s.from+c.length,insert:u}))});return i.changes.empty||e(t.update(i,{userEvent:"indent"})),!0},T$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(ib(t,(n,r)=>{r.push({from:n.from,insert:t.facet(Ic)})}),{userEvent:"input.indent"})),!0),N$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(ib(t,(n,r)=>{let i=/^\s*/.exec(n.text)[0];if(!i)return;let s=ca(i,t.tabSize),o=0,a=rc(t,Math.max(0,s-yd(t)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:n.from+o,to:n.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),aU=t=>(t.setTabFocusMode(),!0),lU=[{key:"Ctrl-b",run:n$,shift:f$,preventDefault:!0},{key:"Ctrl-f",run:r$,shift:d$},{key:"Ctrl-p",run:o$,shift:m$},{key:"Ctrl-n",run:a$,shift:g$},{key:"Ctrl-a",run:NW,shift:ZW},{key:"Ctrl-e",run:PW,shift:VW},{key:"Ctrl-d",run:x$},{key:"Ctrl-h",run:N0},{key:"Ctrl-k",run:YW},{key:"Ctrl-Alt-h",run:w$},{key:"Ctrl-o",run:qW},{key:"Ctrl-t",run:KW},{key:"Ctrl-v",run:T0}],cU=[{key:"ArrowLeft",run:n$,shift:f$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:yW,shift:$W,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:EW,shift:LW,preventDefault:!0},{key:"ArrowRight",run:r$,shift:d$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:bW,shift:AW,preventDefault:!0},{mac:"Cmd-ArrowRight",run:TW,shift:DW,preventDefault:!0},{key:"ArrowUp",run:o$,shift:m$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:yS,shift:xS},{mac:"Ctrl-ArrowUp",run:mS,shift:gS},{key:"ArrowDown",run:a$,shift:g$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:bS,shift:vS},{mac:"Ctrl-ArrowDown",run:T0,shift:OS},{key:"PageUp",run:mS,shift:gS},{key:"PageDown",run:T0,shift:OS},{key:"Home",run:kW,shift:MW,preventDefault:!0},{key:"Mod-Home",run:yS,shift:xS},{key:"End",run:SW,shift:RW,preventDefault:!0},{key:"Mod-End",run:bS,shift:vS},{key:"Enter",run:wS,shift:wS},{key:"Mod-a",run:jW},{key:"Backspace",run:N0,shift:N0,preventDefault:!0},{key:"Delete",run:x$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:w$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:UW,preventDefault:!0},{mac:"Mod-Backspace",run:GW,preventDefault:!0},{mac:"Mod-Delete",run:HW,preventDefault:!0}].concat(lU.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),uU=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:vW,shift:IW},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:wW,shift:QW},{key:"Alt-ArrowUp",run:JW},{key:"Shift-Alt-ArrowUp",run:tU},{key:"Alt-ArrowDown",run:eU},{key:"Shift-Alt-ArrowDown",run:nU},{key:"Mod-Alt-ArrowUp",run:XW},{key:"Mod-Alt-ArrowDown",run:zW},{key:"Escape",run:WW},{key:"Mod-Enter",run:sU},{key:"Alt-l",mac:"Ctrl-l",run:BW},{key:"Mod-i",run:FW,preventDefault:!0},{key:"Mod-[",run:N$},{key:"Mod-]",run:T$},{key:"Mod-Alt-\\",run:oU},{key:"Shift-Mod-k",run:rU},{key:"Shift-Mod-\\",run:CW},{key:"Mod-/",run:J8},{key:"Alt-A",run:tW},{key:"Ctrl-m",mac:"Shift-Alt-m",run:aU}].concat(cU),fU={key:"Tab",run:T$,shift:N$},SS=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class ra{constructor(e,n,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(SS(a)):SS,this.query=this.normalize(n)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return jt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let n=Ty(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=Or(e);let i=this.normalize(n);if(i.length)for(let s=0,o=r,a=!0;;s++){let l=i.charCodeAt(s),c=this.match(l,o,a,this.bufferPos+this.bufferStart,s==i.length-1);if(c)return this.value=c,this;if(s==i.length-1)break;a&&s<n.length&&n.charCodeAt(s)==l?o++:a=!1}}}match(e,n,r,i,s){let o=null;for(let a=0;a<this.matches.length;){let l=this.matches[a],c=!1;this.query.charCodeAt(l.index)==e&&(l.index==this.query.length-1?o={from:l.from,to:i,precise:s&&l.precise}:(l.index++,c=!0)),c?a++:this.matches.splice(a,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?o={from:n,to:i,precise:r&&s}:this.matches.push({from:n,index:1,precise:r})),o&&this.test&&!this.test(o.from,o.to,this.buffer,this.bufferStart)&&(o=null),o}}typeof Symbol<"u"&&(ra.prototype[Symbol.iterator]=function(){return this});const P$={from:-1,to:-1,match:/.*/.exec(""),precise:!0},sb="gm"+(/x/.unicode==null?"":"u");class _${constructor(e,n,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=P$,/\\[sWDnr]|\n|\r|\[\^/.test(n))return new C$(e,n,r,i,s);this.re=new RegExp(n,sb+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=wd(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let n=this.matchPos<=this.to&&this.re.exec(this.curLine);if(n){let r=this.curLineStart+n.index,i=r+n[0].length;if(this.matchPos=wd(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const tm=new WeakMap;class _o{constructor(e,n){this.from=e,this.text=n}get to(){return this.from+this.text.length}static get(e,n,r){let i=tm.get(e);if(!i||i.from>=r||i.to<=n){let a=new _o(n,e.sliceString(n,r));return tm.set(e,a),a}if(i.from==n&&i.to==r)return i;let{text:s,from:o}=i;return o>n&&(s=e.sliceString(n,o)+s,o=n),i.to<r&&(s+=e.sliceString(i.to,r)),tm.set(e,new _o(o,s)),new _o(n,s.slice(n-o,r-o))}}class C${constructor(e,n,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=P$,this.matchPos=wd(e,i),this.re=new RegExp(n,sb+(r!=null&&r.ignoreCase?"i":"")),this.test=r==null?void 0:r.test,this.flat=_o.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,n=this.re.exec(this.flat.text);if(n&&!n[0]&&n.index==e&&(this.re.lastIndex=e+1,n=this.re.exec(this.flat.text)),n){let r=this.flat.from+n.index,i=r+n[0].length;if((this.flat.to>=this.to||n.index+n[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,n)))return this.value={from:r,to:i,precise:!0,match:n},this.matchPos=wd(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=_o.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(_$.prototype[Symbol.iterator]=C$.prototype[Symbol.iterator]=function(){return this});function dU(t){try{return new RegExp(t,sb),!0}catch{return!1}}function wd(t,e){if(e>=t.length)return e;let n=t.lineAt(e),r;for(;e<n.to&&(r=n.text.charCodeAt(e-n.from))>=56320&&r<57344;)e++;return e}const hU=t=>{let{state:e}=t,n=String(e.doc.lineAt(t.state.selection.main.head).number),{close:r,result:i}=I9(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:n},focus:!0,submitLabel:e.phrase("go")});return i.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){t.dispatch({effects:r});return}let a=e.doc.lineAt(e.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let O=h/100;l&&(O=O*(l=="-"?-1:1)+a.number/e.doc.lines),h=Math.round(e.doc.lines*O)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,h))),m=W.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[r,ee.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},pU={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},mU=re.define({combine(t){return $r(t,pU,{highlightWordAroundCursor:(e,n)=>e||n,minSelectionLength:Math.min,maxMatches:Math.min})}});function gU(t){return[vU,xU]}const OU=le.mark({class:"cm-selectionMatch"}),yU=le.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function kS(t,e,n,r){return(n==0||t(e.sliceDoc(n-1,n))!=Me.Word)&&(r==e.doc.length||t(e.sliceDoc(r,r+1))!=Me.Word)}function bU(t,e,n,r){return t(e.sliceDoc(n,n+1))==Me.Word&&t(e.sliceDoc(r-1,r))==Me.Word}const xU=Ue.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(mU),{state:n}=t,r=n.selection;if(r.ranges.length>1)return le.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return le.none;let l=n.wordAt(i.head);if(!l)return le.none;o=n.charCategorizer(i.head),s=n.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return le.none;if(e.wholeWords){if(s=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(kS(o,n,i.from,i.to)&&bU(o,n,i.from,i.to)))return le.none}else if(s=n.sliceDoc(i.from,i.to),!s)return le.none}let a=[];for(let l of t.visibleRanges){let c=new ra(n.doc,s,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!o||kS(o,n,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(yU.range(u,f)):(u>=i.to||f<=i.from)&&a.push(OU.range(u,f)),a.length>e.maxMatches))return le.none}}return le.set(a)}},{decorations:t=>t.decorations}),vU=ee.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),wU=({state:t,dispatch:e})=>{let{selection:n}=t,r=W.create(n.ranges.map(i=>t.wordAt(i.head)||W.cursor(i.head)),n.mainIndex);return r.eq(n)?!1:(e(t.update({selection:r})),!0)};function SU(t,e){let{main:n,ranges:r}=t.selection,i=t.wordAt(n.head),s=i&&i.from==n.from&&i.to==n.to;for(let o=!1,a=new ra(t.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new ra(t.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(s){let l=t.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const kU=({state:t,dispatch:e})=>{let{ranges:n}=t.selection;if(n.some(s=>s.from===s.to))return wU({state:t,dispatch:e});let r=t.sliceDoc(n[0].from,n[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=r))return!1;let i=SU(t,r);return i?(e(t.update({selection:t.selection.addRange(W.range(i.from,i.to),!1),effects:ee.scrollIntoView(i.to)})),!0):!1},da=re.define({combine(t){return $r(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new DU(e),scrollToMatch:e=>ee.scrollIntoView(e)})}});class $${constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||dU(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(n,r)=>r=="n"?`
|
|
75
|
+
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new CU(this):new NU(this)}getCursor(e,n=0,r){let i=e.doc?e:ye.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?Hs(this,i,n,r):Gs(this,i,n,r)}}class A${constructor(e){this.spec=e}}function EU(t,e,n){return(r,i,s,o)=>{if(n&&!n(r,i,s,o))return!1;let a=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return t(a,e,r,i)}}function Gs(t,e,n,r){let i;return t.wholeWord&&(i=TU(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(i=EU(t.test,e,i)),new ra(e.doc,t.unquoted,n,r,t.caseSensitive?void 0:s=>s.toLowerCase(),i)}function TU(t,e){return(n,r,i,s)=>((s>n||s+i.length<r)&&(s=Math.max(0,n-2),i=t.sliceString(s,Math.min(t.length,r+2))),(e(Sd(i,n-s))!=Me.Word||e(kd(i,n-s))!=Me.Word)&&(e(kd(i,r-s))!=Me.Word||e(Sd(i,r-s))!=Me.Word))}class NU extends A${constructor(e){super(e)}nextMatch(e,n,r){let i=Gs(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,n+this.spec.unquoted.length);i=Gs(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==n&&i.value.to==r?null:i.value}prevMatchInRange(e,n,r){for(let i=r;;){let s=Math.max(n,i-1e4-this.spec.unquoted.length),o=Gs(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==n)return null;i-=1e4}}prevMatch(e,n,r){let i=this.prevMatchInRange(e,0,n);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=n||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,n){let r=Gs(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Gs(this.spec,e,Math.max(0,n-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function PU(t,e,n){return(r,i,s)=>(!n||n(r,i,s))&&t(s[0],e,r,i)}function Hs(t,e,n,r){let i;return t.wholeWord&&(i=_U(e.charCategorizer(e.selection.main.head))),t.test&&(i=PU(t.test,e,i)),new _$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:i},n,r)}function Sd(t,e){return t.slice(ut(t,e,!1),e)}function kd(t,e){return t.slice(e,ut(t,e))}function _U(t){return(e,n,r)=>!r[0].length||(t(Sd(r.input,r.index))!=Me.Word||t(kd(r.input,r.index))!=Me.Word)&&(t(kd(r.input,r.index+r[0].length))!=Me.Word||t(Sd(r.input,r.index+r[0].length))!=Me.Word)}class CU extends A${nextMatch(e,n,r){let i=Hs(this.spec,e,r,e.doc.length).next();return i.done&&(i=Hs(this.spec,e,0,n).next()),i.done?null:i.value}prevMatchInRange(e,n,r){for(let i=1;;i++){let s=Math.max(n,r-i*1e4),o=Hs(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==n||a.from>s+10))return a;if(s==n)return null}}prevMatch(e,n,r){return this.prevMatchInRange(e,0,n)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(n,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return n})}matchAll(e,n){let r=Hs(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=n)return null;i.push(r.value)}return i}highlight(e,n,r,i){let s=Hs(this.spec,e,Math.max(0,n-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const ic=he.define(),ob=he.define(),Qi=wt.define({create(t){return new nm(P0(t).create(),null)},update(t,e){for(let n of e.effects)n.is(ic)?t=new nm(n.value.create(),t.panel):n.is(ob)&&(t=new nm(t.query,n.value?ab:null));return t},provide:t=>Jl.from(t,e=>e.panel)});class nm{constructor(e,n){this.query=e,this.panel=n}}const $U=le.mark({class:"cm-searchMatch"}),AU=le.mark({class:"cm-searchMatch cm-searchMatch-selected"}),IU=Ue.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(Qi))}update(t){let e=t.state.field(Qi);(e!=t.startState.field(Qi)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return le.none;let{view:n}=this,r=new ti;for(let i=0,s=n.visibleRanges,o=s.length;i<o;i++){let{from:a,to:l}=s[i];for(;i<o-1&&l>s[i+1].from-2*250;)l=s[++i].to;t.highlight(n.state,a,l,(c,u)=>{let f=n.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?AU:$U)})}return r.finish()}},{decorations:t=>t.decorations});function Mc(t){return e=>{let n=e.state.field(Qi,!1);return n&&n.query.spec.valid?t(e,n):R$(e)}}const Ed=Mc((t,{query:e})=>{let{to:n}=t.state.selection.main,r=e.nextMatch(t.state,n,n);if(!r)return!1;let i=W.single(r.from,r.to),s=t.state.facet(da);return t.dispatch({selection:i,effects:[lb(t,r),s.scrollToMatch(i.main,t)],userEvent:"select.search"}),Q$(t),!0}),Td=Mc((t,{query:e})=>{let{state:n}=t,{from:r}=n.selection.main,i=e.prevMatch(n,r,r);if(!i)return!1;let s=W.single(i.from,i.to),o=t.state.facet(da);return t.dispatch({selection:s,effects:[lb(t,i),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),Q$(t),!0}),QU=Mc((t,{query:e})=>{let n=e.matchAll(t.state,1e3);return!n||!n.length?!1:(t.dispatch({selection:W.create(n.map(r=>W.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),RU=({state:t,dispatch:e})=>{let n=t.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,s=[],o=0;for(let a=new ra(t.doc,t.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(W.range(a.value.from,a.value.to))}return e(t.update({selection:W.create(s,o),userEvent:"select.search.matches"})),!0},ES=Mc((t,{query:e})=>{let{state:n}=t,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let s=e.nextMatch(n,r,r);if(!s)return!1;let o=s,a=[],l,c,u=[];o.precise?o.from==r&&o.to==i&&(c=n.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(n,o.from,o.to),u.push(ee.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))):o=e.nextMatch(n,o.from,o.to);let f=t.state.changes(a);return o&&(l=W.single(o.from,o.to).map(f),u.push(lb(t,o)),u.push(n.facet(da).scrollToMatch(l.main,t))),t.dispatch({changes:f,selection:l,effects:u,userEvent:"input.replace"}),!0}),MU=Mc((t,{query:e})=>{if(t.state.readOnly)return!1;let n=[];for(let i of e.matchAll(t.state,1e9)){let{from:s,to:o,precise:a}=i;a&&n.push({from:s,to:o,insert:e.getReplacement(i)})}if(!n.length)return!1;let r=t.state.phrase("replaced $ matches",n.length)+".";return t.dispatch({changes:n,effects:ee.announce.of(r),userEvent:"input.replace.all"}),!0});function ab(t){return t.state.facet(da).createPanel(t)}function P0(t,e){var n,r,i,s,o;let a=t.selection.main,l=a.empty||a.to>a.from+100?"":t.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=t.facet(da);return new $$({search:((n=e==null?void 0:e.literal)!==null&&n!==void 0?n:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e==null?void 0:e.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e==null?void 0:e.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function I$(t){let e=Xy(t,ab);return e&&e.dom.querySelector("[main-field]")}function Q$(t){let e=I$(t);e&&e==t.root.activeElement&&e.select()}const R$=t=>{let e=t.state.field(Qi,!1);if(e&&e.panel){let n=I$(t);if(n&&n!=t.root.activeElement){let r=P0(t.state,e.query.spec);r.valid&&t.dispatch({effects:ic.of(r)}),n.focus(),n.select()}}else t.dispatch({effects:[ob.of(!0),e?ic.of(P0(t.state,e.query.spec)):he.appendConfig.of(VU)]});return!0},M$=t=>{let e=t.state.field(Qi,!1);if(!e||!e.panel)return!1;let n=Xy(t,ab);return n&&n.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:ob.of(!1)}),!0},LU=[{key:"Mod-f",run:R$,scope:"editor search-panel"},{key:"F3",run:Ed,shift:Td,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Ed,shift:Td,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:M$,scope:"editor search-panel"},{key:"Mod-Shift-l",run:RU},{key:"Mod-Alt-g",run:hU},{key:"Mod-d",run:kU,preventDefault:!0}];class DU{constructor(e){this.view=e;let n=this.query=e.state.field(Qi).query.spec;this.commit=this.commit.bind(this),this.searchField=Te("input",{value:n.search,placeholder:rn(e,"Find"),"aria-label":rn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Te("input",{value:n.replace,placeholder:rn(e,"Replace"),"aria-label":rn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Te("input",{type:"checkbox",name:"case",form:"",checked:n.caseSensitive,onchange:this.commit}),this.reField=Te("input",{type:"checkbox",name:"re",form:"",checked:n.regexp,onchange:this.commit}),this.wordField=Te("input",{type:"checkbox",name:"word",form:"",checked:n.wholeWord,onchange:this.commit});function r(i,s,o){return Te("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=Te("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Ed(e),[rn(e,"next")]),r("prev",()=>Td(e),[rn(e,"previous")]),r("select",()=>QU(e),[rn(e,"all")]),Te("label",null,[this.caseField,rn(e,"match case")]),Te("label",null,[this.reField,rn(e,"regexp")]),Te("label",null,[this.wordField,rn(e,"by word")]),...e.state.readOnly?[]:[Te("br"),this.replaceField,r("replace",()=>ES(e),[rn(e,"replace")]),r("replaceAll",()=>MU(e),[rn(e,"replace all")])],Te("button",{name:"close",onclick:()=>M$(e),"aria-label":rn(e,"close"),type:"button"},["×"])])}commit(){let e=new $$({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:ic.of(e)}))}keydown(e){B6(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Td:Ed)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ES(this.view))}update(e){for(let n of e.transactions)for(let r of n.effects)r.is(ic)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(da).top}}function rn(t,e){return t.state.phrase(e)}const Du=30,Zu=/[\s\.,:;?!]/;function lb(t,{from:e,to:n}){let r=t.state.doc.lineAt(e),i=t.state.doc.lineAt(n).to,s=Math.max(r.from,e-Du),o=Math.min(i,n+Du),a=t.state.sliceDoc(s,o);if(s!=r.from){for(let l=0;l<Du;l++)if(!Zu.test(a[l+1])&&Zu.test(a[l])){a=a.slice(l);break}}if(o!=i){for(let l=a.length-1;l>a.length-Du;l--)if(!Zu.test(a[l-1])&&Zu.test(a[l])){a=a.slice(0,l);break}}return ee.announce.of(`${t.state.phrase("current match")}. ${a} ${t.state.phrase("on line")} ${r.number}.`)}const ZU=ee.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),VU=[Qi,Hi.low(IU),ZU];class L${constructor(e,n,r,i){this.state=e,this.pos=n,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let n=ot(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),s=i.search(Z$(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,n,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(n),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function TS(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function jU(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let s=1;s<i.length;s++)n[i[s]]=!0}let r=TS(e)+TS(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function D$(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:jU(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:n}:null}}function BU(t,e){return n=>{for(let r=ot(n.state).resolveInner(n.pos,-1);r;r=r.parent){if(t.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(n)}}class NS{constructor(e,n,r,i){this.completion=e,this.source=n,this.match=r,this.score=i}}function vs(t){return t.selection.main.from}function Z$(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?t:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}const cb=Cr.define();function FU(t,e,n,r){let{main:i}=t.selection,s=n-i.from,o=r-i.from;return{...t.changeByRange(a=>{if(a!=i&&n!=r&&t.sliceDoc(a.from+s,a.from+o)!=t.sliceDoc(n,r))return{range:a};let l=t.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:l},range:W.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const PS=new WeakMap;function XU(t){if(!Array.isArray(t))return t;let e=PS.get(t);return e||PS.set(t,e=D$(t)),e}const Nd=he.define(),sc=he.define();class zU{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let n=0;n<e.length;){let r=jt(e,n),i=Or(r);this.chars.push(r);let s=e.slice(n,n+i),o=s.toUpperCase();this.folded.push(jt(o==s?s.toLowerCase():o,0)),n+=i}this.astral=e.length!=this.chars.length}ret(e,n){return this.score=e,this.matched=n,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:s,byWord:o}=this;if(n.length==1){let b=jt(e,0),y=Or(b),v=y==e.length?0:-100;if(b!=n[0])if(b==r[0])v+=-200;else return null;return this.ret(v,[0,y])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=n.length,c=0;if(a<0){for(let b=0,y=Math.min(e.length,200);b<y&&c<l;){let v=jt(e,b);(v==n[c]||v==r[c])&&(i[c++]=b),b+=Or(v)}if(c<l)return null}let u=0,f=0,d=!1,h=0,p=-1,m=-1,O=/[a-z]/.test(e),g=!0;for(let b=0,y=Math.min(e.length,200),v=0;b<y&&f<l;){let S=jt(e,b);a<0&&(u<l&&S==n[u]&&(s[u++]=b),h<l&&(S==n[h]||S==r[h]?(h==0&&(p=b),m=b+1,h++):h=0));let E,w=S<255?S>=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(E=Ty(S))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!b||w==1&&O||v==0&&w!=0)&&(n[f]==S||r[f]==S&&(d=!0)?o[f++]=b:o.length&&(g=!1)),v=w,b+=Or(S)}return f==l&&o[0]==0&&g?this.result(-100+(d?-200:0),o,e):h==l&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[p,m]):f==l?this.result(-100+(d?-200:0)+-700+(g?0:-1100),o,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[],s=0;for(let o of n){let a=o+(this.astral?Or(jt(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class WU{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let n=e.slice(0,this.pattern.length),r=n==this.pattern?0:n.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,n.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const ct=re.define({combine(t){return $r(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:UU,filterStrict:!1,compareCompletions:(e,n)=>(e.sortText||e.label).localeCompare(n.sortText||n.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,tooltipClass:(e,n)=>r=>_S(e(r),n(r)),optionClass:(e,n)=>r=>_S(e(r),n(r)),addToOptions:(e,n)=>e.concat(n),filterStrict:(e,n)=>e||n})}});function _S(t,e){return t?e?t+" "+e:t:e}function UU(t,e,n,r,i,s){let o=t.textDirection==_e.RTL,a=o,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,p=r.right-r.left,m=r.bottom-r.top;if(a&&d<Math.min(p,h)?a=!1:!a&&h<Math.min(p,d)&&(a=!0),p<=(a?d:h))u=Math.max(i.top,Math.min(n.top,i.bottom-m))-e.top,f=Math.min(400,a?d:h);else{l=!0,f=Math.min(400,(o?e.right:i.right-e.left)-30);let b=i.bottom-e.bottom;b>=m||b>e.top?u=n.bottom-e.top:(c="bottom",u=e.bottom-n.top)}let O=(e.bottom-e.top)/s.offsetHeight,g=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${u/O}px; max-width: ${f/g}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}const ub=he.define();function YU(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=n.displayLabel||n.label,l=0;for(let c=0;c<s.length;){let u=s[c++],f=s[c++];u>l&&o.appendChild(document.createTextNode(a.slice(l,u)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return l<a.length&&o.appendChild(document.createTextNode(a.slice(l))),o},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function rm(t,e,n){if(t<=n)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.ceil((t-e)/n);return{from:t-r*n,to:t-(r-1)*n}}class GU{constructor(e,n,r){this.view=e,this.stateField=n,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(n),{options:s,selected:o}=i.open,a=e.state.facet(ct);this.optionContent=YU(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=rm(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(n).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]<c.length){this.applyCompletion(e,c[+f[1]]),l.preventDefault();return}if(l.target==this.list){let u=this.list.classList.contains("cm-completionListIncompleteTop")&&l.clientY<this.list.firstChild.getBoundingClientRect().top?this.range.from-1:this.list.classList.contains("cm-completionListIncompleteBottom")&&l.clientY>this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;u!=null&&(e.dispatch({effects:ub.of(u)}),l.preventDefault())}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(ct).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:sc.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,n){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,n,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var n;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=rm(s.length,o,e.state.facet(ct).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((n=i.open)===null||n===void 0?void 0:n.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let n=this.tooltipClass(e);if(n!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of n.split(" "))r&&this.dom.classList.add(r);this.currentClass=n}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;(n.selected>-1&&n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=rm(n.options.length,n.selected,this.view.state.facet(ct).maxRenderedOptions),this.showOptions(n.options,e.id));let r=this.updateSelectedOption(n.selected);if(r){this.destroyInfo();let{completion:i}=n.options[n.selected],{info:s}=i;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(i);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,i)}).catch(a=>Ut(this.view.state,a,"completion info")):(this.addInfoPane(o,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,n){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return n&&qU(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,n.bottom)-10||i.bottom<Math.max(s.top,n.top)+10?null:this.view.state.facet(ct).positionInfo(this.view,n,i,r,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:l}=e[o],{section:c}=a;if(c){let d=typeof c=="string"?c:c.name;if(d!=s&&(o>r.from||r.from==0))if(s=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=n+"-"+o,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function HU(t,e){return n=>new GU(n,t,e)}function qU(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=n.height/t.offsetHeight;r.top<n.top?t.scrollTop-=(n.top-r.top)/i:r.bottom>n.bottom&&(t.scrollTop+=(r.bottom-n.bottom)/i)}function CS(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function KU(t,e){let n=[],r=null,i=null,s=u=>{n.push(u);let{section:f}=u.completion;if(f){r||(r=[]);let d=typeof f=="string"?f:f.name;r.some(h=>h.name==d)||r.push(typeof f=="string"?{name:d}:f)}},o=e.facet(ct);for(let u of t)if(u.hasResult()){let f=u.result.getMatch;if(u.result.filter===!1)for(let d of u.result.options)s(new NS(d,u.source,f?f(d):[],1e9-n.length));else{let d=e.sliceDoc(u.from,u.to),h,p=o.filterStrict?new WU(d):new zU(d);for(let m of u.result.options)if(h=p.match(m.label)){let O=m.displayLabel?f?f(m,h.matched):[]:h.matched,g=h.score+(m.boost||0);if(s(new NS(m,u.source,O,g)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:b}=m.section;i||(i=Object.create(null)),i[b]=Math.max(g,i[b]||-1e9)}}}}if(r){let u=Object.create(null),f=0,d=(h,p)=>(h.rank==="dynamic"&&p.rank==="dynamic"?i[p.name]-i[h.name]:0)||(typeof h.rank=="number"?h.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(h.name<p.name?-1:1);for(let h of r.sort(d))f-=1e5,u[h.name]=f;for(let h of n){let{section:p}=h.completion;p&&(h.score+=u[typeof p=="string"?p:p.name])}}let a=[],l=null,c=o.compareCompletions;for(let u of n.sort((f,d)=>d.score-f.score||c(f.completion,d.completion))){let f=u.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(u):CS(u.completion)>CS(l)&&(a[a.length-1]=u),l=u.completion}return a}class mo{constructor(e,n,r,i,s,o){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new mo(this.options,$S(n,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,n,r,i,s,o){if(i&&!o&&e.some(c=>c.isPending))return i.setDisabled();let a=KU(e,n);if(!a.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let l=n.facet(ct).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let u=0;u<a.length;u++)if(a[u].completion==c){l=u;break}}return new mo(a,$S(r,l),{pos:e.reduce((c,u)=>u.hasResult()?Math.min(c,u.from):c,1e8),create:iY,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new mo(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new mo(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Pd{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new Pd(nY,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(ct),s=(r.override||n.languageDataAt("autocomplete",vs(n)).map(XU)).map(l=>(this.active.find(u=>u.source==l)||new Tn(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((l,c)=>l==this.active[c])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(fb));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!JU(s,this.active)||a?o=mo.build(s,n,this.id,o,r,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new Tn(l.source,0):l));for(let l of e.effects)l.is(ub)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new Pd(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?eY:tY}}function JU(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult();)n++;for(;r<e.length&&!e[r].hasResult();)r++;let i=n==t.length,s=r==e.length;if(i||s)return i==s;if(t[n++].result!=e[r++].result)return!1}}const eY={"aria-autocomplete":"list"},tY={};function $S(t,e){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(n["aria-activedescendant"]=t+"-"+e),n}const nY=[];function V$(t,e){if(t.isUserEvent("input.complete")){let r=t.annotation(cb);if(r&&e.activateOnCompletion(r))return 12}let n=t.isUserEvent("input.type");return n&&e.activateOnTyping?5:n?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Tn{constructor(e,n,r=!1){this.source=e,this.state=n,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,n){let r=V$(e,n),i=this;(r&8||r&16&&this.touches(e))&&(i=new Tn(i.source,0)),r&4&&i.state==0&&(i=new Tn(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(Nd))i=new Tn(i.source,1,s.value);else if(s.is(sc))i=new Tn(i.source,0);else if(s.is(fb))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,n){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(vs(e.state))}}class Co extends Tn{constructor(e,n,r,i,s,o){super(e,3,n),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,n){var r;if(!(n&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=vs(e.state);if(a>o||!i||n&2&&(vs(e.startState)==this.from||a<this.limit))return new Tn(this.source,n&4?1:0);let l=e.changes.mapPos(this.limit);return rY(i.validFor,e.state,s,o)?new Co(this.source,this.explicit,l,i,s,o):i.update&&(i=i.update(i,s,o,new L$(e.state,a,!1)))?new Co(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:vs(e.state)):new Tn(this.source,1,this.explicit)}map(e){if(e.empty)return this;let n=this.result.map?this.result.map(this.result,e):this.result;return n?new Co(this.source,this.explicit,e.mapPos(this.limit),n,e.mapPos(this.from),e.mapPos(this.to,1)):new Tn(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function rY(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):Z$(t,!0).test(i)}const fb=he.define({map(t,e){return t.map(n=>n.map(e))}}),Bt=wt.define({create(){return Pd.start()},update(t,e){return t.update(e)},provide:t=>[Fy.from(t,e=>e.tooltip),ee.contentAttributes.from(t,e=>e.attrs)]});function db(t,e){const n=e.completion.apply||e.completion.label;let r=t.state.field(Bt).active.find(i=>i.source==e.source);return r instanceof Co?(typeof n=="string"?t.dispatch({...FU(t.state,n,r.from,r.to),annotations:cb.of(e.completion)}):n(t,e.completion,r.from,r.to),!0):!1}const iY=HU(Bt,db);function Vu(t,e="option"){return n=>{let r=n.state.field(Bt,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(ct).interactionDelay)return!1;let i=1,s;e=="page"&&(s=bC(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(t?1:-1):t?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),n.dispatch({effects:ub.of(a)}),!0}}const sY=t=>{let e=t.state.field(Bt,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(ct).interactionDelay?!1:db(t,e.open.options[e.open.selected])},im=t=>t.state.field(Bt,!1)?(t.dispatch({effects:Nd.of(!0)}),!0):!1,oY=t=>{let e=t.state.field(Bt,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:sc.of(null)}),!0)};class aY{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const lY=50,cY=1e3,uY=Ue.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Bt).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Bt),n=t.state.facet(ct);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Bt)==e)return;let r=t.transactions.some(s=>{let o=V$(s,n);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(r||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>lY&&Date.now()-o.time>cY){for(let a of o.context.abortListeners)try{a()}catch(l){Ut(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(Nd)))&&(this.pendingStart=!0);let i=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Bt);for(let n of e.active)n.isPending&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ct).updateSyncTime))}startQuery(t){let{state:e}=this.view,n=vs(e),r=new L$(e,n,t.explicit,this.view),i=new aY(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:sc.of(null)}),Ut(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(ct).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(ct),r=this.view.state.field(Bt);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let a=vs(s.updates.length?s.updates[0].startState:this.view.state),l=Math.min(a,s.done.from+(s.active.explicit?0:1)),c=new Co(s.active.source,s.active.explicit,l,s.done,s.done.from,(t=s.done.to)!==null&&t!==void 0?t:a);for(let u of s.updates)c=c.update(u,n);if(c.hasResult()){e.push(c);continue}}let o=r.active.find(a=>a.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new Tn(s.active.source,0);for(let l of s.updates)a=a.update(l,n);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:fb.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Bt,!1);if(e&&e.tooltip&&this.view.state.facet(ct).closeOnBlur){let n=e.open&&bC(this.view,e.open.tooltip);(!n||!n.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:sc.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Nd.of(!1)}),20),this.composing=0}}}),fY=typeof navigator=="object"&&/Win/.test(navigator.platform),dY=Hi.highest(ee.domEventHandlers({keydown(t,e){let n=e.state.field(Bt,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||t.key.length>1||t.ctrlKey&&!(fY&&t.altKey)||t.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&db(e,r),!1}})),j$=ee.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class hY{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class hb{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,yt.TrackDel),r=e.mapPos(this.to,1,yt.TrackDel);return n==null||r==null?null:new hb(this.field,n,r)}}class pb{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],s=e.doc.lineAt(n),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let c=o,u=/^\t*/.exec(l)[0].length;for(let f=0;f<u;f++)c+=e.facet(Ic);i.push(n+c.length-u),l=c+l.slice(u)}r.push(l),n+=l.length+1}let a=this.fieldPositions.map(l=>new hb(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1;a===0&&(a=1e9);let u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<n.length;f++)(a!=null?n[f].seq==a:u&&n[f].name==u)&&(c=f);if(c<0){let f=0;for(;f<n.length&&(a==null||n[f].seq!=null&&n[f].seq<a);)f++;n.splice(f,0,{seq:a,name:u}),c=f;for(let d of i)d.field>=c&&d.field++}for(let f of i)if(f.line==r.length&&f.from>s.index){let d=s[2]?3+(s[1]||"").length:2;f.from-=d,f.to-=d}i.push(new hY(c,r.length,s.index,s.index+u.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(o)}return new pb(r,i)}}let pY=le.widget({widget:new class extends tr{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),mY=le.mark({class:"cm-snippetField"});class ha{constructor(e,n){this.ranges=e,this.active=n,this.deco=le.set(e.map(r=>(r.from==r.to?pY:mY).range(r.from,r.to)),!0)}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new ha(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Lc=he.define({map(t,e){return t&&t.map(e)}}),gY=he.define(),oc=wt.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Lc))return n.value;if(n.is(gY)&&t)return new ha(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ee.decorations.from(t,e=>e?e.deco:le.none)});function mb(t,e){return W.create(t.filter(n=>n.field==e).map(n=>W.range(n.from,n.to)))}function OY(t){let e=pb.parse(t);return(n,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(n.state,i),{main:l}=n.state.selection,c={changes:{from:i,to:s==l.from?l.to:s,insert:xe.of(o)},scrollIntoView:!0,annotations:r?[cb.of(r),et.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=mb(a,0)),a.some(u=>u.field>0)){let u=new ha(a,0),f=c.effects=[Lc.of(u)];n.state.field(oc,!1)===void 0&&f.push(he.appendConfig.of([oc,wY,SY,j$]))}n.dispatch(n.state.update(c))}}function B$(t){return({state:e,dispatch:n})=>{let r=e.field(oc,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,s=t>0&&!r.ranges.some(o=>o.field==i+t);return n(e.update({selection:mb(r.ranges,i),effects:Lc.of(s?null:new ha(r.ranges,i)),scrollIntoView:!0})),!0}}const yY=({state:t,dispatch:e})=>t.field(oc,!1)?(e(t.update({effects:Lc.of(null)})),!0):!1,bY=B$(1),xY=B$(-1),vY=[{key:"Tab",run:bY,shift:xY},{key:"Escape",run:yY}],AS=re.define({combine(t){return t.length?t[0]:vY}}),wY=Hi.highest(Ac.compute([AS],t=>t.facet(AS)));function Dt(t,e){return{...e,apply:OY(t)}}const SY=ee.domEventHandlers({mousedown(t,e){let n=e.state.field(oc,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:mb(n.ranges,i.field),effects:Lc.of(n.ranges.some(s=>s.field>i.field)?new ha(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),ac={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ps=he.define({map(t,e){let n=e.mapPos(t,-1,yt.TrackAfter);return n??void 0}}),gb=new class extends Zi{};gb.startSide=1;gb.endSide=-1;const F$=wt.define({create(){return ge.empty},update(t,e){if(t=t.map(e.changes),e.selection){let n=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:r=>r>=n.from&&r<=n.to})}for(let n of e.effects)n.is(ps)&&(t=t.update({add:[gb.range(n.value,n.value+1)]}));return t}});function kY(){return[TY,F$]}const sm="()[]{}<>«»»«[]{}";function X$(t){for(let e=0;e<sm.length;e+=2)if(sm.charCodeAt(e)==t)return sm.charAt(e+1);return Ty(t<128?t:t+1)}function z$(t,e){return t.languageDataAt("closeBrackets",e)[0]||ac}const EY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),TY=ee.inputHandler.of((t,e,n,r)=>{if((EY?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&Or(jt(r,0))==1||e!=i.from||n!=i.to)return!1;let s=_Y(t.state,r);return s?(t.dispatch(s),!0):!1}),NY=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=z$(t,t.selection.main.head).brackets||ac.brackets,i=null,s=t.changeByRange(o=>{if(o.empty){let a=CY(t.doc,o.head);for(let l of r)if(l==a&&Ph(t.doc,o.head)==X$(jt(l,0)))return{changes:{from:o.head-l.length,to:o.head+l.length},range:W.cursor(o.head-l.length)}}return{range:i=o}});return i||e(t.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},PY=[{key:"Backspace",run:NY}];function _Y(t,e){let n=z$(t,t.selection.main.head),r=n.brackets||ac.brackets;for(let i of r){let s=X$(jt(i,0));if(e==i)return s==i?IY(t,i,r.indexOf(i+i+i)>-1,n):$Y(t,i,s,n.before||ac.before);if(e==s&&W$(t,t.selection.main.from))return AY(t,i,s)}return null}function W$(t,e){let n=!1;return t.field(F$).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function Ph(t,e){let n=t.sliceString(e,e+2);return n.slice(0,Or(jt(n,0)))}function CY(t,e){let n=t.sliceString(e-2,e);return Or(jt(n,0))==n.length?n:n.slice(1)}function $Y(t,e,n,r){let i=null,s=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:n,from:o.to}],effects:ps.of(o.to+e.length),range:W.range(o.anchor+e.length,o.head+e.length)};let a=Ph(t.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:o.head},effects:ps.of(o.head+e.length),range:W.cursor(o.head+e.length)}:{range:i=o}});return i?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function AY(t,e,n){let r=null,i=t.changeByRange(s=>s.empty&&Ph(t.doc,s.head)==n?{changes:{from:s.head,to:s.head+n.length,insert:n},range:W.cursor(s.head+n.length)}:r={range:s});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function IY(t,e,n,r){let i=r.stringPrefixes||ac.stringPrefixes,s=null,o=t.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:ps.of(a.to+e.length),range:W.range(a.anchor+e.length,a.head+e.length)};let l=a.head,c=Ph(t.doc,l),u;if(c==e){if(IS(t,l))return{changes:{insert:e+e,from:l},effects:ps.of(l+e.length),range:W.cursor(l+e.length)};if(W$(t,l)){let d=n&&t.sliceDoc(l,l+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:l,to:l+d.length,insert:d},range:W.cursor(l+d.length)}}}else{if(n&&t.sliceDoc(l-2*e.length,l)==e+e&&(u=QS(t,l-2*e.length,i))>-1&&IS(t,u))return{changes:{insert:e+e+e+e,from:l},effects:ps.of(l+e.length),range:W.cursor(l+e.length)};if(t.charCategorizer(l)(c)!=Me.Word&&QS(t,l,i)>-1&&!QY(t,l,e,i))return{changes:{insert:e+e,from:l},effects:ps.of(l+e.length),range:W.cursor(l+e.length)}}return{range:s=a}});return s?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function IS(t,e){let n=ot(t).resolveInner(e+1);return n.parent&&n.from==e}function QY(t,e,n,r){let i=ot(t).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=t.sliceDoc(i.from,Math.min(i.to,i.from+n.length+s)),l=a.indexOf(n);if(!l||l>-1&&r.indexOf(a.slice(0,l))>-1){let u=i.firstChild;for(;u&&u.from==i.from&&u.to-u.from>n.length+l;){if(t.sliceDoc(u.to-n.length,u.to)==n)return!1;u=u.firstChild}return!0}let c=i.to==e&&i.parent;if(!c)break;i=c}return!1}function QS(t,e,n){let r=t.charCategorizer(e);if(r(t.sliceDoc(e-1,e))!=Me.Word)return e;for(let i of n){let s=e-i.length;if(t.sliceDoc(s,e)==i&&r(t.sliceDoc(s-1,s))!=Me.Word)return s}return-1}function RY(t={}){return[dY,Bt,ct.of(t),uY,MY,j$]}const U$=[{key:"Ctrl-Space",run:im},{mac:"Alt-`",run:im},{mac:"Alt-i",run:im},{key:"Escape",run:oY},{key:"ArrowDown",run:Vu(!0)},{key:"ArrowUp",run:Vu(!1)},{key:"PageDown",run:Vu(!0,"page")},{key:"PageUp",run:Vu(!1,"page")},{key:"Enter",run:sY}],MY=Hi.highest(Ac.computeN([ct],t=>t.facet(ct).defaultKeymap?[U$]:[]));class RS{constructor(e,n,r){this.from=e,this.to=n,this.diagnostic=r}}class ls{constructor(e,n,r){this.diagnostics=e,this.panel=n,this.selected=r}static init(e,n,r){let i=r.facet(lc).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((h,p)=>h.from-p.from||h.to-p.to),o=new ti,a=[],l=0,c=r.doc.iter(),u=0,f=r.doc.length;for(let h=0;;){let p=h==s.length?null:s[h];if(!p&&!a.length)break;let m,O;if(a.length)m=l,O=a.reduce((y,v)=>Math.min(y,v.to),p&&p.from>m?p.from:1e8);else{if(m=p.from,m>f)break;O=p.to,a.push(p),h++}for(;h<s.length;){let y=s[h];if(y.from==m&&(y.to>y.from||y.to==m))a.push(y),h++,O=Math.min(y.to,O);else{O=Math.min(y.from,O);break}}O=Math.min(O,f);let g=!1;if(a.some(y=>y.from==m&&(y.to==O||O==f))&&(g=m==O,!g&&O-m<10)){let y=m-(u+c.value.length);y>0&&(c.next(y),u=m);for(let v=m;;){if(v>=O){g=!0;break}if(!c.lineBreak&&u+c.value.length>v)break;v=u+c.value.length,u+=c.value.length,c.next()}}let b=GY(a);if(g)o.add(m,m,le.widget({widget:new zY(b),diagnostics:a.slice()}));else{let y=a.reduce((v,S)=>S.markClass?v+" "+S.markClass:v,"");o.add(m,O,le.mark({class:"cm-lintRange cm-lintRange-"+b+y,diagnostics:a.slice(),inclusiveEnd:a.some(v=>v.to>O)}))}if(l=O,l==f)break;for(let y=0;y<a.length;y++)a[y].to<=l&&a.splice(y--,1)}let d=o.finish();return new ls(d,n,zi(d))}}function zi(t,e=null,n=0){let r=null;return t.between(n,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new RS(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new RS(r.from,s,r.diagnostic)}}),r}function LY(t,e){let n=e.pos,r=e.end||n,i=t.state.facet(lc).hideOn(t,n,r);if(i!=null)return i;let s=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(Y$))||t.changes.touchesRange(s.from,Math.max(s.to,r)))}function DY(t,e){return t.field(fn,!1)?e:e.concat(he.appendConfig.of(HY))}const Y$=he.define(),Ob=he.define(),G$=he.define(),fn=wt.define({create(){return new ls(le.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let n=t.diagnostics.map(e.changes),r=null,i=t.panel;if(t.selected){let s=e.changes.mapPos(t.selected.from,1);r=zi(n,t.selected.diagnostic,s)||zi(n,null,s)}!n.size&&i&&e.state.facet(lc).autoPanel&&(i=null),t=new ls(n,i,r)}for(let n of e.effects)if(n.is(Y$)){let r=e.state.facet(lc).autoPanel?n.value.length?cc.open:null:t.panel;t=ls.init(n.value,r,e.state)}else n.is(Ob)?t=new ls(t.diagnostics,n.value?cc.open:null,t.selected):n.is(G$)&&(t=new ls(t.diagnostics,t.panel,n.value));return t},provide:t=>[Jl.from(t,e=>e.panel),ee.decorations.from(t,e=>e.diagnostics)]}),ZY=le.mark({class:"cm-lintRange cm-lintRange-active"});function VY(t,e,n){let{diagnostics:r}=t.state.field(fn),i,s=-1,o=-1;r.between(e-(n<0?1:0),e+(n>0?1:0),(l,c,{spec:u})=>{if(e>=l&&e<=c&&(l==c||(e>l||n>0)&&(e<c||n<0)))return i=u.diagnostics,s=l,o=c,!1});let a=t.state.facet(lc).tooltipFilter;return i&&a&&(i=a(i,t.state)),i?{pos:s,end:o,above:!0,create(){return{dom:jY(t,i)}}}:null}function jY(t,e){return Te("ul",{class:"cm-tooltip-lint"},e.map(n=>q$(t,n,!1)))}const BY=t=>{let e=t.state.field(fn,!1);(!e||!e.panel)&&t.dispatch({effects:DY(t.state,[Ob.of(!0)])});let n=Xy(t,cc.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},MS=t=>{let e=t.state.field(fn,!1);return!e||!e.panel?!1:(t.dispatch({effects:Ob.of(!1)}),!0)},FY=t=>{let e=t.state.field(fn,!1);if(!e)return!1;let n=t.state.selection.main,r=zi(e.diagnostics,null,n.to+1);return!r&&(r=zi(e.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(t.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),$9(t,r.from,1,{tooltip:K$,until:i=>i.docChanged||i.newSelection.main.head<r.from||i.newSelection.main.head>r.to}),!0)},XY=[{key:"Mod-Shift-m",run:BY,preventDefault:!0},{key:"F8",run:FY}],lc=re.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...$r(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:LS,tooltipFilter:LS,needsRefresh:(e,n)=>e?n?r=>e(r)||n(r):e:n,hideOn:(e,n)=>e?n?(r,i,s)=>e(r,i,s)||n(r,i,s):e:n,autoPanel:(e,n)=>e||n})}}});function LS(t,e){return t?e?(n,r)=>e(t(n,r),r):t:e}function H$(t){let e=[];if(t)e:for(let{name:n}of t){for(let r=0;r<n.length;r++){let i=n[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function q$(t,e,n){var r;let i=n?H$(e.actions):[];return Te("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Te("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let a=!1,l=h=>{if(h.preventDefault(),a)return;a=!0;let p=zi(t.state.field(fn).diagnostics,e);p&&s.apply(t,p.from,p.to)},{name:c}=s,u=i[o]?c.indexOf(i[o]):-1,f=u<0?c:[c.slice(0,u),Te("u",c.slice(u,u+1)),c.slice(u+1)],d=s.markClass?" "+s.markClass:"";return Te("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:l,onmousedown:l,"aria-label":` Action: ${c}${u<0?"":` (access key "${i[o]})"`}.`},f)}),e.source&&Te("div",{class:"cm-diagnosticSource"},e.source))}class zY extends tr{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Te("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class DS{constructor(e,n){this.diagnostic=n,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=q$(e,n,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class cc{constructor(e){this.view=e,this.items=[];let n=i=>{if(!(i.ctrlKey||i.altKey||i.metaKey)){if(i.keyCode==27)MS(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=H$(s.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==i.keyCode){let l=zi(this.view.state.field(fn).diagnostics,s);l&&s.actions[a].apply(e,l.from,l.to)}}else return;i.preventDefault()}},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=Te("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:n,onclick:r}),this.dom=Te("div",{class:"cm-panel-lint"},this.list,Te("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>MS(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(fn).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(fn),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,l,{spec:c})=>{for(let u of c.diagnostics){if(o.has(u))continue;o.add(u);let f=-1,d;for(let h=r;h<this.items.length;h++)if(this.items[h].diagnostic==u){f=h;break}f<0?(d=new DS(this.view,u),this.items.splice(r,0,d),i=!0):(d=this.items[f],f>r&&(this.items.splice(r,f-r),i=!0)),n&&d.diagnostic==n.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new DS(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!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:a,panel:l})=>{let c=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/c:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function n(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)n();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)n()}moveSelection(e){if(this.selectedIndex<0)return;let n=this.view.state.field(fn),r=zi(n.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:G$.of(r)})}static open(e){return new cc(e)}}function WY(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 ju(t){return WY(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const UY=ee.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:ju("#f11")},".cm-lintRange-warning":{backgroundImage:ju("orange")},".cm-lintRange-info":{backgroundImage:ju("#999")},".cm-lintRange-hint":{backgroundImage:ju("#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 YY(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function GY(t){let e="hint",n=1;for(let r of t){let i=YY(r.severity);i>n&&(n=i,e=r.severity)}return e}const K$=C9(VY,{hideOn:LY}),HY=[fn,ee.decorations.compute([fn],t=>{let{selected:e,panel:n}=t.field(fn);return!e||!n||e.from==e.to?le.none:le.set([ZY.range(e.from,e.to)])}),K$,UY];var ZS=function(e){e===void 0&&(e={});var n=e,r=n.crosshairCursor,i=r===void 0?!1:r,s=[];e.closeBracketsKeymap!==!1&&(s=s.concat(PY)),e.defaultKeymap!==!1&&(s=s.concat(uU)),e.searchKeymap!==!1&&(s=s.concat(LU)),e.historyKeymap!==!1&&(s=s.concat(OW)),e.foldKeymap!==!1&&(s=s.concat($8)),e.completionKeymap!==!1&&(s=s.concat(U$)),e.lintKeymap!==!1&&(s=s.concat(XY));var o=[];return e.lineNumbers!==!1&&o.push(X9()),e.highlightActiveLineGutter!==!1&&o.push(U9()),e.highlightSpecialChars!==!1&&o.push(s9()),e.history!==!1&&o.push(lW()),e.foldGutter!==!1&&o.push(R8()),e.drawSelection!==!1&&o.push(Y6()),e.dropCursor!==!1&&o.push(J6()),e.allowMultipleSelections!==!1&&o.push(ye.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&o.push(w8()),e.syntaxHighlighting!==!1&&o.push(tb(Z8,{fallback:!0})),e.bracketMatching!==!1&&o.push(W8()),e.closeBrackets!==!1&&o.push(kY()),e.autocompletion!==!1&&o.push(RY()),e.rectangularSelection!==!1&&o.push(b9()),i!==!1&&o.push(w9()),e.highlightActiveLine!==!1&&o.push(f9()),e.highlightSelectionMatches!==!1&&o.push(gU()),e.tabSize&&typeof e.tabSize=="number"&&o.push(Ic.of(" ".repeat(e.tabSize))),o.concat([Ac.of(s.flat())]).filter(Boolean)};const qY="#e5c07b",VS="#e06c75",KY="#56b6c2",JY="#ffffff",mf="#abb2bf",_0="#7d8799",e7="#61afef",t7="#98c379",jS="#d19a66",n7="#c678dd",r7="#21252b",BS="#2c313a",FS="#282c34",om="#353a42",i7="#3E4451",XS="#528bff",s7=ee.theme({"&":{color:mf,backgroundColor:FS},".cm-content":{caretColor:XS},".cm-cursor, .cm-dropCursor":{borderLeftColor:XS},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:i7},".cm-panels":{backgroundColor:r7,color:mf},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:FS,color:_0,border:"none"},".cm-activeLineGutter":{backgroundColor:BS},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:om},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:om,borderBottomColor:om},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:BS,color:mf}}},{dark:!0}),o7=ua.define([{tag:T.keyword,color:n7},{tag:[T.name,T.deleted,T.character,T.propertyName,T.macroName],color:VS},{tag:[T.function(T.variableName),T.labelName],color:e7},{tag:[T.color,T.constant(T.name),T.standard(T.name)],color:jS},{tag:[T.definition(T.name),T.separator],color:mf},{tag:[T.typeName,T.className,T.number,T.changed,T.annotation,T.modifier,T.self,T.namespace],color:qY},{tag:[T.operator,T.operatorKeyword,T.url,T.escape,T.regexp,T.link,T.special(T.string)],color:KY},{tag:[T.meta,T.comment],color:_0},{tag:T.strong,fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:T.link,color:_0,textDecoration:"underline"},{tag:T.heading,fontWeight:"bold",color:VS},{tag:[T.atom,T.bool,T.special(T.variableName)],color:jS},{tag:[T.processingInstruction,T.string,T.inserted],color:t7},{tag:T.invalid,color:JY}]),a7=[s7,tb(o7)];var l7=ee.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),c7=function(e){e===void 0&&(e={});var n=e,r=n.indentWithTab,i=r===void 0?!0:r,s=n.editable,o=s===void 0?!0:s,a=n.readOnly,l=a===void 0?!1:a,c=n.theme,u=c===void 0?"light":c,f=n.placeholder,d=f===void 0?"":f,h=n.basicSetup,p=h===void 0?!0:h,m=[];switch(i&&m.unshift(Ac.of([fU])),p&&(typeof p=="boolean"?m.unshift(ZS()):m.unshift(ZS(p))),d&&m.unshift(m9(d)),u){case"light":m.push(l7);break;case"dark":m.push(a7);break;case"none":break;default:m.push(u);break}return o===!1&&m.push(ee.editable.of(!1)),l&&m.push(ye.readOnly.of(!0)),[...m]},u7=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class f7{constructor(e,n){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=n,this.timeoutMS=n,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(n=>{try{n()}catch(r){console.error("TimeoutLatch callback error:",r)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class zS{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var am=null,d7=()=>typeof window>"u"?new zS:(am||(am=new zS),am),WS=Cr.define(),h7=200,p7=[];function m7(t){var e=t.value,n=t.selection,r=t.onChange,i=t.onStatistics,s=t.onCreateEditor,o=t.onUpdate,a=t.extensions,l=a===void 0?p7:a,c=t.autoFocus,u=t.theme,f=u===void 0?"light":u,d=t.height,h=d===void 0?null:d,p=t.minHeight,m=p===void 0?null:p,O=t.maxHeight,g=O===void 0?null:O,b=t.width,y=b===void 0?null:b,v=t.minWidth,S=v===void 0?null:v,E=t.maxWidth,w=E===void 0?null:E,k=t.placeholder,N=k===void 0?"":k,$=t.editable,C=$===void 0?!0:$,_=t.readOnly,V=_===void 0?!1:_,P=t.indentWithTab,M=P===void 0?!0:P,R=t.basicSetup,L=R===void 0?!0:R,I=t.root,A=t.initialState,D=Q.useState(),B=D[0],F=D[1],q=Q.useState(),j=q[0],H=q[1],G=Q.useState(),ne=G[0],z=G[1],J=Q.useState(()=>({current:null}))[0],ue=Q.useState(()=>({current:null}))[0],fe=ee.theme({"&":{height:h,minHeight:m,maxHeight:g,width:y,minWidth:S,maxWidth:w},"& .cm-scroller":{height:"100% !important"}}),oe=ee.updateListener.of(de=>{if(de.docChanged&&typeof r=="function"&&!de.transactions.some(St=>St.annotation(WS))){J.current?J.current.reset():(J.current=new f7(()=>{if(ue.current){var St=ue.current;ue.current=null,St()}J.current=null},h7),d7().add(J.current));var pe=de.state.doc,we=pe.toString();r(we,de)}i&&i(u7(de))}),X=c7({theme:f,editable:C,readOnly:V,placeholder:N,indentWithTab:M,basicSetup:L}),ae=[oe,fe,...X];return o&&typeof o=="function"&&ae.push(ee.updateListener.of(o)),ae=ae.concat(l),Q.useLayoutEffect(()=>{if(B&&!ne){var de={doc:e,selection:n,extensions:ae},pe=A?ye.fromJSON(A.json,de,A.fields):ye.create(de);if(z(pe),!j){var we=new ee({state:pe,parent:B,root:I});H(we),s&&s(we,pe)}}return()=>{j&&(z(void 0),H(void 0))}},[B,ne]),Q.useEffect(()=>{t.container&&F(t.container)},[t.container]),Q.useEffect(()=>()=>{j&&(j.destroy(),H(void 0)),J.current&&(J.current.cancel(),J.current=null)},[j]),Q.useEffect(()=>{c&&j&&j.focus()},[c,j]),Q.useEffect(()=>{j&&j.dispatch({effects:he.reconfigure.of(ae)})},[f,l,h,m,g,y,S,w,N,C,V,M,L,r,o]),Q.useEffect(()=>{if(e!==void 0){var de=j?j.state.doc.toString():"";if(j&&e!==de){var pe=J.current&&!J.current.isDone,we=()=>{j&&e!==j.state.doc.toString()&&j.dispatch({changes:{from:0,to:j.state.doc.toString().length,insert:e||""},annotations:[WS.of(!0)]})};pe?ue.current=we:we()}}},[e,j]),{state:ne,setState:z,view:j,setView:H,container:B,setContainer:F}}var g7=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],Dc=Q.forwardRef((t,e)=>{var n=t.className,r=t.value,i=r===void 0?"":r,s=t.selection,o=t.extensions,a=o===void 0?[]:o,l=t.onChange,c=t.onStatistics,u=t.onCreateEditor,f=t.onUpdate,d=t.autoFocus,h=t.theme,p=h===void 0?"light":h,m=t.height,O=t.minHeight,g=t.maxHeight,b=t.width,y=t.minWidth,v=t.maxWidth,S=t.basicSetup,E=t.placeholder,w=t.indentWithTab,k=t.editable,N=t.readOnly,$=t.root,C=t.initialState,_=RX(t,g7),V=Q.useRef(null),P=m7({root:$,value:i,autoFocus:d,theme:p,height:m,minHeight:O,maxHeight:g,width:b,minWidth:y,maxWidth:v,basicSetup:S,placeholder:E,indentWithTab:w,editable:k,readOnly:N,selection:s,onChange:l,onStatistics:c,onCreateEditor:u,onUpdate:f,extensions:a,initialState:C}),M=P.state,R=P.view,L=P.container,I=P.setContainer;Q.useImperativeHandle(e,()=>({editor:V.current,state:M,view:R}),[V,L,M,R]);var A=Q.useCallback(B=>{V.current=B,I(B)},[I]);if(typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var D=typeof p=="string"?"cm-theme-"+p:"cm-theme";return x.jsx("div",zl({ref:A,className:""+D+(n?" "+n:"")},_))});Dc.displayName="CodeMirror";var US={};class _d{constructor(e,n,r,i,s,o,a,l,c,u=0,f){this.p=e,this.stack=n,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,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,r=0){let i=e.parser.context;return new _d(e,[],n,r,r,0,[],0,i?new YS(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,n){this.stack.push(this.state,n,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var n;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=s.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){i<s.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from;i<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[i])===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=l?this.stack[l-1]:0,d=this.bufferBase+this.buffer.length-f;if(i<s.minRepeatTerm||e&131072){let h=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,h,d+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=s.getGoto(h,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,n,r,i=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==r)return;if(this.buffer[o-2]>=n){this.buffer[o-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,n,r,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)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,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=n,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,n,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(n,r),n<=this.p.parser.maxNode&&this.buffer.push(n,r,i,4);else{let s=e,{parser:o}=this.p;this.pos=i;let a=o.stateFlag(s,1);!a&&(i>r||n<=o.maxNode)&&(this.reducePos=i),this.pushState(s,a?r:Math.min(r,this.reducePos)),this.shiftContext(n,r),n<=o.maxNode&&this.buffer.push(n,r,i,4)}}apply(e,n,r,i){e&65536?this.reduce(e):this.shift(e,n,r,i)}useNode(e,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(n,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,n=e.buffer.length;for(n&&e.buffer[n-4]==0&&(n-=4);n>0&&e.buffer[n-2]>e.reducePos;)n-=4;let r=e.buffer.slice(n),i=e.bufferBase+n;for(;e&&i==e.bufferBase;)e=e.parent;return new _d(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,n){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,n,4),this.storeNode(0,this.pos,n,r?8:4),this.pos=this.reducePos=n,this.score-=190}canShift(e){for(let n=new O7(this);;){let r=this.p.parser.stateSlot(n.state,4)||this.p.parser.hasAction(n.state,e);if(r==0)return!1;if(!(r&65536))return!0;n.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let n=this.p.parser.nextStates(this.state);if(n.length>8||this.stack.length>=120){let i=[];for(let s=0,o;s<n.length;s+=2)(o=n[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(n[s],o);if(this.stack.length<120)for(let s=0;i.length<8&&s<n.length;s+=2){let o=n[s+1];i.some((a,l)=>l&1&&a==o)||i.push(n[s],o)}n=i}let r=[];for(let i=0;i<n.length&&r.length<4;i+=2){let s=n[i+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[i],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,n=e.stateSlot(this.state,5);if(!(n&65536))return!1;if(!e.validAction(this.state,n)){let r=n>>19,i=n&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!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=[],r=(i,s)=>{if(!n.includes(i))return n.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let n=0;n<this.stack.length;n+=3)if(this.stack[n]!=e.stack[n])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(n)))}reduceContext(e,n){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(n)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let n=new YS(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()}}class YS{constructor(e,n){this.tracker=e,this.context=n,this.hash=e.strict?e.hash(n):0}}class O7{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let n=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],n,!0);this.state=i}}class Cd{constructor(e,n,r){this.stack=e,this.pos=n,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,n=e.bufferBase+e.buffer.length){return new Cd(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 Cd(this.stack,this.pos,this.index)}}function Ba(t,e=Uint16Array){if(typeof t!="string")return t;let n=null;for(let r=0,i=0;r<t.length;){let s=0;for(;;){let o=t.charCodeAt(r++),a=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}n?n[i++]=s:n=new e(s)}return n}class gf{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const GS=new gf;class y7{constructor(e,n){this.input=e,this.ranges=n,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=GS,this.rangeIndex=0,this.pos=this.chunkPos=n[0].from,this.range=n[0],this.end=n[n.length-1].to,this.readNext()}resolveOffset(e,n){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let o=this.ranges[--i];s-=r.from-o.to,r=o}for(;n<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=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,r,i;if(n>=0&&n<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(n);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,n=0){let r=n?this.resolveOffset(n,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}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=GS,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,n){if(e>=this.chunkPos&&n<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,n-this.chunkPos);if(e>=this.chunk2Pos&&n<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,n-this.chunk2Pos);if(e>=this.range.from&&n<=this.range.to)return this.input.read(e,n);let r="";for(let i of this.ranges){if(i.from>=n)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,n)))}return r}}class $o{constructor(e,n){this.data=e,this.id=n}token(e,n){let{parser:r}=n.p;J$(this.data,e,n,this.id,r.data,r.tokenPrecTable)}}$o.prototype.contextual=$o.prototype.fallback=$o.prototype.extend=!1;class C0{constructor(e,n,r){this.precTable=n,this.elseToken=r,this.data=typeof e=="string"?Ba(e):e}token(e,n){let r=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(J$(this.data,e,n,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}C0.prototype.contextual=$o.prototype.fallback=$o.prototype.extend=!1;class Zc{constructor(e,n={}){this.token=e,this.contextual=!!n.contextual,this.fallback=!!n.fallback,this.extend=!!n.extend}}function J$(t,e,n,r,i,s){let o=0,a=1<<r,{dialect:l}=n.p.parser;e:for(;a&t[o];){let c=t[o+1];for(let h=o+3;h<c;h+=2)if((t[h+1]&a)>0){let p=t[h];if(l.allows(p)&&(e.token.value==-1||e.token.value==p||b7(p,e.token.value,i,s))){e.acceptToken(p);break}}let u=e.next,f=0,d=t[o+2];if(e.next<0&&d>f&&t[c+d*3-3]==65535){o=t[c+d*3-1];continue e}for(;f<d;){let h=f+d>>1,p=c+h+(h<<1),m=t[p],O=t[p+1]||65536;if(u<m)d=h;else if(u>=O)f=h+1;else{o=t[p+2],e.advance();continue e}}break}}function HS(t,e,n){for(let r=e,i;(i=t[r])!=65535;r++)if(i==n)return r-e;return-1}function b7(t,e,n,r){let i=HS(n,r,e);return i<0||HS(n,r,t)<i}const sn=typeof process<"u"&&US&&/\bparse\b/.test(US.LOG);let lm=null;function qS(t,e,n){let r=t.cursor(Ve.IncludeAnonymous);for(r.moveTo(e);;)if(!(n<0?r.childBefore(e):r.childAfter(e)))for(;;){if((n<0?r.to<e:r.from>e)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(t.length,Math.max(r.from+1,e+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:t.length}}class x7{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?qS(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?qS(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],i=this.index[n];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],o=this.start[n]+r.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof Ke){if(o==e){if(o<this.safeFrom)return null;let a=o+s.length;if(a<=this.safeTo){let l=s.prop(me.lookAhead);if(!l||a+l<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}}}class v7{constructor(e,n){this.stream=n,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new gf)}getActions(e){let n=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<s.length;c++){if(!(1<<c&o))continue;let u=s[c],f=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=a)&&(this.updateCachedToken(f,u,e),f.mask=o,f.context=a),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=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&&(r=f,n>d))break}}for(;this.actions.length>n;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new gf,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,n=this.addActions(e,r.value,r.end,n)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let n=new gf,{pos:r,p:i}=e;return n.start=r,n.end=Math.min(r+1,i.stream.end),n.value=r==i.stream.end?i.parser.eofTerm:0,n}updateCachedToken(e,n,r){let i=this.stream.clipPos(r.pos);if(n.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let a=s.specializers[o](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,n,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=n,this.actions[i++]=r,i}addActions(e,n,r,i){let{state:s}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let c=o.stateSlot(s,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=jr(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(jr(a,c+2),n,r,i));break}a[c]==n&&(i=this.putAction(jr(a,c+1),n,r,i))}return i}}class w7{constructor(e,n,r,i){this.parser=e,this.input=n,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new y7(n,i),this.tokens=new v7(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[_d.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new x7(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,n=this.minStackPos,r=this.stacks=[],i,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 a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>n)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&E7(i);if(o)return sn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw sn&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+n);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return sn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>n)&&this.recovering--}else if(r.length>1){e:for(let o=0;o<r.length-1;o++){let a=r[o];for(let l=o+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,a)=>a.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[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,r){let i=e.pos,{parser:s}=this,o=sn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>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(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(me.contextHash)||0)==u))return e.useNode(f,d),sn&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof Ke)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof Ke&&f.positions[0]==0)f=h;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),sn&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],f=l[c++],d=l[c++],h=c==l.length||!r,p=h?e:e.split(),m=this.tokens.mainToken;if(p.apply(u,f,m?m.start:p.pos,d),sn&&console.log(o+this.stackID(p)+` (via ${u&65536?`reduce of ${s.getName(u&65535)}`:"shift"} for ${s.getName(f)} @ ${i}${p==e?"":", split"})`),h)return!0;p.pos>i?n.push(p):r.push(p)}return!1}advanceFully(e,n){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return KS(e,n),!0}}runRecovery(e,n,r){let i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o],l=n[o<<1],c=n[(o<<1)+1],u=sn?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),sn&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;h<10&&f.forceReduce()&&(sn&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)sn&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))sn&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),sn&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),KS(a,r)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(e){return e.close(),Ke.build({buffer:Cd.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=(lm||(lm=new WeakMap)).get(e);return n||lm.set(e,n=String.fromCodePoint(this.nextStackID++)),n+e}}function KS(t,e){for(let n=0;n<e.length;n++){let r=e[n];if(r.pos==t.pos&&r.sameState(t)){e[n].score<t.score&&(e[n]=t);return}}e.push(t)}class S7{constructor(e,n,r){this.source=e,this.flags=n,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const cm=t=>t;class k7{constructor(e){this.start=e.start,this.shift=e.shift||cm,this.reduce=e.reduce||cm,this.reuse=e.reuse||cm,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class uc extends _C{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 a=0;a<e.repeatNodeCount;a++)n.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<n.length;a++)i.push([]);function s(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=me[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)s(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)s(a[c++],l,f);c++}}}this.nodeSet=new zy(n.map((a,l)=>en.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=EC;let o=Ba(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(JS),this.states=Ba(e.states,Uint32Array),this.data=Ba(e.stateData),this.goto=Ba(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new $o(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,n,r){let i=new w7(this,e,n,r);for(let s of this.wrappers)i=s(i,e,n,r);return i}getGoto(e,n,r=!1){let i=this.goto;if(n>=i[0])return-1;for(let s=i[n+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let c=s+(o>>1);s<c;s++)if(i[s]==e)return l;if(a)return-1}}hasAction(e,n){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=r[s])==65535)if(r[s+1]==1)o=r[s=jr(r,s+2)];else{if(r[s+1]==2)return jr(r,s+2);break}if(o==n||o==0)return jr(r,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,r=>r==n?!0:null)}allActions(e,n){let r=this.stateSlot(e,4),i=r?n(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=jr(this.data,s+2);else break;i=n(jr(this.data,s+1))}return i}nextStates(e){let n=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=jr(this.data,r+2);else break;if(!(this.data[r+2]&1)){let i=this.data[r+1];n.some((s,o)=>o&1&&s==i)||n.push(this.data[r],i)}}return n}configure(e){let n=Object.assign(Object.create(uc.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);n.top=r}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return n.specializers[i]=JS(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),r=n.map(()=>!1);if(e)for(let s of e.split(" ")){let o=n.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;s<n.length;s++)if(!r[s])for(let o=this.dialects[n[s]],a;(a=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new S7(e,r,i)}static deserialize(e){return new uc(e)}}function jr(t,e){return t[e]|t[e+1]<<16}function E7(t){let e=null;for(let n of t){let r=n.p.stoppedAt;(n.pos==n.p.stream.end||r!=null&&n.pos>r)&&n.p.parser.stateFlag(n.state,2)&&(!e||e.score<n.score)&&(e=n)}return e}function JS(t){if(t.external){let e=t.extend?1:0;return(n,r)=>t.external(n,r)<<1|e}return t.get}const T7=Gy({String:T.string,Number:T.number,"True False":T.bool,PropertyName:T.propertyName,Null:T.null,", :":T.separator,"[ ]":T.squareBracket,"{ }":T.brace}),N7=uc.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[T7],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),P7=nc.define({name:"json",parser:N7.configure({props:[Ky.add({Object:cl({except:/^\s*\}/}),Array:cl({except:/^\s*\]/})}),eb.add({"Object Array":LC})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function eA(){return new QC(P7)}const _7=316,C7=317,ek=1,$7=2,A7=3,I7=4,Q7=318,R7=320,M7=321,L7=5,D7=6,Z7=0,$0=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],tA=125,V7=59,A0=47,j7=42,B7=43,F7=45,X7=60,z7=44,W7=63,U7=46,Y7=91,G7=new k7({start:!1,shift(t,e){return e==L7||e==D7||e==R7?t:e==M7},strict:!1}),H7=new Zc((t,e)=>{let{next:n}=t;(n==tA||n==-1||e.context)&&t.acceptToken(Q7)},{contextual:!0,fallback:!0}),q7=new Zc((t,e)=>{let{next:n}=t,r;$0.indexOf(n)>-1||n==A0&&((r=t.peek(1))==A0||r==j7)||n!=tA&&n!=V7&&n!=-1&&!e.context&&t.acceptToken(_7)},{contextual:!0}),K7=new Zc((t,e)=>{t.next==Y7&&!e.context&&t.acceptToken(C7)},{contextual:!0}),J7=new Zc((t,e)=>{let{next:n}=t;if(n==B7||n==F7){if(t.advance(),n==t.next){t.advance();let r=!e.context&&e.canShift(ek);t.acceptToken(r?ek:$7)}}else n==W7&&t.peek(1)==U7&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(A7))},{contextual:!0});function um(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const eG=new Zc((t,e)=>{if(t.next!=X7||!e.dialectEnabled(Z7)||(t.advance(),t.next==A0))return;let n=0;for(;$0.indexOf(t.next)>-1;)t.advance(),n++;if(um(t.next,!0)){for(t.advance(),n++;um(t.next,!1);)t.advance(),n++;for(;$0.indexOf(t.next)>-1;)t.advance(),n++;if(t.next==z7)return;for(let r=0;;r++){if(r==7){if(!um(t.next,!0))return;break}if(t.next!="extends".charCodeAt(r))break;t.advance(),n++}}t.acceptToken(I7,-n)}),tG=Gy({"get set async static":T.modifier,"for while do if else switch try catch finally return throw break continue default case defer":T.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":T.operatorKeyword,"let var const using function class extends":T.definitionKeyword,"import export from":T.moduleKeyword,"with debugger new":T.keyword,TemplateString:T.special(T.string),super:T.atom,BooleanLiteral:T.bool,this:T.self,null:T.null,Star:T.modifier,VariableName:T.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":T.function(T.variableName),VariableDefinition:T.definition(T.variableName),Label:T.labelName,PropertyName:T.propertyName,PrivatePropertyName:T.special(T.propertyName),"CallExpression/MemberExpression/PropertyName":T.function(T.propertyName),"FunctionDeclaration/VariableDefinition":T.function(T.definition(T.variableName)),"ClassDeclaration/VariableDefinition":T.definition(T.className),"NewExpression/VariableName":T.className,PropertyDefinition:T.definition(T.propertyName),PrivatePropertyDefinition:T.definition(T.special(T.propertyName)),UpdateOp:T.updateOperator,"LineComment Hashbang":T.lineComment,BlockComment:T.blockComment,Number:T.number,String:T.string,Escape:T.escape,ArithOp:T.arithmeticOperator,LogicOp:T.logicOperator,BitOp:T.bitwiseOperator,CompareOp:T.compareOperator,RegExp:T.regexp,Equals:T.definitionOperator,Arrow:T.function(T.punctuation),": Spread":T.punctuation,"( )":T.paren,"[ ]":T.squareBracket,"{ }":T.brace,"InterpolationStart InterpolationEnd":T.special(T.brace),".":T.derefOperator,", ;":T.separator,"@":T.meta,TypeName:T.typeName,TypeDefinition:T.definition(T.typeName),"type enum interface implements namespace module declare":T.definitionKeyword,"abstract global Privacy readonly override":T.modifier,"is keyof unique infer asserts":T.operatorKeyword,JSXAttributeValue:T.attributeValue,JSXText:T.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":T.angleBracket,"JSXIdentifier JSXNameSpacedName":T.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":T.attributeName,"JSXBuiltin/JSXIdentifier":T.standard(T.tagName)}),nG={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},rG={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},iG={__proto__:null,"<":193},sG=uc.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_Qp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ParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:G7,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[tG],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOE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Er;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[q7,K7,J7,eG,2,3,4,5,6,7,8,9,10,11,12,13,14,H7,new C0("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new C0("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>nG[t]||-1},{term:343,get:t=>rG[t]||-1},{term:95,get:t=>iG[t]||-1}],tokenPrec:15201}),nA=[Dt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Dt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Dt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Dt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Dt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Dt(`try {
|
|
76
|
+
\${}
|
|
77
|
+
} catch (\${error}) {
|
|
78
|
+
\${}
|
|
79
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),Dt("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Dt(`if (\${}) {
|
|
80
|
+
\${}
|
|
81
|
+
} else {
|
|
82
|
+
\${}
|
|
83
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),Dt(`class \${name} {
|
|
84
|
+
constructor(\${params}) {
|
|
85
|
+
\${}
|
|
86
|
+
}
|
|
87
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),Dt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Dt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],oG=nA.concat([Dt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Dt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Dt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),tk=new e8,rA=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Aa(t){return(e,n)=>{let r=e.node.getChild("VariableDefinition");return r&&n(r,t),!0}}const aG=["FunctionDeclaration"],lG={FunctionDeclaration:Aa("function"),ClassDeclaration:Aa("class"),ClassExpression:()=>!0,EnumDeclaration:Aa("constant"),TypeAliasDeclaration:Aa("type"),NamespaceDeclaration:Aa("namespace"),VariableDefinition(t,e){t.matchContext(aG)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function iA(t,e){let n=tk.get(e);if(n)return n;let r=[],i=!0;function s(o,a){let l=t.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(Ve.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=lG[o.name];if(a&&a(o,s)||rA.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of iA(t,o.node))r.push(a);return!1}}),tk.set(e,r),r}const nk=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,sA=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function cG(t){let e=ot(t.state).resolveInner(t.pos,-1);if(sA.indexOf(e.name)>-1)return null;let n=e.name=="VariableName"||e.to-e.from<20&&nk.test(t.state.sliceDoc(e.from,e.to));if(!n&&!t.explicit)return null;let r=[];for(let i=e;i;i=i.parent)rA.has(i.name)&&(r=r.concat(iA(t.state.doc,i)));return{options:r,from:n?e.from:t.pos,validFor:nk}}const ws=nc.define({name:"javascript",parser:sG.configure({props:[Ky.add({IfStatement:cl({except:/^\s*({|else\b)/}),TryStatement:cl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:x8,SwitchBody:t=>{let e=t.textAfter,n=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return t.baseIndent+(n?0:r?1:2)*t.unit},Block:b8({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":cl({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),eb.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":LC,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let n=t.lastChild;return{from:e.to,to:n.type.isError?t.to:n.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let n=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,r=t.lastChild;return!n||n.type.isError?null:{from:n.to,to:r.type.isError?t.to:r.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),oA={test:t=>/^JSX/.test(t.name),facet:AC({commentTokens:{block:{open:"{/*",close:"*/}"}}})},uG=ws.configure({dialect:"ts"},"typescript"),fG=ws.configure({dialect:"jsx",props:[Hy.add(t=>t.isTop?[oA]:void 0)]}),dG=ws.configure({dialect:"jsx ts",props:[Hy.add(t=>t.isTop?[oA]:void 0)]},"typescript");let aA=t=>({label:t,type:"keyword"});const lA="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(aA),hG=lA.concat(["declare","implements","private","protected","public"].map(aA));function cA(t={}){let e=t.jsx?t.typescript?dG:fG:t.typescript?uG:ws,n=t.typescript?oG.concat(hG):nA.concat(lA);return new QC(e,[ws.data.of({autocomplete:BU(sA,D$(n))}),ws.data.of({autocomplete:cG}),t.jsx?gG:[]])}function pG(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function rk(t,e,n=t.length){for(let r=e==null?void 0:e.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return t.sliceString(r.from,Math.min(r.to,n));return""}const mG=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),gG=ee.inputHandler.of((t,e,n,r,i)=>{if((mG?t.composing:t.compositionStarted)||t.state.readOnly||e!=n||r!=">"&&r!="/"||!ws.isActiveAt(t.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:u}=l,f=ot(o).resolveInner(u-1,-1),d;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(u-1,u)!=r||f.name=="JSXAttributeValue"&&f.to>u)){if(r==">"&&f.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,p=h.parent;if(p&&h.from==u-2&&((d=rk(o.doc,p.firstChild,u))||((c=p.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let m=`${d}>`;return{range:W.cursor(u+m.length,-1),changes:{from:u,insert:m}}}}else if(r==">"){let h=pG(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(d=rk(o.doc,h,u)))return{range:l,changes:{from:u,insert:`</${d}>`}}}}return{range:l}});return a.changes.empty?!1:(t.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function OG(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function yG(t,e){const n=`${OG(t)}/${e}`,r=[];for(const i of n.split("/"))i===""||i==="."||(i===".."?r.length>0&&r[r.length-1]!==".."?r.pop():r.push(".."):r.push(i));return`${r.join("/")}.blueprint`}async function _h(t,e){return Promise.all(e.map(async n=>{var a,l,c,u,f;const r=String(((a=n.data)==null?void 0:a.path)??"").trim(),i=String(((l=n.data)==null?void 0:l.variableName)??"").trim()||"(unnamed)",s=((c=n.data)==null?void 0:c.sourceType)==="npm";if(!r)return{variableName:i,requirePath:r,functions:[],error:"No path configured",isNpm:s};if(s)return{variableName:i,requirePath:r,functions:[],isNpm:!0};const o=yG(t,r);try{const d=await FP(o),h=d.nodes.find(m=>m.type==="logic.export"),p=[];if(h)for(const m of d.edges){if(m.target!==h.id)continue;const O=d.nodes.find(g=>g.id===m.source);(O==null?void 0:O.type)==="logic.function"&&p.push({requirePath:r,variableName:i,functionName:String(((u=O.data)==null?void 0:u.name)??"?"),params:String(((f=O.data)==null?void 0:f.params)??"")})}return{variableName:i,requirePath:r,functions:p}}catch(d){return{variableName:i,requirePath:r,functions:[],error:d.message}}}))}const ul=["server","routing","middleware","handler","operators","controlFlow","logic","debugging"],ii={server:{label:"Server",headerClass:"bg-gradient-to-b from-slate-500 to-slate-700",accentHex:"#64748b",iconPaths:["M4 4h16a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z","M4 14h16a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1z","M7 8h.01","M7 18h.01"]},routing:{label:"Routing",headerClass:"bg-gradient-to-b from-blue-500 to-blue-800",accentHex:"#3b82f6",iconPaths:["M4 12h16","M14 6l6 6-6 6"]},middleware:{label:"Middleware",headerClass:"bg-gradient-to-b from-amber-500 to-amber-800",accentHex:"#d97706",iconPaths:["M4 5h16l-6 7v5l-4 2v-7z"]},handler:{label:"Handler",headerClass:"bg-gradient-to-b from-emerald-500 to-emerald-800",accentHex:"#10b981",iconPaths:["M18 6v6a2 2 0 0 1-2 2H6","M10 10l-4 4 4 4"]},operators:{label:"Operators",headerClass:"bg-gradient-to-b from-cyan-500 to-cyan-800",accentHex:"#06b6d4",iconPaths:["M5 8h6","M8 5v6","M13 16h6"]},controlFlow:{label:"Control Flow",headerClass:"bg-gradient-to-b from-lime-500 to-lime-800",accentHex:"#84cc16",iconPaths:["M4 12h5","M9 12l6-6h5","M9 12l6 6h5"]},logic:{label:"Logic",headerClass:"bg-gradient-to-b from-violet-500 to-violet-800",accentHex:"#8b5cf6",iconPaths:["M12 3l9 9-9 9-9-9z"]},debugging:{label:"Debugging",headerClass:"bg-gradient-to-b from-rose-500 to-rose-800",accentHex:"#f43f5e",iconPaths:["M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14z","M21 21l-4.35-4.35"]}};function ia({category:t,className:e="h-3.5 w-3.5"}){const n=ii[t];return x.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:e,"aria-hidden":"true",children:n.iconPaths.map((r,i)=>x.jsx("path",{d:r},i))})}function bG(){const t=U(l=>l.nodes),e=U(l=>l.currentFilePath),n=Q.useMemo(()=>t.filter(l=>l.type==="logic.require"),[t]),r=n.map(l=>{var c,u,f,d;return`${l.id}:${(c=l.data)==null?void 0:c.path}:${(u=l.data)==null?void 0:u.variableName}:${(f=l.data)==null?void 0:f.sourceType}:${(d=l.data)==null?void 0:d.version}`}).join("|"),[i,s]=Q.useState([]),[o,a]=Q.useState(!1);return Q.useEffect(()=>{if(n.length===0||!e){s([]);return}let l=!1;return a(!0),_h(e,n).then(c=>{l||(s(c),a(!1))}),()=>{l=!0}},[e,r]),n.length===0?null:x.jsxs("div",{className:"mt-4 border-t border-black/60 pt-3",children:[x.jsx("h3",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wide text-neutral-500",children:"Required Modules"}),o&&i.length===0?x.jsx("p",{className:"text-xs text-neutral-500",children:"Loading…"}):x.jsx("div",{className:"flex flex-col gap-2.5",children:i.map(l=>x.jsx(xG,{module:l},l.variableName+l.requirePath))})]})}function xG({module:t}){return x.jsxs("div",{className:`overflow-hidden rounded-lg border shadow-sm shadow-black/40 ${t.error?"border-red-500/60":"border-black/60"}`,children:[x.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1.5 ${t.error?"bg-red-900/40":""}`,style:t.error?void 0:{backgroundColor:ii.logic.accentHex},children:[!t.error&&x.jsx(ia,{category:"logic",className:"h-3.5 w-3.5 text-white"}),x.jsx("span",{className:"truncate font-mono text-[11px] font-bold text-white",title:t.requirePath,children:t.variableName}),x.jsx("span",{className:"ml-auto truncate text-[10px] text-white/60",title:t.requirePath,children:t.requirePath})]}),x.jsx("div",{className:"bg-[#2a2a2a] px-2 py-1.5",children:t.error?x.jsx("p",{className:"text-[11px] text-red-400",children:t.error}):t.isNpm?x.jsx("p",{className:"text-[11px] text-neutral-500",children:"npm package — functions not auto-discovered."}):t.functions.length===0?x.jsx("p",{className:"text-[11px] text-neutral-500",children:"No exported functions."}):x.jsx("div",{className:"flex flex-col gap-1",children:t.functions.map(e=>x.jsx(vG,{variableName:t.variableName,fn:e},e.functionName))})})]})}function vG({variableName:t,fn:e}){const[n,r]=Q.useState(!1),i=`${t}.${e.functionName}(${e.params})`;async function s(){try{await navigator.clipboard.writeText(i),r(!0),setTimeout(()=>r(!1),1200)}catch{}}return x.jsxs("button",{onClick:s,title:`Copy "${i}"`,className:"group flex items-center gap-1.5 rounded px-1 py-0.5 text-left hover:bg-white/5",children:[x.jsx("span",{className:"text-[10px] text-violet-400",children:"ƒ"}),x.jsxs("span",{className:"truncate font-mono text-[11px] text-neutral-200",children:[e.functionName,x.jsxs("span",{className:"text-neutral-500",children:["(",e.params,")"]})]}),x.jsx("span",{className:"ml-auto shrink-0 text-[10px] text-neutral-500 opacity-0 group-hover:opacity-100",children:n?"Copied!":"Copy call"})]})}function wG(t){const e=t.trim();return e==="true"?!0:e==="false"?!1:e!==""&&Number.isFinite(Number(e))?Number(e):t}function uA({node:t,onAddCase:e,onRemoveCase:n,onUpdateCaseValue:r}){const i=Pc(t.data);return x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Cases"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:`Each case's value can be a number, text, or true/false — typed exactly as it should match "Selection".`}),i.length===0&&x.jsx("p",{className:"text-[11px] text-neutral-500",children:"No cases yet."}),i.map(s=>x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",defaultValue:String(s.value),onBlur:o=>r(t.id,s.id,wG(o.target.value)),onKeyDown:o=>{o.key==="Enter"&&o.currentTarget.blur()}}),x.jsx("button",{onClick:()=>n(t.id,s.id),className:"shrink-0 rounded px-1.5 py-1 text-xs text-red-400 hover:bg-red-500/10",title:"Remove case",children:"×"})]},s.id)),x.jsx("button",{onClick:()=>e(t.id),className:"self-start rounded px-2 py-1 text-xs text-sky-400 hover:bg-sky-500/10",children:"+ Add Case"})]})}const I0={string:{label:"String",color:"#d6337a"},number:{label:"Number",color:"#3fae74"},boolean:{label:"Boolean",color:"#d64545"},object:{label:"Object",color:"#2ea3c9"},array:{label:"Array",color:"#c9a227"},map:{label:"Map",color:"#d97b29"},set:{label:"Set",color:"#7a9e4a"},weakset:{label:"WeakSet",color:"#5c7a3a"},null:{label:"Null",color:"#9a9a9a"},undefined:{label:"Undefined",color:"#6f6f6f"},bigint:{label:"BigInt",color:"#2f8f66"},symbol:{label:"Symbol",color:"#9b6fd1"},buffer:{label:"Buffer",color:"#a97c50"},url:{label:"URL",color:"#4a7fd6"}},SG=["string","number","boolean","object","array","map","set","weakset","bigint","symbol","buffer","url","null","undefined"];function yb(t){var e;return((e=I0[t])==null?void 0:e.color)??"#8f8f8f"}const kG=/^[A-Za-z_$][A-Za-z0-9_$]*$/,EG=["const","let","var"];function fA({variables:t,onAdd:e,onRename:n,onSetKeyword:r,onSetDataType:i,onSetDefault:s,onRemove:o}){const[a,l]=Q.useState(!1);return x.jsxs("div",{className:"mt-4 border-t border-black/60 pt-3",children:[x.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[x.jsxs("button",{onClick:()=>l(c=>!c),className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide text-neutral-500 hover:text-neutral-300",title:a?"Expand":"Collapse",children:[x.jsx("span",{className:"inline-block w-2.5 text-neutral-500",children:a?"▸":"▾"}),"Variables",x.jsx("span",{className:"rounded-full bg-neutral-700 px-1.5 py-0.5 text-[10px] font-normal normal-case text-neutral-300",children:t.length})]}),x.jsx("button",{onClick:e,className:"rounded border border-neutral-600 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-sky-500 hover:text-sky-400",children:"+ Add"})]}),!a&&x.jsxs("div",{className:"flex flex-col gap-2",children:[t.length===0&&x.jsx("p",{className:"text-[11px] text-neutral-500",children:"No variables declared."}),t.map(c=>x.jsx(TG,{variable:c,allVariables:t,onRename:n,onSetKeyword:r,onSetDataType:i,onSetDefault:s,onRemove:o},c.id))]})]})}function TG({variable:t,allVariables:e,onRename:n,onSetKeyword:r,onSetDataType:i,onSetDefault:s,onRemove:o}){var h;const[a,l]=Q.useState(t.name),[c,u]=Q.useState(null);Q.useEffect(()=>{l(t.name),u(null)},[t.name]);function f(p){if(l(p),!p){u("Name is required");return}if(!kG.test(p)){u("Must be a valid JS identifier");return}if(e.some(m=>m.id!==t.id&&m.name===p)){u("Name already in use");return}u(null),n(t.id,p)}function d(p){const m=t.dataType;i(t.id,p),p==="null"?s(t.id,"null"):p==="undefined"?s(t.id,"undefined"):(m==="null"||m==="undefined")&&s(t.id,"")}return x.jsxs("div",{draggable:!0,onDragStart:p=>{p.dataTransfer.setData("application/flowserver-variable",JSON.stringify({variableId:t.id})),p.dataTransfer.effectAllowed="move"},className:"flex flex-col gap-1 rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1.5",title:"Drag onto the canvas to add a Get/Set node",children:[x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("select",{value:t.keyword,onChange:p=>r(t.id,p.target.value),className:"rounded border border-neutral-700 bg-[#1f1f1f] px-1 py-1 text-[11px] text-neutral-100",children:EG.map(p=>x.jsx("option",{value:p,children:p},p))}),x.jsx("input",{type:"text",value:a,onChange:p=>f(p.target.value),className:`w-full rounded border bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100 ${c?"border-red-500":"border-neutral-700"}`}),x.jsx("button",{onClick:()=>o(t.id),title:"Remove variable",className:"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-neutral-600 text-xs text-red-400 hover:border-red-500 hover:bg-red-500/10",children:"×"})]}),c&&x.jsx("span",{className:"text-[10px] text-red-400",children:c}),x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("span",{className:"h-2.5 w-2.5 shrink-0 rounded-full border border-black/40",style:{background:yb(t.dataType)},title:(h=I0[t.dataType])==null?void 0:h.label}),x.jsx("select",{value:t.dataType,onChange:p=>d(p.target.value),className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-1 py-1 text-[11px] text-neutral-100",children:SG.map(p=>x.jsx("option",{value:p,children:I0[p].label},p))})]}),x.jsx(NG,{dataType:t.dataType,value:t.defaultValue??"",onChange:p=>s(t.id,p)})]})}function NG({dataType:t,value:e,onChange:n}){const r="w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 font-mono text-[11px] text-neutral-100 placeholder:text-neutral-600";if(t==="null"||t==="undefined")return x.jsx("input",{type:"text",value:t,disabled:!0,readOnly:!0,className:`${r} cursor-not-allowed opacity-60`});if(t==="boolean")return x.jsxs("select",{value:e,onChange:s=>n(s.target.value),className:r,children:[x.jsx("option",{value:"",children:"no default"}),x.jsx("option",{value:"true",children:"true"}),x.jsx("option",{value:"false",children:"false"})]});if(t==="number")return x.jsx("input",{type:"number",value:e,onChange:s=>n(s.target.value),placeholder:"no default",className:r});if(t==="object"||t==="array"||t==="map"||t==="set"||t==="weakset"){const s=t==="object"?'{"key": "value"}':t==="map"?'[["key", "value"]]':t==="weakset"?'[{"a": 1}]':"[1, 2, 3]";return x.jsx("textarea",{value:e,onChange:o=>n(o.target.value),placeholder:s,rows:2,className:`${r} resize-y`})}const i=t==="bigint"?"e.g. 42":t==="symbol"?"description (optional)":t==="buffer"?"UTF-8 text":t==="url"?"https://example.com":"no default";return x.jsx("input",{type:"text",value:e,onChange:s=>n(s.target.value),placeholder:i,className:r})}var dA=t=>{var e=t.theme,n=t.settings,r=n===void 0?{}:n,i=t.styles,s=i===void 0?[]:i,o={".cm-gutters":{}},a={};r.background&&(a.backgroundColor=r.background),r.backgroundImage&&(a.backgroundImage=r.backgroundImage),r.foreground&&(a.color=r.foreground),r.fontSize&&(a.fontSize=r.fontSize),(r.background||r.foreground)&&(o["&"]=a),r.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:r.fontFamily}),r.gutterBackground&&(o[".cm-gutters"].backgroundColor=r.gutterBackground),r.gutterForeground&&(o[".cm-gutters"].color=r.gutterForeground),r.gutterBorder&&(o[".cm-gutters"].borderRightColor=r.gutterBorder),r.caret&&(o[".cm-content"]={caretColor:r.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:r.caret});var l={};r.gutterActiveForeground&&(l.color=r.gutterActiveForeground),r.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:r.lineHighlight},l.backgroundColor=r.lineHighlight),o[".cm-activeLineGutter"]=l,r.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:r.selection+" !important"}),r.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:r.selectionMatch});var c=ee.theme(o,{dark:e==="dark"}),u=ua.define(s),f=[c,tb(u)];return f},PG={background:"#ffffff",foreground:"#383a42",caret:"#000",selection:"#add6ff",selectionMatch:"#a8ac94",lineHighlight:"#99999926",gutterBackground:"#fff",gutterForeground:"#237893",gutterActiveForeground:"#0b216f",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},_G=[{tag:[T.keyword,T.operatorKeyword,T.modifier,T.color,T.constant(T.name),T.standard(T.name),T.standard(T.tagName),T.special(T.brace),T.atom,T.bool,T.special(T.variableName)],color:"#0000ff"},{tag:[T.moduleKeyword,T.controlKeyword],color:"#af00db"},{tag:[T.name,T.deleted,T.character,T.macroName,T.propertyName,T.variableName,T.labelName,T.definition(T.name)],color:"#0070c1"},{tag:T.heading,fontWeight:"bold",color:"#0070c1"},{tag:[T.typeName,T.className,T.tagName,T.number,T.changed,T.annotation,T.self,T.namespace],color:"#267f99"},{tag:[T.function(T.variableName),T.function(T.propertyName)],color:"#795e26"},{tag:[T.number],color:"#098658"},{tag:[T.operator,T.punctuation,T.separator,T.url,T.escape,T.regexp],color:"#383a42"},{tag:[T.regexp],color:"#af00db"},{tag:[T.special(T.string),T.processingInstruction,T.string,T.inserted],color:"#a31515"},{tag:[T.angleBracket],color:"#383a42"},{tag:T.strong,fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:[T.meta,T.comment],color:"#008000"},{tag:T.link,color:"#4078f2",textDecoration:"underline"},{tag:T.invalid,color:"#e45649"}];function CG(t){var e={},n=e.theme,r=n===void 0?"light":n,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return dA({theme:r,settings:zl({},PG,s),styles:[..._G,...a]})}CG();var $G={background:"#1e1e1e",foreground:"#9cdcfe",caret:"#c6c6c6",selection:"#6199ff2f",selectionMatch:"#72a1ff59",lineHighlight:"#ffffff0f",gutterBackground:"#1e1e1e",gutterForeground:"#838383",gutterActiveForeground:"#fff",fontFamily:'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'},AG=[{tag:[T.keyword,T.operatorKeyword,T.modifier,T.color,T.constant(T.name),T.standard(T.name),T.standard(T.tagName),T.special(T.brace),T.atom,T.bool,T.special(T.variableName)],color:"#569cd6"},{tag:[T.controlKeyword,T.moduleKeyword],color:"#c586c0"},{tag:[T.name,T.deleted,T.character,T.macroName,T.propertyName,T.variableName,T.labelName,T.definition(T.name)],color:"#9cdcfe"},{tag:T.heading,fontWeight:"bold",color:"#9cdcfe"},{tag:[T.typeName,T.className,T.tagName,T.number,T.changed,T.annotation,T.self,T.namespace],color:"#4ec9b0"},{tag:[T.function(T.variableName),T.function(T.propertyName)],color:"#dcdcaa"},{tag:[T.number],color:"#b5cea8"},{tag:[T.operator,T.punctuation,T.separator,T.url,T.escape,T.regexp],color:"#d4d4d4"},{tag:[T.regexp],color:"#d16969"},{tag:[T.special(T.string),T.processingInstruction,T.string,T.inserted],color:"#ce9178"},{tag:[T.angleBracket],color:"#808080"},{tag:T.strong,fontWeight:"bold"},{tag:T.emphasis,fontStyle:"italic"},{tag:T.strikethrough,textDecoration:"line-through"},{tag:[T.meta,T.comment],color:"#6a9955"},{tag:T.link,color:"#6a9955",textDecoration:"underline"},{tag:T.invalid,color:"#ff0000"}];function IG(t){var e={},n=e.theme,r=n===void 0?"dark":n,i=e.settings,s=i===void 0?{}:i,o=e.styles,a=o===void 0?[]:o;return dA({theme:r,settings:zl({},$G,s),styles:[...AG,...a]})}var QG=IG();const Ch=QG,$h={lineNumbers:!1,foldGutter:!1};function hA(t){return typeof t.default=="string"}function pA(t){return hA(t)?[cA()]:[eA()]}function mA({onExpand:t}){return x.jsx("span",{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),t())},className:"cursor-pointer rounded px-1 text-xs text-neutral-400 hover:text-neutral-200",title:"Expand",children:"⤢"})}function RG({field:t,value:e,onChange:n,onExpand:r}){const[i,s]=Q.useState(()=>JSON.stringify(e??t.default,null,2)),[o,a]=Q.useState(null);return Q.useEffect(()=>{s(JSON.stringify(e??t.default,null,2)),a(null)},[e,t.default]),x.jsxs("div",{children:[r&&x.jsx("div",{className:"mb-0.5 flex justify-end",children:x.jsx(mA,{onExpand:r})}),x.jsx("div",{className:`overflow-hidden rounded border ${o?"border-red-500":"border-neutral-700"}`,children:x.jsx(Dc,{value:i,theme:Ch,height:"140px",extensions:[eA()],basicSetup:$h,onChange:l=>{s(l);try{const c=JSON.parse(l);a(null),n(c)}catch{a("Invalid JSON")}}})}),o&&x.jsx("div",{className:"mt-0.5 text-[11px] text-red-400",children:o})]})}function bb({value:t,onChange:e,onExpand:n}){return x.jsxs("div",{children:[n&&x.jsx("div",{className:"mb-0.5 flex justify-end",children:x.jsx(mA,{onExpand:n})}),x.jsx("div",{className:"overflow-hidden rounded border border-neutral-700",children:x.jsx(Dc,{value:String(t??""),theme:Ch,height:"140px",extensions:[cA()],basicSetup:$h,onChange:r=>e(r)})})]})}function MG({field:t,value:e,onChange:n,onExpand:r}){switch(t.type){case"text":return x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(e??""),onChange:i=>n(i.target.value)});case"number":return x.jsx("input",{type:"number",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:Number(e??t.default??0),onChange:i=>n(Number(i.target.value))});case"boolean":return x.jsx("input",{type:"checkbox",checked:!!(e??t.default??!1),onChange:i=>n(i.target.checked)});case"select":return x.jsx("select",{className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(e??t.default??""),onChange:i=>n(i.target.value),children:(t.options??[]).map(i=>x.jsx("option",{value:i,children:i},i))});case"code":return typeof t.default=="string"?x.jsx(bb,{value:e,onChange:n,onExpand:r}):x.jsx(RG,{field:t,value:e,onChange:n,onExpand:r});default:return null}}function LG({node:t,edges:e,nodes:n,updateNodeConfig:r}){var l,c,u,f;const i=String(((l=t.data)==null?void 0:l.variableName)??""),s=String(((c=t.data)==null?void 0:c.functionName)??""),o=String(((u=t.data)==null?void 0:u.params)??""),a=o.split(",").map(d=>d.trim()).filter(d=>d.length>0);return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsxs("div",{className:"mb-3 rounded bg-black/40 px-2 py-1.5 font-mono text-xs text-neutral-200",children:[i,".",s,"(",o,")"]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Result Variable Name"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:"Must be a valid, unique JS identifier. Other nodes reference this call's return value by this name."}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((f=t.data)==null?void 0:f.resultVariable)??""),onChange:d=>r(t.id,"resultVariable",d.target.value)})]}),a.map((d,h)=>{var m,O;const p=e.find(g=>g.target===t.id&&g.targetHandle===`param-${h}`);if(p){const g=n.find(y=>y.id===p.source),b=g&&g.type==="logic.functionCall"?String(((m=g.data)==null?void 0:m.resultVariable)??g.id):(g==null?void 0:g.id)??p.source;return x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:d}),x.jsxs("span",{className:"text-[11px] text-neutral-500",children:['← wired from "',b,'"']})]},h)}return x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:d}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((O=t.data)==null?void 0:O[`arg-${h}`])??""),onChange:g=>r(t.id,`arg-${h}`,g.target.value)})]},h)})]})}function DG({node:t,updateNodeConfig:e}){var r,i,s,o;const n=((r=t.data)==null?void 0:r.sourceType)==="npm"?"npm":"local";return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Source"}),x.jsxs("div",{className:"flex overflow-hidden rounded border border-neutral-700",children:[x.jsx("button",{type:"button",onClick:()=>e(t.id,"sourceType","local"),className:`flex-1 px-2 py-1 text-xs ${n==="local"?"bg-sky-600 text-white":"bg-[#1f1f1f] text-neutral-300 hover:bg-neutral-700"}`,children:"Local"}),x.jsx("button",{type:"button",onClick:()=>e(t.id,"sourceType","npm"),className:`flex-1 px-2 py-1 text-xs ${n==="npm"?"bg-sky-600 text-white":"bg-[#1f1f1f] text-neutral-300 hover:bg-neutral-700"}`,children:"npm"})]})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:n==="npm"?"Package Name":"Path"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:n==="npm"?'The npm package name, e.g. "lodash" or a scoped package like "@org/pkg".':'Relative path to the target .blueprint file, e.g. "./helpers/date-utils".'}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((i=t.data)==null?void 0:i.path)??""),onChange:a=>e(t.id,"path",a.target.value)})]}),n==="npm"&&x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Version"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:"leave blank for unpinned"}),x.jsx("input",{type:"text",placeholder:"^1.7.0",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((s=t.data)==null?void 0:s.version)??""),onChange:a=>e(t.id,"version",a.target.value)})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Variable Name"}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((o=t.data)==null?void 0:o.variableName)??""),onChange:a=>e(t.id,"variableName",a.target.value)})]})]})}function ZG({node:t,updateNodeConfig:e,openCodeExpand:n,openFunctionGraph:r}){var c,u,f,d,h,p,m,O,g;const i=((c=t.data)==null?void 0:c.mode)==="blueprint"?"blueprint":"code",s=(u=t.data)==null?void 0:u.graph,o=((f=s==null?void 0:s.nodes)==null?void 0:f.length)??0,a=((d=s==null?void 0:s.edges)==null?void 0:d.length)??0;function l(b){var y;if(b!==i){if(b==="blueprint"){const v=String(((y=t.data)==null?void 0:y.body)??"").trim().length>0,S=o>0;if(v&&!S&&!window.confirm("Switching to Blueprint mode won't preserve your existing Function Body code. Continue?"))return;e(t.id,"mode","blueprint");return}e(t.id,"mode","code")}}return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Function Name"}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((h=t.data)==null?void 0:h.name)??""),onChange:b=>e(t.id,"name",b.target.value)})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Parameters"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:'Comma-separated parameter names, e.g. "date, format".'}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((p=t.data)==null?void 0:p.params)??""),onChange:b=>e(t.id,"params",b.target.value)})]}),x.jsxs("label",{className:"flex items-center gap-2",children:[x.jsx("input",{type:"checkbox",checked:!!(((m=t.data)==null?void 0:m.isAsync)??!1),onChange:b=>e(t.id,"isAsync",b.target.checked)}),x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Async Function"})]}),x.jsxs("div",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Authoring Mode"}),x.jsxs("div",{className:"flex overflow-hidden rounded border border-neutral-700",children:[x.jsx("button",{type:"button",onClick:()=>l("code"),className:`flex-1 px-2 py-1 text-xs ${i==="code"?"bg-sky-600 text-white":"bg-[#1f1f1f] text-neutral-300 hover:bg-neutral-700"}`,children:"Code"}),x.jsx("button",{type:"button",onClick:()=>l("blueprint"),className:`flex-1 px-2 py-1 text-xs ${i==="blueprint"?"bg-sky-600 text-white":"bg-[#1f1f1f] text-neutral-300 hover:bg-neutral-700"}`,children:"Blueprint"})]})]}),i==="code"?x.jsxs(x.Fragment,{children:[x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Function Body"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:"Available: the parameter names declared above. Use `return` to produce a value."}),x.jsx(bb,{value:(O=t.data)==null?void 0:O.body,onChange:b=>e(t.id,"body",b),onExpand:()=>n(t.id,"body","Function Body")})]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"npm Dependencies"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:`Comma-separated package names this function's code depends on, e.g. "lodash, dayjs".`}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((g=t.data)==null?void 0:g.npmDependencies)??""),onChange:b=>e(t.id,"npmDependencies",b.target.value)})]})]}):x.jsxs("div",{className:"flex flex-col gap-2",children:[x.jsxs("div",{className:"rounded bg-black/40 px-2 py-1.5 text-[11px] text-neutral-300",children:[o," node",o===1?"":"s",", ",a," edge",a===1?"":"s"]}),x.jsx("button",{type:"button",onClick:()=>r(t.id),className:"rounded bg-sky-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-sky-700",children:"Open Blueprint Graph"})]})]})}function VG({node:t,edges:e,updateNodeConfig:n,openCodeExpand:r}){var s,o;const i=e.some(a=>a.target===t.id&&a.targetHandle==="value");return x.jsx("div",{className:"flex flex-col gap-3",children:x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Expression"}),x.jsx("span",{className:"text-[11px] text-neutral-500",children:i?"The Value pin is wired — its value is logged instead of this expression.":"Available: req, res. Any JS expression(s), comma-separated for multiple console.log arguments, e.g. req.method, req.path."}),i?x.jsx("div",{className:"rounded border border-neutral-800 bg-black/30 px-2 py-1.5 font-mono text-[11px] text-neutral-500",children:String(((s=t.data)==null?void 0:s.expression)??'""')}):x.jsx(bb,{value:(o=t.data)==null?void 0:o.expression,onChange:a=>n(t.id,"expression",a),onExpand:()=>r(t.id,"expression","Expression")})]})})}function jG({node:t,variables:e}){const n=e.find(r=>{var i;return r.id===((i=t.data)==null?void 0:i.variableId)});return n?x.jsxs("div",{className:"rounded border border-neutral-700 bg-black/30 px-2 py-1.5 text-xs text-neutral-300",children:['Bound to variable "',n.name,'" (',n.keyword,") — edit it in the Variables panel above."]}):x.jsx("div",{className:"rounded border border-red-500/60 bg-red-900/20 px-2 py-1.5 text-xs text-red-400",children:"References a variable that no longer exists."})}function BG(){const t=U(k=>k.selectedNodeId),e=U(k=>k.nodes.find(N=>N.id===k.selectedNodeId)),n=U(k=>k.nodeDefinitions),r=U(k=>k.updateNodeConfig),i=U(k=>k.deleteSelectedNode),s=U(k=>k.edges),o=U(k=>k.nodes),a=U(k=>k.openCodeExpand),l=U(k=>k.openFunctionGraph),c=U(k=>k.addSwitchCasePin),u=U(k=>k.removeSwitchCasePin),f=U(k=>k.updateSwitchCaseValue),d=U(k=>k.variables),h=U(k=>k.addVariable),p=U(k=>k.renameVariable),m=U(k=>k.setVariableKeyword),O=U(k=>k.setVariableDataType),g=U(k=>k.setVariableDefault),b=U(k=>k.removeVariable),y=U(k=>k.currentFilePath),{size:v,onMouseDown:S}=ph({initial:320,min:240,max:600,axis:"x",invert:!0}),E=y?x.jsx(fA,{variables:d,onAdd:h,onRename:p,onSetKeyword:m,onSetDataType:O,onSetDefault:g,onRemove:b}):null;if(!t||!e)return x.jsxs("div",{className:"flex h-full shrink-0",style:{width:v},children:[x.jsx(ko,{axis:"x",onMouseDown:S}),x.jsxs("div",{className:"h-full min-w-0 flex-1 overflow-y-auto border-l border-black/60 bg-[#1f1f1f] p-3",children:[x.jsx("p",{className:"text-xs text-neutral-500",children:"Select a node to configure it."}),x.jsx(bG,{}),E]})]});const w=e.type?n[e.type]:void 0;return w?x.jsxs("div",{className:"flex h-full shrink-0",style:{width:v},children:[x.jsx(ko,{axis:"x",onMouseDown:S}),x.jsxs("div",{className:"h-full min-w-0 flex-1 overflow-y-auto border-l border-black/60 bg-[#1f1f1f] p-3",children:[x.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[x.jsx("h2",{className:"text-sm font-semibold text-neutral-100",children:w.label}),x.jsx("button",{onClick:i,className:"rounded px-2 py-0.5 text-xs text-red-400 hover:bg-red-500/10",title:"Delete node",children:"Delete"})]}),x.jsx("p",{className:"mb-3 text-[11px] text-neutral-500",children:w.description}),e.type==="logic.functionCall"?x.jsx(LG,{node:e,edges:s,nodes:o,updateNodeConfig:r}):e.type==="logic.function"?x.jsx(ZG,{node:e,updateNodeConfig:r,openCodeExpand:a,openFunctionGraph:l}):e.type==="logic.require"?x.jsx(DG,{node:e,updateNodeConfig:r}):e.type==="debug.consoleLog"?x.jsx(VG,{node:e,edges:s,updateNodeConfig:r,openCodeExpand:a}):e.type==="controlFlow.switch"?x.jsx(uA,{node:e,onAddCase:c,onRemoveCase:u,onUpdateCaseValue:f}):e.type==="variable.get"||e.type==="variable.set"?x.jsx(jG,{node:e,variables:d}):w.configSchema.length===0?x.jsx("p",{className:"text-xs text-neutral-500",children:"This node has no configuration."}):x.jsx("div",{className:"flex flex-col gap-3",children:w.configSchema.map(k=>{var N;return x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:k.label}),k.hint&&x.jsx("span",{className:"text-[11px] text-neutral-500",children:k.hint}),x.jsx(MG,{field:k,value:(N=e.data)==null?void 0:N[k.key],onChange:$=>r(e.id,k.key,$),onExpand:k.type==="code"?()=>a(e.id,k.key,k.label):void 0},`${e.id}:${k.key}`)]},k.key)})}),E]})]}):x.jsxs("div",{className:"flex h-full shrink-0",style:{width:v},children:[x.jsx(ko,{axis:"x",onMouseDown:S}),x.jsxs("div",{className:"h-full min-w-0 flex-1 border-l border-black/60 bg-[#1f1f1f] p-3 text-xs text-red-400",children:["Unknown node type: ",e.type,E]})]})}function gA(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=gA(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function OA(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=gA(t))&&(r&&(r+=" "),r+=e);return r}var FG=Object.create,Ah=Object.defineProperty,XG=Object.defineProperties,zG=Object.getOwnPropertyDescriptor,WG=Object.getOwnPropertyDescriptors,yA=Object.getOwnPropertyNames,$d=Object.getOwnPropertySymbols,UG=Object.getPrototypeOf,xb=Object.prototype.hasOwnProperty,bA=Object.prototype.propertyIsEnumerable,ik=(t,e,n)=>e in t?Ah(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Pr=(t,e)=>{for(var n in e||(e={}))xb.call(e,n)&&ik(t,n,e[n]);if($d)for(var n of $d(e))bA.call(e,n)&&ik(t,n,e[n]);return t},Ih=(t,e)=>XG(t,WG(e)),xA=(t,e)=>{var n={};for(var r in t)xb.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&$d)for(var r of $d(t))e.indexOf(r)<0&&bA.call(t,r)&&(n[r]=t[r]);return n},YG=(t,e)=>function(){return e||(0,t[yA(t)[0]])((e={exports:{}}).exports,e),e.exports},GG=(t,e)=>{for(var n in e)Ah(t,n,{get:e[n],enumerable:!0})},HG=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yA(e))!xb.call(t,i)&&i!==n&&Ah(t,i,{get:()=>e[i],enumerable:!(r=zG(e,i))||r.enumerable});return t},qG=(t,e,n)=>(n=t!=null?FG(UG(t)):{},HG(!t||!t.__esModule?Ah(n,"default",{value:t,enumerable:!0}):n,t)),KG=YG({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(t,e){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,s={},o={util:{encode:function p(m){return m instanceof a?new a(m.type,p(m.content),m.alias):Array.isArray(m)?m.map(p):m.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++i}),p.__id},clone:function p(m,O){O=O||{};var g,b;switch(o.util.type(m)){case"Object":if(b=o.util.objId(m),O[b])return O[b];g={},O[b]=g;for(var y in m)m.hasOwnProperty(y)&&(g[y]=p(m[y],O));return g;case"Array":return b=o.util.objId(m),O[b]?O[b]:(g=[],O[b]=g,m.forEach(function(v,S){g[S]=p(v,O)}),g);default:return m}},getLanguage:function(p){for(;p;){var m=r.exec(p.className);if(m)return m[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,m){p.className=p.className.replace(RegExp(r,"gi"),""),p.classList.add("language-"+m)},isActive:function(p,m,O){for(var g="no-"+m;p;){var b=p.classList;if(b.contains(m))return!0;if(b.contains(g))return!1;p=p.parentElement}return!!O}},languages:{plain:s,plaintext:s,text:s,txt:s,extend:function(p,m){var O=o.util.clone(o.languages[p]);for(var g in m)O[g]=m[g];return O},insertBefore:function(p,m,O,g){g=g||o.languages;var b=g[p],y={};for(var v in b)if(b.hasOwnProperty(v)){if(v==m)for(var S in O)O.hasOwnProperty(S)&&(y[S]=O[S]);O.hasOwnProperty(v)||(y[v]=b[v])}var E=g[p];return g[p]=y,o.languages.DFS(o.languages,function(w,k){k===E&&w!=p&&(this[w]=y)}),y},DFS:function p(m,O,g,b){b=b||{};var y=o.util.objId;for(var v in m)if(m.hasOwnProperty(v)){O.call(m,v,m[v],g||v);var S=m[v],E=o.util.type(S);E==="Object"&&!b[y(S)]?(b[y(S)]=!0,p(S,O,null,b)):E==="Array"&&!b[y(S)]&&(b[y(S)]=!0,p(S,O,v,b))}}},plugins:{},highlight:function(p,m,O){var g={code:p,grammar:m,language:O};if(o.hooks.run("before-tokenize",g),!g.grammar)throw new Error('The language "'+g.language+'" has no grammar.');return g.tokens=o.tokenize(g.code,g.grammar),o.hooks.run("after-tokenize",g),a.stringify(o.util.encode(g.tokens),g.language)},tokenize:function(p,m){var O=m.rest;if(O){for(var g in O)m[g]=O[g];delete m.rest}var b=new u;return f(b,b.head,p),c(p,b,m,b.head,0),h(b)},hooks:{all:{},add:function(p,m){var O=o.hooks.all;O[p]=O[p]||[],O[p].push(m)},run:function(p,m){var O=o.hooks.all[p];if(!(!O||!O.length))for(var g=0,b;b=O[g++];)b(m)}},Token:a};function a(p,m,O,g){this.type=p,this.content=m,this.alias=O,this.length=(g||"").length|0}a.stringify=function p(m,O){if(typeof m=="string")return m;if(Array.isArray(m)){var g="";return m.forEach(function(E){g+=p(E,O)}),g}var b={type:m.type,content:p(m.content,O),tag:"span",classes:["token",m.type],attributes:{},language:O},y=m.alias;y&&(Array.isArray(y)?Array.prototype.push.apply(b.classes,y):b.classes.push(y)),o.hooks.run("wrap",b);var v="";for(var S in b.attributes)v+=" "+S+'="'+(b.attributes[S]||"").replace(/"/g,""")+'"';return"<"+b.tag+' class="'+b.classes.join(" ")+'"'+v+">"+b.content+"</"+b.tag+">"};function l(p,m,O,g){p.lastIndex=m;var b=p.exec(O);if(b&&g&&b[1]){var y=b[1].length;b.index+=y,b[0]=b[0].slice(y)}return b}function c(p,m,O,g,b,y){for(var v in O)if(!(!O.hasOwnProperty(v)||!O[v])){var S=O[v];S=Array.isArray(S)?S:[S];for(var E=0;E<S.length;++E){if(y&&y.cause==v+","+E)return;var w=S[E],k=w.inside,N=!!w.lookbehind,$=!!w.greedy,C=w.alias;if($&&!w.pattern.global){var _=w.pattern.toString().match(/[imsuy]*$/)[0];w.pattern=RegExp(w.pattern.source,_+"g")}for(var V=w.pattern||w,P=g.next,M=b;P!==m.tail&&!(y&&M>=y.reach);M+=P.value.length,P=P.next){var R=P.value;if(m.length>p.length)return;if(!(R instanceof a)){var L=1,I;if($){if(I=l(V,M,p,N),!I||I.index>=p.length)break;var F=I.index,A=I.index+I[0].length,D=M;for(D+=P.value.length;F>=D;)P=P.next,D+=P.value.length;if(D-=P.value.length,M=D,P.value instanceof a)continue;for(var B=P;B!==m.tail&&(D<A||typeof B.value=="string");B=B.next)L++,D+=B.value.length;L--,R=p.slice(M,D),I.index-=M}else if(I=l(V,0,R,N),!I)continue;var F=I.index,q=I[0],j=R.slice(0,F),H=R.slice(F+q.length),G=M+R.length;y&&G>y.reach&&(y.reach=G);var ne=P.prev;j&&(ne=f(m,ne,j),M+=j.length),d(m,ne,L);var z=new a(v,k?o.tokenize(q,k):q,C,q);if(P=f(m,ne,z),H&&f(m,P,H),L>1){var J={cause:v+","+E,reach:G};c(p,m,O,P.prev,M,J),y&&J.reach>y.reach&&(y.reach=J.reach)}}}}}}function u(){var p={value:null,prev:null,next:null},m={value:null,prev:p,next:null};p.next=m,this.head=p,this.tail=m,this.length=0}function f(p,m,O){var g=m.next,b={value:O,prev:m,next:g};return m.next=b,g.prev=b,p.length++,b}function d(p,m,O){for(var g=m.next,b=0;b<O&&g!==p.tail;b++)g=g.next;m.next=g,g.prev=m,p.length-=b}function h(p){for(var m=[],O=p.head.next;O!==p.tail;)m.push(O.value),O=O.next;return m}return o}();e.exports=n,n.default=n}}),Y=qG(KG());Y.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Y.languages.markup.tag.inside["attr-value"].inside.entity=Y.languages.markup.entity,Y.languages.markup.doctype.inside["internal-subset"].inside=Y.languages.markup,Y.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&/,"&"))}),Object.defineProperty(Y.languages.markup.tag,"addInlined",{value:function(t,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Y.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:Y.languages[r]},{});r[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:n},Y.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(Y.languages.markup.tag,"addAttribute",{value:function(t,e){Y.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Y.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Y.languages.html=Y.languages.markup,Y.languages.mathml=Y.languages.markup,Y.languages.svg=Y.languages.markup,Y.languages.xml=Y.languages.extend("markup",{}),Y.languages.ssml=Y.languages.xml,Y.languages.atom=Y.languages.xml,Y.languages.rss=Y.languages.xml,function(t){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(Y),Y.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Y.languages.javascript=Y.languages.extend("clike",{"class-name":[Y.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Y.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Y.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Y.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Y.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Y.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Y.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Y.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Y.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Y.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Y.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Y.languages.markup&&(Y.languages.markup.tag.addInlined("script","javascript"),Y.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Y.languages.js=Y.languages.javascript,Y.languages.actionscript=Y.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),Y.languages.actionscript["class-name"].alias="function",delete Y.languages.actionscript.parameter,delete Y.languages.actionscript["literal-property"],Y.languages.markup&&Y.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:Y.languages.markup}}),function(t){var e=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:e,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:e,interpolation:n}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript}(Y),function(t){var e=t.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(e,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(i){var s=function(f){f.inside||(f.inside={}),f.inside.rest=r},o="doc-comment";if(a=t.languages[i]){var a,l=a[o];if((l=l||(a=t.languages.insertBefore(i,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[o])instanceof RegExp&&(l=a[o]={pattern:l}),Array.isArray(l))for(var c=0,u=l.length;c<u;c++)l[c]instanceof RegExp&&(l[c]={pattern:l[c]}),s(l[c]);else s(l)}})}}),e.addSupport(["java","javascript","php"],e)}(Y),function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,e=(t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css,t.languages.markup);e&&(e.tag.addInlined("style","css"),e.tag.addAttribute("style","css"))}(Y),function(t){var e=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,e=(t.languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:e={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+e.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[e,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=e,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:e,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:e,number:n})}(Y),function(t){var e=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+e.source+")?|"+e.source+"(?:[ ]+"+n.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),s=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(a,l){l=(l||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(c,l)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+s+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(s),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:e,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml}(Y),function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(c){return c=c.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),s=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,o=(t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(u){c!==u&&(t.languages.markdown[c].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(c){c.language!=="markdown"&&c.language!=="md"||function u(f){if(f&&typeof f!="string")for(var d=0,h=f.length;d<h;d++){var p,m=f[d];m.type!=="code"?u(m.content):(p=m.content[1],m=m.content[3],p&&m&&p.type==="code-language"&&m.type==="code-block"&&typeof p.content=="string"&&(p=p.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),p="language-"+(p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase()),m.alias?typeof m.alias=="string"?m.alias=[m.alias,p]:m.alias.push(p):m.alias=[p]))}}(c.tokens)}),t.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var u="",f=0,d=c.classes.length;f<d;f++){var h=c.classes[f],h=/language-(.+)/.exec(h);if(h){u=h[1];break}}var p,m=t.languages[u];m?c.content=t.highlight(function(O){return O=O.replace(o,""),O=O.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(g,b){var y;return(b=b.toLowerCase())[0]==="#"?(y=b[1]==="x"?parseInt(b.slice(2),16):Number(b.slice(1)),l(y)):a[b]||g})}(c.content),m,u):u&&u!=="none"&&t.plugins.autoloader&&(p="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),c.attributes.id=p,t.plugins.autoloader.loadLanguages(u,function(){var O=document.getElementById(p);O&&(O.innerHTML=t.highlight(O.textContent,t.languages[u],u))}))}}),RegExp(t.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;t.languages.md=t.languages.markdown}(Y),Y.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:Y.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},Y.hooks.add("after-tokenize",function(t){if(t.language==="graphql")for(var e=t.tokens.filter(function(p){return typeof p!="string"&&p.type!=="comment"&&p.type!=="scalar"}),n=0;n<e.length;){var r=e[n++];if(r.type==="keyword"&&r.content==="mutation"){var i=[];if(f(["definition-mutation","punctuation"])&&u(1).content==="("){n+=2;var s=d(/^\($/,/^\)$/);if(s===-1)continue;for(;n<s;n++){var o=u(0);o.type==="variable"&&(h(o,"variable-input"),i.push(o.content))}n=s+1}if(f(["punctuation","property-query"])&&u(0).content==="{"&&(n++,h(u(0),"property-mutation"),0<i.length)){var a=d(/^\{$/,/^\}$/);if(a!==-1)for(var l=n;l<a;l++){var c=e[l];c.type==="variable"&&0<=i.indexOf(c.content)&&h(c,"variable-input")}}}}function u(p){return e[n+p]}function f(p,m){m=m||0;for(var O=0;O<p.length;O++){var g=u(O+m);if(!g||g.type!==p[O])return}return 1}function d(p,m){for(var O=1,g=n;g<e.length;g++){var b=e[g],y=b.content;if(b.type==="punctuation"&&typeof y=="string"){if(p.test(y))O++;else if(m.test(y)&&--O===0)return g}}return-1}function h(p,m){var O=p.alias;O?Array.isArray(O)||(p.alias=O=[O]):p.alias=O=[],O.push(m)}}),Y.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(t){var e=t.languages.javascript["template-string"],n=e.pattern.source,r=e.inside.interpolation,i=r.inside["interpolation-punctuation"],s=r.pattern.source;function o(f,d){if(t.languages[f])return{pattern:RegExp("((?:"+d+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:f}}}}function a(f,d,h){return f={code:f,grammar:d,language:h},t.hooks.run("before-tokenize",f),f.tokens=t.tokenize(f.code,f.grammar),t.hooks.run("after-tokenize",f),f.tokens}function l(f,d,h){var O=t.tokenize(f,{interpolation:{pattern:RegExp(s),lookbehind:!0}}),p=0,m={},O=a(O.map(function(b){if(typeof b=="string")return b;for(var y,v,b=b.content;f.indexOf((v=p++,y="___"+h.toUpperCase()+"_"+v+"___"))!==-1;);return m[y]=b,y}).join(""),d,h),g=Object.keys(m);return p=0,function b(y){for(var v=0;v<y.length;v++){if(p>=g.length)return;var S,E,w,k,N,$,C,_=y[v];typeof _=="string"||typeof _.content=="string"?(S=g[p],(C=($=typeof _=="string"?_:_.content).indexOf(S))!==-1&&(++p,E=$.substring(0,C),N=m[S],w=void 0,(k={})["interpolation-punctuation"]=i,(k=t.tokenize(N,k)).length===3&&((w=[1,1]).push.apply(w,a(k[1],t.languages.javascript,"javascript")),k.splice.apply(k,w)),w=new t.Token("interpolation",k,r.alias,N),k=$.substring(C+S.length),N=[],E&&N.push(E),N.push(w),k&&(b($=[k]),N.push.apply(N,$)),typeof _=="string"?(y.splice.apply(y,[v,1].concat(N)),v+=N.length-1):_.content=N)):(C=_.content,Array.isArray(C)?b(C):b([C]))}}(O),new t.Token(h,O,"language-"+h,f)}t.languages.javascript["template-string"]=[o("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),o("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),o("svg",/\bsvg/.source),o("markdown",/\b(?:markdown|md)/.source),o("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),o("sql",/\bsql/.source),e].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(f){return typeof f=="string"?f:Array.isArray(f)?f.map(u).join(""):u(f.content)}t.hooks.add("after-tokenize",function(f){f.language in c&&function d(h){for(var p=0,m=h.length;p<m;p++){var O,g,b,y=h[p];typeof y!="string"&&(O=y.content,Array.isArray(O)?y.type==="template-string"?(y=O[1],O.length===3&&typeof y!="string"&&y.type==="embedded-code"&&(g=u(y),y=y.alias,y=Array.isArray(y)?y[0]:y,b=t.languages[y])&&(O[1]=l(g,b,y))):d(O):typeof O!="string"&&d([O]))}}(f.tokens)})}(Y),function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript}(Y),function(t){var e=t.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:e,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:e.string,number:e.number,boolean:e.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:e,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)}(Y),function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(Y),Y.languages.n4js=Y.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),Y.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),Y.languages.n4jsd=Y.languages.n4js,function(t){function e(o,a){return RegExp(o.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),t.languages.insertBefore("javascript","keyword",{imports:{pattern:e(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:e(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:e(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var s=n[r],i=t.languages.javascript[s],s=(i=t.util.type(i)==="RegExp"?t.languages.javascript[s]={pattern:i}:i).inside||{};(i.inside=s)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(Y),function(t){var e=t.util.clone(t.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function s(l,c){return l=l.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(l,c)}i=s(i).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:s(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:s(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);function o(l){for(var c=[],u=0;u<l.length;u++){var f=l[u],d=!1;typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?0<c.length&&c[c.length-1].tagName===a(f.content[0].content[1])&&c.pop():f.content[f.content.length-1].content!=="/>"&&c.push({tagName:a(f.content[0].content[1]),openedBraces:0}):0<c.length&&f.type==="punctuation"&&f.content==="{"?c[c.length-1].openedBraces++:0<c.length&&0<c[c.length-1].openedBraces&&f.type==="punctuation"&&f.content==="}"?c[c.length-1].openedBraces--:d=!0),(d||typeof f=="string")&&0<c.length&&c[c.length-1].openedBraces===0&&(d=a(f),u<l.length-1&&(typeof l[u+1]=="string"||l[u+1].type==="plain-text")&&(d+=a(l[u+1]),l.splice(u+1,1)),0<u&&(typeof l[u-1]=="string"||l[u-1].type==="plain-text")&&(d=a(l[u-1])+d,l.splice(u-1,1),u--),l[u]=new t.Token("plain-text",d,null,d)),f.content&&typeof f.content!="string"&&o(f.content)}}var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""};t.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||o(l.tokens)})}(Y),function(t){var e=t.util.clone(t.languages.typescript),e=(t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"],t.languages.tsx.tag);e.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+e.pattern.source+")",e.pattern.flags),e.lookbehind=!0}(Y),Y.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Y.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=Y.languages.swift}),function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var e={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:e},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:e},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin}(Y),Y.languages.c=Y.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Y.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Y.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Y.languages.c.string],char:Y.languages.c.char,comment:Y.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Y.languages.c}}}}),Y.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Y.languages.c.boolean,Y.languages.objectivec=Y.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Y.languages.objectivec["class-name"],Y.languages.objc=Y.languages.objectivec,Y.languages.reason=Y.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),Y.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete Y.languages.reason.function,function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(Y),Y.languages.go=Y.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),Y.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete Y.languages.go["class-name"],function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(Y),Y.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Y.languages.python["string-interpolation"].inside.interpolation.inside.rest=Y.languages.python,Y.languages.py=Y.languages.python,Y.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Y.languages.webmanifest=Y.languages.json;var vA={};GG(vA,{dracula:()=>eH,duotoneDark:()=>nH,duotoneLight:()=>iH,github:()=>oH,gruvboxMaterialDark:()=>RH,gruvboxMaterialLight:()=>LH,jettwaveDark:()=>NH,jettwaveLight:()=>_H,nightOwl:()=>lH,nightOwlLight:()=>uH,oceanicNext:()=>dH,okaidia:()=>pH,oneDark:()=>$H,oneLight:()=>IH,palenight:()=>gH,shadesOfPurple:()=>yH,synthwave84:()=>xH,ultramin:()=>wH,vsDark:()=>wA,vsLight:()=>EH});var JG={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},eH=JG,tH={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},nH=tH,rH={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},iH=rH,sH={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},oH=sH,aH={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},lH=aH,cH={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},uH=cH,on={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},fH={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:on.keyword}},{types:["attr-value"],style:{color:on.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:on.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:on.primitive}},{types:["boolean"],style:{color:on.boolean}},{types:["tag"],style:{color:on.tag}},{types:["string"],style:{color:on.string}},{types:["punctuation"],style:{color:on.string}},{types:["selector","char","builtin","inserted"],style:{color:on.char}},{types:["function"],style:{color:on.function}},{types:["operator","entity","url","variable"],style:{color:on.variable}},{types:["keyword"],style:{color:on.keyword}},{types:["atrule","class-name"],style:{color:on.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},dH=fH,hH={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},pH=hH,mH={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},gH=mH,OH={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},yH=OH,bH={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},xH=bH,vH={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},wH=vH,SH={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},wA=SH,kH={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},EH=kH,TH={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},NH=TH,PH={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},_H=PH,CH={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},$H=CH,AH={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},IH=AH,QH={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},RH=QH,MH={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},LH=MH,DH=t=>Q.useCallback(e=>{var n=e,{className:r,style:i,line:s}=n,o=xA(n,["className","style","line"]);const a=Ih(Pr({},o),{className:OA("token-line",r)});return typeof t=="object"&&"plain"in t&&(a.style=t.plain),typeof i=="object"&&(a.style=Pr(Pr({},a.style||{}),i)),a},[t]),ZH=t=>{const e=Q.useCallback(({types:n,empty:r})=>{if(t!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return t[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(i=>t[i]))}},[t]);return Q.useCallback(n=>{var r=n,{token:i,className:s,style:o}=r,a=xA(r,["token","className","style"]);const l=Ih(Pr({},a),{className:OA("token",...i.types,s),children:i.content,style:e(i)});return o!=null&&(l.style=Pr(Pr({},l.style||{}),o)),l},[e])},VH=/\r\n|\r|\n/,sk=t=>{t.length===0?t.push({types:["plain"],content:`
|
|
88
|
+
`,empty:!0}):t.length===1&&t[0].content===""&&(t[0].content=`
|
|
89
|
+
`,t[0].empty=!0)},ok=(t,e)=>{const n=t.length;return n>0&&t[n-1]===e?t:t.concat(e)},jH=t=>{const e=[[]],n=[t],r=[0],i=[t.length];let s=0,o=0,a=[];const l=[a];for(;o>-1;){for(;(s=r[o]++)<i[o];){let c,u=e[o];const d=n[o][s];if(typeof d=="string"?(u=o>0?u:["plain"],c=d):(u=ok(u,d.type),d.alias&&(u=ok(u,d.alias)),c=d.content),typeof c!="string"){o++,e.push(u),n.push(c),r.push(0),i.push(c.length);continue}const h=c.split(VH),p=h.length;a.push({types:u,content:h[0]});for(let m=1;m<p;m++)sk(a),l.push(a=[]),a.push({types:u,content:h[m]})}o--,e.pop(),n.pop(),r.pop(),i.pop()}return sk(a),l},ak=jH,BH=({prism:t,code:e,grammar:n,language:r})=>Q.useMemo(()=>{if(n==null)return ak([e]);const i={code:e,grammar:n,language:r,tokens:[]};return t.hooks.run("before-tokenize",i),i.tokens=t.tokenize(e,n),t.hooks.run("after-tokenize",i),ak(i.tokens)},[e,n,r,t]),FH=(t,e)=>{const{plain:n}=t,r=t.styles.reduce((i,s)=>{const{languages:o,style:a}=s;return o&&!o.includes(e)||s.types.forEach(l=>{const c=Pr(Pr({},i[l]),a);i[l]=c}),i},{});return r.root=n,r.plain=Ih(Pr({},n),{backgroundColor:void 0}),r},XH=FH,zH=({children:t,language:e,code:n,theme:r,prism:i})=>{const s=e.toLowerCase(),o=XH(r,s),a=DH(o),l=ZH(o),c=i.languages[s],u=BH({prism:i,language:s,code:n,grammar:c});return t({tokens:u,className:`prism-code language-${s}`,style:o!=null?o.root:{},getLineProps:a,getTokenProps:l})},WH=t=>Q.createElement(zH,Ih(Pr({},t),{prism:t.prism||Y,theme:t.theme||wA,code:t.code,language:t.language}));/*! Bundled license information:
|
|
90
|
+
|
|
91
|
+
prismjs/prism.js:
|
|
92
|
+
(**
|
|
93
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
94
|
+
*
|
|
95
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
96
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
97
|
+
* @namespace
|
|
98
|
+
* @public
|
|
99
|
+
*)
|
|
100
|
+
*/function UH(){const t=U(O=>O.isPreviewOpen),e=U(O=>O.compiledResults),n=U(O=>O.compileErrors),r=U(O=>O.selectedPreviewFile),i=U(id),s=U(O=>O.isWritingAll),o=U(O=>O.lastWrittenFiles),a=U(O=>O.lastError),l=U(O=>O.closePreview),c=U(O=>O.writeProjectToDisk),u=U(O=>O.selectPreviewFile),[f,d]=Q.useState(!1);if(!t||e===null)return null;const h=e.find(O=>O.relativePath===r),p=(h==null?void 0:h.code)??"",m=new Set(n.map(O=>O.relativePath));return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:x.jsxs("div",{className:"flex max-h-[80vh] w-[920px] flex-col rounded-lg border border-black/60 bg-[#242424] shadow-2xl shadow-black/60",children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-black/60 px-4 py-2",children:[x.jsx("div",{children:x.jsxs("h2",{className:"text-sm font-semibold text-neutral-100",children:["Compiled Project (",e.length," files)"]})}),x.jsx("button",{onClick:l,className:"text-neutral-500 hover:text-neutral-300",children:"✕"})]}),x.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[x.jsx("div",{className:"w-52 shrink-0 overflow-y-auto border-r border-black/60 bg-[#1f1f1f] py-1",children:e.map(O=>x.jsxs("button",{onClick:()=>u(O.relativePath),className:`flex w-full items-center justify-between gap-1 px-3 py-1.5 text-left text-xs hover:bg-neutral-700 ${O.relativePath===r?"bg-neutral-700 text-neutral-100":"text-neutral-300"}`,title:O.relativePath,children:[x.jsx("span",{className:"truncate",children:O.relativePath}),m.has(O.relativePath)&&x.jsx("span",{className:"shrink-0 text-red-400",title:"Has compile errors",children:"⚠"})]},O.relativePath))}),x.jsx("div",{className:"flex-1 overflow-auto p-2",children:x.jsx(WH,{theme:vA.vsDark,code:p,language:"javascript",children:({className:O,style:g,tokens:b,getLineProps:y,getTokenProps:v})=>x.jsx("pre",{className:`${O} rounded p-3 text-xs`,style:g,children:b.map((S,E)=>x.jsx("div",{...y({line:S}),children:S.map((w,k)=>x.jsx("span",{...v({token:w})},k))},E))})})})]}),x.jsxs("div",{className:"border-t border-black/60 px-4 py-3",children:[i&&x.jsx("p",{className:"mb-2 text-xs text-amber-400",children:"Project files changed since last compile — click Compile again before writing."}),o&&!f&&x.jsxs("div",{className:"mb-2 text-xs text-green-400",children:[x.jsxs("p",{children:["Written ",o.length," file(s):"]}),x.jsx("ul",{className:"ml-3 list-disc",children:o.map(O=>x.jsx("li",{children:O.outputPath},O.relativePath))})]}),a&&x.jsx("p",{className:"mb-2 text-xs text-red-400",children:a}),x.jsxs("div",{className:"flex justify-end gap-2",children:[x.jsx("button",{onClick:l,className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",children:"Close"}),f?x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"self-center text-xs text-neutral-400",children:"This will overwrite existing files on disk. Confirm?"}),x.jsx("button",{onClick:()=>d(!1),className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",children:"Cancel"}),x.jsx("button",{onClick:async()=>{await c()&&d(!1)},disabled:s,className:"rounded bg-red-600 px-3 py-1 text-xs font-medium text-white hover:bg-red-700 disabled:opacity-50",children:s?"Writing…":"Confirm"})]}):x.jsx("button",{onClick:()=>d(!0),disabled:i,className:"rounded bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:"Write All to Disk"})]})]})]})})}function YH(){const t=U(s=>s.expandedCodeField),e=U(s=>s.nodes.find(o=>{var a;return o.id===((a=s.expandedCodeField)==null?void 0:a.nodeId)})),n=U(s=>s.nodeDefinitions),r=U(s=>s.updateNodeConfig),i=U(s=>s.closeCodeExpand);return t&&e?x.jsx(GH,{expandedCodeField:t,node:e,nodeDefinitions:n,updateNodeConfig:r,closeCodeExpand:i}):null}function GH({expandedCodeField:t,node:e,nodeDefinitions:n,updateNodeConfig:r,closeCodeExpand:i}){var p;const s=e.type?n[e.type]:void 0,o=s==null?void 0:s.configSchema.find(m=>m.key===t.fieldKey),a=(p=e.data)==null?void 0:p[t.fieldKey],l=o?hA(o):!0,[c,u]=Q.useState(()=>l?String(a??""):JSON.stringify(a??(o==null?void 0:o.default),null,2)),[f,d]=Q.useState(null);if(!o)return null;const h=()=>{if(l){r(t.nodeId,t.fieldKey,c),i();return}try{const m=JSON.parse(c);r(t.nodeId,t.fieldKey,m),i()}catch{d("Invalid JSON")}};return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:x.jsxs("div",{className:"flex max-h-[90vh] w-[min(1100px,90vw)] flex-col rounded-lg border border-black/60 bg-[#242424] shadow-2xl shadow-black/60",children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-black/60 px-4 py-2",children:[x.jsxs("h2",{className:"text-sm font-semibold text-neutral-100",children:[(s==null?void 0:s.label)??e.type," — ",t.fieldLabel]}),x.jsx("button",{onClick:i,className:"text-neutral-500 hover:text-neutral-300",children:"✕"})]}),x.jsx("div",{className:"flex-1 overflow-hidden p-2",children:x.jsx(Dc,{value:c,theme:Ch,height:"70vh",extensions:pA(o),basicSetup:$h,onChange:m=>{u(m),l||d(null)}},`${t.nodeId}:${t.fieldKey}`)}),x.jsxs("div",{className:"border-t border-black/60 px-4 py-3",children:[f&&x.jsx("p",{className:"mb-2 text-xs text-red-400",children:f}),x.jsxs("div",{className:"flex justify-end gap-2",children:[x.jsx("button",{onClick:i,className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",children:"Cancel"}),x.jsx("button",{onClick:h,className:"rounded bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-700",children:"Done"})]})]})]})})}let vb=1;function fm(t){return`fgnode_${t.replace(/\./g,"_")}_${vb++}`}function HH(){return`fgedge_${vb++}`}function qH(){return`fgvar_${vb++}`}function dm(t){var n;const e=(n=t.data)==null?void 0:n.params;return Array.isArray(e)?e:[]}function KH(t,e,n=[]){const r=t.nodes.map(u=>({id:u.id,type:u.type,position:u.position,data:u.data??{}})),i=t.edges.map(u=>({id:u.id,source:u.source,target:u.target,sourceHandle:u.sourceHandle,targetHandle:u.targetHandle,type:"flow-edge"})),s=r.filter(u=>u.type==="logic.graphEntry"),o=new Set(s.slice(1).map(u=>u.id));let a=r.filter(u=>!o.has(u.id)),l=i.filter(u=>!o.has(u.source)&&!o.has(u.target));const c=s[0];return c?(a=a.map(u=>u.id===c.id?{...u,data:{...u.data,params:[...e]}}:u),l=l.filter(u=>!(u.source===c.id&&u.sourceHandle!=null&&u.sourceHandle!=="out"&&!e.includes(u.sourceHandle)))):a=[...a,{id:fm("logic.graphEntry"),type:"logic.graphEntry",position:{x:40,y:40},data:{params:[...e]}}],KO((u,f)=>({nodes:a,edges:l,variables:[...n],selectedNodeId:null,onNodesChange:d=>{const h=d.filter(p=>{var m;return p.type!=="remove"?!0:((m=f().nodes.find(O=>O.id===p.id))==null?void 0:m.type)!=="logic.graphEntry"});u({nodes:UO(h,f().nodes)})},onEdgesChange:d=>u({edges:YO(d,f().edges)}),onConnect:d=>{d.source!==d.target&&u({edges:GO({...d,id:HH(),type:"flow-edge"},f().edges)})},addNode:(d,h,p)=>{u({nodes:[...f().nodes,{id:fm(d),type:d,position:h,data:p}]})},selectNode:d=>u({selectedNodeId:d}),deleteSelectedNode:()=>{var p;const{selectedNodeId:d,nodes:h}=f();d&&((p=h.find(m=>m.id===d))==null?void 0:p.type)!=="logic.graphEntry"&&u({nodes:h.filter(m=>m.id!==d),edges:f().edges.filter(m=>m.source!==d&&m.target!==d),selectedNodeId:null})},deleteEdge:d=>u({edges:f().edges.filter(h=>h.id!==d)}),updateNodeData:(d,h,p)=>{u({nodes:f().nodes.map(m=>m.id===d?{...m,data:{...m.data,[h]:p}}:m)})},addInputPin:d=>{u({nodes:f().nodes.map(h=>h.id===d?YP(h):h)})},removeInputPin:(d,h)=>{const{nodes:p,edges:m}=GP(d,h,f().nodes,f().edges);u({nodes:p,edges:m})},addSwitchCasePin:d=>{u({nodes:f().nodes.map(h=>h.id===d?HP(h):h)})},removeSwitchCasePin:(d,h)=>{const{nodes:p,edges:m}=qP(d,h,f().nodes,f().edges);u({nodes:p,edges:m})},updateSwitchCaseValue:(d,h,p)=>{u({nodes:KP(d,h,p,f().nodes)})},addParam:d=>{const h=d.trim();h&&u({nodes:f().nodes.map(p=>p.type==="logic.graphEntry"?{...p,data:{...p.data,params:[...dm(p),h]}}:p)})},removeParam:d=>{const h=f().nodes.find(p=>p.type==="logic.graphEntry");u({nodes:f().nodes.map(p=>p.type==="logic.graphEntry"?{...p,data:{...p.data,params:dm(p).filter(m=>m!==d)}}:p),edges:h?f().edges.filter(p=>!(p.source===h.id&&p.sourceHandle===d)):f().edges})},renameParam:(d,h)=>{const p=f().nodes.find(m=>m.type==="logic.graphEntry");u({nodes:f().nodes.map(m=>m.type==="logic.graphEntry"?{...m,data:{...m.data,params:dm(m).map(O=>O===d?h:O)}}:m),edges:p?f().edges.map(m=>m.source===p.id&&m.sourceHandle===d?{...m,sourceHandle:h}:m):f().edges})},addReturn:()=>{f().nodes.some(d=>d.type==="logic.graphReturn")||u({nodes:[...f().nodes,{id:fm("logic.graphReturn"),type:"logic.graphReturn",position:{x:600,y:40},data:{}}]})},removeReturn:()=>{const d=f().nodes.find(h=>h.type==="logic.graphReturn");d&&u({nodes:f().nodes.filter(h=>h.id!==d.id),edges:f().edges.filter(h=>h.source!==d.id&&h.target!==d.id)})},addVariable:()=>{const{variables:d}=f(),h=new Set(d.map(g=>g.name));let p="variable",m=1;for(;h.has(p);)m+=1,p=`variable${m}`;const O={id:qH(),name:p,keyword:"let",dataType:"string",defaultValue:""};u({variables:[...d,O]})},renameVariable:(d,h)=>{u({variables:f().variables.map(p=>p.id===d?{...p,name:h}:p)})},setVariableKeyword:(d,h)=>{u({variables:f().variables.map(p=>p.id===d?{...p,keyword:h}:p)})},setVariableDataType:(d,h)=>{u({variables:f().variables.map(p=>p.id===d?{...p,dataType:h}:p)})},setVariableDefault:(d,h)=>{u({variables:f().variables.map(p=>p.id===d?{...p,defaultValue:h}:p)})},removeVariable:d=>{u({variables:f().variables.filter(h=>h.id!==d)})},exportGraph:()=>({nodes:f().nodes.map(d=>({id:d.id,type:d.type,position:d.position,data:d.data??{}})),edges:f().edges.map(d=>({id:d.id,source:d.source,target:d.target,sourceHandle:d.sourceHandle??void 0,targetHandle:d.targetHandle??void 0})),variables:f().variables})}))}const SA=Q.createContext(null);function wb(){return Q.useContext(SA)}const kA=Q.createContext(null);function EA(){return Q.useContext(kA)}function Ad(t){return t.kind==="exec"?!0:t.kind==="value"?!1:t.id==="in"||t.id==="out"}function JH(t,e,n){switch(t){case"express.listen":return`port: ${e.port??3e3}`;case"express.route":return`${e.method??"GET"} ${e.path??"/"}`;case"handler.sendJson":return`status ${e.statusCode??200}`;case"handler.customCode":{const r=String(e.code??"");return r.length>0?`${r.slice(0,24)}${r.length>24?"…":""}`:"(empty)"}case"logic.function":{const r=String(e.name??"");return r.length>0?`${r}(${e.params??""})`:"(unnamed)"}case"logic.require":return`${e.variableName??"?"} = require(${JSON.stringify(e.path??"")})`;case"debug.consoleLog":{const r=String(e.expression??"");return r.length>0?r:"(empty)"}case"variable.get":{const r=n.find(i=>i.id===e.variableId);return r?`Get ${r.name}`:"Get (missing variable)"}case"variable.set":{const r=n.find(i=>i.id===e.variableId);return r?`Set ${r.name}`:"Set (missing variable)"}default:return null}}function lk(t){return t==="handler.customCode"}function ai({id:t,type:e,data:n,selected:r}){const i=U(j=>j.nodeDefinitions),s=wb(),o=e?(s==null?void 0:s[e])??i[e]:void 0,a=U(j=>j.validationErrors.filter(H=>H.nodeId===t)),l=EA(),c=U(j=>j.edges),u=(l==null?void 0:l.edges)??c,f=U(j=>j.variables),d=(l==null?void 0:l.variables)??f,h=U(j=>j.updateNodeConfig),p=U(j=>j.addInputPin),m=U(j=>j.removeInputPin),O=(l==null?void 0:l.updateNodeData)??h,g=(l==null?void 0:l.addInputPin)??p,b=(l==null?void 0:l.removeInputPin)??m;if(!o)return x.jsxs("div",{className:"rounded border border-red-500 bg-neutral-900 px-3 py-2 text-xs text-red-400",children:["Unknown node type: ",e]});const y=a.length>0,v=JH(e??"",n??{},d),S=ii[o.category],E=S.accentHex,w=e==="variable.get"||e==="variable.set"?d.find(j=>j.id===(n==null?void 0:n.variableId)):void 0,k=j=>w&&j.id==="value"?yb(w.dataType):E,N=!!v&&!lk(e??""),$=!!v&&lk(e??""),C=j=>u.some(H=>H.target===t&&H.targetHandle===j),_=j=>u.some(H=>H.source===t&&H.sourceHandle===j),V=(j,H=E)=>j?{width:12,height:12,background:H,border:`2px solid ${H}`,borderRadius:"50%",boxShadow:`0 0 4px ${H}`}:{width:12,height:12,background:"#1e1e1e",border:`2px solid ${H}`,borderRadius:"50%"},P=j=>({width:12,height:12,background:j?"#f5f5f5":"#f5f5f566",border:"none",borderRadius:0,clipPath:"polygon(15% 0%, 100% 50%, 15% 100%)"}),M=(j,H)=>Ad(j)?P(H):V(H,k(j)),R=n??{},L=WP(e,R,o),I=UP(e,R,o),A=zP(e),D=R.literals??{},B=(j,H)=>{O(t,"literals",{...D,[j]:H})},F=!!e&&XP.has(e),q=new Set(Array.isArray(R.extraInputs)?R.extraInputs:[]);return x.jsxs("div",{className:["min-w-[190px] overflow-hidden rounded-xl border shadow-lg shadow-black/50",y?"border-red-500 ring-2 ring-red-500":r?"border-sky-400 ring-2 ring-sky-400":"border-black/60"].join(" "),style:{boxShadow:r?`0 0 0 1px ${E}55, 0 8px 24px -4px ${E}66`:void 0},title:y?a.map(j=>j.message).join(`
|
|
101
|
+
`):void 0,children:[x.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1.5 ${S.headerClass}`,children:[x.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded bg-black/25",children:x.jsx(ia,{category:o.category,className:"h-3.5 w-3.5 text-white/90"})}),x.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[x.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wide text-white",children:o.label}),N&&x.jsx("span",{className:"truncate text-[10px] italic text-white/70",children:v})]})]}),x.jsxs("div",{className:"bg-[#242424]",children:[(L.length>0||I.length>0)&&x.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[x.jsxs("div",{className:"flex flex-col gap-1",children:[L.map(j=>{const H=C(j.id),G=A!==null&&!Ad(j)&&!H,ne=F&&q.has(j.id);return x.jsxs("div",{className:"relative flex items-center gap-1.5",children:[x.jsx(Wo,{type:"target",position:ce.Left,id:j.id,style:M(j,H)}),x.jsx("span",{className:"ml-2 text-[10px] text-neutral-300",children:j.label}),G&&A==="number"&&x.jsx("input",{type:"number",className:"nodrag nopan w-10 rounded border border-neutral-700 bg-[#1f1f1f] px-1 py-0.5 text-[10px] text-neutral-100",value:Number(D[j.id]??0),onChange:z=>B(j.id,Number(z.target.value))}),G&&A==="boolean"&&x.jsx("input",{type:"checkbox",className:"nodrag nopan",checked:!!(D[j.id]??!1),onChange:z=>B(j.id,z.target.checked)}),G&&A==="text"&&x.jsx("input",{type:"text",title:"Any JS literal: a number, a quoted string, or true/false",className:"nodrag nopan w-16 rounded border border-neutral-700 bg-[#1f1f1f] px-1 py-0.5 text-[10px] text-neutral-100",defaultValue:String(D[j.id]??"0"),onBlur:z=>B(j.id,z.target.value),onKeyDown:z=>{z.key==="Enter"&&z.currentTarget.blur()}}),ne&&x.jsx("button",{type:"button",onClick:()=>b(t,j.id),title:"Remove pin",className:"nodrag nopan flex h-4 w-4 shrink-0 items-center justify-center rounded-full border border-red-400 text-[9px] leading-none text-red-400 hover:bg-red-500 hover:text-white",children:"×"})]},j.id)}),F&&x.jsx("button",{type:"button",onClick:()=>g(t),className:"nodrag nopan mt-0.5 self-start text-left text-[10px] text-sky-400 hover:text-sky-300",children:"+ Add pin"})]}),x.jsx("div",{className:"flex flex-col items-end gap-1",children:I.map(j=>{const H=_(j.id);return x.jsxs("div",{className:"relative flex items-center gap-1.5",children:[x.jsx("span",{className:"mr-2 text-[10px] text-neutral-300",children:j.label}),x.jsx(Wo,{type:"source",position:ce.Right,id:j.id,style:M(j,H)})]},j.id)})})]}),$&&x.jsx("div",{className:"mx-2.5 mb-2.5 rounded bg-black/40 px-2 py-1 font-mono text-[10px] text-neutral-200",children:v})]})]})}function ck(t){return x.jsx(ai,{...t})}function uk(t){return x.jsx(ai,{...t})}function eq(t){return x.jsx(ai,{...t})}function fk(t){return x.jsx(ai,{...t})}function Us(t){return x.jsx(ai,{...t})}function tq(t){return x.jsx(ai,{...t})}function ht(t){return x.jsx(ai,{...t})}function dk(t){return x.jsx(ai,{...t})}const nq={"express.init":ck,"express.listen":ck,"express.middleware.jsonParser":uk,"middleware.customCode":uk,"express.route":eq,"handler.sendJson":fk,"handler.customCode":fk,"logic.function":Us,"logic.export":Us,"logic.require":Us,"logic.functionCall":Us,"logic.graphEntry":Us,"logic.graphReturn":Us,"debug.consoleLog":tq,"operators.add":ht,"operators.subtract":ht,"operators.multiply":ht,"operators.divide":ht,"operators.modulo":ht,"operators.equal":ht,"operators.notEqual":ht,"operators.greaterThan":ht,"operators.lessThan":ht,"operators.greaterOrEqual":ht,"operators.lessOrEqual":ht,"operators.and":ht,"operators.nand":ht,"operators.or":ht,"operators.nor":ht,"operators.xor":ht,"operators.not":ht,"controlFlow.branch":dk,"controlFlow.switch":dk},TA=new Proxy(nq,{get(t,e,n){const r=Reflect.get(t,e,n);return r!==void 0?r:typeof e=="string"?ai:r}}),rq="#8f8f8f",iq="#f5f5f5";function NA({id:t,source:e,target:n,sourceX:r,sourceY:i,targetX:s,targetY:o,sourcePosition:a,targetPosition:l,markerEnd:c,style:u,selected:f}){var H;const d=EA(),h=wb(),p=U(G=>G.edges),m=U(G=>G.nodes),O=U(G=>G.nodeDefinitions),g=U(G=>G.validationErrors),b=U(G=>G.deleteEdge),y=U(G=>G.variables),v=(d==null?void 0:d.edges)??p,S=(d==null?void 0:d.nodes)??m,E=(d==null?void 0:d.deleteEdge)??b,w=(d==null?void 0:d.variables)??y,k=!d&&g.some(G=>G.nodeId===e||G.nodeId===n),N=v.find(G=>G.id===t),$=S.find(G=>G.id===e),C=S.find(G=>G.id===n);function _(G){if(G)return(h==null?void 0:h[G])??O[G]}const V=_($==null?void 0:$.type),P=_(C==null?void 0:C.type),M=V?UP($==null?void 0:$.type,$==null?void 0:$.data,V).find(G=>G.id===(N==null?void 0:N.sourceHandle)):void 0,R=P?WP(C==null?void 0:C.type,C==null?void 0:C.data,P).find(G=>G.id===(N==null?void 0:N.targetHandle)):void 0,L=!!(M&&Ad(M)||R&&Ad(R)),I=V==null?void 0:V.category,A=($==null?void 0:$.type)==="variable.get"?w.find(G=>{var ne;return G.id===((ne=$==null?void 0:$.data)==null?void 0:ne.variableId)}):void 0,D=L?iq:A?yb(A.dataType):I&&((H=ii[I])==null?void 0:H.accentHex)||rq,[B,F,q]=jO({sourceX:r,sourceY:i,sourcePosition:a,targetX:s,targetY:o,targetPosition:l,curvature:.32}),j=k?{...u,stroke:"#ef4444",strokeWidth:2,strokeDasharray:"6 4"}:{...u,stroke:D,strokeWidth:2,filter:`drop-shadow(0 0 3px ${D}88)`};return x.jsxs(x.Fragment,{children:[x.jsx(kc,{id:t,path:B,markerEnd:c,style:j}),f&&x.jsx(K4,{children:x.jsx("button",{onClick:G=>{G.stopPropagation(),E(t)},title:"Disconnect",className:"nodrag nopan flex h-5 w-5 items-center justify-center rounded-full border border-red-400 bg-[#2a2a2a] text-[11px] leading-none text-red-400 hover:bg-red-500 hover:text-white",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${F}px, ${q}px)`,pointerEvents:"all"},children:"×"})})]})}function PA(){const[t,e]=Q.useState(!1);return x.jsx(wc,{position:"top-right",className:"!m-3",children:t?x.jsxs("div",{className:"w-40 rounded-lg border border-black/60 bg-[#1f1f1f] p-2.5 text-neutral-100 shadow-lg shadow-black/50",children:[x.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[x.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-neutral-400",children:"Legend"}),x.jsx("button",{onClick:()=>e(!1),className:"text-[11px] text-neutral-500 hover:text-neutral-300","aria-label":"Collapse legend",children:"▴"})]}),x.jsx("div",{className:"flex flex-col gap-1",children:ul.map(n=>{const r=ii[n];return x.jsxs("div",{className:"flex items-center gap-1.5",children:[x.jsx("span",{style:{color:r.accentHex},children:x.jsx(ia,{category:n,className:"h-3 w-3"})}),x.jsx("span",{className:"text-[11px] text-neutral-300",children:r.label})]},n)})})]}):x.jsx("button",{onClick:()=>e(!0),className:"rounded-lg border border-black/60 bg-[#1f1f1f] px-2.5 py-1 text-[11px] font-medium text-neutral-300 shadow-lg shadow-black/50 hover:text-neutral-100",children:"Legend ▾"})})}const hk=170,sq=90;function _A({variableName:t,variableKeyword:e,x:n,y:r,onChoose:i,onClose:s}){const o=Q.useRef(null);Q.useEffect(()=>{function c(f){f.key==="Escape"&&s()}function u(f){var d;(d=o.current)!=null&&d.contains(f.target)||s()}return document.addEventListener("keydown",c),document.addEventListener("pointerdown",u),()=>{document.removeEventListener("keydown",c),document.removeEventListener("pointerdown",u)}},[s]);const a=Math.max(8,Math.min(n,window.innerWidth-hk-8)),l=Math.max(8,Math.min(r,window.innerHeight-sq-8));return x.jsxs("div",{ref:o,style:{position:"fixed",left:a,top:l,width:hk},className:"z-50 flex flex-col overflow-hidden rounded-lg border border-black/60 bg-[#1f1f1f] shadow-2xl shadow-black/60",children:[x.jsxs("button",{onClick:()=>i("get"),className:"px-2.5 py-1.5 text-left text-xs text-neutral-100 hover:bg-neutral-700",children:["Get ",t]}),e!=="const"&&x.jsxs("button",{onClick:()=>i("set"),className:"px-2.5 py-1.5 text-left text-xs text-neutral-100 hover:bg-neutral-700",children:["Set ",t]})]})}const pk=260,mk=420;function oq(t){var n;const e=new Set;for(const r of t)r.type==="logic.functionCall"&&e.add(String(((n=r.data)==null?void 0:n.resultVariable)??"").trim());return e.delete(""),e}function aq(t,e){const n=oq(e),r=`${t}Result`;if(!n.has(r))return r;let i=2;for(;n.has(`${r}${i}`);)i++;return`${r}${i}`}const lq=new Set(["logic.graphEntry","logic.graphReturn","logic.functionCall","variable.get","variable.set"]);function cq({screenX:t,screenY:e,flowPosition:n,localNodes:r,onAddNode:i,onClose:s}){const o=U(w=>w.currentFilePath),a=U(w=>w.nodes.filter(k=>k.type==="logic.require")),l=Q.useRef(null),c=Q.useRef(null),[u,f]=Q.useState(""),[d,h]=Q.useState([]),[p,m]=Q.useState([]);Q.useEffect(()=>{let w=!1;return Ey("function-graph").then(k=>{w||h(k)}),()=>{w=!0}},[]);const O=a.map(w=>{var k,N;return`${w.id}:${(k=w.data)==null?void 0:k.path}:${(N=w.data)==null?void 0:N.variableName}`}).join("|");Q.useEffect(()=>{if(a.length===0||!o){m([]);return}let w=!1;return _h(o,a).then(k=>{w||m(k.flatMap(N=>N.functions))}),()=>{w=!0}},[o,O]),Q.useEffect(()=>{var w;(w=c.current)==null||w.focus()},[]),Q.useEffect(()=>{function w(N){N.key==="Escape"&&s()}function k(N){var $;($=l.current)!=null&&$.contains(N.target)||s()}return document.addEventListener("keydown",w),document.addEventListener("pointerdown",k),()=>{document.removeEventListener("keydown",w),document.removeEventListener("pointerdown",k)}},[s]);const g=Q.useMemo(()=>{const w=u.trim().toLowerCase();return d.filter(k=>!lq.has(k.type)&&(k.label.toLowerCase().includes(w)||k.description.toLowerCase().includes(w)))},[d,u]),b=Q.useMemo(()=>{const w=u.trim().toLowerCase();return p.filter(k=>{const N=`${k.functionName}(${k.params})`,$=`Call via ${k.variableName} (${k.requirePath})`;return N.toLowerCase().includes(w)||$.toLowerCase().includes(w)})},[p,u]),y=Math.max(8,Math.min(t,window.innerWidth-pk-8)),v=Math.max(8,Math.min(e,window.innerHeight-mk-8));function S(w){const k=Object.fromEntries(w.configSchema.map($=>[$.key,$.default])),N=rd(w.type,w);N&&(k.literals=N),i(w.type,n,k),s()}function E(w){const k={requirePath:w.requirePath,variableName:w.variableName,functionName:w.functionName,params:w.params,resultVariable:aq(w.functionName,r)};i("logic.functionCall",n,k),s()}return x.jsxs("div",{ref:l,style:{position:"fixed",left:y,top:v,width:pk,maxHeight:mk},className:"z-50 flex flex-col overflow-hidden rounded-lg border border-black/60 bg-[#1f1f1f] shadow-2xl shadow-black/60",children:[x.jsx("div",{className:"border-b border-black/60 p-2",children:x.jsx("input",{ref:c,value:u,onChange:w=>f(w.target.value),placeholder:"Search nodes…",className:"w-full rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1 text-xs text-neutral-100 outline-none focus:border-sky-500"})}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[x.jsx("div",{className:"flex flex-col gap-1.5",children:g.map(w=>x.jsx(gk,{label:w.label,description:w.description,onClick:()=>S(w)},w.type))}),b.length>0&&x.jsxs("div",{className:"mt-3",children:[x.jsx("h3",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-neutral-500",children:"Function Calls"}),x.jsx("div",{className:"flex flex-col gap-1.5",children:b.map((w,k)=>x.jsx(gk,{label:`${w.functionName}(${w.params})`,description:`Call via ${w.variableName} (${w.requirePath})`,onClick:()=>E(w)},`${w.requirePath}:${w.variableName}:${w.functionName}:${k}`))})]}),g.length===0&&b.length===0&&x.jsx("div",{className:"px-1 py-2 text-xs text-neutral-500",children:"No matching nodes"})]})]})}function gk({label:t,description:e,disabled:n,onClick:r}){return x.jsxs("button",{onClick:r,disabled:n,title:e,className:`rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1.5 text-left text-xs shadow-sm ${n?"cursor-not-allowed opacity-50":"hover:border-sky-500"}`,children:[x.jsx("div",{className:"font-medium text-neutral-100",children:t}),x.jsx("div",{className:"truncate text-neutral-400",children:e})]})}const uq={"flow-edge":NA};function fq(){const t=U(i=>i.openFunctionGraphNodeId),e=U(i=>i.nodes.find(s=>s.id===i.openFunctionGraphNodeId)),n=U(i=>i.closeFunctionGraph),r=U(i=>i.updateNodeConfig);return!t||!e?null:x.jsx(dq,{functionNode:e,closeFunctionGraph:n,updateNodeConfig:r},e.id)}function dq({functionNode:t,closeFunctionGraph:e,updateNodeConfig:n}){var J,ue,fe,oe;const r=Q.useMemo(()=>{var X;return String(((X=t.data)==null?void 0:X.params)??"").split(",").map(ae=>ae.trim()).filter(Boolean)},[]),i=Q.useMemo(()=>{var X,ae;return((ae=(X=t.data)==null?void 0:X.graph)==null?void 0:ae.variables)??[]},[]),s=Q.useMemo(()=>{var X;return KH(((X=t.data)==null?void 0:X.graph)??{nodes:[],edges:[]},r,i)},[]),o=s(X=>X.nodes),a=s(X=>X.edges),l=s(X=>X.onNodesChange),c=s(X=>X.onEdgesChange),u=s(X=>X.onConnect),f=s(X=>X.selectedNodeId),d=s(X=>X.selectNode),h=s(X=>X.deleteSelectedNode),p=s(X=>X.deleteEdge),m=s(X=>X.updateNodeData),O=s(X=>X.addInputPin),g=s(X=>X.removeInputPin),b=s(X=>X.addSwitchCasePin),y=s(X=>X.removeSwitchCasePin),v=s(X=>X.updateSwitchCaseValue),S=s(X=>X.addParam),E=s(X=>X.removeParam),w=s(X=>X.renameParam),k=s(X=>X.addReturn),N=s(X=>X.removeReturn),$=s(X=>X.variables),C=s(X=>X.addVariable),_=s(X=>X.renameVariable),V=s(X=>X.setVariableKeyword),P=s(X=>X.setVariableDataType),M=s(X=>X.setVariableDefault),R=s(X=>X.removeVariable),L=o.find(X=>X.id===f)??null,I=o.find(X=>X.type==="logic.graphEntry"),A=Array.isArray((J=I==null?void 0:I.data)==null?void 0:J.params)?I.data.params:[],D=o.some(X=>X.type==="logic.graphReturn"),[B,F]=Q.useState(null),[q,j]=Q.useState(null),[H,G]=Q.useState(null);Q.useEffect(()=>{let X=!1;return Ey("function-graph").then(ae=>{X||G(Object.fromEntries(ae.map(de=>[de.type,de])))}),()=>{X=!0}},[]);const ne=()=>{var pe;const X=s.getState(),ae=X.nodes.find(we=>we.type==="logic.graphEntry"),de=Array.isArray((pe=ae==null?void 0:ae.data)==null?void 0:pe.params)?ae.data.params:[];n(t.id,"params",de.join(", ")),n(t.id,"graph",X.exportGraph()),e()},z=`Blueprint Graph — ${((ue=t.data)==null?void 0:ue.name)??"function"}(${((fe=t.data)==null?void 0:fe.params)??""})`;return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",children:x.jsxs("div",{className:"flex h-[85vh] w-[95vw] flex-col rounded-lg border border-black/60 bg-[#242424] shadow-2xl shadow-black/60",children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-black/60 px-4 py-2",children:[x.jsx("h2",{className:"text-sm font-semibold text-neutral-100",children:z}),x.jsx("button",{onClick:e,className:"text-neutral-500 hover:text-neutral-300",children:"✕"})]}),x.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[x.jsx("div",{className:"flex-1",children:x.jsx(SA.Provider,{value:H,children:x.jsx(kA.Provider,{value:{edges:a,nodes:o,deleteEdge:p,updateNodeData:m,addInputPin:O,removeInputPin:g,addSwitchCasePin:b,removeSwitchCasePin:y,updateSwitchCaseValue:v,variables:$},children:x.jsx(qO,{children:x.jsx(hq,{nodes:o,edges:a,onNodesChange:l,onEdgesChange:c,onConnect:u,picker:B,setPicker:F,variableDrop:q,setVariableDrop:j,variables:$,localNodes:o,onAddNode:(X,ae,de)=>s.getState().addNode(X,ae,de),onSelectNode:d})})})})}),x.jsxs("div",{className:"w-72 shrink-0 overflow-auto border-l border-black/60 bg-[#1f1f1f] p-3",children:[x.jsx(mq,{functionName:String(((oe=t.data)==null?void 0:oe.name)??""),onRenameFunction:X=>n(t.id,"name",X),paramNames:A,onAddParam:S,onRemoveParam:E,onRenameParam:w,hasReturnNode:D,onAddReturn:k,onRemoveReturn:N,variables:$,onAddVariable:C,onRenameVariable:_,onSetVariableKeyword:V,onSetVariableDataType:P,onSetVariableDefault:M,onRemoveVariable:R}),x.jsx("div",{className:"my-3 border-t border-black/60"}),x.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[x.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-neutral-500",children:"Node Config"}),L&&L.type!=="logic.graphEntry"&&x.jsx("button",{onClick:h,className:"rounded px-2 py-0.5 text-[11px] text-red-400 hover:bg-red-500/10",children:"Delete"})]}),L?x.jsx(pq,{node:L,definition:(H==null?void 0:H[L.type??""])??null,updateNodeData:m,addSwitchCasePin:b,removeSwitchCasePin:y,updateSwitchCaseValue:v,variables:$}):x.jsx("p",{className:"text-xs text-neutral-500",children:"Select a node to configure it."})]})]}),x.jsxs("div",{className:"flex justify-end gap-2 border-t border-black/60 px-4 py-3",children:[x.jsx("button",{onClick:e,className:"rounded border border-neutral-600 px-3 py-1 text-xs font-medium text-neutral-200 hover:bg-neutral-700",children:"Cancel"}),x.jsx("button",{onClick:ne,className:"rounded bg-blue-600 px-3 py-1 text-xs font-medium text-white hover:bg-blue-700",children:"Save & Close"})]})]})})}function hq({nodes:t,edges:e,onNodesChange:n,onEdgesChange:r,onConnect:i,picker:s,setPicker:o,variableDrop:a,setVariableDrop:l,variables:c,localNodes:u,onAddNode:f,onSelectNode:d}){const{screenToFlowPosition:h}=Sc(),p=wb(),m=Q.useCallback(b=>{b.preventDefault();const{clientX:y,clientY:v}=b;o({screenX:y,screenY:v,flowPosition:h({x:y,y:v})})},[h,o]),O=Q.useCallback(b=>{b.preventDefault(),b.dataTransfer.dropEffect="move"},[]),g=Q.useCallback(b=>{b.preventDefault();const y=b.dataTransfer.getData("application/flowserver-variable");if(!y)return;const{variableId:v}=JSON.parse(y),S=h({x:b.clientX,y:b.clientY});l({screenX:b.clientX,screenY:b.clientY,flowPosition:S,variableId:v})},[h,l]);return x.jsxs("div",{className:"h-full w-full bg-[#1b1b1b]",onDragOver:O,onDrop:g,children:[x.jsxs(vN,{nodes:t,edges:e,nodeTypes:TA,edgeTypes:uq,onNodesChange:n,onEdgesChange:r,onConnect:i,onNodeClick:(b,y)=>d(y.id),onPaneClick:()=>d(null),onPaneContextMenu:m,colorMode:"dark",defaultEdgeOptions:{style:{stroke:"#8f8f8f",strokeWidth:2}},deleteKeyCode:["Backspace","Delete"],fitView:!0,children:[x.jsx(SN,{variant:Tr.Dots,color:"#3a3a3a",gap:18,size:1.5}),x.jsx(EN,{}),x.jsx(PA,{})]}),s&&x.jsx(cq,{screenX:s.screenX,screenY:s.screenY,flowPosition:s.flowPosition,localNodes:u,onAddNode:f,onClose:()=>o(null)}),a&&(()=>{const b=c.find(y=>y.id===a.variableId);return b?x.jsx(_A,{variableName:b.name,variableKeyword:b.keyword,x:a.screenX,y:a.screenY,onChoose:y=>{const v=y==="get"?"variable.get":"variable.set",S={variableId:a.variableId},E=p==null?void 0:p[v];if(E){const w=rd(v,E);w&&(S.literals=w)}f(v,a.flowPosition,S),l(null)},onClose:()=>l(null)}):null})()]})}function pq({node:t,definition:e,updateNodeData:n,addSwitchCasePin:r,removeSwitchCasePin:i,updateSwitchCaseValue:s,variables:o}){var a,l,c,u;if(!e)return x.jsx("p",{className:"text-xs text-neutral-500",children:"Loading…"});if(t.type==="variable.get"||t.type==="variable.set"){const f=o.find(d=>{var h;return d.id===((h=t.data)==null?void 0:h.variableId)});return f?x.jsxs("div",{className:"rounded border border-neutral-700 bg-black/30 px-2 py-1.5 text-xs text-neutral-300",children:['Bound to variable "',f.name,'" (',f.keyword,") — edit it in the Variables panel above."]}):x.jsx("div",{className:"rounded border border-red-500/60 bg-red-900/20 px-2 py-1.5 text-xs text-red-400",children:"References a variable that no longer exists."})}if(t.type==="controlFlow.switch")return x.jsx(uA,{node:t,onAddCase:r,onRemoveCase:i,onUpdateCaseValue:s});if(t.type==="logic.functionCall"){const f=String(((a=t.data)==null?void 0:a.variableName)??""),d=String(((l=t.data)==null?void 0:l.functionName)??""),h=String(((c=t.data)==null?void 0:c.params)??"");return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsxs("div",{className:"rounded bg-black/40 px-2 py-1.5 font-mono text-xs text-neutral-200",children:[f,".",d,"(",h,")"]}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Result Variable Name"}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((u=t.data)==null?void 0:u.resultVariable)??""),onChange:p=>n(t.id,"resultVariable",p.target.value)})]})]})}return e.configSchema.length===0?x.jsx("p",{className:"text-xs text-neutral-500",children:"This node has no configuration."}):x.jsx("div",{className:"flex flex-col gap-3",children:e.configSchema.map(f=>{var d,h;return x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:f.label}),f.hint&&x.jsx("span",{className:"text-[11px] text-neutral-500",children:f.hint}),f.type==="code"?x.jsx("div",{className:"overflow-hidden rounded border border-neutral-700",children:x.jsx(Dc,{value:String(((d=t.data)==null?void 0:d[f.key])??""),theme:Ch,height:"100px",extensions:pA(f),basicSetup:$h,onChange:p=>n(t.id,f.key,p)},`${t.id}:${f.key}`)}):x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#1f1f1f] px-2 py-1 text-xs text-neutral-100",value:String(((h=t.data)==null?void 0:h[f.key])??""),onChange:p=>n(t.id,f.key,p.target.value)})]},`${t.id}:${f.key}`)})})}function mq({functionName:t,onRenameFunction:e,paramNames:n,onAddParam:r,onRemoveParam:i,onRenameParam:s,hasReturnNode:o,onAddReturn:a,onRemoveReturn:l,variables:c,onAddVariable:u,onRenameVariable:f,onSetVariableKeyword:d,onSetVariableDataType:h,onSetVariableDefault:p,onRemoveVariable:m}){function O(){let g="param",b=1;for(;n.includes(g);)b+=1,g=`param${b}`;r(g)}return x.jsxs("div",{className:"flex flex-col gap-3",children:[x.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wide text-neutral-500",children:"Function"}),x.jsxs("label",{className:"flex flex-col gap-1",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Name"}),x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1 text-xs text-neutral-100",value:t,onChange:g=>e(g.target.value)})]}),x.jsxs("div",{children:[x.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Inputs"}),x.jsx("button",{onClick:O,title:"Add input",className:"flex h-5 w-5 items-center justify-center rounded border border-neutral-600 text-xs text-neutral-300 hover:border-sky-500 hover:text-sky-400",children:"+"})]}),x.jsxs("div",{className:"flex flex-col gap-1",children:[n.length===0&&x.jsx("p",{className:"text-[11px] text-neutral-500",children:"No inputs."}),n.map((g,b)=>x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("input",{type:"text",className:"w-full rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1 text-xs text-neutral-100",value:g,onChange:y=>{const v=y.target.value.trim();v&&v!==g&&s(g,v)}}),x.jsx("button",{onClick:()=>i(g),title:"Remove input",className:"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-neutral-600 text-xs text-red-400 hover:border-red-500 hover:bg-red-500/10",children:"×"})]},b))]})]}),x.jsxs("div",{children:[x.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[x.jsx("span",{className:"text-xs font-medium text-neutral-400",children:"Outputs"}),!o&&x.jsx("button",{onClick:a,title:"Add output",className:"flex h-5 w-5 items-center justify-center rounded border border-neutral-600 text-xs text-neutral-300 hover:border-sky-500 hover:text-sky-400",children:"+"})]}),o?x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx("span",{className:"flex-1 rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1 text-xs text-neutral-100",children:"Return Value"}),x.jsx("button",{onClick:l,title:"Remove output",className:"flex h-5 w-5 shrink-0 items-center justify-center rounded border border-neutral-600 text-xs text-red-400 hover:border-red-500 hover:bg-red-500/10",children:"×"})]}):x.jsx("p",{className:"text-[11px] text-neutral-500",children:"No return value."})]}),x.jsx(fA,{variables:c,onAdd:u,onRename:f,onSetKeyword:d,onSetDataType:h,onSetDefault:p,onRemove:m})]})}function gq(){const t=U(w=>w.isNodeBrowserOpen),e=U(w=>w.nodeDefinitions),n=U(w=>w.currentFilePath),r=U(w=>w.nodes),i=U(w=>w.addNodeFromBrowser),s=U(w=>w.addFunctionCallNode),o=U(w=>w.closeNodeBrowser),[a,l]=Q.useState(""),[c,u]=Q.useState(null),f=Q.useMemo(()=>{const w=a.trim().toLowerCase(),k=Object.values(e).filter($=>$.type!=="logic.functionCall"&&$.type!=="variable.get"&&$.type!=="variable.set"&&($.label.toLowerCase().includes(w)||$.description.toLowerCase().includes(w))),N=new Map;for(const $ of k){const C=N.get($.category)??[];C.push($),N.set($.category,C)}return N},[e,a]),d=Q.useMemo(()=>r.filter(w=>w.type==="logic.require"),[r]),h=d.map(w=>{var k,N;return`${w.id}:${(k=w.data)==null?void 0:k.path}:${(N=w.data)==null?void 0:N.variableName}`}).join("|"),[p,m]=Q.useState([]);Q.useEffect(()=>{if(d.length===0||!n){m([]);return}let w=!1;return _h(n,d).then(k=>{w||m(k)}),()=>{w=!0}},[n,h]);const O=Q.useMemo(()=>{const w=a.trim().toLowerCase();return p.flatMap(N=>N.functions).filter(N=>{const $=`${N.functionName}(${N.params})`.toLowerCase(),C=`Call via ${N.variableName} (${N.requirePath})`.toLowerCase();return $.includes(w)||C.includes(w)})},[p,a]);if(!t)return null;function g(w){i(w.type),u(w.label)}function b(w){s(w),u(`${w.functionName}(${w.params})`)}function y(w){const k=ii[w];return x.jsxs("div",{className:"mb-4 last:mb-0",children:[x.jsxs("h3",{className:"mb-1.5 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide text-neutral-500",children:[x.jsx("span",{style:{color:k.accentHex},children:x.jsx(ia,{category:w,className:"h-3 w-3"})}),k.label]}),x.jsx("div",{className:"grid grid-cols-2 gap-2",children:f.get(w).map(N=>x.jsxs("button",{draggable:!0,onDragStart:$=>{$.dataTransfer.setData("application/flowserver-node-type",N.type),$.dataTransfer.effectAllowed="move"},onClick:()=>g(N),disabled:n===null,title:N.description,className:"relative rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1.5 text-left text-xs shadow-sm hover:border-sky-500 disabled:cursor-not-allowed disabled:opacity-50",children:[x.jsxs("div",{className:"flex items-center gap-1.5 font-medium text-neutral-100",children:[x.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center rounded",style:{backgroundColor:k.accentHex},children:x.jsx(ia,{category:w,className:"h-2.5 w-2.5 text-white"})}),x.jsx("span",{className:"truncate",children:N.label}),N.type.startsWith("plugin.")&&x.jsx("span",{className:"ml-auto shrink-0 rounded-full border border-amber-500/50 bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-amber-400",children:"Plugin"})]}),x.jsx("div",{className:"truncate text-neutral-400",children:N.description})]},N.type))})]},w)}const v=ul.indexOf("logic"),S=ul.slice(0,v+1).filter(w=>f.has(w)),E=ul.slice(v+1).filter(w=>f.has(w));return x.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:o,children:x.jsxs("div",{onClick:w=>w.stopPropagation(),className:"flex max-h-[80vh] w-[640px] flex-col rounded-lg border border-black/60 bg-[#242424] shadow-2xl shadow-black/60",children:[x.jsxs("div",{className:"flex items-center justify-between border-b border-black/60 px-4 py-2",children:[x.jsx("h2",{className:"text-sm font-semibold text-neutral-100",children:"Built-in Nodes"}),x.jsx("button",{onClick:o,className:"text-neutral-500 hover:text-neutral-300",children:"✕"})]}),x.jsxs("div",{className:"border-b border-black/60 p-3",children:[x.jsx("input",{autoFocus:!0,value:a,onChange:w=>l(w.target.value),placeholder:"Search nodes…",className:"w-full rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1.5 text-sm text-neutral-100 outline-none focus:border-sky-500"}),n===null&&x.jsx("p",{className:"mt-2 text-xs text-amber-400",children:"Open a file first — nodes are added to the current canvas."}),c&&n!==null&&x.jsxs("p",{className:"mt-2 text-xs text-green-400",children:['Added "',c,'" to the canvas.']})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-3",children:[S.map(y),O.length>0&&x.jsxs("div",{className:"mb-4 last:mb-0",children:[x.jsx("h3",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wide text-neutral-500",children:"Function Calls"}),x.jsx("div",{className:"grid grid-cols-2 gap-2",children:O.map((w,k)=>{const N=`${w.functionName}(${w.params})`,$=`Call via ${w.variableName} (${w.requirePath})`;return x.jsxs("button",{draggable:!0,onDragStart:C=>{C.dataTransfer.setData("application/flowserver-function-call",JSON.stringify(w)),C.dataTransfer.effectAllowed="move"},onClick:()=>b(w),disabled:n===null,title:$,className:"rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1.5 text-left text-xs shadow-sm hover:border-sky-500 disabled:cursor-not-allowed disabled:opacity-50",children:[x.jsx("div",{className:"font-medium text-neutral-100",children:N}),x.jsx("div",{className:"truncate text-neutral-400",children:$})]},`${w.requirePath}:${w.variableName}:${w.functionName}:${k}`)})})]}),E.map(y),f.size===0&&O.length===0&&x.jsx("div",{className:"px-1 py-2 text-xs text-neutral-500",children:"No matching nodes"})]})]})})}function Oq(){const t=U(s=>s.isServerRunning),e=U(s=>s.serverLogs),n=Q.useRef(null),{size:r,onMouseDown:i}=ph({initial:160,min:80,max:500,axis:"y",invert:!0});return Q.useEffect(()=>{var s;(s=n.current)==null||s.scrollIntoView({block:"end"})},[e]),!t&&e.length===0?null:x.jsxs("div",{className:"flex shrink-0 flex-col",style:{height:r},children:[x.jsx(ko,{axis:"y",onMouseDown:i}),x.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden border-t border-black/60 bg-[#161616]",children:[x.jsxs("div",{className:"flex items-center gap-2 border-b border-black/60 px-3 py-1",children:[x.jsx("span",{className:`h-2 w-2 rounded-full ${t?"bg-green-500":"bg-neutral-600"}`,title:t?"Running":"Stopped"}),x.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-neutral-400",children:"Server Logs"})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-1.5 font-mono text-[11px] leading-5 text-neutral-300",children:[e.map((s,o)=>x.jsx("div",{className:"whitespace-pre-wrap",children:s},o)),x.jsx("div",{ref:n})]})]})]})}function yq(){const t=U(f=>f.isErrorLogOpen),e=U(f=>f.validationErrors),n=U(f=>f.compileErrors),r=U(f=>f.currentFilePath),i=U(f=>f.closeErrorLog),s=U(f=>f.selectNode),o=U(f=>f.openFile),{size:a,onMouseDown:l}=ph({initial:192,min:80,max:500,axis:"y",invert:!0});if(!t)return null;const c=e.length+n.length;async function u(f,d){f!==r&&await o(f),d&&s(d)}return x.jsxs("div",{className:"flex shrink-0 flex-col",style:{height:a},children:[x.jsx(ko,{axis:"y",onMouseDown:l}),x.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden border-t border-black/60 bg-[#161616]",children:[x.jsxs("div",{className:"flex items-center gap-2 border-b border-black/60 px-3 py-1",children:[x.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"}),x.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-neutral-400",children:["Problems ",c>0&&`(${c})`]}),x.jsx("button",{onClick:i,className:"ml-auto text-neutral-500 hover:text-neutral-300",children:"✕"})]}),x.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-1.5 font-mono text-[11px] leading-5",children:[c===0&&x.jsx("div",{className:"text-neutral-500",children:"No problems found."}),n.length>0&&x.jsxs("div",{className:"mb-2",children:[x.jsx("div",{className:"mb-1 text-neutral-500",children:'Compile errors (last "Compile" run):'}),n.map((f,d)=>x.jsxs("button",{onClick:()=>u(f.relativePath,f.nodeId),className:"block w-full whitespace-pre-wrap py-0.5 text-left text-red-400 hover:bg-white/5",children:[x.jsx("span",{className:"text-neutral-400",children:f.relativePath}),f.nodeId&&x.jsxs("span",{className:"text-neutral-500",children:[" [",f.nodeId,"]"]}),": ",f.message]},d))]}),e.length>0&&x.jsxs("div",{children:[x.jsxs("div",{className:"mb-1 text-neutral-500",children:["Validation errors in ",r??"the current file",":"]}),e.map((f,d)=>x.jsxs("button",{onClick:()=>f.nodeId&&s(f.nodeId),className:"block w-full whitespace-pre-wrap py-0.5 text-left text-amber-400 hover:bg-white/5",children:[f.nodeId&&x.jsxs("span",{className:"text-neutral-500",children:["[",f.nodeId,"] "]}),f.message]},d))]})]})]})]})}const Ok=240,yk=360;function bq({screenX:t,screenY:e,flowPosition:n,onClose:r}){const i=U(w=>w.nodeDefinitions),s=U(w=>w.addNodeFromPalette),o=U(w=>w.addFunctionCallNode),a=U(w=>w.currentFilePath),l=U(w=>w.nodes),[c,u]=Q.useState(""),f=Q.useRef(null),d=Q.useRef(null),h=Q.useMemo(()=>l.filter(w=>w.type==="logic.require"),[l]),p=h.map(w=>{var k,N;return`${w.id}:${(k=w.data)==null?void 0:k.path}:${(N=w.data)==null?void 0:N.variableName}`}).join("|"),[m,O]=Q.useState([]);Q.useEffect(()=>{if(h.length===0||!a){O([]);return}let w=!1;return _h(a,h).then(k=>{w||O(k)}),()=>{w=!0}},[a,p]),Q.useEffect(()=>{var w;(w=f.current)==null||w.focus()},[]),Q.useEffect(()=>{function w(N){N.key==="Escape"&&r()}function k(N){var $;($=d.current)!=null&&$.contains(N.target)||r()}return document.addEventListener("keydown",w),document.addEventListener("pointerdown",k),()=>{document.removeEventListener("keydown",w),document.removeEventListener("pointerdown",k)}},[r]);const g=Q.useMemo(()=>{const w=c.trim().toLowerCase(),k=Object.values(i).filter($=>$.type!=="logic.functionCall"&&$.type!=="variable.get"&&$.type!=="variable.set"&&($.label.toLowerCase().includes(w)||$.description.toLowerCase().includes(w))),N=new Map;for(const $ of k){const C=N.get($.category)??[];C.push($),N.set($.category,C)}return N},[i,c]),b=Q.useMemo(()=>{const w=c.trim().toLowerCase();return m.flatMap(N=>N.functions).filter(N=>{const $=`${N.functionName}(${N.params})`,C=`Call via ${N.variableName} (${N.requirePath})`;return $.toLowerCase().includes(w)||C.toLowerCase().includes(w)})},[m,c]),y=Math.max(8,Math.min(t,window.innerWidth-Ok-8)),v=Math.max(8,Math.min(e,window.innerHeight-yk-8));function S(w){s(w,n),r()}function E(w){o(w,n),r()}return x.jsxs("div",{ref:d,style:{position:"fixed",left:y,top:v,width:Ok,maxHeight:yk},className:"z-50 flex flex-col overflow-hidden rounded-lg border border-black/60 bg-[#1f1f1f] shadow-2xl shadow-black/60",children:[x.jsx("div",{className:"border-b border-black/60 p-2",children:x.jsx("input",{ref:f,value:c,onChange:w=>u(w.target.value),placeholder:"Search nodes…",className:"w-full rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1 text-xs text-neutral-100 outline-none focus:border-sky-500"})}),x.jsxs("div",{className:"flex-1 overflow-y-auto p-2",children:[ul.filter(w=>w!=="debugging"&&g.has(w)).map(w=>x.jsx(hm,{category:w,title:ii[w].label,children:g.get(w).map(k=>x.jsx(pm,{label:k.label,description:k.description,onClick:()=>S(k.type)},k.type))},w)),b.length>0&&x.jsx(hm,{title:"Function Calls",children:b.map((w,k)=>{const N=`${w.functionName}(${w.params})`,$=`Call via ${w.variableName} (${w.requirePath})`;return x.jsx(pm,{label:N,description:$,onClick:()=>E(w)},`${w.requirePath}:${w.variableName}:${w.functionName}:${k}`)})}),g.has("debugging")&&x.jsx(hm,{category:"debugging",title:ii.debugging.label,children:g.get("debugging").map(w=>x.jsx(pm,{label:w.label,description:w.description,onClick:()=>S(w.type)},w.type))}),g.size===0&&b.length===0&&x.jsx("div",{className:"px-1 py-2 text-xs text-neutral-500",children:"No matching nodes"})]})]})}function hm({title:t,category:e,children:n}){return x.jsxs("div",{className:"mb-3 last:mb-0",children:[x.jsxs("h3",{className:"mb-1.5 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide text-neutral-500",children:[e&&x.jsx("span",{style:{color:ii[e].accentHex},children:x.jsx(ia,{category:e,className:"h-3 w-3"})}),t]}),x.jsx("div",{className:"flex flex-col gap-1.5",children:n})]})}function pm({label:t,description:e,onClick:n}){return x.jsxs("button",{onClick:n,title:e,className:"rounded border border-neutral-700 bg-[#2a2a2a] px-2 py-1.5 text-left text-xs shadow-sm hover:border-sky-500",children:[x.jsx("div",{className:"font-medium text-neutral-100",children:t}),x.jsx("div",{className:"truncate text-neutral-400",children:e})]})}const xq={"flow-edge":NA};function vq(){const t=U(v=>v.nodes),e=U(v=>v.edges),n=U(v=>v.onNodesChange),r=U(v=>v.onEdgesChange),i=U(v=>v.onConnect),s=U(v=>v.selectNode),o=U(v=>v.addNodeFromPalette),a=U(v=>v.addFunctionCallNode),l=U(v=>v.addVariableNode),c=U(v=>v.variables),u=U(v=>v.openFunctionGraph),f=U(v=>v.openFunctionGraphNodeId!==null),{screenToFlowPosition:d}=Sc(),[h,p]=Q.useState(null),[m,O]=Q.useState(null),g=Q.useCallback(v=>{v.preventDefault();const{clientX:S,clientY:E}=v;p({screenX:S,screenY:E,flowPosition:d({x:S,y:E})})},[d]),b=Q.useCallback(v=>{v.preventDefault(),v.dataTransfer.dropEffect="move"},[]),y=Q.useCallback(v=>{v.preventDefault();const S=d({x:v.clientX,y:v.clientY}),E=v.dataTransfer.getData("application/flowserver-function-call");if(E){const N=JSON.parse(E);a(N,S);return}const w=v.dataTransfer.getData("application/flowserver-variable");if(w){const{variableId:N}=JSON.parse(w);O({screenX:v.clientX,screenY:v.clientY,flowPosition:S,variableId:N});return}const k=v.dataTransfer.getData("application/flowserver-node-type");k&&o(k,S)},[d,a,o]);return x.jsxs("div",{className:"h-full w-full bg-[#1b1b1b]",onDragOver:b,onDrop:y,children:[x.jsxs(vN,{nodes:t,edges:e,nodeTypes:TA,edgeTypes:xq,onNodesChange:n,onEdgesChange:r,onConnect:i,onNodeClick:(v,S)=>s(S.id),onNodeDoubleClick:(v,S)=>{var E;S.type==="logic.function"&&((E=S.data)==null?void 0:E.mode)==="blueprint"&&u(S.id)},onPaneClick:()=>s(null),onPaneContextMenu:g,colorMode:"dark",defaultEdgeOptions:{style:{stroke:"#8f8f8f",strokeWidth:2}},deleteKeyCode:f?null:["Backspace","Delete"],fitView:!0,children:[x.jsx(SN,{variant:Tr.Dots,color:"#3a3a3a",gap:18,size:1.5}),x.jsx(EN,{}),x.jsx(PA,{})]}),h&&x.jsx(bq,{screenX:h.screenX,screenY:h.screenY,flowPosition:h.flowPosition,onClose:()=>p(null)}),m&&(()=>{const v=c.find(S=>S.id===m.variableId);return v?x.jsx(_A,{variableName:v.name,variableKeyword:v.keyword,x:m.screenX,y:m.screenY,onChoose:S=>{l(m.variableId,S,m.flowPosition),O(null)},onClose:()=>O(null)}):null})()]})}function wq(){const t=U(n=>n.bootstrap),e=U(n=>n.currentFilePath);return Q.useEffect(()=>{t(),Vn.getState().refreshTree()},[t]),x.jsxs("div",{className:"flex h-screen w-screen flex-col bg-[#1b1b1b]",children:[x.jsx($X,{}),x.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[x.jsx(QX,{}),x.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[x.jsx("div",{className:"flex-1",children:e===null?x.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-neutral-500",children:"Select or create a file to begin"}):x.jsx(qO,{children:x.jsx(vq,{})})}),x.jsx(yq,{}),x.jsx(Oq,{})]}),x.jsx(BG,{})]}),x.jsx(UH,{}),x.jsx(YH,{}),x.jsx(fq,{}),x.jsx(gq,{})]})}mm.createRoot(document.getElementById("root")).render(x.jsx(D0.StrictMode,{children:x.jsx(wq,{})}));
|