attraverso 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,90 +0,0 @@
1
- var _k=Object.defineProperty;var bk=(e,t,n)=>t in e?_k(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t,n)=>bk(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Kl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Do(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tg={exports:{}},$s={},Lg={exports:{}},pe={};/**
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 Ro=Symbol.for("react.element"),Ck=Symbol.for("react.portal"),Nk=Symbol.for("react.fragment"),Ik=Symbol.for("react.strict_mode"),Pk=Symbol.for("react.profiler"),Mk=Symbol.for("react.provider"),Tk=Symbol.for("react.context"),Lk=Symbol.for("react.forward_ref"),Ak=Symbol.for("react.suspense"),zk=Symbol.for("react.memo"),Ok=Symbol.for("react.lazy"),Qd=Symbol.iterator;function Dk(e){return e===null||typeof e!="object"?null:(e=Qd&&e[Qd]||e["@@iterator"],typeof e=="function"?e:null)}var Ag={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zg=Object.assign,Og={};function Si(e,t,n){this.props=e,this.context=t,this.refs=Og,this.updater=n||Ag}Si.prototype.isReactComponent={};Si.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dg(){}Dg.prototype=Si.prototype;function Zc(e,t,n){this.props=e,this.context=t,this.refs=Og,this.updater=n||Ag}var Jc=Zc.prototype=new Dg;Jc.constructor=Zc;zg(Jc,Si.prototype);Jc.isPureReactComponent=!0;var qd=Array.isArray,Rg=Object.prototype.hasOwnProperty,ef={current:null},jg={key:!0,ref:!0,__self:!0,__source:!0};function $g(e,t,n){var r,i={},o=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(o=""+t.key),t)Rg.call(t,r)&&!jg.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var a=Array(s),u=0;u<s;u++)a[u]=arguments[u+2];i.children=a}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:Ro,type:e,key:o,ref:l,props:i,_owner:ef.current}}function Rk(e,t){return{$$typeof:Ro,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function tf(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ro}function jk(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Kd=/\/+/g;function Sa(e,t){return typeof e=="object"&&e!==null&&e.key!=null?jk(""+e.key):t.toString(36)}function Pl(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Ro:case Ck:l=!0}}if(l)return l=e,i=i(l),e=r===""?"."+Sa(l,0):r,qd(i)?(n="",e!=null&&(n=e.replace(Kd,"$&/")+"/"),Pl(i,t,n,"",function(u){return u})):i!=null&&(tf(i)&&(i=Rk(i,n+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(Kd,"$&/")+"/")+e)),t.push(i)),1;if(l=0,r=r===""?".":r+":",qd(e))for(var s=0;s<e.length;s++){o=e[s];var a=r+Sa(o,s);l+=Pl(o,t,n,a,i)}else if(a=Dk(e),typeof a=="function")for(e=a.call(e),s=0;!(o=e.next()).done;)o=o.value,a=r+Sa(o,s++),l+=Pl(o,t,n,a,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Zo(e,t,n){if(e==null)return e;var r=[],i=0;return Pl(e,r,"","",function(o){return t.call(n,o,i++)}),r}function $k(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var at={current:null},Ml={transition:null},Fk={ReactCurrentDispatcher:at,ReactCurrentBatchConfig:Ml,ReactCurrentOwner:ef};function Fg(){throw Error("act(...) is not supported in production builds of React.")}pe.Children={map:Zo,forEach:function(e,t,n){Zo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Zo(e,function(){t++}),t},toArray:function(e){return Zo(e,function(t){return t})||[]},only:function(e){if(!tf(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Component=Si;pe.Fragment=Nk;pe.Profiler=Pk;pe.PureComponent=Zc;pe.StrictMode=Ik;pe.Suspense=Ak;pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Fk;pe.act=Fg;pe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=zg({},e.props),i=e.key,o=e.ref,l=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,l=ef.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(a in t)Rg.call(t,a)&&!jg.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&s!==void 0?s[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){s=Array(a);for(var u=0;u<a;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:Ro,type:e.type,key:i,ref:o,props:r,_owner:l}};pe.createContext=function(e){return e={$$typeof:Tk,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Mk,_context:e},e.Consumer=e};pe.createElement=$g;pe.createFactory=function(e){var t=$g.bind(null,e);return t.type=e,t};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:Lk,render:e}};pe.isValidElement=tf;pe.lazy=function(e){return{$$typeof:Ok,_payload:{_status:-1,_result:e},_init:$k}};pe.memo=function(e,t){return{$$typeof:zk,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=Ml.transition;Ml.transition={};try{e()}finally{Ml.transition=t}};pe.unstable_act=Fg;pe.useCallback=function(e,t){return at.current.useCallback(e,t)};pe.useContext=function(e){return at.current.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e){return at.current.useDeferredValue(e)};pe.useEffect=function(e,t){return at.current.useEffect(e,t)};pe.useId=function(){return at.current.useId()};pe.useImperativeHandle=function(e,t,n){return at.current.useImperativeHandle(e,t,n)};pe.useInsertionEffect=function(e,t){return at.current.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return at.current.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return at.current.useMemo(e,t)};pe.useReducer=function(e,t,n){return at.current.useReducer(e,t,n)};pe.useRef=function(e){return at.current.useRef(e)};pe.useState=function(e){return at.current.useState(e)};pe.useSyncExternalStore=function(e,t,n){return at.current.useSyncExternalStore(e,t,n)};pe.useTransition=function(){return at.current.useTransition()};pe.version="18.3.1";Lg.exports=pe;var D=Lg.exports;const Bk=Do(D);/**
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 Hk=D,Vk=Symbol.for("react.element"),Uk=Symbol.for("react.fragment"),Wk=Object.prototype.hasOwnProperty,Yk=Hk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Xk={key:!0,ref:!0,__self:!0,__source:!0};function Bg(e,t,n){var r,i={},o=null,l=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)Wk.call(t,r)&&!Xk.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Vk,type:e,key:o,ref:l,props:i,_owner:Yk.current}}$s.Fragment=Uk;$s.jsx=Bg;$s.jsxs=Bg;Tg.exports=$s;var b=Tg.exports,Hg={exports:{}},Nt={},Vg={exports:{}},Ug={};/**
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(e){function t(M,L){var k=M.length;M.push(L);e:for(;0<k;){var F=k-1>>>1,B=M[F];if(0<i(B,L))M[F]=L,M[k]=B,k=F;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var L=M[0],k=M.pop();if(k!==L){M[0]=k;e:for(var F=0,B=M.length,I=B>>>1;F<I;){var G=2*(F+1)-1,K=M[G],q=G+1,te=M[q];if(0>i(K,k))q<B&&0>i(te,K)?(M[F]=te,M[q]=k,F=q):(M[F]=K,M[G]=k,F=G);else if(q<B&&0>i(te,k))M[F]=te,M[q]=k,F=q;else break e}}return L}function i(M,L){var k=M.sortIndex-L.sortIndex;return k!==0?k:M.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,s=l.now();e.unstable_now=function(){return l.now()-s}}var a=[],u=[],c=1,f=null,d=3,h=!1,p=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(M){for(var L=n(u);L!==null;){if(L.callback===null)r(u);else if(L.startTime<=M)r(u),L.sortIndex=L.expirationTime,t(a,L);else break;L=n(u)}}function v(M){if(x=!1,g(M),!p)if(n(a)!==null)p=!0,O(C);else{var L=n(u);L!==null&&R(v,L.startTime-M)}}function C(M,L){p=!1,x&&(x=!1,m(P),P=-1),h=!0;var k=d;try{for(g(L),f=n(a);f!==null&&(!(f.expirationTime>L)||M&&!T());){var F=f.callback;if(typeof F=="function"){f.callback=null,d=f.priorityLevel;var B=F(f.expirationTime<=L);L=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(a)&&r(a),g(L)}else r(a);f=n(a)}if(f!==null)var I=!0;else{var G=n(u);G!==null&&R(v,G.startTime-L),I=!1}return I}finally{f=null,d=k,h=!1}}var E=!1,S=null,P=-1,z=5,N=-1;function T(){return!(e.unstable_now()-N<z)}function j(){if(S!==null){var M=e.unstable_now();N=M;var L=!0;try{L=S(!0,M)}finally{L?$():(E=!1,S=null)}}else E=!1}var $;if(typeof y=="function")$=function(){y(j)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,A=_.port2;_.port1.onmessage=j,$=function(){A.postMessage(null)}}else $=function(){w(j,0)};function O(M){S=M,E||(E=!0,$())}function R(M,L){P=w(function(){M(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,O(C))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return d},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(M){switch(d){case 1:case 2:case 3:var L=3;break;default:L=d}var k=d;d=L;try{return M()}finally{d=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,L){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var k=d;d=M;try{return L()}finally{d=k}},e.unstable_scheduleCallback=function(M,L,k){var F=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?F+k:F):k=F,M){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=k+B,M={id:c++,callback:L,priorityLevel:M,startTime:k,expirationTime:B,sortIndex:-1},k>F?(M.sortIndex=k,t(u,M),n(a)===null&&M===n(u)&&(x?(m(P),P=-1):x=!0,R(v,k-F))):(M.sortIndex=B,t(a,M),p||h||(p=!0,O(C))),M},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(M){var L=d;return function(){var k=d;d=L;try{return M.apply(this,arguments)}finally{d=k}}}})(Ug);Vg.exports=Ug;var Gk=Vg.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 Qk=D,bt=Gk;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Wg=new Set,so={};function Ar(e,t){ai(e,t),ai(e+"Capture",t)}function ai(e,t){for(so[e]=t,e=0;e<t.length;e++)Wg.add(t[e])}var En=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mu=Object.prototype.hasOwnProperty,qk=/^[: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]*$/,Zd={},Jd={};function Kk(e){return Mu.call(Jd,e)?!0:Mu.call(Zd,e)?!1:qk.test(e)?Jd[e]=!0:(Zd[e]=!0,!1)}function Zk(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Jk(e,t,n,r){if(t===null||typeof t>"u"||Zk(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ut(e,t,n,r,i,o,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=l}var qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qe[e]=new ut(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qe[t]=new ut(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qe[e]=new ut(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qe[e]=new ut(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){qe[e]=new ut(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qe[e]=new ut(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qe[e]=new ut(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qe[e]=new ut(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qe[e]=new ut(e,5,!1,e.toLowerCase(),null,!1,!1)});var nf=/[\-:]([a-z])/g;function rf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(nf,rf);qe[t]=new ut(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(nf,rf);qe[t]=new ut(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(nf,rf);qe[t]=new ut(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qe[e]=new ut(e,1,!1,e.toLowerCase(),null,!1,!1)});qe.xlinkHref=new ut("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qe[e]=new ut(e,1,!1,e.toLowerCase(),null,!0,!0)});function of(e,t,n,r){var i=qe.hasOwnProperty(t)?qe[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Jk(t,n,i,r)&&(n=null),r||i===null?Kk(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var In=Qk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Jo=Symbol.for("react.element"),Fr=Symbol.for("react.portal"),Br=Symbol.for("react.fragment"),lf=Symbol.for("react.strict_mode"),Tu=Symbol.for("react.profiler"),Yg=Symbol.for("react.provider"),Xg=Symbol.for("react.context"),sf=Symbol.for("react.forward_ref"),Lu=Symbol.for("react.suspense"),Au=Symbol.for("react.suspense_list"),af=Symbol.for("react.memo"),On=Symbol.for("react.lazy"),Gg=Symbol.for("react.offscreen"),eh=Symbol.iterator;function Ii(e){return e===null||typeof e!="object"?null:(e=eh&&e[eh]||e["@@iterator"],typeof e=="function"?e:null)}var ze=Object.assign,_a;function Fi(e){if(_a===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);_a=t&&t[1]||""}return`
34
- `+_a+e}var ba=!1;function Ca(e,t){if(!e||ba)return"";ba=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
- `),o=r.stack.split(`
36
- `),l=i.length-1,s=o.length-1;1<=l&&0<=s&&i[l]!==o[s];)s--;for(;1<=l&&0<=s;l--,s--)if(i[l]!==o[s]){if(l!==1||s!==1)do if(l--,s--,0>s||i[l]!==o[s]){var a=`
37
- `+i[l].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=l&&0<=s);break}}}finally{ba=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fi(e):""}function eE(e){switch(e.tag){case 5:return Fi(e.type);case 16:return Fi("Lazy");case 13:return Fi("Suspense");case 19:return Fi("SuspenseList");case 0:case 2:case 15:return e=Ca(e.type,!1),e;case 11:return e=Ca(e.type.render,!1),e;case 1:return e=Ca(e.type,!0),e;default:return""}}function zu(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Br:return"Fragment";case Fr:return"Portal";case Tu:return"Profiler";case lf:return"StrictMode";case Lu:return"Suspense";case Au:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xg:return(e.displayName||"Context")+".Consumer";case Yg:return(e._context.displayName||"Context")+".Provider";case sf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case af:return t=e.displayName||null,t!==null?t:zu(e.type)||"Memo";case On:t=e._payload,e=e._init;try{return zu(e(t))}catch{}}return null}function tE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zu(t);case 8:return t===lf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Kn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nE(e){var t=Qg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(l){r=""+l,o.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function el(e){e._valueTracker||(e._valueTracker=nE(e))}function qg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Qg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Zl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ou(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function th(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Kn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Kg(e,t){t=t.checked,t!=null&&of(e,"checked",t,!1)}function Du(e,t){Kg(e,t);var n=Kn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ru(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ru(e,t.type,Kn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ru(e,t,n){(t!=="number"||Zl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bi=Array.isArray;function ei(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Kn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ju(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return ze({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rh(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(W(92));if(Bi(n)){if(1<n.length)throw Error(W(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Kn(n)}}function Zg(e,t){var n=Kn(t.value),r=Kn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function ih(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Jg(e){switch(e){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 $u(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Jg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var tl,ey=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(tl=tl||document.createElement("div"),tl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=tl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ao(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xi={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},rE=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){rE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function ty(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function ny(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ty(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var iE=ze({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 Fu(e,t){if(t){if(iE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function Bu(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Hu=null;function uf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vu=null,ti=null,ni=null;function oh(e){if(e=Fo(e)){if(typeof Vu!="function")throw Error(W(280));var t=e.stateNode;t&&(t=Us(t),Vu(e.stateNode,e.type,t))}}function ry(e){ti?ni?ni.push(e):ni=[e]:ti=e}function iy(){if(ti){var e=ti,t=ni;if(ni=ti=null,oh(e),t)for(e=0;e<t.length;e++)oh(t[e])}}function oy(e,t){return e(t)}function ly(){}var Na=!1;function sy(e,t,n){if(Na)return e(t,n);Na=!0;try{return oy(e,t,n)}finally{Na=!1,(ti!==null||ni!==null)&&(ly(),iy())}}function uo(e,t){var n=e.stateNode;if(n===null)return null;var r=Us(n);if(r===null)return null;n=r[t];e:switch(t){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)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(W(231,t,typeof n));return n}var Uu=!1;if(En)try{var Pi={};Object.defineProperty(Pi,"passive",{get:function(){Uu=!0}}),window.addEventListener("test",Pi,Pi),window.removeEventListener("test",Pi,Pi)}catch{Uu=!1}function oE(e,t,n,r,i,o,l,s,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Gi=!1,Jl=null,es=!1,Wu=null,lE={onError:function(e){Gi=!0,Jl=e}};function sE(e,t,n,r,i,o,l,s,a){Gi=!1,Jl=null,oE.apply(lE,arguments)}function aE(e,t,n,r,i,o,l,s,a){if(sE.apply(this,arguments),Gi){if(Gi){var u=Jl;Gi=!1,Jl=null}else throw Error(W(198));es||(es=!0,Wu=u)}}function zr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ay(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function lh(e){if(zr(e)!==e)throw Error(W(188))}function uE(e){var t=e.alternate;if(!t){if(t=zr(e),t===null)throw Error(W(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return lh(i),e;if(o===r)return lh(i),t;o=o.sibling}throw Error(W(188))}if(n.return!==r.return)n=i,r=o;else{for(var l=!1,s=i.child;s;){if(s===n){l=!0,n=i,r=o;break}if(s===r){l=!0,r=i,n=o;break}s=s.sibling}if(!l){for(s=o.child;s;){if(s===n){l=!0,n=o,r=i;break}if(s===r){l=!0,r=o,n=i;break}s=s.sibling}if(!l)throw Error(W(189))}}if(n.alternate!==r)throw Error(W(190))}if(n.tag!==3)throw Error(W(188));return n.stateNode.current===n?e:t}function uy(e){return e=uE(e),e!==null?cy(e):null}function cy(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=cy(e);if(t!==null)return t;e=e.sibling}return null}var fy=bt.unstable_scheduleCallback,sh=bt.unstable_cancelCallback,cE=bt.unstable_shouldYield,fE=bt.unstable_requestPaint,Re=bt.unstable_now,dE=bt.unstable_getCurrentPriorityLevel,cf=bt.unstable_ImmediatePriority,dy=bt.unstable_UserBlockingPriority,ts=bt.unstable_NormalPriority,hE=bt.unstable_LowPriority,hy=bt.unstable_IdlePriority,Fs=null,sn=null;function pE(e){if(sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(Fs,e,void 0,(e.current.flags&128)===128)}catch{}}var Xt=Math.clz32?Math.clz32:yE,mE=Math.log,gE=Math.LN2;function yE(e){return e>>>=0,e===0?32:31-(mE(e)/gE|0)|0}var nl=64,rl=4194304;function Hi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ns(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,l=n&268435455;if(l!==0){var s=l&~i;s!==0?r=Hi(s):(o&=l,o!==0&&(r=Hi(o)))}else l=n&~i,l!==0?r=Hi(l):o!==0&&(r=Hi(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Xt(t),i=1<<n,r|=e[n],t&=~i;return r}function xE(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 wE(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var l=31-Xt(o),s=1<<l,a=i[l];a===-1?(!(s&n)||s&r)&&(i[l]=xE(s,t)):a<=t&&(e.expiredLanes|=s),o&=~s}}function Yu(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function py(){var e=nl;return nl<<=1,!(nl&4194240)&&(nl=64),e}function Ia(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function jo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Xt(t),e[t]=n}function vE(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Xt(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function ff(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Xt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Se=0;function my(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var gy,df,yy,xy,wy,Xu=!1,il=[],Hn=null,Vn=null,Un=null,co=new Map,fo=new Map,Rn=[],kE="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 ah(e,t){switch(e){case"focusin":case"focusout":Hn=null;break;case"dragenter":case"dragleave":Vn=null;break;case"mouseover":case"mouseout":Un=null;break;case"pointerover":case"pointerout":co.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fo.delete(t.pointerId)}}function Mi(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=Fo(t),t!==null&&df(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function EE(e,t,n,r,i){switch(t){case"focusin":return Hn=Mi(Hn,e,t,n,r,i),!0;case"dragenter":return Vn=Mi(Vn,e,t,n,r,i),!0;case"mouseover":return Un=Mi(Un,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return co.set(o,Mi(co.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,fo.set(o,Mi(fo.get(o)||null,e,t,n,r,i)),!0}return!1}function vy(e){var t=dr(e.target);if(t!==null){var n=zr(t);if(n!==null){if(t=n.tag,t===13){if(t=ay(n),t!==null){e.blockedOn=t,wy(e.priority,function(){yy(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Tl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Gu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Hu=r,n.target.dispatchEvent(r),Hu=null}else return t=Fo(n),t!==null&&df(t),e.blockedOn=n,!1;t.shift()}return!0}function uh(e,t,n){Tl(e)&&n.delete(t)}function SE(){Xu=!1,Hn!==null&&Tl(Hn)&&(Hn=null),Vn!==null&&Tl(Vn)&&(Vn=null),Un!==null&&Tl(Un)&&(Un=null),co.forEach(uh),fo.forEach(uh)}function Ti(e,t){e.blockedOn===t&&(e.blockedOn=null,Xu||(Xu=!0,bt.unstable_scheduleCallback(bt.unstable_NormalPriority,SE)))}function ho(e){function t(i){return Ti(i,e)}if(0<il.length){Ti(il[0],e);for(var n=1;n<il.length;n++){var r=il[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Hn!==null&&Ti(Hn,e),Vn!==null&&Ti(Vn,e),Un!==null&&Ti(Un,e),co.forEach(t),fo.forEach(t),n=0;n<Rn.length;n++)r=Rn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Rn.length&&(n=Rn[0],n.blockedOn===null);)vy(n),n.blockedOn===null&&Rn.shift()}var ri=In.ReactCurrentBatchConfig,rs=!0;function _E(e,t,n,r){var i=Se,o=ri.transition;ri.transition=null;try{Se=1,hf(e,t,n,r)}finally{Se=i,ri.transition=o}}function bE(e,t,n,r){var i=Se,o=ri.transition;ri.transition=null;try{Se=4,hf(e,t,n,r)}finally{Se=i,ri.transition=o}}function hf(e,t,n,r){if(rs){var i=Gu(e,t,n,r);if(i===null)ja(e,t,r,is,n),ah(e,r);else if(EE(i,e,t,n,r))r.stopPropagation();else if(ah(e,r),t&4&&-1<kE.indexOf(e)){for(;i!==null;){var o=Fo(i);if(o!==null&&gy(o),o=Gu(e,t,n,r),o===null&&ja(e,t,r,is,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else ja(e,t,r,null,n)}}var is=null;function Gu(e,t,n,r){if(is=null,e=uf(r),e=dr(e),e!==null)if(t=zr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ay(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return is=e,null}function ky(e){switch(e){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(dE()){case cf:return 1;case dy:return 4;case ts:case hE:return 16;case hy:return 536870912;default:return 16}default:return 16}}var Fn=null,pf=null,Ll=null;function Ey(){if(Ll)return Ll;var e,t=pf,n=t.length,r,i="value"in Fn?Fn.value:Fn.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var l=n-e;for(r=1;r<=l&&t[n-r]===i[o-r];r++);return Ll=i.slice(e,1<r?1-r:void 0)}function Al(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ol(){return!0}function ch(){return!1}function It(e){function t(n,r,i,o,l){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=l,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?ol:ch,this.isPropagationStopped=ch,this}return ze(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ol)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ol)},persist:function(){},isPersistent:ol}),t}var _i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mf=It(_i),$o=ze({},_i,{view:0,detail:0}),CE=It($o),Pa,Ma,Li,Bs=ze({},$o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Li&&(Li&&e.type==="mousemove"?(Pa=e.screenX-Li.screenX,Ma=e.screenY-Li.screenY):Ma=Pa=0,Li=e),Pa)},movementY:function(e){return"movementY"in e?e.movementY:Ma}}),fh=It(Bs),NE=ze({},Bs,{dataTransfer:0}),IE=It(NE),PE=ze({},$o,{relatedTarget:0}),Ta=It(PE),ME=ze({},_i,{animationName:0,elapsedTime:0,pseudoElement:0}),TE=It(ME),LE=ze({},_i,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),AE=It(LE),zE=ze({},_i,{data:0}),dh=It(zE),OE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DE={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"},RE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jE(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=RE[e])?!!t[e]:!1}function gf(){return jE}var $E=ze({},$o,{key:function(e){if(e.key){var t=OE[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Al(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?DE[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gf,charCode:function(e){return e.type==="keypress"?Al(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Al(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),FE=It($E),BE=ze({},Bs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hh=It(BE),HE=ze({},$o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gf}),VE=It(HE),UE=ze({},_i,{propertyName:0,elapsedTime:0,pseudoElement:0}),WE=It(UE),YE=ze({},Bs,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),XE=It(YE),GE=[9,13,27,32],yf=En&&"CompositionEvent"in window,Qi=null;En&&"documentMode"in document&&(Qi=document.documentMode);var QE=En&&"TextEvent"in window&&!Qi,Sy=En&&(!yf||Qi&&8<Qi&&11>=Qi),ph=" ",mh=!1;function _y(e,t){switch(e){case"keyup":return GE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function by(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hr=!1;function qE(e,t){switch(e){case"compositionend":return by(t);case"keypress":return t.which!==32?null:(mh=!0,ph);case"textInput":return e=t.data,e===ph&&mh?null:e;default:return null}}function KE(e,t){if(Hr)return e==="compositionend"||!yf&&_y(e,t)?(e=Ey(),Ll=pf=Fn=null,Hr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Sy&&t.locale!=="ko"?null:t.data;default:return null}}var ZE={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 gh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ZE[e.type]:t==="textarea"}function Cy(e,t,n,r){ry(r),t=os(t,"onChange"),0<t.length&&(n=new mf("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var qi=null,po=null;function JE(e){Ry(e,0)}function Hs(e){var t=Wr(e);if(qg(t))return e}function eS(e,t){if(e==="change")return t}var Ny=!1;if(En){var La;if(En){var Aa="oninput"in document;if(!Aa){var yh=document.createElement("div");yh.setAttribute("oninput","return;"),Aa=typeof yh.oninput=="function"}La=Aa}else La=!1;Ny=La&&(!document.documentMode||9<document.documentMode)}function xh(){qi&&(qi.detachEvent("onpropertychange",Iy),po=qi=null)}function Iy(e){if(e.propertyName==="value"&&Hs(po)){var t=[];Cy(t,po,e,uf(e)),sy(JE,t)}}function tS(e,t,n){e==="focusin"?(xh(),qi=t,po=n,qi.attachEvent("onpropertychange",Iy)):e==="focusout"&&xh()}function nS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hs(po)}function rS(e,t){if(e==="click")return Hs(t)}function iS(e,t){if(e==="input"||e==="change")return Hs(t)}function oS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qt=typeof Object.is=="function"?Object.is:oS;function mo(e,t){if(qt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Mu.call(t,i)||!qt(e[i],t[i]))return!1}return!0}function wh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vh(e,t){var n=wh(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=wh(n)}}function Py(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Py(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function My(){for(var e=window,t=Zl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Zl(e.document)}return t}function xf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function lS(e){var t=My(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Py(n.ownerDocument.documentElement,n)){if(r!==null&&xf(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=vh(n,o);var l=vh(n,r);i&&l&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sS=En&&"documentMode"in document&&11>=document.documentMode,Vr=null,Qu=null,Ki=null,qu=!1;function kh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qu||Vr==null||Vr!==Zl(r)||(r=Vr,"selectionStart"in r&&xf(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}),Ki&&mo(Ki,r)||(Ki=r,r=os(Qu,"onSelect"),0<r.length&&(t=new mf("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Vr)))}function ll(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ur={animationend:ll("Animation","AnimationEnd"),animationiteration:ll("Animation","AnimationIteration"),animationstart:ll("Animation","AnimationStart"),transitionend:ll("Transition","TransitionEnd")},za={},Ty={};En&&(Ty=document.createElement("div").style,"AnimationEvent"in window||(delete Ur.animationend.animation,delete Ur.animationiteration.animation,delete Ur.animationstart.animation),"TransitionEvent"in window||delete Ur.transitionend.transition);function Vs(e){if(za[e])return za[e];if(!Ur[e])return e;var t=Ur[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ty)return za[e]=t[n];return e}var Ly=Vs("animationend"),Ay=Vs("animationiteration"),zy=Vs("animationstart"),Oy=Vs("transitionend"),Dy=new Map,Eh="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 Jn(e,t){Dy.set(e,t),Ar(t,[e])}for(var Oa=0;Oa<Eh.length;Oa++){var Da=Eh[Oa],aS=Da.toLowerCase(),uS=Da[0].toUpperCase()+Da.slice(1);Jn(aS,"on"+uS)}Jn(Ly,"onAnimationEnd");Jn(Ay,"onAnimationIteration");Jn(zy,"onAnimationStart");Jn("dblclick","onDoubleClick");Jn("focusin","onFocus");Jn("focusout","onBlur");Jn(Oy,"onTransitionEnd");ai("onMouseEnter",["mouseout","mouseover"]);ai("onMouseLeave",["mouseout","mouseover"]);ai("onPointerEnter",["pointerout","pointerover"]);ai("onPointerLeave",["pointerout","pointerover"]);Ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ar("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vi="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(" "),cS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vi));function Sh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,aE(r,t,void 0,e),e.currentTarget=null}function Ry(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var l=r.length-1;0<=l;l--){var s=r[l],a=s.instance,u=s.currentTarget;if(s=s.listener,a!==o&&i.isPropagationStopped())break e;Sh(i,s,u),o=a}else for(l=0;l<r.length;l++){if(s=r[l],a=s.instance,u=s.currentTarget,s=s.listener,a!==o&&i.isPropagationStopped())break e;Sh(i,s,u),o=a}}}if(es)throw e=Wu,es=!1,Wu=null,e}function Ie(e,t){var n=t[tc];n===void 0&&(n=t[tc]=new Set);var r=e+"__bubble";n.has(r)||(jy(t,e,2,!1),n.add(r))}function Ra(e,t,n){var r=0;t&&(r|=4),jy(n,e,r,t)}var sl="_reactListening"+Math.random().toString(36).slice(2);function go(e){if(!e[sl]){e[sl]=!0,Wg.forEach(function(n){n!=="selectionchange"&&(cS.has(n)||Ra(n,!1,e),Ra(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sl]||(t[sl]=!0,Ra("selectionchange",!1,t))}}function jy(e,t,n,r){switch(ky(t)){case 1:var i=_E;break;case 4:i=bE;break;default:i=hf}n=i.bind(null,t,n,e),i=void 0,!Uu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function ja(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var l=r.tag;if(l===3||l===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(l===4)for(l=r.return;l!==null;){var a=l.tag;if((a===3||a===4)&&(a=l.stateNode.containerInfo,a===i||a.nodeType===8&&a.parentNode===i))return;l=l.return}for(;s!==null;){if(l=dr(s),l===null)return;if(a=l.tag,a===5||a===6){r=o=l;continue e}s=s.parentNode}}r=r.return}sy(function(){var u=o,c=uf(n),f=[];e:{var d=Dy.get(e);if(d!==void 0){var h=mf,p=e;switch(e){case"keypress":if(Al(n)===0)break e;case"keydown":case"keyup":h=FE;break;case"focusin":p="focus",h=Ta;break;case"focusout":p="blur",h=Ta;break;case"beforeblur":case"afterblur":h=Ta;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=fh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=IE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=VE;break;case Ly:case Ay:case zy:h=TE;break;case Oy:h=WE;break;case"scroll":h=CE;break;case"wheel":h=XE;break;case"copy":case"cut":case"paste":h=AE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=hh}var x=(t&4)!==0,w=!x&&e==="scroll",m=x?d!==null?d+"Capture":null:d;x=[];for(var y=u,g;y!==null;){g=y;var v=g.stateNode;if(g.tag===5&&v!==null&&(g=v,m!==null&&(v=uo(y,m),v!=null&&x.push(yo(y,v,g)))),w)break;y=y.return}0<x.length&&(d=new h(d,p,null,n,c),f.push({event:d,listeners:x}))}}if(!(t&7)){e:{if(d=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",d&&n!==Hu&&(p=n.relatedTarget||n.fromElement)&&(dr(p)||p[Sn]))break e;if((h||d)&&(d=c.window===c?c:(d=c.ownerDocument)?d.defaultView||d.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=u,p=p?dr(p):null,p!==null&&(w=zr(p),p!==w||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(x=fh,v="onMouseLeave",m="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(x=hh,v="onPointerLeave",m="onPointerEnter",y="pointer"),w=h==null?d:Wr(h),g=p==null?d:Wr(p),d=new x(v,y+"leave",h,n,c),d.target=w,d.relatedTarget=g,v=null,dr(c)===u&&(x=new x(m,y+"enter",p,n,c),x.target=g,x.relatedTarget=w,v=x),w=v,h&&p)t:{for(x=h,m=p,y=0,g=x;g;g=Rr(g))y++;for(g=0,v=m;v;v=Rr(v))g++;for(;0<y-g;)x=Rr(x),y--;for(;0<g-y;)m=Rr(m),g--;for(;y--;){if(x===m||m!==null&&x===m.alternate)break t;x=Rr(x),m=Rr(m)}x=null}else x=null;h!==null&&_h(f,d,h,x,!1),p!==null&&w!==null&&_h(f,w,p,x,!0)}}e:{if(d=u?Wr(u):window,h=d.nodeName&&d.nodeName.toLowerCase(),h==="select"||h==="input"&&d.type==="file")var C=eS;else if(gh(d))if(Ny)C=iS;else{C=nS;var E=tS}else(h=d.nodeName)&&h.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(C=rS);if(C&&(C=C(e,u))){Cy(f,C,n,c);break e}E&&E(e,d,u),e==="focusout"&&(E=d._wrapperState)&&E.controlled&&d.type==="number"&&Ru(d,"number",d.value)}switch(E=u?Wr(u):window,e){case"focusin":(gh(E)||E.contentEditable==="true")&&(Vr=E,Qu=u,Ki=null);break;case"focusout":Ki=Qu=Vr=null;break;case"mousedown":qu=!0;break;case"contextmenu":case"mouseup":case"dragend":qu=!1,kh(f,n,c);break;case"selectionchange":if(sS)break;case"keydown":case"keyup":kh(f,n,c)}var S;if(yf)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Hr?_y(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(Sy&&n.locale!=="ko"&&(Hr||P!=="onCompositionStart"?P==="onCompositionEnd"&&Hr&&(S=Ey()):(Fn=c,pf="value"in Fn?Fn.value:Fn.textContent,Hr=!0)),E=os(u,P),0<E.length&&(P=new dh(P,e,null,n,c),f.push({event:P,listeners:E}),S?P.data=S:(S=by(n),S!==null&&(P.data=S)))),(S=QE?qE(e,n):KE(e,n))&&(u=os(u,"onBeforeInput"),0<u.length&&(c=new dh("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=S))}Ry(f,t)})}function yo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function os(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=uo(e,n),o!=null&&r.unshift(yo(e,o,i)),o=uo(e,t),o!=null&&r.push(yo(e,o,i))),e=e.return}return r}function Rr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _h(e,t,n,r,i){for(var o=t._reactName,l=[];n!==null&&n!==r;){var s=n,a=s.alternate,u=s.stateNode;if(a!==null&&a===r)break;s.tag===5&&u!==null&&(s=u,i?(a=uo(n,o),a!=null&&l.unshift(yo(n,a,s))):i||(a=uo(n,o),a!=null&&l.push(yo(n,a,s)))),n=n.return}l.length!==0&&e.push({event:t,listeners:l})}var fS=/\r\n?/g,dS=/\u0000|\uFFFD/g;function bh(e){return(typeof e=="string"?e:""+e).replace(fS,`
38
- `).replace(dS,"")}function al(e,t,n){if(t=bh(t),bh(e)!==t&&n)throw Error(W(425))}function ls(){}var Ku=null,Zu=null;function Ju(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ec=typeof setTimeout=="function"?setTimeout:void 0,hS=typeof clearTimeout=="function"?clearTimeout:void 0,Ch=typeof Promise=="function"?Promise:void 0,pS=typeof queueMicrotask=="function"?queueMicrotask:typeof Ch<"u"?function(e){return Ch.resolve(null).then(e).catch(mS)}:ec;function mS(e){setTimeout(function(){throw e})}function $a(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),ho(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);ho(t)}function Wn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Nh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var bi=Math.random().toString(36).slice(2),ln="__reactFiber$"+bi,xo="__reactProps$"+bi,Sn="__reactContainer$"+bi,tc="__reactEvents$"+bi,gS="__reactListeners$"+bi,yS="__reactHandles$"+bi;function dr(e){var t=e[ln];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Sn]||n[ln]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Nh(e);e!==null;){if(n=e[ln])return n;e=Nh(e)}return t}e=n,n=e.parentNode}return null}function Fo(e){return e=e[ln]||e[Sn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Wr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function Us(e){return e[xo]||null}var nc=[],Yr=-1;function er(e){return{current:e}}function Pe(e){0>Yr||(e.current=nc[Yr],nc[Yr]=null,Yr--)}function Ne(e,t){Yr++,nc[Yr]=e.current,e.current=t}var Zn={},nt=er(Zn),pt=er(!1),kr=Zn;function ui(e,t){var n=e.type.contextTypes;if(!n)return Zn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function mt(e){return e=e.childContextTypes,e!=null}function ss(){Pe(pt),Pe(nt)}function Ih(e,t,n){if(nt.current!==Zn)throw Error(W(168));Ne(nt,t),Ne(pt,n)}function $y(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(W(108,tE(e)||"Unknown",i));return ze({},n,r)}function as(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Zn,kr=nt.current,Ne(nt,e),Ne(pt,pt.current),!0}function Ph(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=$y(e,t,kr),r.__reactInternalMemoizedMergedChildContext=e,Pe(pt),Pe(nt),Ne(nt,e)):Pe(pt),Ne(pt,n)}var gn=null,Ws=!1,Fa=!1;function Fy(e){gn===null?gn=[e]:gn.push(e)}function xS(e){Ws=!0,Fy(e)}function tr(){if(!Fa&&gn!==null){Fa=!0;var e=0,t=Se;try{var n=gn;for(Se=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}gn=null,Ws=!1}catch(i){throw gn!==null&&(gn=gn.slice(e+1)),fy(cf,tr),i}finally{Se=t,Fa=!1}}return null}var Xr=[],Gr=0,us=null,cs=0,Pt=[],Mt=0,Er=null,xn=1,wn="";function sr(e,t){Xr[Gr++]=cs,Xr[Gr++]=us,us=e,cs=t}function By(e,t,n){Pt[Mt++]=xn,Pt[Mt++]=wn,Pt[Mt++]=Er,Er=e;var r=xn;e=wn;var i=32-Xt(r)-1;r&=~(1<<i),n+=1;var o=32-Xt(t)+i;if(30<o){var l=i-i%5;o=(r&(1<<l)-1).toString(32),r>>=l,i-=l,xn=1<<32-Xt(t)+i|n<<i|r,wn=o+e}else xn=1<<o|n<<i|r,wn=e}function wf(e){e.return!==null&&(sr(e,1),By(e,1,0))}function vf(e){for(;e===us;)us=Xr[--Gr],Xr[Gr]=null,cs=Xr[--Gr],Xr[Gr]=null;for(;e===Er;)Er=Pt[--Mt],Pt[Mt]=null,wn=Pt[--Mt],Pt[Mt]=null,xn=Pt[--Mt],Pt[Mt]=null}var St=null,Et=null,Te=!1,Vt=null;function Hy(e,t){var n=Lt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Mh(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,St=e,Et=Wn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,St=e,Et=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Er!==null?{id:xn,overflow:wn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Lt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,St=e,Et=null,!0):!1;default:return!1}}function rc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ic(e){if(Te){var t=Et;if(t){var n=t;if(!Mh(e,t)){if(rc(e))throw Error(W(418));t=Wn(n.nextSibling);var r=St;t&&Mh(e,t)?Hy(r,n):(e.flags=e.flags&-4097|2,Te=!1,St=e)}}else{if(rc(e))throw Error(W(418));e.flags=e.flags&-4097|2,Te=!1,St=e}}}function Th(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;St=e}function ul(e){if(e!==St)return!1;if(!Te)return Th(e),Te=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ju(e.type,e.memoizedProps)),t&&(t=Et)){if(rc(e))throw Vy(),Error(W(418));for(;t;)Hy(e,t),t=Wn(t.nextSibling)}if(Th(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Et=Wn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Et=null}}else Et=St?Wn(e.stateNode.nextSibling):null;return!0}function Vy(){for(var e=Et;e;)e=Wn(e.nextSibling)}function ci(){Et=St=null,Te=!1}function kf(e){Vt===null?Vt=[e]:Vt.push(e)}var wS=In.ReactCurrentBatchConfig;function Ai(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(W(309));var r=n.stateNode}if(!r)throw Error(W(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(l){var s=i.refs;l===null?delete s[o]:s[o]=l},t._stringRef=o,t)}if(typeof e!="string")throw Error(W(284));if(!n._owner)throw Error(W(290,e))}return e}function cl(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Lh(e){var t=e._init;return t(e._payload)}function Uy(e){function t(m,y){if(e){var g=m.deletions;g===null?(m.deletions=[y],m.flags|=16):g.push(y)}}function n(m,y){if(!e)return null;for(;y!==null;)t(m,y),y=y.sibling;return null}function r(m,y){for(m=new Map;y!==null;)y.key!==null?m.set(y.key,y):m.set(y.index,y),y=y.sibling;return m}function i(m,y){return m=Qn(m,y),m.index=0,m.sibling=null,m}function o(m,y,g){return m.index=g,e?(g=m.alternate,g!==null?(g=g.index,g<y?(m.flags|=2,y):g):(m.flags|=2,y)):(m.flags|=1048576,y)}function l(m){return e&&m.alternate===null&&(m.flags|=2),m}function s(m,y,g,v){return y===null||y.tag!==6?(y=Xa(g,m.mode,v),y.return=m,y):(y=i(y,g),y.return=m,y)}function a(m,y,g,v){var C=g.type;return C===Br?c(m,y,g.props.children,v,g.key):y!==null&&(y.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===On&&Lh(C)===y.type)?(v=i(y,g.props),v.ref=Ai(m,y,g),v.return=m,v):(v=Fl(g.type,g.key,g.props,null,m.mode,v),v.ref=Ai(m,y,g),v.return=m,v)}function u(m,y,g,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=Ga(g,m.mode,v),y.return=m,y):(y=i(y,g.children||[]),y.return=m,y)}function c(m,y,g,v,C){return y===null||y.tag!==7?(y=yr(g,m.mode,v,C),y.return=m,y):(y=i(y,g),y.return=m,y)}function f(m,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Xa(""+y,m.mode,g),y.return=m,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Jo:return g=Fl(y.type,y.key,y.props,null,m.mode,g),g.ref=Ai(m,null,y),g.return=m,g;case Fr:return y=Ga(y,m.mode,g),y.return=m,y;case On:var v=y._init;return f(m,v(y._payload),g)}if(Bi(y)||Ii(y))return y=yr(y,m.mode,g,null),y.return=m,y;cl(m,y)}return null}function d(m,y,g,v){var C=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return C!==null?null:s(m,y,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Jo:return g.key===C?a(m,y,g,v):null;case Fr:return g.key===C?u(m,y,g,v):null;case On:return C=g._init,d(m,y,C(g._payload),v)}if(Bi(g)||Ii(g))return C!==null?null:c(m,y,g,v,null);cl(m,g)}return null}function h(m,y,g,v,C){if(typeof v=="string"&&v!==""||typeof v=="number")return m=m.get(g)||null,s(y,m,""+v,C);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Jo:return m=m.get(v.key===null?g:v.key)||null,a(y,m,v,C);case Fr:return m=m.get(v.key===null?g:v.key)||null,u(y,m,v,C);case On:var E=v._init;return h(m,y,g,E(v._payload),C)}if(Bi(v)||Ii(v))return m=m.get(g)||null,c(y,m,v,C,null);cl(y,v)}return null}function p(m,y,g,v){for(var C=null,E=null,S=y,P=y=0,z=null;S!==null&&P<g.length;P++){S.index>P?(z=S,S=null):z=S.sibling;var N=d(m,S,g[P],v);if(N===null){S===null&&(S=z);break}e&&S&&N.alternate===null&&t(m,S),y=o(N,y,P),E===null?C=N:E.sibling=N,E=N,S=z}if(P===g.length)return n(m,S),Te&&sr(m,P),C;if(S===null){for(;P<g.length;P++)S=f(m,g[P],v),S!==null&&(y=o(S,y,P),E===null?C=S:E.sibling=S,E=S);return Te&&sr(m,P),C}for(S=r(m,S);P<g.length;P++)z=h(S,m,P,g[P],v),z!==null&&(e&&z.alternate!==null&&S.delete(z.key===null?P:z.key),y=o(z,y,P),E===null?C=z:E.sibling=z,E=z);return e&&S.forEach(function(T){return t(m,T)}),Te&&sr(m,P),C}function x(m,y,g,v){var C=Ii(g);if(typeof C!="function")throw Error(W(150));if(g=C.call(g),g==null)throw Error(W(151));for(var E=C=null,S=y,P=y=0,z=null,N=g.next();S!==null&&!N.done;P++,N=g.next()){S.index>P?(z=S,S=null):z=S.sibling;var T=d(m,S,N.value,v);if(T===null){S===null&&(S=z);break}e&&S&&T.alternate===null&&t(m,S),y=o(T,y,P),E===null?C=T:E.sibling=T,E=T,S=z}if(N.done)return n(m,S),Te&&sr(m,P),C;if(S===null){for(;!N.done;P++,N=g.next())N=f(m,N.value,v),N!==null&&(y=o(N,y,P),E===null?C=N:E.sibling=N,E=N);return Te&&sr(m,P),C}for(S=r(m,S);!N.done;P++,N=g.next())N=h(S,m,P,N.value,v),N!==null&&(e&&N.alternate!==null&&S.delete(N.key===null?P:N.key),y=o(N,y,P),E===null?C=N:E.sibling=N,E=N);return e&&S.forEach(function(j){return t(m,j)}),Te&&sr(m,P),C}function w(m,y,g,v){if(typeof g=="object"&&g!==null&&g.type===Br&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Jo:e:{for(var C=g.key,E=y;E!==null;){if(E.key===C){if(C=g.type,C===Br){if(E.tag===7){n(m,E.sibling),y=i(E,g.props.children),y.return=m,m=y;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===On&&Lh(C)===E.type){n(m,E.sibling),y=i(E,g.props),y.ref=Ai(m,E,g),y.return=m,m=y;break e}n(m,E);break}else t(m,E);E=E.sibling}g.type===Br?(y=yr(g.props.children,m.mode,v,g.key),y.return=m,m=y):(v=Fl(g.type,g.key,g.props,null,m.mode,v),v.ref=Ai(m,y,g),v.return=m,m=v)}return l(m);case Fr:e:{for(E=g.key;y!==null;){if(y.key===E)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(m,y.sibling),y=i(y,g.children||[]),y.return=m,m=y;break e}else{n(m,y);break}else t(m,y);y=y.sibling}y=Ga(g,m.mode,v),y.return=m,m=y}return l(m);case On:return E=g._init,w(m,y,E(g._payload),v)}if(Bi(g))return p(m,y,g,v);if(Ii(g))return x(m,y,g,v);cl(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(m,y.sibling),y=i(y,g),y.return=m,m=y):(n(m,y),y=Xa(g,m.mode,v),y.return=m,m=y),l(m)):n(m,y)}return w}var fi=Uy(!0),Wy=Uy(!1),fs=er(null),ds=null,Qr=null,Ef=null;function Sf(){Ef=Qr=ds=null}function _f(e){var t=fs.current;Pe(fs),e._currentValue=t}function oc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ii(e,t){ds=e,Ef=Qr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(dt=!0),e.firstContext=null)}function zt(e){var t=e._currentValue;if(Ef!==e)if(e={context:e,memoizedValue:t,next:null},Qr===null){if(ds===null)throw Error(W(308));Qr=e,ds.dependencies={lanes:0,firstContext:e}}else Qr=Qr.next=e;return t}var hr=null;function bf(e){hr===null?hr=[e]:hr.push(e)}function Yy(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,bf(t)):(n.next=i.next,i.next=n),t.interleaved=n,_n(e,r)}function _n(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Dn=!1;function Cf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xy(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,we&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,_n(e,n)}return i=r.interleaved,i===null?(t.next=t,bf(r)):(t.next=i.next,i.next=t),r.interleaved=t,_n(e,n)}function zl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ff(e,n)}}function Ah(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=l:o=o.next=l,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function hs(e,t,n,r){var i=e.updateQueue;Dn=!1;var o=i.firstBaseUpdate,l=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var a=s,u=a.next;a.next=null,l===null?o=u:l.next=u,l=a;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==l&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=a))}if(o!==null){var f=i.baseState;l=0,c=u=a=null,s=o;do{var d=s.lane,h=s.eventTime;if((r&d)===d){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,x=s;switch(d=t,h=n,x.tag){case 1:if(p=x.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=x.payload,d=typeof p=="function"?p.call(h,f,d):p,d==null)break e;f=ze({},f,d);break e;case 2:Dn=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,d=i.effects,d===null?i.effects=[s]:d.push(s))}else h={eventTime:h,lane:d,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,a=f):c=c.next=h,l|=d;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;d=s,s=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(c===null&&(a=f),i.baseState=a,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do l|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);_r|=l,e.lanes=l,e.memoizedState=f}}function zh(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(W(191,i));i.call(r)}}}var Bo={},an=er(Bo),wo=er(Bo),vo=er(Bo);function pr(e){if(e===Bo)throw Error(W(174));return e}function Nf(e,t){switch(Ne(vo,t),Ne(wo,e),Ne(an,Bo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:$u(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=$u(t,e)}Pe(an),Ne(an,t)}function di(){Pe(an),Pe(wo),Pe(vo)}function Gy(e){pr(vo.current);var t=pr(an.current),n=$u(t,e.type);t!==n&&(Ne(wo,e),Ne(an,n))}function If(e){wo.current===e&&(Pe(an),Pe(wo))}var Le=er(0);function ps(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ba=[];function Pf(){for(var e=0;e<Ba.length;e++)Ba[e]._workInProgressVersionPrimary=null;Ba.length=0}var Ol=In.ReactCurrentDispatcher,Ha=In.ReactCurrentBatchConfig,Sr=0,Ae=null,Ve=null,We=null,ms=!1,Zi=!1,ko=0,vS=0;function Ze(){throw Error(W(321))}function Mf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qt(e[n],t[n]))return!1;return!0}function Tf(e,t,n,r,i,o){if(Sr=o,Ae=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ol.current=e===null||e.memoizedState===null?_S:bS,e=n(r,i),Zi){o=0;do{if(Zi=!1,ko=0,25<=o)throw Error(W(301));o+=1,We=Ve=null,t.updateQueue=null,Ol.current=CS,e=n(r,i)}while(Zi)}if(Ol.current=gs,t=Ve!==null&&Ve.next!==null,Sr=0,We=Ve=Ae=null,ms=!1,t)throw Error(W(300));return e}function Lf(){var e=ko!==0;return ko=0,e}function nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return We===null?Ae.memoizedState=We=e:We=We.next=e,We}function Ot(){if(Ve===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ve.next;var t=We===null?Ae.memoizedState:We.next;if(t!==null)We=t,Ve=e;else{if(e===null)throw Error(W(310));Ve=e,e={memoizedState:Ve.memoizedState,baseState:Ve.baseState,baseQueue:Ve.baseQueue,queue:Ve.queue,next:null},We===null?Ae.memoizedState=We=e:We=We.next=e}return We}function Eo(e,t){return typeof t=="function"?t(e):t}function Va(e){var t=Ot(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=Ve,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var l=i.next;i.next=o.next,o.next=l}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=l=null,a=null,u=o;do{var c=u.lane;if((Sr&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(s=a=f,l=r):a=a.next=f,Ae.lanes|=c,_r|=c}u=u.next}while(u!==null&&u!==o);a===null?l=r:a.next=s,qt(r,t.memoizedState)||(dt=!0),t.memoizedState=r,t.baseState=l,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,Ae.lanes|=o,_r|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ua(e){var t=Ot(),n=t.queue;if(n===null)throw Error(W(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var l=i=i.next;do o=e(o,l.action),l=l.next;while(l!==i);qt(o,t.memoizedState)||(dt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Qy(){}function qy(e,t){var n=Ae,r=Ot(),i=t(),o=!qt(r.memoizedState,i);if(o&&(r.memoizedState=i,dt=!0),r=r.queue,Af(Jy.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||We!==null&&We.memoizedState.tag&1){if(n.flags|=2048,So(9,Zy.bind(null,n,r,i,t),void 0,null),Ye===null)throw Error(W(349));Sr&30||Ky(n,t,i)}return i}function Ky(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ae.updateQueue,t===null?(t={lastEffect:null,stores:null},Ae.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Zy(e,t,n,r){t.value=n,t.getSnapshot=r,e0(t)&&t0(e)}function Jy(e,t,n){return n(function(){e0(t)&&t0(e)})}function e0(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qt(e,n)}catch{return!0}}function t0(e){var t=_n(e,1);t!==null&&Gt(t,e,1,-1)}function Oh(e){var t=nn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:e},t.queue=e,e=e.dispatch=SS.bind(null,Ae,e),[t.memoizedState,e]}function So(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ae.updateQueue,t===null?(t={lastEffect:null,stores:null},Ae.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function n0(){return Ot().memoizedState}function Dl(e,t,n,r){var i=nn();Ae.flags|=e,i.memoizedState=So(1|t,n,void 0,r===void 0?null:r)}function Ys(e,t,n,r){var i=Ot();r=r===void 0?null:r;var o=void 0;if(Ve!==null){var l=Ve.memoizedState;if(o=l.destroy,r!==null&&Mf(r,l.deps)){i.memoizedState=So(t,n,o,r);return}}Ae.flags|=e,i.memoizedState=So(1|t,n,o,r)}function Dh(e,t){return Dl(8390656,8,e,t)}function Af(e,t){return Ys(2048,8,e,t)}function r0(e,t){return Ys(4,2,e,t)}function i0(e,t){return Ys(4,4,e,t)}function o0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function l0(e,t,n){return n=n!=null?n.concat([e]):null,Ys(4,4,o0.bind(null,t,e),n)}function zf(){}function s0(e,t){var n=Ot();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function a0(e,t){var n=Ot();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Mf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function u0(e,t,n){return Sr&21?(qt(n,t)||(n=py(),Ae.lanes|=n,_r|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,dt=!0),e.memoizedState=n)}function kS(e,t){var n=Se;Se=n!==0&&4>n?n:4,e(!0);var r=Ha.transition;Ha.transition={};try{e(!1),t()}finally{Se=n,Ha.transition=r}}function c0(){return Ot().memoizedState}function ES(e,t,n){var r=Gn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},f0(e))d0(t,n);else if(n=Yy(e,t,n,r),n!==null){var i=st();Gt(n,e,r,i),h0(n,t,r)}}function SS(e,t,n){var r=Gn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(f0(e))d0(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var l=t.lastRenderedState,s=o(l,n);if(i.hasEagerState=!0,i.eagerState=s,qt(s,l)){var a=t.interleaved;a===null?(i.next=i,bf(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=Yy(e,t,i,r),n!==null&&(i=st(),Gt(n,e,r,i),h0(n,t,r))}}function f0(e){var t=e.alternate;return e===Ae||t!==null&&t===Ae}function d0(e,t){Zi=ms=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function h0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ff(e,n)}}var gs={readContext:zt,useCallback:Ze,useContext:Ze,useEffect:Ze,useImperativeHandle:Ze,useInsertionEffect:Ze,useLayoutEffect:Ze,useMemo:Ze,useReducer:Ze,useRef:Ze,useState:Ze,useDebugValue:Ze,useDeferredValue:Ze,useTransition:Ze,useMutableSource:Ze,useSyncExternalStore:Ze,useId:Ze,unstable_isNewReconciler:!1},_S={readContext:zt,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:Dh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dl(4194308,4,o0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dl(4,2,e,t)},useMemo:function(e,t){var n=nn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=nn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ES.bind(null,Ae,e),[r.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:Oh,useDebugValue:zf,useDeferredValue:function(e){return nn().memoizedState=e},useTransition:function(){var e=Oh(!1),t=e[0];return e=kS.bind(null,e[1]),nn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ae,i=nn();if(Te){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),Ye===null)throw Error(W(349));Sr&30||Ky(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Dh(Jy.bind(null,r,o,e),[e]),r.flags|=2048,So(9,Zy.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=nn(),t=Ye.identifierPrefix;if(Te){var n=wn,r=xn;n=(r&~(1<<32-Xt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ko++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=vS++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},bS={readContext:zt,useCallback:s0,useContext:zt,useEffect:Af,useImperativeHandle:l0,useInsertionEffect:r0,useLayoutEffect:i0,useMemo:a0,useReducer:Va,useRef:n0,useState:function(){return Va(Eo)},useDebugValue:zf,useDeferredValue:function(e){var t=Ot();return u0(t,Ve.memoizedState,e)},useTransition:function(){var e=Va(Eo)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:Qy,useSyncExternalStore:qy,useId:c0,unstable_isNewReconciler:!1},CS={readContext:zt,useCallback:s0,useContext:zt,useEffect:Af,useImperativeHandle:l0,useInsertionEffect:r0,useLayoutEffect:i0,useMemo:a0,useReducer:Ua,useRef:n0,useState:function(){return Ua(Eo)},useDebugValue:zf,useDeferredValue:function(e){var t=Ot();return Ve===null?t.memoizedState=e:u0(t,Ve.memoizedState,e)},useTransition:function(){var e=Ua(Eo)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:Qy,useSyncExternalStore:qy,useId:c0,unstable_isNewReconciler:!1};function Ft(e,t){if(e&&e.defaultProps){t=ze({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function lc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ze({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Xs={isMounted:function(e){return(e=e._reactInternals)?zr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=st(),i=Gn(e),o=kn(r,i);o.payload=t,n!=null&&(o.callback=n),t=Yn(e,o,i),t!==null&&(Gt(t,e,i,r),zl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=st(),i=Gn(e),o=kn(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Yn(e,o,i),t!==null&&(Gt(t,e,i,r),zl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=st(),r=Gn(e),i=kn(n,r);i.tag=2,t!=null&&(i.callback=t),t=Yn(e,i,r),t!==null&&(Gt(t,e,r,n),zl(t,e,r))}};function Rh(e,t,n,r,i,o,l){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,l):t.prototype&&t.prototype.isPureReactComponent?!mo(n,r)||!mo(i,o):!0}function p0(e,t,n){var r=!1,i=Zn,o=t.contextType;return typeof o=="object"&&o!==null?o=zt(o):(i=mt(t)?kr:nt.current,r=t.contextTypes,o=(r=r!=null)?ui(e,i):Zn),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Xs,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function jh(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Xs.enqueueReplaceState(t,t.state,null)}function sc(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Cf(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=zt(o):(o=mt(t)?kr:nt.current,i.context=ui(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(lc(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Xs.enqueueReplaceState(i,i.state,null),hs(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function hi(e,t){try{var n="",r=t;do n+=eE(r),r=r.return;while(r);var i=n}catch(o){i=`
39
- Error generating stack: `+o.message+`
40
- `+o.stack}return{value:e,source:t,stack:i,digest:null}}function Wa(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ac(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var NS=typeof WeakMap=="function"?WeakMap:Map;function m0(e,t,n){n=kn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){xs||(xs=!0,xc=r),ac(e,t)},n}function g0(e,t,n){n=kn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ac(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){ac(e,t),typeof r!="function"&&(Xn===null?Xn=new Set([this]):Xn.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function $h(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new NS;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=BS.bind(null,e,t,n),t.then(e,e))}function Fh(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Bh(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=kn(-1,1),t.tag=2,Yn(n,t,1))),n.lanes|=1),e)}var IS=In.ReactCurrentOwner,dt=!1;function ot(e,t,n,r){t.child=e===null?Wy(t,null,n,r):fi(t,e.child,n,r)}function Hh(e,t,n,r,i){n=n.render;var o=t.ref;return ii(t,i),r=Tf(e,t,n,r,o,i),n=Lf(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,bn(e,t,i)):(Te&&n&&wf(t),t.flags|=1,ot(e,t,r,i),t.child)}function Vh(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!Hf(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,y0(e,t,o,r,i)):(e=Fl(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var l=o.memoizedProps;if(n=n.compare,n=n!==null?n:mo,n(l,r)&&e.ref===t.ref)return bn(e,t,i)}return t.flags|=1,e=Qn(o,r),e.ref=t.ref,e.return=t,t.child=e}function y0(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(mo(o,r)&&e.ref===t.ref)if(dt=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(dt=!0);else return t.lanes=e.lanes,bn(e,t,i)}return uc(e,t,n,r,i)}function x0(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(Kr,vt),vt|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(Kr,vt),vt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,Ne(Kr,vt),vt|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ne(Kr,vt),vt|=r;return ot(e,t,i,n),t.child}function w0(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function uc(e,t,n,r,i){var o=mt(n)?kr:nt.current;return o=ui(t,o),ii(t,i),n=Tf(e,t,n,r,o,i),r=Lf(),e!==null&&!dt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,bn(e,t,i)):(Te&&r&&wf(t),t.flags|=1,ot(e,t,n,i),t.child)}function Uh(e,t,n,r,i){if(mt(n)){var o=!0;as(t)}else o=!1;if(ii(t,i),t.stateNode===null)Rl(e,t),p0(t,n,r),sc(t,n,r,i),r=!0;else if(e===null){var l=t.stateNode,s=t.memoizedProps;l.props=s;var a=l.context,u=n.contextType;typeof u=="object"&&u!==null?u=zt(u):(u=mt(n)?kr:nt.current,u=ui(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof l.getSnapshotBeforeUpdate=="function";f||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==r||a!==u)&&jh(t,l,r,u),Dn=!1;var d=t.memoizedState;l.state=d,hs(t,r,l,i),a=t.memoizedState,s!==r||d!==a||pt.current||Dn?(typeof c=="function"&&(lc(t,n,c,r),a=t.memoizedState),(s=Dn||Rh(t,n,s,r,d,a,u))?(f||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),l.props=r,l.state=a,l.context=u,r=s):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{l=t.stateNode,Xy(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ft(t.type,s),l.props=u,f=t.pendingProps,d=l.context,a=n.contextType,typeof a=="object"&&a!==null?a=zt(a):(a=mt(n)?kr:nt.current,a=ui(t,a));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(s!==f||d!==a)&&jh(t,l,r,a),Dn=!1,d=t.memoizedState,l.state=d,hs(t,r,l,i);var p=t.memoizedState;s!==f||d!==p||pt.current||Dn?(typeof h=="function"&&(lc(t,n,h,r),p=t.memoizedState),(u=Dn||Rh(t,n,u,r,d,p,a)||!1)?(c||typeof l.UNSAFE_componentWillUpdate!="function"&&typeof l.componentWillUpdate!="function"||(typeof l.componentWillUpdate=="function"&&l.componentWillUpdate(r,p,a),typeof l.UNSAFE_componentWillUpdate=="function"&&l.UNSAFE_componentWillUpdate(r,p,a)),typeof l.componentDidUpdate=="function"&&(t.flags|=4),typeof l.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),l.props=r,l.state=p,l.context=a,r=u):(typeof l.componentDidUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof l.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return cc(e,t,n,r,o,i)}function cc(e,t,n,r,i,o){w0(e,t);var l=(t.flags&128)!==0;if(!r&&!l)return i&&Ph(t,n,!1),bn(e,t,o);r=t.stateNode,IS.current=t;var s=l&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&l?(t.child=fi(t,e.child,null,o),t.child=fi(t,null,s,o)):ot(e,t,s,o),t.memoizedState=r.state,i&&Ph(t,n,!0),t.child}function v0(e){var t=e.stateNode;t.pendingContext?Ih(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ih(e,t.context,!1),Nf(e,t.containerInfo)}function Wh(e,t,n,r,i){return ci(),kf(i),t.flags|=256,ot(e,t,n,r),t.child}var fc={dehydrated:null,treeContext:null,retryLane:0};function dc(e){return{baseLanes:e,cachePool:null,transitions:null}}function k0(e,t,n){var r=t.pendingProps,i=Le.current,o=!1,l=(t.flags&128)!==0,s;if((s=l)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ne(Le,i&1),e===null)return ic(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=r.children,e=r.fallback,o?(r=t.mode,o=t.child,l={mode:"hidden",children:l},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=l):o=qs(l,r,0,null),e=yr(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=dc(n),t.memoizedState=fc,e):Of(t,l));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return PS(e,t,l,r,s,i,n);if(o){o=r.fallback,l=t.mode,i=e.child,s=i.sibling;var a={mode:"hidden",children:r.children};return!(l&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Qn(i,a),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=Qn(s,o):(o=yr(o,l,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,l=e.child.memoizedState,l=l===null?dc(n):{baseLanes:l.baseLanes|n,cachePool:null,transitions:l.transitions},o.memoizedState=l,o.childLanes=e.childLanes&~n,t.memoizedState=fc,r}return o=e.child,e=o.sibling,r=Qn(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Of(e,t){return t=qs({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fl(e,t,n,r){return r!==null&&kf(r),fi(t,e.child,null,n),e=Of(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function PS(e,t,n,r,i,o,l){if(n)return t.flags&256?(t.flags&=-257,r=Wa(Error(W(422))),fl(e,t,l,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=qs({mode:"visible",children:r.children},i,0,null),o=yr(o,i,l,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&fi(t,e.child,null,l),t.child.memoizedState=dc(l),t.memoizedState=fc,o);if(!(t.mode&1))return fl(e,t,l,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(W(419)),r=Wa(o,r,void 0),fl(e,t,l,r)}if(s=(l&e.childLanes)!==0,dt||s){if(r=Ye,r!==null){switch(l&-l){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|l)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,_n(e,i),Gt(r,e,i,-1))}return Bf(),r=Wa(Error(W(421))),fl(e,t,l,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=HS.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Et=Wn(i.nextSibling),St=t,Te=!0,Vt=null,e!==null&&(Pt[Mt++]=xn,Pt[Mt++]=wn,Pt[Mt++]=Er,xn=e.id,wn=e.overflow,Er=t),t=Of(t,r.children),t.flags|=4096,t)}function Yh(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),oc(e.return,t,n)}function Ya(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function E0(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(ot(e,t,r.children,n),r=Le.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Yh(e,n,t);else if(e.tag===19)Yh(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Ne(Le,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ps(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ya(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ps(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ya(t,!0,n,null,o);break;case"together":Ya(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Rl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function bn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),_r|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,n=Qn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function MS(e,t,n){switch(t.tag){case 3:v0(t),ci();break;case 5:Gy(t);break;case 1:mt(t.type)&&as(t);break;case 4:Nf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Ne(fs,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ne(Le,Le.current&1),t.flags|=128,null):n&t.child.childLanes?k0(e,t,n):(Ne(Le,Le.current&1),e=bn(e,t,n),e!==null?e.sibling:null);Ne(Le,Le.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return E0(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ne(Le,Le.current),r)break;return null;case 22:case 23:return t.lanes=0,x0(e,t,n)}return bn(e,t,n)}var S0,hc,_0,b0;S0=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};hc=function(){};_0=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,pr(an.current);var o=null;switch(n){case"input":i=Ou(e,i),r=Ou(e,r),o=[];break;case"select":i=ze({},i,{value:void 0}),r=ze({},r,{value:void 0}),o=[];break;case"textarea":i=ju(e,i),r=ju(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=ls)}Fu(n,r);var l;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(l in s)s.hasOwnProperty(l)&&(n||(n={}),n[l]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(so.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var a=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&a!==s&&(a!=null||s!=null))if(u==="style")if(s){for(l in s)!s.hasOwnProperty(l)||a&&a.hasOwnProperty(l)||(n||(n={}),n[l]="");for(l in a)a.hasOwnProperty(l)&&s[l]!==a[l]&&(n||(n={}),n[l]=a[l])}else n||(o||(o=[]),o.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,s=s?s.__html:void 0,a!=null&&s!==a&&(o=o||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(o=o||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(so.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&Ie("scroll",e),o||s===a||(o=[])):(o=o||[]).push(u,a))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};b0=function(e,t,n,r){n!==r&&(t.flags|=4)};function zi(e,t){if(!Te)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function TS(e,t,n){var r=t.pendingProps;switch(vf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return mt(t.type)&&ss(),Je(t),null;case 3:return r=t.stateNode,di(),Pe(pt),Pe(nt),Pf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ul(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vt!==null&&(kc(Vt),Vt=null))),hc(e,t),Je(t),null;case 5:If(t);var i=pr(vo.current);if(n=t.type,e!==null&&t.stateNode!=null)_0(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(W(166));return Je(t),null}if(e=pr(an.current),ul(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[ln]=t,r[xo]=o,e=(t.mode&1)!==0,n){case"dialog":Ie("cancel",r),Ie("close",r);break;case"iframe":case"object":case"embed":Ie("load",r);break;case"video":case"audio":for(i=0;i<Vi.length;i++)Ie(Vi[i],r);break;case"source":Ie("error",r);break;case"img":case"image":case"link":Ie("error",r),Ie("load",r);break;case"details":Ie("toggle",r);break;case"input":th(r,o),Ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Ie("invalid",r);break;case"textarea":rh(r,o),Ie("invalid",r)}Fu(n,o),i=null;for(var l in o)if(o.hasOwnProperty(l)){var s=o[l];l==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&al(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&al(r.textContent,s,e),i=["children",""+s]):so.hasOwnProperty(l)&&s!=null&&l==="onScroll"&&Ie("scroll",r)}switch(n){case"input":el(r),nh(r,o,!0);break;case"textarea":el(r),ih(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=ls)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{l=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Jg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=l.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[ln]=t,e[xo]=r,S0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Bu(n,r),n){case"dialog":Ie("cancel",e),Ie("close",e),i=r;break;case"iframe":case"object":case"embed":Ie("load",e),i=r;break;case"video":case"audio":for(i=0;i<Vi.length;i++)Ie(Vi[i],e);i=r;break;case"source":Ie("error",e),i=r;break;case"img":case"image":case"link":Ie("error",e),Ie("load",e),i=r;break;case"details":Ie("toggle",e),i=r;break;case"input":th(e,r),i=Ou(e,r),Ie("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=ze({},r,{value:void 0}),Ie("invalid",e);break;case"textarea":rh(e,r),i=ju(e,r),Ie("invalid",e);break;default:i=r}Fu(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="style"?ny(e,a):o==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&ey(e,a)):o==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&ao(e,a):typeof a=="number"&&ao(e,""+a):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(so.hasOwnProperty(o)?a!=null&&o==="onScroll"&&Ie("scroll",e):a!=null&&of(e,o,a,l))}switch(n){case"input":el(e),nh(e,r,!1);break;case"textarea":el(e),ih(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kn(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?ei(e,!!r.multiple,o,!1):r.defaultValue!=null&&ei(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=ls)}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&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Je(t),null;case 6:if(e&&t.stateNode!=null)b0(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(W(166));if(n=pr(vo.current),pr(an.current),ul(t)){if(r=t.stateNode,n=t.memoizedProps,r[ln]=t,(o=r.nodeValue!==n)&&(e=St,e!==null))switch(e.tag){case 3:al(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&al(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ln]=t,t.stateNode=r}return Je(t),null;case 13:if(Pe(Le),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Te&&Et!==null&&t.mode&1&&!(t.flags&128))Vy(),ci(),t.flags|=98560,o=!1;else if(o=ul(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(W(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(W(317));o[ln]=t}else ci(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Je(t),o=!1}else Vt!==null&&(kc(Vt),Vt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Le.current&1?Ue===0&&(Ue=3):Bf())),t.updateQueue!==null&&(t.flags|=4),Je(t),null);case 4:return di(),hc(e,t),e===null&&go(t.stateNode.containerInfo),Je(t),null;case 10:return _f(t.type._context),Je(t),null;case 17:return mt(t.type)&&ss(),Je(t),null;case 19:if(Pe(Le),o=t.memoizedState,o===null)return Je(t),null;if(r=(t.flags&128)!==0,l=o.rendering,l===null)if(r)zi(o,!1);else{if(Ue!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(l=ps(e),l!==null){for(t.flags|=128,zi(o,!1),r=l.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,l=o.alternate,l===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=l.childLanes,o.lanes=l.lanes,o.child=l.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=l.memoizedProps,o.memoizedState=l.memoizedState,o.updateQueue=l.updateQueue,o.type=l.type,e=l.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ne(Le,Le.current&1|2),t.child}e=e.sibling}o.tail!==null&&Re()>pi&&(t.flags|=128,r=!0,zi(o,!1),t.lanes=4194304)}else{if(!r)if(e=ps(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!l.alternate&&!Te)return Je(t),null}else 2*Re()-o.renderingStartTime>pi&&n!==1073741824&&(t.flags|=128,r=!0,zi(o,!1),t.lanes=4194304);o.isBackwards?(l.sibling=t.child,t.child=l):(n=o.last,n!==null?n.sibling=l:t.child=l,o.last=l)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Re(),t.sibling=null,n=Le.current,Ne(Le,r?n&1|2:n&1),t):(Je(t),null);case 22:case 23:return Ff(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?vt&1073741824&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function LS(e,t){switch(vf(t),t.tag){case 1:return mt(t.type)&&ss(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return di(),Pe(pt),Pe(nt),Pf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return If(t),null;case 13:if(Pe(Le),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));ci()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pe(Le),null;case 4:return di(),null;case 10:return _f(t.type._context),null;case 22:case 23:return Ff(),null;case 24:return null;default:return null}}var dl=!1,et=!1,AS=typeof WeakSet=="function"?WeakSet:Set,J=null;function qr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){De(e,t,r)}else n.current=null}function pc(e,t,n){try{n()}catch(r){De(e,t,r)}}var Xh=!1;function zS(e,t){if(Ku=rs,e=My(),xf(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var l=0,s=-1,a=-1,u=0,c=0,f=e,d=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(s=l+i),f!==o||r!==0&&f.nodeType!==3||(a=l+r),f.nodeType===3&&(l+=f.nodeValue.length),(h=f.firstChild)!==null;)d=f,f=h;for(;;){if(f===e)break t;if(d===n&&++u===i&&(s=l),d===o&&++c===r&&(a=l),(h=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=h}n=s===-1||a===-1?null:{start:s,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zu={focusedElem:e,selectionRange:n},rs=!1,J=t;J!==null;)if(t=J,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,J=e;else for(;J!==null;){t=J;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var x=p.memoizedProps,w=p.memoizedState,m=t.stateNode,y=m.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ft(t.type,x),w);m.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(v){De(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,J=e;break}J=t.return}return p=Xh,Xh=!1,p}function Ji(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&pc(t,n,o)}i=i.next}while(i!==r)}}function Gs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function mc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function C0(e){var t=e.alternate;t!==null&&(e.alternate=null,C0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ln],delete t[xo],delete t[tc],delete t[gS],delete t[yS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function N0(e){return e.tag===5||e.tag===3||e.tag===4}function Gh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||N0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=ls));else if(r!==4&&(e=e.child,e!==null))for(gc(e,t,n),e=e.sibling;e!==null;)gc(e,t,n),e=e.sibling}function yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(yc(e,t,n),e=e.sibling;e!==null;)yc(e,t,n),e=e.sibling}var Ge=null,Bt=!1;function Tn(e,t,n){for(n=n.child;n!==null;)I0(e,t,n),n=n.sibling}function I0(e,t,n){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(Fs,n)}catch{}switch(n.tag){case 5:et||qr(n,t);case 6:var r=Ge,i=Bt;Ge=null,Tn(e,t,n),Ge=r,Bt=i,Ge!==null&&(Bt?(e=Ge,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ge.removeChild(n.stateNode));break;case 18:Ge!==null&&(Bt?(e=Ge,n=n.stateNode,e.nodeType===8?$a(e.parentNode,n):e.nodeType===1&&$a(e,n),ho(e)):$a(Ge,n.stateNode));break;case 4:r=Ge,i=Bt,Ge=n.stateNode.containerInfo,Bt=!0,Tn(e,t,n),Ge=r,Bt=i;break;case 0:case 11:case 14:case 15:if(!et&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,l=o.destroy;o=o.tag,l!==void 0&&(o&2||o&4)&&pc(n,t,l),i=i.next}while(i!==r)}Tn(e,t,n);break;case 1:if(!et&&(qr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){De(n,t,s)}Tn(e,t,n);break;case 21:Tn(e,t,n);break;case 22:n.mode&1?(et=(r=et)||n.memoizedState!==null,Tn(e,t,n),et=r):Tn(e,t,n);break;default:Tn(e,t,n)}}function Qh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new AS),t.forEach(function(r){var i=VS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function $t(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,l=t,s=l;e:for(;s!==null;){switch(s.tag){case 5:Ge=s.stateNode,Bt=!1;break e;case 3:Ge=s.stateNode.containerInfo,Bt=!0;break e;case 4:Ge=s.stateNode.containerInfo,Bt=!0;break e}s=s.return}if(Ge===null)throw Error(W(160));I0(o,l,i),Ge=null,Bt=!1;var a=i.alternate;a!==null&&(a.return=null),i.return=null}catch(u){De(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)P0(t,e),t=t.sibling}function P0(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if($t(t,e),tn(e),r&4){try{Ji(3,e,e.return),Gs(3,e)}catch(x){De(e,e.return,x)}try{Ji(5,e,e.return)}catch(x){De(e,e.return,x)}}break;case 1:$t(t,e),tn(e),r&512&&n!==null&&qr(n,n.return);break;case 5:if($t(t,e),tn(e),r&512&&n!==null&&qr(n,n.return),e.flags&32){var i=e.stateNode;try{ao(i,"")}catch(x){De(e,e.return,x)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,l=n!==null?n.memoizedProps:o,s=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&Kg(i,o),Bu(s,l);var u=Bu(s,o);for(l=0;l<a.length;l+=2){var c=a[l],f=a[l+1];c==="style"?ny(i,f):c==="dangerouslySetInnerHTML"?ey(i,f):c==="children"?ao(i,f):of(i,c,f,u)}switch(s){case"input":Du(i,o);break;case"textarea":Zg(i,o);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?ei(i,!!o.multiple,h,!1):d!==!!o.multiple&&(o.defaultValue!=null?ei(i,!!o.multiple,o.defaultValue,!0):ei(i,!!o.multiple,o.multiple?[]:"",!1))}i[xo]=o}catch(x){De(e,e.return,x)}}break;case 6:if($t(t,e),tn(e),r&4){if(e.stateNode===null)throw Error(W(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(x){De(e,e.return,x)}}break;case 3:if($t(t,e),tn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ho(t.containerInfo)}catch(x){De(e,e.return,x)}break;case 4:$t(t,e),tn(e);break;case 13:$t(t,e),tn(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(jf=Re())),r&4&&Qh(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(et=(u=et)||c,$t(t,e),et=u):$t(t,e),tn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(J=e,c=e.child;c!==null;){for(f=J=c;J!==null;){switch(d=J,h=d.child,d.tag){case 0:case 11:case 14:case 15:Ji(4,d,d.return);break;case 1:qr(d,d.return);var p=d.stateNode;if(typeof p.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(x){De(r,n,x)}}break;case 5:qr(d,d.return);break;case 22:if(d.memoizedState!==null){Kh(f);continue}}h!==null?(h.return=d,J=h):Kh(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{i=f.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=f.stateNode,a=f.memoizedProps.style,l=a!=null&&a.hasOwnProperty("display")?a.display:null,s.style.display=ty("display",l))}catch(x){De(e,e.return,x)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(x){De(e,e.return,x)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:$t(t,e),tn(e),r&4&&Qh(e);break;case 21:break;default:$t(t,e),tn(e)}}function tn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(N0(n)){var r=n;break e}n=n.return}throw Error(W(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ao(i,""),r.flags&=-33);var o=Gh(e);yc(e,o,i);break;case 3:case 4:var l=r.stateNode.containerInfo,s=Gh(e);gc(e,s,l);break;default:throw Error(W(161))}}catch(a){De(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function OS(e,t,n){J=e,M0(e)}function M0(e,t,n){for(var r=(e.mode&1)!==0;J!==null;){var i=J,o=i.child;if(i.tag===22&&r){var l=i.memoizedState!==null||dl;if(!l){var s=i.alternate,a=s!==null&&s.memoizedState!==null||et;s=dl;var u=et;if(dl=l,(et=a)&&!u)for(J=i;J!==null;)l=J,a=l.child,l.tag===22&&l.memoizedState!==null?Zh(i):a!==null?(a.return=l,J=a):Zh(i);for(;o!==null;)J=o,M0(o),o=o.sibling;J=i,dl=s,et=u}qh(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,J=o):qh(e)}}function qh(e){for(;J!==null;){var t=J;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:et||Gs(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!et)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ft(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&zh(t,o,r);break;case 3:var l=t.updateQueue;if(l!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}zh(t,l,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&ho(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}et||t.flags&512&&mc(t)}catch(d){De(t,t.return,d)}}if(t===e){J=null;break}if(n=t.sibling,n!==null){n.return=t.return,J=n;break}J=t.return}}function Kh(e){for(;J!==null;){var t=J;if(t===e){J=null;break}var n=t.sibling;if(n!==null){n.return=t.return,J=n;break}J=t.return}}function Zh(e){for(;J!==null;){var t=J;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Gs(4,t)}catch(a){De(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(a){De(t,i,a)}}var o=t.return;try{mc(t)}catch(a){De(t,o,a)}break;case 5:var l=t.return;try{mc(t)}catch(a){De(t,l,a)}}}catch(a){De(t,t.return,a)}if(t===e){J=null;break}var s=t.sibling;if(s!==null){s.return=t.return,J=s;break}J=t.return}}var DS=Math.ceil,ys=In.ReactCurrentDispatcher,Df=In.ReactCurrentOwner,At=In.ReactCurrentBatchConfig,we=0,Ye=null,Fe=null,Qe=0,vt=0,Kr=er(0),Ue=0,_o=null,_r=0,Qs=0,Rf=0,eo=null,ft=null,jf=0,pi=1/0,mn=null,xs=!1,xc=null,Xn=null,hl=!1,Bn=null,ws=0,to=0,wc=null,jl=-1,$l=0;function st(){return we&6?Re():jl!==-1?jl:jl=Re()}function Gn(e){return e.mode&1?we&2&&Qe!==0?Qe&-Qe:wS.transition!==null?($l===0&&($l=py()),$l):(e=Se,e!==0||(e=window.event,e=e===void 0?16:ky(e.type)),e):1}function Gt(e,t,n,r){if(50<to)throw to=0,wc=null,Error(W(185));jo(e,n,r),(!(we&2)||e!==Ye)&&(e===Ye&&(!(we&2)&&(Qs|=n),Ue===4&&jn(e,Qe)),gt(e,r),n===1&&we===0&&!(t.mode&1)&&(pi=Re()+500,Ws&&tr()))}function gt(e,t){var n=e.callbackNode;wE(e,t);var r=ns(e,e===Ye?Qe:0);if(r===0)n!==null&&sh(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&sh(n),t===1)e.tag===0?xS(Jh.bind(null,e)):Fy(Jh.bind(null,e)),pS(function(){!(we&6)&&tr()}),n=null;else{switch(my(r)){case 1:n=cf;break;case 4:n=dy;break;case 16:n=ts;break;case 536870912:n=hy;break;default:n=ts}n=j0(n,T0.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function T0(e,t){if(jl=-1,$l=0,we&6)throw Error(W(327));var n=e.callbackNode;if(oi()&&e.callbackNode!==n)return null;var r=ns(e,e===Ye?Qe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=vs(e,r);else{t=r;var i=we;we|=2;var o=A0();(Ye!==e||Qe!==t)&&(mn=null,pi=Re()+500,gr(e,t));do try{$S();break}catch(s){L0(e,s)}while(!0);Sf(),ys.current=o,we=i,Fe!==null?t=0:(Ye=null,Qe=0,t=Ue)}if(t!==0){if(t===2&&(i=Yu(e),i!==0&&(r=i,t=vc(e,i))),t===1)throw n=_o,gr(e,0),jn(e,r),gt(e,Re()),n;if(t===6)jn(e,r);else{if(i=e.current.alternate,!(r&30)&&!RS(i)&&(t=vs(e,r),t===2&&(o=Yu(e),o!==0&&(r=o,t=vc(e,o))),t===1))throw n=_o,gr(e,0),jn(e,r),gt(e,Re()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(W(345));case 2:ar(e,ft,mn);break;case 3:if(jn(e,r),(r&130023424)===r&&(t=jf+500-Re(),10<t)){if(ns(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){st(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ec(ar.bind(null,e,ft,mn),t);break}ar(e,ft,mn);break;case 4:if(jn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var l=31-Xt(r);o=1<<l,l=t[l],l>i&&(i=l),r&=~o}if(r=i,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*DS(r/1960))-r,10<r){e.timeoutHandle=ec(ar.bind(null,e,ft,mn),r);break}ar(e,ft,mn);break;case 5:ar(e,ft,mn);break;default:throw Error(W(329))}}}return gt(e,Re()),e.callbackNode===n?T0.bind(null,e):null}function vc(e,t){var n=eo;return e.current.memoizedState.isDehydrated&&(gr(e,t).flags|=256),e=vs(e,t),e!==2&&(t=ft,ft=n,t!==null&&kc(t)),e}function kc(e){ft===null?ft=e:ft.push.apply(ft,e)}function RS(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!qt(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function jn(e,t){for(t&=~Rf,t&=~Qs,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Xt(t),r=1<<n;e[n]=-1,t&=~r}}function Jh(e){if(we&6)throw Error(W(327));oi();var t=ns(e,0);if(!(t&1))return gt(e,Re()),null;var n=vs(e,t);if(e.tag!==0&&n===2){var r=Yu(e);r!==0&&(t=r,n=vc(e,r))}if(n===1)throw n=_o,gr(e,0),jn(e,t),gt(e,Re()),n;if(n===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ar(e,ft,mn),gt(e,Re()),null}function $f(e,t){var n=we;we|=1;try{return e(t)}finally{we=n,we===0&&(pi=Re()+500,Ws&&tr())}}function br(e){Bn!==null&&Bn.tag===0&&!(we&6)&&oi();var t=we;we|=1;var n=At.transition,r=Se;try{if(At.transition=null,Se=1,e)return e()}finally{Se=r,At.transition=n,we=t,!(we&6)&&tr()}}function Ff(){vt=Kr.current,Pe(Kr)}function gr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,hS(n)),Fe!==null)for(n=Fe.return;n!==null;){var r=n;switch(vf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ss();break;case 3:di(),Pe(pt),Pe(nt),Pf();break;case 5:If(r);break;case 4:di();break;case 13:Pe(Le);break;case 19:Pe(Le);break;case 10:_f(r.type._context);break;case 22:case 23:Ff()}n=n.return}if(Ye=e,Fe=e=Qn(e.current,null),Qe=vt=t,Ue=0,_o=null,Rf=Qs=_r=0,ft=eo=null,hr!==null){for(t=0;t<hr.length;t++)if(n=hr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var l=o.next;o.next=i,r.next=l}n.pending=r}hr=null}return e}function L0(e,t){do{var n=Fe;try{if(Sf(),Ol.current=gs,ms){for(var r=Ae.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}ms=!1}if(Sr=0,We=Ve=Ae=null,Zi=!1,ko=0,Df.current=null,n===null||n.return===null){Ue=1,_o=t,Fe=null;break}e:{var o=e,l=n.return,s=n,a=t;if(t=Qe,s.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=s,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var d=c.alternate;d?(c.updateQueue=d.updateQueue,c.memoizedState=d.memoizedState,c.lanes=d.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=Fh(l);if(h!==null){h.flags&=-257,Bh(h,l,s,o,t),h.mode&1&&$h(o,u,t),t=h,a=u;var p=t.updateQueue;if(p===null){var x=new Set;x.add(a),t.updateQueue=x}else p.add(a);break e}else{if(!(t&1)){$h(o,u,t),Bf();break e}a=Error(W(426))}}else if(Te&&s.mode&1){var w=Fh(l);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Bh(w,l,s,o,t),kf(hi(a,s));break e}}o=a=hi(a,s),Ue!==4&&(Ue=2),eo===null?eo=[o]:eo.push(o),o=l;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var m=m0(o,a,t);Ah(o,m);break e;case 1:s=a;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Xn===null||!Xn.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var v=g0(o,s,t);Ah(o,v);break e}}o=o.return}while(o!==null)}O0(n)}catch(C){t=C,Fe===n&&n!==null&&(Fe=n=n.return);continue}break}while(!0)}function A0(){var e=ys.current;return ys.current=gs,e===null?gs:e}function Bf(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ye===null||!(_r&268435455)&&!(Qs&268435455)||jn(Ye,Qe)}function vs(e,t){var n=we;we|=2;var r=A0();(Ye!==e||Qe!==t)&&(mn=null,gr(e,t));do try{jS();break}catch(i){L0(e,i)}while(!0);if(Sf(),we=n,ys.current=r,Fe!==null)throw Error(W(261));return Ye=null,Qe=0,Ue}function jS(){for(;Fe!==null;)z0(Fe)}function $S(){for(;Fe!==null&&!cE();)z0(Fe)}function z0(e){var t=R0(e.alternate,e,vt);e.memoizedProps=e.pendingProps,t===null?O0(e):Fe=t,Df.current=null}function O0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=LS(n,t),n!==null){n.flags&=32767,Fe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ue=6,Fe=null;return}}else if(n=TS(n,t,vt),n!==null){Fe=n;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);Ue===0&&(Ue=5)}function ar(e,t,n){var r=Se,i=At.transition;try{At.transition=null,Se=1,FS(e,t,n,r)}finally{At.transition=i,Se=r}return null}function FS(e,t,n,r){do oi();while(Bn!==null);if(we&6)throw Error(W(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(W(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(vE(e,o),e===Ye&&(Fe=Ye=null,Qe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hl||(hl=!0,j0(ts,function(){return oi(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=At.transition,At.transition=null;var l=Se;Se=1;var s=we;we|=4,Df.current=null,zS(e,n),P0(n,e),lS(Zu),rs=!!Ku,Zu=Ku=null,e.current=n,OS(n),fE(),we=s,Se=l,At.transition=o}else e.current=n;if(hl&&(hl=!1,Bn=e,ws=i),o=e.pendingLanes,o===0&&(Xn=null),pE(n.stateNode),gt(e,Re()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(xs)throw xs=!1,e=xc,xc=null,e;return ws&1&&e.tag!==0&&oi(),o=e.pendingLanes,o&1?e===wc?to++:(to=0,wc=e):to=0,tr(),null}function oi(){if(Bn!==null){var e=my(ws),t=At.transition,n=Se;try{if(At.transition=null,Se=16>e?16:e,Bn===null)var r=!1;else{if(e=Bn,Bn=null,ws=0,we&6)throw Error(W(331));var i=we;for(we|=4,J=e.current;J!==null;){var o=J,l=o.child;if(J.flags&16){var s=o.deletions;if(s!==null){for(var a=0;a<s.length;a++){var u=s[a];for(J=u;J!==null;){var c=J;switch(c.tag){case 0:case 11:case 15:Ji(8,c,o)}var f=c.child;if(f!==null)f.return=c,J=f;else for(;J!==null;){c=J;var d=c.sibling,h=c.return;if(C0(c),c===u){J=null;break}if(d!==null){d.return=h,J=d;break}J=h}}}var p=o.alternate;if(p!==null){var x=p.child;if(x!==null){p.child=null;do{var w=x.sibling;x.sibling=null,x=w}while(x!==null)}}J=o}}if(o.subtreeFlags&2064&&l!==null)l.return=o,J=l;else e:for(;J!==null;){if(o=J,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Ji(9,o,o.return)}var m=o.sibling;if(m!==null){m.return=o.return,J=m;break e}J=o.return}}var y=e.current;for(J=y;J!==null;){l=J;var g=l.child;if(l.subtreeFlags&2064&&g!==null)g.return=l,J=g;else e:for(l=y;J!==null;){if(s=J,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:Gs(9,s)}}catch(C){De(s,s.return,C)}if(s===l){J=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,J=v;break e}J=s.return}}if(we=i,tr(),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(Fs,e)}catch{}r=!0}return r}finally{Se=n,At.transition=t}}return!1}function ep(e,t,n){t=hi(n,t),t=m0(e,t,1),e=Yn(e,t,1),t=st(),e!==null&&(jo(e,1,t),gt(e,t))}function De(e,t,n){if(e.tag===3)ep(e,e,n);else for(;t!==null;){if(t.tag===3){ep(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Xn===null||!Xn.has(r))){e=hi(n,e),e=g0(t,e,1),t=Yn(t,e,1),e=st(),t!==null&&(jo(t,1,e),gt(t,e));break}}t=t.return}}function BS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=st(),e.pingedLanes|=e.suspendedLanes&n,Ye===e&&(Qe&n)===n&&(Ue===4||Ue===3&&(Qe&130023424)===Qe&&500>Re()-jf?gr(e,0):Rf|=n),gt(e,t)}function D0(e,t){t===0&&(e.mode&1?(t=rl,rl<<=1,!(rl&130023424)&&(rl=4194304)):t=1);var n=st();e=_n(e,t),e!==null&&(jo(e,t,n),gt(e,n))}function HS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),D0(e,n)}function VS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(t),D0(e,n)}var R0;R0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||pt.current)dt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return dt=!1,MS(e,t,n);dt=!!(e.flags&131072)}else dt=!1,Te&&t.flags&1048576&&By(t,cs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Rl(e,t),e=t.pendingProps;var i=ui(t,nt.current);ii(t,n),i=Tf(null,t,r,e,i,n);var o=Lf();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,mt(r)?(o=!0,as(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Cf(t),i.updater=Xs,t.stateNode=i,i._reactInternals=t,sc(t,r,e,n),t=cc(null,t,r,!0,o,n)):(t.tag=0,Te&&o&&wf(t),ot(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Rl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=WS(r),e=Ft(r,e),i){case 0:t=uc(null,t,r,e,n);break e;case 1:t=Uh(null,t,r,e,n);break e;case 11:t=Hh(null,t,r,e,n);break e;case 14:t=Vh(null,t,r,Ft(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),uc(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Uh(e,t,r,i,n);case 3:e:{if(v0(t),e===null)throw Error(W(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Xy(e,t),hs(t,r,null,n);var l=t.memoizedState;if(r=l.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=hi(Error(W(423)),t),t=Wh(e,t,r,n,i);break e}else if(r!==i){i=hi(Error(W(424)),t),t=Wh(e,t,r,n,i);break e}else for(Et=Wn(t.stateNode.containerInfo.firstChild),St=t,Te=!0,Vt=null,n=Wy(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ci(),r===i){t=bn(e,t,n);break e}ot(e,t,r,n)}t=t.child}return t;case 5:return Gy(t),e===null&&ic(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,l=i.children,Ju(r,i)?l=null:o!==null&&Ju(r,o)&&(t.flags|=32),w0(e,t),ot(e,t,l,n),t.child;case 6:return e===null&&ic(t),null;case 13:return k0(e,t,n);case 4:return Nf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fi(t,null,r,n):ot(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Hh(e,t,r,i,n);case 7:return ot(e,t,t.pendingProps,n),t.child;case 8:return ot(e,t,t.pendingProps.children,n),t.child;case 12:return ot(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,l=i.value,Ne(fs,r._currentValue),r._currentValue=l,o!==null)if(qt(o.value,l)){if(o.children===i.children&&!pt.current){t=bn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){l=o.child;for(var a=s.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=kn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),oc(o.return,n,t),s.lanes|=n;break}a=a.next}}else if(o.tag===10)l=o.type===t.type?null:o.child;else if(o.tag===18){if(l=o.return,l===null)throw Error(W(341));l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),oc(l,n,t),l=o.sibling}else l=o.child;if(l!==null)l.return=o;else for(l=o;l!==null;){if(l===t){l=null;break}if(o=l.sibling,o!==null){o.return=l.return,l=o;break}l=l.return}o=l}ot(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ii(t,n),i=zt(i),r=r(i),t.flags|=1,ot(e,t,r,n),t.child;case 14:return r=t.type,i=Ft(r,t.pendingProps),i=Ft(r.type,i),Vh(e,t,r,i,n);case 15:return y0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Rl(e,t),t.tag=1,mt(r)?(e=!0,as(t)):e=!1,ii(t,n),p0(t,r,i),sc(t,r,i,n),cc(null,t,r,!0,e,n);case 19:return E0(e,t,n);case 22:return x0(e,t,n)}throw Error(W(156,t.tag))};function j0(e,t){return fy(e,t)}function US(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lt(e,t,n,r){return new US(e,t,n,r)}function Hf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WS(e){if(typeof e=="function")return Hf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sf)return 11;if(e===af)return 14}return 2}function Qn(e,t){var n=e.alternate;return n===null?(n=Lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Fl(e,t,n,r,i,o){var l=2;if(r=e,typeof e=="function")Hf(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Br:return yr(n.children,i,o,t);case lf:l=8,i|=8;break;case Tu:return e=Lt(12,n,t,i|2),e.elementType=Tu,e.lanes=o,e;case Lu:return e=Lt(13,n,t,i),e.elementType=Lu,e.lanes=o,e;case Au:return e=Lt(19,n,t,i),e.elementType=Au,e.lanes=o,e;case Gg:return qs(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Yg:l=10;break e;case Xg:l=9;break e;case sf:l=11;break e;case af:l=14;break e;case On:l=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=Lt(l,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function yr(e,t,n,r){return e=Lt(7,e,r,t),e.lanes=n,e}function qs(e,t,n,r){return e=Lt(22,e,r,t),e.elementType=Gg,e.lanes=n,e.stateNode={isHidden:!1},e}function Xa(e,t,n){return e=Lt(6,e,null,t),e.lanes=n,e}function Ga(e,t,n){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function YS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ia(0),this.expirationTimes=Ia(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ia(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Vf(e,t,n,r,i,o,l,s,a){return e=new YS(e,t,n,s,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Lt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Cf(o),e}function XS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function $0(e){if(!e)return Zn;e=e._reactInternals;e:{if(zr(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(mt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var n=e.type;if(mt(n))return $y(e,n,t)}return t}function F0(e,t,n,r,i,o,l,s,a){return e=Vf(n,r,!0,e,i,o,l,s,a),e.context=$0(null),n=e.current,r=st(),i=Gn(n),o=kn(r,i),o.callback=t??null,Yn(n,o,i),e.current.lanes=i,jo(e,i,r),gt(e,r),e}function Ks(e,t,n,r){var i=t.current,o=st(),l=Gn(i);return n=$0(n),t.context===null?t.context=n:t.pendingContext=n,t=kn(o,l),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Yn(i,t,l),e!==null&&(Gt(e,i,l,o),zl(e,i,l)),l}function ks(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function tp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Uf(e,t){tp(e,t),(e=e.alternate)&&tp(e,t)}function GS(){return null}var B0=typeof reportError=="function"?reportError:function(e){console.error(e)};function Wf(e){this._internalRoot=e}Zs.prototype.render=Wf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));Ks(e,t,null,null)};Zs.prototype.unmount=Wf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;br(function(){Ks(null,e,null,null)}),t[Sn]=null}};function Zs(e){this._internalRoot=e}Zs.prototype.unstable_scheduleHydration=function(e){if(e){var t=xy();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rn.length&&t!==0&&t<Rn[n].priority;n++);Rn.splice(n,0,e),n===0&&vy(e)}};function Yf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Js(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function np(){}function QS(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=ks(l);o.call(u)}}var l=F0(t,r,e,0,null,!1,!1,"",np);return e._reactRootContainer=l,e[Sn]=l.current,go(e.nodeType===8?e.parentNode:e),br(),l}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=ks(a);s.call(u)}}var a=Vf(e,0,!1,null,null,!1,!1,"",np);return e._reactRootContainer=a,e[Sn]=a.current,go(e.nodeType===8?e.parentNode:e),br(function(){Ks(t,a,n,r)}),a}function ea(e,t,n,r,i){var o=n._reactRootContainer;if(o){var l=o;if(typeof i=="function"){var s=i;i=function(){var a=ks(l);s.call(a)}}Ks(t,l,e,i)}else l=QS(n,t,e,i,r);return ks(l)}gy=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Hi(t.pendingLanes);n!==0&&(ff(t,n|1),gt(t,Re()),!(we&6)&&(pi=Re()+500,tr()))}break;case 13:br(function(){var r=_n(e,1);if(r!==null){var i=st();Gt(r,e,1,i)}}),Uf(e,1)}};df=function(e){if(e.tag===13){var t=_n(e,134217728);if(t!==null){var n=st();Gt(t,e,134217728,n)}Uf(e,134217728)}};yy=function(e){if(e.tag===13){var t=Gn(e),n=_n(e,t);if(n!==null){var r=st();Gt(n,e,t,r)}Uf(e,t)}};xy=function(){return Se};wy=function(e,t){var n=Se;try{return Se=e,t()}finally{Se=n}};Vu=function(e,t,n){switch(t){case"input":if(Du(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Us(r);if(!i)throw Error(W(90));qg(r),Du(r,i)}}}break;case"textarea":Zg(e,n);break;case"select":t=n.value,t!=null&&ei(e,!!n.multiple,t,!1)}};oy=$f;ly=br;var qS={usingClientEntryPoint:!1,Events:[Fo,Wr,Us,ry,iy,$f]},Oi={findFiberByHostInstance:dr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KS={bundleType:Oi.bundleType,version:Oi.version,rendererPackageName:Oi.rendererPackageName,rendererConfig:Oi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:In.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=uy(e),e===null?null:e.stateNode},findFiberByHostInstance:Oi.findFiberByHostInstance||GS,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 pl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pl.isDisabled&&pl.supportsFiber)try{Fs=pl.inject(KS),sn=pl}catch{}}Nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qS;Nt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yf(t))throw Error(W(200));return XS(e,t,null,n)};Nt.createRoot=function(e,t){if(!Yf(e))throw Error(W(299));var n=!1,r="",i=B0;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Vf(e,1,!1,null,null,n,!1,r,i),e[Sn]=t.current,go(e.nodeType===8?e.parentNode:e),new Wf(t)};Nt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=uy(t),e=e===null?null:e.stateNode,e};Nt.flushSync=function(e){return br(e)};Nt.hydrate=function(e,t,n){if(!Js(t))throw Error(W(200));return ea(null,e,t,!0,n)};Nt.hydrateRoot=function(e,t,n){if(!Yf(e))throw Error(W(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",l=B0;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(l=n.onRecoverableError)),t=F0(t,null,e,1,n??null,i,!1,o,l),e[Sn]=t.current,go(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new Zs(t)};Nt.render=function(e,t,n){if(!Js(t))throw Error(W(200));return ea(null,e,t,!1,n)};Nt.unmountComponentAtNode=function(e){if(!Js(e))throw Error(W(40));return e._reactRootContainer?(br(function(){ea(null,null,e,!1,function(){e._reactRootContainer=null,e[Sn]=null})}),!0):!1};Nt.unstable_batchedUpdates=$f;Nt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Js(n))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return ea(e,t,n,!1,r)};Nt.version="18.3.1-next-f1338f8080-20240426";function H0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(H0)}catch(e){console.error(e)}}H0(),Hg.exports=Nt;var ZS=Hg.exports,V0,rp=ZS;V0=rp.createRoot,rp.hydrateRoot;function He(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=He(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var JS={value:()=>{}};function ta(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Bl(n)}function Bl(e){this._=e}function e_(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Bl.prototype=ta.prototype={constructor:Bl,on:function(e,t){var n=this._,r=e_(e+"",n),i,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((i=(e=r[o]).type)&&(i=t_(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<l;)if(i=(e=r[o]).type)n[i]=ip(n[i],e.name,t);else if(t==null)for(i in n)n[i]=ip(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Bl(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function t_(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function ip(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=JS,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Ec="http://www.w3.org/1999/xhtml";const op={svg:"http://www.w3.org/2000/svg",xhtml:Ec,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function na(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),op.hasOwnProperty(t)?{space:op[t],local:e}:e}function n_(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ec&&t.documentElement.namespaceURI===Ec?t.createElement(e):t.createElementNS(n,e)}}function r_(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function U0(e){var t=na(e);return(t.local?r_:n_)(t)}function i_(){}function Xf(e){return e==null?i_:function(){return this.querySelector(e)}}function o_(e){typeof e!="function"&&(e=Xf(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],l=o.length,s=r[i]=new Array(l),a,u,c=0;c<l;++c)(a=o[c])&&(u=e.call(a,a.__data__,c,o))&&("__data__"in a&&(u.__data__=a.__data__),s[c]=u);return new Ct(r,this._parents)}function l_(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function s_(){return[]}function W0(e){return e==null?s_:function(){return this.querySelectorAll(e)}}function a_(e){return function(){return l_(e.apply(this,arguments))}}function u_(e){typeof e=="function"?e=a_(e):e=W0(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var l=t[o],s=l.length,a,u=0;u<s;++u)(a=l[u])&&(r.push(e.call(a,a.__data__,u,l)),i.push(a));return new Ct(r,i)}function Y0(e){return function(){return this.matches(e)}}function X0(e){return function(t){return t.matches(e)}}var c_=Array.prototype.find;function f_(e){return function(){return c_.call(this.children,e)}}function d_(){return this.firstElementChild}function h_(e){return this.select(e==null?d_:f_(typeof e=="function"?e:X0(e)))}var p_=Array.prototype.filter;function m_(){return Array.from(this.children)}function g_(e){return function(){return p_.call(this.children,e)}}function y_(e){return this.selectAll(e==null?m_:g_(typeof e=="function"?e:X0(e)))}function x_(e){typeof e!="function"&&(e=Y0(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],l=o.length,s=r[i]=[],a,u=0;u<l;++u)(a=o[u])&&e.call(a,a.__data__,u,o)&&s.push(a);return new Ct(r,this._parents)}function G0(e){return new Array(e.length)}function w_(){return new Ct(this._enter||this._groups.map(G0),this._parents)}function Es(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Es.prototype={constructor:Es,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function v_(e){return function(){return e}}function k_(e,t,n,r,i,o){for(var l=0,s,a=t.length,u=o.length;l<u;++l)(s=t[l])?(s.__data__=o[l],r[l]=s):n[l]=new Es(e,o[l]);for(;l<a;++l)(s=t[l])&&(i[l]=s)}function E_(e,t,n,r,i,o,l){var s,a,u=new Map,c=t.length,f=o.length,d=new Array(c),h;for(s=0;s<c;++s)(a=t[s])&&(d[s]=h=l.call(a,a.__data__,s,t)+"",u.has(h)?i[s]=a:u.set(h,a));for(s=0;s<f;++s)h=l.call(e,o[s],s,o)+"",(a=u.get(h))?(r[s]=a,a.__data__=o[s],u.delete(h)):n[s]=new Es(e,o[s]);for(s=0;s<c;++s)(a=t[s])&&u.get(d[s])===a&&(i[s]=a)}function S_(e){return e.__data__}function __(e,t){if(!arguments.length)return Array.from(this,S_);var n=t?E_:k_,r=this._parents,i=this._groups;typeof e!="function"&&(e=v_(e));for(var o=i.length,l=new Array(o),s=new Array(o),a=new Array(o),u=0;u<o;++u){var c=r[u],f=i[u],d=f.length,h=b_(e.call(c,c&&c.__data__,u,r)),p=h.length,x=s[u]=new Array(p),w=l[u]=new Array(p),m=a[u]=new Array(d);n(c,f,x,w,m,h,t);for(var y=0,g=0,v,C;y<p;++y)if(v=x[y]){for(y>=g&&(g=y+1);!(C=w[g])&&++g<p;);v._next=C||null}}return l=new Ct(l,r),l._enter=s,l._exit=a,l}function b_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function C_(){return new Ct(this._exit||this._groups.map(G0),this._parents)}function N_(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function I_(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,l=Math.min(i,o),s=new Array(i),a=0;a<l;++a)for(var u=n[a],c=r[a],f=u.length,d=s[a]=new Array(f),h,p=0;p<f;++p)(h=u[p]||c[p])&&(d[p]=h);for(;a<i;++a)s[a]=n[a];return new Ct(s,this._parents)}function P_(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],l;--i>=0;)(l=r[i])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function M_(e){e||(e=T_);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var l=n[o],s=l.length,a=i[o]=new Array(s),u,c=0;c<s;++c)(u=l[c])&&(a[c]=u);a.sort(t)}return new Ct(i,this._parents).order()}function T_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function L_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function A_(){return Array.from(this)}function z_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var l=r[i];if(l)return l}return null}function O_(){let e=0;for(const t of this)++e;return e}function D_(){return!this.node()}function R_(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,l=i.length,s;o<l;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function j_(e){return function(){this.removeAttribute(e)}}function $_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function F_(e,t){return function(){this.setAttribute(e,t)}}function B_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function H_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function V_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function U_(e,t){var n=na(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?$_:j_:typeof t=="function"?n.local?V_:H_:n.local?B_:F_)(n,t))}function Q0(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function W_(e){return function(){this.style.removeProperty(e)}}function Y_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function X_(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function G_(e,t,n){return arguments.length>1?this.each((t==null?W_:typeof t=="function"?X_:Y_)(e,t,n??"")):mi(this.node(),e)}function mi(e,t){return e.style.getPropertyValue(t)||Q0(e).getComputedStyle(e,null).getPropertyValue(t)}function Q_(e){return function(){delete this[e]}}function q_(e,t){return function(){this[e]=t}}function K_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Z_(e,t){return arguments.length>1?this.each((t==null?Q_:typeof t=="function"?K_:q_)(e,t)):this.node()[e]}function q0(e){return e.trim().split(/^|\s+/)}function Gf(e){return e.classList||new K0(e)}function K0(e){this._node=e,this._names=q0(e.getAttribute("class")||"")}K0.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Z0(e,t){for(var n=Gf(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function J0(e,t){for(var n=Gf(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function J_(e){return function(){Z0(this,e)}}function eb(e){return function(){J0(this,e)}}function tb(e,t){return function(){(t.apply(this,arguments)?Z0:J0)(this,e)}}function nb(e,t){var n=q0(e+"");if(arguments.length<2){for(var r=Gf(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?tb:t?J_:eb)(n,t))}function rb(){this.textContent=""}function ib(e){return function(){this.textContent=e}}function ob(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lb(e){return arguments.length?this.each(e==null?rb:(typeof e=="function"?ob:ib)(e)):this.node().textContent}function sb(){this.innerHTML=""}function ab(e){return function(){this.innerHTML=e}}function ub(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function cb(e){return arguments.length?this.each(e==null?sb:(typeof e=="function"?ub:ab)(e)):this.node().innerHTML}function fb(){this.nextSibling&&this.parentNode.appendChild(this)}function db(){return this.each(fb)}function hb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function pb(){return this.each(hb)}function mb(e){var t=typeof e=="function"?e:U0(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function gb(){return null}function yb(e,t){var n=typeof e=="function"?e:U0(e),r=t==null?gb:typeof t=="function"?t:Xf(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function xb(){var e=this.parentNode;e&&e.removeChild(this)}function wb(){return this.each(xb)}function vb(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kb(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Eb(e){return this.select(e?kb:vb)}function Sb(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _b(e){return function(t){e.call(this,t,this.__data__)}}function bb(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Cb(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function Nb(e,t,n){return function(){var r=this.__on,i,o=_b(t);if(r){for(var l=0,s=r.length;l<s;++l)if((i=r[l]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function Ib(e,t,n){var r=bb(e+""),i,o=r.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var a=0,u=s.length,c;a<u;++a)for(i=0,c=s[a];i<o;++i)if((l=r[i]).type===c.type&&l.name===c.name)return c.value}return}for(s=t?Nb:Cb,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function ex(e,t,n){var r=Q0(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Pb(e,t){return function(){return ex(this,e,t)}}function Mb(e,t){return function(){return ex(this,e,t.apply(this,arguments))}}function Tb(e,t){return this.each((typeof t=="function"?Mb:Pb)(e,t))}function*Lb(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,l;i<o;++i)(l=r[i])&&(yield l)}var tx=[null];function Ct(e,t){this._groups=e,this._parents=t}function Ho(){return new Ct([[document.documentElement]],tx)}function Ab(){return this}Ct.prototype=Ho.prototype={constructor:Ct,select:o_,selectAll:u_,selectChild:h_,selectChildren:y_,filter:x_,data:__,enter:w_,exit:C_,join:N_,merge:I_,selection:Ab,order:P_,sort:M_,call:L_,nodes:A_,node:z_,size:O_,empty:D_,each:R_,attr:U_,style:G_,property:Z_,classed:nb,text:lb,html:cb,raise:db,lower:pb,append:mb,insert:yb,remove:wb,clone:Eb,datum:Sb,on:Ib,dispatch:Tb,[Symbol.iterator]:Lb};function kt(e){return typeof e=="string"?new Ct([[document.querySelector(e)]],[document.documentElement]):new Ct([[e]],tx)}function zb(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ht(e,t){if(e=zb(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const Ob={passive:!1},bo={capture:!0,passive:!1};function Qa(e){e.stopImmediatePropagation()}function li(e){e.preventDefault(),e.stopImmediatePropagation()}function nx(e){var t=e.document.documentElement,n=kt(e).on("dragstart.drag",li,bo);"onselectstart"in t?n.on("selectstart.drag",li,bo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function rx(e,t){var n=e.document.documentElement,r=kt(e).on("dragstart.drag",null);t&&(r.on("click.drag",li,bo),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 ml=e=>()=>e;function Sc(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:l,y:s,dx:a,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,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:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Sc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Db(e){return!e.ctrlKey&&!e.button}function Rb(){return this.parentNode}function jb(e,t){return t??{x:e.x,y:e.y}}function $b(){return navigator.maxTouchPoints||"ontouchstart"in this}function ix(){var e=Db,t=Rb,n=jb,r=$b,i={},o=ta("start","drag","end"),l=0,s,a,u,c,f=0;function d(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",w).on("touchmove.drag",m,Ob).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,C){if(!(c||!e.call(this,v,C))){var E=g(this,t.call(this,v,C),v,C,"mouse");E&&(kt(v.view).on("mousemove.drag",p,bo).on("mouseup.drag",x,bo),nx(v.view),Qa(v),u=!1,s=v.clientX,a=v.clientY,E("start",v))}}function p(v){if(li(v),!u){var C=v.clientX-s,E=v.clientY-a;u=C*C+E*E>f}i.mouse("drag",v)}function x(v){kt(v.view).on("mousemove.drag mouseup.drag",null),rx(v.view,u),li(v),i.mouse("end",v)}function w(v,C){if(e.call(this,v,C)){var E=v.changedTouches,S=t.call(this,v,C),P=E.length,z,N;for(z=0;z<P;++z)(N=g(this,S,v,C,E[z].identifier,E[z]))&&(Qa(v),N("start",v,E[z]))}}function m(v){var C=v.changedTouches,E=C.length,S,P;for(S=0;S<E;++S)(P=i[C[S].identifier])&&(li(v),P("drag",v,C[S]))}function y(v){var C=v.changedTouches,E=C.length,S,P;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),S=0;S<E;++S)(P=i[C[S].identifier])&&(Qa(v),P("end",v,C[S]))}function g(v,C,E,S,P,z){var N=o.copy(),T=Ht(z||E,C),j,$,_;if((_=n.call(v,new Sc("beforestart",{sourceEvent:E,target:d,identifier:P,active:l,x:T[0],y:T[1],dx:0,dy:0,dispatch:N}),S))!=null)return j=_.x-T[0]||0,$=_.y-T[1]||0,function A(O,R,M){var L=T,k;switch(O){case"start":i[P]=A,k=l++;break;case"end":delete i[P],--l;case"drag":T=Ht(M||R,C),k=l;break}N.call(O,v,new Sc(O,{sourceEvent:R,subject:_,target:d,identifier:P,active:k,x:T[0]+j,y:T[1]+$,dx:T[0]-L[0],dy:T[1]-L[1],dispatch:N}),S)}}return d.filter=function(v){return arguments.length?(e=typeof v=="function"?v:ml(!!v),d):e},d.container=function(v){return arguments.length?(t=typeof v=="function"?v:ml(v),d):t},d.subject=function(v){return arguments.length?(n=typeof v=="function"?v:ml(v),d):n},d.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:ml(!!v),d):r},d.on=function(){var v=o.on.apply(o,arguments);return v===o?d:v},d.clickDistance=function(v){return arguments.length?(f=(v=+v)*v,d):Math.sqrt(f)},d}function Qf(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ox(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Vo(){}var Co=.7,Ss=1/Co,si="\\s*([+-]?\\d+)\\s*",No="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",un="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fb=/^#([0-9a-f]{3,8})$/,Bb=new RegExp(`^rgb\\(${si},${si},${si}\\)$`),Hb=new RegExp(`^rgb\\(${un},${un},${un}\\)$`),Vb=new RegExp(`^rgba\\(${si},${si},${si},${No}\\)$`),Ub=new RegExp(`^rgba\\(${un},${un},${un},${No}\\)$`),Wb=new RegExp(`^hsl\\(${No},${un},${un}\\)$`),Yb=new RegExp(`^hsla\\(${No},${un},${un},${No}\\)$`),lp={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};Qf(Vo,Cr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:sp,formatHex:sp,formatHex8:Xb,formatHsl:Gb,formatRgb:ap,toString:ap});function sp(){return this.rgb().formatHex()}function Xb(){return this.rgb().formatHex8()}function Gb(){return lx(this).formatHsl()}function ap(){return this.rgb().formatRgb()}function Cr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Fb.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?up(t):n===3?new ht(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gl(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Bb.exec(e))?new ht(t[1],t[2],t[3],1):(t=Hb.exec(e))?new ht(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Vb.exec(e))?gl(t[1],t[2],t[3],t[4]):(t=Ub.exec(e))?gl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Wb.exec(e))?dp(t[1],t[2]/100,t[3]/100,1):(t=Yb.exec(e))?dp(t[1],t[2]/100,t[3]/100,t[4]):lp.hasOwnProperty(e)?up(lp[e]):e==="transparent"?new ht(NaN,NaN,NaN,0):null}function up(e){return new ht(e>>16&255,e>>8&255,e&255,1)}function gl(e,t,n,r){return r<=0&&(e=t=n=NaN),new ht(e,t,n,r)}function Qb(e){return e instanceof Vo||(e=Cr(e)),e?(e=e.rgb(),new ht(e.r,e.g,e.b,e.opacity)):new ht}function _c(e,t,n,r){return arguments.length===1?Qb(e):new ht(e,t,n,r??1)}function ht(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Qf(ht,_c,ox(Vo,{brighter(e){return e=e==null?Ss:Math.pow(Ss,e),new ht(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Co:Math.pow(Co,e),new ht(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ht(xr(this.r),xr(this.g),xr(this.b),_s(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:cp,formatHex:cp,formatHex8:qb,formatRgb:fp,toString:fp}));function cp(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}`}function qb(){return`#${mr(this.r)}${mr(this.g)}${mr(this.b)}${mr((isNaN(this.opacity)?1:this.opacity)*255)}`}function fp(){const e=_s(this.opacity);return`${e===1?"rgb(":"rgba("}${xr(this.r)}, ${xr(this.g)}, ${xr(this.b)}${e===1?")":`, ${e})`}`}function _s(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function mr(e){return e=xr(e),(e<16?"0":"")+e.toString(16)}function dp(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Ut(e,t,n,r)}function lx(e){if(e instanceof Ut)return new Ut(e.h,e.s,e.l,e.opacity);if(e instanceof Vo||(e=Cr(e)),!e)return new Ut;if(e instanceof Ut)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,s=o-i,a=(o+i)/2;return s?(t===o?l=(n-r)/s+(n<r)*6:n===o?l=(r-t)/s+2:l=(t-n)/s+4,s/=a<.5?o+i:2-o-i,l*=60):s=a>0&&a<1?0:l,new Ut(l,s,a,e.opacity)}function Kb(e,t,n,r){return arguments.length===1?lx(e):new Ut(e,t,n,r??1)}function Ut(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Qf(Ut,Kb,ox(Vo,{brighter(e){return e=e==null?Ss:Math.pow(Ss,e),new Ut(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Co:Math.pow(Co,e),new Ut(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ht(qa(e>=240?e-240:e+120,i,r),qa(e,i,r),qa(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Ut(hp(this.h),yl(this.s),yl(this.l),_s(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 e=_s(this.opacity);return`${e===1?"hsl(":"hsla("}${hp(this.h)}, ${yl(this.s)*100}%, ${yl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function hp(e){return e=(e||0)%360,e<0?e+360:e}function yl(e){return Math.max(0,Math.min(1,e||0))}function qa(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const qf=e=>()=>e;function Zb(e,t){return function(n){return e+n*t}}function Jb(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function eC(e){return(e=+e)==1?sx:function(t,n){return n-t?Jb(t,n,e):qf(isNaN(t)?n:t)}}function sx(e,t){var n=t-e;return n?Zb(e,n):qf(isNaN(e)?t:e)}const bs=function e(t){var n=eC(t);function r(i,o){var l=n((i=_c(i)).r,(o=_c(o)).r),s=n(i.g,o.g),a=n(i.b,o.b),u=sx(i.opacity,o.opacity);return function(c){return i.r=l(c),i.g=s(c),i.b=a(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function tC(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(o){for(i=0;i<n;++i)r[i]=e[i]*(1-o)+t[i]*o;return r}}function nC(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function rC(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n),l;for(l=0;l<r;++l)i[l]=no(e[l],t[l]);for(;l<n;++l)o[l]=t[l];return function(s){for(l=0;l<r;++l)o[l]=i[l](s);return o}}function iC(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function on(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function oC(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=no(e[i],t[i]):r[i]=t[i];return function(o){for(i in n)r[i]=n[i](o);return r}}var bc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ka=new RegExp(bc.source,"g");function lC(e){return function(){return e}}function sC(e){return function(t){return e(t)+""}}function ax(e,t){var n=bc.lastIndex=Ka.lastIndex=0,r,i,o,l=-1,s=[],a=[];for(e=e+"",t=t+"";(r=bc.exec(e))&&(i=Ka.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[l]?s[l]+=o:s[++l]=o),(r=r[0])===(i=i[0])?s[l]?s[l]+=i:s[++l]=i:(s[++l]=null,a.push({i:l,x:on(r,i)})),n=Ka.lastIndex;return n<t.length&&(o=t.slice(n),s[l]?s[l]+=o:s[++l]=o),s.length<2?a[0]?sC(a[0].x):lC(t):(t=a.length,function(u){for(var c=0,f;c<t;++c)s[(f=a[c]).i]=f.x(u);return s.join("")})}function no(e,t){var n=typeof t,r;return t==null||n==="boolean"?qf(t):(n==="number"?on:n==="string"?(r=Cr(t))?(t=r,bs):ax:t instanceof Cr?bs:t instanceof Date?iC:nC(t)?tC:Array.isArray(t)?rC:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?oC:on)(e,t)}var pp=180/Math.PI,Cc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ux(e,t,n,r,i,o){var l,s,a;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,a/=s),e*r<t*n&&(e=-e,t=-t,a=-a,l=-l),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*pp,skewX:Math.atan(a)*pp,scaleX:l,scaleY:s}}var xl;function aC(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Cc:ux(t.a,t.b,t.c,t.d,t.e,t.f)}function uC(e){return e==null||(xl||(xl=document.createElementNS("http://www.w3.org/2000/svg","g")),xl.setAttribute("transform",e),!(e=xl.transform.baseVal.consolidate()))?Cc:(e=e.matrix,ux(e.a,e.b,e.c,e.d,e.e,e.f))}function cx(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,f,d,h,p){if(u!==f||c!==d){var x=h.push("translate(",null,t,null,n);p.push({i:x-4,x:on(u,f)},{i:x-2,x:on(c,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function l(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,r)-2,x:on(u,c)})):c&&f.push(i(f)+"rotate("+c+r)}function s(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,r)-2,x:on(u,c)}):c&&f.push(i(f)+"skewX("+c+r)}function a(u,c,f,d,h,p){if(u!==f||c!==d){var x=h.push(i(h)+"scale(",null,",",null,")");p.push({i:x-4,x:on(u,f)},{i:x-2,x:on(c,d)})}else(f!==1||d!==1)&&h.push(i(h)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,f,d),l(u.rotate,c.rotate,f,d),s(u.skewX,c.skewX,f,d),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(h){for(var p=-1,x=d.length,w;++p<x;)f[(w=d[p]).i]=w.x(h);return f.join("")}}}var cC=cx(aC,"px, ","px)","deg)"),fC=cx(uC,", ",")",")"),dC=1e-12;function mp(e){return((e=Math.exp(e))+1/e)/2}function hC(e){return((e=Math.exp(e))-1/e)/2}function pC(e){return((e=Math.exp(2*e))-1)/(e+1)}const Hl=function e(t,n,r){function i(o,l){var s=o[0],a=o[1],u=o[2],c=l[0],f=l[1],d=l[2],h=c-s,p=f-a,x=h*h+p*p,w,m;if(x<dC)m=Math.log(d/u)/t,w=function(S){return[s+S*h,a+S*p,u*Math.exp(t*S*m)]};else{var y=Math.sqrt(x),g=(d*d-u*u+r*x)/(2*u*n*y),v=(d*d-u*u-r*x)/(2*d*n*y),C=Math.log(Math.sqrt(g*g+1)-g),E=Math.log(Math.sqrt(v*v+1)-v);m=(E-C)/t,w=function(S){var P=S*m,z=mp(C),N=u/(n*y)*(z*pC(t*P+C)-hC(C));return[s+N*h,a+N*p,u*z/mp(t*P+C)]}}return w.duration=m*1e3*t/Math.SQRT2,w}return i.rho=function(o){var l=Math.max(.001,+o),s=l*l,a=s*s;return e(l,s,a)},i}(Math.SQRT2,2,4);var gi=0,Ui=0,Di=0,fx=1e3,Cs,Wi,Ns=0,Nr=0,ra=0,Io=typeof performance=="object"&&performance.now?performance:Date,dx=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Kf(){return Nr||(dx(mC),Nr=Io.now()+ra)}function mC(){Nr=0}function Is(){this._call=this._time=this._next=null}Is.prototype=hx.prototype={constructor:Is,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Kf():+n)+(t==null?0:+t),!this._next&&Wi!==this&&(Wi?Wi._next=this:Cs=this,Wi=this),this._call=e,this._time=n,Nc()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nc())}};function hx(e,t,n){var r=new Is;return r.restart(e,t,n),r}function gC(){Kf(),++gi;for(var e=Cs,t;e;)(t=Nr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--gi}function gp(){Nr=(Ns=Io.now())+ra,gi=Ui=0;try{gC()}finally{gi=0,xC(),Nr=0}}function yC(){var e=Io.now(),t=e-Ns;t>fx&&(ra-=t,Ns=e)}function xC(){for(var e,t=Cs,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Cs=n);Wi=e,Nc(r)}function Nc(e){if(!gi){Ui&&(Ui=clearTimeout(Ui));var t=e-Nr;t>24?(e<1/0&&(Ui=setTimeout(gp,e-Io.now()-ra)),Di&&(Di=clearInterval(Di))):(Di||(Ns=Io.now(),Di=setInterval(yC,fx)),gi=1,dx(gp))}}function yp(e,t,n){var r=new Is;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var wC=ta("start","end","cancel","interrupt"),vC=[],px=0,xp=1,Ic=2,Vl=3,wp=4,Pc=5,Ul=6;function ia(e,t,n,r,i,o){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;kC(e,n,{name:t,index:r,group:i,on:wC,tween:vC,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:px})}function Zf(e,t){var n=Jt(e,t);if(n.state>px)throw new Error("too late; already scheduled");return n}function cn(e,t){var n=Jt(e,t);if(n.state>Vl)throw new Error("too late; already running");return n}function Jt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function kC(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=hx(o,0,n.time);function o(u){n.state=xp,n.timer.restart(l,n.delay,n.time),n.delay<=u&&l(u-n.delay)}function l(u){var c,f,d,h;if(n.state!==xp)return a();for(c in r)if(h=r[c],h.name===n.name){if(h.state===Vl)return yp(l);h.state===wp?(h.state=Ul,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=Ul,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(yp(function(){n.state===Vl&&(n.state=wp,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=Ic,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Ic){for(n.state=Vl,i=new Array(d=n.tween.length),c=0,f=-1;c<d;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=h);i.length=f+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Pc,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);n.state===Pc&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Ul,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Wl(e,t){var n=e.__transition,r,i,o=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){o=!1;continue}i=r.state>Ic&&r.state<Pc,r.state=Ul,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}o&&delete e.__transition}}function EC(e){return this.each(function(){Wl(this,e)})}function SC(e,t){var n,r;return function(){var i=cn(this,e),o=i.tween;if(o!==n){r=n=o;for(var l=0,s=r.length;l<s;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}i.tween=r}}function _C(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=cn(this,e),l=o.tween;if(l!==r){i=(r=l).slice();for(var s={name:t,value:n},a=0,u=i.length;a<u;++a)if(i[a].name===t){i[a]=s;break}a===u&&i.push(s)}o.tween=i}}function bC(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Jt(this.node(),n).tween,i=0,o=r.length,l;i<o;++i)if((l=r[i]).name===e)return l.value;return null}return this.each((t==null?SC:_C)(n,e,t))}function Jf(e,t,n){var r=e._id;return e.each(function(){var i=cn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Jt(i,r).value[t]}}function mx(e,t){var n;return(typeof t=="number"?on:t instanceof Cr?bs:(n=Cr(t))?(t=n,bs):ax)(e,t)}function CC(e){return function(){this.removeAttribute(e)}}function NC(e){return function(){this.removeAttributeNS(e.space,e.local)}}function IC(e,t,n){var r,i=n+"",o;return function(){var l=this.getAttribute(e);return l===i?null:l===r?o:o=t(r=l,n)}}function PC(e,t,n){var r,i=n+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===i?null:l===r?o:o=t(r=l,n)}}function MC(e,t,n){var r,i,o;return function(){var l,s=n(this),a;return s==null?void this.removeAttribute(e):(l=this.getAttribute(e),a=s+"",l===a?null:l===r&&a===i?o:(i=a,o=t(r=l,s)))}}function TC(e,t,n){var r,i,o;return function(){var l,s=n(this),a;return s==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),a=s+"",l===a?null:l===r&&a===i?o:(i=a,o=t(r=l,s)))}}function LC(e,t){var n=na(e),r=n==="transform"?fC:mx;return this.attrTween(e,typeof t=="function"?(n.local?TC:MC)(n,r,Jf(this,"attr."+e,t)):t==null?(n.local?NC:CC)(n):(n.local?PC:IC)(n,r,t))}function AC(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function zC(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function OC(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&zC(e,o)),n}return i._value=t,i}function DC(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&AC(e,o)),n}return i._value=t,i}function RC(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=na(e);return this.tween(n,(r.local?OC:DC)(r,t))}function jC(e,t){return function(){Zf(this,e).delay=+t.apply(this,arguments)}}function $C(e,t){return t=+t,function(){Zf(this,e).delay=t}}function FC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?jC:$C)(t,e)):Jt(this.node(),t).delay}function BC(e,t){return function(){cn(this,e).duration=+t.apply(this,arguments)}}function HC(e,t){return t=+t,function(){cn(this,e).duration=t}}function VC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BC:HC)(t,e)):Jt(this.node(),t).duration}function UC(e,t){if(typeof t!="function")throw new Error;return function(){cn(this,e).ease=t}}function WC(e){var t=this._id;return arguments.length?this.each(UC(t,e)):Jt(this.node(),t).ease}function YC(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;cn(this,e).ease=n}}function XC(e){if(typeof e!="function")throw new Error;return this.each(YC(this._id,e))}function GC(e){typeof e!="function"&&(e=Y0(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],l=o.length,s=r[i]=[],a,u=0;u<l;++u)(a=o[u])&&e.call(a,a.__data__,u,o)&&s.push(a);return new Cn(r,this._parents,this._name,this._id)}function QC(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),l=new Array(r),s=0;s<o;++s)for(var a=t[s],u=n[s],c=a.length,f=l[s]=new Array(c),d,h=0;h<c;++h)(d=a[h]||u[h])&&(f[h]=d);for(;s<r;++s)l[s]=t[s];return new Cn(l,this._parents,this._name,this._id)}function qC(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function KC(e,t,n){var r,i,o=qC(t)?Zf:cn;return function(){var l=o(this,e),s=l.on;s!==r&&(i=(r=s).copy()).on(t,n),l.on=i}}function ZC(e,t){var n=this._id;return arguments.length<2?Jt(this.node(),n).on.on(e):this.each(KC(n,e,t))}function JC(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function eN(){return this.on("end.remove",JC(this._id))}function tN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Xf(e));for(var r=this._groups,i=r.length,o=new Array(i),l=0;l<i;++l)for(var s=r[l],a=s.length,u=o[l]=new Array(a),c,f,d=0;d<a;++d)(c=s[d])&&(f=e.call(c,c.__data__,d,s))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,ia(u[d],t,n,d,u,Jt(c,n)));return new Cn(o,this._parents,t,n)}function nN(e){var t=this._name,n=this._id;typeof e!="function"&&(e=W0(e));for(var r=this._groups,i=r.length,o=[],l=[],s=0;s<i;++s)for(var a=r[s],u=a.length,c,f=0;f<u;++f)if(c=a[f]){for(var d=e.call(c,c.__data__,f,a),h,p=Jt(c,n),x=0,w=d.length;x<w;++x)(h=d[x])&&ia(h,t,n,x,d,p);o.push(d),l.push(c)}return new Cn(o,l,t,n)}var rN=Ho.prototype.constructor;function iN(){return new rN(this._groups,this._parents)}function oN(e,t){var n,r,i;return function(){var o=mi(this,e),l=(this.style.removeProperty(e),mi(this,e));return o===l?null:o===n&&l===r?i:i=t(n=o,r=l)}}function gx(e){return function(){this.style.removeProperty(e)}}function lN(e,t,n){var r,i=n+"",o;return function(){var l=mi(this,e);return l===i?null:l===r?o:o=t(r=l,n)}}function sN(e,t,n){var r,i,o;return function(){var l=mi(this,e),s=n(this),a=s+"";return s==null&&(a=s=(this.style.removeProperty(e),mi(this,e))),l===a?null:l===r&&a===i?o:(i=a,o=t(r=l,s))}}function aN(e,t){var n,r,i,o="style."+t,l="end."+o,s;return function(){var a=cn(this,e),u=a.on,c=a.value[o]==null?s||(s=gx(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(l,i=c),a.on=r}}function uN(e,t,n){var r=(e+="")=="transform"?cC:mx;return t==null?this.styleTween(e,oN(e,r)).on("end.style."+e,gx(e)):typeof t=="function"?this.styleTween(e,sN(e,r,Jf(this,"style."+e,t))).each(aN(this._id,e)):this.styleTween(e,lN(e,r,t),n).on("end.style."+e,null)}function cN(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function fN(e,t,n){var r,i;function o(){var l=t.apply(this,arguments);return l!==i&&(r=(i=l)&&cN(e,l,n)),r}return o._value=t,o}function dN(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,fN(e,t,n??""))}function hN(e){return function(){this.textContent=e}}function pN(e){return function(){var t=e(this);this.textContent=t??""}}function mN(e){return this.tween("text",typeof e=="function"?pN(Jf(this,"text",e)):hN(e==null?"":e+""))}function gN(e){return function(t){this.textContent=e.call(this,t)}}function yN(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&gN(i)),t}return r._value=e,r}function xN(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,yN(e))}function wN(){for(var e=this._name,t=this._id,n=yx(),r=this._groups,i=r.length,o=0;o<i;++o)for(var l=r[o],s=l.length,a,u=0;u<s;++u)if(a=l[u]){var c=Jt(a,t);ia(a,e,n,u,l,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Cn(r,this._parents,e,n)}function vN(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,l){var s={value:l},a={value:function(){--i===0&&o()}};n.each(function(){var u=cn(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(a)),u.on=t}),i===0&&o()})}var kN=0;function Cn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function yx(){return++kN}var pn=Ho.prototype;Cn.prototype={constructor:Cn,select:tN,selectAll:nN,selectChild:pn.selectChild,selectChildren:pn.selectChildren,filter:GC,merge:QC,selection:iN,transition:wN,call:pn.call,nodes:pn.nodes,node:pn.node,size:pn.size,empty:pn.empty,each:pn.each,on:ZC,attr:LC,attrTween:RC,style:uN,styleTween:dN,text:mN,textTween:xN,remove:eN,tween:bC,delay:FC,duration:VC,ease:WC,easeVarying:XC,end:vN,[Symbol.iterator]:pn[Symbol.iterator]};function EN(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var SN={time:null,delay:0,duration:250,ease:EN};function _N(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function bN(e){var t,n;e instanceof Cn?(t=e._id,e=e._name):(t=yx(),(n=SN).time=Kf(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var l=r[o],s=l.length,a,u=0;u<s;++u)(a=l[u])&&ia(a,e,t,u,l,n||_N(a,t));return new Cn(r,this._parents,e,t)}Ho.prototype.interrupt=EC;Ho.prototype.transition=bN;const wl=e=>()=>e;function CN(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function vn(e,t,n){this.k=e,this.x=t,this.y=n}vn.prototype={constructor:vn,scale:function(e){return e===1?this:new vn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new vn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var oa=new vn(1,0,0);xx.prototype=vn.prototype;function xx(e){for(;!e.__zoom;)if(!(e=e.parentNode))return oa;return e.__zoom}function Za(e){e.stopImmediatePropagation()}function Ri(e){e.preventDefault(),e.stopImmediatePropagation()}function NN(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function IN(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function vp(){return this.__zoom||oa}function PN(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function MN(){return navigator.maxTouchPoints||"ontouchstart"in this}function TN(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function wx(){var e=NN,t=IN,n=TN,r=PN,i=MN,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,a=Hl,u=ta("start","zoom","end"),c,f,d,h=500,p=150,x=0,w=10;function m(_){_.property("__zoom",vp).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",z).on("dblclick.zoom",N).filter(i).on("touchstart.zoom",T).on("touchmove.zoom",j).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(_,A,O,R){var M=_.selection?_.selection():_;M.property("__zoom",vp),_!==M?C(_,A,O,R):M.interrupt().each(function(){E(this,arguments).event(R).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},m.scaleBy=function(_,A,O,R){m.scaleTo(_,function(){var M=this.__zoom.k,L=typeof A=="function"?A.apply(this,arguments):A;return M*L},O,R)},m.scaleTo=function(_,A,O,R){m.transform(_,function(){var M=t.apply(this,arguments),L=this.__zoom,k=O==null?v(M):typeof O=="function"?O.apply(this,arguments):O,F=L.invert(k),B=typeof A=="function"?A.apply(this,arguments):A;return n(g(y(L,B),k,F),M,l)},O,R)},m.translateBy=function(_,A,O,R){m.transform(_,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof O=="function"?O.apply(this,arguments):O),t.apply(this,arguments),l)},null,R)},m.translateTo=function(_,A,O,R,M){m.transform(_,function(){var L=t.apply(this,arguments),k=this.__zoom,F=R==null?v(L):typeof R=="function"?R.apply(this,arguments):R;return n(oa.translate(F[0],F[1]).scale(k.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof O=="function"?-O.apply(this,arguments):-O),L,l)},R,M)};function y(_,A){return A=Math.max(o[0],Math.min(o[1],A)),A===_.k?_:new vn(A,_.x,_.y)}function g(_,A,O){var R=A[0]-O[0]*_.k,M=A[1]-O[1]*_.k;return R===_.x&&M===_.y?_:new vn(_.k,R,M)}function v(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function C(_,A,O,R){_.on("start.zoom",function(){E(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){E(this,arguments).event(R).end()}).tween("zoom",function(){var M=this,L=arguments,k=E(M,L).event(R),F=t.apply(M,L),B=O==null?v(F):typeof O=="function"?O.apply(M,L):O,I=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),G=M.__zoom,K=typeof A=="function"?A.apply(M,L):A,q=a(G.invert(B).concat(I/G.k),K.invert(B).concat(I/K.k));return function(te){if(te===1)te=K;else{var V=q(te),Q=I/V[2];te=new vn(Q,B[0]-V[0]*Q,B[1]-V[1]*Q)}k.zoom(null,te)}})}function E(_,A,O){return!O&&_.__zooming||new S(_,A)}function S(_,A){this.that=_,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,A),this.taps=0}S.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,A){return this.mouse&&_!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var A=kt(this.that).datum();u.call(_,this.that,new CN(_,{sourceEvent:this.sourceEvent,target:m,transform:this.that.__zoom,dispatch:u}),A)}};function P(_,...A){if(!e.apply(this,arguments))return;var O=E(this,A).event(_),R=this.__zoom,M=Math.max(o[0],Math.min(o[1],R.k*Math.pow(2,r.apply(this,arguments)))),L=Ht(_);if(O.wheel)(O.mouse[0][0]!==L[0]||O.mouse[0][1]!==L[1])&&(O.mouse[1]=R.invert(O.mouse[0]=L)),clearTimeout(O.wheel);else{if(R.k===M)return;O.mouse=[L,R.invert(L)],Wl(this),O.start()}Ri(_),O.wheel=setTimeout(k,p),O.zoom("mouse",n(g(y(R,M),O.mouse[0],O.mouse[1]),O.extent,l));function k(){O.wheel=null,O.end()}}function z(_,...A){if(d||!e.apply(this,arguments))return;var O=_.currentTarget,R=E(this,A,!0).event(_),M=kt(_.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",I,!0),L=Ht(_,O),k=_.clientX,F=_.clientY;nx(_.view),Za(_),R.mouse=[L,this.__zoom.invert(L)],Wl(this),R.start();function B(G){if(Ri(G),!R.moved){var K=G.clientX-k,q=G.clientY-F;R.moved=K*K+q*q>x}R.event(G).zoom("mouse",n(g(R.that.__zoom,R.mouse[0]=Ht(G,O),R.mouse[1]),R.extent,l))}function I(G){M.on("mousemove.zoom mouseup.zoom",null),rx(G.view,R.moved),Ri(G),R.event(G).end()}}function N(_,...A){if(e.apply(this,arguments)){var O=this.__zoom,R=Ht(_.changedTouches?_.changedTouches[0]:_,this),M=O.invert(R),L=O.k*(_.shiftKey?.5:2),k=n(g(y(O,L),R,M),t.apply(this,A),l);Ri(_),s>0?kt(this).transition().duration(s).call(C,k,R,_):kt(this).call(m.transform,k,R,_)}}function T(_,...A){if(e.apply(this,arguments)){var O=_.touches,R=O.length,M=E(this,A,_.changedTouches.length===R).event(_),L,k,F,B;for(Za(_),k=0;k<R;++k)F=O[k],B=Ht(F,this),B=[B,this.__zoom.invert(B),F.identifier],M.touch0?!M.touch1&&M.touch0[2]!==B[2]&&(M.touch1=B,M.taps=0):(M.touch0=B,L=!0,M.taps=1+!!c);c&&(c=clearTimeout(c)),L&&(M.taps<2&&(f=B[0],c=setTimeout(function(){c=null},h)),Wl(this),M.start())}}function j(_,...A){if(this.__zooming){var O=E(this,A).event(_),R=_.changedTouches,M=R.length,L,k,F,B;for(Ri(_),L=0;L<M;++L)k=R[L],F=Ht(k,this),O.touch0&&O.touch0[2]===k.identifier?O.touch0[0]=F:O.touch1&&O.touch1[2]===k.identifier&&(O.touch1[0]=F);if(k=O.that.__zoom,O.touch1){var I=O.touch0[0],G=O.touch0[1],K=O.touch1[0],q=O.touch1[1],te=(te=K[0]-I[0])*te+(te=K[1]-I[1])*te,V=(V=q[0]-G[0])*V+(V=q[1]-G[1])*V;k=y(k,Math.sqrt(te/V)),F=[(I[0]+K[0])/2,(I[1]+K[1])/2],B=[(G[0]+q[0])/2,(G[1]+q[1])/2]}else if(O.touch0)F=O.touch0[0],B=O.touch0[1];else return;O.zoom("touch",n(g(k,F,B),O.extent,l))}}function $(_,...A){if(this.__zooming){var O=E(this,A).event(_),R=_.changedTouches,M=R.length,L,k;for(Za(_),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),L=0;L<M;++L)k=R[L],O.touch0&&O.touch0[2]===k.identifier?delete O.touch0:O.touch1&&O.touch1[2]===k.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(k=Ht(k,this),Math.hypot(f[0]-k[0],f[1]-k[1])<w)){var F=kt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return m.wheelDelta=function(_){return arguments.length?(r=typeof _=="function"?_:wl(+_),m):r},m.filter=function(_){return arguments.length?(e=typeof _=="function"?_:wl(!!_),m):e},m.touchable=function(_){return arguments.length?(i=typeof _=="function"?_:wl(!!_),m):i},m.extent=function(_){return arguments.length?(t=typeof _=="function"?_:wl([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),m):t},m.scaleExtent=function(_){return arguments.length?(o[0]=+_[0],o[1]=+_[1],m):[o[0],o[1]]},m.translateExtent=function(_){return arguments.length?(l[0][0]=+_[0][0],l[1][0]=+_[1][0],l[0][1]=+_[0][1],l[1][1]=+_[1][1],m):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},m.constrain=function(_){return arguments.length?(n=_,m):n},m.duration=function(_){return arguments.length?(s=+_,m):s},m.interpolate=function(_){return arguments.length?(a=_,m):a},m.on=function(){var _=u.on.apply(u,arguments);return _===u?m:_},m.clickDistance=function(_){return arguments.length?(x=(_=+_)*_,m):Math.sqrt(x)},m.tapDistance=function(_){return arguments.length?(w=+_,m):w},m}const Kt={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/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:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Po=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],vx=["Enter"," ","Escape"],kx={"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:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, 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 yi;(function(e){e.Strict="strict",e.Loose="loose"})(yi||(yi={}));var wr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(wr||(wr={}));var Mo;(function(e){e.Partial="partial",e.Full="full"})(Mo||(Mo={}));const Ex={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var $n;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})($n||($n={}));var Ps;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ps||(Ps={}));var ie;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ie||(ie={}));const kp={[ie.Left]:ie.Right,[ie.Right]:ie.Left,[ie.Top]:ie.Bottom,[ie.Bottom]:ie.Top};function Sx(e){return e===null?null:e?"valid":"invalid"}const _x=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,LN=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ed=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Uo=(e,t=[0,0])=>{const{width:n,height:r}=fn(e),i=e.origin??t,o=n*i[0],l=r*i[1];return{x:e.position.x-o,y:e.position.y-l}},AN=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const o=typeof i=="string";let l=!t.nodeLookup&&!o?i:void 0;t.nodeLookup&&(l=o?t.nodeLookup.get(i):ed(i)?i:t.nodeLookup.get(i.id));const s=l?Ms(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return la(r,s)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return sa(n)},Wo=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=la(n,Ms(i)),r=!0)}),r?sa(n):{x:0,y:0,width:0,height:0}},td=(e,t,[n,r,i]=[0,0,1],o=!1,l=!1)=>{const s=(t.x-n)/i,a=(t.y-r)/i,u=t.width/i,c=t.height/i,f=[];for(const d of e.values()){const{measured:h,selectable:p=!0,hidden:x=!1}=d;if(l&&!p||x)continue;const w=h.width??d.width??d.initialWidth??0,m=h.height??d.height??d.initialHeight??0,{x:y,y:g}=d.internals.positionAbsolute,v=Ix(s,a,u,c,y,g,w,m),C=w*m,E=o&&v>0;(!d.internals.handleBounds||E||v>=C||d.dragging)&&f.push(d)}return f},zN=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function ON(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let o;if(t!=null&&t.includeHiddenNodes){const{width:l,height:s}=fn(i);o=l>0&&s>0}else o=!!(i.measured.width&&i.measured.height&&!i.hidden);o&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function DN({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:o},l){if(e.size===0)return!0;const s=ON(e,l),a=Wo(s),u=rd(a,t,n,(l==null?void 0:l.minZoom)??i,(l==null?void 0:l.maxZoom)??o,(l==null?void 0:l.padding)??.1);return await r.setViewport(u,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function bx({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:o}){const l=n.get(e),s=l.parentId?n.get(l.parentId):void 0,{x:a,y:u}=s?s.internals.positionAbsolute:{x:0,y:0},c=l.origin??r;let f=l.extent||i;if(l.extent==="parent"&&!l.expandParent)if(!s)o==null||o("005",Kt.error005());else{const h=s.measured.width,p=s.measured.height;h&&p&&(f=[[a,u],[a+h,u+p]])}else s&&Pr(l.extent)&&(f=[[l.extent[0][0]+a,l.extent[0][1]+u],[l.extent[1][0]+a,l.extent[1][1]+u]]);const d=Pr(f)?Ir(t,f,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(o==null||o("015",Kt.error015())),{position:{x:d.x-a+(l.measured.width??0)*c[0],y:d.y-u+(l.measured.height??0)*c[1]},positionAbsolute:d}}async function RN({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const o=new Set(e.map(d=>d.id)),l=[];for(const d of n){if(d.deletable===!1)continue;const h=o.has(d.id),p=!h&&d.parentId&&l.find(x=>x.id===d.parentId);(h||p)&&l.push(d)}const s=new Set(t.map(d=>d.id)),a=r.filter(d=>d.deletable!==!1),c=zN(l,a);for(const d of a)s.has(d.id)&&!c.find(p=>p.id===d.id)&&c.push(d);if(!i)return{edges:c,nodes:l};const f=await i({nodes:l,edges:c});return typeof f=="boolean"?f?{edges:c,nodes:l}:{edges:[],nodes:[]}:f}const xi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ir=(e={x:0,y:0},t,n)=>({x:xi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:xi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function Cx(e,t,n){const{width:r,height:i}=fn(n),{x:o,y:l}=n.internals.positionAbsolute;return Ir(e,[[o,l],[o+r,l+i]],t)}const Ep=(e,t,n)=>e<t?xi(Math.abs(e-t),1,t)/t:e>n?-xi(Math.abs(e-n),1,t)/t:0,nd=(e,t,n=15,r=40)=>{const i=Ep(e.x,r,t.width-r)*n,o=Ep(e.y,r,t.height-r)*n;return[i,o]},la=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Mc=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),sa=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),To=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=ed(e)?e.internals.positionAbsolute:Uo(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Ms=(e,t=[0,0])=>{var i,o;const{x:n,y:r}=ed(e)?e.internals.positionAbsolute:Uo(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},Nx=(e,t)=>sa(la(Mc(e),Mc(t))),Ix=(e,t,n,r,i,o,l,s)=>{const a=Math.max(0,Math.min(e+n,i+l)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,o+s)-Math.max(t,o));return Math.ceil(a*u)},Ts=(e,t)=>Ix(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Sp=e=>Wt(e.width)&&Wt(e.height)&&Wt(e.x)&&Wt(e.y),Wt=e=>!isNaN(e)&&isFinite(e),Px=(e,t)=>(n,r)=>{},Yo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Xo=({x:e,y:t},[n,r,i],o=!1,l=[1,1])=>{const s={x:(e-n)/i,y:(t-r)/i};return o?Yo(s,l):s},wi=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function jr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function jN(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=jr(e,n),i=jr(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=jr(e.top??e.y??0,n),i=jr(e.bottom??e.y??0,n),o=jr(e.left??e.x??0,t),l=jr(e.right??e.x??0,t);return{top:r,right:l,bottom:i,left:o,x:o+l,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function $N(e,t,n,r,i,o){const{x:l,y:s}=wi(e,[t,n,r]),{x:a,y:u}=wi({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=i-a,f=o-u;return{left:Math.floor(l),top:Math.floor(s),right:Math.floor(c),bottom:Math.floor(f)}}const rd=(e,t,n,r,i,o)=>{const l=jN(o,t,n),s=(t-l.x)/e.width,a=(n-l.y)/e.height,u=Math.min(s,a),c=xi(u,r,i),f=e.x+e.width/2,d=e.y+e.height/2,h=t/2-f*c,p=n/2-d*c,x=$N(e,h,p,c,t,n),w={left:Math.min(x.left-l.left,0),top:Math.min(x.top-l.top,0),right:Math.min(x.right-l.right,0),bottom:Math.min(x.bottom-l.bottom,0)};return{x:h-w.left+w.right,y:p-w.top+w.bottom,zoom:c}},Lo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Pr(e){return e!=null&&e!=="parent"}function fn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function Mx(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function Tx(e,t={width:0,height:0},n,r,i){const o={...e},l=r.get(n);if(l){const s=l.origin||i;o.x+=l.internals.positionAbsolute.x-(t.width??0)*s[0],o.y+=l.internals.positionAbsolute.y-(t.height??0)*s[1]}return o}function _p(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function FN(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function BN(e){return{...kx,...e||{}}}function ro(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:o,y:l}=Yt(e),s=Xo({x:o-((i==null?void 0:i.left)??0),y:l-((i==null?void 0:i.top)??0)},r),{x:a,y:u}=n?Yo(s,t):s;return{xSnapped:a,ySnapped:u,...s}}const id=e=>({width:e.offsetWidth,height:e.offsetHeight}),Lx=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},HN=["INPUT","SELECT","TEXTAREA"];function Ax(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:HN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const zx=e=>"clientX"in e,Yt=(e,t)=>{var o,l;const n=zx(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},bp=(e,t,n,r,i)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(l=>{const s=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:i,position:l.getAttribute("data-handlepos"),x:(s.left-n.left)/r,y:(s.top-n.top)/r,...id(l)}})};function Ox({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:l,targetControlY:s}){const a=e*.125+i*.375+l*.375+n*.125,u=t*.125+o*.375+s*.375+r*.125,c=Math.abs(a-e),f=Math.abs(u-t);return[a,u,c,f]}function vl(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Cp({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case ie.Left:return[t-vl(t-r,o),n];case ie.Right:return[t+vl(r-t,o),n];case ie.Top:return[t,n-vl(n-i,o)];case ie.Bottom:return[t,n+vl(i-n,o)]}}function Dx({sourceX:e,sourceY:t,sourcePosition:n=ie.Bottom,targetX:r,targetY:i,targetPosition:o=ie.Top,curvature:l=.25}){const[s,a]=Cp({pos:n,x1:e,y1:t,x2:r,y2:i,c:l}),[u,c]=Cp({pos:o,x1:r,y1:i,x2:e,y2:t,c:l}),[f,d,h,p]=Ox({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${a} ${u},${c} ${r},${i}`,f,d,h,p]}function Rx({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,l=Math.abs(r-t)/2,s=r<t?r+l:r-l;return[o,s,i,l]}function VN({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const l=i&&n?r+1e3:r,s=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return l+s}function UN({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const o=la(Ms(e),Ms(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const l={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Ts(l,sa(o))>0}const WN=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,YN=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),XN=(e,t,n={})=>{var o;if(!e.source||!e.target)return(o=n.onError)==null||o.call(n,"006",Kt.error006()),t;const r=n.getEdgeId||WN;let i;return _x(e)?i={...e}:i={...e,id:r(e)},YN(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function jx({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,l,s]=Rx({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,l,s]}const Np={[ie.Left]:{x:-1,y:0},[ie.Right]:{x:1,y:0},[ie.Top]:{x:0,y:-1},[ie.Bottom]:{x:0,y:1}},GN=({source:e,sourcePosition:t=ie.Bottom,target:n})=>t===ie.Left||t===ie.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Ip=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function QN({source:e,sourcePosition:t=ie.Bottom,target:n,targetPosition:r=ie.Top,center:i,offset:o,stepPosition:l}){const s=Np[t],a=Np[r],u={x:e.x+s.x*o,y:e.y+s.y*o},c={x:n.x+a.x*o,y:n.y+a.y*o},f=GN({source:u,sourcePosition:t,target:c}),d=f.x!==0?"x":"y",h=f[d];let p=[],x,w;const m={x:0,y:0},y={x:0,y:0},[,,g,v]=Rx({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[d]*a[d]===-1){d==="x"?(x=i.x??u.x+(c.x-u.x)*l,w=i.y??(u.y+c.y)/2):(x=i.x??(u.x+c.x)/2,w=i.y??u.y+(c.y-u.y)*l);const P=[{x,y:u.y},{x,y:c.y}],z=[{x:u.x,y:w},{x:c.x,y:w}];s[d]===h?p=d==="x"?P:z:p=d==="x"?z:P}else{const P=[{x:u.x,y:c.y}],z=[{x:c.x,y:u.y}];if(d==="x"?p=s.x===h?z:P:p=s.y===h?P:z,t===r){const _=Math.abs(e[d]-n[d]);if(_<=o){const A=Math.min(o-1,o-_);s[d]===h?m[d]=(u[d]>e[d]?-1:1)*A:y[d]=(c[d]>n[d]?-1:1)*A}}if(t!==r){const _=d==="x"?"y":"x",A=s[d]===a[_],O=u[_]>c[_],R=u[_]<c[_];(s[d]===1&&(!A&&O||A&&R)||s[d]!==1&&(!A&&R||A&&O))&&(p=d==="x"?P:z)}const N={x:u.x+m.x,y:u.y+m.y},T={x:c.x+y.x,y:c.y+y.y},j=Math.max(Math.abs(N.x-p[0].x),Math.abs(T.x-p[0].x)),$=Math.max(Math.abs(N.y-p[0].y),Math.abs(T.y-p[0].y));j>=$?(x=(N.x+T.x)/2,w=p[0].y):(x=p[0].x,w=(N.y+T.y)/2)}const C={x:u.x+m.x,y:u.y+m.y},E={x:c.x+y.x,y:c.y+y.y};return[[e,...C.x!==p[0].x||C.y!==p[0].y?[C]:[],...p,...E.x!==p[p.length-1].x||E.y!==p[p.length-1].y?[E]:[],n],x,w,g,v]}function qN(e,t,n,r){const i=Math.min(Ip(e,t)/2,Ip(t,n)/2,r),{x:o,y:l}=t;if(e.x===o&&o===n.x||e.y===l&&l===n.y)return`L${o} ${l}`;if(e.y===l){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${o+i*u},${l}Q ${o},${l} ${o},${l+i*c}`}const s=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${o},${l+i*a}Q ${o},${l} ${o+i*s},${l}`}function Tc({sourceX:e,sourceY:t,sourcePosition:n=ie.Bottom,targetX:r,targetY:i,targetPosition:o=ie.Top,borderRadius:l=5,centerX:s,centerY:a,offset:u=20,stepPosition:c=.5}){const[f,d,h,p,x]=QN({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:s,y:a},offset:u,stepPosition:c});let w=`M${f[0].x} ${f[0].y}`;for(let m=1;m<f.length-1;m++)w+=qN(f[m-1],f[m],f[m+1],l);return w+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[w,d,h,p,x]}function Pp(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function KN(e){var f;const{sourceNode:t,targetNode:n}=e;if(!Pp(t)||!Pp(n))return null;const r=t.internals.handleBounds||Mp(t.handles),i=n.internals.handleBounds||Mp(n.handles),o=Tp((r==null?void 0:r.source)??[],e.sourceHandle),l=Tp(e.connectionMode===yi.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!o||!l)return(f=e.onError)==null||f.call(e,"008",Kt.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const s=(o==null?void 0:o.position)||ie.Bottom,a=(l==null?void 0:l.position)||ie.Top,u=Mr(t,o,s),c=Mr(n,l,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:s,targetPosition:a}}function Mp(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Mr(e,t,n=ie.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:s}=t??fn(e);if(r)return{x:i+l/2,y:o+s/2};switch((t==null?void 0:t.position)??n){case ie.Top:return{x:i+l/2,y:o};case ie.Right:return{x:i+l,y:o+s/2};case ie.Bottom:return{x:i+l/2,y:o+s};case ie.Left:return{x:i,y:o+s/2}}}function Tp(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Lc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function ZN(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const o=new Set;return e.reduce((l,s)=>([s.markerStart||r,s.markerEnd||i].forEach(a=>{if(a&&typeof a=="object"){const u=Lc(a,t);o.has(u)||(l.push({id:u,color:a.color||n,...a}),o.add(u))}}),l),[]).sort((l,s)=>l.id.localeCompare(s.id))}const $x=1e3,JN=10,od={nodeOrigin:[0,0],nodeExtent:Po,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},e2={...od,checkEquality:!0};function ld(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function t2(e,t,n){const r=ld(od,n);for(const i of e.values())if(i.parentId)ad(i,e,t,r);else{const o=Uo(i,r.nodeOrigin),l=Pr(i.extent)?i.extent:r.nodeExtent,s=Ir(o,l,fn(i));i.internals.positionAbsolute=s}}function n2(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const o={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(o):i.type==="target"&&r.push(o)}return{source:n,target:r}}function sd(e){return e==="manual"}function Ac(e,t,n,r={}){var c,f;const i=ld(e2,r),o={i:0},l=new Map(t),s=i!=null&&i.elevateNodesOnSelect&&!sd(i.zIndexMode)?$x:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const d of e){let h=l.get(d.id);if(i.checkEquality&&d===(h==null?void 0:h.internals.userNode))t.set(d.id,h);else{const p=Uo(d,i.nodeOrigin),x=Pr(d.extent)?d.extent:i.nodeExtent,w=Ir(p,x,fn(d));h={...i.defaults,...d,measured:{width:(c=d.measured)==null?void 0:c.width,height:(f=d.measured)==null?void 0:f.height},internals:{positionAbsolute:w,handleBounds:n2(d,h),z:Fx(d,s,i.zIndexMode),userNode:d}},t.set(d.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(a=!1),d.parentId&&ad(h,t,n,r,o),u||(u=d.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function r2(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function ad(e,t,n,r,i){const{elevateNodesOnSelect:o,nodeOrigin:l,nodeExtent:s,zIndexMode:a}=ld(od,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}r2(e,n),i&&!c.parentId&&c.internals.rootParentIndex===void 0&&a==="auto"&&(c.internals.rootParentIndex=++i.i,c.internals.z=c.internals.z+i.i*JN),i&&c.internals.rootParentIndex!==void 0&&(i.i=c.internals.rootParentIndex);const f=o&&!sd(a)?$x:0,{x:d,y:h,z:p}=i2(e,c,l,s,f,a),{positionAbsolute:x}=e.internals,w=d!==x.x||h!==x.y;(w||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:d,y:h}:x,z:p}})}function Fx(e,t,n){const r=Wt(e.zIndex)?e.zIndex:0;return sd(n)?r:r+(e.selected?t:0)}function i2(e,t,n,r,i,o){const{x:l,y:s}=t.internals.positionAbsolute,a=fn(e),u=Uo(e,n),c=Pr(e.extent)?Ir(u,e.extent,a):u;let f=Ir({x:l+c.x,y:s+c.y},r,a);e.extent==="parent"&&(f=Cx(f,a,t));const d=Fx(e,i,o),h=t.internals.z??0;return{x:f.x,y:f.y,z:h>=d?h+1:d}}function ud(e,t,n,r=[0,0]){var l;const i=[],o=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const u=((l=o.get(s.parentId))==null?void 0:l.expandedRect)??To(a),c=Nx(u,s.rect);o.set(s.parentId,{expandedRect:c,parent:a})}return o.size>0&&o.forEach(({expandedRect:s,parent:a},u)=>{var g;const c=a.internals.positionAbsolute,f=fn(a),d=a.origin??r,h=s.x<c.x?Math.round(Math.abs(c.x-s.x)):0,p=s.y<c.y?Math.round(Math.abs(c.y-s.y)):0,x=Math.max(f.width,Math.round(s.width)),w=Math.max(f.height,Math.round(s.height)),m=(x-f.width)*d[0],y=(w-f.height)*d[1];(h>0||p>0||m||y)&&(i.push({id:u,type:"position",position:{x:a.position.x-h+m,y:a.position.y-p+y}}),(g=n.get(u))==null||g.forEach(v=>{e.some(C=>C.id===v.id)||i.push({id:v.id,type:"position",position:{x:v.position.x+h,y:v.position.y+p}})})),(f.width<s.width||f.height<s.height||h||p)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?d[0]*h-m:0),height:w+(p?d[1]*p-y:0)}})}),i}function o2(e,t,n,r,i,o,l){const s=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!s)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(s),{m22:f}=new window.DOMMatrixReadOnly(c.transform),d=[];for(const h of e.values()){const p=t.get(h.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),a=!0;continue}const x=id(h.nodeElement),w=p.measured.width!==x.width||p.measured.height!==x.height;if(!!(x.width&&x.height&&(w||!p.internals.handleBounds||h.force))){const y=h.nodeElement.getBoundingClientRect(),g=Pr(p.extent)?p.extent:o;let{positionAbsolute:v}=p.internals;if(p.parentId&&p.extent==="parent"){const E=t.get(p.parentId);E&&(v=Cx(v,x,E))}else g&&(v=Ir(v,g,x));const C={...p,measured:x,internals:{...p.internals,positionAbsolute:v,handleBounds:{source:bp("source",h.nodeElement,y,f,p.id),target:bp("target",h.nodeElement,y,f,p.id)}}};t.set(p.id,C),p.parentId&&ad(C,t,n,{nodeOrigin:i,zIndexMode:l}),a=!0,w&&(u.push({id:p.id,type:"dimensions",dimensions:x}),p.expandParent&&p.parentId&&d.push({id:p.id,parentId:p.parentId,rect:To(C,i)}))}}if(d.length>0){const h=ud(d,t,n,i);u.push(...h)}return{changes:u,updatedInternals:a}}async function l2({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:o}){if(!t||!e.x&&!e.y)return!1;const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,o]],r);return!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2])}function Lp(e,t,n,r,i,o){let l=i;const s=r.get(l)||new Map;r.set(l,s.set(n,t)),l=`${i}-${e}`;const a=r.get(l)||new Map;if(r.set(l,a.set(n,t)),o){l=`${i}-${e}-${o}`;const u=r.get(l)||new Map;r.set(l,u.set(n,t))}}function Bx(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:o,sourceHandle:l=null,targetHandle:s=null}=r,a={edgeId:r.id,source:i,target:o,sourceHandle:l,targetHandle:s},u=`${i}-${l}--${o}-${s}`,c=`${o}-${s}--${i}-${l}`;Lp("source",a,c,e,i,l),Lp("target",a,u,e,o,s),t.set(r.id,r)}}function Hx(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Hx(n,t):!1}function Ap(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function s2(e,t,n,r){const i=new Map;for(const[o,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!Hx(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const s=e.get(o);s&&i.set(o,{id:o,position:s.position||{x:0,y:0},distance:{x:n.x-s.internals.positionAbsolute.x,y:n.y-s.internals.positionAbsolute.y},extent:s.extent,parentId:s.parentId,origin:s.origin,expandParent:s.expandParent,internals:{positionAbsolute:s.internals.positionAbsolute||{x:0,y:0}},measured:{width:s.measured.width??0,height:s.measured.height??0}})}return i}function Ja({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var l,s,a;const i=[];for(const[u,c]of t){const f=(l=n.get(u))==null?void 0:l.internals.userNode;f&&i.push({...f,position:c.position,dragging:r})}if(!e)return[i[0],i];const o=(s=n.get(e))==null?void 0:s.internals.userNode;return[o?{...o,position:((a=t.get(e))==null?void 0:a.position)||o.position,dragging:r}:i[0],i]}function a2({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const o={x:n-i.distance.x,y:r-i.distance.y},l=Yo(o,t);return{x:l.x-o.x,y:l.y-o.y}}function u2({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let o={x:null,y:null},l=0,s=new Map,a=!1,u={x:0,y:0},c=null,f=!1,d=null,h=!1,p=!1,x=null;function w({noDragClassName:y,handleSelector:g,domNode:v,isSelectable:C,nodeId:E,nodeClickDistance:S=0}){d=kt(v);function P({x:j,y:$}){const{nodeLookup:_,nodeExtent:A,snapGrid:O,snapToGrid:R,nodeOrigin:M,onNodeDrag:L,onSelectionDrag:k,onError:F,updateNodePositions:B}=t();o={x:j,y:$};let I=!1;const G=s.size>1,K=G&&A?Mc(Wo(s)):null,q=G&&R?a2({dragItems:s,snapGrid:O,x:j,y:$}):null;for(const[te,V]of s){if(!_.has(te))continue;let Q={x:j-V.distance.x,y:$-V.distance.y};R&&(Q=q?{x:Math.round(Q.x+q.x),y:Math.round(Q.y+q.y)}:Yo(Q,O));let Z=null;if(G&&A&&!V.extent&&K){const{positionAbsolute:re}=V.internals,ce=re.x-K.x+A[0][0],de=re.x+V.measured.width-K.x2+A[1][0],me=re.y-K.y+A[0][1],_e=re.y+V.measured.height-K.y2+A[1][1];Z=[[ce,me],[de,_e]]}const{position:oe,positionAbsolute:ne}=bx({nodeId:te,nextPosition:Q,nodeLookup:_,nodeExtent:Z||A,nodeOrigin:M,onError:F});I=I||V.position.x!==oe.x||V.position.y!==oe.y,V.position=oe,V.internals.positionAbsolute=ne}if(p=p||I,!!I&&(B(s,!0),x&&(r||L||!E&&k))){const[te,V]=Ja({nodeId:E,dragItems:s,nodeLookup:_});r==null||r(x,s,te,V),L==null||L(x,te,V),E||k==null||k(x,V)}}async function z(){if(!c)return;const{transform:j,panBy:$,autoPanSpeed:_,autoPanOnNodeDrag:A}=t();if(!A){a=!1,cancelAnimationFrame(l);return}const[O,R]=nd(u,c,_);(O!==0||R!==0)&&(o.x=(o.x??0)-O/j[2],o.y=(o.y??0)-R/j[2],await $({x:O,y:R})&&P(o)),l=requestAnimationFrame(z)}function N(j){var G;const{nodeLookup:$,multiSelectionActive:_,nodesDraggable:A,transform:O,snapGrid:R,snapToGrid:M,selectNodesOnDrag:L,onNodeDragStart:k,onSelectionDragStart:F,unselectNodesAndEdges:B}=t();f=!0,(!L||!C)&&!_&&E&&((G=$.get(E))!=null&&G.selected||B()),C&&L&&E&&(e==null||e(E));const I=ro(j.sourceEvent,{transform:O,snapGrid:R,snapToGrid:M,containerBounds:c});if(o=I,s=s2($,A,I,E),s.size>0&&(n||k||!E&&F)){const[K,q]=Ja({nodeId:E,dragItems:s,nodeLookup:$});n==null||n(j.sourceEvent,s,K,q),k==null||k(j.sourceEvent,K,q),E||F==null||F(j.sourceEvent,q)}}const T=ix().clickDistance(S).on("start",j=>{const{domNode:$,nodeDragThreshold:_,transform:A,snapGrid:O,snapToGrid:R}=t();c=($==null?void 0:$.getBoundingClientRect())||null,h=!1,p=!1,x=j.sourceEvent,_===0&&N(j),o=ro(j.sourceEvent,{transform:A,snapGrid:O,snapToGrid:R,containerBounds:c}),u=Yt(j.sourceEvent,c)}).on("drag",j=>{const{autoPanOnNodeDrag:$,transform:_,snapGrid:A,snapToGrid:O,nodeDragThreshold:R,nodeLookup:M}=t(),L=ro(j.sourceEvent,{transform:_,snapGrid:A,snapToGrid:O,containerBounds:c});if(x=j.sourceEvent,(j.sourceEvent.type==="touchmove"&&j.sourceEvent.touches.length>1||E&&!M.has(E))&&(h=!0),!h){if(!a&&$&&f&&(a=!0,z()),!f){const k=Yt(j.sourceEvent,c),F=k.x-u.x,B=k.y-u.y;Math.sqrt(F*F+B*B)>R&&N(j)}(o.x!==L.xSnapped||o.y!==L.ySnapped)&&s&&f&&(u=Yt(j.sourceEvent,c),P(L))}}).on("end",j=>{if(!f||h){h&&s.size>0&&t().updateNodePositions(s,!1);return}if(a=!1,f=!1,cancelAnimationFrame(l),s.size>0){const{nodeLookup:$,updateNodePositions:_,onNodeDragStop:A,onSelectionDragStop:O}=t();if(p&&(_(s,!1),p=!1),i||A||!E&&O){const[R,M]=Ja({nodeId:E,dragItems:s,nodeLookup:$,dragging:!1});i==null||i(j.sourceEvent,s,R,M),A==null||A(j.sourceEvent,R,M),E||O==null||O(j.sourceEvent,M)}}}).filter(j=>{const $=j.target;return!j.button&&(!y||!Ap($,`.${y}`,v))&&(!g||Ap($,g,v))});d.call(T)}function m(){d==null||d.on(".drag",null)}return{update:w,destroy:m}}function c2(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Ts(i,To(o))>0&&r.push(o);return r}const f2=250;function d2(e,t,n,r){var s,a;let i=[],o=1/0;const l=c2(e,n,t+f2);for(const u of l){const c=[...((s=u.internals.handleBounds)==null?void 0:s.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const f of c){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:d,y:h}=Mr(u,f,f.position,!0),p=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(h-e.y,2));p>t||(p<o?(i=[{...f,x:d,y:h}],o=p):p===o&&i.push({...f,x:d,y:h}))}}if(!i.length)return null;if(i.length>1){const u=r.type==="source"?"target":"source";return i.find(c=>c.type===u)??i[0]}return i[0]}function Vx(e,t,n,r,i,o=!1){var u,c,f;const l=r.get(e);if(!l)return null;const s=i==="strict"?(u=l.internals.handleBounds)==null?void 0:u[t]:[...((c=l.internals.handleBounds)==null?void 0:c.source)??[],...((f=l.internals.handleBounds)==null?void 0:f.target)??[]],a=(n?s==null?void 0:s.find(d=>d.id===n):s==null?void 0:s[0])??null;return a&&o?{...a,...Mr(l,a,a.position,!0)}:a}function Ux(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function h2(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Wx=()=>!0;function p2(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:o,isTarget:l,domNode:s,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:f,panBy:d,cancelConnection:h,onConnectStart:p,onConnect:x,onConnectEnd:w,isValidConnection:m=Wx,onReconnectEnd:y,updateConnection:g,getTransform:v,getFromHandle:C,autoPanSpeed:E,dragThreshold:S=1,handleDomNode:P}){const z=Lx(e.target);let N=0,T;const{x:j,y:$}=Yt(e),_=Ux(o,P),A=s==null?void 0:s.getBoundingClientRect();let O=!1;if(!A||!_)return;const R=Vx(i,_,r,a,t);if(!R)return;let M=Yt(e,A),L=!1,k=null,F=!1,B=null;function I(){if(!c||!A)return;const[oe,ne]=nd(M,A,E);d({x:oe,y:ne}),N=requestAnimationFrame(I)}const G={...R,nodeId:i,type:_,position:R.position},K=a.get(i);let te={inProgress:!0,isValid:null,from:Mr(K,G,ie.Left,!0),fromHandle:G,fromPosition:G.position,fromNode:K,to:M,toHandle:null,toPosition:kp[G.position],toNode:null,pointer:M};function V(){O=!0,g(te),p==null||p(e,{nodeId:i,handleId:r,handleType:_})}S===0&&V();function Q(oe){if(!O){const{x:_e,y:Xe}=Yt(oe),Ke=_e-j,U=Xe-$;if(!(Ke*Ke+U*U>S*S))return;V()}if(!C()||!G){Z(oe);return}const ne=v();M=Yt(oe,A),T=d2(Xo(M,ne,!1,[1,1]),n,a,G),L||(I(),L=!0);const re=Yx(oe,{handle:T,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:l?"target":"source",isValidConnection:m,doc:z,lib:u,flowId:f,nodeLookup:a});B=re.handleDomNode,k=re.connection,F=h2(!!T,re.isValid);const ce=a.get(i),de=ce?Mr(ce,G,ie.Left,!0):te.from,me={...te,from:de,isValid:F,to:re.toHandle&&F?wi({x:re.toHandle.x,y:re.toHandle.y},ne):M,toHandle:re.toHandle,toPosition:F&&re.toHandle?re.toHandle.position:kp[G.position],toNode:re.toHandle?a.get(re.toHandle.nodeId):null,pointer:M};g(me),te=me}function Z(oe){if(!("touches"in oe&&oe.touches.length>0)){if(O){(T||B)&&k&&F&&(x==null||x(k));const{inProgress:ne,...re}=te,ce={...re,toPosition:te.toHandle?te.toPosition:null};w==null||w(oe,ce),o&&(y==null||y(oe,ce))}h(),cancelAnimationFrame(N),L=!1,F=!1,k=null,B=null,z.removeEventListener("mousemove",Q),z.removeEventListener("mouseup",Z),z.removeEventListener("touchmove",Q),z.removeEventListener("touchend",Z)}}z.addEventListener("mousemove",Q),z.addEventListener("mouseup",Z),z.addEventListener("touchmove",Q),z.addEventListener("touchend",Z)}function Yx(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:o,doc:l,lib:s,flowId:a,isValidConnection:u=Wx,nodeLookup:c}){const f=o==="target",d=t?l.querySelector(`.${s}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:p}=Yt(e),x=l.elementFromPoint(h,p),w=x!=null&&x.classList.contains(`${s}-flow__handle`)?x:d,m={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const y=Ux(void 0,w),g=w.getAttribute("data-nodeid"),v=w.getAttribute("data-handleid"),C=w.classList.contains("connectable"),E=w.classList.contains("connectableend");if(!g||!y)return m;const S={source:f?g:r,sourceHandle:f?v:i,target:f?r:g,targetHandle:f?i:v};m.connection=S;const z=C&&E&&(n===yi.Strict?f&&y==="source"||!f&&y==="target":g!==r||v!==i);m.isValid=z&&u(S),m.toHandle=Vx(g,y,v,c,n,!0)}return m}const zc={onPointerDown:p2,isValid:Yx};function m2({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=kt(e);function o({translateExtent:s,width:a,height:u,zoomStep:c=1,pannable:f=!0,zoomable:d=!0,inversePan:h=!1}){const p=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const v=n(),C=g.sourceEvent.ctrlKey&&Lo()?10:1,E=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*c,S=v[2]*Math.pow(2,E*C);t.scaleTo(S)};let x=[0,0];const w=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(x=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},m=g=>{const v=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const C=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],E=[C[0]-x[0],C[1]-x[1]];x=C;const S=r()*Math.max(v[2],Math.log(v[2]))*(h?-1:1),P={x:v[0]-E[0]*S,y:v[1]-E[1]*S},z=[[0,0],[a,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:v[2]},z,s)},y=wx().on("start",w).on("zoom",f?m:null).on("zoom.wheel",d?p:null);i.call(y,{})}function l(){i.on("zoom",null)}return{update:o,destroy:l,pointer:Ht}}const aa=e=>({x:e.x,y:e.y,zoom:e.k}),eu=({x:e,y:t,zoom:n})=>oa.translate(e,t).scale(n),Zr=(e,t)=>e.target.closest(`.${t}`),Xx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),g2=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,tu=(e,t=0,n=g2,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},Gx=e=>{const t=e.ctrlKey&&Lo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function y2({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:o,zoomOnPinch:l,onPanZoomStart:s,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(Zr(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(c.ctrlKey&&l){const w=Ht(c),m=Gx(c),y=f*Math.pow(2,m);r.scaleTo(n,y,w,c);return}const d=c.deltaMode===1?20:1;let h=i===wr.Vertical?0:c.deltaX*d,p=i===wr.Horizontal?0:c.deltaY*d;!Lo()&&c.shiftKey&&i!==wr.Vertical&&(h=c.deltaY*d,p=0),r.translateBy(n,-(h/f)*o,-(p/f)*o,{internal:!0});const x=aa(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,x):(e.isPanScrolling=!0,s==null||s(c,x)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,x),e.isPanScrolling=!1},150)}}function x2({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const o=r.type==="wheel",l=!t&&o&&!r.ctrlKey,s=Zr(r,e);if(r.ctrlKey&&o&&s&&r.preventDefault(),l||s)return null;r.preventDefault(),n.call(this,r,i)}}function w2({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,l,s;if((o=r.sourceEvent)!=null&&o.internal)return;const i=aa(r.transform);e.mouseButton=((l=r.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((s=r.sourceEvent)==null?void 0:s.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function v2({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return o=>{var l,s;e.usedRightMouseButton=!!(n&&Xx(t,e.mouseButton??0)),(l=o.sourceEvent)!=null&&l.sync||r([o.transform.x,o.transform.y,o.transform.k]),i&&!((s=o.sourceEvent)!=null&&s.internal)&&(i==null||i(o.sourceEvent,aa(o.transform)))}}function k2({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:o}){return l=>{var s;if(!((s=l.sourceEvent)!=null&&s.internal)&&(e.isZoomingOrPanning=!1,o&&Xx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&o(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const a=aa(l.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(l.sourceEvent,a)},n?150:0)}}}function E2({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:o,userSelectionActive:l,noWheelClassName:s,noPanClassName:a,lib:u,connectionInProgress:c}){return f=>{var w;const d=e||t,h=n&&f.ctrlKey,p=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(Zr(f,`${u}-flow__node`)||Zr(f,`${u}-flow__edge`)))return!0;if(!r&&!d&&!i&&!o&&!n||l||c&&!p||Zr(f,s)&&p||Zr(f,a)&&(!p||i&&p&&!e)||!n&&f.ctrlKey&&p)return!1;if(!n&&f.type==="touchstart"&&((w=f.touches)==null?void 0:w.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 x=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||p)&&x}}function S2({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:s,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let f=[[0,0],[c.width,c.height]];const d=typeof ResizeObserver<"u"?new ResizeObserver($=>{const _=$[0];_&&(f=[[0,0],[_.contentRect.width,_.contentRect.height]])}):null;d==null||d.observe(e);const h=wx().extent(()=>f).scaleExtent([t,n]).translateExtent(r),p=kt(e).call(h);v({x:i.x,y:i.y,zoom:xi(i.zoom,t,n)},[[0,0],[c.width,c.height]],r);const x=p.on("wheel.zoom"),w=p.on("dblclick.zoom");h.wheelDelta(Gx);async function m($,_){return p?new Promise(A=>{h==null||h.interpolate((_==null?void 0:_.interpolate)==="linear"?no:Hl).transform(tu(p,_==null?void 0:_.duration,_==null?void 0:_.ease,()=>A(!0)),$)}):!1}function y({noWheelClassName:$,noPanClassName:_,onPaneContextMenu:A,userSelectionActive:O,panOnScroll:R,panOnDrag:M,panOnScrollMode:L,panOnScrollSpeed:k,preventScrolling:F,zoomOnPinch:B,zoomOnScroll:I,zoomOnDoubleClick:G,zoomActivationKeyPressed:K,lib:q,onTransformChange:te,connectionInProgress:V,paneClickDistance:Q,selectionOnDrag:Z}){O&&!u.isZoomingOrPanning&&g();const oe=R&&!K&&!O;h.clickDistance(Z?1/0:!Wt(Q)||Q<0?0:Q);const ne=oe?y2({zoomPanValues:u,noWheelClassName:$,d3Selection:p,d3Zoom:h,panOnScrollMode:L,panOnScrollSpeed:k,zoomOnPinch:B,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:s}):x2({noWheelClassName:$,preventScrolling:F,d3ZoomHandler:x});p.on("wheel.zoom",ne,{passive:!1});const re=w2({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:l});h.on("start",re);const ce=v2({zoomPanValues:u,panOnDrag:M,onPaneContextMenu:!!A,onPanZoom:o,onTransformChange:te});h.on("zoom",ce);const de=k2({zoomPanValues:u,panOnDrag:M,panOnScroll:R,onPaneContextMenu:A,onPanZoomEnd:s,onDraggingChange:a});h.on("end",de);const me=E2({zoomActivationKeyPressed:K,panOnDrag:M,zoomOnScroll:I,panOnScroll:R,zoomOnDoubleClick:G,zoomOnPinch:B,userSelectionActive:O,noPanClassName:_,noWheelClassName:$,lib:q,connectionInProgress:V});h.filter(me),G?p.on("dblclick.zoom",w):p.on("dblclick.zoom",null)}function g(){h.on("zoom",null)}async function v($,_,A){const O=eu($),R=h==null?void 0:h.constrain()(O,_,A);return R&&await m(R),R}async function C($,_){const A=eu($);return await m(A,_),A}function E($){if(p){const _=eu($),A=p.property("__zoom");(A.k!==$.zoom||A.x!==$.x||A.y!==$.y)&&(h==null||h.transform(p,_,null,{sync:!0}))}}function S(){const $=p?xx(p.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}async function P($,_){return p?new Promise(A=>{h==null||h.interpolate((_==null?void 0:_.interpolate)==="linear"?no:Hl).scaleTo(tu(p,_==null?void 0:_.duration,_==null?void 0:_.ease,()=>A(!0)),$)}):!1}async function z($,_){return p?new Promise(A=>{h==null||h.interpolate((_==null?void 0:_.interpolate)==="linear"?no:Hl).scaleBy(tu(p,_==null?void 0:_.duration,_==null?void 0:_.ease,()=>A(!0)),$)}):!1}function N($){h==null||h.scaleExtent($)}function T($){h==null||h.translateExtent($)}function j($){const _=!Wt($)||$<0?0:$;h==null||h.clickDistance(_)}return{update:y,destroy:g,setViewport:C,setViewportConstrained:v,getViewport:S,scaleTo:P,scaleBy:z,setScaleExtent:N,setTranslateExtent:T,syncViewport:E,setClickDistance:j}}var Tr;(function(e){e.Line="line",e.Handle="handle"})(Tr||(Tr={}));const _2=["top-left","top-right","bottom-left","bottom-right"],b2=["top","right","bottom","left"];function C2({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:o}){const l=e-t,s=n-r,a=[l>0?1:l<0?-1:0,s>0?1:s<0?-1:0];return l&&i&&(a[0]=a[0]*-1),s&&o&&(a[1]=a[1]*-1),a}function zp(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Ln(e,t){return Math.max(0,t-e)}function An(e,t){return Math.max(0,e-t)}function kl(e,t,n){return Math.max(0,t-e,e-n)}function Op(e,t){return e?!t:t}function N2(e,t,n,r,i,o,l,s){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:f}=t,d=c&&f,{xSnapped:h,ySnapped:p}=n,{minWidth:x,maxWidth:w,minHeight:m,maxHeight:y}=r,{x:g,y:v,width:C,height:E,aspectRatio:S}=e;let P=Math.floor(c?h-e.pointerX:0),z=Math.floor(f?p-e.pointerY:0);const N=C+(a?-P:P),T=E+(u?-z:z),j=-o[0]*C,$=-o[1]*E;let _=kl(N,x,w),A=kl(T,m,y);if(l){let M=0,L=0;a&&P<0?M=Ln(g+P+j,l[0][0]):!a&&P>0&&(M=An(g+N+j,l[1][0])),u&&z<0?L=Ln(v+z+$,l[0][1]):!u&&z>0&&(L=An(v+T+$,l[1][1])),_=Math.max(_,M),A=Math.max(A,L)}if(s){let M=0,L=0;a&&P>0?M=An(g+P,s[0][0]):!a&&P<0&&(M=Ln(g+N,s[1][0])),u&&z>0?L=An(v+z,s[0][1]):!u&&z<0&&(L=Ln(v+T,s[1][1])),_=Math.max(_,M),A=Math.max(A,L)}if(i){if(c){const M=kl(N/S,m,y)*S;if(_=Math.max(_,M),l){let L=0;!a&&!u||a&&!u&&d?L=An(v+$+N/S,l[1][1])*S:L=Ln(v+$+(a?P:-P)/S,l[0][1])*S,_=Math.max(_,L)}if(s){let L=0;!a&&!u||a&&!u&&d?L=Ln(v+N/S,s[1][1])*S:L=An(v+(a?P:-P)/S,s[0][1])*S,_=Math.max(_,L)}}if(f){const M=kl(T*S,x,w)/S;if(A=Math.max(A,M),l){let L=0;!a&&!u||u&&!a&&d?L=An(g+T*S+j,l[1][0])/S:L=Ln(g+(u?z:-z)*S+j,l[0][0])/S,A=Math.max(A,L)}if(s){let L=0;!a&&!u||u&&!a&&d?L=Ln(g+T*S,s[1][0])/S:L=An(g+(u?z:-z)*S,s[0][0])/S,A=Math.max(A,L)}}}z=z+(z<0?A:-A),P=P+(P<0?_:-_),i&&(d?N>T*S?z=(Op(a,u)?-P:P)/S:P=(Op(a,u)?-z:z)*S:c?(z=P/S,u=a):(P=z*S,a=u));const O=a?g+P:g,R=u?v+z:v;return{width:C+(a?-P:P),height:E+(u?-z:z),x:o[0]*P*(a?-1:1)+O,y:o[1]*z*(u?-1:1)+R}}const Qx={width:0,height:0,x:0,y:0},I2={...Qx,pointerX:0,pointerY:0,aspectRatio:1};function P2(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,o=e.measured.width??0,l=e.measured.height??0,s=n[0]*o,a=n[1]*l;return[[r-s,i-a],[r+o-s,i+l-a]]}function M2({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const o=kt(e);let l={controlDirection:zp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:u,boundaries:c,keepAspectRatio:f,resizeDirection:d,onResizeStart:h,onResize:p,onResizeEnd:x,shouldResize:w}){let m={...Qx},y={...I2};l={boundaries:c,resizeDirection:d,keepAspectRatio:f,controlDirection:zp(u)};let g,v=null,C=[],E,S,P,z=!1;const N=ix().on("start",T=>{const{nodeLookup:j,transform:$,snapGrid:_,snapToGrid:A,nodeOrigin:O,paneDomNode:R}=n();if(g=j.get(t),!g)return;v=(R==null?void 0:R.getBoundingClientRect())??null;const{xSnapped:M,ySnapped:L}=ro(T.sourceEvent,{transform:$,snapGrid:_,snapToGrid:A,containerBounds:v});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},y={...m,pointerX:M,pointerY:L,aspectRatio:m.width/m.height},E=void 0,S=Pr(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(E=j.get(g.parentId)),E&&g.extent==="parent"&&(S=[[0,0],[E.measured.width,E.measured.height]]),C=[],P=void 0;for(const[k,F]of j)if(F.parentId===t&&(C.push({id:k,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){const B=P2(F,g,F.origin??O);P?P=[[Math.min(B[0][0],P[0][0]),Math.min(B[0][1],P[0][1])],[Math.max(B[1][0],P[1][0]),Math.max(B[1][1],P[1][1])]]:P=B}h==null||h(T,{...m})}).on("drag",T=>{const{transform:j,snapGrid:$,snapToGrid:_,nodeOrigin:A}=n(),O=ro(T.sourceEvent,{transform:j,snapGrid:$,snapToGrid:_,containerBounds:v}),R=[];if(!g)return;const{x:M,y:L,width:k,height:F}=m,B={},I=g.origin??A,{width:G,height:K,x:q,y:te}=N2(y,l.controlDirection,O,l.boundaries,l.keepAspectRatio,I,S,P),V=G!==k,Q=K!==F,Z=q!==M&&V,oe=te!==L&&Q;if(!Z&&!oe&&!V&&!Q)return;if((Z||oe||I[0]===1||I[1]===1)&&(B.x=Z?q:m.x,B.y=oe?te:m.y,m.x=B.x,m.y=B.y,C.length>0)){const de=q-M,me=te-L;for(const _e of C)_e.position={x:_e.position.x-de+I[0]*(G-k),y:_e.position.y-me+I[1]*(K-F)},R.push(_e)}if((V||Q)&&(B.width=V&&(!l.resizeDirection||l.resizeDirection==="horizontal")?G:m.width,B.height=Q&&(!l.resizeDirection||l.resizeDirection==="vertical")?K:m.height,m.width=B.width,m.height=B.height),E&&g.expandParent){const de=I[0]*(B.width??0);B.x&&B.x<de&&(m.x=de,y.x=y.x-(B.x-de));const me=I[1]*(B.height??0);B.y&&B.y<me&&(m.y=me,y.y=y.y-(B.y-me))}const ne=C2({width:m.width,prevWidth:k,height:m.height,prevHeight:F,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),re={...m,direction:ne};(w==null?void 0:w(T,re))!==!1&&(z=!0,p==null||p(T,re),r(B,R))}).on("end",T=>{z&&(x==null||x(T,{...m}),i==null||i({...m}),z=!1)});o.call(N)}function a(){o.on(".drag",null)}return{update:s,destroy:a}}var qx={exports:{}},Kx={},Zx={exports:{}},Jx={};/**
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 vi=D;function T2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var L2=typeof Object.is=="function"?Object.is:T2,A2=vi.useState,z2=vi.useEffect,O2=vi.useLayoutEffect,D2=vi.useDebugValue;function R2(e,t){var n=t(),r=A2({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return O2(function(){i.value=n,i.getSnapshot=t,nu(i)&&o({inst:i})},[e,n,t]),z2(function(){return nu(i)&&o({inst:i}),e(function(){nu(i)&&o({inst:i})})},[e]),D2(n),n}function nu(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!L2(e,n)}catch{return!0}}function j2(e,t){return t()}var $2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?j2:R2;Jx.useSyncExternalStore=vi.useSyncExternalStore!==void 0?vi.useSyncExternalStore:$2;Zx.exports=Jx;var F2=Zx.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 ua=D,B2=F2;function H2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var V2=typeof Object.is=="function"?Object.is:H2,U2=B2.useSyncExternalStore,W2=ua.useRef,Y2=ua.useEffect,X2=ua.useMemo,G2=ua.useDebugValue;Kx.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=W2(null);if(o.current===null){var l={hasValue:!1,value:null};o.current=l}else l=o.current;o=X2(function(){function a(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&l.hasValue){var p=l.value;if(i(p,h))return f=p}return f=h}if(p=f,V2(c,h))return p;var x=r(h);return i!==void 0&&i(p,x)?(c=h,p):(c=h,f=x)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,i]);var s=U2(e,o[0],o[1]);return Y2(function(){l.hasValue=!0,l.value=s},[s]),G2(s),s};qx.exports=Kx;var Q2=qx.exports;const q2=Do(Q2),K2={},Dp=e=>{let t;const n=new Set,r=(c,f)=>{const d=typeof c=="function"?c(t):c;if(!Object.is(d,t)){const h=t;t=f??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(K2?"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()}},u=t=e(r,i,a);return a},Z2=e=>e?Dp(e):Dp,{useDebugValue:J2}=Bk,{useSyncExternalStoreWithSelector:eI}=q2,tI=e=>e;function ew(e,t=tI,n){const r=eI(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return J2(r),r}const Rp=(e,t)=>{const n=Z2(e),r=(i,o=t)=>ew(n,i,o);return Object.assign(r,n),r},nI=(e,t)=>e?Rp(e,t):Rp;function Oe(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const ca=D.createContext(null),rI=ca.Provider,tw=Kt.error001("react");function ve(e,t){const n=D.useContext(ca);if(n===null)throw new Error(tw);return ew(n,e,t)}function Me(){const e=D.useContext(ca);if(e===null)throw new Error(tw);return D.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const jp={display:"none"},iI={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},nw="react-flow__node-desc",rw="react-flow__edge-desc",oI="react-flow__aria-live",lI=e=>e.ariaLiveMessage,sI=e=>e.ariaLabelConfig;function aI({rfId:e}){const t=ve(lI);return b.jsx("div",{id:`${oI}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:iI,children:t})}function uI({rfId:e,disableKeyboardA11y:t}){const n=ve(sI);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${nw}-${e}`,style:jp,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${rw}-${e}`,style:jp,children:n["edge.a11yDescription.default"]}),!t&&b.jsx(aI,{rfId:e})]})}const fa=D.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},o)=>{const l=`${e}`.split("-");return b.jsx("div",{className:He(["react-flow__panel",n,...l]),style:r,ref:o,...i,children:t})});fa.displayName="Panel";const $p="https://reactflow.dev?utm_source=attribution";function cI({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:b.jsx(fa,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${$p}`,children:b.jsx("a",{href:$p,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const fI=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},El=e=>e.id;function dI(e,t){return Oe(e.selectedNodes.map(El),t.selectedNodes.map(El))&&Oe(e.selectedEdges.map(El),t.selectedEdges.map(El))}function hI({onSelectionChange:e}){const t=Me(),{selectedNodes:n,selectedEdges:r}=ve(fI,dI);return D.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(o=>o(i))},[n,r,e]),null}const pI=e=>!!e.onSelectionChangeHandlers;function mI({onSelectionChange:e}){const t=ve(pI);return e||t?b.jsx(hI,{onSelectionChange:e}):null}const iw=[0,0],gI={x:0,y:0,zoom:1},yI=["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"],Fp=[...yI,"rfId"],xI=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Bp={translateExtent:Po,nodeOrigin:iw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function wI(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:o,setNodeExtent:l,reset:s,setDefaultNodesAndEdges:a}=ve(xI,Oe),u=Me();D.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Bp,s()}),[]);const c=D.useRef(Bp);return D.useEffect(()=>{for(const f of Fp){const d=e[f],h=c.current[f];d!==h&&(typeof e[f]>"u"||(f==="nodes"?t(d):f==="edges"?n(d):f==="minZoom"?r(d):f==="maxZoom"?i(d):f==="translateExtent"?o(d):f==="nodeExtent"?l(d):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:BN(d)}):f==="fitView"?u.setState({fitViewQueued:d}):f==="fitViewOptions"?u.setState({fitViewOptions:d}):u.setState({[f]:d})))}c.current=e},Fp.map(f=>e[f])),null}function Hp(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function vI(e){var r;const[t,n]=D.useState(e==="system"?null:e);return D.useEffect(()=>{if(e!=="system"){n(e);return}const i=Hp(),o=()=>n(i!=null&&i.matches?"dark":"light");return o(),i==null||i.addEventListener("change",o),()=>{i==null||i.removeEventListener("change",o)}},[e]),t!==null?t:(r=Hp())!=null&&r.matches?"dark":"light"}const Vp=typeof document<"u"?document:null;function Ao(e=null,t={target:Vp,actInsideInputWithModifier:!0}){const[n,r]=D.useState(!1),i=D.useRef(!1),o=D.useRef(new Set([])),[l,s]=D.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
57
- `).replace(`
58
-
59
- `,`
60
- +`).split(`
61
- `)),c=u.reduce((f,d)=>f.concat(...d),[]);return[u,c]}return[[],[]]},[e]);return D.useEffect(()=>{const a=(t==null?void 0:t.target)??Vp,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=h=>{var w,m;if(i.current=h.ctrlKey||h.metaKey||h.shiftKey||h.altKey,(!i.current||i.current&&!u)&&Ax(h))return!1;const x=Wp(h.code,s);if(o.current.add(h[x]),Up(l,o.current,!1)){const y=((m=(w=h.composedPath)==null?void 0:w.call(h))==null?void 0:m[0])||h.target,g=(y==null?void 0:y.nodeName)==="BUTTON"||(y==null?void 0:y.nodeName)==="A";t.preventDefault!==!1&&(i.current||!g)&&h.preventDefault(),r(!0)}},f=h=>{const p=Wp(h.code,s);Up(l,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[p]),h.key==="Meta"&&o.current.clear(),i.current=!1},d=()=>{o.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",f),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",f),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,r]),n}function Up(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Wp(e,t){return t.includes(e)?"code":"key"}const kI=()=>{const e=Me();return D.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,o],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??o},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:o,maxZoom:l,panZoom:s}=e.getState(),a=rd(t,r,i,o,l,(n==null?void 0:n.padding)??.1);return s?(await s.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:o,domNode:l}=e.getState();if(!l)return t;const{x:s,y:a}=l.getBoundingClientRect(),u={x:t.x-s,y:t.y-a},c=n.snapGrid??i,f=n.snapToGrid??o;return Xo(u,r,f,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:o}=r.getBoundingClientRect(),l=wi(t,n);return{x:l.x+i,y:l.y+o}}}),[])};function ow(e,t){const n=[],r=new Map,i=[];for(const o of e)if(o.type==="add"){i.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const l=r.get(o.id);l?l.push(o):r.set(o.id,[o])}for(const o of t){const l=r.get(o.id);if(!l){n.push(o);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const s={...o};for(const a of l)EI(a,s);n.push(s)}return i.length&&i.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function EI(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function cd(e,t){return ow(e,t)}function lw(e,t){return ow(e,t)}function ur(e,t){return{id:e,type:"select",selected:t}}function Jr(e,t=new Set,n=!1){const r=[];for(const[i,o]of e){const l=t.has(i);!(o.selected===void 0&&!l)&&o.selected!==l&&(n&&(o.selected=l),r.push(ur(o.id,l)))}return r}function Yp({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const s=t.get(l.id),a=((i=s==null?void 0:s.internals)==null?void 0:i.userNode)??s;a!==void 0&&a!==l&&n.push({id:l.id,item:l,type:"replace"}),a===void 0&&n.push({item:l,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function Xp(e){return{id:e.id,type:"remove"}}const SI=Px();function _I(e,t,n={}){return XN(e,t,{...n,onError:n.onError??SI})}const Gp=e=>LN(e),bI=e=>_x(e);function sw(e){return D.forwardRef(e)}const aw=typeof window<"u"?D.useLayoutEffect:D.useEffect;function Qp(e){const[t,n]=D.useState(BigInt(0)),[r]=D.useState(()=>CI(()=>n(i=>i+BigInt(1))));return aw(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function CI(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const uw=D.createContext(null);function NI({children:e}){const t=Me(),n=D.useCallback(s=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:f,nodeLookup:d,fitViewQueued:h,onNodesChangeMiddlewareMap:p}=t.getState();let x=a;for(const m of s)x=typeof m=="function"?m(x):m;let w=Yp({items:x,lookup:d});for(const m of p.values())w=m(w);c&&u(x),w.length>0?f==null||f(w):h&&window.requestAnimationFrame(()=>{const{fitViewQueued:m,nodes:y,setNodes:g}=t.getState();m&&g(y)})},[]),r=Qp(n),i=D.useCallback(s=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:f,edgeLookup:d}=t.getState();let h=a;for(const p of s)h=typeof p=="function"?p(h):p;c?u(h):f&&f(Yp({items:h,lookup:d}))},[]),o=Qp(i),l=D.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return b.jsx(uw.Provider,{value:l,children:e})}function II(){const e=D.useContext(uw);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const PI=e=>!!e.panZoom;function fd(){const e=kI(),t=Me(),n=II(),r=ve(PI),i=D.useMemo(()=>{const o=f=>t.getState().nodeLookup.get(f),l=f=>{n.nodeQueue.push(f)},s=f=>{n.edgeQueue.push(f)},a=f=>{var m,y;const{nodeLookup:d,nodeOrigin:h}=t.getState(),p=Gp(f)?f:d.get(f.id),x=p.parentId?Tx(p.position,p.measured,p.parentId,d,h):p.position,w={...p,position:x,width:((m=p.measured)==null?void 0:m.width)??p.width,height:((y=p.measured)==null?void 0:y.height)??p.height};return To(w)},u=(f,d,h={replace:!1})=>{l(p=>p.map(x=>{if(x.id===f){const w=typeof d=="function"?d(x):d;return h.replace&&Gp(w)?w:{...x,...w}}return x}))},c=(f,d,h={replace:!1})=>{s(p=>p.map(x=>{if(x.id===f){const w=typeof d=="function"?d(x):d;return h.replace&&bI(w)?w:{...x,...w}}return x}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var d;return(d=o(f))==null?void 0:d.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(d=>({...d}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:l,setEdges:s,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}=t.getState(),[p,x,w]=h;return{nodes:f.map(m=>({...m})),edges:d.map(m=>({...m})),viewport:{x:p,y:x,zoom:w}}},deleteElements:async({nodes:f=[],edges:d=[]})=>{const{nodes:h,edges:p,onNodesDelete:x,onEdgesDelete:w,triggerNodeChanges:m,triggerEdgeChanges:y,onDelete:g,onBeforeDelete:v}=t.getState(),{nodes:C,edges:E}=await RN({nodesToRemove:f,edgesToRemove:d,nodes:h,edges:p,onBeforeDelete:v}),S=E.length>0,P=C.length>0;if(S){const z=E.map(Xp);w==null||w(E),y(z)}if(P){const z=C.map(Xp);x==null||x(C),m(z)}return(P||S)&&(g==null||g({nodes:C,edges:E})),{deletedNodes:C,deletedEdges:E}},getIntersectingNodes:(f,d=!0,h)=>{const p=Sp(f),x=p?f:a(f),w=h!==void 0;return x?(h||t.getState().nodes).filter(m=>{const y=t.getState().nodeLookup.get(m.id);if(y&&!p&&(m.id===f.id||!y.internals.positionAbsolute))return!1;const g=To(w?m:y),v=Ts(g,x);return d&&v>0||v>=g.width*g.height||v>=x.width*x.height}):[]},isNodeIntersecting:(f,d,h=!0)=>{const x=Sp(f)?f:a(f);if(!x)return!1;const w=Ts(x,d);return h&&w>0||w>=d.width*d.height||w>=x.width*x.height},updateNode:u,updateNodeData:(f,d,h={replace:!1})=>{u(f,p=>{const x=typeof d=="function"?d(p):d;return h.replace?{...p,data:x}:{...p,data:{...p.data,...x}}},h)},updateEdge:c,updateEdgeData:(f,d,h={replace:!1})=>{c(f,p=>{const x=typeof d=="function"?d(p):d;return h.replace?{...p,data:x}:{...p,data:{...p.data,...x}}},h)},getNodesBounds:f=>{const{nodeLookup:d,nodeOrigin:h}=t.getState();return AN(f,{nodeLookup:d,nodeOrigin:h})},getHandleConnections:({type:f,id:d,nodeId:h})=>{var p;return Array.from(((p=t.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=t.getState().connectionLookup.get(`${h}${f?d?`-${f}-${d}`:`-${f}`:""}`))==null?void 0:p.values())??[])},fitView:async f=>{const d=t.getState().fitViewResolver??FN();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:d}),n.nodeQueue.push(h=>[...h]),d.promise}}},[]);return D.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const qp=e=>e.selected,MI=typeof window<"u"?window:void 0;function TI({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Me(),{deleteElements:r}=fd(),i=Ao(e,{actInsideInputWithModifier:!1}),o=Ao(t,{target:MI});D.useEffect(()=>{if(i){const{edges:l,nodes:s}=n.getState();r({nodes:s.filter(qp),edges:l.filter(qp)}),n.setState({nodesSelectionActive:!1})}},[i]),D.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function LI(e){const t=Me();D.useEffect(()=>{const n=()=>{var i,o,l,s;if(!e.current||!(((o=(i=e.current).checkVisibility)==null?void 0:o.call(i))??!0))return!1;const r=id(e.current);(r.height===0||r.width===0)&&((s=(l=t.getState()).onError)==null||s.call(l,"004",Kt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const da={position:"absolute",width:"100%",height:"100%",top:0,left:0},AI=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function zI({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:o=wr.Free,zoomOnDoubleClick:l=!0,panOnDrag:s=!0,defaultViewport:a,translateExtent:u,minZoom:c,maxZoom:f,zoomActivationKeyCode:d,preventScrolling:h=!0,children:p,noWheelClassName:x,noPanClassName:w,onViewportChange:m,isControlledViewport:y,paneClickDistance:g,selectionOnDrag:v}){const C=Me(),E=D.useRef(null),{userSelectionActive:S,lib:P,connectionInProgress:z}=ve(AI,Oe),N=Ao(d),T=D.useRef();LI(E);const j=D.useCallback($=>{m==null||m({x:$[0],y:$[1],zoom:$[2]}),y||C.setState({transform:$})},[m,y]);return D.useEffect(()=>{if(E.current){T.current=S2({domNode:E.current,minZoom:c,maxZoom:f,translateExtent:u,viewport:a,onDraggingChange:O=>C.setState(R=>R.paneDragging===O?R:{paneDragging:O}),onPanZoomStart:(O,R)=>{const{onViewportChangeStart:M,onMoveStart:L}=C.getState();L==null||L(O,R),M==null||M(R)},onPanZoom:(O,R)=>{const{onViewportChange:M,onMove:L}=C.getState();L==null||L(O,R),M==null||M(R)},onPanZoomEnd:(O,R)=>{const{onViewportChangeEnd:M,onMoveEnd:L}=C.getState();L==null||L(O,R),M==null||M(R)}});const{x:$,y:_,zoom:A}=T.current.getViewport();return C.setState({panZoom:T.current,transform:[$,_,A],domNode:E.current.closest(".react-flow")}),()=>{var O;(O=T.current)==null||O.destroy()}}},[]),D.useEffect(()=>{var $;($=T.current)==null||$.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:o,zoomOnDoubleClick:l,panOnDrag:s,zoomActivationKeyPressed:N,preventScrolling:h,noPanClassName:w,userSelectionActive:S,noWheelClassName:x,lib:P,onTransformChange:j,connectionInProgress:z,selectionOnDrag:v,paneClickDistance:g})},[e,t,n,r,i,o,l,s,N,h,w,S,x,P,j,z,v,g]),b.jsx("div",{className:"react-flow__renderer",ref:E,style:da,children:p})}const OI=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function DI(){const{userSelectionActive:e,userSelectionRect:t}=ve(OI,Oe);return e&&t?b.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const ru=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},RI=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function jI({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Mo.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:o,selectionOnDrag:l,onSelectionStart:s,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:f,onPaneMouseEnter:d,onPaneMouseMove:h,onPaneMouseLeave:p,children:x}){const w=D.useRef(0),m=Me(),{userSelectionActive:y,elementsSelectable:g,dragging:v,panBy:C,autoPanSpeed:E}=ve(RI,Oe),S=g&&(e||y),P=D.useRef(null),z=D.useRef(),N=D.useRef(new Set),T=D.useRef(new Set),j=D.useRef(!1),$=D.useRef(!1),_=D.useRef({x:0,y:0}),A=D.useRef(!1),O=V=>{if($.current||j.current||m.getState().connection.inProgress){$.current=!1,j.current=!1;return}u==null||u(V),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},R=V=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){V.preventDefault();return}c==null||c(V)},M=f?V=>f(V):void 0,L=V=>{$.current&&(V.stopPropagation(),$.current=!1)},k=V=>{var _e,Xe;const{domNode:Q,transform:Z}=m.getState();if(z.current=Q==null?void 0:Q.getBoundingClientRect(),!z.current)return;const oe=V.target===P.current;if(!oe&&!!V.target.closest(".nokey")||!e||!(l&&oe||t)||V.button!==0||!V.isPrimary)return;(Xe=(_e=V.target)==null?void 0:_e.setPointerCapture)==null||Xe.call(_e,V.pointerId),$.current=!1;const{x:ce,y:de}=Yt(V.nativeEvent,z.current),me=Xo({x:ce,y:de},Z);m.setState({userSelectionRect:{width:0,height:0,startX:me.x,startY:me.y,x:ce,y:de}}),oe||(V.stopPropagation(),V.preventDefault())};function F(V,Q){const{userSelectionRect:Z}=m.getState();if(!Z)return;const{transform:oe,nodeLookup:ne,edgeLookup:re,connectionLookup:ce,triggerNodeChanges:de,triggerEdgeChanges:me,defaultEdgeOptions:_e}=m.getState(),Xe={x:Z.startX,y:Z.startY},{x:Ke,y:U}=wi(Xe,oe),ee={startX:Xe.x,startY:Xe.y,x:V<Ke?V:Ke,y:Q<U?Q:U,width:Math.abs(V-Ke),height:Math.abs(Q-U)},ge=N.current,se=T.current;N.current=new Set(td(ne,ee,oe,n===Mo.Partial,!0).map(ye=>ye.id)),T.current=new Set;const Ee=(_e==null?void 0:_e.selectable)??!0;for(const ye of N.current){const H=ce.get(ye);if(H)for(const{edgeId:Y}of H.values()){const le=re.get(Y);le&&(le.selectable??Ee)&&T.current.add(Y)}}if(!_p(ge,N.current)){const ye=Jr(ne,N.current,!0);de(ye)}if(!_p(se,T.current)){const ye=Jr(re,T.current);me(ye)}m.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})}function B(){if(!i||!z.current)return;const[V,Q]=nd(_.current,z.current,E);C({x:V,y:Q}).then(Z=>{if(!$.current||!Z){w.current=requestAnimationFrame(B);return}const{x:oe,y:ne}=_.current;F(oe,ne),w.current=requestAnimationFrame(B)})}const I=()=>{cancelAnimationFrame(w.current),w.current=0,A.current=!1};D.useEffect(()=>()=>I(),[]);const G=V=>{const{userSelectionRect:Q,transform:Z,resetSelectedElements:oe}=m.getState();if(!z.current||!Q)return;const{x:ne,y:re}=Yt(V.nativeEvent,z.current);_.current={x:ne,y:re};const ce=wi({x:Q.startX,y:Q.startY},Z);if(!$.current){const de=t?0:o;if(Math.hypot(ne-ce.x,re-ce.y)<=de)return;oe(),s==null||s(V)}$.current=!0,A.current||(B(),A.current=!0),F(ne,re)},K=V=>{var Q,Z;if(!S){V.target===P.current&&m.getState().connection.inProgress&&(j.current=!0);return}V.button===0&&((Z=(Q=V.target)==null?void 0:Q.releasePointerCapture)==null||Z.call(Q,V.pointerId),!y&&V.target===P.current&&m.getState().userSelectionRect&&(O==null||O(V)),m.setState({userSelectionActive:!1,userSelectionRect:null}),$.current&&(a==null||a(V),m.setState({nodesSelectionActive:N.current.size>0})),I())},q=V=>{var Q,Z;(Z=(Q=V.target)==null?void 0:Q.releasePointerCapture)==null||Z.call(Q,V.pointerId),I()},te=r===!0||Array.isArray(r)&&r.includes(0);return b.jsxs("div",{className:He(["react-flow__pane",{draggable:te,dragging:v,selection:e}]),onClick:S?void 0:ru(O,P),onContextMenu:ru(R,P),onWheel:ru(M,P),onPointerEnter:S?void 0:d,onPointerMove:S?G:h,onPointerUp:K,onPointerCancel:S?q:void 0,onPointerDownCapture:S?k:void 0,onClickCapture:S?L:void 0,onPointerLeave:p,ref:P,style:da,children:[x,b.jsx(DI,{})]})}function Oc({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:l,nodeLookup:s,onError:a}=t.getState(),u=s.get(e);if(!u){a==null||a("012",Kt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&l)&&(o({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function cw({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,nodeClickDistance:l}){const s=Me(),[a,u]=D.useState(!1),c=D.useRef();return D.useEffect(()=>{if(!t)return c.current=u2({getStoreItems:()=>s.getState(),onNodeMouseDown:f=>{Oc({id:f,store:s,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var f;(f=c.current)==null||f.destroy(),c.current=void 0}},[t,s,e]),D.useEffect(()=>{t||!e.current||!c.current||c.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:i,nodeClickDistance:l})},[n,r,t,o,e,i,l]),a}const $I=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function fw(){const e=Me();return D.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:o,nodesDraggable:l,onError:s,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),f=new Map,d=$I(l),h=i?o[0]:5,p=i?o[1]:5,x=n.direction.x*h*n.factor,w=n.direction.y*p*n.factor;for(const[,m]of u){if(!d(m))continue;let y={x:m.internals.positionAbsolute.x+x,y:m.internals.positionAbsolute.y+w};i&&(y=Yo(y,o));const{position:g,positionAbsolute:v}=bx({nodeId:m.id,nextPosition:y,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:s});m.position=g,m.internals.positionAbsolute=v,f.set(m.id,m)}a(f)},[])}const dd=D.createContext(null),FI=dd.Provider;dd.Consumer;const dw=()=>D.useContext(dd),BI=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),hw=D.createContext(null);function HI({children:e}){const t=ve(BI,Oe);return b.jsx(hw.Provider,{value:t,children:e})}function VI(){const e=D.useContext(hw);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const UI={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},WI=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:o,connection:l}=r,{fromHandle:s,toHandle:a,isValid:u}=l;if(!s&&!i)return UI;const c=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,connectingTo:c,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:o===yi.Strict?(s==null?void 0:s.type)!==n:e!==(s==null?void 0:s.nodeId)||t!==(s==null?void 0:s.id),connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:c&&u}};function YI({type:e="source",position:t=ie.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:l,onConnect:s,children:a,className:u,onMouseDown:c,onTouchStart:f,...d},h){var A,O;const p=l||null,x=e==="target",w=Me(),m=dw(),{connectOnClick:y,noPanClassName:g,rfId:v}=VI(),{connectingFrom:C,connectingTo:E,clickConnecting:S,isPossibleEndHandle:P,connectionInProcess:z,clickConnectionInProcess:N,valid:T}=ve(WI(m,p,e),Oe);m||(O=(A=w.getState()).onError)==null||O.call(A,"010",Kt.error010());const j=R=>{const{defaultEdgeOptions:M,onConnect:L,hasDefaultEdges:k}=w.getState(),F={...M,...R};if(k){const{edges:B,setEdges:I,onError:G}=w.getState();I(_I(F,B,{onError:G}))}L==null||L(F),s==null||s(F)},$=R=>{if(!m)return;const M=zx(R.nativeEvent);if(i&&(M&&R.button===0||!M)){const L=w.getState();zc.onPointerDown(R.nativeEvent,{handleDomNode:R.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:x,handleId:p,nodeId:m,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...k)=>{var F,B;return(B=(F=w.getState()).onConnectEnd)==null?void 0:B.call(F,...k)},updateConnection:L.updateConnection,onConnect:j,isValidConnection:n||((...k)=>{var F,B;return((B=(F=w.getState()).isValidConnection)==null?void 0:B.call(F,...k))??!0}),getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}M?c==null||c(R):f==null||f(R)},_=R=>{const{onClickConnectStart:M,onClickConnectEnd:L,connectionClickStartHandle:k,connectionMode:F,isValidConnection:B,lib:I,rfId:G,nodeLookup:K,connection:q}=w.getState();if(!m||!k&&!i)return;if(!k){M==null||M(R.nativeEvent,{nodeId:m,handleId:p,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:m,type:e,id:p}});return}const te=Lx(R.target),V=n||B,{connection:Q,isValid:Z}=zc.isValid(R.nativeEvent,{handle:{nodeId:m,id:p,type:e},connectionMode:F,fromNodeId:k.nodeId,fromHandleId:k.id||null,fromType:k.type,isValidConnection:V,flowId:G,doc:te,lib:I,nodeLookup:K});Z&&Q&&j(Q);const oe=structuredClone(q);delete oe.inProgress,oe.toPosition=oe.toHandle?oe.toHandle.position:null,L==null||L(R,oe),w.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":p,"data-nodeid":m,"data-handlepos":t,"data-id":`${v}-${m}-${p}-${e}`,className:He(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!x,target:x,connectable:r,connectablestart:i,connectableend:o,clickconnecting:S,connectingfrom:C,connectingto:E,valid:T,connectionindicator:r&&(!z||P)&&(z||N?o:i)}]),onMouseDown:$,onTouchStart:$,onClick:y?_:void 0,ref:h,...d,children:a})}const Nn=D.memo(sw(YI));function XI({data:e,isConnectable:t,sourcePosition:n=ie.Bottom}){return b.jsxs(b.Fragment,{children:[e==null?void 0:e.label,b.jsx(Nn,{type:"source",position:n,isConnectable:t})]})}function GI({data:e,isConnectable:t,targetPosition:n=ie.Top,sourcePosition:r=ie.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(Nn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,b.jsx(Nn,{type:"source",position:r,isConnectable:t})]})}function QI(){return null}function qI({data:e,isConnectable:t,targetPosition:n=ie.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(Nn,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ls={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Kp={input:XI,default:GI,output:qI,group:QI};function KI(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const ZI=e=>{const{width:t,height:n,x:r,y:i}=Wo(e.nodeLookup,{filter:o=>!!o.selected});return{width:Wt(t)?t:null,height:Wt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function JI({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Me(),{width:i,height:o,transformString:l,userSelectionActive:s}=ve(ZI,Oe),a=fw(),u=D.useRef(null);D.useEffect(()=>{var h;n||(h=u.current)==null||h.focus({preventScroll:!0})},[n]);const c=!s&&i!==null&&o!==null;if(cw({nodeRef:u,disabled:!c}),!c)return null;const f=e?h=>{const p=r.getState().nodes.filter(x=>x.selected);e(h,p)}:void 0,d=h=>{Object.prototype.hasOwnProperty.call(Ls,h.key)&&(h.preventDefault(),a({direction:Ls[h.key],factor:h.shiftKey?4:1}))};return b.jsx("div",{className:He(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:b.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:i,height:o}})})}const Zp=typeof window<"u"?window:void 0,eP=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function pw({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:l,paneClickDistance:s,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:f,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:x,zoomActivationKeyCode:w,elementsSelectable:m,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:v,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:P,autoPanOnSelection:z,defaultViewport:N,translateExtent:T,minZoom:j,maxZoom:$,preventScrolling:_,onSelectionContextMenu:A,noWheelClassName:O,noPanClassName:R,disableKeyboardA11y:M,onViewportChange:L,isControlledViewport:k}){const{nodesSelectionActive:F,userSelectionActive:B}=ve(eP,Oe),I=Ao(u,{target:Zp}),G=Ao(x,{target:Zp}),K=G||P,q=G||v,te=c&&K!==!0,V=I||B||te;return TI({deleteKeyCode:a,multiSelectionKeyCode:p}),b.jsx(zI,{onPaneContextMenu:o,elementsSelectable:m,zoomOnScroll:y,zoomOnPinch:g,panOnScroll:q,panOnScrollSpeed:C,panOnScrollMode:E,zoomOnDoubleClick:S,panOnDrag:!I&&K,defaultViewport:N,translateExtent:T,minZoom:j,maxZoom:$,zoomActivationKeyCode:w,preventScrolling:_,noWheelClassName:O,noPanClassName:R,onViewportChange:L,isControlledViewport:k,paneClickDistance:s,selectionOnDrag:te,children:b.jsxs(jI,{onSelectionStart:d,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:l,panOnDrag:K,autoPanOnSelection:z,isSelecting:!!V,selectionMode:f,selectionKeyPressed:I,paneClickDistance:s,selectionOnDrag:te,children:[e,F&&b.jsx(JI,{onSelectionContextMenu:A,noPanClassName:R,disableKeyboardA11y:M})]})})}pw.displayName="FlowRenderer";const tP=D.memo(pw),nP=e=>t=>e?td(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function rP(e){return ve(D.useCallback(nP(e),[e]),Oe)}const iP=e=>e.updateNodeInternals;function oP(){const e=ve(iP),[t]=D.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const o=i.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:i.target,force:!0})}),e(r)}));return D.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function lP({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Me(),o=D.useRef(null),l=D.useRef(null),s=D.useRef(e.sourcePosition),a=D.useRef(e.targetPosition),u=D.useRef(t),c=n&&!!e.internals.handleBounds;return D.useEffect(()=>{o.current&&!e.hidden&&(!c||l.current!==o.current)&&(l.current&&(r==null||r.unobserve(l.current)),r==null||r.observe(o.current),l.current=o.current)},[c,e.hidden]),D.useEffect(()=>()=>{l.current&&(r==null||r.unobserve(l.current),l.current=null)},[]),D.useEffect(()=>{if(o.current){const f=u.current!==t,d=s.current!==e.sourcePosition,h=a.current!==e.targetPosition;(f||d||h)&&(u.current=t,s.current=e.sourcePosition,a.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function sP({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:o,onDoubleClick:l,nodesDraggable:s,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:f,noDragClassName:d,noPanClassName:h,disableKeyboardA11y:p,rfId:x,nodeTypes:w,nodeClickDistance:m,onError:y}){const{node:g,internals:v,isParent:C}=ve(V=>{const Q=V.nodeLookup.get(e),Z=V.parentLookup.has(e);return{node:Q,internals:Q.internals,isParent:Z}},Oe);let E=g.type||"default",S=(w==null?void 0:w[E])||Kp[E];S===void 0&&(y==null||y("003",Kt.error003(E)),E="default",S=(w==null?void 0:w.default)||Kp.default);const P=!!(g.draggable||s&&typeof g.draggable>"u"),z=!!(g.selectable||a&&typeof g.selectable>"u"),N=!!(g.connectable||u&&typeof g.connectable>"u"),T=!!(g.focusable||c&&typeof g.focusable>"u"),j=Me(),$=Mx(g),_=lP({node:g,nodeType:E,hasDimensions:$,resizeObserver:f}),A=cw({nodeRef:_,disabled:g.hidden||!P,noDragClassName:d,handleSelector:g.dragHandle,nodeId:e,isSelectable:z,nodeClickDistance:m}),O=fw();if(g.hidden)return null;const R=fn(g),M=KI(g),L=z||P||t||n||r||i,k=n?V=>n(V,{...v.userNode}):void 0,F=r?V=>r(V,{...v.userNode}):void 0,B=i?V=>i(V,{...v.userNode}):void 0,I=o?V=>o(V,{...v.userNode}):void 0,G=l?V=>l(V,{...v.userNode}):void 0,K=V=>{const{selectNodesOnDrag:Q,nodeDragThreshold:Z}=j.getState();z&&(!Q||!P||Z>0)&&Oc({id:e,store:j,nodeRef:_}),t&&t(V,{...v.userNode})},q=V=>{if(!(Ax(V.nativeEvent)||p)){if(vx.includes(V.key)&&z){const Q=V.key==="Escape";Oc({id:e,store:j,unselect:Q,nodeRef:_})}else if(P&&g.selected&&Object.prototype.hasOwnProperty.call(Ls,V.key)){V.preventDefault();const{ariaLabelConfig:Q}=j.getState();j.setState({ariaLiveMessage:Q["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~v.positionAbsolute.x,y:~~v.positionAbsolute.y})}),O({direction:Ls[V.key],factor:V.shiftKey?4:1})}}},te=()=>{var ce;if(p||!((ce=_.current)!=null&&ce.matches(":focus-visible")))return;const{transform:V,width:Q,height:Z,autoPanOnNodeFocus:oe,setCenter:ne}=j.getState();if(!oe)return;td(new Map([[e,g]]),{x:0,y:0,width:Q,height:Z},V,!0).length>0||ne(g.position.x+R.width/2,g.position.y+R.height/2,{zoom:V[2]})};return b.jsx("div",{className:He(["react-flow__node",`react-flow__node-${E}`,{[h]:P},g.className,{selected:g.selected,selectable:z,parent:C,draggable:P,dragging:A}]),ref:_,style:{zIndex:v.z,transform:`translate(${v.positionAbsolute.x}px,${v.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:$?"visible":"hidden",...g.style,...M},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:k,onMouseMove:F,onMouseLeave:B,onContextMenu:I,onClick:K,onDoubleClick:G,onKeyDown:T?q:void 0,tabIndex:T?0:void 0,onFocus:T?te:void 0,role:g.ariaRole??(T?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${nw}-${x}`,"aria-label":g.ariaLabel,...g.domAttributes,children:b.jsx(FI,{value:e,children:b.jsx(S,{id:e,data:g.data,type:E,positionAbsoluteX:v.positionAbsolute.x,positionAbsoluteY:v.positionAbsolute.y,selected:g.selected??!1,selectable:z,draggable:P,deletable:g.deletable??!0,isConnectable:N,sourcePosition:g.sourcePosition,targetPosition:g.targetPosition,dragging:A,dragHandle:g.dragHandle,zIndex:v.z,parentId:g.parentId,...R})})})}var aP=D.memo(sP);const uP=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function mw(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=ve(uP,Oe),o=rP(e.onlyRenderVisibleElements),l=oP();return b.jsx("div",{className:"react-flow__nodes",style:da,children:o.map(s=>b.jsx(aP,{id:s,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},s))})}mw.displayName="NodeRenderer";const cP=D.memo(mw);function fP(e){return ve(D.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const o=n.nodeLookup.get(i.source),l=n.nodeLookup.get(i.target);o&&l&&UN({sourceNode:o,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),Oe)}const dP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},hP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Jp={[Ps.Arrow]:dP,[Ps.ArrowClosed]:hP};function pP(e){const t=Me();return D.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Jp,e)?Jp[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Kt.error009(e)),null)},[e])}const mP=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:l,orient:s="auto-start-reverse"})=>{const a=pP(t);return a?b.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:s,refX:"0",refY:"0",children:b.jsx(a,{color:n,strokeWidth:l})}):null},gw=({defaultColor:e,rfId:t})=>{const n=ve(o=>o.edges),r=ve(o=>o.defaultEdgeOptions),i=D.useMemo(()=>ZN(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:i.map(o=>b.jsx(mP,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};gw.displayName="MarkerDefinitions";var gP=D.memo(gw);function yw({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:o,labelBgPadding:l=[2,4],labelBgBorderRadius:s=2,children:a,className:u,...c}){const[f,d]=D.useState({x:1,y:0,width:0,height:0}),h=He(["react-flow__edge-textwrapper",u]),p=D.useRef(null);return D.useEffect(()=>{if(p.current){const x=p.current.getBBox();d({x:x.x,y:x.y,width:x.width,height:x.height})}},[n]),n?b.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:h,visibility:f.width?"visible":"hidden",...c,children:[i&&b.jsx("rect",{width:f.width+2*l[0],x:-l[0],y:-l[1],height:f.height+2*l[1],className:"react-flow__edge-textbg",style:o,rx:s,ry:s}),b.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:r,children:n}),a]}):null}yw.displayName="EdgeText";const yP=D.memo(yw);function ha({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...c,d:e,fill:"none",className:He(["react-flow__edge-path",c.className])}),u?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Wt(t)&&Wt(n)?b.jsx(yP,{x:t,y:n,label:r,labelStyle:i,labelShowBg:o,labelBgStyle:l,labelBgPadding:s,labelBgBorderRadius:a}):null]})}function em({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===ie.Left||e===ie.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function xw({sourceX:e,sourceY:t,sourcePosition:n=ie.Bottom,targetX:r,targetY:i,targetPosition:o=ie.Top}){const[l,s]=em({pos:n,x1:e,y1:t,x2:r,y2:i}),[a,u]=em({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,f,d,h]=Ox({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:s,targetControlX:a,targetControlY:u});return[`M${e},${t} C${l},${s} ${a},${u} ${r},${i}`,c,f,d,h]}function ww(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:l,targetPosition:s,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:w,interactionWidth:m})=>{const[y,g,v]=xw({sourceX:n,sourceY:r,sourcePosition:l,targetX:i,targetY:o,targetPosition:s}),C=e.isInternal?void 0:t;return b.jsx(ha,{id:C,path:y,labelX:g,labelY:v,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:w,interactionWidth:m})})}const xP=ww({isInternal:!1}),vw=ww({isInternal:!0});xP.displayName="SimpleBezierEdge";vw.displayName="SimpleBezierEdgeInternal";function kw(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,sourcePosition:h=ie.Bottom,targetPosition:p=ie.Top,markerEnd:x,markerStart:w,pathOptions:m,interactionWidth:y})=>{const[g,v,C]=Tc({sourceX:n,sourceY:r,sourcePosition:h,targetX:i,targetY:o,targetPosition:p,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset,stepPosition:m==null?void 0:m.stepPosition}),E=e.isInternal?void 0:t;return b.jsx(ha,{id:E,path:g,labelX:v,labelY:C,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:x,markerStart:w,interactionWidth:y})})}const Ew=kw({isInternal:!1}),Sw=kw({isInternal:!0});Ew.displayName="SmoothStepEdge";Sw.displayName="SmoothStepEdgeInternal";function _w(e){return D.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return b.jsx(Ew,{...n,id:r,pathOptions:D.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const wP=_w({isInternal:!1}),bw=_w({isInternal:!0});wP.displayName="StepEdge";bw.displayName="StepEdgeInternal";function Cw(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:x})=>{const[w,m,y]=jx({sourceX:n,sourceY:r,targetX:i,targetY:o}),g=e.isInternal?void 0:t;return b.jsx(ha,{id:g,path:w,labelX:m,labelY:y,label:l,labelStyle:s,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:p,interactionWidth:x})})}const vP=Cw({isInternal:!1}),Nw=Cw({isInternal:!0});vP.displayName="StraightEdge";Nw.displayName="StraightEdgeInternal";function Iw(e){return D.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:o,sourcePosition:l=ie.Bottom,targetPosition:s=ie.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:w,pathOptions:m,interactionWidth:y})=>{const[g,v,C]=Dx({sourceX:n,sourceY:r,sourcePosition:l,targetX:i,targetY:o,targetPosition:s,curvature:m==null?void 0:m.curvature}),E=e.isInternal?void 0:t;return b.jsx(ha,{id:E,path:g,labelX:v,labelY:C,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:f,labelBgPadding:d,labelBgBorderRadius:h,style:p,markerEnd:x,markerStart:w,interactionWidth:y})})}const kP=Iw({isInternal:!1}),Pw=Iw({isInternal:!0});kP.displayName="BezierEdge";Pw.displayName="BezierEdgeInternal";const tm={default:Pw,straight:Nw,step:bw,smoothstep:Sw,simplebezier:vw},nm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},EP=(e,t,n)=>n===ie.Left?e-t:n===ie.Right?e+t:e,SP=(e,t,n)=>n===ie.Top?e-t:n===ie.Bottom?e+t:e,rm="react-flow__edgeupdater";function im({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:l,type:s}){return b.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:l,className:He([rm,`${rm}-${s}`]),cx:EP(t,r,e),cy:SP(n,r,e),r,stroke:"transparent",fill:"transparent"})}function _P({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:o,targetY:l,sourcePosition:s,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:f,setReconnecting:d,setUpdateHover:h}){const p=Me(),x=(v,C)=>{if(v.button!==0)return;const{autoPanOnConnect:E,domNode:S,connectionMode:P,connectionRadius:z,lib:N,onConnectStart:T,cancelConnection:j,nodeLookup:$,rfId:_,panBy:A,updateConnection:O}=p.getState(),R=C.type==="target",M=(F,B)=>{d(!1),f==null||f(F,n,C.type,B)},L=F=>u==null?void 0:u(n,F),k=(F,B)=>{d(!0),c==null||c(v,n,C.type),T==null||T(F,B)};zc.onPointerDown(v.nativeEvent,{autoPanOnConnect:E,connectionMode:P,connectionRadius:z,domNode:S,handleId:C.id,nodeId:C.nodeId,nodeLookup:$,isTarget:R,edgeUpdaterType:C.type,lib:N,flowId:_,cancelConnection:j,panBy:A,isValidConnection:(...F)=>{var B,I;return((I=(B=p.getState()).isValidConnection)==null?void 0:I.call(B,...F))??!0},onConnect:L,onConnectStart:k,onConnectEnd:(...F)=>{var B,I;return(I=(B=p.getState()).onConnectEnd)==null?void 0:I.call(B,...F)},onReconnectEnd:M,updateConnection:O,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:v.currentTarget})},w=v=>x(v,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),m=v=>x(v,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),y=()=>h(!0),g=()=>h(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx(im,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:w,onMouseEnter:y,onMouseOut:g,type:"source"}),(e===!0||e==="target")&&b.jsx(im,{position:a,centerX:o,centerY:l,radius:t,onMouseDown:m,onMouseEnter:y,onMouseOut:g,type:"target"})]})}function bP({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:o,onContextMenu:l,onMouseEnter:s,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,rfId:p,edgeTypes:x,noPanClassName:w,onError:m,disableKeyboardA11y:y}){let g=ve(ne=>ne.edgeLookup.get(e));const v=ve(ne=>ne.defaultEdgeOptions);g=v?{...v,...g}:g;let C=g.type||"default",E=(x==null?void 0:x[C])||tm[C];E===void 0&&(m==null||m("011",Kt.error011(C)),C="default",E=(x==null?void 0:x.default)||tm.default);const S=!!(g.focusable||t&&typeof g.focusable>"u"),P=typeof f<"u"&&(g.reconnectable||n&&typeof g.reconnectable>"u"),z=!!(g.selectable||r&&typeof g.selectable>"u"),N=D.useRef(null),[T,j]=D.useState(!1),[$,_]=D.useState(!1),A=Me(),{zIndex:O=g.zIndex,sourceX:R,sourceY:M,targetX:L,targetY:k,sourcePosition:F,targetPosition:B}=ve(D.useCallback(ne=>{const re=ne.nodeLookup.get(g.source),ce=ne.nodeLookup.get(g.target);if(!re||!ce)return nm;const de=KN({id:e,sourceNode:re,targetNode:ce,sourceHandle:g.sourceHandle||null,targetHandle:g.targetHandle||null,connectionMode:ne.connectionMode,onError:m}),me=VN({selected:g.selected,zIndex:g.zIndex,sourceNode:re,targetNode:ce,elevateOnSelect:ne.elevateEdgesOnSelect,zIndexMode:ne.zIndexMode});return{...de||nm,zIndex:me}},[g.source,g.target,g.sourceHandle,g.targetHandle,g.selected,g.zIndex]),Oe),I=D.useMemo(()=>g.markerStart?`url('#${Lc(g.markerStart,p)}')`:void 0,[g.markerStart,p]),G=D.useMemo(()=>g.markerEnd?`url('#${Lc(g.markerEnd,p)}')`:void 0,[g.markerEnd,p]);if(g.hidden||R===null||M===null||L===null||k===null)return null;const K=ne=>{var me;const{addSelectedEdges:re,unselectNodesAndEdges:ce,multiSelectionActive:de}=A.getState();z&&(A.setState({nodesSelectionActive:!1}),g.selected&&de?(ce({nodes:[],edges:[g]}),(me=N.current)==null||me.blur()):re([e])),i&&i(ne,g)},q=o?ne=>{o(ne,{...g})}:void 0,te=l?ne=>{l(ne,{...g})}:void 0,V=s?ne=>{s(ne,{...g})}:void 0,Q=a?ne=>{a(ne,{...g})}:void 0,Z=u?ne=>{u(ne,{...g})}:void 0,oe=ne=>{var re;if(!y&&vx.includes(ne.key)&&z){const{unselectNodesAndEdges:ce,addSelectedEdges:de}=A.getState();ne.key==="Escape"?((re=N.current)==null||re.blur(),ce({edges:[g]})):de([e])}};return b.jsx("svg",{style:{zIndex:O},children:b.jsxs("g",{className:He(["react-flow__edge",`react-flow__edge-${C}`,g.className,w,{selected:g.selected,animated:g.animated,inactive:!z&&!i,updating:T,selectable:z}]),onClick:K,onDoubleClick:q,onContextMenu:te,onMouseEnter:V,onMouseMove:Q,onMouseLeave:Z,onKeyDown:S?oe:void 0,tabIndex:S?0:void 0,role:g.ariaRole??(S?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":g.ariaLabel===null?void 0:g.ariaLabel||`Edge from ${g.source} to ${g.target}`,"aria-describedby":S?`${rw}-${p}`:void 0,ref:N,...g.domAttributes,children:[!$&&b.jsx(E,{id:e,source:g.source,target:g.target,type:g.type,selected:g.selected,animated:g.animated,selectable:z,deletable:g.deletable??!0,label:g.label,labelStyle:g.labelStyle,labelShowBg:g.labelShowBg,labelBgStyle:g.labelBgStyle,labelBgPadding:g.labelBgPadding,labelBgBorderRadius:g.labelBgBorderRadius,sourceX:R,sourceY:M,targetX:L,targetY:k,sourcePosition:F,targetPosition:B,data:g.data,style:g.style,sourceHandleId:g.sourceHandle,targetHandleId:g.targetHandle,markerStart:I,markerEnd:G,pathOptions:"pathOptions"in g?g.pathOptions:void 0,interactionWidth:g.interactionWidth}),P&&b.jsx(_P,{edge:g,isReconnectable:P,reconnectRadius:c,onReconnect:f,onReconnectStart:d,onReconnectEnd:h,sourceX:R,sourceY:M,targetX:L,targetY:k,sourcePosition:F,targetPosition:B,setUpdateHover:j,setReconnecting:_})]})})}var CP=D.memo(bP);const NP=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function Mw({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:o,onEdgeContextMenu:l,onEdgeMouseEnter:s,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:f,onEdgeDoubleClick:d,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:x}){const{edgesFocusable:w,edgesReconnectable:m,elementsSelectable:y,onError:g}=ve(NP,Oe),v=fP(t);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(gP,{defaultColor:e,rfId:n}),v.map(C=>b.jsx(CP,{id:C,edgesFocusable:w,edgesReconnectable:m,elementsSelectable:y,noPanClassName:i,onReconnect:o,onContextMenu:l,onMouseEnter:s,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:f,onDoubleClick:d,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:g,edgeTypes:r,disableKeyboardA11y:x},C))]})}Mw.displayName="EdgeRenderer";const IP=D.memo(Mw),om=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function PP({children:e}){const t=Me(),n=D.useRef(null),[r]=D.useState(()=>t.getState().transform);return aw(()=>{let i=null;const o=()=>{const l=t.getState().transform;i&&l[0]===i[0]&&l[1]===i[1]&&l[2]===i[2]||(i=l,n.current&&(n.current.style.transform=om(l)))};return o(),t.subscribe(o)},[t]),b.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:om(r)},children:e})}function MP(e){const t=fd(),n=D.useRef(!1);D.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const TP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function LP(e){const t=ve(TP),n=Me();return D.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function AP(e){return e.connection.inProgress?{...e.connection,to:Xo(e.connection.to,e.transform)}:{...e.connection}}function zP(e){return AP}function OP(e){const t=zP();return ve(t,Oe)}const DP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function RP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:o,height:l,isValid:s,inProgress:a}=ve(DP,Oe);return!(o&&i&&a)?null:b.jsx("svg",{style:e,width:o,height:l,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:He(["react-flow__connection",Sx(s)]),children:b.jsx(Tw,{style:t,type:n,CustomComponent:r,isValid:s})})})}const Tw=({style:e,type:t=$n.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:o,fromNode:l,fromHandle:s,fromPosition:a,to:u,toNode:c,toHandle:f,toPosition:d,pointer:h}=OP();if(!i)return;if(n)return b.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:s,fromX:o.x,fromY:o.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:d,connectionStatus:Sx(r),toNode:c,toHandle:f,pointer:h});let p="";const x={sourceX:o.x,sourceY:o.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:d};switch(t){case $n.Bezier:[p]=Dx(x);break;case $n.SimpleBezier:[p]=xw(x);break;case $n.Step:[p]=Tc({...x,borderRadius:0});break;case $n.SmoothStep:[p]=Tc(x);break;default:[p]=jx(x)}return b.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};Tw.displayName="ConnectionLine";const jP={};function lm(e=jP){D.useRef(e),Me(),D.useEffect(()=>{},[e])}function $P(){Me(),D.useRef(!1),D.useEffect(()=>{},[])}function Lw({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:o,onEdgeDoubleClick:l,onNodeMouseEnter:s,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:f,onSelectionStart:d,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:x,connectionLineComponent:w,connectionLineContainerStyle:m,selectionKeyCode:y,selectionOnDrag:g,selectionMode:v,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:S,deleteKeyCode:P,onlyRenderVisibleElements:z,elementsSelectable:N,defaultViewport:T,translateExtent:j,minZoom:$,maxZoom:_,preventScrolling:A,defaultMarkerColor:O,zoomOnScroll:R,zoomOnPinch:M,panOnScroll:L,panOnScrollSpeed:k,panOnScrollMode:F,zoomOnDoubleClick:B,panOnDrag:I,autoPanOnSelection:G,onPaneClick:K,onPaneMouseEnter:q,onPaneMouseMove:te,onPaneMouseLeave:V,onPaneScroll:Q,onPaneContextMenu:Z,paneClickDistance:oe,nodeClickDistance:ne,onEdgeContextMenu:re,onEdgeMouseEnter:ce,onEdgeMouseMove:de,onEdgeMouseLeave:me,reconnectRadius:_e,onReconnect:Xe,onReconnectStart:Ke,onReconnectEnd:U,noDragClassName:ee,noWheelClassName:ge,noPanClassName:se,disableKeyboardA11y:Ee,nodeExtent:ye,rfId:H,viewport:Y,onViewportChange:le,nodesDraggable:fe}){return lm(e),lm(t),$P(),MP(n),LP(Y),b.jsx(tP,{onPaneClick:K,onPaneMouseEnter:q,onPaneMouseMove:te,onPaneMouseLeave:V,onPaneContextMenu:Z,onPaneScroll:Q,paneClickDistance:oe,deleteKeyCode:P,selectionKeyCode:y,selectionOnDrag:g,selectionMode:v,onSelectionStart:d,onSelectionEnd:h,multiSelectionKeyCode:C,panActivationKeyCode:E,zoomActivationKeyCode:S,elementsSelectable:N,zoomOnScroll:R,zoomOnPinch:M,zoomOnDoubleClick:B,panOnScroll:L,panOnScrollSpeed:k,panOnScrollMode:F,panOnDrag:I,autoPanOnSelection:G,defaultViewport:T,translateExtent:j,minZoom:$,maxZoom:_,onSelectionContextMenu:f,preventScrolling:A,noDragClassName:ee,noWheelClassName:ge,noPanClassName:se,disableKeyboardA11y:Ee,onViewportChange:le,isControlledViewport:!!Y,children:b.jsxs(PP,{children:[b.jsx(IP,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:l,onReconnect:Xe,onReconnectStart:Ke,onReconnectEnd:U,onlyRenderVisibleElements:z,onEdgeContextMenu:re,onEdgeMouseEnter:ce,onEdgeMouseMove:de,onEdgeMouseLeave:me,reconnectRadius:_e,defaultMarkerColor:O,noPanClassName:se,disableKeyboardA11y:Ee,rfId:H}),b.jsx(RP,{style:x,type:p,component:w,containerStyle:m}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(cP,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:ne,onlyRenderVisibleElements:z,noPanClassName:se,noDragClassName:ee,disableKeyboardA11y:Ee,nodeExtent:ye,rfId:H,nodesDraggable:fe}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}Lw.displayName="GraphView";const FP=D.memo(Lw),BP=Px(),sm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:l,fitViewOptions:s,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:f,zIndexMode:d="basic"}={})=>{const h=new Map,p=new Map,x=new Map,w=new Map,m=r??t??[],y=n??e??[],g=c??[0,0],v=f??Po;Bx(x,w,m);const{nodesInitialized:C}=Ac(y,h,p,{nodeOrigin:g,nodeExtent:v,zIndexMode:d});let E=[0,0,1];if(l&&i&&o){const S=Wo(h,{filter:T=>!!((T.width||T.initialWidth)&&(T.height||T.initialHeight))}),{x:P,y:z,zoom:N}=rd(S,i,o,a,u,(s==null?void 0:s.padding)??.1);E=[P,z,N]}return{rfId:"1",width:i??0,height:o??0,transform:E,nodes:y,nodesInitialized:C,nodeLookup:h,parentLookup:p,edges:m,edgeLookup:w,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:Po,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:yi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:g,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:l??!1,fitViewOptions:s,fitViewResolver:null,connection:{...Ex},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:BP,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:kx,zIndexMode:d,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},HP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:l,fitViewOptions:s,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:f,zIndexMode:d})=>nI((h,p)=>{async function x(){const{nodeLookup:w,panZoom:m,fitViewOptions:y,fitViewResolver:g,width:v,height:C,minZoom:E,maxZoom:S}=p();m&&(await DN({nodes:w,width:v,height:C,panZoom:m,minZoom:E,maxZoom:S},y),g==null||g.resolve(!0),h({fitViewResolver:null}))}return{...sm({nodes:e,edges:t,width:i,height:o,fitView:l,fitViewOptions:s,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:d}),setNodes:w=>{const{nodeLookup:m,parentLookup:y,nodeOrigin:g,elevateNodesOnSelect:v,fitViewQueued:C,zIndexMode:E,nodesSelectionActive:S}=p(),{nodesInitialized:P,hasSelectedNodes:z}=Ac(w,m,y,{nodeOrigin:g,nodeExtent:f,elevateNodesOnSelect:v,checkEquality:!0,zIndexMode:E}),N=S&&z;C&&P?(x(),h({nodes:w,nodesInitialized:P,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:N})):h({nodes:w,nodesInitialized:P,nodesSelectionActive:N})},setEdges:w=>{const{connectionLookup:m,edgeLookup:y}=p();Bx(m,y,w),h({edges:w})},setDefaultNodesAndEdges:(w,m)=>{if(w){const{setNodes:y}=p();y(w),h({hasDefaultNodes:!0})}if(m){const{setEdges:y}=p();y(m),h({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:m,nodeLookup:y,parentLookup:g,domNode:v,nodeOrigin:C,nodeExtent:E,debug:S,fitViewQueued:P,zIndexMode:z}=p(),{changes:N,updatedInternals:T}=o2(w,y,g,v,C,E,z);T&&(t2(y,g,{nodeOrigin:C,nodeExtent:E,zIndexMode:z}),P?(x(),h({fitViewQueued:!1,fitViewOptions:void 0})):h({}),(N==null?void 0:N.length)>0&&(S&&console.log("React Flow: trigger node changes",N),m==null||m(N)))},updateNodePositions:(w,m=!1)=>{const y=[];let g=[];const{nodeLookup:v,triggerNodeChanges:C,connection:E,updateConnection:S,onNodesChangeMiddlewareMap:P}=p();for(const[z,N]of w){const T=v.get(z),j=!!(T!=null&&T.expandParent&&(T!=null&&T.parentId)&&(N!=null&&N.position)),$={id:z,type:"position",position:j?{x:Math.max(0,N.position.x),y:Math.max(0,N.position.y)}:N.position,dragging:m};if(T&&E.inProgress&&E.fromNode.id===T.id){const _=Mr(T,E.fromHandle,ie.Left,!0);S({...E,from:_})}j&&T.parentId&&y.push({id:z,parentId:T.parentId,rect:{...N.internals.positionAbsolute,width:N.measured.width??0,height:N.measured.height??0}}),g.push($)}if(y.length>0){const{parentLookup:z,nodeOrigin:N}=p(),T=ud(y,v,z,N);g.push(...T)}for(const z of P.values())g=z(g);C(g)},triggerNodeChanges:w=>{const{onNodesChange:m,setNodes:y,nodes:g,hasDefaultNodes:v,debug:C}=p();if(w!=null&&w.length){if(v){const E=cd(w,g);y(E)}C&&console.log("React Flow: trigger node changes",w),m==null||m(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:m,setEdges:y,edges:g,hasDefaultEdges:v,debug:C}=p();if(w!=null&&w.length){if(v){const E=lw(w,g);y(E)}C&&console.log("React Flow: trigger edge changes",w),m==null||m(w)}},addSelectedNodes:w=>{const{multiSelectionActive:m,edgeLookup:y,nodeLookup:g,triggerNodeChanges:v,triggerEdgeChanges:C}=p();if(m){const E=w.map(S=>ur(S,!0));v(E);return}v(Jr(g,new Set([...w]),!0)),C(Jr(y))},addSelectedEdges:w=>{const{multiSelectionActive:m,edgeLookup:y,nodeLookup:g,triggerNodeChanges:v,triggerEdgeChanges:C}=p();if(m){const E=w.map(S=>ur(S,!0));C(E);return}C(Jr(y,new Set([...w]))),v(Jr(g,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:m}={})=>{const{edges:y,nodes:g,nodeLookup:v,triggerNodeChanges:C,triggerEdgeChanges:E}=p(),S=w||g,P=m||y,z=[];for(const T of S){if(!T.selected)continue;const j=v.get(T.id);j&&(j.selected=!1),z.push(ur(T.id,!1))}const N=[];for(const T of P)T.selected&&N.push(ur(T.id,!1));C(z),E(N)},setMinZoom:w=>{const{panZoom:m,maxZoom:y}=p();m==null||m.setScaleExtent([w,y]),h({minZoom:w})},setMaxZoom:w=>{const{panZoom:m,minZoom:y}=p();m==null||m.setScaleExtent([y,w]),h({maxZoom:w})},setTranslateExtent:w=>{var m;(m=p().panZoom)==null||m.setTranslateExtent(w),h({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:m,triggerNodeChanges:y,triggerEdgeChanges:g,elementsSelectable:v}=p();if(!v)return;const C=m.reduce((S,P)=>P.selected?[...S,ur(P.id,!1)]:S,[]),E=w.reduce((S,P)=>P.selected?[...S,ur(P.id,!1)]:S,[]);y(C),g(E)},setNodeExtent:w=>{const{nodes:m,nodeLookup:y,parentLookup:g,nodeOrigin:v,elevateNodesOnSelect:C,nodeExtent:E,zIndexMode:S}=p();w[0][0]===E[0][0]&&w[0][1]===E[0][1]&&w[1][0]===E[1][0]&&w[1][1]===E[1][1]||(Ac(m,y,g,{nodeOrigin:v,nodeExtent:w,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:S}),h({nodeExtent:w}))},panBy:w=>{const{transform:m,width:y,height:g,panZoom:v,translateExtent:C}=p();return l2({delta:w,panZoom:v,transform:m,translateExtent:C,width:y,height:g})},setCenter:async(w,m,y)=>{const{width:g,height:v,maxZoom:C,panZoom:E}=p();if(!E)return!1;const S=typeof(y==null?void 0:y.zoom)<"u"?y.zoom:C;return await E.setViewport({x:g/2-w*S,y:v/2-m*S,zoom:S},{duration:y==null?void 0:y.duration,ease:y==null?void 0:y.ease,interpolate:y==null?void 0:y.interpolate}),!0},cancelConnection:()=>{h({connection:{...Ex}})},updateConnection:w=>{h({connection:w})},reset:()=>h({...sm()})}},Object.is);function VP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:o,initialMinZoom:l,initialMaxZoom:s,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:f,zIndexMode:d,children:h}){const[p]=D.useState(()=>HP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:o,fitView:u,minZoom:l,maxZoom:s,fitViewOptions:a,nodeOrigin:c,nodeExtent:f,zIndexMode:d}));return b.jsx(rI,{value:p,children:b.jsx(NI,{children:b.jsx(HI,{children:h})})})}function UP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:o,height:l,fitView:s,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:f,nodeExtent:d,zIndexMode:h}){return D.useContext(ca)?b.jsx(b.Fragment,{children:e}):b.jsx(VP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:o,initialHeight:l,fitView:s,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:f,nodeExtent:d,zIndexMode:h,children:e})}const WP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function YP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o,edgeTypes:l,onNodeClick:s,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:p,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:m,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:C,onNodeDoubleClick:E,onNodeDragStart:S,onNodeDrag:P,onNodeDragStop:z,onNodesDelete:N,onEdgesDelete:T,onDelete:j,onSelectionChange:$,onSelectionDragStart:_,onSelectionDrag:A,onSelectionDragStop:O,onSelectionContextMenu:R,onSelectionStart:M,onSelectionEnd:L,onBeforeDelete:k,connectionMode:F,connectionLineType:B=$n.Bezier,connectionLineStyle:I,connectionLineComponent:G,connectionLineContainerStyle:K,deleteKeyCode:q="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:V=!1,selectionMode:Q=Mo.Full,panActivationKeyCode:Z="Space",multiSelectionKeyCode:oe=Lo()?"Meta":"Control",zoomActivationKeyCode:ne=Lo()?"Meta":"Control",snapToGrid:re,snapGrid:ce,onlyRenderVisibleElements:de=!1,selectNodesOnDrag:me,nodesDraggable:_e,autoPanOnNodeFocus:Xe,nodesConnectable:Ke,nodesFocusable:U,nodeOrigin:ee=iw,edgesFocusable:ge,edgesReconnectable:se,elementsSelectable:Ee=!0,defaultViewport:ye=gI,minZoom:H=.5,maxZoom:Y=2,translateExtent:le=Po,preventScrolling:fe=!0,nodeExtent:ke,defaultMarkerColor:xt="#b1b1b7",zoomOnScroll:hn=!0,zoomOnPinch:Rt=!0,panOnScroll:rr=!1,panOnScrollSpeed:ir=.5,panOnScrollMode:it=wr.Free,zoomOnDoubleClick:Mn=!0,panOnDrag:jt=!0,onPaneClick:P1,onPaneMouseEnter:M1,onPaneMouseMove:T1,onPaneMouseLeave:L1,onPaneScroll:A1,onPaneContextMenu:z1,paneClickDistance:O1=1,nodeClickDistance:D1=0,children:R1,onReconnect:j1,onReconnectStart:$1,onReconnectEnd:F1,onEdgeContextMenu:B1,onEdgeDoubleClick:H1,onEdgeMouseEnter:V1,onEdgeMouseMove:U1,onEdgeMouseLeave:W1,reconnectRadius:Y1=10,onNodesChange:X1,onEdgesChange:G1,noDragClassName:Q1="nodrag",noWheelClassName:q1="nowheel",noPanClassName:Hd="nopan",fitView:Vd,fitViewOptions:Ud,connectOnClick:K1,attributionPosition:Z1,proOptions:J1,defaultEdgeOptions:ek,elevateNodesOnSelect:tk=!0,elevateEdgesOnSelect:nk=!1,disableKeyboardA11y:Wd=!1,autoPanOnConnect:rk,autoPanOnNodeDrag:ik,autoPanOnSelection:ok=!0,autoPanSpeed:lk,connectionRadius:sk,isValidConnection:ak,onError:uk,style:ck,id:Yd,nodeDragThreshold:fk,connectionDragThreshold:dk,viewport:hk,onViewportChange:pk,width:mk,height:gk,colorMode:yk="light",debug:xk,onScroll:Ko,ariaLabelConfig:wk,zIndexMode:Xd="basic",...vk},kk){const Ea=Yd||"1",Ek=vI(yk),Sk=D.useCallback(Gd=>{Gd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ko==null||Ko(Gd)},[Ko]);return b.jsx("div",{"data-testid":"rf__wrapper",...vk,onScroll:Sk,style:{...ck,...WP},ref:kk,className:He(["react-flow",i,Ek]),id:Yd,role:"application",children:b.jsxs(UP,{nodes:e,edges:t,width:mk,height:gk,fitView:Vd,fitViewOptions:Ud,minZoom:H,maxZoom:Y,nodeOrigin:ee,nodeExtent:ke,zIndexMode:Xd,children:[b.jsx(wI,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:x,onClickConnectStart:w,onClickConnectEnd:m,nodesDraggable:_e,autoPanOnNodeFocus:Xe,nodesConnectable:Ke,nodesFocusable:U,edgesFocusable:ge,edgesReconnectable:se,elementsSelectable:Ee,elevateNodesOnSelect:tk,elevateEdgesOnSelect:nk,minZoom:H,maxZoom:Y,nodeExtent:ke,onNodesChange:X1,onEdgesChange:G1,snapToGrid:re,snapGrid:ce,connectionMode:F,translateExtent:le,connectOnClick:K1,defaultEdgeOptions:ek,fitView:Vd,fitViewOptions:Ud,onNodesDelete:N,onEdgesDelete:T,onDelete:j,onNodeDragStart:S,onNodeDrag:P,onNodeDragStop:z,onSelectionDrag:A,onSelectionDragStart:_,onSelectionDragStop:O,onMove:c,onMoveStart:f,onMoveEnd:d,noPanClassName:Hd,nodeOrigin:ee,rfId:Ea,autoPanOnConnect:rk,autoPanOnNodeDrag:ik,autoPanSpeed:lk,onError:uk,connectionRadius:sk,isValidConnection:ak,selectNodesOnDrag:me,nodeDragThreshold:fk,connectionDragThreshold:dk,onBeforeDelete:k,debug:xk,ariaLabelConfig:wk,zIndexMode:Xd}),b.jsx(FP,{onInit:u,onNodeClick:s,onEdgeClick:a,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:C,onNodeDoubleClick:E,nodeTypes:o,edgeTypes:l,connectionLineType:B,connectionLineStyle:I,connectionLineComponent:G,connectionLineContainerStyle:K,selectionKeyCode:te,selectionOnDrag:V,selectionMode:Q,deleteKeyCode:q,multiSelectionKeyCode:oe,panActivationKeyCode:Z,zoomActivationKeyCode:ne,onlyRenderVisibleElements:de,defaultViewport:ye,translateExtent:le,minZoom:H,maxZoom:Y,preventScrolling:fe,zoomOnScroll:hn,zoomOnPinch:Rt,zoomOnDoubleClick:Mn,panOnScroll:rr,panOnScrollSpeed:ir,panOnScrollMode:it,panOnDrag:jt,autoPanOnSelection:ok,onPaneClick:P1,onPaneMouseEnter:M1,onPaneMouseMove:T1,onPaneMouseLeave:L1,onPaneScroll:A1,onPaneContextMenu:z1,paneClickDistance:O1,nodeClickDistance:D1,onSelectionContextMenu:R,onSelectionStart:M,onSelectionEnd:L,onReconnect:j1,onReconnectStart:$1,onReconnectEnd:F1,onEdgeContextMenu:B1,onEdgeDoubleClick:H1,onEdgeMouseEnter:V1,onEdgeMouseMove:U1,onEdgeMouseLeave:W1,reconnectRadius:Y1,defaultMarkerColor:xt,noDragClassName:Q1,noWheelClassName:q1,noPanClassName:Hd,rfId:Ea,disableKeyboardA11y:Wd,nodeExtent:ke,viewport:hk,onViewportChange:pk,nodesDraggable:_e}),b.jsx(mI,{onSelectionChange:$}),R1,b.jsx(cI,{proOptions:J1,position:Z1}),b.jsx(uI,{rfId:Ea,disableKeyboardA11y:Wd})]})})}var XP=sw(YP);function GP(e){const[t,n]=D.useState(e),r=D.useCallback(i=>n(o=>cd(i,o)),[]);return[t,n,r]}function QP(e){const[t,n]=D.useState(e),r=D.useCallback(i=>n(o=>lw(i,o)),[]);return[t,n,r]}function qP({dimensions:e,lineWidth:t,variant:n,className:r}){return b.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:He(["react-flow__background-pattern",n,r])})}function KP({radius:e,className:t}){return b.jsx("circle",{cx:e,cy:e,r:e,className:He(["react-flow__background-pattern","dots",t])})}var qn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(qn||(qn={}));const ZP={[qn.Dots]:1,[qn.Lines]:1,[qn.Cross]:6},JP=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Aw({id:e,variant:t=qn.Dots,gap:n=20,size:r,lineWidth:i=1,offset:o=0,color:l,bgColor:s,style:a,className:u,patternClassName:c}){const f=D.useRef(null),{transform:d,patternId:h}=ve(JP,Oe),p=r||ZP[t],x=t===qn.Dots,w=t===qn.Cross,m=Array.isArray(n)?n:[n,n],y=[m[0]*d[2]||1,m[1]*d[2]||1],g=p*d[2],v=Array.isArray(o)?o:[o,o],C=w?[g,g]:y,E=[v[0]*d[2]||1+C[0]/2,v[1]*d[2]||1+C[1]/2],S=`${h}${e||""}`;return b.jsxs("svg",{className:He(["react-flow__background",u]),style:{...a,...da,"--xy-background-color-props":s,"--xy-background-pattern-color-props":l},ref:f,"data-testid":"rf__background",children:[b.jsx("pattern",{id:S,x:d[0]%y[0],y:d[1]%y[1],width:y[0],height:y[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:x?b.jsx(KP,{radius:g/2,className:c}):b.jsx(qP,{dimensions:C,lineWidth:i,variant:t,className:c})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${S})`})]})}Aw.displayName="Background";const eM=D.memo(Aw);function tM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function nM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function rM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.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 iM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 oM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 Sl({children:e,className:t,...n}){return b.jsx("button",{type:"button",className:He(["react-flow__controls-button",t]),...n,children:e})}const lM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function zw({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:o,onZoomOut:l,onFitView:s,onInteractiveChange:a,className:u,children:c,position:f="bottom-left",orientation:d="vertical","aria-label":h}){const p=Me(),{isInteractive:x,minZoomReached:w,maxZoomReached:m,ariaLabelConfig:y}=ve(lM,Oe),{zoomIn:g,zoomOut:v,fitView:C}=fd(),E=()=>{g(),o==null||o()},S=()=>{v(),l==null||l()},P=()=>{C(i),s==null||s()},z=()=>{p.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),a==null||a(!x)},N=d==="horizontal"?"horizontal":"vertical";return b.jsxs(fa,{className:He(["react-flow__controls",N,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":h??y["controls.ariaLabel"],children:[t&&b.jsxs(b.Fragment,{children:[b.jsx(Sl,{onClick:E,className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:m,children:b.jsx(tM,{})}),b.jsx(Sl,{onClick:S,className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:w,children:b.jsx(nM,{})})]}),n&&b.jsx(Sl,{className:"react-flow__controls-fitview",onClick:P,title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:b.jsx(rM,{})}),r&&b.jsx(Sl,{className:"react-flow__controls-interactive",onClick:z,title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:x?b.jsx(oM,{}):b.jsx(iM,{})}),c]})}zw.displayName="Controls";const sM=D.memo(zw);function aM({id:e,x:t,y:n,width:r,height:i,style:o,color:l,strokeColor:s,strokeWidth:a,className:u,borderRadius:c,shapeRendering:f,selected:d,onClick:h}){const{background:p,backgroundColor:x}=o||{},w=l||p||x;return b.jsx("rect",{className:He(["react-flow__minimap-node",{selected:d},u]),x:t,y:n,rx:c,ry:c,width:r,height:i,style:{fill:w,stroke:s,strokeWidth:a},shapeRendering:f,onClick:h?m=>h(m,e):void 0})}const uM=D.memo(aM),cM=e=>e.nodes.map(t=>t.id),iu=e=>e instanceof Function?e:()=>e;function fM({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:o=uM,onClick:l}){const s=ve(cM,Oe),a=iu(t),u=iu(e),c=iu(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:s.map(d=>b.jsx(hM,{id:d,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:o,onClick:l,shapeRendering:f},d))})}function dM({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:o,shapeRendering:l,NodeComponent:s,onClick:a}){const{node:u,x:c,y:f,width:d,height:h}=ve(p=>{const x=p.nodeLookup.get(e);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const w=x.internals.userNode,{x:m,y}=x.internals.positionAbsolute,{width:g,height:v}=fn(w);return{node:w,x:m,y,width:g,height:v}},Oe);return!u||u.hidden||!Mx(u)?null:b.jsx(s,{x:c,y:f,width:d,height:h,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:o,shapeRendering:l,onClick:a,id:u.id})}const hM=D.memo(dM);var pM=D.memo(fM);const mM=200,gM=150,yM=e=>!e.hidden,xM=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Nx(Wo(e.nodeLookup,{filter:yM}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},am=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,wM=(e,t)=>am(e.viewBB,t.viewBB)&&am(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,vM="react-flow__minimap-desc";function Ow({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:o=5,nodeStrokeWidth:l,nodeComponent:s,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:f,position:d="bottom-right",onClick:h,onNodeClick:p,pannable:x=!1,zoomable:w=!1,ariaLabel:m,inversePan:y,zoomStep:g=1,offsetScale:v=5}){const C=Me(),E=D.useRef(null),{boundingRect:S,viewBB:P,rfId:z,panZoom:N,translateExtent:T,flowWidth:j,flowHeight:$,ariaLabelConfig:_}=ve(xM,wM),A=(e==null?void 0:e.width)??mM,O=(e==null?void 0:e.height)??gM,R=S.width/A,M=S.height/O,L=Math.max(R,M),k=L*A,F=L*O,B=v*L,I=S.x-(k-S.width)/2-B,G=S.y-(F-S.height)/2-B,K=k+B*2,q=F+B*2,te=`${vM}-${z}`,V=D.useRef(0),Q=D.useRef();V.current=L,D.useEffect(()=>{if(E.current&&N)return Q.current=m2({domNode:E.current,panZoom:N,getTransform:()=>C.getState().transform,getViewScale:()=>V.current}),()=>{var re;(re=Q.current)==null||re.destroy()}},[N]),D.useEffect(()=>{var re;(re=Q.current)==null||re.update({translateExtent:T,width:j,height:$,inversePan:y,pannable:x,zoomStep:g,zoomable:w})},[x,w,y,g,T,j,$]);const Z=h?re=>{var me;const[ce,de]=((me=Q.current)==null?void 0:me.pointer(re))||[0,0];h(re,{x:ce,y:de})}:void 0,oe=p?D.useCallback((re,ce)=>{const de=C.getState().nodeLookup.get(ce).internals.userNode;p(re,de)},[]):void 0,ne=m??_["minimap.ariaLabel"];return b.jsx(fa,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*L: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 l=="number"?l:void 0},className:He(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:A,height:O,viewBox:`${I} ${G} ${K} ${q}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:E,onClick:Z,children:[ne&&b.jsx("title",{id:te,children:ne}),b.jsx(pM,{onClick:oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:i,nodeStrokeWidth:l,nodeComponent:s}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${I-B},${G-B}h${K+B*2}v${q+B*2}h${-K-B*2}z
62
- M${P.x},${P.y}h${P.width}v${P.height}h${-P.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Ow.displayName="MiniMap";const kM=D.memo(Ow),EM=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,SM={[Tr.Line]:"right",[Tr.Handle]:"bottom-right"};function _M({nodeId:e,position:t,variant:n=Tr.Handle,className:r,style:i=void 0,children:o,color:l,minWidth:s=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:d,autoScale:h=!0,shouldResize:p,onResizeStart:x,onResize:w,onResizeEnd:m}){const y=dw(),g=typeof e=="string"?e:y,v=Me(),C=D.useRef(null),E=n===Tr.Handle,S=ve(D.useCallback(EM(E&&h),[E,h]),Oe),P=D.useRef(null),z=t??SM[n];D.useEffect(()=>{if(!(!C.current||!g))return P.current||(P.current=M2({domNode:C.current,nodeId:g,getStoreItems:()=>{const{nodeLookup:T,transform:j,snapGrid:$,snapToGrid:_,nodeOrigin:A,domNode:O}=v.getState();return{nodeLookup:T,transform:j,snapGrid:$,snapToGrid:_,nodeOrigin:A,paneDomNode:O}},onChange:(T,j)=>{const{triggerNodeChanges:$,nodeLookup:_,parentLookup:A,nodeOrigin:O}=v.getState(),R=[],M={x:T.x,y:T.y},L=_.get(g);if(L&&L.expandParent&&L.parentId){const k=L.origin??O,F=T.width??L.measured.width??0,B=T.height??L.measured.height??0,I={id:L.id,parentId:L.parentId,rect:{width:F,height:B,...Tx({x:T.x??L.position.x,y:T.y??L.position.y},{width:F,height:B},L.parentId,_,k)}},G=ud([I],_,A,O);R.push(...G),M.x=T.x?Math.max(k[0]*F,T.x):void 0,M.y=T.y?Math.max(k[1]*B,T.y):void 0}if(M.x!==void 0&&M.y!==void 0){const k={id:g,type:"position",position:{...M}};R.push(k)}if(T.width!==void 0&&T.height!==void 0){const F={id:g,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:T.width,height:T.height}};R.push(F)}for(const k of j){const F={...k,type:"position"};R.push(F)}$(R)},onEnd:({width:T,height:j})=>{const $={id:g,type:"dimensions",resizing:!1,dimensions:{width:T,height:j}};v.getState().triggerNodeChanges([$])}})),P.current.update({controlPosition:z,boundaries:{minWidth:s,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:f,resizeDirection:d,onResizeStart:x,onResize:w,onResizeEnd:m,shouldResize:p}),()=>{var T;(T=P.current)==null||T.destroy()}},[z,s,a,u,c,f,x,w,m,p]);const N=z.split("-");return b.jsx("div",{className:He(["react-flow__resize-control","nodrag",...N,n,r]),ref:C,style:{...i,scale:S,...l&&{[E?"backgroundColor":"borderColor"]:l}},children:o})}const um=D.memo(_M);function Dw({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:r,lineClassName:i,lineStyle:o,color:l,minWidth:s=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:f=!1,autoScale:d=!0,shouldResize:h,onResizeStart:p,onResize:x,onResizeEnd:w}){return t?b.jsxs(b.Fragment,{children:[b2.map(m=>b.jsx(um,{className:i,style:o,nodeId:e,position:m,variant:Tr.Line,color:l,minWidth:s,minHeight:a,maxWidth:u,maxHeight:c,onResizeStart:p,keepAspectRatio:f,autoScale:d,shouldResize:h,onResize:x,onResizeEnd:w},m)),_2.map(m=>b.jsx(um,{className:n,style:r,nodeId:e,position:m,color:l,minWidth:s,minHeight:a,maxWidth:u,maxHeight:c,onResizeStart:p,keepAspectRatio:f,autoScale:d,shouldResize:h,onResize:x,onResizeEnd:w},m))]}):null}function bM(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const CM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,IM={};function cm(e,t){return(IM.jsx?NM:CM).test(e)}const PM=/[ \t\n\f\r]/g;function MM(e){return typeof e=="object"?e.type==="text"?fm(e.value):!1:fm(e)}function fm(e){return e.replace(PM,"")===""}class Go{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Go.prototype.normal={};Go.prototype.property={};Go.prototype.space=void 0;function Rw(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Go(n,r,t)}function Dc(e){return e.toLowerCase()}class yt{constructor(t,n){this.attribute=n,this.property=t}}yt.prototype.attribute="";yt.prototype.booleanish=!1;yt.prototype.boolean=!1;yt.prototype.commaOrSpaceSeparated=!1;yt.prototype.commaSeparated=!1;yt.prototype.defined=!1;yt.prototype.mustUseProperty=!1;yt.prototype.number=!1;yt.prototype.overloadedBoolean=!1;yt.prototype.property="";yt.prototype.spaceSeparated=!1;yt.prototype.space=void 0;let TM=0;const ue=Or(),$e=Or(),Rc=Or(),X=Or(),be=Or(),vr=Or(),wt=Or();function Or(){return 2**++TM}const jc=Object.freeze(Object.defineProperty({__proto__:null,boolean:ue,booleanish:$e,commaOrSpaceSeparated:wt,commaSeparated:vr,number:X,overloadedBoolean:Rc,spaceSeparated:be},Symbol.toStringTag,{value:"Module"})),ou=Object.keys(jc);class hd extends yt{constructor(t,n,r,i){let o=-1;if(super(t,n),dm(this,"space",i),typeof r=="number")for(;++o<ou.length;){const l=ou[o];dm(this,ou[o],(r&jc[l])===jc[l])}}}hd.prototype.defined=!0;function dm(e,t,n){n&&(e[t]=n)}function Ci(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new hd(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Dc(r)]=r,n[Dc(o.attribute)]=r}return new Go(t,n,e.space)}const jw=Ci({properties:{ariaActiveDescendant:null,ariaAtomic:$e,ariaAutoComplete:null,ariaBusy:$e,ariaChecked:$e,ariaColCount:X,ariaColIndex:X,ariaColSpan:X,ariaControls:be,ariaCurrent:null,ariaDescribedBy:be,ariaDetails:null,ariaDisabled:$e,ariaDropEffect:be,ariaErrorMessage:null,ariaExpanded:$e,ariaFlowTo:be,ariaGrabbed:$e,ariaHasPopup:null,ariaHidden:$e,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:be,ariaLevel:X,ariaLive:null,ariaModal:$e,ariaMultiLine:$e,ariaMultiSelectable:$e,ariaOrientation:null,ariaOwns:be,ariaPlaceholder:null,ariaPosInSet:X,ariaPressed:$e,ariaReadOnly:$e,ariaRelevant:null,ariaRequired:$e,ariaRoleDescription:be,ariaRowCount:X,ariaRowIndex:X,ariaRowSpan:X,ariaSelected:$e,ariaSetSize:X,ariaSort:null,ariaValueMax:X,ariaValueMin:X,ariaValueNow:X,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $w(e,t){return t in e?e[t]:t}function Fw(e,t){return $w(e,t.toLowerCase())}const LM=Ci({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:vr,acceptCharset:be,accessKey:be,action:null,allow:null,allowFullScreen:ue,allowPaymentRequest:ue,allowUserMedia:ue,alpha:ue,alt:null,as:null,async:ue,autoCapitalize:null,autoComplete:be,autoFocus:ue,autoPlay:ue,blocking:be,capture:null,charSet:null,checked:ue,cite:null,className:be,closedBy:null,colorSpace:null,cols:X,colSpan:X,command:null,commandFor:null,content:null,contentEditable:$e,controls:ue,controlsList:be,coords:X|vr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ue,defer:ue,dir:null,dirName:null,disabled:ue,download:Rc,draggable:$e,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ue,formTarget:null,headers:be,height:X,hidden:Rc,high:X,href:null,hrefLang:null,htmlFor:be,httpEquiv:be,id:null,imageSizes:null,imageSrcSet:null,inert:ue,inputMode:null,integrity:null,is:null,isMap:ue,itemId:null,itemProp:be,itemRef:be,itemScope:ue,itemType:be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ue,low:X,manifest:null,max:null,maxLength:X,media:null,method:null,min:null,minLength:X,multiple:ue,muted:ue,name:null,nonce:null,noModule:ue,noValidate:ue,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ue,optimum:X,pattern:null,ping:be,placeholder:null,playsInline:ue,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ue,referrerPolicy:null,rel:be,required:ue,reversed:ue,rows:X,rowSpan:X,sandbox:be,scope:null,scoped:ue,seamless:ue,selected:ue,shadowRootClonable:ue,shadowRootCustomElementRegistry:ue,shadowRootDelegatesFocus:ue,shadowRootMode:null,shadowRootSerializable:ue,shape:null,size:X,sizes:null,slot:null,span:X,spellCheck:$e,src:null,srcDoc:null,srcLang:null,srcSet:null,start:X,step:null,style:null,tabIndex:X,target:null,title:null,translate:null,type:null,typeMustMatch:ue,useMap:null,value:$e,width:X,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:be,axis:null,background:null,bgColor:null,border:X,borderColor:null,bottomMargin:X,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ue,declare:ue,event:null,face:null,frame:null,frameBorder:null,hSpace:X,leftMargin:X,link:null,longDesc:null,lowSrc:null,marginHeight:X,marginWidth:X,noResize:ue,noHref:ue,noShade:ue,noWrap:ue,object:null,profile:null,prompt:null,rev:null,rightMargin:X,rules:null,scheme:null,scrolling:$e,standby:null,summary:null,text:null,topMargin:X,valueType:null,version:null,vAlign:null,vLink:null,vSpace:X,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ue,disablePictureInPicture:ue,disableRemotePlayback:ue,exportParts:vr,part:be,prefix:null,property:null,results:X,security:null,unselectable:null},space:"html",transform:Fw}),AM=Ci({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:wt,accentHeight:X,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:X,amplitude:X,arabicForm:null,ascent:X,attributeName:null,attributeType:null,azimuth:X,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:X,by:null,calcMode:null,capHeight:X,className:be,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:X,diffuseConstant:X,direction:null,display:null,dur:null,divisor:X,dominantBaseline:null,download:ue,dx:null,dy:null,edgeMode:null,editable:null,elevation:X,enableBackground:null,end:null,event:null,exponent:X,externalResourcesRequired:null,fill:null,fillOpacity:X,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:vr,g2:vr,glyphName:vr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:X,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:X,horizOriginX:X,horizOriginY:X,id:null,ideographic:X,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:X,k:X,k1:X,k2:X,k3:X,k4:X,kernelMatrix:wt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:X,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:X,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:X,overlineThickness:X,paintOrder:null,panose1:null,path:null,pathLength:X,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:X,pointsAtY:X,pointsAtZ:X,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wt,rev:wt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wt,requiredFeatures:wt,requiredFonts:wt,requiredFormats:wt,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:X,specularExponent:X,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:X,strikethroughThickness:X,string:null,stroke:null,strokeDashArray:wt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:X,strokeOpacity:X,strokeWidth:null,style:null,surfaceScale:X,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wt,tabIndex:X,tableValues:null,target:null,targetX:X,targetY:X,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:X,underlineThickness:X,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:X,values:null,vAlphabetic:X,vMathematical:X,vectorEffect:null,vHanging:X,vIdeographic:X,version:null,vertAdvY:X,vertOriginX:X,vertOriginY:X,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:X,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$w}),Bw=Ci({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Hw=Ci({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Fw}),Vw=Ci({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),zM={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},OM=/[A-Z]/g,hm=/-[a-z]/g,DM=/^data[-\w.:]+$/i;function RM(e,t){const n=Dc(t);let r=t,i=yt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&DM.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(hm,$M);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!hm.test(o)){let l=o.replace(OM,jM);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=hd}return new i(r,t)}function jM(e){return"-"+e.toLowerCase()}function $M(e){return e.charAt(1).toUpperCase()}const FM=Rw([jw,LM,Bw,Hw,Vw],"html"),pd=Rw([jw,AM,Bw,Hw,Vw],"svg");function BM(e){return e.join(" ").trim()}var md={},pm=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,HM=/\n/g,VM=/^\s*/,UM=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,WM=/^:\s*/,YM=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,XM=/^[;\s]*/,GM=/^\s+|\s+$/g,QM=`
63
- `,mm="/",gm="*",fr="",qM="comment",KM="declaration";function ZM(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var x=p.match(HM);x&&(n+=x.length);var w=p.lastIndexOf(QM);r=~w?p.length-w:r+p.length}function o(){var p={line:n,column:r};return function(x){return x.position=new l(p),u(),x}}function l(p){this.start=p,this.end={line:n,column:r},this.source=t.source}l.prototype.content=e;function s(p){var x=new Error(t.source+":"+n+":"+r+": "+p);if(x.reason=p,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function a(p){var x=p.exec(e);if(x){var w=x[0];return i(w),e=e.slice(w.length),x}}function u(){a(VM)}function c(p){var x;for(p=p||[];x=f();)x!==!1&&p.push(x);return p}function f(){var p=o();if(!(mm!=e.charAt(0)||gm!=e.charAt(1))){for(var x=2;fr!=e.charAt(x)&&(gm!=e.charAt(x)||mm!=e.charAt(x+1));)++x;if(x+=2,fr===e.charAt(x-1))return s("End of comment missing");var w=e.slice(2,x-2);return r+=2,i(w),e=e.slice(x),r+=2,p({type:qM,comment:w})}}function d(){var p=o(),x=a(UM);if(x){if(f(),!a(WM))return s("property missing ':'");var w=a(YM),m=p({type:KM,property:ym(x[0].replace(pm,fr)),value:w?ym(w[0].replace(pm,fr)):fr});return a(XM),m}}function h(){var p=[];c(p);for(var x;x=d();)x!==!1&&(p.push(x),c(p));return p}return u(),h()}function ym(e){return e?e.replace(GM,fr):fr}var JM=ZM,eT=Kl&&Kl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(md,"__esModule",{value:!0});md.default=nT;const tT=eT(JM);function nT(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,tT.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:l,value:s}=o;i?t(l,s,o):s&&(n=n||{},n[l]=s)}),n}var pa={};Object.defineProperty(pa,"__esModule",{value:!0});pa.camelCase=void 0;var rT=/^--[a-zA-Z0-9_-]+$/,iT=/-([a-z])/g,oT=/^[^-]+$/,lT=/^-(webkit|moz|ms|o|khtml)-/,sT=/^-(ms)-/,aT=function(e){return!e||oT.test(e)||rT.test(e)},uT=function(e,t){return t.toUpperCase()},xm=function(e,t){return"".concat(t,"-")},cT=function(e,t){return t===void 0&&(t={}),aT(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(sT,xm):e=e.replace(lT,xm),e.replace(iT,uT))};pa.camelCase=cT;var fT=Kl&&Kl.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},dT=fT(md),hT=pa;function $c(e,t){var n={};return!e||typeof e!="string"||(0,dT.default)(e,function(r,i){r&&i&&(n[(0,hT.camelCase)(r,t)]=i)}),n}$c.default=$c;var pT=$c;const mT=Do(pT),Uw=Ww("end"),gd=Ww("start");function Ww(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function gT(e){const t=gd(e),n=Uw(e);if(t&&n)return{start:t,end:n}}function io(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wm(e.position):"start"in e||"end"in e?wm(e):"line"in e||"column"in e?Fc(e):""}function Fc(e){return vm(e&&e.line)+":"+vm(e&&e.column)}function wm(e){return Fc(e&&e.start)+"-"+Fc(e&&e.end)}function vm(e){return e&&typeof e=="number"?e:1}class rt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const s=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=s?s.line:void 0,this.name=io(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}rt.prototype.file="";rt.prototype.name="";rt.prototype.reason="";rt.prototype.message="";rt.prototype.stack="";rt.prototype.column=void 0;rt.prototype.line=void 0;rt.prototype.ancestors=void 0;rt.prototype.cause=void 0;rt.prototype.fatal=void 0;rt.prototype.place=void 0;rt.prototype.ruleId=void 0;rt.prototype.source=void 0;const yd={}.hasOwnProperty,yT=new Map,xT=/[A-Z]/g,wT=new Set(["table","tbody","thead","tfoot","tr"]),vT=new Set(["td","th"]),Yw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function kT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=PT(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=IT(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?pd:FM,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Xw(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Xw(e,t,n){if(t.type==="element")return ET(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return ST(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return bT(e,t,n);if(t.type==="mdxjsEsm")return _T(e,t);if(t.type==="root")return CT(e,t,n);if(t.type==="text")return NT(e,t)}function ET(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=pd,e.schema=i),e.ancestors.push(t);const o=Qw(e,t.tagName,!1),l=MT(e,t);let s=wd(e,t);return wT.has(t.tagName)&&(s=s.filter(function(a){return typeof a=="string"?!MM(a):!0})),Gw(e,l,o,t),xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function ST(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}zo(e,t.position)}function _T(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);zo(e,t.position)}function bT(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=pd,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Qw(e,t.name,!0),l=TT(e,t),s=wd(e,t);return Gw(e,l,o,t),xd(l,s),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function CT(e,t,n){const r={};return xd(r,wd(e,t)),e.create(t,e.Fragment,r,n)}function NT(e,t){return t.value}function Gw(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function xd(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function IT(e,t,n){return r;function r(i,o,l,s){const u=Array.isArray(l.children)?n:t;return s?u(o,l,s):u(o,l)}}function PT(e,t){return n;function n(r,i,o,l){const s=Array.isArray(o.children),a=gd(r);return t(i,o,l,s,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function MT(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&yd.call(t.properties,i)){const o=LT(e,i,t.properties[i]);if(o){const[l,s]=o;e.tableCellAlignToStyle&&l==="align"&&typeof s=="string"&&vT.has(t.tagName)?r=s:n[l]=s}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function TT(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const s=l.properties[0];s.type,Object.assign(n,e.evaluater.evaluateExpression(s.argument))}else zo(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const s=r.value.data.estree.body[0];s.type,o=e.evaluater.evaluateExpression(s.expression)}else zo(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function wd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:yT;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const a=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(a){const u=i.get(a)||0;l=a+"-"+u,i.set(a,u+1)}}const s=Xw(e,o,l);s!==void 0&&n.push(s)}return n}function LT(e,t,n){const r=RM(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?bM(n):BM(n)),r.property==="style"){let i=typeof n=="object"?n:AT(e,String(n));return e.stylePropertyNameCase==="css"&&(i=zT(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?zM[r.property]||r.property:r.attribute,n]}}function AT(e,t){try{return mT(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new rt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Yw+"#cannot-parse-style-attribute",i}}function Qw(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const s=cm(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:s,computed:!!(o&&s.type==="Literal"),optional:!1}:s}r=l}else r=cm(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return yd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);zo(e)}function zo(e,t){const n=new rt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Yw+"#cannot-handle-mdx-estrees-without-createevaluater",n}function zT(e){const t={};let n;for(n in e)yd.call(e,n)&&(t[OT(n)]=e[n]);return t}function OT(e){let t=e.replace(xT,DT);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function DT(e){return"-"+e.toLowerCase()}const lu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},RT={};function vd(e,t){const n=RT,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return qw(e,r,i)}function qw(e,t,n){if(jT(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return km(e.children,t,n)}return Array.isArray(e)?km(e,t,n):""}function km(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=qw(e[i],t,n);return r.join("")}function jT(e){return!!(e&&typeof e=="object")}const Em=document.createElement("i");function kd(e){const t="&"+e+";";Em.innerHTML=t;const n=Em.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function _t(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Tt(e,t){return e.length>0?(_t(e,e.length,0,t),e):t}const Sm={}.hasOwnProperty;function Kw(e){const t={};let n=-1;for(;++n<e.length;)$T(t,e[n]);return t}function $T(e,t){let n;for(n in t){const i=(Sm.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){Sm.call(i,l)||(i[l]=[]);const s=o[l];FT(i[l],Array.isArray(s)?s:s?[s]:[])}}}function FT(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);_t(e,0,0,r)}function Zw(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Qt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=nr(/[A-Za-z]/),tt=nr(/[\dA-Za-z]/),BT=nr(/[#-'*+\--9=?A-Z^-~]/);function As(e){return e!==null&&(e<32||e===127)}const Bc=nr(/\d/),HT=nr(/[\dA-Fa-f]/),VT=nr(/[!-/:-@[-`{-~]/);function ae(e){return e!==null&&e<-2}function Ce(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const ma=nr(new RegExp("\\p{P}|\\p{S}","u")),Lr=nr(/\s/);function nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ni(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&tt(e.charCodeAt(n+1))&&tt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const s=e.charCodeAt(n+1);o<56320&&s>56319&&s<57344?(l=String.fromCharCode(o,s),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function xe(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(a){return he(a)?(e.enter(n),s(a)):t(a)}function s(a){return he(a)&&o++<i?(e.consume(a),s):(e.exit(n),t(a))}}const UT={tokenize:WT};function WT(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),xe(e,t,"linePrefix")}function i(s){return e.enter("paragraph"),o(s)}function o(s){const a=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,l(s)}function l(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return ae(s)?(e.consume(s),e.exit("chunkText"),o):(e.consume(s),l)}}const YT={tokenize:XT},_m={tokenize:GT};function XT(e){const t=this,n=[];let r=0,i,o,l;return s;function s(g){if(r<n.length){const v=n[r];return t.containerState=v[1],e.attempt(v[0].continuation,a,u)(g)}return u(g)}function a(g){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const v=t.events.length;let C=v,E;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){E=t.events[C][1].end;break}m(r);let S=v;for(;S<t.events.length;)t.events[S][1].end={...E},S++;return _t(t.events,C+1,0,t.events.slice(v)),t.events.length=S,u(g)}return s(g)}function u(g){if(r===n.length){if(!i)return d(g);if(i.currentConstruct&&i.currentConstruct.concrete)return p(g);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_m,c,f)(g)}function c(g){return i&&y(),m(r),d(g)}function f(g){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,p(g)}function d(g){return t.containerState={},e.attempt(_m,h,p)(g)}function h(g){return r++,n.push([t.currentConstruct,t.containerState]),d(g)}function p(g){if(g===null){i&&y(),m(0),e.consume(g);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(g)}function x(g){if(g===null){w(e.exit("chunkFlow"),!0),m(0),e.consume(g);return}return ae(g)?(e.consume(g),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,s):(e.consume(g),x)}function w(g,v){const C=t.sliceStream(g);if(v&&C.push(null),g.previous=o,o&&(o.next=g),o=g,i.defineSkip(g.start),i.write(C),t.parser.lazy[g.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<l&&(!i.events[E][1].end||i.events[E][1].end.offset>l))return;const S=t.events.length;let P=S,z,N;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(z){N=t.events[P][1].end;break}z=!0}for(m(r),E=S;E<t.events.length;)t.events[E][1].end={...N},E++;_t(t.events,P+1,0,t.events.slice(S)),t.events.length=E}}function m(g){let v=n.length;for(;v-- >g;){const C=n[v];t.containerState=C[1],C[0].exit.call(t,e)}n.length=g}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function GT(e,t,n){return xe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ki(e){if(e===null||Ce(e)||Lr(e))return 1;if(ma(e))return 2}function ga(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Hc={name:"attention",resolveAll:QT,tokenize:qT};function QT(e,t){let n=-1,r,i,o,l,s,a,u,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},d={...e[n][1].start};bm(f,-a),bm(d,a),l={type:a>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},s={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:d},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...l.start},end:{...s.end}},e[r][1].end={...l.start},e[n][1].start={...s.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Tt(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Tt(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=Tt(u,ga(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Tt(u,[["exit",o,t],["enter",s,t],["exit",s,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,u=Tt(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,_t(e,r-1,n-r+3,u),n=r+u.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function qT(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ki(r);let o;return l;function l(a){return o=a,e.enter("attentionSequence"),s(a)}function s(a){if(a===o)return e.consume(a),s;const u=e.exit("attentionSequence"),c=ki(a),f=!c||c===2&&i||n.includes(a),d=!i||i===2&&c||n.includes(r);return u._open=!!(o===42?f:f&&(i||!d)),u._close=!!(o===42?d:d&&(c||!f)),t(a)}}function bm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const KT={name:"autolink",tokenize:ZT};function ZT(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return lt(h)?(e.consume(h),l):h===64?n(h):u(h)}function l(h){return h===43||h===45||h===46||tt(h)?(r=1,s(h)):u(h)}function s(h){return h===58?(e.consume(h),r=0,a):(h===43||h===45||h===46||tt(h))&&r++<32?(e.consume(h),s):(r=0,u(h))}function a(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||As(h)?n(h):(e.consume(h),a)}function u(h){return h===64?(e.consume(h),c):BT(h)?(e.consume(h),u):n(h)}function c(h){return tt(h)?f(h):n(h)}function f(h){return h===46?(e.consume(h),r=0,c):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):d(h)}function d(h){if((h===45||tt(h))&&r++<63){const p=h===45?d:f;return e.consume(h),p}return n(h)}}const Qo={partial:!0,tokenize:JT};function JT(e,t,n){return r;function r(o){return he(o)?xe(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ae(o)?t(o):n(o)}}const Jw={continuation:{tokenize:tL},exit:nL,name:"blockQuote",tokenize:eL};function eL(e,t,n){const r=this;return i;function i(l){if(l===62){const s=r.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return he(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function tL(e,t,n){const r=this;return i;function i(l){return he(l)?xe(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Jw,t,n)(l)}}function nL(e){e.exit("blockQuote")}const ev={name:"characterEscape",tokenize:rL};function rL(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return VT(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const tv={name:"characterReference",tokenize:iL};function iL(e,t,n){const r=this;let i=0,o,l;return s;function s(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),a}function a(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=tt,c(f))}function u(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=HT,c):(e.enter("characterReferenceValue"),o=7,l=Bc,c(f))}function c(f){if(f===59&&i){const d=e.exit("characterReferenceValue");return l===tt&&!kd(r.sliceSerialize(d))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(f)&&i++<o?(e.consume(f),c):n(f)}}const Cm={partial:!0,tokenize:lL},Nm={concrete:!0,name:"codeFenced",tokenize:oL};function oL(e,t,n){const r=this,i={partial:!0,tokenize:C};let o=0,l=0,s;return a;function a(E){return u(E)}function u(E){const S=r.events[r.events.length-1];return o=S&&S[1].type==="linePrefix"?S[2].sliceSerialize(S[1],!0).length:0,s=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(E)}function c(E){return E===s?(l++,e.consume(E),c):l<3?n(E):(e.exit("codeFencedFenceSequence"),he(E)?xe(e,f,"whitespace")(E):f(E))}function f(E){return E===null||ae(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Cm,x,v)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(E))}function d(E){return E===null||ae(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(E)):he(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),xe(e,h,"whitespace")(E)):E===96&&E===s?n(E):(e.consume(E),d)}function h(E){return E===null||ae(E)?f(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||ae(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(E)):E===96&&E===s?n(E):(e.consume(E),p)}function x(E){return e.attempt(i,v,w)(E)}function w(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),m}function m(E){return o>0&&he(E)?xe(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ae(E)?e.check(Cm,x,v)(E):(e.enter("codeFlowValue"),g(E))}function g(E){return E===null||ae(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),g)}function v(E){return e.exit("codeFenced"),t(E)}function C(E,S,P){let z=0;return N;function N(A){return E.enter("lineEnding"),E.consume(A),E.exit("lineEnding"),T}function T(A){return E.enter("codeFencedFence"),he(A)?xe(E,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):j(A)}function j(A){return A===s?(E.enter("codeFencedFenceSequence"),$(A)):P(A)}function $(A){return A===s?(z++,E.consume(A),$):z>=l?(E.exit("codeFencedFenceSequence"),he(A)?xe(E,_,"whitespace")(A):_(A)):P(A)}function _(A){return A===null||ae(A)?(E.exit("codeFencedFence"),S(A)):P(A)}}}function lL(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const su={name:"codeIndented",tokenize:aL},sL={partial:!0,tokenize:uL};function aL(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),xe(e,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?a(u):ae(u)?e.attempt(sL,l,a)(u):(e.enter("codeFlowValue"),s(u))}function s(u){return u===null||ae(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),s)}function a(u){return e.exit("codeIndented"),t(u)}}function uL(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):ae(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):xe(e,o,"linePrefix",5)(l)}function o(l){const s=r.events[r.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):ae(l)?i(l):n(l)}}const cL={name:"codeText",previous:dL,resolve:fL,tokenize:hL};function fL(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function dL(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function hL(e,t,n){let r=0,i,o;return l;function l(f){return e.enter("codeText"),e.enter("codeTextSequence"),s(f)}function s(f){return f===96?(e.consume(f),r++,s):(e.exit("codeTextSequence"),a(f))}function a(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),a):f===96?(o=e.enter("codeTextSequence"),i=0,c(f)):ae(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),a):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||ae(f)?(e.exit("codeTextData"),a(f)):(e.consume(f),u)}function c(f){return f===96?(e.consume(f),i++,c):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(o.type="codeTextData",u(f))}}class pL{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&ji(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ji(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ji(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ji(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ji(this.left,n.reverse())}}}function ji(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function nv(e){const t={};let n=-1,r,i,o,l,s,a,u;const c=new pL(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,o=0,o<a.length&&a[o][1].type==="lineEndingBlank"&&(o+=2),o<a.length&&a[o][1].type==="content"))for(;++o<a.length&&a[o][1].type!=="content";)a[o][1].type==="chunkText"&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,mL(c,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=c.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},s=c.slice(i,n),s.unshift(r),c.splice(i,n-i+1,s))}}return _t(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!u}function mL(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const s=l.events,a=[],u={};let c,f,d=-1,h=n,p=0,x=0;const w=[x];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(c=r.sliceStream(h),h.next||c.push(null),f&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(c),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),f=h,h=h.next}for(h=n;++d<s.length;)s[d][0]==="exit"&&s[d-1][0]==="enter"&&s[d][1].type===s[d-1][1].type&&s[d][1].start.line!==s[d][1].end.line&&(x=d+1,w.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):w.pop(),d=w.length;d--;){const m=s.slice(w[d],w[d+1]),y=o.pop();a.push([y,y+m.length-1]),e.splice(y,2,m)}for(a.reverse(),d=-1;++d<a.length;)u[p+a[d][0]]=p+a[d][1],p+=a[d][1]-a[d][0]-1;return u}const gL={resolve:xL,tokenize:wL},yL={partial:!0,tokenize:vL};function xL(e){return nv(e),e}function wL(e,t){let n;return r;function r(s){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(s)}function i(s){return s===null?o(s):ae(s)?e.check(yL,l,o)(s):(e.consume(s),i)}function o(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function l(s){return e.consume(s),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function vL(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),xe(e,o,"linePrefix")}function o(l){if(l===null||ae(l))return n(l);const s=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function rv(e,t,n,r,i,o,l,s,a){const u=a||Number.POSITIVE_INFINITY;let c=0;return f;function f(m){return m===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(m),e.exit(o),d):m===null||m===32||m===41||As(m)?n(m):(e.enter(r),e.enter(l),e.enter(s),e.enter("chunkString",{contentType:"string"}),x(m))}function d(m){return m===62?(e.enter(o),e.consume(m),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===62?(e.exit("chunkString"),e.exit(s),d(m)):m===null||m===60||ae(m)?n(m):(e.consume(m),m===92?p:h)}function p(m){return m===60||m===62||m===92?(e.consume(m),h):h(m)}function x(m){return!c&&(m===null||m===41||Ce(m))?(e.exit("chunkString"),e.exit(s),e.exit(l),e.exit(r),t(m)):c<u&&m===40?(e.consume(m),c++,x):m===41?(e.consume(m),c--,x):m===null||m===32||m===40||As(m)?n(m):(e.consume(m),m===92?w:x)}function w(m){return m===40||m===41||m===92?(e.consume(m),x):x(m)}}function iv(e,t,n,r,i,o){const l=this;let s=0,a;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),c}function c(h){return s>999||h===null||h===91||h===93&&!a||h===94&&!s&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):ae(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===null||h===91||h===93||ae(h)||s++>999?(e.exit("chunkString"),c(h)):(e.consume(h),a||(a=!he(h)),h===92?d:f)}function d(h){return h===91||h===92||h===93?(e.consume(h),s++,f):f(h)}}function ov(e,t,n,r,i,o){let l;return s;function s(d){return d===34||d===39||d===40?(e.enter(r),e.enter(i),e.consume(d),e.exit(i),l=d===40?41:d,a):n(d)}function a(d){return d===l?(e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):(e.enter(o),u(d))}function u(d){return d===l?(e.exit(o),a(l)):d===null?n(d):ae(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),xe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===l||d===null||ae(d)?(e.exit("chunkString"),u(d)):(e.consume(d),d===92?f:c)}function f(d){return d===l||d===92?(e.consume(d),c):c(d)}}function oo(e,t){let n;return r;function r(i){return ae(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):he(i)?xe(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const kL={name:"definition",tokenize:SL},EL={partial:!0,tokenize:_L};function SL(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return iv.call(r,e,s,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function s(h){return i=Qt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),a):n(h)}function a(h){return Ce(h)?oo(e,u)(h):u(h)}function u(h){return rv(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function c(h){return e.attempt(EL,f,f)(h)}function f(h){return he(h)?xe(e,d,"whitespace")(h):d(h)}function d(h){return h===null||ae(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function _L(e,t,n){return r;function r(s){return Ce(s)?oo(e,i)(s):n(s)}function i(s){return ov(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function o(s){return he(s)?xe(e,l,"whitespace")(s):l(s)}function l(s){return s===null||ae(s)?t(s):n(s)}}const bL={name:"hardBreakEscape",tokenize:CL};function CL(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ae(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const NL={name:"headingAtx",resolve:IL,tokenize:PL};function IL(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},_t(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function PL(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),l(c)}function l(c){return c===35&&r++<6?(e.consume(c),l):c===null||Ce(c)?(e.exit("atxHeadingSequence"),s(c)):n(c)}function s(c){return c===35?(e.enter("atxHeadingSequence"),a(c)):c===null||ae(c)?(e.exit("atxHeading"),t(c)):he(c)?xe(e,s,"whitespace")(c):(e.enter("atxHeadingText"),u(c))}function a(c){return c===35?(e.consume(c),a):(e.exit("atxHeadingSequence"),s(c))}function u(c){return c===null||c===35||Ce(c)?(e.exit("atxHeadingText"),s(c)):(e.consume(c),u)}}const ML=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Im=["pre","script","style","textarea"],TL={concrete:!0,name:"htmlFlow",resolveTo:zL,tokenize:OL},LL={partial:!0,tokenize:RL},AL={partial:!0,tokenize:DL};function zL(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function OL(e,t,n){const r=this;let i,o,l,s,a;return u;function u(I){return c(I)}function c(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),d):I===47?(e.consume(I),o=!0,x):I===63?(e.consume(I),i=3,r.interrupt?t:k):lt(I)?(e.consume(I),l=String.fromCharCode(I),w):n(I)}function d(I){return I===45?(e.consume(I),i=2,h):I===91?(e.consume(I),i=5,s=0,p):lt(I)?(e.consume(I),i=4,r.interrupt?t:k):n(I)}function h(I){return I===45?(e.consume(I),r.interrupt?t:k):n(I)}function p(I){const G="CDATA[";return I===G.charCodeAt(s++)?(e.consume(I),s===G.length?r.interrupt?t:j:p):n(I)}function x(I){return lt(I)?(e.consume(I),l=String.fromCharCode(I),w):n(I)}function w(I){if(I===null||I===47||I===62||Ce(I)){const G=I===47,K=l.toLowerCase();return!G&&!o&&Im.includes(K)?(i=1,r.interrupt?t(I):j(I)):ML.includes(l.toLowerCase())?(i=6,G?(e.consume(I),m):r.interrupt?t(I):j(I)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?y(I):g(I))}return I===45||tt(I)?(e.consume(I),l+=String.fromCharCode(I),w):n(I)}function m(I){return I===62?(e.consume(I),r.interrupt?t:j):n(I)}function y(I){return he(I)?(e.consume(I),y):N(I)}function g(I){return I===47?(e.consume(I),N):I===58||I===95||lt(I)?(e.consume(I),v):he(I)?(e.consume(I),g):N(I)}function v(I){return I===45||I===46||I===58||I===95||tt(I)?(e.consume(I),v):C(I)}function C(I){return I===61?(e.consume(I),E):he(I)?(e.consume(I),C):g(I)}function E(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),a=I,S):he(I)?(e.consume(I),E):P(I)}function S(I){return I===a?(e.consume(I),a=null,z):I===null||ae(I)?n(I):(e.consume(I),S)}function P(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||Ce(I)?C(I):(e.consume(I),P)}function z(I){return I===47||I===62||he(I)?g(I):n(I)}function N(I){return I===62?(e.consume(I),T):n(I)}function T(I){return I===null||ae(I)?j(I):he(I)?(e.consume(I),T):n(I)}function j(I){return I===45&&i===2?(e.consume(I),O):I===60&&i===1?(e.consume(I),R):I===62&&i===4?(e.consume(I),F):I===63&&i===3?(e.consume(I),k):I===93&&i===5?(e.consume(I),L):ae(I)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(LL,B,$)(I)):I===null||ae(I)?(e.exit("htmlFlowData"),$(I)):(e.consume(I),j)}function $(I){return e.check(AL,_,B)(I)}function _(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),A}function A(I){return I===null||ae(I)?$(I):(e.enter("htmlFlowData"),j(I))}function O(I){return I===45?(e.consume(I),k):j(I)}function R(I){return I===47?(e.consume(I),l="",M):j(I)}function M(I){if(I===62){const G=l.toLowerCase();return Im.includes(G)?(e.consume(I),F):j(I)}return lt(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),M):j(I)}function L(I){return I===93?(e.consume(I),k):j(I)}function k(I){return I===62?(e.consume(I),F):I===45&&i===2?(e.consume(I),k):j(I)}function F(I){return I===null||ae(I)?(e.exit("htmlFlowData"),B(I)):(e.consume(I),F)}function B(I){return e.exit("htmlFlow"),t(I)}}function DL(e,t,n){const r=this;return i;function i(l){return ae(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function RL(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Qo,t,n)}}const jL={name:"htmlText",tokenize:$L};function $L(e,t,n){const r=this;let i,o,l;return s;function s(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),C):k===63?(e.consume(k),g):lt(k)?(e.consume(k),P):n(k)}function u(k){return k===45?(e.consume(k),c):k===91?(e.consume(k),o=0,p):lt(k)?(e.consume(k),y):n(k)}function c(k){return k===45?(e.consume(k),h):n(k)}function f(k){return k===null?n(k):k===45?(e.consume(k),d):ae(k)?(l=f,R(k)):(e.consume(k),f)}function d(k){return k===45?(e.consume(k),h):f(k)}function h(k){return k===62?O(k):k===45?d(k):f(k)}function p(k){const F="CDATA[";return k===F.charCodeAt(o++)?(e.consume(k),o===F.length?x:p):n(k)}function x(k){return k===null?n(k):k===93?(e.consume(k),w):ae(k)?(l=x,R(k)):(e.consume(k),x)}function w(k){return k===93?(e.consume(k),m):x(k)}function m(k){return k===62?O(k):k===93?(e.consume(k),m):x(k)}function y(k){return k===null||k===62?O(k):ae(k)?(l=y,R(k)):(e.consume(k),y)}function g(k){return k===null?n(k):k===63?(e.consume(k),v):ae(k)?(l=g,R(k)):(e.consume(k),g)}function v(k){return k===62?O(k):g(k)}function C(k){return lt(k)?(e.consume(k),E):n(k)}function E(k){return k===45||tt(k)?(e.consume(k),E):S(k)}function S(k){return ae(k)?(l=S,R(k)):he(k)?(e.consume(k),S):O(k)}function P(k){return k===45||tt(k)?(e.consume(k),P):k===47||k===62||Ce(k)?z(k):n(k)}function z(k){return k===47?(e.consume(k),O):k===58||k===95||lt(k)?(e.consume(k),N):ae(k)?(l=z,R(k)):he(k)?(e.consume(k),z):O(k)}function N(k){return k===45||k===46||k===58||k===95||tt(k)?(e.consume(k),N):T(k)}function T(k){return k===61?(e.consume(k),j):ae(k)?(l=T,R(k)):he(k)?(e.consume(k),T):z(k)}function j(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,$):ae(k)?(l=j,R(k)):he(k)?(e.consume(k),j):(e.consume(k),_)}function $(k){return k===i?(e.consume(k),i=void 0,A):k===null?n(k):ae(k)?(l=$,R(k)):(e.consume(k),$)}function _(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||Ce(k)?z(k):(e.consume(k),_)}function A(k){return k===47||k===62||Ce(k)?z(k):n(k)}function O(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function R(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),M}function M(k){return he(k)?xe(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):L(k)}function L(k){return e.enter("htmlTextData"),l(k)}}const Ed={name:"labelEnd",resolveAll:VL,resolveTo:UL,tokenize:WL},FL={tokenize:YL},BL={tokenize:XL},HL={tokenize:GL};function VL(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&_t(e,0,e.length,n),e}function UL(e,t){let n=e.length,r=0,i,o,l,s;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const a={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return s=[["enter",a,t],["enter",u,t]],s=Tt(s,e.slice(o+1,o+r+3)),s=Tt(s,[["enter",c,t]]),s=Tt(s,ga(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),s=Tt(s,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),s=Tt(s,e.slice(l+1)),s=Tt(s,[["exit",a,t]]),_t(e,o,e.length,s),e}function WL(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return s;function s(d){return o?o._inactive?f(d):(l=r.parser.defined.includes(Qt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),a):n(d)}function a(d){return d===40?e.attempt(FL,c,l?c:f)(d):d===91?e.attempt(BL,c,l?u:f)(d):l?c(d):f(d)}function u(d){return e.attempt(HL,c,f)(d)}function c(d){return t(d)}function f(d){return o._balanced=!0,n(d)}}function YL(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),i}function i(f){return Ce(f)?oo(e,o)(f):o(f)}function o(f){return f===41?c(f):rv(e,l,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function l(f){return Ce(f)?oo(e,a)(f):c(f)}function s(f){return n(f)}function a(f){return f===34||f===39||f===40?ov(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function u(f){return Ce(f)?oo(e,c)(f):c(f)}function c(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function XL(e,t,n){const r=this;return i;function i(s){return iv.call(r,e,o,l,"reference","referenceMarker","referenceString")(s)}function o(s){return r.parser.defined.includes(Qt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(s):n(s)}function l(s){return n(s)}}function GL(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const QL={name:"labelStartImage",resolveAll:Ed.resolveAll,tokenize:qL};function qL(e,t,n){const r=this;return i;function i(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),o}function o(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),l):n(s)}function l(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const KL={name:"labelStartLink",resolveAll:Ed.resolveAll,tokenize:ZL};function ZL(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const au={name:"lineEnding",tokenize:JL};function JL(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),xe(e,t,"linePrefix")}}const Yl={name:"thematicBreak",tokenize:eA};function eA(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,s(u)}function s(u){return u===i?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||ae(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),he(u)?xe(e,s,"whitespace")(u):s(u))}}const ct={continuation:{tokenize:iA},exit:lA,name:"list",tokenize:rA},tA={partial:!0,tokenize:sA},nA={partial:!0,tokenize:oA};function rA(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return s;function s(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Bc(h)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Yl,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(h)}return n(h)}function a(h){return Bc(h)&&++l<10?(e.consume(h),a):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Qo,r.interrupt?n:c,e.attempt(tA,d,f))}function c(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function f(h){return he(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):n(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function iA(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Qo,i,o);function i(s){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,xe(e,t,"listItemIndent",r.containerState.size+1)(s)}function o(s){return r.containerState.furtherBlankLines||!he(s)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(s)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(nA,t,l)(s))}function l(s){return r.containerState._closeFlow=!0,r.interrupt=void 0,xe(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function oA(e,t,n){const r=this;return xe(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function lA(e){e.exit(this.containerState.type)}function sA(e,t,n){const r=this;return xe(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!he(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pm={name:"setextUnderline",resolveTo:aA,tokenize:uA};function aA(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function uA(e,t,n){const r=this;let i;return o;function o(u){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),s(u)}function s(u){return u===i?(e.consume(u),s):(e.exit("setextHeadingLineSequence"),he(u)?xe(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||ae(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const cA={tokenize:fA};function fA(e){const t=this,n=e.attempt(Qo,r,e.attempt(this.parser.constructs.flowInitial,i,xe(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gL,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const dA={resolveAll:sv()},hA=lv("string"),pA=lv("text");function lv(e){return{resolveAll:sv(e==="text"?mA:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,s);return l;function l(c){return u(c)?o(c):s(c)}function s(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),a}function a(c){return u(c)?(n.exit("data"),o(c)):(n.consume(c),a)}function u(c){if(c===null)return!0;const f=i[c];let d=-1;if(f)for(;++d<f.length;){const h=f[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function sv(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function mA(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,s=0,a;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)s++,l--;if(l)break;l=-1}else if(u===-2)a=!0,s++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){const u={type:n===e.length||a||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const gA={42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:Jw},yA={91:kL},xA={[-2]:su,[-1]:su,32:su},wA={35:NL,42:Yl,45:[Pm,Yl],60:TL,61:Pm,95:Yl,96:Nm,126:Nm},vA={38:tv,92:ev},kA={[-5]:au,[-4]:au,[-3]:au,33:QL,38:tv,42:Hc,60:[KT,jL],91:KL,92:[bL,ev],93:Ed,95:Hc,96:cL},EA={null:[Hc,dA]},SA={null:[42,95]},_A={null:[]},bA=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:SA,contentInitial:yA,disable:_A,document:gA,flow:wA,flowInitial:xA,insideSpan:EA,string:vA,text:kA},Symbol.toStringTag,{value:"Module"}));function CA(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],s=[];const a={attempt:S(C),check:S(E),consume:y,enter:g,exit:v,interrupt:S(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:x,events:[],now:p,parser:e,previous:null,sliceSerialize:d,sliceStream:h,write:f};let c=t.tokenize.call(u,a);return t.resolveAll&&o.push(t),u;function f(T){return l=Tt(l,T),w(),l[l.length-1]!==null?[]:(P(t,0),u.events=ga(o,u.events,u),u.events)}function d(T,j){return IA(h(T),j)}function h(T){return NA(l,T)}function p(){const{_bufferIndex:T,_index:j,line:$,column:_,offset:A}=r;return{_bufferIndex:T,_index:j,line:$,column:_,offset:A}}function x(T){i[T.line]=T.column,N()}function w(){let T;for(;r._index<l.length;){const j=l[r._index];if(typeof j=="string")for(T=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===T&&r._bufferIndex<j.length;)m(j.charCodeAt(r._bufferIndex));else m(j)}}function m(T){c=c(T)}function y(T){ae(T)?(r.line++,r.column=1,r.offset+=T===-3?2:1,N()):T!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=T}function g(T,j){const $=j||{};return $.type=T,$.start=p(),u.events.push(["enter",$,u]),s.push($),$}function v(T){const j=s.pop();return j.end=p(),u.events.push(["exit",j,u]),j}function C(T,j){P(T,j.from)}function E(T,j){j.restore()}function S(T,j){return $;function $(_,A,O){let R,M,L,k;return Array.isArray(_)?B(_):"tokenize"in _?B([_]):F(_);function F(q){return te;function te(V){const Q=V!==null&&q[V],Z=V!==null&&q.null,oe=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(Z)?Z:Z?[Z]:[]];return B(oe)(V)}}function B(q){return R=q,M=0,q.length===0?O:I(q[M])}function I(q){return te;function te(V){return k=z(),L=q,q.partial||(u.currentConstruct=q),q.name&&u.parser.constructs.disable.null.includes(q.name)?K():q.tokenize.call(j?Object.assign(Object.create(u),j):u,a,G,K)(V)}}function G(q){return T(L,k),A}function K(q){return k.restore(),++M<R.length?I(R[M]):O}}}function P(T,j){T.resolveAll&&!o.includes(T)&&o.push(T),T.resolve&&_t(u.events,j,u.events.length-j,T.resolve(u.events.slice(j),u)),T.resolveTo&&(u.events=T.resolveTo(u.events,u))}function z(){const T=p(),j=u.previous,$=u.currentConstruct,_=u.events.length,A=Array.from(s);return{from:_,restore:O};function O(){r=T,u.previous=j,u.currentConstruct=$,u.events.length=_,s=A,N()}}function N(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function NA(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const s=l[0];typeof s=="string"?l[0]=s.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function IA(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
64
- `;break}case-3:{l=`\r
65
- `;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function PA(e){const r={constructs:Kw([bA,...(e||{}).extensions||[]]),content:i(UT),defined:[],document:i(YT),flow:i(cA),lazy:{},string:i(hA),text:i(pA)};return r;function i(o){return l;function l(s){return CA(r,o,s)}}}function MA(e){for(;!nv(e););return e}const Mm=/[\0\t\n\r]/g;function TA(){let e=1,t="",n=!0,r;return i;function i(o,l,s){const a=[];let u,c,f,d,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),f=0,t="",n&&(o.charCodeAt(0)===65279&&f++,n=void 0);f<o.length;){if(Mm.lastIndex=f,u=Mm.exec(o),d=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(d),!u){t=o.slice(f);break}if(h===10&&f===d&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),f<d&&(a.push(o.slice(f,d)),e+=d-f),h){case 0:{a.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,a.push(-2);e++<c;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}f=d+1}return s&&(r&&a.push(-5),t&&a.push(t),a.push(null)),a}}const LA=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function AA(e){return e.replace(LA,zA)}function zA(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Zw(n.slice(o?2:1),o?16:10)}return kd(n)||e}const av={}.hasOwnProperty;function OA(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),DA(n)(MA(PA(n).document().write(TA()(e,t,!0))))}function DA(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ke),autolinkProtocol:z,autolinkEmail:z,atxHeading:o(de),blockQuote:o(Z),characterEscape:z,characterReference:z,codeFenced:o(oe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(oe,l),codeText:o(ne,l),codeTextData:z,data:z,codeFlowValue:z,definition:o(re),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(ce),hardBreakEscape:o(me),hardBreakTrailing:o(me),htmlFlow:o(_e,l),htmlFlowData:z,htmlText:o(_e,l),htmlTextData:z,image:o(Xe),label:l,link:o(Ke),listItem:o(ee),listItemValue:d,listOrdered:o(U,f),listUnordered:o(U),paragraph:o(ge),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(de),strong:o(se),thematicBreak:o(ye)},exit:{atxHeading:a(),atxHeadingSequence:C,autolink:a(),autolinkEmail:Q,autolinkProtocol:V,blockQuote:a(),characterEscapeValue:N,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:q,characterReference:te,codeFenced:a(w),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:p,codeFlowValue:N,codeIndented:a(m),codeText:a(A),codeTextData:N,data:N,definition:a(),definitionDestinationString:v,definitionLabelString:y,definitionTitleString:g,emphasis:a(),hardBreakEscape:a(j),hardBreakTrailing:a(j),htmlFlow:a($),htmlFlowData:N,htmlText:a(_),htmlTextData:N,image:a(R),label:L,labelText:M,lineEnding:T,link:a(O),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:G,resourceDestinationString:k,resourceTitleString:F,resource:B,setextHeading:a(P),setextHeadingLineSequence:S,setextHeadingText:E,strong:a(),thematicBreak:a()}};uv(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let Y={type:"root",children:[]};const le={stack:[Y],tokenStack:[],config:t,enter:s,exit:u,buffer:l,resume:c,data:n},fe=[];let ke=-1;for(;++ke<H.length;)if(H[ke][1].type==="listOrdered"||H[ke][1].type==="listUnordered")if(H[ke][0]==="enter")fe.push(ke);else{const xt=fe.pop();ke=i(H,xt,ke)}for(ke=-1;++ke<H.length;){const xt=t[H[ke][0]];av.call(xt,H[ke][1].type)&&xt[H[ke][1].type].call(Object.assign({sliceSerialize:H[ke][2].sliceSerialize},le),H[ke][1])}if(le.tokenStack.length>0){const xt=le.tokenStack[le.tokenStack.length-1];(xt[1]||Tm).call(le,void 0,xt[0])}for(Y.position={start:zn(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:zn(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},ke=-1;++ke<t.transforms.length;)Y=t.transforms[ke](Y)||Y;return Y}function i(H,Y,le){let fe=Y-1,ke=-1,xt=!1,hn,Rt,rr,ir;for(;++fe<=le;){const it=H[fe];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?ke++:ke--,ir=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(hn&&!ir&&!ke&&!rr&&(rr=fe),ir=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ir=void 0}if(!ke&&it[0]==="enter"&&it[1].type==="listItemPrefix"||ke===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(hn){let Mn=fe;for(Rt=void 0;Mn--;){const jt=H[Mn];if(jt[1].type==="lineEnding"||jt[1].type==="lineEndingBlank"){if(jt[0]==="exit")continue;Rt&&(H[Rt][1].type="lineEndingBlank",xt=!0),jt[1].type="lineEnding",Rt=Mn}else if(!(jt[1].type==="linePrefix"||jt[1].type==="blockQuotePrefix"||jt[1].type==="blockQuotePrefixWhitespace"||jt[1].type==="blockQuoteMarker"||jt[1].type==="listItemIndent"))break}rr&&(!Rt||rr<Rt)&&(hn._spread=!0),hn.end=Object.assign({},Rt?H[Rt][1].start:it[1].end),H.splice(Rt||fe,0,["exit",hn,it[2]]),fe++,le++}if(it[1].type==="listItemPrefix"){const Mn={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};hn=Mn,H.splice(fe,0,["enter",Mn,it[2]]),fe++,le++,rr=void 0,ir=!0}}}return H[Y][1]._spread=xt,le}function o(H,Y){return le;function le(fe){s.call(this,H(fe),fe),Y&&Y.call(this,fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function s(H,Y,le){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([Y,le||void 0]),H.position={start:zn(Y.start),end:void 0}}function a(H){return Y;function Y(le){H&&H.call(this,le),u.call(this,le)}}function u(H,Y){const le=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==H.type&&(Y?Y.call(this,H,fe[0]):(fe[1]||Tm).call(this,H,fe[0]));else throw new Error("Cannot close `"+H.type+"` ("+io({start:H.start,end:H.end})+"): it’s not open");le.position.end=zn(H.end)}function c(){return vd(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function d(H){if(this.data.expectingFirstListItemValue){const Y=this.stack[this.stack.length-2];Y.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function h(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.lang=H}function p(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.meta=H}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function m(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H.replace(/(\r?\n|\r)$/g,"")}function y(H){const Y=this.resume(),le=this.stack[this.stack.length-1];le.label=Y,le.identifier=Qt(this.sliceSerialize(H)).toLowerCase()}function g(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.title=H}function v(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.url=H}function C(H){const Y=this.stack[this.stack.length-1];if(!Y.depth){const le=this.sliceSerialize(H).length;Y.depth=le}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function S(H){const Y=this.stack[this.stack.length-1];Y.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function z(H){const le=this.stack[this.stack.length-1].children;let fe=le[le.length-1];(!fe||fe.type!=="text")&&(fe=Ee(),fe.position={start:zn(H.start),end:void 0},le.push(fe)),this.stack.push(fe)}function N(H){const Y=this.stack.pop();Y.value+=this.sliceSerialize(H),Y.position.end=zn(H.end)}function T(H){const Y=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=Y.children[Y.children.length-1];le.position.end=zn(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Y.type)&&(z.call(this,H),N.call(this,H))}function j(){this.data.atHardBreak=!0}function $(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H}function _(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H}function A(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.value=H}function O(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Y,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function R(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const Y=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=Y,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function M(H){const Y=this.sliceSerialize(H),le=this.stack[this.stack.length-2];le.label=AA(Y),le.identifier=Qt(Y).toLowerCase()}function L(){const H=this.stack[this.stack.length-1],Y=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const fe=H.children;le.children=fe}else le.alt=Y}function k(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.url=H}function F(){const H=this.resume(),Y=this.stack[this.stack.length-1];Y.title=H}function B(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function G(H){const Y=this.resume(),le=this.stack[this.stack.length-1];le.label=Y,le.identifier=Qt(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function K(H){this.data.characterReferenceType=H.type}function q(H){const Y=this.sliceSerialize(H),le=this.data.characterReferenceType;let fe;le?(fe=Zw(Y,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=kd(Y);const ke=this.stack[this.stack.length-1];ke.value+=fe}function te(H){const Y=this.stack.pop();Y.position.end=zn(H.end)}function V(H){N.call(this,H);const Y=this.stack[this.stack.length-1];Y.url=this.sliceSerialize(H)}function Q(H){N.call(this,H);const Y=this.stack[this.stack.length-1];Y.url="mailto:"+this.sliceSerialize(H)}function Z(){return{type:"blockquote",children:[]}}function oe(){return{type:"code",lang:null,meta:null,value:""}}function ne(){return{type:"inlineCode",value:""}}function re(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ce(){return{type:"emphasis",children:[]}}function de(){return{type:"heading",depth:0,children:[]}}function me(){return{type:"break"}}function _e(){return{type:"html",value:""}}function Xe(){return{type:"image",title:null,url:"",alt:null}}function Ke(){return{type:"link",title:null,url:"",children:[]}}function U(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function ee(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function ge(){return{type:"paragraph",children:[]}}function se(){return{type:"strong",children:[]}}function Ee(){return{type:"text",value:""}}function ye(){return{type:"thematicBreak"}}}function zn(e){return{line:e.line,column:e.column,offset:e.offset}}function uv(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?uv(e,r):RA(e,r)}}function RA(e,t){let n;for(n in t)if(av.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Tm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+io({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+io({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+io({start:t.start,end:t.end})+") is still open")}function jA(e){const t=this;t.parser=n;function n(r){return OA(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $A(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function FA(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
66
- `}]}function BA(e,t){const n=t.value?t.value+`
67
- `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function HA(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VA(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UA(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Ni(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,s+=1,e.footnoteCounts.set(r,s);const a={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(s>1?"-"+s:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,a);const u={type:"element",tagName:"sup",properties:{},children:[a]};return e.patch(t,u),e.applyData(t,u)}function WA(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function YA(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function cv(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const l=i[i.length-1];return l&&l.type==="text"?l.value+=r:i.push({type:"text",value:r}),i}function XA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return cv(e,t);const i={src:Ni(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function GA(e,t){const n={src:Ni(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function QA(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function qA(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return cv(e,t);const i={href:Ni(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function KA(e,t){const n={href:Ni(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ZA(e,t,n){const r=e.all(t),i=n?JA(n):fv(t),o={},l=[];if(typeof t.checked=="boolean"){const c=r[0];let f;c&&c.type==="element"&&c.tagName==="p"?f=c:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let s=-1;for(;++s<r.length;){const c=r[s];(i||s!==0||c.type!=="element"||c.tagName!=="p")&&l.push({type:"text",value:`
68
- `}),c.type==="element"&&c.tagName==="p"&&!i?l.push(...c.children):l.push(c)}const a=r[r.length-1];a&&(i||a.type!=="element"||a.tagName!=="p")&&l.push({type:"text",value:`
69
- `});const u={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,u),e.applyData(t,u)}function JA(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=fv(n[r])}return t}function fv(e){const t=e.spread;return t??e.children.length>1}function ez(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const l=r[i];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function tz(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nz(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function rz(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iz(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),i.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},s=gd(t.children[1]),a=Uw(t.children[t.children.length-1]);s&&a&&(l.position={start:s,end:a}),i.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function oz(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,s=l?l.length:t.children.length;let a=-1;const u=[];for(;++a<s;){const f=t.children[a],d={},h=l?l[a]:void 0;h&&(d.align=h);let p={type:"element",tagName:o,properties:d,children:[]};f&&(p.children=e.all(f),e.patch(f,p),p=e.applyData(f,p)),u.push(p)}const c={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,c),e.applyData(t,c)}function lz(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Lm=9,Am=32;function sz(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(zm(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(zm(t.slice(i),i>0,!1)),o.join("")}function zm(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Lm||o===Am;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Lm||o===Am;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function az(e,t){const n={type:"text",value:sz(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function uz(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cz={blockquote:$A,break:FA,code:BA,delete:HA,emphasis:VA,footnoteReference:UA,heading:WA,html:YA,imageReference:XA,image:GA,inlineCode:QA,linkReference:qA,link:KA,listItem:ZA,list:ez,paragraph:tz,root:nz,strong:rz,table:iz,tableCell:lz,tableRow:oz,text:az,thematicBreak:uz,toml:_l,yaml:_l,definition:_l,footnoteDefinition:_l};function _l(){}const dv=-1,ya=0,lo=1,zs=2,Sd=3,_d=4,bd=5,Cd=6,hv=7,pv=8,mv=typeof self=="object"?self:globalThis,Om=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new mv[e](t)},fz=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,l]=t[i];switch(o){case ya:case dv:return n(l,i);case lo:{const s=n([],i);for(const a of l)s.push(r(a));return s}case zs:{const s=n({},i);for(const[a,u]of l)s[r(a)]=r(u);return s}case Sd:return n(new Date(l),i);case _d:{const{source:s,flags:a}=l;return n(new RegExp(s,a),i)}case bd:{const s=n(new Map,i);for(const[a,u]of l)s.set(r(a),r(u));return s}case Cd:{const s=n(new Set,i);for(const a of l)s.add(r(a));return s}case hv:{const{name:s,message:a}=l;return n(typeof mv[s]=="function"?Om(s,a):new Error(a),i)}case pv:return n(BigInt(l),i);case"BigInt":return n(Object(BigInt(l)),i);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:s}=new Uint8Array(l);return n(new DataView(s),l)}}return n(Om(o,l),i)};return r},Dm=e=>fz(new Map,e)(0),cr="",{toString:dz}={},{keys:hz}=Object,$i=e=>{const t=typeof e;if(t!=="object"||!e)return[ya,t];const n=dz.call(e).slice(8,-1);switch(n){case"Array":return[lo,cr];case"Object":return[zs,cr];case"Date":return[Sd,cr];case"RegExp":return[_d,cr];case"Map":return[bd,cr];case"Set":return[Cd,cr];case"DataView":return[lo,n]}return n.includes("Array")?[lo,n]:e instanceof Error?[hv,e.name||"Error"]:[zs,n]},bl=([e,t])=>e===ya&&(t==="function"||t==="symbol"),pz=(e,t,n,r)=>{const i=(l,s)=>{const a=r.push(l)-1;return n.set(s,a),a},o=l=>{if(n.has(l))return n.get(l);let[s,a]=$i(l);switch(s){case ya:{let c=l;switch(a){case"bigint":s=pv,c=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+a);c=null;break;case"undefined":return i([dv],l)}return i([s,c],l)}case lo:{if(a){let d=l;return a==="DataView"?d=new Uint8Array(l.buffer):a==="ArrayBuffer"&&(d=new Uint8Array(l)),i([a,[...d]],l)}const c=[],f=i([s,c],l);for(const d of l)c.push(o(d));return f}case zs:{if(a)switch(a){case"BigInt":return i([a,l.toString()],l);case"Boolean":case"Number":case"String":return i([a,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const c=[],f=i([s,c],l);for(const d of hz(l))(e||!bl($i(l[d])))&&c.push([o(d),o(l[d])]);return f}case Sd:return i([s,isNaN(l.getTime())?cr:l.toISOString()],l);case _d:{const{source:c,flags:f}=l;return i([s,{source:c,flags:f}],l)}case bd:{const c=[],f=i([s,c],l);for(const[d,h]of l)(e||!(bl($i(d))||bl($i(h))))&&c.push([o(d),o(h)]);return f}case Cd:{const c=[],f=i([s,c],l);for(const d of l)(e||!bl($i(d)))&&c.push(o(d));return f}}const{message:u}=l;return i([s,{name:a,message:u}],l)};return o},Rm=(e,{json:t,lossy:n}={})=>{const r=[];return pz(!(t||n),!!t,new Map,r)(e),r},Os=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Dm(Rm(e,t)):structuredClone(e):(e,t)=>Dm(Rm(e,t));function mz(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function gz(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function yz(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||mz,r=e.options.footnoteBackLabel||gz,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},s=[];let a=-1;for(;++a<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[a]);if(!u)continue;const c=e.all(u),f=String(u.identifier).toUpperCase(),d=Ni(f.toLowerCase());let h=0;const p=[],x=e.footnoteCounts.get(f);for(;x!==void 0&&++h<=x;){p.length>0&&p.push({type:"text",value:" "});let y=typeof n=="string"?n:n(a,h);typeof y=="string"&&(y={type:"text",value:y}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(a,h),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const w=c[c.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const y=w.children[w.children.length-1];y&&y.type==="text"?y.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...p)}else c.push(...p);const m={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(c,!0)};e.patch(u,m),s.push(m)}if(s.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Os(l),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
70
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(s,!0)},{type:"text",value:`
71
- `}]}}const xa=function(e){if(e==null)return kz;if(typeof e=="function")return wa(e);if(typeof e=="object")return Array.isArray(e)?xz(e):wz(e);if(typeof e=="string")return vz(e);throw new Error("Expected function, string, or object as test")};function xz(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=xa(e[n]);return wa(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function wz(e){const t=e;return wa(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function vz(e){return wa(t);function t(n){return n&&n.type===e}}function wa(e){return t;function t(n,r,i){return!!(Ez(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function kz(){return!0}function Ez(e){return e!==null&&typeof e=="object"&&"type"in e}const gv=[],Sz=!0,Vc=!1,_z="skip";function yv(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=xa(i),l=r?-1:1;s(e,void 0,[])();function s(a,u,c){const f=a&&typeof a=="object"?a:{};if(typeof f.type=="string"){const h=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(d,"name",{value:"node ("+(a.type+(h?"<"+h+">":""))+")"})}return d;function d(){let h=gv,p,x,w;if((!t||o(a,u,c[c.length-1]||void 0))&&(h=bz(n(a,c)),h[0]===Vc))return h;if("children"in a&&a.children){const m=a;if(m.children&&h[0]!==_z)for(x=(r?m.children.length:-1)+l,w=c.concat(m);x>-1&&x<m.children.length;){const y=m.children[x];if(p=s(y,x,w)(),p[0]===Vc)return p;x=typeof p[1]=="number"?p[1]:x+l}}return h}}}function bz(e){return Array.isArray(e)?e:typeof e=="number"?[Sz,e]:e==null?gv:[e]}function Nd(e,t,n,r){let i,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,i=n):(o=t,l=n,i=r),yv(e,o,s,i);function s(a,u){const c=u[u.length-1],f=c?c.children.indexOf(a):void 0;return l(a,f,c)}}const Uc={}.hasOwnProperty,Cz={};function Nz(e,t){const n=t||Cz,r=new Map,i=new Map,o=new Map,l={...cz,...n.handlers},s={all:u,applyData:Pz,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:l,one:a,options:n,patch:Iz,wrap:Tz};return Nd(e,function(c){if(c.type==="definition"||c.type==="footnoteDefinition"){const f=c.type==="definition"?r:i,d=String(c.identifier).toUpperCase();f.has(d)||f.set(d,c)}}),s;function a(c,f){const d=c.type,h=s.handlers[d];if(Uc.call(s.handlers,d)&&h)return h(s,c,f);if(s.options.passThrough&&s.options.passThrough.includes(d)){if("children"in c){const{children:x,...w}=c,m=Os(w);return m.children=s.all(c),m}return Os(c)}return(s.options.unknownHandler||Mz)(s,c,f)}function u(c){const f=[];if("children"in c){const d=c.children;let h=-1;for(;++h<d.length;){const p=s.one(d[h],c);if(p){if(h&&d[h-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=jm(p.value)),!Array.isArray(p)&&p.type==="element")){const x=p.children[0];x&&x.type==="text"&&(x.value=jm(x.value))}Array.isArray(p)?f.push(...p):f.push(p)}}}return f}}function Iz(e,t){e.position&&(t.position=gT(e))}function Pz(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,Os(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Mz(e,t){const n=t.data||{},r="value"in t&&!(Uc.call(n,"hProperties")||Uc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Tz(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
72
- `});++r<e.length;)r&&n.push({type:"text",value:`
73
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
74
- `}),n}function jm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function $m(e,t){const n=Nz(e,t),r=n.one(e,void 0),i=yz(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
75
- `},i),o}function Lz(e,t){return e&&"run"in e?async function(n,r){const i=$m(n,{file:r,...t});await e.run(i,r)}:function(n,r){return $m(n,{file:r,...e||t})}}function Fm(e){if(e)throw e}var Xl=Object.prototype.hasOwnProperty,xv=Object.prototype.toString,Bm=Object.defineProperty,Hm=Object.getOwnPropertyDescriptor,Vm=function(t){return typeof Array.isArray=="function"?Array.isArray(t):xv.call(t)==="[object Array]"},Um=function(t){if(!t||xv.call(t)!=="[object Object]")return!1;var n=Xl.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Xl.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Xl.call(t,i)},Wm=function(t,n){Bm&&n.name==="__proto__"?Bm(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Ym=function(t,n){if(n==="__proto__")if(Xl.call(t,n)){if(Hm)return Hm(t,n).value}else return;return t[n]},Az=function e(){var t,n,r,i,o,l,s=arguments[0],a=1,u=arguments.length,c=!1;for(typeof s=="boolean"&&(c=s,s=arguments[1]||{},a=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});a<u;++a)if(t=arguments[a],t!=null)for(n in t)r=Ym(s,n),i=Ym(t,n),s!==i&&(c&&i&&(Um(i)||(o=Vm(i)))?(o?(o=!1,l=r&&Vm(r)?r:[]):l=r&&Um(r)?r:{},Wm(s,{name:n,newValue:e(c,l,i)})):typeof i<"u"&&Wm(s,{name:n,newValue:i}));return s};const uu=Do(Az);function Wc(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zz(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const l=i.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);s(null,...i);function s(a,...u){const c=e[++o];let f=-1;if(a){l(a);return}for(;++f<i.length;)(u[f]===null||u[f]===void 0)&&(u[f]=i[f]);i=u,c?Oz(c,s)(...u):l(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Oz(e,t){let n;return r;function r(...l){const s=e.length>l.length;let a;s&&l.push(i);try{a=e.apply(this,l)}catch(u){const c=u;if(s&&n)throw c;return i(c)}s||(a&&a.then&&typeof a.then=="function"?a.then(o,i):a instanceof Error?i(a):o(a))}function i(l,...s){n||(n=!0,t(l,...s))}function o(l){i(null,l)}}const rn={basename:Dz,dirname:Rz,extname:jz,join:$z,sep:"/"};function Dz(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');qo(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else l<0&&(o=!0,l=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function Rz(e){if(qo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function jz(e){qo(e);let t=e.length,n=-1,r=0,i=-1,o=0,l;for(;t--;){const s=e.codePointAt(t);if(s===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),s===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function $z(...e){let t=-1,n;for(;++t<e.length;)qo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Fz(n)}function Fz(e){qo(e);const t=e.codePointAt(0)===47;let n=Bz(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Bz(e,t){let n="",r=0,i=-1,o=0,l=-1,s,a;for(;++l<=e.length;){if(l<e.length)s=e.codePointAt(l);else{if(s===47)break;s=47}if(s===47){if(!(i===l-1||o===1))if(i!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(a=n.lastIndexOf("/"),a!==n.length-1){a<0?(n="",r=0):(n=n.slice(0,a),r=n.length-1-n.lastIndexOf("/")),i=l,o=0;continue}}else if(n.length>0){n="",r=0,i=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,l):n=e.slice(i+1,l),r=l-i-1;i=l,o=0}else s===46&&o>-1?o++:o=-1}return n}function qo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Hz={cwd:Vz};function Vz(){return"/"}function Yc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Uz(e){if(typeof e=="string")e=new URL(e);else if(!Yc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Wz(e)}function Wz(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const cu=["history","path","basename","stem","extname","dirname"];class wv{constructor(t){let n;t?Yc(t)?n={path:t}:typeof t=="string"||Yz(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Hz.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<cu.length;){const o=cu[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)cu.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?rn.basename(this.path):void 0}set basename(t){du(t,"basename"),fu(t,"basename"),this.path=rn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?rn.dirname(this.path):void 0}set dirname(t){Xm(this.basename,"dirname"),this.path=rn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?rn.extname(this.path):void 0}set extname(t){if(fu(t,"extname"),Xm(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=rn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Yc(t)&&(t=Uz(t)),du(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?rn.basename(this.path,this.extname):void 0}set stem(t){du(t,"stem"),fu(t,"stem"),this.path=rn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new rt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function fu(e,t){if(e&&e.includes(rn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+rn.sep+"`")}function du(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Xm(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Yz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Xz=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},Gz={}.hasOwnProperty;class Id extends Xz{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zz()}copy(){const t=new Id;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(uu(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(mu("data",this.frozen),this.namespace[t]=n,this):Gz.call(this.namespace,t)&&this.namespace[t]||void 0:t?(mu("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Cl(t),r=this.parser||this.Parser;return hu("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),hu("process",this.parser||this.Parser),pu("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,l){const s=Cl(t),a=r.parse(s);r.run(a,s,function(c,f,d){if(c||!f||!d)return u(c);const h=f,p=r.stringify(h,d);Kz(p)?d.value=p:d.result=p,u(c,d)});function u(c,f){c||!f?l(c):o?o(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),hu("processSync",this.parser||this.Parser),pu("processSync",this.compiler||this.Compiler),this.process(t,i),Qm("processSync","process",n),r;function i(o,l){n=!0,Fm(o),r=l}}run(t,n,r){Gm(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,s){const a=Cl(n);i.run(t,a,u);function u(c,f,d){const h=f||t;c?s(c):l?l(h):r(void 0,h,d)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),Qm("runSync","run",r),i;function o(l,s){Fm(l),i=s,r=!0}}stringify(t,n){this.freeze();const r=Cl(n),i=this.compiler||this.Compiler;return pu("stringify",i),Gm(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(mu("use",this.frozen),t!=null)if(typeof t=="function")a(t,n);else if(typeof t=="object")Array.isArray(t)?s(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")a(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[c,...f]=u;a(c,f)}else l(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function l(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(u.plugins),u.settings&&(i.settings=uu(!0,i.settings,u.settings))}function s(u){let c=-1;if(u!=null)if(Array.isArray(u))for(;++c<u.length;){const f=u[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function a(u,c){let f=-1,d=-1;for(;++f<r.length;)if(r[f][0]===u){d=f;break}if(d===-1)r.push([u,...c]);else if(c.length>0){let[h,...p]=c;const x=r[d][1];Wc(x)&&Wc(h)&&(h=uu(!0,x,h)),r[d]=[u,h,...p]}}}}const Qz=new Id().freeze();function hu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function pu(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mu(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Gm(e){if(!Wc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Qm(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Cl(e){return qz(e)?e:new wv(e)}function qz(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Kz(e){return typeof e=="string"||Zz(e)}function Zz(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Jz="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",qm=[],Km={allowDangerousHtml:!0},eO=/^(https?|ircs?|mailto|xmpp)$/i,tO=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function nO(e){const t=rO(e),n=iO(e);return oO(t.runSync(t.parse(n),n),e)}function rO(e){const t=e.rehypePlugins||qm,n=e.remarkPlugins||qm,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Km}:Km;return Qz().use(jA).use(n).use(Lz,r).use(t)}function iO(e){const t=e.children||"",n=new wv;return typeof t=="string"&&(n.value=t),n}function oO(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,o=t.disallowedElements,l=t.skipHtml,s=t.unwrapDisallowed,a=t.urlTransform||lO;for(const c of tO)Object.hasOwn(t,c.from)&&(""+c.from+(c.to?"use `"+c.to+"` instead":"remove it")+Jz+c.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Nd(e,u),kT(e,{Fragment:b.Fragment,components:i,ignoreInvalidStyle:!0,jsx:b.jsx,jsxs:b.jsxs,passKeys:!0,passNode:!0});function u(c,f,d){if(c.type==="raw"&&d&&typeof f=="number")return l?d.children.splice(f,1):d.children[f]={type:"text",value:c.value},f;if(c.type==="element"){let h;for(h in lu)if(Object.hasOwn(lu,h)&&Object.hasOwn(c.properties,h)){const p=c.properties[h],x=lu[h];(x===null||x.includes(c.tagName))&&(c.properties[h]=a(String(p||""),h,c))}}if(c.type==="element"){let h=n?!n.includes(c.tagName):o?o.includes(c.tagName):!1;if(!h&&r&&typeof f=="number"&&(h=!r(c,f,d)),h&&d&&typeof f=="number")return s&&c.children?d.children.splice(f,1,...c.children):d.children.splice(f,1),f}}}function lO(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||eO.test(e.slice(0,t))?e:""}function vv({title:e,count:t,open:n,onToggle:r,children:i}){return b.jsxs("div",{className:"section",children:[b.jsxs("button",{className:"section__head",onClick:r,"aria-expanded":n,children:[b.jsx("span",{className:"section__caret","aria-hidden":"true",children:n?"▾":"▸"}),e,t!==void 0&&t>0&&b.jsx("span",{className:"section__count",children:t})]}),n&&b.jsx("div",{className:"section__body",children:i})]})}const Pd=()=>({});function sO(e,t){return e===void 0?Promise.resolve({mode:"local"}):e.start(t)}const Xc="/api/store",kv=()=>new URLSearchParams(window.location.search).get("t"),Ev=()=>kv()!==null||Object.keys(Pd()).length>0;function Md(e){const t=kv(),n=Pd();if(t!==null)return{"x-apm-token":t,...n};if(Object.keys(n).length>0)return n;throw new Error(`this viewer is read-only - open it with the open_viewer tool to ${e}`)}async function aO(e,t,n){const r=await fetch(`/api/ticket?project=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"POST",headers:{"content-type":"application/json",...Md("change a status")},body:JSON.stringify({status:n})});if(!r.ok)throw new Error((await r.json()).error??`could not change the status (${r.status})`)}async function uO(e,t){const n=await fetch(`/api/media/${t}?project=${encodeURIComponent(e)}`,{method:"DELETE",headers:Md("remove an image")});if(!n.ok)throw new Error((await n.json()).error??`remove failed (${n.status})`)}async function cO(e,t,n){const r=await fetch(`/api/media?project=${encodeURIComponent(e)}&ref=${encodeURIComponent(t)}`,{method:"POST",headers:{"content-type":n.type,...Md("upload")},body:n}),i=await r.json();if(!r.ok)throw new Error(i.error??`upload failed (${r.status})`);return{hash:i.hash,mime:i.mime,bytes:i.bytes,at:new Date().toISOString()}}function fO(e,t){const n=new Map;for(const r of e)n.set(t(r),[...n.get(t(r))??[],r]);return n}async function dO(){const e=await fetch(Xc,{headers:Pd()});if(!e.ok)throw new Error(`${Xc} returned ${e.status} ${e.statusText}`);const{path:t,store:n,metrics:r,uploadsDisabled:i}=await e.json();return{storePath:t,uploadsDisabled:i??null,projects:(n.projects??[]).map(o=>({key:o.key,name:o.name,items:o.items.map(l=>({id:l.ref,area:l.area,status:l.status,title:l.title,deps:l.deps??[],parent:l.parent??null})),next:(o.next??[]).filter(l=>o.items.some(s=>s.ref===l)),bodies:new Map(o.items.map(l=>[l.ref,l.body??""])),attachments:new Map(o.items.filter(l=>{var s;return(s=l.attachments)==null?void 0:s.length}).map(l=>[l.ref,l.attachments])),metrics:fO((r==null?void 0:r[o.key])??[],l=>l.ref??"")}))}}function hO(e,t){if(e.length===0)return{project:null,notice:"This store has no projects yet. Create one and it will appear here."};if(t!==null){const n=e.find(r=>r.key===t);return n?{project:n,notice:null}:{project:null,notice:`No project "${t}" in this store. It holds: ${e.map(r=>r.key).join(", ")}.`}}return e.length===1?{project:e[0],notice:null}:{project:null,notice:"This store holds several projects. Choose one to see its graph."}}const pO=e=>e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/1024/1024).toFixed(1)} MB`;function mO({projectKey:e,ref_:t,images:n,uploadsDisabled:r,reload:i,open:o,onToggle:l}){const[s,a]=D.useState(!1),[u,c]=D.useState(null),[f,d]=D.useState(!1),h=D.useRef(null),p=Ev(),x=p&&r===null;D.useEffect(()=>c(null),[t]);async function w(y){a(!0),c(null);try{await y()}catch(g){c(g instanceof Error?g.message:String(g))}finally{a(!1),i()}}const m=y=>y===null||y.length===0?Promise.resolve():w(async()=>{for(const g of Array.from(y))await cO(e,t,g)});return b.jsxs(vv,{title:"Images",count:n.length,open:o,onToggle:l,children:[n.length>0&&b.jsx("div",{className:"attachments__grid",children:n.map(y=>b.jsxs("div",{className:"attachments__item",children:[b.jsx("a",{href:`/media/${y.hash}`,target:"_blank",rel:"noreferrer",children:b.jsx("img",{className:"attachments__thumb",src:`/media/${y.hash}`,alt:y.caption??"attachment",loading:"lazy"})}),b.jsx("span",{className:"attachments__meta",children:pO(y.bytes)}),p&&b.jsx("button",{className:"attachments__remove",title:"Remove this image from the ticket",disabled:s,onClick:()=>void w(()=>uO(e,y.hash)),children:"x"})]},y.hash))}),x?b.jsxs("div",{className:`attachments__drop${f?" attachments__drop--over":""}`,onDragOver:y=>{y.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:y=>{y.preventDefault(),d(!1),m(y.dataTransfer.files)},onClick:()=>{var y;return(y=h.current)==null?void 0:y.click()},children:[b.jsx("input",{ref:h,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",multiple:!0,hidden:!0,onChange:y=>{m(y.target.files),y.target.value=""}}),s?"Uploading...":`Drop an image on ${t}, or click to choose`]}):r!==null?b.jsx("p",{className:"attachments__readonly",children:r}):n.length===0&&b.jsx("p",{className:"attachments__readonly",children:"Open the viewer with the open_viewer tool to add images."}),u!==null&&b.jsx("p",{className:"attachments__error",children:u})]})}const gu=e=>new Date(e).toLocaleDateString(void 0,{day:"numeric",month:"short"}),gO=e=>e.latest===null&&e.latestText===null;function yO(e){if(e.latest!==null){const t=Number.isInteger(e.latest)?String(e.latest):e.latest.toFixed(2).replace(/\.?0+$/,"");return e.units.length>0?`${t} ${e.units.join("/")}`:t}if(e.values.length>1){const t=e.values.map(r=>`${r.text} x${r.count}`).join(", "),n=e.distinctValues-e.values.length;return n>0?`${t}, +${n} more`:t}return e.latestText??""}function xO({metrics:e,open:t,onToggle:n}){return e.length===0?null:b.jsx(vv,{title:"Metrics",count:e.length,open:t,onToggle:n,children:b.jsx("table",{className:"metrics__table",children:b.jsx("tbody",{children:e.map(r=>b.jsxs("tr",{children:[b.jsx("td",{className:"metrics__name",children:r.metric}),b.jsx("td",{className:"metrics__value","data-mixed":r.units.length>1,"data-wrap":r.values.length>1,children:yO(r)}),b.jsx("td",{className:"metrics__count",children:gO(r)?`${r.count} ${r.count===1?"occurrence":"occurrences"}, to ${gu(r.latestAt)}`:r.count===1?gu(r.latestAt):`${r.count} readings, to ${gu(r.latestAt)}`})]},r.metric))})})})}function Zm(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function wO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function vO(e,t,n){const i=xa((n||{}).ignore||[]),o=kO(t);let l=-1;for(;++l<o.length;)yv(e,"text",s);function s(u,c){let f=-1,d;for(;++f<c.length;){const h=c[f],p=d?d.children:void 0;if(i(h,p?p.indexOf(h):void 0,d))return;d=h}if(d)return a(u,c)}function a(u,c){const f=c[c.length-1],d=o[l][0],h=o[l][1];let p=0;const w=f.children.indexOf(u);let m=!1,y=[];d.lastIndex=0;let g=d.exec(u.value);for(;g;){const v=g.index,C={index:g.index,input:g.input,stack:[...c,u]};let E=h(...g,C);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?d.lastIndex=v+1:(p!==v&&y.push({type:"text",value:u.value.slice(p,v)}),Array.isArray(E)?y.push(...E):E&&y.push(E),p=v+g[0].length,m=!0),!d.global)break;g=d.exec(u.value)}return m?(p<u.value.length&&y.push({type:"text",value:u.value.slice(p)}),f.children.splice(w,1,...y)):y=[u],w+y.length}}function kO(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([EO(i[0]),SO(i[1])])}return t}function EO(e){return typeof e=="string"?new RegExp(wO(e),"g"):e}function SO(e){return typeof e=="function"?e:function(){return e}}const yu="phrasing",xu=["autolink","link","image","label"];function _O(){return{transforms:[TO],enter:{literalAutolink:CO,literalAutolinkEmail:wu,literalAutolinkHttp:wu,literalAutolinkWww:wu},exit:{literalAutolink:MO,literalAutolinkEmail:PO,literalAutolinkHttp:NO,literalAutolinkWww:IO}}}function bO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:yu,notInConstruct:xu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:yu,notInConstruct:xu},{character:":",before:"[ps]",after:"\\/",inConstruct:yu,notInConstruct:xu}]}}function CO(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function wu(e){this.config.enter.autolinkProtocol.call(this,e)}function NO(e){this.config.exit.autolinkProtocol.call(this,e)}function IO(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function PO(e){this.config.exit.autolinkEmail.call(this,e)}function MO(e){this.exit(e)}function TO(e){vO(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,LO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),AO]],{ignore:["link","linkReference"]})}function LO(e,t,n,r,i){let o="";if(!Sv(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!zO(n)))return!1;const l=OO(n+r);if(!l[0])return!1;const s={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[s,{type:"text",value:l[1]}]:s}function AO(e,t,n,r){return!Sv(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function zO(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function OO(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Zm(e,"(");let o=Zm(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Sv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Lr(n)||ma(n))&&(!t||n!==47)}_v.peek=UO;function DO(){this.buffer()}function RO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function jO(){this.buffer()}function $O(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function BO(e){this.exit(e)}function HO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function VO(e){this.exit(e)}function UO(){return"["}function _v(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const l=n.enter("footnoteReference"),s=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),s(),l(),o+=i.move("]"),o}function WO(){return{enter:{gfmFootnoteCallString:DO,gfmFootnoteCall:RO,gfmFootnoteDefinitionLabelString:jO,gfmFootnoteDefinition:$O},exit:{gfmFootnoteCallString:FO,gfmFootnoteCall:BO,gfmFootnoteDefinitionLabelString:HO,gfmFootnoteDefinition:VO}}}function YO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_v},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,l){const s=o.createTracker(l);let a=s.move("[^");const u=o.enter("footnoteDefinition"),c=o.enter("label");return a+=s.move(o.safe(o.associationId(r),{before:a,after:"]"})),c(),a+=s.move("]:"),r.children&&r.children.length>0&&(s.shift(4),a+=s.move((t?`
76
- `:" ")+o.indentLines(o.containerFlow(r,s.current()),t?bv:XO))),u(),a}}function XO(e,t,n){return t===0?e:bv(e,t,n)}function bv(e,t,n){return(n?"":" ")+e}const GO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Cv.peek=JO;function QO(){return{canContainEols:["delete"],enter:{strikethrough:KO},exit:{strikethrough:ZO}}}function qO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GO}],handlers:{delete:Cv}}}function KO(e){this.enter({type:"delete",children:[]},e)}function ZO(e){this.exit(e)}function Cv(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let l=i.move("~~");return l+=n.containerPhrasing(e,{...i.current(),before:l,after:"~"}),l+=i.move("~~"),o(),l}function JO(){return"~"}function e3(e){return e.length}function t3(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||e3,o=[],l=[],s=[],a=[];let u=0,c=-1;for(;++c<e.length;){const x=[],w=[];let m=-1;for(e[c].length>u&&(u=e[c].length);++m<e[c].length;){const y=n3(e[c][m]);if(n.alignDelimiters!==!1){const g=i(y);w[m]=g,(a[m]===void 0||g>a[m])&&(a[m]=g)}x.push(y)}l[c]=x,s[c]=w}let f=-1;if(typeof r=="object"&&"length"in r)for(;++f<u;)o[f]=Jm(r[f]);else{const x=Jm(r);for(;++f<u;)o[f]=x}f=-1;const d=[],h=[];for(;++f<u;){const x=o[f];let w="",m="";x===99?(w=":",m=":"):x===108?w=":":x===114&&(m=":");let y=n.alignDelimiters===!1?1:Math.max(1,a[f]-w.length-m.length);const g=w+"-".repeat(y)+m;n.alignDelimiters!==!1&&(y=w.length+y+m.length,y>a[f]&&(a[f]=y),h[f]=y),d[f]=g}l.splice(1,0,d),s.splice(1,0,h),c=-1;const p=[];for(;++c<l.length;){const x=l[c],w=s[c];f=-1;const m=[];for(;++f<u;){const y=x[f]||"";let g="",v="";if(n.alignDelimiters!==!1){const C=a[f]-(w[f]||0),E=o[f];E===114?g=" ".repeat(C):E===99?C%2?(g=" ".repeat(C/2+.5),v=" ".repeat(C/2-.5)):(g=" ".repeat(C/2),v=g):v=" ".repeat(C)}n.delimiterStart!==!1&&!f&&m.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||f)&&m.push(" "),n.alignDelimiters!==!1&&m.push(g),m.push(y),n.alignDelimiters!==!1&&m.push(v),n.padding!==!1&&m.push(" "),(n.delimiterEnd!==!1||f!==u-1)&&m.push("|")}p.push(n.delimiterEnd===!1?m.join("").replace(/ +$/,""):m.join(""))}return p.join(`
77
- `)}function n3(e){return e==null?"":String(e)}function Jm(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function r3(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),i3);return i(),l}function i3(e,t,n){return">"+(n?"":" ")+e}function o3(e,t){return eg(e,t.inConstruct,!0)&&!eg(e,t.notInConstruct,!1)}function eg(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function tg(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
78
- `&&o3(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
79
- `}function l3(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>l&&(l=o):o=1,i=r+t.length,r=n.indexOf(t,i);return l}function s3(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function a3(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function u3(e,t,n,r){const i=a3(n),o=e.value||"",l=i==="`"?"GraveAccent":"Tilde";if(s3(e,n)){const f=n.enter("codeIndented"),d=n.indentLines(o,c3);return f(),d}const s=n.createTracker(r),a=i.repeat(Math.max(l3(o,i)+1,3)),u=n.enter("codeFenced");let c=s.move(a);if(e.lang){const f=n.enter(`codeFencedLang${l}`);c+=s.move(n.safe(e.lang,{before:c,after:" ",encode:["`"],...s.current()})),f()}if(e.lang&&e.meta){const f=n.enter(`codeFencedMeta${l}`);c+=s.move(" "),c+=s.move(n.safe(e.meta,{before:c,after:`
80
- `,encode:["`"],...s.current()})),f()}return c+=s.move(`
81
- `),o&&(c+=s.move(o+`
82
- `)),c+=s.move(a),u(),c}function c3(e,t,n){return(n?"":" ")+e}function Td(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function f3(e,t,n,r){const i=Td(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("definition");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("[");return u+=a.move(n.safe(n.associationId(e),{before:u,after:"]",...a.current()})),u+=a.move("]: "),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(s=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":`
83
- `,...a.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),s()),l(),u}function d3(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Oo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Ds(e,t,n){const r=ki(e),i=ki(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Nv.peek=h3;function Nv(e,t,n,r){const i=d3(n),o=n.enter("emphasis"),l=n.createTracker(r),s=l.move(i);let a=l.move(n.containerPhrasing(e,{after:i,before:s,...l.current()}));const u=a.charCodeAt(0),c=Ds(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(a=Oo(u)+a.slice(1));const f=a.charCodeAt(a.length-1),d=Ds(r.after.charCodeAt(0),f,i);d.inside&&(a=a.slice(0,-1)+Oo(f));const h=l.move(i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+a+h}function h3(e,t,n){return n.options.emphasis||"*"}function p3(e,t){let n=!1;return Nd(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Vc}),!!((!e.depth||e.depth<3)&&vd(e)&&(t.options.setext||n))}function m3(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(p3(e,n)){const c=n.enter("headingSetext"),f=n.enter("phrasing"),d=n.containerPhrasing(e,{...o.current(),before:`
84
- `,after:`
85
- `});return f(),c(),d+`
86
- `+(i===1?"=":"-").repeat(d.length-(Math.max(d.lastIndexOf("\r"),d.lastIndexOf(`
87
- `))+1))}const l="#".repeat(i),s=n.enter("headingAtx"),a=n.enter("phrasing");o.move(l+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
88
- `,...o.current()});return/^[\t ]/.test(u)&&(u=Oo(u.charCodeAt(0))+u.slice(1)),u=u?l+" "+u:l,n.options.closeAtx&&(u+=" "+l),a(),s(),u}Iv.peek=g3;function Iv(e){return e.value||""}function g3(){return"<"}Pv.peek=y3;function Pv(e,t,n,r){const i=Td(n),o=i==='"'?"Quote":"Apostrophe",l=n.enter("image");let s=n.enter("label");const a=n.createTracker(r);let u=a.move("![");return u+=a.move(n.safe(e.alt,{before:u,after:"]",...a.current()})),u+=a.move("]("),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter("destinationLiteral"),u+=a.move("<"),u+=a.move(n.safe(e.url,{before:u,after:">",...a.current()})),u+=a.move(">")):(s=n.enter("destinationRaw"),u+=a.move(n.safe(e.url,{before:u,after:e.title?" ":")",...a.current()}))),s(),e.title&&(s=n.enter(`title${o}`),u+=a.move(" "+i),u+=a.move(n.safe(e.title,{before:u,after:i,...a.current()})),u+=a.move(i),s()),u+=a.move(")"),l(),u}function y3(){return"!"}Mv.peek=x3;function Mv(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const s=n.createTracker(r);let a=s.move("![");const u=n.safe(e.alt,{before:a,after:"]",...s.current()});a+=s.move(u+"]["),l();const c=n.stack;n.stack=[],l=n.enter("reference");const f=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=c,o(),i==="full"||!u||u!==f?a+=s.move(f+"]"):i==="shortcut"?a=a.slice(0,-1):a+=s.move("]"),a}function x3(){return"!"}Tv.peek=w3;function Tv(e,t,n){let r=e.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],s=n.compilePattern(l);let a;if(l.atBreak)for(;a=s.exec(r);){let u=a.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(a.index+1)}}return i+r+i}function w3(){return"`"}function Lv(e,t){const n=vd(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Av.peek=v3;function Av(e,t,n,r){const i=Td(n),o=i==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let s,a;if(Lv(e,n)){const c=n.stack;n.stack=[],s=n.enter("autolink");let f=l.move("<");return f+=l.move(n.containerPhrasing(e,{before:f,after:">",...l.current()})),f+=l.move(">"),s(),n.stack=c,f}s=n.enter("link"),a=n.enter("label");let u=l.move("[");return u+=l.move(n.containerPhrasing(e,{before:u,after:"](",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function v3(e,t,n){return Lv(e,n)?"<":"["}zv.peek=k3;function zv(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const s=n.createTracker(r);let a=s.move("[");const u=n.containerPhrasing(e,{before:a,after:"]",...s.current()});a+=s.move(u+"]["),l();const c=n.stack;n.stack=[],l=n.enter("reference");const f=n.safe(n.associationId(e),{before:a,after:"]",...s.current()});return l(),n.stack=c,o(),i==="full"||!u||u!==f?a+=s.move(f+"]"):i==="shortcut"?a=a.slice(0,-1):a+=s.move("]"),a}function k3(){return"["}function Ld(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function E3(e){const t=Ld(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function S3(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ov(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function _3(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?S3(n):Ld(n);const s=e.ordered?l==="."?")":".":E3(n);let a=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const c=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&c&&(!c.children||!c.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(a=!0),Ov(n)===l&&c){let f=-1;for(;++f<e.children.length;){const d=e.children[f];if(d&&d.type==="listItem"&&d.children&&d.children[0]&&d.children[0].type==="thematicBreak"){a=!0;break}}}}a&&(l=s),n.bulletCurrent=l;const u=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,i(),u}function b3(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function C3(e,t,n,r){const i=b3(n);let o=n.bulletCurrent||Ld(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const s=n.createTracker(r);s.move(o+" ".repeat(l-o.length)),s.shift(l);const a=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,s.current()),c);return a(),u;function c(f,d,h){return d?(h?"":" ".repeat(l))+f:(h?o:o+" ".repeat(l-o.length))+f}}function N3(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),i(),l}const I3=xa(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function P3(e,t,n,r){return(e.children.some(function(l){return I3(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function M3(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Dv.peek=T3;function Dv(e,t,n,r){const i=M3(n),o=n.enter("strong"),l=n.createTracker(r),s=l.move(i+i);let a=l.move(n.containerPhrasing(e,{after:i,before:s,...l.current()}));const u=a.charCodeAt(0),c=Ds(r.before.charCodeAt(r.before.length-1),u,i);c.inside&&(a=Oo(u)+a.slice(1));const f=a.charCodeAt(a.length-1),d=Ds(r.after.charCodeAt(0),f,i);d.inside&&(a=a.slice(0,-1)+Oo(f));const h=l.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:d.outside,before:c.outside},s+a+h}function T3(e,t,n){return n.options.strong||"*"}function L3(e,t,n,r){return n.safe(e.value,r)}function A3(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function z3(e,t,n){const r=(Ov(n)+(n.options.ruleSpaces?" ":"")).repeat(A3(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Rv={blockquote:r3,break:tg,code:u3,definition:f3,emphasis:Nv,hardBreak:tg,heading:m3,html:Iv,image:Pv,imageReference:Mv,inlineCode:Tv,link:Av,linkReference:zv,list:_3,listItem:C3,paragraph:N3,root:P3,strong:Dv,text:L3,thematicBreak:z3};function O3(){return{enter:{table:D3,tableData:ng,tableHeader:ng,tableRow:j3},exit:{codeText:$3,table:R3,tableData:vu,tableHeader:vu,tableRow:vu}}}function D3(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function R3(e){this.exit(e),this.data.inTable=void 0}function j3(e){this.enter({type:"tableRow",children:[]},e)}function vu(e){this.exit(e)}function ng(e){this.enter({type:"tableCell",children:[]},e)}function $3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,F3));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function F3(e,t){return t==="|"?t:e}function B3(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
89
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:d,table:l,tableCell:a,tableRow:s}};function l(h,p,x,w){return u(c(h,x,w),h.align)}function s(h,p,x,w){const m=f(h,x,w),y=u([m]);return y.slice(0,y.indexOf(`
90
- `))}function a(h,p,x,w){const m=x.enter("tableCell"),y=x.enter("phrasing"),g=x.containerPhrasing(h,{...w,before:o,after:o});return y(),m(),g}function u(h,p){return t3(h,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function c(h,p,x){const w=h.children;let m=-1;const y=[],g=p.enter("table");for(;++m<w.length;)y[m]=f(w[m],p,x);return g(),y}function f(h,p,x){const w=h.children;let m=-1;const y=[],g=p.enter("tableRow");for(;++m<w.length;)y[m]=a(w[m],h,p,x);return g(),y}function d(h,p,x){let w=Rv.inlineCode(h,p,x);return x.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function H3(){return{exit:{taskListCheckValueChecked:rg,taskListCheckValueUnchecked:rg,paragraph:U3}}}function V3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:W3}}}function rg(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function U3(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let o=-1,l;for(;++o<i.length;){const s=i[o];if(s.type==="paragraph"){l=s;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function W3(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",s=n.createTracker(r);o&&s.move(l);let a=Rv.listItem(e,t,n,{...r,...s.current()});return o&&(a=a.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),a;function u(c){return c+l}}function Y3(){return[_O(),WO(),QO(),O3(),H3()]}function X3(e){return{extensions:[bO(),YO(e),qO(),B3(e),V3()]}}const G3={tokenize:e4,partial:!0},jv={tokenize:t4,partial:!0},$v={tokenize:n4,partial:!0},Fv={tokenize:r4,partial:!0},Q3={tokenize:i4,partial:!0},Bv={name:"wwwAutolink",tokenize:Z3,previous:Vv},Hv={name:"protocolAutolink",tokenize:J3,previous:Uv},Pn={name:"emailAutolink",tokenize:K3,previous:Wv},dn={};function q3(){return{text:dn}}let or=48;for(;or<123;)dn[or]=Pn,or++,or===58?or=65:or===91&&(or=97);dn[43]=Pn;dn[45]=Pn;dn[46]=Pn;dn[95]=Pn;dn[72]=[Pn,Hv];dn[104]=[Pn,Hv];dn[87]=[Pn,Bv];dn[119]=[Pn,Bv];function K3(e,t,n){const r=this;let i,o;return l;function l(f){return!Gc(f)||!Wv.call(r,r.previous)||Ad(r.events)?n(f):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),s(f))}function s(f){return Gc(f)?(e.consume(f),s):f===64?(e.consume(f),a):n(f)}function a(f){return f===46?e.check(Q3,c,u)(f):f===45||f===95||tt(f)?(o=!0,e.consume(f),a):c(f)}function u(f){return e.consume(f),i=!0,a}function c(f){return o&&i&&lt(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(f)):n(f)}}function Z3(e,t,n){const r=this;return i;function i(l){return l!==87&&l!==119||!Vv.call(r,r.previous)||Ad(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(G3,e.attempt(jv,e.attempt($v,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function J3(e,t,n){const r=this;let i="",o=!1;return l;function l(f){return(f===72||f===104)&&Uv.call(r,r.previous)&&!Ad(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),e.consume(f),s):n(f)}function s(f){if(lt(f)&&i.length<5)return i+=String.fromCodePoint(f),e.consume(f),s;if(f===58){const d=i.toLowerCase();if(d==="http"||d==="https")return e.consume(f),a}return n(f)}function a(f){return f===47?(e.consume(f),o?u:(o=!0,a)):n(f)}function u(f){return f===null||As(f)||Ce(f)||Lr(f)||ma(f)?n(f):e.attempt(jv,e.attempt($v,c),n)(f)}function c(f){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(f)}}function e4(e,t,n){let r=0;return i;function i(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),i):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function t4(e,t,n){let r,i,o;return l;function l(u){return u===46||u===95?e.check(Fv,a,s)(u):u===null||Ce(u)||Lr(u)||u!==45&&ma(u)?a(u):(o=!0,e.consume(u),l)}function s(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),l}function a(u){return i||r||!o?n(u):t(u)}}function n4(e,t){let n=0,r=0;return i;function i(l){return l===40?(n++,e.consume(l),i):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(Fv,t,o)(l):l===null||Ce(l)||Lr(l)?t(l):(e.consume(l),i)}function o(l){return l===41&&r++,e.consume(l),i}}function r4(e,t,n){return r;function r(s){return s===33||s===34||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===63||s===95||s===126?(e.consume(s),r):s===38?(e.consume(s),o):s===93?(e.consume(s),i):s===60||s===null||Ce(s)||Lr(s)?t(s):n(s)}function i(s){return s===null||s===40||s===91||Ce(s)||Lr(s)?t(s):r(s)}function o(s){return lt(s)?l(s):n(s)}function l(s){return s===59?(e.consume(s),r):lt(s)?(e.consume(s),l):n(s)}}function i4(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return tt(o)?n(o):t(o)}}function Vv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ce(e)}function Uv(e){return!lt(e)}function Wv(e){return!(e===47||Gc(e))}function Gc(e){return e===43||e===45||e===46||e===95||tt(e)}function Ad(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const o4={tokenize:h4,partial:!0};function l4(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:c4,continuation:{tokenize:f4},exit:d4}},text:{91:{name:"gfmFootnoteCall",tokenize:u4},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:s4,resolveTo:a4}}}}function s4(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;i--;){const a=r.events[i][1];if(a.type==="labelImage"){l=a;break}if(a.type==="gfmFootnoteCall"||a.type==="labelLink"||a.type==="label"||a.type==="image"||a.type==="link")break}return s;function s(a){if(!l||!l._balanced)return n(a);const u=Qt(r.sliceSerialize({start:l.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(a):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a))}}function a4(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},s=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...s),e}function u4(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return s;function s(f){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),a}function a(f){return f!==94?n(f):(e.enter("gfmFootnoteCallMarker"),e.consume(f),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(f){if(o>999||f===93&&!l||f===null||f===91||Ce(f))return n(f);if(f===93){e.exit("chunkString");const d=e.exit("gfmFootnoteCallString");return i.includes(Qt(r.sliceSerialize(d)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(f)}return Ce(f)||(l=!0),o++,e.consume(f),f===92?c:u}function c(f){return f===91||f===92||f===93?(e.consume(f),o++,u):u(f)}}function c4(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,s;return a;function a(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(p)}function c(p){if(l>999||p===93&&!s||p===null||p===91||Ce(p))return n(p);if(p===93){e.exit("chunkString");const x=e.exit("gfmFootnoteDefinitionLabelString");return o=Qt(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return Ce(p)||(s=!0),l++,e.consume(p),p===92?f:c}function f(p){return p===91||p===92||p===93?(e.consume(p),l++,c):c(p)}function d(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),xe(e,h,"gfmFootnoteDefinitionWhitespace")):n(p)}function h(p){return t(p)}}function f4(e,t,n){return e.check(Qo,t,e.attempt(o4,t,n))}function d4(e){e.exit("gfmFootnoteDefinition")}function h4(e,t,n){const r=this;return xe(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function p4(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(l,s){let a=-1;for(;++a<l.length;)if(l[a][0]==="enter"&&l[a][1].type==="strikethroughSequenceTemporary"&&l[a][1]._close){let u=a;for(;u--;)if(l[u][0]==="exit"&&l[u][1].type==="strikethroughSequenceTemporary"&&l[u][1]._open&&l[a][1].end.offset-l[a][1].start.offset===l[u][1].end.offset-l[u][1].start.offset){l[a][1].type="strikethroughSequence",l[u][1].type="strikethroughSequence";const c={type:"strikethrough",start:Object.assign({},l[u][1].start),end:Object.assign({},l[a][1].end)},f={type:"strikethroughText",start:Object.assign({},l[u][1].end),end:Object.assign({},l[a][1].start)},d=[["enter",c,s],["enter",l[u][1],s],["exit",l[u][1],s],["enter",f,s]],h=s.parser.constructs.insideSpan.null;h&&_t(d,d.length,0,ga(h,l.slice(u+1,a),s)),_t(d,d.length,0,[["exit",f,s],["enter",l[a][1],s],["exit",l[a][1],s],["exit",c,s]]),_t(l,u-1,a-u+3,d),a=u+d.length-2;break}}for(a=-1;++a<l.length;)l[a][1].type==="strikethroughSequenceTemporary"&&(l[a][1].type="data");return l}function o(l,s,a){const u=this.previous,c=this.events;let f=0;return d;function d(p){return u===126&&c[c.length-1][1].type!=="characterEscape"?a(p):(l.enter("strikethroughSequenceTemporary"),h(p))}function h(p){const x=ki(u);if(p===126)return f>1?a(p):(l.consume(p),f++,h);if(f<2&&!n)return a(p);const w=l.exit("strikethroughSequenceTemporary"),m=ki(p);return w._open=!m||m===2&&!!x,w._close=!x||x===2&&!!m,s(p)}}}class m4{constructor(){this.map=[]}add(t,n,r){g4(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function g4(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function y4(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function x4(){return{flow:{null:{name:"table",tokenize:w4,resolveAll:v4}}}}function w4(e,t,n){const r=this;let i=0,o=0,l;return s;function s(N){let T=r.events.length-1;for(;T>-1;){const _=r.events[T][1].type;if(_==="lineEnding"||_==="linePrefix")T--;else break}const j=T>-1?r.events[T][1].type:null,$=j==="tableHead"||j==="tableRow"?E:a;return $===E&&r.parser.lazy[r.now().line]?n(N):$(N)}function a(N){return e.enter("tableHead"),e.enter("tableRow"),u(N)}function u(N){return N===124||(l=!0,o+=1),c(N)}function c(N){return N===null?n(N):ae(N)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),h):n(N):he(N)?xe(e,c,"whitespace")(N):(o+=1,l&&(l=!1,i+=1),N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),l=!0,c):(e.enter("data"),f(N)))}function f(N){return N===null||N===124||Ce(N)?(e.exit("data"),c(N)):(e.consume(N),N===92?d:f)}function d(N){return N===92||N===124?(e.consume(N),f):f(N)}function h(N){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(N):(e.enter("tableDelimiterRow"),l=!1,he(N)?xe(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):p(N))}function p(N){return N===45||N===58?w(N):N===124?(l=!0,e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),x):C(N)}function x(N){return he(N)?xe(e,w,"whitespace")(N):w(N)}function w(N){return N===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),m):N===45?(o+=1,m(N)):N===null||ae(N)?v(N):C(N)}function m(N){return N===45?(e.enter("tableDelimiterFiller"),y(N)):C(N)}function y(N){return N===45?(e.consume(N),y):N===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(N),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(N))}function g(N){return he(N)?xe(e,v,"whitespace")(N):v(N)}function v(N){return N===124?p(N):N===null||ae(N)?!l||i!==o?C(N):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(N)):C(N)}function C(N){return n(N)}function E(N){return e.enter("tableRow"),S(N)}function S(N){return N===124?(e.enter("tableCellDivider"),e.consume(N),e.exit("tableCellDivider"),S):N===null||ae(N)?(e.exit("tableRow"),t(N)):he(N)?xe(e,S,"whitespace")(N):(e.enter("data"),P(N))}function P(N){return N===null||N===124||Ce(N)?(e.exit("data"),S(N)):(e.consume(N),N===92?z:P)}function z(N){return N===92||N===124?(e.consume(N),P):P(N)}}function v4(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],l=[0,0,0,0],s=!1,a=0,u,c,f;const d=new m4;for(;++n<e.length;){const h=e[n],p=h[1];h[0]==="enter"?p.type==="tableHead"?(s=!1,a!==0&&(ig(d,t,a,u,c),c=void 0,a=0),u={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",u,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,f=void 0,o=[0,0,0,0],l=[0,n+1,0,0],s&&(s=!1,c={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},d.add(n,0,[["enter",c,t]])),i=p.type==="tableDelimiterRow"?2:c?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],f=Nl(d,t,o,i,void 0,f),o=[0,0,0,0]),l[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],f=Nl(d,t,o,i,void 0,f)),o=l,l=[o[1],n,0,0])):p.type==="tableHead"?(s=!0,a=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(a=n,o[1]!==0?(l[0]=l[1],f=Nl(d,t,o,i,n,f)):l[1]!==0&&(f=Nl(d,t,l,i,n,f)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(l[3]=n)}for(a!==0&&ig(d,t,a,u,c),d.consume(t.events),n=-1;++n<t.events.length;){const h=t.events[n];h[0]==="enter"&&h[1].type==="table"&&(h[1]._align=y4(t.events,n))}return e}function Nl(e,t,n,r,i,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",s="tableContent";n[0]!==0&&(o.end=Object.assign({},$r(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const a=$r(t.events,n[1]);if(o={type:l,start:Object.assign({},a),end:Object.assign({},a)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=$r(t.events,n[2]),c=$r(t.events,n[3]),f={type:s,start:Object.assign({},u),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",f,t]]),r!==2){const d=t.events[n[2]],h=t.events[n[3]];if(d[1].end=Object.assign({},h[1].end),d[1].type="chunkText",d[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,x=n[3]-n[2]-1;e.add(p,x,[])}}e.add(n[3]+1,0,[["exit",f,t]])}return i!==void 0&&(o.end=Object.assign({},$r(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function ig(e,t,n,r,i){const o=[],l=$r(t.events,n);i&&(i.end=Object.assign({},l),o.push(["exit",i,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function $r(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const k4={name:"tasklistCheck",tokenize:S4};function E4(){return{text:{91:k4}}}function S4(e,t,n){const r=this;return i;function i(a){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(a):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),o)}function o(a){return Ce(a)?(e.enter("taskListCheckValueUnchecked"),e.consume(a),e.exit("taskListCheckValueUnchecked"),l):a===88||a===120?(e.enter("taskListCheckValueChecked"),e.consume(a),e.exit("taskListCheckValueChecked"),l):n(a)}function l(a){return a===93?(e.enter("taskListCheckMarker"),e.consume(a),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(a)}function s(a){return ae(a)?t(a):he(a)?e.check({tokenize:_4},t,n)(a):n(a)}}function _4(e,t,n){return xe(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function b4(e){return Kw([q3(),l4(),p4(e),x4(),E4()])}const C4={};function N4(e){const t=this,n=e||C4,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(b4(n)),o.push(Y3()),l.push(X3(n))}const Yv=D.createContext({}),I4=()=>D.useContext(Yv),Zt={done:{icon:"✓",label:"done",colour:"#34d399",strike:!0},review:{icon:"◐",label:"review",colour:"#a884f3",strike:!1},"in-progress":{icon:"●",label:"in-progress",colour:"#4f9dff",strike:!1},"to-do":{icon:"○",label:"to-do",colour:"#fbbf24",strike:!1},planning:{icon:"○",label:"planning",colour:"#e8590c",strike:!1}},P4=/^[A-Z][A-Z0-9]*-[1-9]\d*(\.[1-9]\d*)*$/,M4=e=>P4.test(e);function zd(e){const t=e.indexOf(":");if(t<=0)return null;const n=e.slice(t+1);return M4(n)?{project:e.slice(0,t),ref:n}:null}function T4(e){const t=[];for(const n of e)t.includes(n.area)||t.push(n.area);return t}var L4="\0",lr="\0",og="";let A4=class{constructor(t){je(this,"_isDirected",!0);je(this,"_isMultigraph",!1);je(this,"_isCompound",!1);je(this,"_label");je(this,"_defaultNodeLabelFn",()=>{});je(this,"_defaultEdgeLabelFn",()=>{});je(this,"_nodes",{});je(this,"_in",{});je(this,"_preds",{});je(this,"_out",{});je(this,"_sucs",{});je(this,"_edgeObjs",{});je(this,"_edgeLabels",{});je(this,"_nodeCount",0);je(this,"_edgeCount",0);je(this,"_parent");je(this,"_children");t&&(this._isDirected=Object.hasOwn(t,"directed")?t.directed:!0,this._isMultigraph=Object.hasOwn(t,"multigraph")?t.multigraph:!1,this._isCompound=Object.hasOwn(t,"compound")?t.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[lr]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(t){return this._label=t,this}graph(){return this._label}setDefaultNodeLabel(t){return this._defaultNodeLabelFn=t,typeof t!="function"&&(this._defaultNodeLabelFn=()=>t),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var t=this;return this.nodes().filter(n=>Object.keys(t._in[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(t._out[n]).length===0)}setNodes(t,n){var r=arguments,i=this;return t.forEach(function(o){r.length>1?i.setNode(o,n):i.setNode(o)}),this}setNode(t,n){return Object.hasOwn(this._nodes,t)?(arguments.length>1&&(this._nodes[t]=n),this):(this._nodes[t]=arguments.length>1?n:this._defaultNodeLabelFn(t),this._isCompound&&(this._parent[t]=lr,this._children[t]={},this._children[lr][t]=!0),this._in[t]={},this._preds[t]={},this._out[t]={},this._sucs[t]={},++this._nodeCount,this)}node(t){return this._nodes[t]}hasNode(t){return Object.hasOwn(this._nodes,t)}removeNode(t){var n=this;if(Object.hasOwn(this._nodes,t)){var r=i=>n.removeEdge(n._edgeObjs[i]);delete this._nodes[t],this._isCompound&&(this._removeFromParentsChildList(t),delete this._parent[t],this.children(t).forEach(function(i){n.setParent(i)}),delete this._children[t]),Object.keys(this._in[t]).forEach(r),delete this._in[t],delete this._preds[t],Object.keys(this._out[t]).forEach(r),delete this._out[t],delete this._sucs[t],--this._nodeCount}return this}setParent(t,n){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=lr;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),this._removeFromParentsChildList(t),this._parent[t]=n,this._children[n][t]=!0,this}_removeFromParentsChildList(t){delete this._children[this._parent[t]][t]}parent(t){if(this._isCompound){var n=this._parent[t];if(n!==lr)return n}}children(t=lr){if(this._isCompound){var n=this._children[t];if(n)return Object.keys(n)}else{if(t===lr)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=this._preds[t];if(n)return Object.keys(n)}successors(t){var n=this._sucs[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const i=new Set(n);for(var r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([l,s]){t(l)&&n.setNode(l,s)}),Object.values(this._edgeObjs).forEach(function(l){n.hasNode(l.v)&&n.hasNode(l.w)&&n.setEdge(l,r.edge(l))});var i={};function o(l){var s=r.parent(l);return s===void 0||n.hasNode(s)?(i[l]=s,s):s in i?i[s]:o(s)}return this._isCompound&&n.nodes().forEach(l=>n.setParent(l,o(l))),n}setDefaultEdgeLabel(t){return this._defaultEdgeLabelFn=t,typeof t!="function"&&(this._defaultEdgeLabelFn=()=>t),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(t,n){var r=this,i=arguments;return t.reduce(function(o,l){return i.length>1?r.setEdge(o,l,n):r.setEdge(o,l),l}),this}setEdge(){var t,n,r,i,o=!1,l=arguments[0];typeof l=="object"&&l!==null&&"v"in l?(t=l.v,n=l.w,r=l.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=l,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var s=Yi(this._isDirected,t,n,r);if(Object.hasOwn(this._edgeLabels,s))return o&&(this._edgeLabels[s]=i),this;if(r!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),this._edgeLabels[s]=o?i:this._defaultEdgeLabelFn(t,n,r);var a=z4(this._isDirected,t,n,r);return t=a.v,n=a.w,Object.freeze(a),this._edgeObjs[s]=a,lg(this._preds[n],t),lg(this._sucs[t],n),this._in[n][s]=a,this._out[t][s]=a,this._edgeCount++,this}edge(t,n,r){var i=arguments.length===1?ku(this._isDirected,arguments[0]):Yi(this._isDirected,t,n,r);return this._edgeLabels[i]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var i=arguments.length===1?ku(this._isDirected,arguments[0]):Yi(this._isDirected,t,n,r);return Object.hasOwn(this._edgeLabels,i)}removeEdge(t,n,r){var i=arguments.length===1?ku(this._isDirected,arguments[0]):Yi(this._isDirected,t,n,r),o=this._edgeObjs[i];return o&&(t=o.v,n=o.w,delete this._edgeLabels[i],delete this._edgeObjs[i],sg(this._preds[n],t),sg(this._sucs[t],n),delete this._in[n][i],delete this._out[t][i],this._edgeCount--),this}inEdges(t,n){var r=this._in[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.v===n):i}}outEdges(t,n){var r=this._out[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.w===n):i}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}};function lg(e,t){e[t]?e[t]++:e[t]=1}function sg(e,t){--e[t]||delete e[t]}function Yi(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var l=i;i=o,o=l}return i+og+o+og+(r===void 0?L4:r)}function z4(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var l=i;i=o,o=l}var s={v:i,w:o};return r&&(s.name=r),s}function ku(e,t){return Yi(e,t.v,t.w,t.name)}var Od=A4,O4="2.2.4",D4={Graph:Od,version:O4},R4=Od,j4={write:$4,read:H4};function $4(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:F4(e),edges:B4(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function F4(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function B4(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function H4(e){var t=new R4(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var V4=U4;function U4(e){var t={},n=[],r;function i(o){Object.hasOwn(t,o)||(t[o]=!0,r.push(o),e.successors(o).forEach(i),e.predecessors(o).forEach(i))}return e.nodes().forEach(function(o){r=[],i(o),r.length&&n.push(r)}),n}let W4=class{constructor(){je(this,"_arr",[]);je(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(t){return t.key})}has(t){return Object.hasOwn(this._keyIndices,t)}priority(t){var n=this._keyIndices[t];if(n!==void 0)return this._arr[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(t,n){var r=this._keyIndices;if(t=String(t),!Object.hasOwn(r,t)){var i=this._arr,o=i.length;return r[t]=o,i.push({key:t,priority:n}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var t=this._arr.pop();return delete this._keyIndices[t.key],this._heapify(0),t.key}decrease(t,n){var r=this._keyIndices[t];if(n>this._arr[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+this._arr[r].priority+" New: "+n);this._arr[r].priority=n,this._decrease(r)}_heapify(t){var n=this._arr,r=2*t,i=r+1,o=t;r<n.length&&(o=n[r].priority<n[o].priority?r:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(this._swap(t,o),this._heapify(o)))}_decrease(t){for(var n=this._arr,r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)this._swap(t,i),t=i}_swap(t,n){var r=this._arr,i=this._keyIndices,o=r[t],l=r[n];r[t]=l,r[n]=o,i[l.key]=t,i[o.key]=n}};var Xv=W4,Y4=Xv,Gv=G4,X4=()=>1;function G4(e,t,n,r){return Q4(e,String(t),n||X4,r||function(i){return e.outEdges(i)})}function Q4(e,t,n,r){var i={},o=new Y4,l,s,a=function(u){var c=u.v!==l?u.v:u.w,f=i[c],d=n(u),h=s.distance+d;if(d<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+d);h<f.distance&&(f.distance=h,f.predecessor=l,o.decrease(c,h))};for(e.nodes().forEach(function(u){var c=u===t?0:Number.POSITIVE_INFINITY;i[u]={distance:c},o.add(u,c)});o.size()>0&&(l=o.removeMin(),s=i[l],s.distance!==Number.POSITIVE_INFINITY);)r(l).forEach(a);return i}var q4=Gv,K4=Z4;function Z4(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=q4(e,i,t,n),r},{})}var Qv=J4;function J4(e){var t=0,n=[],r={},i=[];function o(l){var s=r[l]={onStack:!0,lowlink:t,index:t++};if(n.push(l),e.successors(l).forEach(function(c){Object.hasOwn(r,c)?r[c].onStack&&(s.lowlink=Math.min(s.lowlink,r[c].index)):(o(c),s.lowlink=Math.min(s.lowlink,r[c].lowlink))}),s.lowlink===s.index){var a=[],u;do u=n.pop(),r[u].onStack=!1,a.push(u);while(l!==u);i.push(a)}}return e.nodes().forEach(function(l){Object.hasOwn(r,l)||o(l)}),i}var eD=Qv,tD=nD;function nD(e){return eD(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var rD=oD,iD=()=>1;function oD(e,t,n){return lD(e,t||iD,n||function(r){return e.outEdges(r)})}function lD(e,t,n){var r={},i=e.nodes();return i.forEach(function(o){r[o]={},r[o][o]={distance:0},i.forEach(function(l){o!==l&&(r[o][l]={distance:Number.POSITIVE_INFINITY})}),n(o).forEach(function(l){var s=l.v===o?l.w:l.v,a=t(l);r[o][s]={distance:a,predecessor:o}})}),i.forEach(function(o){var l=r[o];i.forEach(function(s){var a=r[s];i.forEach(function(u){var c=a[o],f=l[u],d=a[u],h=c.distance+f.distance;h<d.distance&&(d.distance=h,d.predecessor=f.predecessor)})})}),r}function qv(e){var t={},n={},r=[];function i(o){if(Object.hasOwn(n,o))throw new Qc;Object.hasOwn(t,o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(i),delete n[o],r.push(o))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new Qc;return r}class Qc extends Error{constructor(){super(...arguments)}}var Kv=qv;qv.CycleException=Qc;var ag=Kv,sD=aD;function aD(e){try{ag(e)}catch(t){if(t instanceof ag.CycleException)return!1;throw t}return!0}var Zv=uD;function uD(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?s=>e.successors(s):s=>e.neighbors(s),i=n==="post"?cD:fD,o=[],l={};return t.forEach(s=>{if(!e.hasNode(s))throw new Error("Graph does not have node: "+s);i(s,r,l,o)}),o}function cD(e,t,n,r){for(var i=[[e,!1]];i.length>0;){var o=i.pop();o[1]?r.push(o[0]):Object.hasOwn(n,o[0])||(n[o[0]]=!0,i.push([o[0],!0]),Jv(t(o[0]),l=>i.push([l,!1])))}}function fD(e,t,n,r){for(var i=[e];i.length>0;){var o=i.pop();Object.hasOwn(n,o)||(n[o]=!0,r.push(o),Jv(t(o),l=>i.push(l)))}}function Jv(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var dD=Zv,hD=pD;function pD(e,t){return dD(e,t,"post")}var mD=Zv,gD=yD;function yD(e,t){return mD(e,t,"pre")}var xD=Od,wD=Xv,vD=kD;function kD(e,t){var n=new xD,r={},i=new wD,o;function l(a){var u=a.v===o?a.w:a.v,c=i.priority(u);if(c!==void 0){var f=t(a);f<c&&(r[u]=o,i.decrease(u,f))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(a){i.add(a,Number.POSITIVE_INFINITY),n.setNode(a)}),i.decrease(e.nodes()[0],0);for(var s=!1;i.size()>0;){if(o=i.removeMin(),Object.hasOwn(r,o))n.setEdge(o,r[o]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(o).forEach(l)}return n}var ED={components:V4,dijkstra:Gv,dijkstraAll:K4,findCycles:tD,floydWarshall:rD,isAcyclic:sD,postorder:hD,preorder:gD,prim:vD,tarjan:Qv,topsort:Kv},ug=D4,en={Graph:ug.Graph,json:j4,alg:ED,version:ug.version};let SD=class{constructor(){let t={};t._next=t._prev=t,this._sentinel=t}dequeue(){let t=this._sentinel,n=t._prev;if(n!==t)return cg(n),n}enqueue(t){let n=this._sentinel;t._prev&&t._next&&cg(t),t._next=n._next,n._next._prev=t,n._next=t,t._prev=n}toString(){let t=[],n=this._sentinel,r=n._prev;for(;r!==n;)t.push(JSON.stringify(r,_D)),r=r._prev;return"["+t.join(", ")+"]"}};function cg(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function _D(e,t){if(e!=="_next"&&e!=="_prev")return t}var bD=SD;let CD=en.Graph,ND=bD;var ID=MD;let PD=()=>1;function MD(e,t){if(e.nodeCount()<=1)return[];let n=LD(e,t||PD);return TD(n.graph,n.buckets,n.zeroIdx).flatMap(i=>e.outEdges(i.v,i.w))}function TD(e,t,n){let r=[],i=t[t.length-1],o=t[0],l;for(;e.nodeCount();){for(;l=o.dequeue();)Eu(e,t,n,l);for(;l=i.dequeue();)Eu(e,t,n,l);if(e.nodeCount()){for(let s=t.length-2;s>0;--s)if(l=t[s].dequeue(),l){r=r.concat(Eu(e,t,n,l,!0));break}}}return r}function Eu(e,t,n,r,i){let o=i?[]:void 0;return e.inEdges(r.v).forEach(l=>{let s=e.edge(l),a=e.node(l.v);i&&o.push({v:l.v,w:l.w}),a.out-=s,qc(t,n,a)}),e.outEdges(r.v).forEach(l=>{let s=e.edge(l),a=l.w,u=e.node(a);u.in-=s,qc(t,n,u)}),e.removeNode(r.v),o}function LD(e,t){let n=new CD,r=0,i=0;e.nodes().forEach(s=>{n.setNode(s,{v:s,in:0,out:0})}),e.edges().forEach(s=>{let a=n.edge(s.v,s.w)||0,u=t(s),c=a+u;n.setEdge(s.v,s.w,c),i=Math.max(i,n.node(s.v).out+=u),r=Math.max(r,n.node(s.w).in+=u)});let o=AD(i+r+3).map(()=>new ND),l=r+1;return n.nodes().forEach(s=>{qc(o,l,n.node(s))}),{graph:n,buckets:o,zeroIdx:l}}function qc(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function AD(e){const t=[];for(let n=0;n<e;n++)t.push(n);return t}let e1=en.Graph;var Be={addBorderNode:HD,addDummyNode:t1,applyWithChunking:va,asNonCompoundGraph:OD,buildLayerMatrix:$D,intersectRect:jD,mapValues:QD,maxRank:r1,normalizeRanks:FD,notime:YD,partition:UD,pick:GD,predecessorWeights:RD,range:o1,removeEmptyRanks:BD,simplify:zD,successorWeights:DD,time:WD,uniqueId:i1,zipObject:Dd};function t1(e,t,n,r){for(var i=r;e.hasNode(i);)i=i1(r);return n.dummy=t,e.setNode(i,n),i}function zD(e){let t=new e1().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function OD(e){let t=new e1({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function DD(e){let t=e.nodes().map(n=>{let r={};return e.outEdges(n).forEach(i=>{r[i.w]=(r[i.w]||0)+e.edge(i).weight}),r});return Dd(e.nodes(),t)}function RD(e){let t=e.nodes().map(n=>{let r={};return e.inEdges(n).forEach(i=>{r[i.v]=(r[i.v]||0)+e.edge(i).weight}),r});return Dd(e.nodes(),t)}function jD(e,t){let n=e.x,r=e.y,i=t.x-n,o=t.y-r,l=e.width/2,s=e.height/2;if(!i&&!o)throw new Error("Not possible to find intersection inside of the rectangle");let a,u;return Math.abs(o)*l>Math.abs(i)*s?(o<0&&(s=-s),a=s*i/o,u=s):(i<0&&(l=-l),a=l,u=l*o/i),{x:n+a,y:r+u}}function $D(e){let t=o1(r1(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function FD(e){let t=e.nodes().map(r=>{let i=e.node(r).rank;return i===void 0?Number.MAX_VALUE:i}),n=va(Math.min,t);e.nodes().forEach(r=>{let i=e.node(r);Object.hasOwn(i,"rank")&&(i.rank-=n)})}function BD(e){let t=e.nodes().map(l=>e.node(l).rank),n=va(Math.min,t),r=[];e.nodes().forEach(l=>{let s=e.node(l).rank-n;r[s]||(r[s]=[]),r[s].push(l)});let i=0,o=e.graph().nodeRankFactor;Array.from(r).forEach((l,s)=>{l===void 0&&s%o!==0?--i:l!==void 0&&i&&l.forEach(a=>e.node(a).rank+=i)})}function HD(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),t1(e,"border",i,t)}function VD(e,t=n1){const n=[];for(let r=0;r<e.length;r+=t){const i=e.slice(r,r+t);n.push(i)}return n}const n1=65535;function va(e,t){if(t.length>n1){const n=VD(t);return e.apply(null,n.map(r=>e.apply(null,r)))}else return e.apply(null,t)}function r1(e){const n=e.nodes().map(r=>{let i=e.node(r).rank;return i===void 0?Number.MIN_VALUE:i});return va(Math.max,n)}function UD(e,t){let n={lhs:[],rhs:[]};return e.forEach(r=>{t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function WD(e,t){let n=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-n)+"ms")}}function YD(e,t){return t()}let XD=0;function i1(e){var t=++XD;return e+(""+t)}function o1(e,t,n=1){t==null&&(t=e,e=0);let r=o=>o<t;n<0&&(r=o=>t<o);const i=[];for(let o=e;r(o);o+=n)i.push(o);return i}function GD(e,t){const n={};for(const r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function QD(e,t){let n=t;return typeof t=="string"&&(n=r=>r[t]),Object.entries(e).reduce((r,[i,o])=>(r[i]=n(o,i),r),{})}function Dd(e,t){return e.reduce((n,r,i)=>(n[r]=t[i],n),{})}let qD=ID,KD=Be.uniqueId;var ZD={run:JD,undo:tR};function JD(e){(e.graph().acyclicer==="greedy"?qD(e,n(e)):eR(e)).forEach(r=>{let i=e.edge(r);e.removeEdge(r),i.forwardName=r.name,i.reversed=!0,e.setEdge(r.w,r.v,i,KD("rev"))});function n(r){return i=>r.edge(i).weight}}function eR(e){let t=[],n={},r={};function i(o){Object.hasOwn(r,o)||(r[o]=!0,n[o]=!0,e.outEdges(o).forEach(l=>{Object.hasOwn(n,l.w)?t.push(l):i(l.w)}),delete n[o])}return e.nodes().forEach(i),t}function tR(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}let nR=Be;var rR={run:iR,undo:lR};function iR(e){e.graph().dummyChains=[],e.edges().forEach(t=>oR(e,t))}function oR(e,t){let n=t.v,r=e.node(n).rank,i=t.w,o=e.node(i).rank,l=t.name,s=e.edge(t),a=s.labelRank;if(o===r+1)return;e.removeEdge(t);let u,c,f;for(f=0,++r;r<o;++f,++r)s.points=[],c={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=nR.addDummyNode(e,"edge",c,"_d"),r===a&&(c.width=s.width,c.height=s.height,c.dummy="edge-label",c.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},l),f===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},l)}function lR(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}const{applyWithChunking:sR}=Be;var ka={longestPath:aR,slack:uR};function aR(e){var t={};function n(r){var i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let o=e.outEdges(r).map(s=>s==null?Number.POSITIVE_INFINITY:n(s.w)-e.edge(s).minlen);var l=sR(Math.min,o);return l===Number.POSITIVE_INFINITY&&(l=0),i.rank=l}e.sources().forEach(n)}function uR(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var cR=en.Graph,Rs=ka.slack,l1=fR;function fR(e){var t=new cR({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,o;dR(t,e)<r;)i=hR(t,e),o=t.hasNode(i.v)?Rs(e,i):-Rs(e,i),pR(t,e,o);return t}function dR(e,t){function n(r){t.nodeEdges(r).forEach(i=>{var o=i.v,l=r===o?i.w:o;!e.hasNode(l)&&!Rs(t,i)&&(e.setNode(l,{}),e.setEdge(r,l,{}),n(l))})}return e.nodes().forEach(n),e.nodeCount()}function hR(e,t){return t.edges().reduce((r,i)=>{let o=Number.POSITIVE_INFINITY;return e.hasNode(i.v)!==e.hasNode(i.w)&&(o=Rs(t,i)),o<r[0]?[o,i]:r},[Number.POSITIVE_INFINITY,null])[1]}function pR(e,t,n){e.nodes().forEach(r=>t.node(r).rank+=n)}var mR=l1,fg=ka.slack,gR=ka.longestPath,yR=en.alg.preorder,xR=en.alg.postorder,wR=Be.simplify,vR=Dr;Dr.initLowLimValues=jd;Dr.initCutValues=Rd;Dr.calcCutValue=s1;Dr.leaveEdge=u1;Dr.enterEdge=c1;Dr.exchangeEdges=f1;function Dr(e){e=wR(e),gR(e);var t=mR(e);jd(t),Rd(t,e);for(var n,r;n=u1(t);)r=c1(t,e,n),f1(t,e,n,r)}function Rd(e,t){var n=xR(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(r=>kR(e,t,r))}function kR(e,t,n){var r=e.node(n),i=r.parent;e.edge(n,i).cutvalue=s1(e,t,n)}function s1(e,t,n){var r=e.node(n),i=r.parent,o=!0,l=t.edge(n,i),s=0;return l||(o=!1,l=t.edge(i,n)),s=l.weight,t.nodeEdges(n).forEach(a=>{var u=a.v===n,c=u?a.w:a.v;if(c!==i){var f=u===o,d=t.edge(a).weight;if(s+=f?d:-d,SR(e,n,c)){var h=e.edge(n,c).cutvalue;s+=f?-h:h}}}),s}function jd(e,t){arguments.length<2&&(t=e.nodes()[0]),a1(e,{},1,t)}function a1(e,t,n,r,i){var o=n,l=e.node(r);return t[r]=!0,e.neighbors(r).forEach(s=>{Object.hasOwn(t,s)||(n=a1(e,t,n,s,r))}),l.low=o,l.lim=n++,i?l.parent=i:delete l.parent,n}function u1(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function c1(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var o=e.node(r),l=e.node(i),s=o,a=!1;o.lim>l.lim&&(s=l,a=!0);var u=t.edges().filter(c=>a===dg(e,e.node(c.v),s)&&a!==dg(e,e.node(c.w),s));return u.reduce((c,f)=>fg(t,f)<fg(t,c)?f:c)}function f1(e,t,n,r){var i=n.v,o=n.w;e.removeEdge(i,o),e.setEdge(r.v,r.w,{}),jd(e),Rd(e,t),ER(e,t)}function ER(e,t){var n=e.nodes().find(i=>!t.node(i).parent),r=yR(e,n);r=r.slice(1),r.forEach(i=>{var o=e.node(i).parent,l=t.edge(i,o),s=!1;l||(l=t.edge(o,i),s=!0),t.node(i).rank=t.node(o).rank+(s?l.minlen:-l.minlen)})}function SR(e,t,n){return e.hasEdge(t,n)}function dg(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var _R=ka,d1=_R.longestPath,bR=l1,CR=vR,NR=IR;function IR(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case"network-simplex":hg(e);break;case"tight-tree":MR(e);break;case"longest-path":PR(e);break;case"none":break;default:hg(e)}}var PR=d1;function MR(e){d1(e),bR(e)}function hg(e){CR(e)}var TR=LR;function LR(e){let t=zR(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,o=AR(e,t,i.v,i.w),l=o.path,s=o.lca,a=0,u=l[a],c=!0;for(;n!==i.w;){if(r=e.node(n),c){for(;(u=l[a])!==s&&e.node(u).maxRank<r.rank;)a++;u===s&&(c=!1)}if(!c){for(;a<l.length-1&&e.node(u=l[a+1]).minRank<=r.rank;)a++;u=l[a]}e.setParent(n,u),n=e.successors(n)[0]}})}function AR(e,t,n,r){let i=[],o=[],l=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),a,u;a=n;do a=e.parent(a),i.push(a);while(a&&(t[a].low>l||s>t[a].lim));for(u=a,a=r;(a=e.parent(a))!==u;)o.push(a);return{path:i.concat(o.reverse()),lca:u}}function zR(e){let t={},n=0;function r(i){let o=n;e.children(i).forEach(r),t[i]={low:o,lim:n++}}return e.children().forEach(r),t}let js=Be;var OR={run:DR,cleanup:$R};function DR(e){let t=js.addDummyNode(e,"root",{},"_root"),n=RR(e),r=Object.values(n),i=js.applyWithChunking(Math.max,r)-1,o=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(s=>e.edge(s).minlen*=o);let l=jR(e)+1;e.children().forEach(s=>h1(e,t,o,l,i,n,s)),e.graph().nodeRankFactor=o}function h1(e,t,n,r,i,o,l){let s=e.children(l);if(!s.length){l!==t&&e.setEdge(t,l,{weight:0,minlen:n});return}let a=js.addBorderNode(e,"_bt"),u=js.addBorderNode(e,"_bb"),c=e.node(l);e.setParent(a,l),c.borderTop=a,e.setParent(u,l),c.borderBottom=u,s.forEach(f=>{h1(e,t,n,r,i,o,f);let d=e.node(f),h=d.borderTop?d.borderTop:f,p=d.borderBottom?d.borderBottom:f,x=d.borderTop?r:2*r,w=h!==p?1:i-o[l]+1;e.setEdge(a,h,{weight:x,minlen:w,nestingEdge:!0}),e.setEdge(p,u,{weight:x,minlen:w,nestingEdge:!0})}),e.parent(l)||e.setEdge(t,a,{weight:0,minlen:i+o[l]})}function RR(e){var t={};function n(r,i){var o=e.children(r);o&&o.length&&o.forEach(l=>n(l,i+1)),t[r]=i}return e.children().forEach(r=>n(r,1)),t}function jR(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function $R(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(n=>{var r=e.edge(n);r.nestingEdge&&e.removeEdge(n)})}let FR=Be;var BR=HR;function HR(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(let o=i.minRank,l=i.maxRank+1;o<l;++o)pg(e,"borderLeft","_bl",n,i,o),pg(e,"borderRight","_br",n,i,o)}}e.children().forEach(t)}function pg(e,t,n,r,i,o){let l={width:0,height:0,rank:o,borderType:t},s=i[t][o-1],a=FR.addDummyNode(e,"border",l,n);i[t][o]=a,e.setParent(a,r),s&&e.setEdge(s,a,{weight:1})}var VR={adjust:UR,undo:WR};function UR(e){let t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&p1(e)}function WR(e){let t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&YR(e),(t==="lr"||t==="rl")&&(XR(e),p1(e))}function p1(e){e.nodes().forEach(t=>mg(e.node(t))),e.edges().forEach(t=>mg(e.edge(t)))}function mg(e){let t=e.width;e.width=e.height,e.height=t}function YR(e){e.nodes().forEach(t=>Su(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(Su),Object.hasOwn(n,"y")&&Su(n)})}function Su(e){e.y=-e.y}function XR(e){e.nodes().forEach(t=>_u(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(_u),Object.hasOwn(n,"x")&&_u(n)})}function _u(e){let t=e.x;e.x=e.y,e.y=t}let gg=Be;var GR=QR;function QR(e){let t={},n=e.nodes().filter(a=>!e.children(a).length),r=n.map(a=>e.node(a).rank),i=gg.applyWithChunking(Math.max,r),o=gg.range(i+1).map(()=>[]);function l(a){if(t[a])return;t[a]=!0;let u=e.node(a);o[u.rank].push(a),e.successors(a).forEach(l)}return n.sort((a,u)=>e.node(a).rank-e.node(u).rank).forEach(l),o}let qR=Be.zipObject;var KR=ZR;function ZR(e,t){let n=0;for(let r=1;r<t.length;++r)n+=JR(e,t[r-1],t[r]);return n}function JR(e,t,n){let r=qR(n,n.map((u,c)=>c)),i=t.flatMap(u=>e.outEdges(u).map(c=>({pos:r[c.w],weight:e.edge(c).weight})).sort((c,f)=>c.pos-f.pos)),o=1;for(;o<n.length;)o<<=1;let l=2*o-1;o-=1;let s=new Array(l).fill(0),a=0;return i.forEach(u=>{let c=u.pos+o;s[c]+=u.weight;let f=0;for(;c>0;)c%2&&(f+=s[c+1]),c=c-1>>1,s[c]+=u.weight;a+=u.weight*f}),a}var ej=tj;function tj(e,t=[]){return t.map(n=>{let r=e.inEdges(n);if(r.length){let i=r.reduce((o,l)=>{let s=e.edge(l),a=e.node(l.v);return{sum:o.sum+s.weight*a.order,weight:o.weight+s.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:n}})}let nj=Be;var rj=ij;function ij(e,t){let n={};e.forEach((i,o)=>{let l=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:o};i.barycenter!==void 0&&(l.barycenter=i.barycenter,l.weight=i.weight)}),t.edges().forEach(i=>{let o=n[i.v],l=n[i.w];o!==void 0&&l!==void 0&&(l.indegree++,o.out.push(n[i.w]))});let r=Object.values(n).filter(i=>!i.indegree);return oj(r)}function oj(e){let t=[];function n(i){return o=>{o.merged||(o.barycenter===void 0||i.barycenter===void 0||o.barycenter>=i.barycenter)&&lj(i,o)}}function r(i){return o=>{o.in.push(i),--o.indegree===0&&e.push(o)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(i=>!i.merged).map(i=>nj.pick(i,["vs","i","barycenter","weight"]))}function lj(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}let sj=Be;var aj=uj;function uj(e,t){let n=sj.partition(e,c=>Object.hasOwn(c,"barycenter")),r=n.lhs,i=n.rhs.sort((c,f)=>f.i-c.i),o=[],l=0,s=0,a=0;r.sort(cj(!!t)),a=yg(o,i,a),r.forEach(c=>{a+=c.vs.length,o.push(c.vs),l+=c.barycenter*c.weight,s+=c.weight,a=yg(o,i,a)});let u={vs:o.flat(!0)};return s&&(u.barycenter=l/s,u.weight=s),u}function yg(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function cj(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}let fj=ej,dj=rj,hj=aj;var pj=m1;function m1(e,t,n,r){let i=e.children(t),o=e.node(t),l=o?o.borderLeft:void 0,s=o?o.borderRight:void 0,a={};l&&(i=i.filter(d=>d!==l&&d!==s));let u=fj(e,i);u.forEach(d=>{if(e.children(d.v).length){let h=m1(e,d.v,n,r);a[d.v]=h,Object.hasOwn(h,"barycenter")&&gj(d,h)}});let c=dj(u,n);mj(c,a);let f=hj(c,r);if(l&&(f.vs=[l,f.vs,s].flat(!0),e.predecessors(l).length)){let d=e.node(e.predecessors(l)[0]),h=e.node(e.predecessors(s)[0]);Object.hasOwn(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+d.order+h.order)/(f.weight+2),f.weight+=2}return f}function mj(e,t){e.forEach(n=>{n.vs=n.vs.flatMap(r=>t[r]?t[r].vs:r)})}function gj(e,t){e.barycenter!==void 0?(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight):(e.barycenter=t.barycenter,e.weight=t.weight)}let yj=en.Graph,xj=Be;var wj=vj;function vj(e,t,n,r){r||(r=e.nodes());let i=kj(e),o=new yj({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(l=>e.node(l));return r.forEach(l=>{let s=e.node(l),a=e.parent(l);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(o.setNode(l),o.setParent(l,a||i),e[n](l).forEach(u=>{let c=u.v===l?u.w:u.v,f=o.edge(c,l),d=f!==void 0?f.weight:0;o.setEdge(c,l,{weight:e.edge(u).weight+d})}),Object.hasOwn(s,"minRank")&&o.setNode(l,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),o}function kj(e){for(var t;e.hasNode(t=xj.uniqueId("_root")););return t}var Ej=Sj;function Sj(e,t,n){let r={},i;n.forEach(o=>{let l=e.parent(o),s,a;for(;l;){if(s=e.parent(l),s?(a=r[s],r[s]=l):(a=i,i=l),a&&a!==l){t.setEdge(a,l);return}l=s}})}let _j=GR,bj=KR,Cj=pj,Nj=wj,Ij=Ej,Pj=en.Graph,Il=Be;var Mj=g1;function g1(e,t){if(t&&typeof t.customOrder=="function"){t.customOrder(e,g1);return}let n=Il.maxRank(e),r=xg(e,Il.range(1,n+1),"inEdges"),i=xg(e,Il.range(n-1,-1,-1),"outEdges"),o=_j(e);if(wg(e,o),t&&t.disableOptimalOrderHeuristic)return;let l=Number.POSITIVE_INFINITY,s;for(let a=0,u=0;u<4;++a,++u){Tj(a%2?r:i,a%4>=2),o=Il.buildLayerMatrix(e);let c=bj(e,o);c<l&&(u=0,s=Object.assign({},o),l=c)}wg(e,s)}function xg(e,t,n){const r=new Map,i=(o,l)=>{r.has(o)||r.set(o,[]),r.get(o).push(l)};for(const o of e.nodes()){const l=e.node(o);if(typeof l.rank=="number"&&i(l.rank,o),typeof l.minRank=="number"&&typeof l.maxRank=="number")for(let s=l.minRank;s<=l.maxRank;s++)s!==l.rank&&i(s,o)}return t.map(function(o){return Nj(e,o,n,r.get(o)||[])})}function Tj(e,t){let n=new Pj;e.forEach(function(r){let i=r.graph().root,o=Cj(r,i,n,t);o.vs.forEach((l,s)=>r.node(l).order=s),Ij(r,n,o.vs)})}function wg(e,t){Object.values(t).forEach(n=>n.forEach((r,i)=>e.node(r).order=i))}let Lj=en.Graph,yn=Be;var Aj={positionX:Uj};function zj(e,t){let n={};function r(i,o){let l=0,s=0,a=i.length,u=o[o.length-1];return o.forEach((c,f)=>{let d=Dj(e,c),h=d?e.node(d).order:a;(d||c===u)&&(o.slice(s,f+1).forEach(p=>{e.predecessors(p).forEach(x=>{let w=e.node(x),m=w.order;(m<l||h<m)&&!(w.dummy&&e.node(p).dummy)&&y1(n,x,p)})}),s=f+1,l=h)}),o}return t.length&&t.reduce(r),n}function Oj(e,t){let n={};function r(o,l,s,a,u){let c;yn.range(l,s).forEach(f=>{c=o[f],e.node(c).dummy&&e.predecessors(c).forEach(d=>{let h=e.node(d);h.dummy&&(h.order<a||h.order>u)&&y1(n,d,c)})})}function i(o,l){let s=-1,a,u=0;return l.forEach((c,f)=>{if(e.node(c).dummy==="border"){let d=e.predecessors(c);d.length&&(a=e.node(d[0]).order,r(l,u,f,s,a),u=f,s=a)}r(l,u,l.length,a,o.length)}),l}return t.length&&t.reduce(i),n}function Dj(e,t){if(e.node(t).dummy)return e.predecessors(t).find(n=>e.node(n).dummy)}function y1(e,t,n){if(t>n){let i=t;t=n,n=i}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Rj(e,t,n){if(t>n){let r=t;t=n,n=r}return!!e[t]&&Object.hasOwn(e[t],n)}function jj(e,t,n,r){let i={},o={},l={};return t.forEach(s=>{s.forEach((a,u)=>{i[a]=a,o[a]=a,l[a]=u})}),t.forEach(s=>{let a=-1;s.forEach(u=>{let c=r(u);if(c.length){c=c.sort((d,h)=>l[d]-l[h]);let f=(c.length-1)/2;for(let d=Math.floor(f),h=Math.ceil(f);d<=h;++d){let p=c[d];o[u]===u&&a<l[p]&&!Rj(n,u,p)&&(o[p]=u,o[u]=i[u]=i[p],a=l[p])}}})}),{root:i,align:o}}function $j(e,t,n,r,i){let o={},l=Fj(e,t,n,i),s=i?"borderLeft":"borderRight";function a(f,d){let h=l.nodes(),p=h.pop(),x={};for(;p;)x[p]?f(p):(x[p]=!0,h.push(p),h=h.concat(d(p))),p=h.pop()}function u(f){o[f]=l.inEdges(f).reduce((d,h)=>Math.max(d,o[h.v]+l.edge(h)),0)}function c(f){let d=l.outEdges(f).reduce((p,x)=>Math.min(p,o[x.w]-l.edge(x)),Number.POSITIVE_INFINITY),h=e.node(f);d!==Number.POSITIVE_INFINITY&&h.borderType!==s&&(o[f]=Math.max(o[f],d))}return a(u,l.predecessors.bind(l)),a(c,l.successors.bind(l)),Object.keys(r).forEach(f=>o[f]=o[n[f]]),o}function Fj(e,t,n,r){let i=new Lj,o=e.graph(),l=Wj(o.nodesep,o.edgesep,r);return t.forEach(s=>{let a;s.forEach(u=>{let c=n[u];if(i.setNode(c),a){var f=n[a],d=i.edge(f,c);i.setEdge(f,c,Math.max(l(e,u,a),d||0))}a=u})}),i}function Bj(e,t){return Object.values(t).reduce((n,r)=>{let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY;Object.entries(r).forEach(([s,a])=>{let u=Yj(e,s)/2;i=Math.max(a+u,i),o=Math.min(a-u,o)});const l=i-o;return l<n[0]&&(n=[l,r]),n},[Number.POSITIVE_INFINITY,null])[1]}function Hj(e,t){let n=Object.values(t),r=yn.applyWithChunking(Math.min,n),i=yn.applyWithChunking(Math.max,n);["u","d"].forEach(o=>{["l","r"].forEach(l=>{let s=o+l,a=e[s];if(a===t)return;let u=Object.values(a),c=r-yn.applyWithChunking(Math.min,u);l!=="l"&&(c=i-yn.applyWithChunking(Math.max,u)),c&&(e[s]=yn.mapValues(a,f=>f+c))})})}function Vj(e,t){return yn.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let i=Object.values(e).map(o=>o[r]).sort((o,l)=>o-l);return(i[1]+i[2])/2}})}function Uj(e){let t=yn.buildLayerMatrix(e),n=Object.assign(zj(e,t),Oj(e,t)),r={},i;["u","d"].forEach(l=>{i=l==="u"?t:Object.values(t).reverse(),["l","r"].forEach(s=>{s==="r"&&(i=i.map(f=>Object.values(f).reverse()));let a=(l==="u"?e.predecessors:e.successors).bind(e),u=jj(e,i,n,a),c=$j(e,i,u.root,u.align,s==="r");s==="r"&&(c=yn.mapValues(c,f=>-f)),r[l+s]=c})});let o=Bj(e,r);return Hj(r,o),Vj(r,e.graph().align)}function Wj(e,t,n){return(r,i,o)=>{let l=r.node(i),s=r.node(o),a=0,u;if(a+=l.width/2,Object.hasOwn(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":u=-l.width/2;break;case"r":u=l.width/2;break}if(u&&(a+=n?u:-u),u=0,a+=(l.dummy?t:e)/2,a+=(s.dummy?t:e)/2,a+=s.width/2,Object.hasOwn(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(a+=n?u:-u),u=0,a}}function Yj(e,t){return e.node(t).width}let x1=Be,Xj=Aj.positionX;var Gj=Qj;function Qj(e){e=x1.asNonCompoundGraph(e),qj(e),Object.entries(Xj(e)).forEach(([t,n])=>e.node(t).x=n)}function qj(e){let t=x1.buildLayerMatrix(e),n=e.graph().ranksep,r=0;t.forEach(i=>{const o=i.reduce((l,s)=>{const a=e.node(s).height;return l>a?l:a},0);i.forEach(l=>e.node(l).y=r+o/2),r+=o+n})}let vg=ZD,kg=rR,Kj=NR,Zj=Be.normalizeRanks,Jj=TR,e$=Be.removeEmptyRanks,Eg=OR,t$=BR,Sg=VR,n$=Mj,r$=Gj,Dt=Be,i$=en.Graph;var o$=l$;function l$(e,t){let n=t&&t.debugTiming?Dt.time:Dt.notime;n("layout",()=>{let r=n(" buildLayoutGraph",()=>g$(e));n(" runLayout",()=>s$(r,n,t)),n(" updateInputGraph",()=>a$(e,r))})}function s$(e,t,n){t(" makeSpaceForEdgeLabels",()=>y$(e)),t(" removeSelfEdges",()=>C$(e)),t(" acyclic",()=>vg.run(e)),t(" nestingGraph.run",()=>Eg.run(e)),t(" rank",()=>Kj(Dt.asNonCompoundGraph(e))),t(" injectEdgeLabelProxies",()=>x$(e)),t(" removeEmptyRanks",()=>e$(e)),t(" nestingGraph.cleanup",()=>Eg.cleanup(e)),t(" normalizeRanks",()=>Zj(e)),t(" assignRankMinMax",()=>w$(e)),t(" removeEdgeLabelProxies",()=>v$(e)),t(" normalize.run",()=>kg.run(e)),t(" parentDummyChains",()=>Jj(e)),t(" addBorderSegments",()=>t$(e)),t(" order",()=>n$(e,n)),t(" insertSelfEdges",()=>N$(e)),t(" adjustCoordinateSystem",()=>Sg.adjust(e)),t(" position",()=>r$(e)),t(" positionSelfEdges",()=>I$(e)),t(" removeBorderNodes",()=>b$(e)),t(" normalize.undo",()=>kg.undo(e)),t(" fixupEdgeLabelCoords",()=>S$(e)),t(" undoCoordinateSystem",()=>Sg.undo(e)),t(" translateGraph",()=>k$(e)),t(" assignNodeIntersects",()=>E$(e)),t(" reversePoints",()=>_$(e)),t(" acyclic.undo",()=>vg.undo(e))}function a$(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,"x")&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}let u$=["nodesep","edgesep","ranksep","marginx","marginy"],c$={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},f$=["acyclicer","ranker","rankdir","align"],d$=["width","height","rank"],_g={width:0,height:0},h$=["minlen","weight","width","height","labeloffset"],p$={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},m$=["labelpos"];function g$(e){let t=new i$({multigraph:!0,compound:!0}),n=Cu(e.graph());return t.setGraph(Object.assign({},c$,bu(n,u$),Dt.pick(n,f$))),e.nodes().forEach(r=>{let i=Cu(e.node(r));const o=bu(i,d$);Object.keys(_g).forEach(l=>{o[l]===void 0&&(o[l]=_g[l])}),t.setNode(r,o),t.setParent(r,e.parent(r))}),e.edges().forEach(r=>{let i=Cu(e.edge(r));t.setEdge(r,Object.assign({},p$,bu(i,h$),Dt.pick(i,m$)))}),t}function y$(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function x$(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let r=e.node(t.v),o={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};Dt.addDummyNode(e,"edge-proxy",o,"_ep")}})}function w$(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function v$(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function k$(e){let t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,o=e.graph(),l=o.marginx||0,s=o.marginy||0;function a(u){let c=u.x,f=u.y,d=u.width,h=u.height;t=Math.min(t,c-d/2),n=Math.max(n,c+d/2),r=Math.min(r,f-h/2),i=Math.max(i,f+h/2)}e.nodes().forEach(u=>a(e.node(u))),e.edges().forEach(u=>{let c=e.edge(u);Object.hasOwn(c,"x")&&a(c)}),t-=l,r-=s,e.nodes().forEach(u=>{let c=e.node(u);c.x-=t,c.y-=r}),e.edges().forEach(u=>{let c=e.edge(u);c.points.forEach(f=>{f.x-=t,f.y-=r}),Object.hasOwn(c,"x")&&(c.x-=t),Object.hasOwn(c,"y")&&(c.y-=r)}),o.width=n-t+l,o.height=i-r+s}function E$(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),o,l;n.points?(o=n.points[0],l=n.points[n.points.length-1]):(n.points=[],o=i,l=r),n.points.unshift(Dt.intersectRect(r,o)),n.points.push(Dt.intersectRect(i,l))})}function S$(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function _$(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function b$(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),o=e.node(n.borderLeft[n.borderLeft.length-1]),l=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(l.x-o.x),n.height=Math.abs(i.y-r.y),n.x=o.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy==="border"&&e.removeNode(t)})}function C$(e){e.edges().forEach(t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function N$(e){var t=Dt.buildLayerMatrix(e);t.forEach(n=>{var r=0;n.forEach((i,o)=>{var l=e.node(i);l.order=o+r,(l.selfEdges||[]).forEach(s=>{Dt.addDummyNode(e,"selfedge",{width:s.label.width,height:s.label.height,rank:l.rank,order:o+ ++r,e:s.e,label:s.label},"_se")}),delete l.selfEdges})})}function I$(e){e.nodes().forEach(t=>{var n=e.node(t);if(n.dummy==="selfedge"){var r=e.node(n.e.v),i=r.x+r.width/2,o=r.y,l=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*l/3,y:o-s},{x:i+5*l/6,y:o-s},{x:i+l,y:o},{x:i+5*l/6,y:o+s},{x:i+2*l/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}})}function bu(e,t){return Dt.mapValues(Dt.pick(e,t),Number)}function Cu(e){var t={};return e&&Object.entries(e).forEach(([n,r])=>{typeof n=="string"&&(n=n.toLowerCase()),t[n]=r}),t}let P$=Be,M$=en.Graph;var T$={debugOrdering:L$};function L$(e){let t=P$.buildLayerMatrix(e),n=new M$({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(r=>{n.setNode(r,{label:r}),n.setParent(r,"layer"+e.node(r).rank)}),e.edges().forEach(r=>n.setEdge(r.v,r.w,{},r.name)),t.forEach((r,i)=>{let o="layer"+i;n.setNode(o,{rank:"same"}),r.reduce((l,s)=>(n.setEdge(l,s,{style:"invis"}),s))}),n}var A$="1.1.8",z$={graphlib:en,layout:o$,debug:T$,util:{time:Be.time,notime:Be.notime},version:A$};const bg=Do(z$),w1=(e,t)=>`elsewhere:${e}:${t}`,Kc=e=>`elsewhere:${e}`;function v1(e){return e.flatMap(t=>t.deps.flatMap(n=>{const r=zd(n);return r===null?[]:[{ghostId:w1(r.project,r.ref),...r,dependent:t.id}]}))}const Cg=["#4f9dff","#34d399","#a884f3","#fbbf24","#f472b6","#22d3ee","#fb923c","#a3e635"];function O$(e){return Object.fromEntries(e.map((t,n)=>[t,Cg[n%Cg.length]]))}const Gl=212,k1=62,Nu=34,Ql=18,ql=46,E1=20,Ng=68,Iu=34,Ig=12,D$=92,R$=30,S1=(e,t)=>e.filter(n=>n.parent===t),_1=(e,t)=>e===t||e.startsWith(`${t}.`)||t.startsWith(`${e}.`);function j$(e,t){const n=S1(t,e.id);if(n.length===0)return{width:Gl,height:k1};const r=C1(n,t).box;return{width:r.width,height:r.height}}function $$(e,t,n){const r=new bg.graphlib.Graph;r.setGraph({rankdir:"LR",nodesep:R$,ranksep:D$}),r.setDefaultEdgeLabel(()=>({}));for(const u of e){const c=n.get(u.id);r.setNode(u.id,{width:c.width,height:c.height})}for(const[u,c]of t)r.setEdge(u,c);bg.layout(r);const i=new Map;let o=1/0,l=1/0;for(const u of e){const c=r.node(u.id),f=n.get(u.id),d=c.x-f.width/2,h=c.y-f.height/2;i.set(u.id,{x:d,y:h,width:f.width,height:f.height}),o=Math.min(o,d),l=Math.min(l,h)}let s=0,a=0;for(const u of i.values())u.x-=o,u.y-=l,s=Math.max(s,u.x+u.width),a=Math.max(a,u.y+u.height);return{placements:i,extent:{width:s,height:a}}}function F$(e,t,n){const r=new Map;let i=0,o=0,l=0,s=0;for(const a of e)i>0&&i+a.width>t&&(o+=l+n,i=0,l=0),r.set(a.id,{x:i,y:o,width:a.width,height:a.height}),i+=a.width+n,s=Math.max(s,i-n),l=Math.max(l,a.height);return{placements:r,extent:{width:s,height:o+l}}}function B$(e,t,n){const r=Math.max(t,...e.map(u=>u.width));let i=[{x:0,y:0,width:r}];const o=new Map,l=[...e].sort((u,c)=>c.height-u.height||c.width-u.width);for(const u of l){let c=null;for(const d of i){const h=d.x;if(h+u.width>r)continue;let p=0;for(const x of i)x.x+x.width<=h||x.x>=h+u.width||(p=Math.max(p,x.y));(c===null||p<c.y||p===c.y&&h<c.x)&&(c={x:h,y:p})}const f=c??{x:0,y:0};o.set(u.id,{x:f.x,y:f.y,width:u.width,height:u.height}),i=H$(i,f.x,u.width+n,f.y+u.height+n)}let s=0,a=0;for(const u of o.values())s=Math.max(s,u.x+u.width),a=Math.max(a,u.y+u.height);return{placements:o,extent:{width:s,height:a}}}function H$(e,t,n,r){const i=t+n,o=[];for(const s of e){const a=s.x+s.width;if(a<=t||s.x>=i){o.push(s);continue}s.x<t&&o.push({x:s.x,y:s.y,width:t-s.x}),a>i&&o.push({x:i,y:s.y,width:a-i})}o.push({x:t,y:r,width:n}),o.sort((s,a)=>s.x-a.x);const l=[];for(const s of o){const a=l[l.length-1];a&&a.y===s.y&&a.x+a.width===s.x?a.width+=s.width:l.push({...s})}return l}function b1(e,t,n=2.8){const r=e.reduce((o,l)=>o+(l.width+t)*(l.height+t),0),i=Math.max(...e.map(o=>o.width));return Math.max(i,Math.sqrt(r*n))}function C1(e,t){const n=new Map(e.map(c=>[c.id,j$(c,t)])),r=new Set(e.map(c=>c.id)),i=e.flatMap(c=>c.deps.filter(f=>r.has(f)).map(f=>[f,c.id])),o=new Set(i.flat()),l=e.filter(c=>o.has(c.id)),s=e.filter(c=>!o.has(c.id)),a=new Map,u=l.length>0?$$(l,i,n):{placements:new Map,extent:{width:0,height:0}};for(const[c,f]of u.placements)a.set(c,f);if(s.length>0){const c=s.map(p=>({id:p.id,...n.get(p.id)})),f=Math.max(u.extent.width,b1(c,Nu)),d=F$(c,f,Nu),h=l.length>0?u.extent.height+Nu:0;for(const[p,x]of d.placements)a.set(p,{...x,y:x.y+h})}return{placements:a,box:V$(a)}}function V$(e){let t=0,n=0;for(const r of e.values())t=Math.max(t,r.x+r.width),n=Math.max(n,r.y+r.height);return{width:t+2*Ql,height:n+ql+E1}}function U$(e,t){const n=a=>a.split("-")[0]??a,r=new Map;for(const a of t)for(const u of a.deps){const c=zd(u),[f,d]=[c===null?n(u):Kc(c.project),n(a.id)];if(f!==d){const h=r.get(d)??new Set;h.add(f),r.set(d,h)}}const i=new Map(e.map(a=>[a.area,a])),o=new Set,l=[],s=a=>{const u=i.get(a);if(!(!u||o.has(a))){o.add(a);for(const c of r.get(a)??[])s(c);l.push(u)}};for(const a of e)s(a.area);return l}function W$(e,t,n,r,i,o){const l=new Set(e.map(S=>S.id)),s=e.flatMap(S=>S.deps.filter(P=>l.has(P)&&!_1(P,S.id)).map(P=>({id:`${P}->${S.id}`,source:P,target:S.id}))),a=new Map;for(const S of v1(e))l.has(S.dependent)&&a.set(S.ghostId,[...a.get(S.ghostId)??[],S.dependent]);const u=[...a].flatMap(([S,P])=>P.map(z=>({source:S,target:z}))),c=i?new Set([...s,...u].filter(S=>S.source===i||S.target===i).flatMap(S=>[S.source,S.target])):null,f=S=>S.split("-")[0]??S,d=new Set(e.filter(S=>S.status==="done").map(S=>S.id)),h=new Set,p=new Set;for(const S of s){const P=o.has(S.source)||o.has(S.target),z=f(S.source)!==f(S.target)&&d.has(S.source);!P&&!z||(o.has(S.source)||p.add(S.source),o.has(S.target)||h.add(S.target))}const x=S=>{var P;return r==="area"?n[S.area]??"#94a3b8":((P=Zt[S.status])==null?void 0:P.colour)??"#94a3b8"},w=S=>{var P;return{item:S,colour:x(S),statusColour:((P=Zt[S.status])==null?void 0:P.colour)??"#94a3b8",selected:S.id===i,dimmed:c?!c.has(S.id):!1,hiddenLinkIn:h.has(S.id),hiddenLinkOut:p.has(S.id)}},m=(S,P)=>{const{placements:z,box:N}=C1(P,e);return{nodes:P.flatMap(j=>{const $=z.get(j.id),_={x:Ql+$.x,y:ql+$.y},A=S1(e,j.id);if(A.length>0){const R=m(j.id,A);return[{id:j.id,type:"ticket",parentId:S,position:_,hidden:o.has(j.id),style:{width:R.box.width,height:R.box.height},data:{...w(j),count:A.length},zIndex:1},...R.nodes]}return[{id:j.id,type:"item",parentId:S,position:_,hidden:o.has(j.id),style:{width:Gl,height:k1},data:w(j),zIndex:3}]}),box:N}},y=t.flatMap(S=>{const P=e.filter(N=>N.area===S&&N.parent===null);if(P.length===0)return[];const z=m(`area:${S}`,P);return[{area:S,inner:z,size:z.box}]}),g=[...new Set([...a.keys()].map(S=>S.split(":")[1]))].sort().map(S=>{const P=[...a.keys()].filter(T=>T.startsWith(`elsewhere:${S}:`)).map(T=>T.slice(`elsewhere:${S}:`.length)).sort(),z=P.map((T,j)=>{const $=w1(S,T);return{id:$,type:"ghost",parentId:`area:${Kc(S)}`,position:{x:Ql,y:ql+j*(Iu+Ig)},hidden:(a.get($)??[]).every(_=>o.has(_)),data:{project:S,ref:T,dimmed:c?!c.has($):!1},style:{width:Gl,height:Iu},zIndex:3}}),N={width:Gl+Ql*2,height:ql+P.length*Iu+(P.length-1)*Ig+E1};return{area:Kc(S),foreign:S,inner:{nodes:z,box:N},size:N}}),v=U$([...g,...y],e),C=B$(v.map(S=>({id:S.area,...S.size})),b1(v.map(S=>S.size),Ng,1.6),Ng);return v.flatMap(S=>{const P=C.placements.get(S.area);if(S.foreign!==void 0)return[{id:`area:${S.area}`,type:"area",position:{x:P.x,y:P.y},hidden:S.inner.nodes.every(j=>j.hidden===!0),data:{area:S.foreign,colour:"#64748b",count:S.inner.nodes.length,foreign:!0},style:{width:S.size.width,height:S.size.height},zIndex:0},...S.inner.nodes];const z=e.filter(T=>T.area===S.area);return[{id:`area:${S.area}`,type:"area",position:{x:P.x,y:P.y},hidden:z.every(T=>o.has(T.id)),data:{area:S.area,colour:n[S.area]??"#94a3b8",count:z.length},style:{width:S.size.width,height:S.size.height},zIndex:0},...S.inner.nodes]})}function Y$(e,t,n,r,i,o,l){const s=new Set(e.map(h=>h.id)),a=new Set(e.filter(h=>h.status==="done").map(h=>h.id)),u=h=>h.split("-")[0]??h,c=h=>{var p;return n==="area"?t[h.area]??"#94a3b8":((p=Zt[h.status])==null?void 0:p.colour)??"#94a3b8"},f=v1(e).filter(h=>s.has(h.dependent)).map(h=>{const p=`${h.ghostId}->${h.dependent}`,x=r===h.ghostId||r===h.dependent,w=i!=null&&(h.ghostId===i||h.dependent===i),m=x||w||p===o,y=l.has(h.dependent);return{id:p,source:h.ghostId,target:h.dependent,type:"smoothstep",pathOptions:{borderRadius:12},hidden:y&&!w,animated:x,zIndex:-1,style:{stroke:m?"#cbd5e1":"#7c8aa0",strokeWidth:m?2.5:1.2,strokeDasharray:"6 5",opacity:m?1:r?.08:.4}}});return[...e.flatMap(h=>h.deps.filter(p=>s.has(p)&&!_1(p,h.id)).map(p=>{const x=`${p}->${h.id}`,w=r===p||r===h.id,m=i!=null&&(p===i||h.id===i),y=u(p)!==u(h.id),g=w||m||x===o,v=y&&a.has(p),C=l.has(p)||l.has(h.id),E=m&&C;return{id:x,source:p,target:h.id,type:"smoothstep",pathOptions:{borderRadius:12},hidden:C&&!E||v&&!g,animated:w,zIndex:-1,style:{stroke:g?c(h):"#7c8aa0",strokeWidth:g?2.5:y?1.2:1.5,strokeDasharray:y?"6 5":void 0,opacity:g?1:r?y?.08:.12:y?.4:.6}}})),...f]}function X$({data:e}){const{item:t,colour:n,statusColour:r,selected:i,dimmed:o,hiddenLinkIn:l,hiddenLinkOut:s}=e,a=Zt[t.status];return b.jsxs("div",{className:"item-node","data-selected":i,"data-dimmed":o,style:{"--area":n},children:[b.jsx(Nn,{type:"target",position:ie.Left,className:l?"handle--hidden-link":void 0}),b.jsx("div",{className:"item-node__rail"}),b.jsxs("div",{className:"item-node__body",children:[b.jsxs("div",{className:"item-node__meta",children:[b.jsx("span",{className:"item-node__id",children:t.id}),b.jsx("span",{className:"item-node__status",title:(a==null?void 0:a.label)??t.status,style:{color:r},children:(a==null?void 0:a.icon)??"?"})]}),b.jsx("div",{className:"item-node__title","data-strike":(a==null?void 0:a.strike)??!1,children:t.title})]}),b.jsx(Nn,{type:"source",position:ie.Right,className:s?"handle--hidden-link":void 0})]})}const $d=D.createContext(!1);function G$({data:e,selected:t}){const n=D.useContext($d);return b.jsxs("div",{className:"area-box","data-foreign":e.foreign===!0,style:{"--area":e.colour},children:[b.jsx(Dw,{isVisible:t&&!n,minWidth:220,minHeight:120,lineClassName:"box-resize-line",handleClassName:"box-resize-handle"}),b.jsxs("div",{className:"area-box__title",children:[b.jsx("span",{className:"area-box__name",children:e.area}),b.jsx("span",{className:"area-box__count",children:e.count})]})]})}function Q$({data:e}){const{item:t,colour:n,statusColour:r,count:i,selected:o,dimmed:l,hiddenLinkIn:s,hiddenLinkOut:a}=e,u=Zt[t.status],c=D.useContext($d);return b.jsxs("div",{className:"ticket-box","data-selected":o,"data-dimmed":l,style:{"--area":n},children:[b.jsx(Dw,{isVisible:o&&!c,minWidth:200,minHeight:100,lineClassName:"box-resize-line",handleClassName:"box-resize-handle"}),b.jsx(Nn,{type:"target",position:ie.Left,className:s?"handle--hidden-link":void 0}),b.jsxs("div",{className:"ticket-box__title",children:[b.jsx("span",{className:"ticket-box__id",children:t.id}),b.jsx("span",{className:"ticket-box__status",title:(u==null?void 0:u.label)??t.status,style:{color:r},children:(u==null?void 0:u.icon)??"?"}),b.jsx("span",{className:"ticket-box__label","data-strike":(u==null?void 0:u.strike)??!1,children:t.title}),b.jsx("span",{className:"ticket-box__count",children:i})]}),b.jsx(Nn,{type:"source",position:ie.Right,className:a?"handle--hidden-link":void 0})]})}function q$({data:e}){const{project:t,ref:n,dimmed:r}=e;return b.jsxs("div",{className:"ghost-node","data-dimmed":r,title:`${n} lives in the ${t} project, which is not open here`,children:[b.jsx("span",{className:"ghost-node__ref",children:n}),b.jsx(Nn,{type:"source",position:ie.Right})]})}const Fd="roadmap.positions.v2",Bd="roadmap.sizes.v2",Ei=(e,t)=>`${e}:${t}`;function N1(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):{}}catch{return{}}}function I1(e,t){try{localStorage.setItem(e,JSON.stringify(t))}catch{}}const K$=e=>N1(Ei(Fd,e)),Z$=(e,t)=>I1(Ei(Fd,e),t),J$=e=>N1(Ei(Bd,e)),eF=(e,t)=>I1(Ei(Bd,e),t);function tF(e){try{localStorage.removeItem(Ei(Fd,e)),localStorage.removeItem(Ei(Bd,e))}catch{}}const Pg=e=>`${Zt[e].icon} ${Zt[e].label}`;function nF({projectKey:e,ref_:t,status:n,reload:r}){const[i,o]=D.useState(!1),[l,s]=D.useState(null);if(D.useEffect(()=>s(null),[t]),!Ev())return b.jsx("span",{className:"detail__status",children:Pg(n)});async function a(u){if(u!==n){o(!0),s(null);try{await aO(e,t,u)}catch(c){s(c instanceof Error?c.message:String(c))}finally{o(!1),r()}}}return b.jsxs(b.Fragment,{children:[b.jsx("select",{className:"detail__status detail__status--edit",value:n,disabled:i,"aria-label":"Status",onChange:u=>void a(u.target.value),children:Object.keys(Zt).map(u=>b.jsx("option",{value:u,children:Pg(u)},u))}),l!==null&&b.jsx("span",{className:"detail__status-error",children:l})]})}const rF={item:X$,area:G$,ticket:Q$,ghost:q$},iF=Object.keys(Zt),oF=["status","area"],Pu=20,Mg=[],lF=[],sF=[];function aF({plan:e,selection:t,reload:n}){var Ke;const r=t.project,{ToolbarActions:i,EmptyPlan:o}=I4(),l=(r==null?void 0:r.key)??"",s=(r==null?void 0:r.items)??lF,a=D.useMemo(()=>T4(s),[s]),u=D.useMemo(()=>O$(a),[a]),[c,f]=D.useState(new Set),[d,h]=D.useState(new Set),[p,x]=D.useState("area"),[w,m]=D.useState(!1),[y,g]=D.useState(null),[v,C]=D.useState(null),[E,S]=D.useState(null),[P,z]=D.useState(0),[N,T]=D.useState(!0),[j,$]=D.useState(new Set),_=U=>({open:!j.has(U),onToggle:()=>$(ee=>ne(ee,U))}),A=D.useMemo(()=>((r==null?void 0:r.next)??sF).flatMap(U=>s.find(ee=>ee.id===U)??[]),[r,s]),O=D.useMemo(()=>{const U=new Set;for(const ee of s)for(const ge of ee.deps)U.add(ge).add(ee.id);return U},[s]),R=D.useMemo(()=>s.filter(U=>!c.has(U.area)&&!d.has(U.status)),[s,c,d]),M=D.useMemo(()=>{const U=new Map;for(const ye of s){if(!ye.parent)continue;const H=U.get(ye.parent);H?H.push(ye):U.set(ye.parent,[ye])}const ee=ye=>c.has(ye.area)||d.has(ye.status),ge=new Map,se=ye=>{const H=ge.get(ye.id);if(H!==void 0)return H;const Y=U.get(ye.id),le=Y?Y.every(se):ee(ye);return ge.set(ye.id,le),le},Ee=new Set;for(const ye of s)se(ye)&&Ee.add(ye.id);return Ee},[s,c,d]),L=D.useMemo(()=>{const U=(se,Ee)=>se===Ee||se.startsWith(`${Ee}.`)||Ee.startsWith(`${se}.`),ee=new Map,ge=(se,Ee)=>{const ye=ee.get(se)??new Set;ye.add(Ee),ee.set(se,ye)};for(const se of s)for(const Ee of se.deps)U(Ee,se.id)||(M.has(se.id)&&!M.has(Ee)&&ge(Ee,se.id),M.has(Ee)&&!M.has(se.id)&&ge(se.id,Ee));return ee},[s,M]),[k,F]=GP([]),[B,I,G]=QP([]),K=D.useRef(K$(l)),q=D.useRef(J$(l)),te=D.useCallback(U=>{let ee=!1,ge=!1;for(const se of U)se.type==="position"&&se.position?(K.current[se.id]=se.position,se.dragging===!1&&(ee=!0)):se.type==="dimensions"&&se.dimensions&&(q.current[se.id]=se.dimensions,se.resizing===!1&&(ge=!0));ee&&Z$(l,K.current),ge&&eF(l,q.current),F(se=>cd(U,se))},[l,F]),V=D.useCallback(()=>{(Object.keys(K.current).length>0||Object.keys(q.current).length>0)&&!window.confirm("Reset the layout? This discards your saved node positions and sizes.")||(tF(l),K.current={},q.current={},z(ee=>ee+1))},[l]);D.useEffect(()=>{const U=W$(s,a,u,p,y,M);F(U.map(ee=>{const ge=K.current[ee.id],se=q.current[ee.id],Ee=ge??ee.position,ye=se?{...ee.style,width:se.width,height:se.height}:ee.style;return{...ee,position:Ee,style:ye}}))},[s,a,u,p,y,M,P,F]),D.useEffect(()=>{I(Y$(s,u,p,y,v,E,M))},[s,u,p,y,v,E,M,I]);const Q=D.useRef(new Set);D.useEffect(()=>{const U=(v?L.get(v):void 0)??new Set,ee=Q.current;U.size===0&&ee.size===0||(F(ge=>ge.map(se=>{if(U.has(se.id))return{...se,hidden:!1,style:{...se.style,opacity:.42}};if(ee.has(se.id)){const Ee={...se.style};return delete Ee.opacity,{...se,hidden:M.has(se.id),style:Ee}}return se})),Q.current=U)},[v,L,M,F]);const Z=y?s.find(U=>U.id===y)??null:null,oe=Z?(r==null?void 0:r.bodies.get(Z.id))??"":"",ne=(U,ee)=>{const ge=new Set(U);return ge.has(ee)?ge.delete(ee):ge.add(ee),ge},re=(U,ee)=>{(ee.type==="item"||ee.type==="ticket")&&g(ee.data.item.id)},ce=(U,ee)=>{O.has(ee.id)&&C(ee.id)},de=()=>C(null),me=(U,ee)=>S(ee.id),_e=()=>S(null),Xe=D.useMemo(()=>{const U=new Map,ee=new Map;for(const ge of s)U.set(ge.area,(U.get(ge.area)??0)+1),ee.set(ge.status,(ee.get(ge.status)??0)+1);return{byArea:U,byStatus:ee}},[s]);return b.jsxs("div",{className:"app",children:[b.jsxs("header",{className:"topbar",children:[b.jsxs("div",{className:"topbar__title",children:[e.projects.length>1?b.jsxs("select",{className:"picker","aria-label":"Project",value:(r==null?void 0:r.key)??"",onChange:U=>{window.location.hash=U.target.value},children:[r===null&&b.jsx("option",{value:"",children:"choose a project"}),e.projects.map(U=>b.jsx("option",{value:U.key,children:U.name},U.key))]}):b.jsx("strong",{children:(r==null?void 0:r.name)??"no project"}),b.jsxs("span",{className:"topbar__sub",title:e.storePath??"a database is the source of truth here - there is no plan file",children:[R.length," of ",s.length," items - ",((Ke=e.storePath)==null?void 0:Ke.split("/").pop())??"database"]})]}),b.jsxs("div",{className:"filters",children:[b.jsx("div",{className:"filters__group",children:a.map(U=>b.jsxs("button",{className:"chip","data-off":c.has(U),style:{"--area":u[U]},onClick:()=>f(ee=>ne(ee,U)),children:[b.jsx("span",{className:"chip__dot"}),U,b.jsx("span",{className:"chip__count",children:Xe.byArea.get(U)})]},U))}),b.jsx("div",{className:"filters__group",children:iF.map(U=>b.jsxs("button",{className:"chip","data-off":d.has(U),style:{"--area":Zt[U].colour},onClick:()=>h(ee=>ne(ee,U)),children:[b.jsx("span",{className:"chip__dot"}),Zt[U].label,b.jsx("span",{className:"chip__count",children:Xe.byStatus.get(U)??0})]},U))}),b.jsxs("div",{className:"segmented",role:"group","aria-label":"Colour by",children:[b.jsx("span",{className:"segmented__label",children:"colour"}),oF.map(U=>b.jsx("button",{className:"segmented__btn","data-on":p===U,onClick:()=>x(U),children:U},U))]}),b.jsx("button",{className:"chip","data-on":w,onClick:()=>m(U=>!U),title:w?"Unlock to drag / resize nodes":"Lock the layout: pan without moving nodes",children:w?"🔒 locked":"🔓 lock"}),b.jsx("button",{className:"chip",onClick:V,title:"Clear saved positions and re-run auto-layout",children:"reset layout"}),A.length>0&&b.jsxs("button",{className:"chip","data-off":!N,onClick:()=>T(U=>!U),title:"The order agreed with set_next",children:["next",b.jsx("span",{className:"chip__count",children:A.length})]}),i!==void 0&&b.jsx(i,{plan:e,project:r,reload:n})]})]}),b.jsxs("div",{className:"body",children:[b.jsxs("div",{className:"graph",children:[e.projects.length===0&&o!==void 0?b.jsx("div",{className:"graph__notice",children:b.jsx(o,{reload:n})}):t.notice!==null&&b.jsx("div",{className:"graph__notice",children:t.notice}),N&&A.length>0&&b.jsxs("aside",{className:"next",children:[b.jsxs("div",{className:"next__head",children:[b.jsx("span",{className:"next__label",children:"Next"}),b.jsx("button",{className:"next__close",onClick:()=>T(!1),"aria-label":"Close",children:"✕"})]}),b.jsx("ol",{className:"next__list",children:A.map((U,ee)=>b.jsx("li",{children:b.jsxs("button",{className:"next__item","data-on":y===U.id,"data-hidden":M.has(U.id),onClick:()=>g(U.id),children:[b.jsx("span",{className:"next__pos",children:ee+1}),b.jsx("span",{className:"next__id",style:{color:u[U.area]},children:U.id}),b.jsx("span",{className:"next__title",children:U.title})]})},U.id))})]}),b.jsx($d.Provider,{value:w,children:b.jsxs(XP,{nodes:k,edges:B,nodeTypes:rF,onNodesChange:te,onEdgesChange:G,onNodeClick:re,onNodeMouseEnter:ce,onNodeMouseLeave:de,onEdgeMouseEnter:me,onEdgeMouseLeave:_e,onPaneClick:()=>g(null),nodesDraggable:!w,fitView:!0,snapToGrid:!0,snapGrid:[Pu,Pu],minZoom:.2,maxZoom:1.75,proOptions:{hideAttribution:!0},children:[b.jsx(eM,{gap:Pu,color:"#232a33"}),b.jsx(kM,{pannable:!0,zoomable:!0,nodeColor:U=>U.data.colour??"#2b3644",nodeStrokeColor:"#0b0f14",nodeBorderRadius:4,maskColor:"rgba(11,15,20,0.6)"}),b.jsx(sM,{})]})})]}),Z&&b.jsxs("aside",{className:"detail",children:[b.jsxs("div",{className:"detail__head",children:[b.jsxs("div",{children:[b.jsx("span",{className:"detail__id",style:{color:u[Z.area]},children:Z.id}),r&&b.jsx(nF,{projectKey:r.key,ref_:Z.id,status:Z.status,reload:n})]}),b.jsx("button",{className:"detail__close",onClick:()=>g(null),"aria-label":"Close",children:"×"})]}),Z.deps.length>0&&b.jsxs("div",{className:"detail__deps",children:["depends on:"," ",Z.deps.map((U,ee)=>{const ge=zd(U);return b.jsxs("span",{children:[ee>0&&", ",ge===null?b.jsx("button",{className:"detail__dep",onClick:()=>g(U),children:U}):b.jsx("span",{className:"detail__dep detail__dep--elsewhere",title:`${ge.ref} in the ${ge.project} project, which is not open here`,children:U})]},U)})]}),b.jsx("div",{className:"detail__doc",children:b.jsx(nO,{remarkPlugins:[N4],children:oe})}),r&&b.jsx(xO,{metrics:r.metrics.get(Z.id)??Mg,..._("metrics")}),r&&b.jsx(mO,{..._("images"),projectKey:r.key,ref_:Z.id,images:r.attachments.get(Z.id)??Mg,uploadsDisabled:e.uploadsDisabled,reload:n})]})]})]})}function uF({extensions:e}){var c;const[t,n]=D.useState(null),[r,i]=D.useState(null),[o,l]=D.useState(null),s=cF();D.useEffect(()=>{sO(e.session,l).then(l,()=>l({mode:"local"}))},[e.session]);const a=D.useCallback(()=>{dO().then(n,f=>i(f instanceof Error?f.message:String(f)))},[]);if(D.useEffect(()=>{o!==null&&o.mode!=="anonymous"&&a()},[o,a]),o===null)return b.jsx("div",{className:"boot",children:"Starting..."});if(o.mode==="anonymous")return b.jsxs("div",{className:"boot",children:[b.jsx("strong",{children:"Sign in to see your projects"}),b.jsx("span",{className:"boot__hint",children:"This viewer is hosted, so it shows the projects belonging to your account."}),b.jsx("button",{className:"boot__action",onClick:o.signIn,children:o.signInLabel})]});if(r)return b.jsxs("div",{className:"boot boot--error",children:[b.jsx("strong",{children:"Could not load the plan."}),b.jsx("span",{children:r}),b.jsxs("span",{className:"boot__hint",children:["Nothing is serving ",b.jsx("code",{children:Xc}),". Run ",b.jsx("code",{children:"yarn viewer"}),", or open the viewer from the MCP server so it serves the store it already has loaded."]})]});if(!t)return b.jsx("div",{className:"boot",children:"Loading the plan..."});const u=hO(t.projects,s);return b.jsx(Yv.Provider,{value:e,children:b.jsx(aF,{plan:t,selection:u,reload:a},((c=u.project)==null?void 0:c.key)??"none")})}function cF(){const e=()=>decodeURIComponent(window.location.hash.replace(/^#/,""))||null,[t,n]=D.useState(e);return D.useEffect(()=>{const r=()=>n(e());return window.addEventListener("hashchange",r),()=>window.removeEventListener("hashchange",r)},[]),t}function fF(e={}){V0(document.getElementById("root")).render(b.jsx(D.StrictMode,{children:b.jsx(uF,{extensions:e})}))}fF();