archbyte 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -62
- package/dist/agents/index.js +2 -0
- package/dist/agents/prompt-data.js +9 -0
- package/dist/cli/analyze.js +81 -1
- package/package.json +1 -1
- package/ui/dist/assets/index-ClEznf0G.js +85 -0
- package/ui/dist/assets/{index-bMoto6NK.css → index-FuWCQecR.css} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-CkJhpZMm.js +0 -85
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const u of a.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();function tl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pc={exports:{}},To={},Ac={exports:{}},Ue={};/**
|
|
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 Ip;function nw(){if(Ip)return Ue;Ip=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function x(z){return z===null||typeof z!="object"?null:(z=g&&z[g]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function C(z,Y,A){this.props=z,this.context=Y,this.refs=E,this.updater=A||w}C.prototype.isReactComponent={},C.prototype.setState=function(z,Y){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,Y,"setState")},C.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function S(){}S.prototype=C.prototype;function b(z,Y,A){this.props=z,this.context=Y,this.refs=E,this.updater=A||w}var N=b.prototype=new S;N.constructor=b,k(N,C.prototype),N.isPureReactComponent=!0;var I=Array.isArray,B=Object.prototype.hasOwnProperty,T={current:null},$={key:!0,ref:!0,__self:!0,__source:!0};function Q(z,Y,A){var le,fe={},ce=null,ve=null;if(Y!=null)for(le in Y.ref!==void 0&&(ve=Y.ref),Y.key!==void 0&&(ce=""+Y.key),Y)B.call(Y,le)&&!$.hasOwnProperty(le)&&(fe[le]=Y[le]);var se=arguments.length-2;if(se===1)fe.children=A;else if(1<se){for(var xe=Array(se),je=0;je<se;je++)xe[je]=arguments[je+2];fe.children=xe}if(z&&z.defaultProps)for(le in se=z.defaultProps,se)fe[le]===void 0&&(fe[le]=se[le]);return{$$typeof:e,type:z,key:ce,ref:ve,props:fe,_owner:T.current}}function U(z,Y){return{$$typeof:e,type:z.type,key:Y,ref:z.ref,props:z.props,_owner:z._owner}}function q(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function L(z){var Y={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(A){return Y[A]})}var W=/\/+/g;function J(z,Y){return typeof z=="object"&&z!==null&&z.key!=null?L(""+z.key):Y.toString(36)}function P(z,Y,A,le,fe){var ce=typeof z;(ce==="undefined"||ce==="boolean")&&(z=null);var ve=!1;if(z===null)ve=!0;else switch(ce){case"string":case"number":ve=!0;break;case"object":switch(z.$$typeof){case e:case t:ve=!0}}if(ve)return ve=z,fe=fe(ve),z=le===""?"."+J(ve,0):le,I(fe)?(A="",z!=null&&(A=z.replace(W,"$&/")+"/"),P(fe,Y,A,"",function(je){return je})):fe!=null&&(q(fe)&&(fe=U(fe,A+(!fe.key||ve&&ve.key===fe.key?"":(""+fe.key).replace(W,"$&/")+"/")+z)),Y.push(fe)),1;if(ve=0,le=le===""?".":le+":",I(z))for(var se=0;se<z.length;se++){ce=z[se];var xe=le+J(ce,se);ve+=P(ce,Y,A,xe,fe)}else if(xe=x(z),typeof xe=="function")for(z=xe.call(z),se=0;!(ce=z.next()).done;)ce=ce.value,xe=le+J(ce,se++),ve+=P(ce,Y,A,xe,fe);else if(ce==="object")throw Y=String(z),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.");return ve}function O(z,Y,A){if(z==null)return z;var le=[],fe=0;return P(z,le,"","",function(ce){return Y.call(A,ce,fe++)}),le}function F(z){if(z._status===-1){var Y=z._result;Y=Y(),Y.then(function(A){(z._status===0||z._status===-1)&&(z._status=1,z._result=A)},function(A){(z._status===0||z._status===-1)&&(z._status=2,z._result=A)}),z._status===-1&&(z._status=0,z._result=Y)}if(z._status===1)return z._result.default;throw z._result}var K={current:null},R={transition:null},V={ReactCurrentDispatcher:K,ReactCurrentBatchConfig:R,ReactCurrentOwner:T};function j(){throw Error("act(...) is not supported in production builds of React.")}return Ue.Children={map:O,forEach:function(z,Y,A){O(z,function(){Y.apply(this,arguments)},A)},count:function(z){var Y=0;return O(z,function(){Y++}),Y},toArray:function(z){return O(z,function(Y){return Y})||[]},only:function(z){if(!q(z))throw Error("React.Children.only expected to receive a single React element child.");return z}},Ue.Component=C,Ue.Fragment=r,Ue.Profiler=o,Ue.PureComponent=b,Ue.StrictMode=s,Ue.Suspense=h,Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V,Ue.act=j,Ue.cloneElement=function(z,Y,A){if(z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+z+".");var le=k({},z.props),fe=z.key,ce=z.ref,ve=z._owner;if(Y!=null){if(Y.ref!==void 0&&(ce=Y.ref,ve=T.current),Y.key!==void 0&&(fe=""+Y.key),z.type&&z.type.defaultProps)var se=z.type.defaultProps;for(xe in Y)B.call(Y,xe)&&!$.hasOwnProperty(xe)&&(le[xe]=Y[xe]===void 0&&se!==void 0?se[xe]:Y[xe])}var xe=arguments.length-2;if(xe===1)le.children=A;else if(1<xe){se=Array(xe);for(var je=0;je<xe;je++)se[je]=arguments[je+2];le.children=se}return{$$typeof:e,type:z.type,key:fe,ref:ce,props:le,_owner:ve}},Ue.createContext=function(z){return z={$$typeof:u,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},z.Provider={$$typeof:a,_context:z},z.Consumer=z},Ue.createElement=Q,Ue.createFactory=function(z){var Y=Q.bind(null,z);return Y.type=z,Y},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(z){return{$$typeof:c,render:z}},Ue.isValidElement=q,Ue.lazy=function(z){return{$$typeof:m,_payload:{_status:-1,_result:z},_init:F}},Ue.memo=function(z,Y){return{$$typeof:p,type:z,compare:Y===void 0?null:Y}},Ue.startTransition=function(z){var Y=R.transition;R.transition={};try{z()}finally{R.transition=Y}},Ue.unstable_act=j,Ue.useCallback=function(z,Y){return K.current.useCallback(z,Y)},Ue.useContext=function(z){return K.current.useContext(z)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(z){return K.current.useDeferredValue(z)},Ue.useEffect=function(z,Y){return K.current.useEffect(z,Y)},Ue.useId=function(){return K.current.useId()},Ue.useImperativeHandle=function(z,Y,A){return K.current.useImperativeHandle(z,Y,A)},Ue.useInsertionEffect=function(z,Y){return K.current.useInsertionEffect(z,Y)},Ue.useLayoutEffect=function(z,Y){return K.current.useLayoutEffect(z,Y)},Ue.useMemo=function(z,Y){return K.current.useMemo(z,Y)},Ue.useReducer=function(z,Y,A){return K.current.useReducer(z,Y,A)},Ue.useRef=function(z){return K.current.useRef(z)},Ue.useState=function(z){return K.current.useState(z)},Ue.useSyncExternalStore=function(z,Y,A){return K.current.useSyncExternalStore(z,Y,A)},Ue.useTransition=function(){return K.current.useTransition()},Ue.version="18.3.1",Ue}var Tp;function nl(){return Tp||(Tp=1,Ac.exports=nw()),Ac.exports}/**
|
|
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 Pp;function rw(){if(Pp)return To;Pp=1;var e=nl(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function u(c,h,p){var m,g={},x=null,w=null;p!==void 0&&(x=""+p),h.key!==void 0&&(x=""+h.key),h.ref!==void 0&&(w=h.ref);for(m in h)s.call(h,m)&&!a.hasOwnProperty(m)&&(g[m]=h[m]);if(c&&c.defaultProps)for(m in h=c.defaultProps,h)g[m]===void 0&&(g[m]=h[m]);return{$$typeof:t,type:c,key:x,ref:w,props:g,_owner:o.current}}return To.Fragment=r,To.jsx=u,To.jsxs=u,To}var Ap;function iw(){return Ap||(Ap=1,Pc.exports=rw()),Pc.exports}var f=iw(),M=nl();const Hg=tl(M);var ca={},Mc={exports:{}},an={},Rc={exports:{}},zc={};/**
|
|
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
|
-
*/var Mp;function sw(){return Mp||(Mp=1,(function(e){function t(R,V){var j=R.length;R.push(V);e:for(;0<j;){var z=j-1>>>1,Y=R[z];if(0<o(Y,V))R[z]=V,R[j]=Y,j=z;else break e}}function r(R){return R.length===0?null:R[0]}function s(R){if(R.length===0)return null;var V=R[0],j=R.pop();if(j!==V){R[0]=j;e:for(var z=0,Y=R.length,A=Y>>>1;z<A;){var le=2*(z+1)-1,fe=R[le],ce=le+1,ve=R[ce];if(0>o(fe,j))ce<Y&&0>o(ve,fe)?(R[z]=ve,R[ce]=j,z=ce):(R[z]=fe,R[le]=j,z=le);else if(ce<Y&&0>o(ve,j))R[z]=ve,R[ce]=j,z=ce;else break e}}return V}function o(R,V){var j=R.sortIndex-V.sortIndex;return j!==0?j:R.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var h=[],p=[],m=1,g=null,x=3,w=!1,k=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(R){for(var V=r(p);V!==null;){if(V.callback===null)s(p);else if(V.startTime<=R)s(p),V.sortIndex=V.expirationTime,t(h,V);else break;V=r(p)}}function I(R){if(E=!1,N(R),!k)if(r(h)!==null)k=!0,F(B);else{var V=r(p);V!==null&&K(I,V.startTime-R)}}function B(R,V){k=!1,E&&(E=!1,S(Q),Q=-1),w=!0;var j=x;try{for(N(V),g=r(h);g!==null&&(!(g.expirationTime>V)||R&&!L());){var z=g.callback;if(typeof z=="function"){g.callback=null,x=g.priorityLevel;var Y=z(g.expirationTime<=V);V=e.unstable_now(),typeof Y=="function"?g.callback=Y:g===r(h)&&s(h),N(V)}else s(h);g=r(h)}if(g!==null)var A=!0;else{var le=r(p);le!==null&&K(I,le.startTime-V),A=!1}return A}finally{g=null,x=j,w=!1}}var T=!1,$=null,Q=-1,U=5,q=-1;function L(){return!(e.unstable_now()-q<U)}function W(){if($!==null){var R=e.unstable_now();q=R;var V=!0;try{V=$(!0,R)}finally{V?J():(T=!1,$=null)}}else T=!1}var J;if(typeof b=="function")J=function(){b(W)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,O=P.port2;P.port1.onmessage=W,J=function(){O.postMessage(null)}}else J=function(){C(W,0)};function F(R){$=R,T||(T=!0,J())}function K(R,V){Q=C(function(){R(e.unstable_now())},V)}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(R){R.callback=null},e.unstable_continueExecution=function(){k||w||(k=!0,F(B))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return r(h)},e.unstable_next=function(R){switch(x){case 1:case 2:case 3:var V=3;break;default:V=x}var j=x;x=V;try{return R()}finally{x=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,V){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var j=x;x=R;try{return V()}finally{x=j}},e.unstable_scheduleCallback=function(R,V,j){var z=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?z+j:z):j=z,R){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=j+Y,R={id:m++,callback:V,priorityLevel:R,startTime:j,expirationTime:Y,sortIndex:-1},j>z?(R.sortIndex=j,t(p,R),r(h)===null&&R===r(p)&&(E?(S(Q),Q=-1):E=!0,K(I,j-z))):(R.sortIndex=Y,t(h,R),k||w||(k=!0,F(B))),R},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(R){var V=x;return function(){var j=x;x=V;try{return R.apply(this,arguments)}finally{x=j}}}})(zc)),zc}var Rp;function ow(){return Rp||(Rp=1,Rc.exports=sw()),Rc.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 zp;function lw(){if(zp)return an;zp=1;var e=nl(),t=ow();function r(n){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+n,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+n+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,o={};function a(n,i){u(n,i),u(n+"Capture",i)}function u(n,i){for(o[n]=i,n=0;n<i.length;n++)s.add(i[n])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,p=/^[: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]*$/,m={},g={};function x(n){return h.call(g,n)?!0:h.call(m,n)?!1:p.test(n)?g[n]=!0:(m[n]=!0,!1)}function w(n,i,l,d){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:l!==null?!l.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function k(n,i,l,d){if(i===null||typeof i>"u"||w(n,i,l,d))return!0;if(d)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function E(n,i,l,d,y,v,_){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=y,this.mustUseProperty=l,this.propertyName=n,this.type=i,this.sanitizeURL=v,this.removeEmptyString=_}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){C[n]=new E(n,0,!1,n,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var i=n[0];C[i]=new E(i,1,!1,n[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(n){C[n]=new E(n,2,!1,n.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){C[n]=new E(n,2,!1,n,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(n){C[n]=new E(n,3,!1,n.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(n){C[n]=new E(n,3,!0,n,null,!1,!1)}),["capture","download"].forEach(function(n){C[n]=new E(n,4,!1,n,null,!1,!1)}),["cols","rows","size","span"].forEach(function(n){C[n]=new E(n,6,!1,n,null,!1,!1)}),["rowSpan","start"].forEach(function(n){C[n]=new E(n,5,!1,n.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function b(n){return n[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(n){var i=n.replace(S,b);C[i]=new E(i,1,!1,n,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var i=n.replace(S,b);C[i]=new E(i,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(n){var i=n.replace(S,b);C[i]=new E(i,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(n){C[n]=new E(n,1,!1,n.toLowerCase(),null,!1,!1)}),C.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(n){C[n]=new E(n,1,!1,n.toLowerCase(),null,!0,!0)});function N(n,i,l,d){var y=C.hasOwnProperty(i)?C[i]:null;(y!==null?y.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(k(i,l,y,d)&&(l=null),d||y===null?x(i)&&(l===null?n.removeAttribute(i):n.setAttribute(i,""+l)):y.mustUseProperty?n[y.propertyName]=l===null?y.type===3?!1:"":l:(i=y.attributeName,d=y.attributeNamespace,l===null?n.removeAttribute(i):(y=y.type,l=y===3||y===4&&l===!0?"":""+l,d?n.setAttributeNS(d,i,l):n.setAttribute(i,l))))}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),T=Symbol.for("react.portal"),$=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),q=Symbol.for("react.provider"),L=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),R=Symbol.iterator;function V(n){return n===null||typeof n!="object"?null:(n=R&&n[R]||n["@@iterator"],typeof n=="function"?n:null)}var j=Object.assign,z;function Y(n){if(z===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);z=i&&i[1]||""}return`
|
|
34
|
-
`+z+n}var A=!1;function le(n,i){if(!n||A)return"";A=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(ne){var d=ne}Reflect.construct(n,[],i)}else{try{i.call()}catch(ne){d=ne}n.call(i.prototype)}else{try{throw Error()}catch(ne){d=ne}n()}}catch(ne){if(ne&&d&&typeof ne.stack=="string"){for(var y=ne.stack.split(`
|
|
35
|
-
`),v=d.stack.split(`
|
|
36
|
-
`),_=y.length-1,D=v.length-1;1<=_&&0<=D&&y[_]!==v[D];)D--;for(;1<=_&&0<=D;_--,D--)if(y[_]!==v[D]){if(_!==1||D!==1)do if(_--,D--,0>D||y[_]!==v[D]){var X=`
|
|
37
|
-
`+y[_].replace(" at new "," at ");return n.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",n.displayName)),X}while(1<=_&&0<=D);break}}}finally{A=!1,Error.prepareStackTrace=l}return(n=n?n.displayName||n.name:"")?Y(n):""}function fe(n){switch(n.tag){case 5:return Y(n.type);case 16:return Y("Lazy");case 13:return Y("Suspense");case 19:return Y("SuspenseList");case 0:case 2:case 15:return n=le(n.type,!1),n;case 11:return n=le(n.type.render,!1),n;case 1:return n=le(n.type,!0),n;default:return""}}function ce(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case $:return"Fragment";case T:return"Portal";case U:return"Profiler";case Q:return"StrictMode";case J:return"Suspense";case P:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case L:return(n.displayName||"Context")+".Consumer";case q:return(n._context.displayName||"Context")+".Provider";case W:var i=n.render;return n=n.displayName,n||(n=i.displayName||i.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case O:return i=n.displayName||null,i!==null?i:ce(n.type)||"Memo";case F:i=n._payload,n=n._init;try{return ce(n(i))}catch{}}return null}function ve(n){var i=n.type;switch(n.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=i.render,n=n.displayName||n.name||"",i.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ce(i);case 8:return i===Q?"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 i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function se(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function xe(n){var i=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function je(n){var i=xe(n)?"checked":"value",l=Object.getOwnPropertyDescriptor(n.constructor.prototype,i),d=""+n[i];if(!n.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var y=l.get,v=l.set;return Object.defineProperty(n,i,{configurable:!0,get:function(){return y.call(this)},set:function(_){d=""+_,v.call(this,_)}}),Object.defineProperty(n,i,{enumerable:l.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){n._valueTracker=null,delete n[i]}}}}function Pe(n){n._valueTracker||(n._valueTracker=je(n))}function Ee(n){if(!n)return!1;var i=n._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return n&&(d=xe(n)?n.checked?"true":"false":n.value),n=d,n!==l?(i.setValue(n),!0):!1}function Ce(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function Ve(n,i){var l=i.checked;return j({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??n._wrapperState.initialChecked})}function We(n,i){var l=i.defaultValue==null?"":i.defaultValue,d=i.checked!=null?i.checked:i.defaultChecked;l=se(i.value!=null?i.value:l),n._wrapperState={initialChecked:d,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function Oe(n,i){i=i.checked,i!=null&&N(n,"checked",i,!1)}function tt(n,i){Oe(n,i);var l=se(i.value),d=i.type;if(l!=null)d==="number"?(l===0&&n.value===""||n.value!=l)&&(n.value=""+l):n.value!==""+l&&(n.value=""+l);else if(d==="submit"||d==="reset"){n.removeAttribute("value");return}i.hasOwnProperty("value")?bt(n,i.type,l):i.hasOwnProperty("defaultValue")&&bt(n,i.type,se(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(n.defaultChecked=!!i.defaultChecked)}function It(n,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var d=i.type;if(!(d!=="submit"&&d!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+n._wrapperState.initialValue,l||i===n.value||(n.value=i),n.defaultValue=i}l=n.name,l!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,l!==""&&(n.name=l)}function bt(n,i,l){(i!=="number"||Ce(n.ownerDocument)!==n)&&(l==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+l&&(n.defaultValue=""+l))}var gt=Array.isArray;function Tt(n,i,l,d){if(n=n.options,i){i={};for(var y=0;y<l.length;y++)i["$"+l[y]]=!0;for(l=0;l<n.length;l++)y=i.hasOwnProperty("$"+n[l].value),n[l].selected!==y&&(n[l].selected=y),y&&d&&(n[l].defaultSelected=!0)}else{for(l=""+se(l),i=null,y=0;y<n.length;y++){if(n[y].value===l){n[y].selected=!0,d&&(n[y].defaultSelected=!0);return}i!==null||n[y].disabled||(i=n[y])}i!==null&&(i.selected=!0)}}function Ht(n,i){if(i.dangerouslySetInnerHTML!=null)throw Error(r(91));return j({},i,{value:void 0,defaultValue:void 0,children:""+n._wrapperState.initialValue})}function pn(n,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(r(92));if(gt(l)){if(1<l.length)throw Error(r(93));l=l[0]}i=l}i==null&&(i=""),l=i}n._wrapperState={initialValue:se(l)}}function mn(n,i){var l=se(i.value),d=se(i.defaultValue);l!=null&&(l=""+l,l!==n.value&&(n.value=l),i.defaultValue==null&&n.defaultValue!==l&&(n.defaultValue=l)),d!=null&&(n.defaultValue=""+d)}function Jt(n){var i=n.textContent;i===n._wrapperState.initialValue&&i!==""&&i!==null&&(n.value=i)}function ie(n){switch(n){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 me(n,i){return n==null||n==="http://www.w3.org/1999/xhtml"?ie(i):n==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":n}var pe,$e=(function(n){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,d,y){MSApp.execUnsafeLocalFunction(function(){return n(i,l,d,y)})}:n})(function(n,i){if(n.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in n)n.innerHTML=i;else{for(pe=pe||document.createElement("div"),pe.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=pe.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;i.firstChild;)n.appendChild(i.firstChild)}});function Be(n,i){if(i){var l=n.firstChild;if(l&&l===n.lastChild&&l.nodeType===3){l.nodeValue=i;return}}n.textContent=i}var ht={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},gn=["Webkit","ms","Moz","O"];Object.keys(ht).forEach(function(n){gn.forEach(function(i){i=i+n.charAt(0).toUpperCase()+n.substring(1),ht[i]=ht[n]})});function Pt(n,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||ht.hasOwnProperty(n)&&ht[n]?(""+i).trim():i+"px"}function yt(n,i){n=n.style;for(var l in i)if(i.hasOwnProperty(l)){var d=l.indexOf("--")===0,y=Pt(l,i[l],d);l==="float"&&(l="cssFloat"),d?n.setProperty(l,y):n[l]=y}}var _n=j({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 pt(n,i){if(i){if(_n[n]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(r(137,n));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(r(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(r(61))}if(i.style!=null&&typeof i.style!="object")throw Error(r(62))}}function en(n,i){if(n.indexOf("-")===-1)return typeof i.is=="string";switch(n){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 At=null;function Or(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var $r=null,Vt=null,tr=null;function Fn(n){if(n=mo(n)){if(typeof $r!="function")throw Error(r(280));var i=n.stateNode;i&&(i=Cl(i),$r(n.stateNode,n.type,i))}}function yn(n){Vt?tr?tr.push(n):tr=[n]:Vt=n}function Br(){if(Vt){var n=Vt,i=tr;if(tr=Vt=null,Fn(n),i)for(n=0;n<i.length;n++)Fn(i[n])}}function wi(n,i){return n(i)}function On(){}var vr=!1;function Ji(n,i,l){if(vr)return n(i,l);vr=!0;try{return wi(n,i,l)}finally{vr=!1,(Vt!==null||tr!==null)&&(On(),Br())}}function wr(n,i){var l=n.stateNode;if(l===null)return null;var d=Cl(l);if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(n=n.type,d=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!d;break e;default:n=!1}if(n)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var Sr=!1;if(c)try{var $n={};Object.defineProperty($n,"passive",{get:function(){Sr=!0}}),window.addEventListener("test",$n,$n),window.removeEventListener("test",$n,$n)}catch{Sr=!1}function Hr(n,i,l,d,y,v,_,D,X){var ne=Array.prototype.slice.call(arguments,3);try{i.apply(l,ne)}catch(de){this.onError(de)}}var Vr=!1,Dt=null,kr=!1,St=null,Gs={onError:function(n){Vr=!0,Dt=n}};function xn(n,i,l,d,y,v,_,D,X){Vr=!1,Dt=null,Hr.apply(Gs,arguments)}function es(n,i,l,d,y,v,_,D,X){if(xn.apply(this,arguments),Vr){if(Vr){var ne=Dt;Vr=!1,Dt=null}else throw Error(r(198));kr||(kr=!0,St=ne)}}function Ft(n){var i=n,l=n;if(n.alternate)for(;i.return;)i=i.return;else{n=i;do i=n,(i.flags&4098)!==0&&(l=i.return),n=i.return;while(n)}return i.tag===3?l:null}function Si(n){if(n.tag===13){var i=n.memoizedState;if(i===null&&(n=n.alternate,n!==null&&(i=n.memoizedState)),i!==null)return i.dehydrated}return null}function Bn(n){if(Ft(n)!==n)throw Error(r(188))}function xt(n){var i=n.alternate;if(!i){if(i=Ft(n),i===null)throw Error(r(188));return i!==n?null:n}for(var l=n,d=i;;){var y=l.return;if(y===null)break;var v=y.alternate;if(v===null){if(d=y.return,d!==null){l=d;continue}break}if(y.child===v.child){for(v=y.child;v;){if(v===l)return Bn(y),n;if(v===d)return Bn(y),i;v=v.sibling}throw Error(r(188))}if(l.return!==d.return)l=y,d=v;else{for(var _=!1,D=y.child;D;){if(D===l){_=!0,l=y,d=v;break}if(D===d){_=!0,d=y,l=v;break}D=D.sibling}if(!_){for(D=v.child;D;){if(D===l){_=!0,l=v,d=y;break}if(D===d){_=!0,d=v,l=y;break}D=D.sibling}if(!_)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?n:i}function ki(n){return n=xt(n),n!==null?nr(n):null}function nr(n){if(n.tag===5||n.tag===6)return n;for(n=n.child;n!==null;){var i=nr(n);if(i!==null)return i;n=n.sibling}return null}var Ni=t.unstable_scheduleCallback,Ei=t.unstable_cancelCallback,In=t.unstable_shouldYield,rr=t.unstable_requestPaint,st=t.unstable_now,Ks=t.unstable_getCurrentPriorityLevel,Ci=t.unstable_ImmediatePriority,bi=t.unstable_UserBlockingPriority,Nr=t.unstable_NormalPriority,Qs=t.unstable_LowPriority,ts=t.unstable_IdlePriority,Er=null,tn=null;function ns(n){if(tn&&typeof tn.onCommitFiberRoot=="function")try{tn.onCommitFiberRoot(Er,n,void 0,(n.current.flags&128)===128)}catch{}}var Ot=Math.clz32?Math.clz32:ir,Ur=Math.log,rs=Math.LN2;function ir(n){return n>>>=0,n===0?32:31-(Ur(n)/rs|0)|0}var Wr=64,Yr=4194304;function Gt(n){switch(n&-n){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 n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function et(n,i){var l=n.pendingLanes;if(l===0)return 0;var d=0,y=n.suspendedLanes,v=n.pingedLanes,_=l&268435455;if(_!==0){var D=_&~y;D!==0?d=Gt(D):(v&=_,v!==0&&(d=Gt(v)))}else _=l&~y,_!==0?d=Gt(_):v!==0&&(d=Gt(v));if(d===0)return 0;if(i!==0&&i!==d&&(i&y)===0&&(y=d&-d,v=i&-i,y>=v||y===16&&(v&4194240)!==0))return i;if((d&4)!==0&&(d|=l&16),i=n.entangledLanes,i!==0)for(n=n.entanglements,i&=d;0<i;)l=31-Ot(i),y=1<<l,d|=n[l],i&=~y;return d}function Xr(n,i){switch(n){case 1:case 2:case 4:return i+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 i+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 Zs(n,i){for(var l=n.suspendedLanes,d=n.pingedLanes,y=n.expirationTimes,v=n.pendingLanes;0<v;){var _=31-Ot(v),D=1<<_,X=y[_];X===-1?((D&l)===0||(D&d)!==0)&&(y[_]=Xr(D,i)):X<=i&&(n.expiredLanes|=D),v&=~D}}function ji(n){return n=n.pendingLanes&-1073741825,n!==0?n:n&1073741824?1073741824:0}function qr(){var n=Wr;return Wr<<=1,(Wr&4194240)===0&&(Wr=64),n}function _i(n){for(var i=[],l=0;31>l;l++)i.push(n);return i}function Hn(n,i,l){n.pendingLanes|=i,i!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,i=31-Ot(i),n[i]=l}function is(n,i){var l=n.pendingLanes&~i;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=i,n.mutableReadLanes&=i,n.entangledLanes&=i,i=n.entanglements;var d=n.eventTimes;for(n=n.expirationTimes;0<l;){var y=31-Ot(l),v=1<<y;i[y]=0,d[y]=-1,n[y]=-1,l&=~v}}function ss(n,i){var l=n.entangledLanes|=i;for(n=n.entanglements;l;){var d=31-Ot(l),y=1<<d;y&i|n[d]&i&&(n[d]|=i),l&=~y}}var Ke=0;function fl(n){return n&=-n,1<n?4<n?(n&268435455)!==0?16:536870912:4:1}var Js,os,eo,Gr,hl,to=!1,ls=[],sr=null,Kt=null,or=null,Ii=new Map,Cr=new Map,Vn=[],H="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 Z(n,i){switch(n){case"focusin":case"focusout":sr=null;break;case"dragenter":case"dragleave":Kt=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Ii.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cr.delete(i.pointerId)}}function re(n,i,l,d,y,v){return n===null||n.nativeEvent!==v?(n={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:v,targetContainers:[y]},i!==null&&(i=mo(i),i!==null&&os(i)),n):(n.eventSystemFlags|=d,i=n.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),n)}function ae(n,i,l,d,y){switch(i){case"focusin":return sr=re(sr,n,i,l,d,y),!0;case"dragenter":return Kt=re(Kt,n,i,l,d,y),!0;case"mouseover":return or=re(or,n,i,l,d,y),!0;case"pointerover":var v=y.pointerId;return Ii.set(v,re(Ii.get(v)||null,n,i,l,d,y)),!0;case"gotpointercapture":return v=y.pointerId,Cr.set(v,re(Cr.get(v)||null,n,i,l,d,y)),!0}return!1}function oe(n){var i=Ti(n.target);if(i!==null){var l=Ft(i);if(l!==null){if(i=l.tag,i===13){if(i=Si(l),i!==null){n.blockedOn=i,hl(n.priority,function(){eo(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){n.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}n.blockedOn=null}function we(n){if(n.blockedOn!==null)return!1;for(var i=n.targetContainers;0<i.length;){var l=no(n.domEventName,n.eventSystemFlags,i[0],n.nativeEvent);if(l===null){l=n.nativeEvent;var d=new l.constructor(l.type,l);At=d,l.target.dispatchEvent(d),At=null}else return i=mo(l),i!==null&&os(i),n.blockedOn=l,!1;i.shift()}return!0}function Ae(n,i,l){we(n)&&l.delete(i)}function _e(){to=!1,sr!==null&&we(sr)&&(sr=null),Kt!==null&&we(Kt)&&(Kt=null),or!==null&&we(or)&&(or=null),Ii.forEach(Ae),Cr.forEach(Ae)}function Me(n,i){n.blockedOn===i&&(n.blockedOn=null,to||(to=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,_e)))}function Ye(n){function i(y){return Me(y,n)}if(0<ls.length){Me(ls[0],n);for(var l=1;l<ls.length;l++){var d=ls[l];d.blockedOn===n&&(d.blockedOn=null)}}for(sr!==null&&Me(sr,n),Kt!==null&&Me(Kt,n),or!==null&&Me(or,n),Ii.forEach(i),Cr.forEach(i),l=0;l<Vn.length;l++)d=Vn[l],d.blockedOn===n&&(d.blockedOn=null);for(;0<Vn.length&&(l=Vn[0],l.blockedOn===null);)oe(l),l.blockedOn===null&&Vn.shift()}var Qe=I.ReactCurrentBatchConfig,vt=!0;function Xe(n,i,l,d){var y=Ke,v=Qe.transition;Qe.transition=null;try{Ke=1,Tn(n,i,l,d)}finally{Ke=y,Qe.transition=v}}function kt(n,i,l,d){var y=Ke,v=Qe.transition;Qe.transition=null;try{Ke=4,Tn(n,i,l,d)}finally{Ke=y,Qe.transition=v}}function Tn(n,i,l,d){if(vt){var y=no(n,i,l,d);if(y===null)Su(n,i,d,br,l),Z(n,d);else if(ae(y,n,i,l,d))d.stopPropagation();else if(Z(n,d),i&4&&-1<H.indexOf(n)){for(;y!==null;){var v=mo(y);if(v!==null&&Js(v),v=no(n,i,l,d),v===null&&Su(n,i,d,br,l),v===y)break;y=v}y!==null&&d.stopPropagation()}else Su(n,i,d,null,l)}}var br=null;function no(n,i,l,d){if(br=null,n=Or(d),n=Ti(n),n!==null)if(i=Ft(n),i===null)n=null;else if(l=i.tag,l===13){if(n=Si(i),n!==null)return n;n=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;n=null}else i!==n&&(n=null);return br=n,null}function mf(n){switch(n){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(Ks()){case Ci:return 1;case bi:return 4;case Nr:case Qs:return 16;case ts:return 536870912;default:return 16}default:return 16}}var Kr=null,su=null,pl=null;function gf(){if(pl)return pl;var n,i=su,l=i.length,d,y="value"in Kr?Kr.value:Kr.textContent,v=y.length;for(n=0;n<l&&i[n]===y[n];n++);var _=l-n;for(d=1;d<=_&&i[l-d]===y[v-d];d++);return pl=y.slice(n,1<d?1-d:void 0)}function ml(n){var i=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&i===13&&(n=13)):n=i,n===10&&(n=13),32<=n||n===13?n:0}function gl(){return!0}function yf(){return!1}function vn(n){function i(l,d,y,v,_){this._reactName=l,this._targetInst=y,this.type=d,this.nativeEvent=v,this.target=_,this.currentTarget=null;for(var D in n)n.hasOwnProperty(D)&&(l=n[D],this[D]=l?l(v):v[D]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?gl:yf,this.isPropagationStopped=yf,this}return j(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=gl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=gl)},persist:function(){},isPersistent:gl}),i}var as={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ou=vn(as),ro=j({},as,{view:0,detail:0}),I0=vn(ro),lu,au,io,yl=j({},ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cu,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==io&&(io&&n.type==="mousemove"?(lu=n.screenX-io.screenX,au=n.screenY-io.screenY):au=lu=0,io=n),lu)},movementY:function(n){return"movementY"in n?n.movementY:au}}),xf=vn(yl),T0=j({},yl,{dataTransfer:0}),P0=vn(T0),A0=j({},ro,{relatedTarget:0}),uu=vn(A0),M0=j({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),R0=vn(M0),z0=j({},as,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),L0=vn(z0),D0=j({},as,{data:0}),vf=vn(D0),F0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},O0={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"},$0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function B0(n){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(n):(n=$0[n])?!!i[n]:!1}function cu(){return B0}var H0=j({},ro,{key:function(n){if(n.key){var i=F0[n.key]||n.key;if(i!=="Unidentified")return i}return n.type==="keypress"?(n=ml(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?O0[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cu,charCode:function(n){return n.type==="keypress"?ml(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?ml(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),V0=vn(H0),U0=j({},yl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wf=vn(U0),W0=j({},ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cu}),Y0=vn(W0),X0=j({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),q0=vn(X0),G0=j({},yl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),K0=vn(G0),Q0=[9,13,27,32],du=c&&"CompositionEvent"in window,so=null;c&&"documentMode"in document&&(so=document.documentMode);var Z0=c&&"TextEvent"in window&&!so,Sf=c&&(!du||so&&8<so&&11>=so),kf=" ",Nf=!1;function Ef(n,i){switch(n){case"keyup":return Q0.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cf(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var us=!1;function J0(n,i){switch(n){case"compositionend":return Cf(i);case"keypress":return i.which!==32?null:(Nf=!0,kf);case"textInput":return n=i.data,n===kf&&Nf?null:n;default:return null}}function ev(n,i){if(us)return n==="compositionend"||!du&&Ef(n,i)?(n=gf(),pl=su=Kr=null,us=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Sf&&i.locale!=="ko"?null:i.data;default:return null}}var tv={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 bf(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i==="input"?!!tv[n.type]:i==="textarea"}function jf(n,i,l,d){yn(d),i=kl(i,"onChange"),0<i.length&&(l=new ou("onChange","change",null,l,d),n.push({event:l,listeners:i}))}var oo=null,lo=null;function nv(n){Wf(n,0)}function xl(n){var i=ps(n);if(Ee(i))return n}function rv(n,i){if(n==="change")return i}var _f=!1;if(c){var fu;if(c){var hu="oninput"in document;if(!hu){var If=document.createElement("div");If.setAttribute("oninput","return;"),hu=typeof If.oninput=="function"}fu=hu}else fu=!1;_f=fu&&(!document.documentMode||9<document.documentMode)}function Tf(){oo&&(oo.detachEvent("onpropertychange",Pf),lo=oo=null)}function Pf(n){if(n.propertyName==="value"&&xl(lo)){var i=[];jf(i,lo,n,Or(n)),Ji(nv,i)}}function iv(n,i,l){n==="focusin"?(Tf(),oo=i,lo=l,oo.attachEvent("onpropertychange",Pf)):n==="focusout"&&Tf()}function sv(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return xl(lo)}function ov(n,i){if(n==="click")return xl(i)}function lv(n,i){if(n==="input"||n==="change")return xl(i)}function av(n,i){return n===i&&(n!==0||1/n===1/i)||n!==n&&i!==i}var Un=typeof Object.is=="function"?Object.is:av;function ao(n,i){if(Un(n,i))return!0;if(typeof n!="object"||n===null||typeof i!="object"||i===null)return!1;var l=Object.keys(n),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var y=l[d];if(!h.call(i,y)||!Un(n[y],i[y]))return!1}return!0}function Af(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Mf(n,i){var l=Af(n);n=0;for(var d;l;){if(l.nodeType===3){if(d=n+l.textContent.length,n<=i&&d>=i)return{node:l,offset:i-n};n=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Af(l)}}function Rf(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?Rf(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function zf(){for(var n=window,i=Ce();i instanceof n.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)n=i.contentWindow;else break;i=Ce(n.document)}return i}function pu(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}function uv(n){var i=zf(),l=n.focusedElem,d=n.selectionRange;if(i!==l&&l&&l.ownerDocument&&Rf(l.ownerDocument.documentElement,l)){if(d!==null&&pu(l)){if(i=d.start,n=d.end,n===void 0&&(n=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(n,l.value.length);else if(n=(i=l.ownerDocument||document)&&i.defaultView||window,n.getSelection){n=n.getSelection();var y=l.textContent.length,v=Math.min(d.start,y);d=d.end===void 0?v:Math.min(d.end,y),!n.extend&&v>d&&(y=d,d=v,v=y),y=Mf(l,v);var _=Mf(l,d);y&&_&&(n.rangeCount!==1||n.anchorNode!==y.node||n.anchorOffset!==y.offset||n.focusNode!==_.node||n.focusOffset!==_.offset)&&(i=i.createRange(),i.setStart(y.node,y.offset),n.removeAllRanges(),v>d?(n.addRange(i),n.extend(_.node,_.offset)):(i.setEnd(_.node,_.offset),n.addRange(i)))}}for(i=[],n=l;n=n.parentNode;)n.nodeType===1&&i.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)n=i[l],n.element.scrollLeft=n.left,n.element.scrollTop=n.top}}var cv=c&&"documentMode"in document&&11>=document.documentMode,cs=null,mu=null,uo=null,gu=!1;function Lf(n,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;gu||cs==null||cs!==Ce(d)||(d=cs,"selectionStart"in d&&pu(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),uo&&ao(uo,d)||(uo=d,d=kl(mu,"onSelect"),0<d.length&&(i=new ou("onSelect","select",null,i,l),n.push({event:i,listeners:d}),i.target=cs)))}function vl(n,i){var l={};return l[n.toLowerCase()]=i.toLowerCase(),l["Webkit"+n]="webkit"+i,l["Moz"+n]="moz"+i,l}var ds={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionend:vl("Transition","TransitionEnd")},yu={},Df={};c&&(Df=document.createElement("div").style,"AnimationEvent"in window||(delete ds.animationend.animation,delete ds.animationiteration.animation,delete ds.animationstart.animation),"TransitionEvent"in window||delete ds.transitionend.transition);function wl(n){if(yu[n])return yu[n];if(!ds[n])return n;var i=ds[n],l;for(l in i)if(i.hasOwnProperty(l)&&l in Df)return yu[n]=i[l];return n}var Ff=wl("animationend"),Of=wl("animationiteration"),$f=wl("animationstart"),Bf=wl("transitionend"),Hf=new Map,Vf="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 Qr(n,i){Hf.set(n,i),a(i,[n])}for(var xu=0;xu<Vf.length;xu++){var vu=Vf[xu],dv=vu.toLowerCase(),fv=vu[0].toUpperCase()+vu.slice(1);Qr(dv,"on"+fv)}Qr(Ff,"onAnimationEnd"),Qr(Of,"onAnimationIteration"),Qr($f,"onAnimationStart"),Qr("dblclick","onDoubleClick"),Qr("focusin","onFocus"),Qr("focusout","onBlur"),Qr(Bf,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var co="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(" "),hv=new Set("cancel close invalid load scroll toggle".split(" ").concat(co));function Uf(n,i,l){var d=n.type||"unknown-event";n.currentTarget=l,es(d,i,void 0,n),n.currentTarget=null}function Wf(n,i){i=(i&4)!==0;for(var l=0;l<n.length;l++){var d=n[l],y=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var _=d.length-1;0<=_;_--){var D=d[_],X=D.instance,ne=D.currentTarget;if(D=D.listener,X!==v&&y.isPropagationStopped())break e;Uf(y,D,ne),v=X}else for(_=0;_<d.length;_++){if(D=d[_],X=D.instance,ne=D.currentTarget,D=D.listener,X!==v&&y.isPropagationStopped())break e;Uf(y,D,ne),v=X}}}if(kr)throw n=St,kr=!1,St=null,n}function ot(n,i){var l=i[ju];l===void 0&&(l=i[ju]=new Set);var d=n+"__bubble";l.has(d)||(Yf(i,n,2,!1),l.add(d))}function wu(n,i,l){var d=0;i&&(d|=4),Yf(l,n,d,i)}var Sl="_reactListening"+Math.random().toString(36).slice(2);function fo(n){if(!n[Sl]){n[Sl]=!0,s.forEach(function(l){l!=="selectionchange"&&(hv.has(l)||wu(l,!1,n),wu(l,!0,n))});var i=n.nodeType===9?n:n.ownerDocument;i===null||i[Sl]||(i[Sl]=!0,wu("selectionchange",!1,i))}}function Yf(n,i,l,d){switch(mf(i)){case 1:var y=Xe;break;case 4:y=kt;break;default:y=Tn}l=y.bind(null,i,l,n),y=void 0,!Sr||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),d?y!==void 0?n.addEventListener(i,l,{capture:!0,passive:y}):n.addEventListener(i,l,!0):y!==void 0?n.addEventListener(i,l,{passive:y}):n.addEventListener(i,l,!1)}function Su(n,i,l,d,y){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var _=d.tag;if(_===3||_===4){var D=d.stateNode.containerInfo;if(D===y||D.nodeType===8&&D.parentNode===y)break;if(_===4)for(_=d.return;_!==null;){var X=_.tag;if((X===3||X===4)&&(X=_.stateNode.containerInfo,X===y||X.nodeType===8&&X.parentNode===y))return;_=_.return}for(;D!==null;){if(_=Ti(D),_===null)return;if(X=_.tag,X===5||X===6){d=v=_;continue e}D=D.parentNode}}d=d.return}Ji(function(){var ne=v,de=Or(l),he=[];e:{var ue=Hf.get(n);if(ue!==void 0){var Se=ou,Ne=n;switch(n){case"keypress":if(ml(l)===0)break e;case"keydown":case"keyup":Se=V0;break;case"focusin":Ne="focus",Se=uu;break;case"focusout":Ne="blur",Se=uu;break;case"beforeblur":case"afterblur":Se=uu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Se=xf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Se=P0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Se=Y0;break;case Ff:case Of:case $f:Se=R0;break;case Bf:Se=q0;break;case"scroll":Se=I0;break;case"wheel":Se=K0;break;case"copy":case"cut":case"paste":Se=L0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Se=wf}var be=(i&4)!==0,wt=!be&&n==="scroll",ee=be?ue!==null?ue+"Capture":null:ue;be=[];for(var G=ne,te;G!==null;){te=G;var ye=te.stateNode;if(te.tag===5&&ye!==null&&(te=ye,ee!==null&&(ye=wr(G,ee),ye!=null&&be.push(ho(G,ye,te)))),wt)break;G=G.return}0<be.length&&(ue=new Se(ue,Ne,null,l,de),he.push({event:ue,listeners:be}))}}if((i&7)===0){e:{if(ue=n==="mouseover"||n==="pointerover",Se=n==="mouseout"||n==="pointerout",ue&&l!==At&&(Ne=l.relatedTarget||l.fromElement)&&(Ti(Ne)||Ne[jr]))break e;if((Se||ue)&&(ue=de.window===de?de:(ue=de.ownerDocument)?ue.defaultView||ue.parentWindow:window,Se?(Ne=l.relatedTarget||l.toElement,Se=ne,Ne=Ne?Ti(Ne):null,Ne!==null&&(wt=Ft(Ne),Ne!==wt||Ne.tag!==5&&Ne.tag!==6)&&(Ne=null)):(Se=null,Ne=ne),Se!==Ne)){if(be=xf,ye="onMouseLeave",ee="onMouseEnter",G="mouse",(n==="pointerout"||n==="pointerover")&&(be=wf,ye="onPointerLeave",ee="onPointerEnter",G="pointer"),wt=Se==null?ue:ps(Se),te=Ne==null?ue:ps(Ne),ue=new be(ye,G+"leave",Se,l,de),ue.target=wt,ue.relatedTarget=te,ye=null,Ti(de)===ne&&(be=new be(ee,G+"enter",Ne,l,de),be.target=te,be.relatedTarget=wt,ye=be),wt=ye,Se&&Ne)t:{for(be=Se,ee=Ne,G=0,te=be;te;te=fs(te))G++;for(te=0,ye=ee;ye;ye=fs(ye))te++;for(;0<G-te;)be=fs(be),G--;for(;0<te-G;)ee=fs(ee),te--;for(;G--;){if(be===ee||ee!==null&&be===ee.alternate)break t;be=fs(be),ee=fs(ee)}be=null}else be=null;Se!==null&&Xf(he,ue,Se,be,!1),Ne!==null&&wt!==null&&Xf(he,wt,Ne,be,!0)}}e:{if(ue=ne?ps(ne):window,Se=ue.nodeName&&ue.nodeName.toLowerCase(),Se==="select"||Se==="input"&&ue.type==="file")var Ie=rv;else if(bf(ue))if(_f)Ie=lv;else{Ie=sv;var Re=iv}else(Se=ue.nodeName)&&Se.toLowerCase()==="input"&&(ue.type==="checkbox"||ue.type==="radio")&&(Ie=ov);if(Ie&&(Ie=Ie(n,ne))){jf(he,Ie,l,de);break e}Re&&Re(n,ue,ne),n==="focusout"&&(Re=ue._wrapperState)&&Re.controlled&&ue.type==="number"&&bt(ue,"number",ue.value)}switch(Re=ne?ps(ne):window,n){case"focusin":(bf(Re)||Re.contentEditable==="true")&&(cs=Re,mu=ne,uo=null);break;case"focusout":uo=mu=cs=null;break;case"mousedown":gu=!0;break;case"contextmenu":case"mouseup":case"dragend":gu=!1,Lf(he,l,de);break;case"selectionchange":if(cv)break;case"keydown":case"keyup":Lf(he,l,de)}var ze;if(du)e:{switch(n){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else us?Ef(n,l)&&(De="onCompositionEnd"):n==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(Sf&&l.locale!=="ko"&&(us||De!=="onCompositionStart"?De==="onCompositionEnd"&&us&&(ze=gf()):(Kr=de,su="value"in Kr?Kr.value:Kr.textContent,us=!0)),Re=kl(ne,De),0<Re.length&&(De=new vf(De,n,null,l,de),he.push({event:De,listeners:Re}),ze?De.data=ze:(ze=Cf(l),ze!==null&&(De.data=ze)))),(ze=Z0?J0(n,l):ev(n,l))&&(ne=kl(ne,"onBeforeInput"),0<ne.length&&(de=new vf("onBeforeInput","beforeinput",null,l,de),he.push({event:de,listeners:ne}),de.data=ze))}Wf(he,i)})}function ho(n,i,l){return{instance:n,listener:i,currentTarget:l}}function kl(n,i){for(var l=i+"Capture",d=[];n!==null;){var y=n,v=y.stateNode;y.tag===5&&v!==null&&(y=v,v=wr(n,l),v!=null&&d.unshift(ho(n,v,y)),v=wr(n,i),v!=null&&d.push(ho(n,v,y))),n=n.return}return d}function fs(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5);return n||null}function Xf(n,i,l,d,y){for(var v=i._reactName,_=[];l!==null&&l!==d;){var D=l,X=D.alternate,ne=D.stateNode;if(X!==null&&X===d)break;D.tag===5&&ne!==null&&(D=ne,y?(X=wr(l,v),X!=null&&_.unshift(ho(l,X,D))):y||(X=wr(l,v),X!=null&&_.push(ho(l,X,D)))),l=l.return}_.length!==0&&n.push({event:i,listeners:_})}var pv=/\r\n?/g,mv=/\u0000|\uFFFD/g;function qf(n){return(typeof n=="string"?n:""+n).replace(pv,`
|
|
38
|
-
`).replace(mv,"")}function Nl(n,i,l){if(i=qf(i),qf(n)!==i&&l)throw Error(r(425))}function El(){}var ku=null,Nu=null;function Eu(n,i){return n==="textarea"||n==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Cu=typeof setTimeout=="function"?setTimeout:void 0,gv=typeof clearTimeout=="function"?clearTimeout:void 0,Gf=typeof Promise=="function"?Promise:void 0,yv=typeof queueMicrotask=="function"?queueMicrotask:typeof Gf<"u"?function(n){return Gf.resolve(null).then(n).catch(xv)}:Cu;function xv(n){setTimeout(function(){throw n})}function bu(n,i){var l=i,d=0;do{var y=l.nextSibling;if(n.removeChild(l),y&&y.nodeType===8)if(l=y.data,l==="/$"){if(d===0){n.removeChild(y),Ye(i);return}d--}else l!=="$"&&l!=="$?"&&l!=="$!"||d++;l=y}while(l);Ye(i)}function Zr(n){for(;n!=null;n=n.nextSibling){var i=n.nodeType;if(i===1||i===3)break;if(i===8){if(i=n.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return n}function Kf(n){n=n.previousSibling;for(var i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return n;i--}else l==="/$"&&i++}n=n.previousSibling}return null}var hs=Math.random().toString(36).slice(2),lr="__reactFiber$"+hs,po="__reactProps$"+hs,jr="__reactContainer$"+hs,ju="__reactEvents$"+hs,vv="__reactListeners$"+hs,wv="__reactHandles$"+hs;function Ti(n){var i=n[lr];if(i)return i;for(var l=n.parentNode;l;){if(i=l[jr]||l[lr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(n=Kf(n);n!==null;){if(l=n[lr])return l;n=Kf(n)}return i}n=l,l=n.parentNode}return null}function mo(n){return n=n[lr]||n[jr],!n||n.tag!==5&&n.tag!==6&&n.tag!==13&&n.tag!==3?null:n}function ps(n){if(n.tag===5||n.tag===6)return n.stateNode;throw Error(r(33))}function Cl(n){return n[po]||null}var _u=[],ms=-1;function Jr(n){return{current:n}}function lt(n){0>ms||(n.current=_u[ms],_u[ms]=null,ms--)}function nt(n,i){ms++,_u[ms]=n.current,n.current=i}var ei={},Ut=Jr(ei),nn=Jr(!1),Pi=ei;function gs(n,i){var l=n.type.contextTypes;if(!l)return ei;var d=n.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===i)return d.__reactInternalMemoizedMaskedChildContext;var y={},v;for(v in l)y[v]=i[v];return d&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=i,n.__reactInternalMemoizedMaskedChildContext=y),y}function rn(n){return n=n.childContextTypes,n!=null}function bl(){lt(nn),lt(Ut)}function Qf(n,i,l){if(Ut.current!==ei)throw Error(r(168));nt(Ut,i),nt(nn,l)}function Zf(n,i,l){var d=n.stateNode;if(i=i.childContextTypes,typeof d.getChildContext!="function")return l;d=d.getChildContext();for(var y in d)if(!(y in i))throw Error(r(108,ve(n)||"Unknown",y));return j({},l,d)}function jl(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||ei,Pi=Ut.current,nt(Ut,n),nt(nn,nn.current),!0}function Jf(n,i,l){var d=n.stateNode;if(!d)throw Error(r(169));l?(n=Zf(n,i,Pi),d.__reactInternalMemoizedMergedChildContext=n,lt(nn),lt(Ut),nt(Ut,n)):lt(nn),nt(nn,l)}var _r=null,_l=!1,Iu=!1;function eh(n){_r===null?_r=[n]:_r.push(n)}function Sv(n){_l=!0,eh(n)}function ti(){if(!Iu&&_r!==null){Iu=!0;var n=0,i=Ke;try{var l=_r;for(Ke=1;n<l.length;n++){var d=l[n];do d=d(!0);while(d!==null)}_r=null,_l=!1}catch(y){throw _r!==null&&(_r=_r.slice(n+1)),Ni(Ci,ti),y}finally{Ke=i,Iu=!1}}return null}var ys=[],xs=0,Il=null,Tl=0,Pn=[],An=0,Ai=null,Ir=1,Tr="";function Mi(n,i){ys[xs++]=Tl,ys[xs++]=Il,Il=n,Tl=i}function th(n,i,l){Pn[An++]=Ir,Pn[An++]=Tr,Pn[An++]=Ai,Ai=n;var d=Ir;n=Tr;var y=32-Ot(d)-1;d&=~(1<<y),l+=1;var v=32-Ot(i)+y;if(30<v){var _=y-y%5;v=(d&(1<<_)-1).toString(32),d>>=_,y-=_,Ir=1<<32-Ot(i)+y|l<<y|d,Tr=v+n}else Ir=1<<v|l<<y|d,Tr=n}function Tu(n){n.return!==null&&(Mi(n,1),th(n,1,0))}function Pu(n){for(;n===Il;)Il=ys[--xs],ys[xs]=null,Tl=ys[--xs],ys[xs]=null;for(;n===Ai;)Ai=Pn[--An],Pn[An]=null,Tr=Pn[--An],Pn[An]=null,Ir=Pn[--An],Pn[An]=null}var wn=null,Sn=null,at=!1,Wn=null;function nh(n,i){var l=Ln(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=n,i=n.deletions,i===null?(n.deletions=[l],n.flags|=16):i.push(l)}function rh(n,i){switch(n.tag){case 5:var l=n.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(n.stateNode=i,wn=n,Sn=Zr(i.firstChild),!0):!1;case 6:return i=n.pendingProps===""||i.nodeType!==3?null:i,i!==null?(n.stateNode=i,wn=n,Sn=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=Ai!==null?{id:Ir,overflow:Tr}:null,n.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=Ln(18,null,null,0),l.stateNode=i,l.return=n,n.child=l,wn=n,Sn=null,!0):!1;default:return!1}}function Au(n){return(n.mode&1)!==0&&(n.flags&128)===0}function Mu(n){if(at){var i=Sn;if(i){var l=i;if(!rh(n,i)){if(Au(n))throw Error(r(418));i=Zr(l.nextSibling);var d=wn;i&&rh(n,i)?nh(d,l):(n.flags=n.flags&-4097|2,at=!1,wn=n)}}else{if(Au(n))throw Error(r(418));n.flags=n.flags&-4097|2,at=!1,wn=n}}}function ih(n){for(n=n.return;n!==null&&n.tag!==5&&n.tag!==3&&n.tag!==13;)n=n.return;wn=n}function Pl(n){if(n!==wn)return!1;if(!at)return ih(n),at=!0,!1;var i;if((i=n.tag!==3)&&!(i=n.tag!==5)&&(i=n.type,i=i!=="head"&&i!=="body"&&!Eu(n.type,n.memoizedProps)),i&&(i=Sn)){if(Au(n))throw sh(),Error(r(418));for(;i;)nh(n,i),i=Zr(i.nextSibling)}if(ih(n),n.tag===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));e:{for(n=n.nextSibling,i=0;n;){if(n.nodeType===8){var l=n.data;if(l==="/$"){if(i===0){Sn=Zr(n.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}n=n.nextSibling}Sn=null}}else Sn=wn?Zr(n.stateNode.nextSibling):null;return!0}function sh(){for(var n=Sn;n;)n=Zr(n.nextSibling)}function vs(){Sn=wn=null,at=!1}function Ru(n){Wn===null?Wn=[n]:Wn.push(n)}var kv=I.ReactCurrentBatchConfig;function go(n,i,l){if(n=l.ref,n!==null&&typeof n!="function"&&typeof n!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(r(309));var d=l.stateNode}if(!d)throw Error(r(147,n));var y=d,v=""+n;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===v?i.ref:(i=function(_){var D=y.refs;_===null?delete D[v]:D[v]=_},i._stringRef=v,i)}if(typeof n!="string")throw Error(r(284));if(!l._owner)throw Error(r(290,n))}return n}function Al(n,i){throw n=Object.prototype.toString.call(i),Error(r(31,n==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":n))}function oh(n){var i=n._init;return i(n._payload)}function lh(n){function i(ee,G){if(n){var te=ee.deletions;te===null?(ee.deletions=[G],ee.flags|=16):te.push(G)}}function l(ee,G){if(!n)return null;for(;G!==null;)i(ee,G),G=G.sibling;return null}function d(ee,G){for(ee=new Map;G!==null;)G.key!==null?ee.set(G.key,G):ee.set(G.index,G),G=G.sibling;return ee}function y(ee,G){return ee=ui(ee,G),ee.index=0,ee.sibling=null,ee}function v(ee,G,te){return ee.index=te,n?(te=ee.alternate,te!==null?(te=te.index,te<G?(ee.flags|=2,G):te):(ee.flags|=2,G)):(ee.flags|=1048576,G)}function _(ee){return n&&ee.alternate===null&&(ee.flags|=2),ee}function D(ee,G,te,ye){return G===null||G.tag!==6?(G=Cc(te,ee.mode,ye),G.return=ee,G):(G=y(G,te),G.return=ee,G)}function X(ee,G,te,ye){var Ie=te.type;return Ie===$?de(ee,G,te.props.children,ye,te.key):G!==null&&(G.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===F&&oh(Ie)===G.type)?(ye=y(G,te.props),ye.ref=go(ee,G,te),ye.return=ee,ye):(ye=na(te.type,te.key,te.props,null,ee.mode,ye),ye.ref=go(ee,G,te),ye.return=ee,ye)}function ne(ee,G,te,ye){return G===null||G.tag!==4||G.stateNode.containerInfo!==te.containerInfo||G.stateNode.implementation!==te.implementation?(G=bc(te,ee.mode,ye),G.return=ee,G):(G=y(G,te.children||[]),G.return=ee,G)}function de(ee,G,te,ye,Ie){return G===null||G.tag!==7?(G=Bi(te,ee.mode,ye,Ie),G.return=ee,G):(G=y(G,te),G.return=ee,G)}function he(ee,G,te){if(typeof G=="string"&&G!==""||typeof G=="number")return G=Cc(""+G,ee.mode,te),G.return=ee,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case B:return te=na(G.type,G.key,G.props,null,ee.mode,te),te.ref=go(ee,null,G),te.return=ee,te;case T:return G=bc(G,ee.mode,te),G.return=ee,G;case F:var ye=G._init;return he(ee,ye(G._payload),te)}if(gt(G)||V(G))return G=Bi(G,ee.mode,te,null),G.return=ee,G;Al(ee,G)}return null}function ue(ee,G,te,ye){var Ie=G!==null?G.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Ie!==null?null:D(ee,G,""+te,ye);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case B:return te.key===Ie?X(ee,G,te,ye):null;case T:return te.key===Ie?ne(ee,G,te,ye):null;case F:return Ie=te._init,ue(ee,G,Ie(te._payload),ye)}if(gt(te)||V(te))return Ie!==null?null:de(ee,G,te,ye,null);Al(ee,te)}return null}function Se(ee,G,te,ye,Ie){if(typeof ye=="string"&&ye!==""||typeof ye=="number")return ee=ee.get(te)||null,D(G,ee,""+ye,Ie);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case B:return ee=ee.get(ye.key===null?te:ye.key)||null,X(G,ee,ye,Ie);case T:return ee=ee.get(ye.key===null?te:ye.key)||null,ne(G,ee,ye,Ie);case F:var Re=ye._init;return Se(ee,G,te,Re(ye._payload),Ie)}if(gt(ye)||V(ye))return ee=ee.get(te)||null,de(G,ee,ye,Ie,null);Al(G,ye)}return null}function Ne(ee,G,te,ye){for(var Ie=null,Re=null,ze=G,De=G=0,zt=null;ze!==null&&De<te.length;De++){ze.index>De?(zt=ze,ze=null):zt=ze.sibling;var Ze=ue(ee,ze,te[De],ye);if(Ze===null){ze===null&&(ze=zt);break}n&&ze&&Ze.alternate===null&&i(ee,ze),G=v(Ze,G,De),Re===null?Ie=Ze:Re.sibling=Ze,Re=Ze,ze=zt}if(De===te.length)return l(ee,ze),at&&Mi(ee,De),Ie;if(ze===null){for(;De<te.length;De++)ze=he(ee,te[De],ye),ze!==null&&(G=v(ze,G,De),Re===null?Ie=ze:Re.sibling=ze,Re=ze);return at&&Mi(ee,De),Ie}for(ze=d(ee,ze);De<te.length;De++)zt=Se(ze,ee,De,te[De],ye),zt!==null&&(n&&zt.alternate!==null&&ze.delete(zt.key===null?De:zt.key),G=v(zt,G,De),Re===null?Ie=zt:Re.sibling=zt,Re=zt);return n&&ze.forEach(function(ci){return i(ee,ci)}),at&&Mi(ee,De),Ie}function be(ee,G,te,ye){var Ie=V(te);if(typeof Ie!="function")throw Error(r(150));if(te=Ie.call(te),te==null)throw Error(r(151));for(var Re=Ie=null,ze=G,De=G=0,zt=null,Ze=te.next();ze!==null&&!Ze.done;De++,Ze=te.next()){ze.index>De?(zt=ze,ze=null):zt=ze.sibling;var ci=ue(ee,ze,Ze.value,ye);if(ci===null){ze===null&&(ze=zt);break}n&&ze&&ci.alternate===null&&i(ee,ze),G=v(ci,G,De),Re===null?Ie=ci:Re.sibling=ci,Re=ci,ze=zt}if(Ze.done)return l(ee,ze),at&&Mi(ee,De),Ie;if(ze===null){for(;!Ze.done;De++,Ze=te.next())Ze=he(ee,Ze.value,ye),Ze!==null&&(G=v(Ze,G,De),Re===null?Ie=Ze:Re.sibling=Ze,Re=Ze);return at&&Mi(ee,De),Ie}for(ze=d(ee,ze);!Ze.done;De++,Ze=te.next())Ze=Se(ze,ee,De,Ze.value,ye),Ze!==null&&(n&&Ze.alternate!==null&&ze.delete(Ze.key===null?De:Ze.key),G=v(Ze,G,De),Re===null?Ie=Ze:Re.sibling=Ze,Re=Ze);return n&&ze.forEach(function(tw){return i(ee,tw)}),at&&Mi(ee,De),Ie}function wt(ee,G,te,ye){if(typeof te=="object"&&te!==null&&te.type===$&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case B:e:{for(var Ie=te.key,Re=G;Re!==null;){if(Re.key===Ie){if(Ie=te.type,Ie===$){if(Re.tag===7){l(ee,Re.sibling),G=y(Re,te.props.children),G.return=ee,ee=G;break e}}else if(Re.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===F&&oh(Ie)===Re.type){l(ee,Re.sibling),G=y(Re,te.props),G.ref=go(ee,Re,te),G.return=ee,ee=G;break e}l(ee,Re);break}else i(ee,Re);Re=Re.sibling}te.type===$?(G=Bi(te.props.children,ee.mode,ye,te.key),G.return=ee,ee=G):(ye=na(te.type,te.key,te.props,null,ee.mode,ye),ye.ref=go(ee,G,te),ye.return=ee,ee=ye)}return _(ee);case T:e:{for(Re=te.key;G!==null;){if(G.key===Re)if(G.tag===4&&G.stateNode.containerInfo===te.containerInfo&&G.stateNode.implementation===te.implementation){l(ee,G.sibling),G=y(G,te.children||[]),G.return=ee,ee=G;break e}else{l(ee,G);break}else i(ee,G);G=G.sibling}G=bc(te,ee.mode,ye),G.return=ee,ee=G}return _(ee);case F:return Re=te._init,wt(ee,G,Re(te._payload),ye)}if(gt(te))return Ne(ee,G,te,ye);if(V(te))return be(ee,G,te,ye);Al(ee,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,G!==null&&G.tag===6?(l(ee,G.sibling),G=y(G,te),G.return=ee,ee=G):(l(ee,G),G=Cc(te,ee.mode,ye),G.return=ee,ee=G),_(ee)):l(ee,G)}return wt}var ws=lh(!0),ah=lh(!1),Ml=Jr(null),Rl=null,Ss=null,zu=null;function Lu(){zu=Ss=Rl=null}function Du(n){var i=Ml.current;lt(Ml),n._currentValue=i}function Fu(n,i,l){for(;n!==null;){var d=n.alternate;if((n.childLanes&i)!==i?(n.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),n===l)break;n=n.return}}function ks(n,i){Rl=n,zu=Ss=null,n=n.dependencies,n!==null&&n.firstContext!==null&&((n.lanes&i)!==0&&(sn=!0),n.firstContext=null)}function Mn(n){var i=n._currentValue;if(zu!==n)if(n={context:n,memoizedValue:i,next:null},Ss===null){if(Rl===null)throw Error(r(308));Ss=n,Rl.dependencies={lanes:0,firstContext:n}}else Ss=Ss.next=n;return i}var Ri=null;function Ou(n){Ri===null?Ri=[n]:Ri.push(n)}function uh(n,i,l,d){var y=i.interleaved;return y===null?(l.next=l,Ou(i)):(l.next=y.next,y.next=l),i.interleaved=l,Pr(n,d)}function Pr(n,i){n.lanes|=i;var l=n.alternate;for(l!==null&&(l.lanes|=i),l=n,n=n.return;n!==null;)n.childLanes|=i,l=n.alternate,l!==null&&(l.childLanes|=i),l=n,n=n.return;return l.tag===3?l.stateNode:null}var ni=!1;function $u(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ch(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function Ar(n,i){return{eventTime:n,lane:i,tag:0,payload:null,callback:null,next:null}}function ri(n,i,l){var d=n.updateQueue;if(d===null)return null;if(d=d.shared,(Ge&2)!==0){var y=d.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),d.pending=i,Pr(n,l)}return y=d.interleaved,y===null?(i.next=i,Ou(d)):(i.next=y.next,y.next=i),d.interleaved=i,Pr(n,l)}function zl(n,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,ss(n,l)}}function dh(n,i){var l=n.updateQueue,d=n.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var y=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var _={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?y=v=_:v=v.next=_,l=l.next}while(l!==null);v===null?y=v=i:v=v.next=i}else y=v=i;l={baseState:d.baseState,firstBaseUpdate:y,lastBaseUpdate:v,shared:d.shared,effects:d.effects},n.updateQueue=l;return}n=l.lastBaseUpdate,n===null?l.firstBaseUpdate=i:n.next=i,l.lastBaseUpdate=i}function Ll(n,i,l,d){var y=n.updateQueue;ni=!1;var v=y.firstBaseUpdate,_=y.lastBaseUpdate,D=y.shared.pending;if(D!==null){y.shared.pending=null;var X=D,ne=X.next;X.next=null,_===null?v=ne:_.next=ne,_=X;var de=n.alternate;de!==null&&(de=de.updateQueue,D=de.lastBaseUpdate,D!==_&&(D===null?de.firstBaseUpdate=ne:D.next=ne,de.lastBaseUpdate=X))}if(v!==null){var he=y.baseState;_=0,de=ne=X=null,D=v;do{var ue=D.lane,Se=D.eventTime;if((d&ue)===ue){de!==null&&(de=de.next={eventTime:Se,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Ne=n,be=D;switch(ue=i,Se=l,be.tag){case 1:if(Ne=be.payload,typeof Ne=="function"){he=Ne.call(Se,he,ue);break e}he=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=be.payload,ue=typeof Ne=="function"?Ne.call(Se,he,ue):Ne,ue==null)break e;he=j({},he,ue);break e;case 2:ni=!0}}D.callback!==null&&D.lane!==0&&(n.flags|=64,ue=y.effects,ue===null?y.effects=[D]:ue.push(D))}else Se={eventTime:Se,lane:ue,tag:D.tag,payload:D.payload,callback:D.callback,next:null},de===null?(ne=de=Se,X=he):de=de.next=Se,_|=ue;if(D=D.next,D===null){if(D=y.shared.pending,D===null)break;ue=D,D=ue.next,ue.next=null,y.lastBaseUpdate=ue,y.shared.pending=null}}while(!0);if(de===null&&(X=he),y.baseState=X,y.firstBaseUpdate=ne,y.lastBaseUpdate=de,i=y.shared.interleaved,i!==null){y=i;do _|=y.lane,y=y.next;while(y!==i)}else v===null&&(y.shared.lanes=0);Di|=_,n.lanes=_,n.memoizedState=he}}function fh(n,i,l){if(n=i.effects,i.effects=null,n!==null)for(i=0;i<n.length;i++){var d=n[i],y=d.callback;if(y!==null){if(d.callback=null,d=l,typeof y!="function")throw Error(r(191,y));y.call(d)}}}var yo={},ar=Jr(yo),xo=Jr(yo),vo=Jr(yo);function zi(n){if(n===yo)throw Error(r(174));return n}function Bu(n,i){switch(nt(vo,i),nt(xo,n),nt(ar,yo),n=i.nodeType,n){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:me(null,"");break;default:n=n===8?i.parentNode:i,i=n.namespaceURI||null,n=n.tagName,i=me(i,n)}lt(ar),nt(ar,i)}function Ns(){lt(ar),lt(xo),lt(vo)}function hh(n){zi(vo.current);var i=zi(ar.current),l=me(i,n.type);i!==l&&(nt(xo,n),nt(ar,l))}function Hu(n){xo.current===n&&(lt(ar),lt(xo))}var dt=Jr(0);function Dl(n){for(var i=n;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Vu=[];function Uu(){for(var n=0;n<Vu.length;n++)Vu[n]._workInProgressVersionPrimary=null;Vu.length=0}var Fl=I.ReactCurrentDispatcher,Wu=I.ReactCurrentBatchConfig,Li=0,ft=null,jt=null,Mt=null,Ol=!1,wo=!1,So=0,Nv=0;function Wt(){throw Error(r(321))}function Yu(n,i){if(i===null)return!1;for(var l=0;l<i.length&&l<n.length;l++)if(!Un(n[l],i[l]))return!1;return!0}function Xu(n,i,l,d,y,v){if(Li=v,ft=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Fl.current=n===null||n.memoizedState===null?jv:_v,n=l(d,y),wo){v=0;do{if(wo=!1,So=0,25<=v)throw Error(r(301));v+=1,Mt=jt=null,i.updateQueue=null,Fl.current=Iv,n=l(d,y)}while(wo)}if(Fl.current=Hl,i=jt!==null&&jt.next!==null,Li=0,Mt=jt=ft=null,Ol=!1,i)throw Error(r(300));return n}function qu(){var n=So!==0;return So=0,n}function ur(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?ft.memoizedState=Mt=n:Mt=Mt.next=n,Mt}function Rn(){if(jt===null){var n=ft.alternate;n=n!==null?n.memoizedState:null}else n=jt.next;var i=Mt===null?ft.memoizedState:Mt.next;if(i!==null)Mt=i,jt=n;else{if(n===null)throw Error(r(310));jt=n,n={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},Mt===null?ft.memoizedState=Mt=n:Mt=Mt.next=n}return Mt}function ko(n,i){return typeof i=="function"?i(n):i}function Gu(n){var i=Rn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var d=jt,y=d.baseQueue,v=l.pending;if(v!==null){if(y!==null){var _=y.next;y.next=v.next,v.next=_}d.baseQueue=y=v,l.pending=null}if(y!==null){v=y.next,d=d.baseState;var D=_=null,X=null,ne=v;do{var de=ne.lane;if((Li&de)===de)X!==null&&(X=X.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),d=ne.hasEagerState?ne.eagerState:n(d,ne.action);else{var he={lane:de,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};X===null?(D=X=he,_=d):X=X.next=he,ft.lanes|=de,Di|=de}ne=ne.next}while(ne!==null&&ne!==v);X===null?_=d:X.next=D,Un(d,i.memoizedState)||(sn=!0),i.memoizedState=d,i.baseState=_,i.baseQueue=X,l.lastRenderedState=d}if(n=l.interleaved,n!==null){y=n;do v=y.lane,ft.lanes|=v,Di|=v,y=y.next;while(y!==n)}else y===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function Ku(n){var i=Rn(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=n;var d=l.dispatch,y=l.pending,v=i.memoizedState;if(y!==null){l.pending=null;var _=y=y.next;do v=n(v,_.action),_=_.next;while(_!==y);Un(v,i.memoizedState)||(sn=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,d]}function ph(){}function mh(n,i){var l=ft,d=Rn(),y=i(),v=!Un(d.memoizedState,y);if(v&&(d.memoizedState=y,sn=!0),d=d.queue,Qu(xh.bind(null,l,d,n),[n]),d.getSnapshot!==i||v||Mt!==null&&Mt.memoizedState.tag&1){if(l.flags|=2048,No(9,yh.bind(null,l,d,y,i),void 0,null),Rt===null)throw Error(r(349));(Li&30)!==0||gh(l,i,y)}return y}function gh(n,i,l){n.flags|=16384,n={getSnapshot:i,value:l},i=ft.updateQueue,i===null?(i={lastEffect:null,stores:null},ft.updateQueue=i,i.stores=[n]):(l=i.stores,l===null?i.stores=[n]:l.push(n))}function yh(n,i,l,d){i.value=l,i.getSnapshot=d,vh(i)&&wh(n)}function xh(n,i,l){return l(function(){vh(i)&&wh(n)})}function vh(n){var i=n.getSnapshot;n=n.value;try{var l=i();return!Un(n,l)}catch{return!0}}function wh(n){var i=Pr(n,1);i!==null&&Gn(i,n,1,-1)}function Sh(n){var i=ur();return typeof n=="function"&&(n=n()),i.memoizedState=i.baseState=n,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ko,lastRenderedState:n},i.queue=n,n=n.dispatch=bv.bind(null,ft,n),[i.memoizedState,n]}function No(n,i,l,d){return n={tag:n,create:i,destroy:l,deps:d,next:null},i=ft.updateQueue,i===null?(i={lastEffect:null,stores:null},ft.updateQueue=i,i.lastEffect=n.next=n):(l=i.lastEffect,l===null?i.lastEffect=n.next=n:(d=l.next,l.next=n,n.next=d,i.lastEffect=n)),n}function kh(){return Rn().memoizedState}function $l(n,i,l,d){var y=ur();ft.flags|=n,y.memoizedState=No(1|i,l,void 0,d===void 0?null:d)}function Bl(n,i,l,d){var y=Rn();d=d===void 0?null:d;var v=void 0;if(jt!==null){var _=jt.memoizedState;if(v=_.destroy,d!==null&&Yu(d,_.deps)){y.memoizedState=No(i,l,v,d);return}}ft.flags|=n,y.memoizedState=No(1|i,l,v,d)}function Nh(n,i){return $l(8390656,8,n,i)}function Qu(n,i){return Bl(2048,8,n,i)}function Eh(n,i){return Bl(4,2,n,i)}function Ch(n,i){return Bl(4,4,n,i)}function bh(n,i){if(typeof i=="function")return n=n(),i(n),function(){i(null)};if(i!=null)return n=n(),i.current=n,function(){i.current=null}}function jh(n,i,l){return l=l!=null?l.concat([n]):null,Bl(4,4,bh.bind(null,i,n),l)}function Zu(){}function _h(n,i){var l=Rn();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Yu(i,d[1])?d[0]:(l.memoizedState=[n,i],n)}function Ih(n,i){var l=Rn();i=i===void 0?null:i;var d=l.memoizedState;return d!==null&&i!==null&&Yu(i,d[1])?d[0]:(n=n(),l.memoizedState=[n,i],n)}function Th(n,i,l){return(Li&21)===0?(n.baseState&&(n.baseState=!1,sn=!0),n.memoizedState=l):(Un(l,i)||(l=qr(),ft.lanes|=l,Di|=l,n.baseState=!0),i)}function Ev(n,i){var l=Ke;Ke=l!==0&&4>l?l:4,n(!0);var d=Wu.transition;Wu.transition={};try{n(!1),i()}finally{Ke=l,Wu.transition=d}}function Ph(){return Rn().memoizedState}function Cv(n,i,l){var d=li(n);if(l={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null},Ah(n))Mh(i,l);else if(l=uh(n,i,l,d),l!==null){var y=Zt();Gn(l,n,d,y),Rh(l,i,d)}}function bv(n,i,l){var d=li(n),y={lane:d,action:l,hasEagerState:!1,eagerState:null,next:null};if(Ah(n))Mh(i,y);else{var v=n.alternate;if(n.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var _=i.lastRenderedState,D=v(_,l);if(y.hasEagerState=!0,y.eagerState=D,Un(D,_)){var X=i.interleaved;X===null?(y.next=y,Ou(i)):(y.next=X.next,X.next=y),i.interleaved=y;return}}catch{}finally{}l=uh(n,i,y,d),l!==null&&(y=Zt(),Gn(l,n,d,y),Rh(l,i,d))}}function Ah(n){var i=n.alternate;return n===ft||i!==null&&i===ft}function Mh(n,i){wo=Ol=!0;var l=n.pending;l===null?i.next=i:(i.next=l.next,l.next=i),n.pending=i}function Rh(n,i,l){if((l&4194240)!==0){var d=i.lanes;d&=n.pendingLanes,l|=d,i.lanes=l,ss(n,l)}}var Hl={readContext:Mn,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},jv={readContext:Mn,useCallback:function(n,i){return ur().memoizedState=[n,i===void 0?null:i],n},useContext:Mn,useEffect:Nh,useImperativeHandle:function(n,i,l){return l=l!=null?l.concat([n]):null,$l(4194308,4,bh.bind(null,i,n),l)},useLayoutEffect:function(n,i){return $l(4194308,4,n,i)},useInsertionEffect:function(n,i){return $l(4,2,n,i)},useMemo:function(n,i){var l=ur();return i=i===void 0?null:i,n=n(),l.memoizedState=[n,i],n},useReducer:function(n,i,l){var d=ur();return i=l!==void 0?l(i):i,d.memoizedState=d.baseState=i,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:i},d.queue=n,n=n.dispatch=Cv.bind(null,ft,n),[d.memoizedState,n]},useRef:function(n){var i=ur();return n={current:n},i.memoizedState=n},useState:Sh,useDebugValue:Zu,useDeferredValue:function(n){return ur().memoizedState=n},useTransition:function(){var n=Sh(!1),i=n[0];return n=Ev.bind(null,n[1]),ur().memoizedState=n,[i,n]},useMutableSource:function(){},useSyncExternalStore:function(n,i,l){var d=ft,y=ur();if(at){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),Rt===null)throw Error(r(349));(Li&30)!==0||gh(d,i,l)}y.memoizedState=l;var v={value:l,getSnapshot:i};return y.queue=v,Nh(xh.bind(null,d,v,n),[n]),d.flags|=2048,No(9,yh.bind(null,d,v,l,i),void 0,null),l},useId:function(){var n=ur(),i=Rt.identifierPrefix;if(at){var l=Tr,d=Ir;l=(d&~(1<<32-Ot(d)-1)).toString(32)+l,i=":"+i+"R"+l,l=So++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=Nv++,i=":"+i+"r"+l.toString(32)+":";return n.memoizedState=i},unstable_isNewReconciler:!1},_v={readContext:Mn,useCallback:_h,useContext:Mn,useEffect:Qu,useImperativeHandle:jh,useInsertionEffect:Eh,useLayoutEffect:Ch,useMemo:Ih,useReducer:Gu,useRef:kh,useState:function(){return Gu(ko)},useDebugValue:Zu,useDeferredValue:function(n){var i=Rn();return Th(i,jt.memoizedState,n)},useTransition:function(){var n=Gu(ko)[0],i=Rn().memoizedState;return[n,i]},useMutableSource:ph,useSyncExternalStore:mh,useId:Ph,unstable_isNewReconciler:!1},Iv={readContext:Mn,useCallback:_h,useContext:Mn,useEffect:Qu,useImperativeHandle:jh,useInsertionEffect:Eh,useLayoutEffect:Ch,useMemo:Ih,useReducer:Ku,useRef:kh,useState:function(){return Ku(ko)},useDebugValue:Zu,useDeferredValue:function(n){var i=Rn();return jt===null?i.memoizedState=n:Th(i,jt.memoizedState,n)},useTransition:function(){var n=Ku(ko)[0],i=Rn().memoizedState;return[n,i]},useMutableSource:ph,useSyncExternalStore:mh,useId:Ph,unstable_isNewReconciler:!1};function Yn(n,i){if(n&&n.defaultProps){i=j({},i),n=n.defaultProps;for(var l in n)i[l]===void 0&&(i[l]=n[l]);return i}return i}function Ju(n,i,l,d){i=n.memoizedState,l=l(d,i),l=l==null?i:j({},i,l),n.memoizedState=l,n.lanes===0&&(n.updateQueue.baseState=l)}var Vl={isMounted:function(n){return(n=n._reactInternals)?Ft(n)===n:!1},enqueueSetState:function(n,i,l){n=n._reactInternals;var d=Zt(),y=li(n),v=Ar(d,y);v.payload=i,l!=null&&(v.callback=l),i=ri(n,v,y),i!==null&&(Gn(i,n,y,d),zl(i,n,y))},enqueueReplaceState:function(n,i,l){n=n._reactInternals;var d=Zt(),y=li(n),v=Ar(d,y);v.tag=1,v.payload=i,l!=null&&(v.callback=l),i=ri(n,v,y),i!==null&&(Gn(i,n,y,d),zl(i,n,y))},enqueueForceUpdate:function(n,i){n=n._reactInternals;var l=Zt(),d=li(n),y=Ar(l,d);y.tag=2,i!=null&&(y.callback=i),i=ri(n,y,d),i!==null&&(Gn(i,n,d,l),zl(i,n,d))}};function zh(n,i,l,d,y,v,_){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(d,v,_):i.prototype&&i.prototype.isPureReactComponent?!ao(l,d)||!ao(y,v):!0}function Lh(n,i,l){var d=!1,y=ei,v=i.contextType;return typeof v=="object"&&v!==null?v=Mn(v):(y=rn(i)?Pi:Ut.current,d=i.contextTypes,v=(d=d!=null)?gs(n,y):ei),i=new i(l,v),n.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=Vl,n.stateNode=i,i._reactInternals=n,d&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=y,n.__reactInternalMemoizedMaskedChildContext=v),i}function Dh(n,i,l,d){n=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==n&&Vl.enqueueReplaceState(i,i.state,null)}function ec(n,i,l,d){var y=n.stateNode;y.props=l,y.state=n.memoizedState,y.refs={},$u(n);var v=i.contextType;typeof v=="object"&&v!==null?y.context=Mn(v):(v=rn(i)?Pi:Ut.current,y.context=gs(n,v)),y.state=n.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Ju(n,i,v,l),y.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(i=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),i!==y.state&&Vl.enqueueReplaceState(y,y.state,null),Ll(n,l,y,d),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308)}function Es(n,i){try{var l="",d=i;do l+=fe(d),d=d.return;while(d);var y=l}catch(v){y=`
|
|
39
|
-
Error generating stack: `+v.message+`
|
|
40
|
-
`+v.stack}return{value:n,source:i,stack:y,digest:null}}function tc(n,i,l){return{value:n,source:null,stack:l??null,digest:i??null}}function nc(n,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var Tv=typeof WeakMap=="function"?WeakMap:Map;function Fh(n,i,l){l=Ar(-1,l),l.tag=3,l.payload={element:null};var d=i.value;return l.callback=function(){Kl||(Kl=!0,yc=d),nc(n,i)},l}function Oh(n,i,l){l=Ar(-1,l),l.tag=3;var d=n.type.getDerivedStateFromError;if(typeof d=="function"){var y=i.value;l.payload=function(){return d(y)},l.callback=function(){nc(n,i)}}var v=n.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(l.callback=function(){nc(n,i),typeof d!="function"&&(si===null?si=new Set([this]):si.add(this));var _=i.stack;this.componentDidCatch(i.value,{componentStack:_!==null?_:""})}),l}function $h(n,i,l){var d=n.pingCache;if(d===null){d=n.pingCache=new Tv;var y=new Set;d.set(i,y)}else y=d.get(i),y===void 0&&(y=new Set,d.set(i,y));y.has(l)||(y.add(l),n=Uv.bind(null,n,i,l),i.then(n,n))}function Bh(n){do{var i;if((i=n.tag===13)&&(i=n.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return n;n=n.return}while(n!==null);return null}function Hh(n,i,l,d,y){return(n.mode&1)===0?(n===i?n.flags|=65536:(n.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=Ar(-1,1),i.tag=2,ri(l,i,1))),l.lanes|=1),n):(n.flags|=65536,n.lanes=y,n)}var Pv=I.ReactCurrentOwner,sn=!1;function Qt(n,i,l,d){i.child=n===null?ah(i,null,l,d):ws(i,n.child,l,d)}function Vh(n,i,l,d,y){l=l.render;var v=i.ref;return ks(i,y),d=Xu(n,i,l,d,v,y),l=qu(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~y,Mr(n,i,y)):(at&&l&&Tu(i),i.flags|=1,Qt(n,i,d,y),i.child)}function Uh(n,i,l,d,y){if(n===null){var v=l.type;return typeof v=="function"&&!Ec(v)&&v.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=v,Wh(n,i,v,d,y)):(n=na(l.type,null,d,i,i.mode,y),n.ref=i.ref,n.return=i,i.child=n)}if(v=n.child,(n.lanes&y)===0){var _=v.memoizedProps;if(l=l.compare,l=l!==null?l:ao,l(_,d)&&n.ref===i.ref)return Mr(n,i,y)}return i.flags|=1,n=ui(v,d),n.ref=i.ref,n.return=i,i.child=n}function Wh(n,i,l,d,y){if(n!==null){var v=n.memoizedProps;if(ao(v,d)&&n.ref===i.ref)if(sn=!1,i.pendingProps=d=v,(n.lanes&y)!==0)(n.flags&131072)!==0&&(sn=!0);else return i.lanes=n.lanes,Mr(n,i,y)}return rc(n,i,l,d,y)}function Yh(n,i,l){var d=i.pendingProps,y=d.children,v=n!==null?n.memoizedState:null;if(d.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},nt(bs,kn),kn|=l;else{if((l&1073741824)===0)return n=v!==null?v.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:n,cachePool:null,transitions:null},i.updateQueue=null,nt(bs,kn),kn|=n,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=v!==null?v.baseLanes:l,nt(bs,kn),kn|=d}else v!==null?(d=v.baseLanes|l,i.memoizedState=null):d=l,nt(bs,kn),kn|=d;return Qt(n,i,y,l),i.child}function Xh(n,i){var l=i.ref;(n===null&&l!==null||n!==null&&n.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function rc(n,i,l,d,y){var v=rn(l)?Pi:Ut.current;return v=gs(i,v),ks(i,y),l=Xu(n,i,l,d,v,y),d=qu(),n!==null&&!sn?(i.updateQueue=n.updateQueue,i.flags&=-2053,n.lanes&=~y,Mr(n,i,y)):(at&&d&&Tu(i),i.flags|=1,Qt(n,i,l,y),i.child)}function qh(n,i,l,d,y){if(rn(l)){var v=!0;jl(i)}else v=!1;if(ks(i,y),i.stateNode===null)Wl(n,i),Lh(i,l,d),ec(i,l,d,y),d=!0;else if(n===null){var _=i.stateNode,D=i.memoizedProps;_.props=D;var X=_.context,ne=l.contextType;typeof ne=="object"&&ne!==null?ne=Mn(ne):(ne=rn(l)?Pi:Ut.current,ne=gs(i,ne));var de=l.getDerivedStateFromProps,he=typeof de=="function"||typeof _.getSnapshotBeforeUpdate=="function";he||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==d||X!==ne)&&Dh(i,_,d,ne),ni=!1;var ue=i.memoizedState;_.state=ue,Ll(i,d,_,y),X=i.memoizedState,D!==d||ue!==X||nn.current||ni?(typeof de=="function"&&(Ju(i,l,de,d),X=i.memoizedState),(D=ni||zh(i,l,D,d,ue,X,ne))?(he||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(i.flags|=4194308)):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=X),_.props=d,_.state=X,_.context=ne,d=D):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{_=i.stateNode,ch(n,i),D=i.memoizedProps,ne=i.type===i.elementType?D:Yn(i.type,D),_.props=ne,he=i.pendingProps,ue=_.context,X=l.contextType,typeof X=="object"&&X!==null?X=Mn(X):(X=rn(l)?Pi:Ut.current,X=gs(i,X));var Se=l.getDerivedStateFromProps;(de=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==he||ue!==X)&&Dh(i,_,d,X),ni=!1,ue=i.memoizedState,_.state=ue,Ll(i,d,_,y);var Ne=i.memoizedState;D!==he||ue!==Ne||nn.current||ni?(typeof Se=="function"&&(Ju(i,l,Se,d),Ne=i.memoizedState),(ne=ni||zh(i,l,ne,d,ue,Ne,X)||!1)?(de||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(d,Ne,X),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(d,Ne,X)),typeof _.componentDidUpdate=="function"&&(i.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===n.memoizedProps&&ue===n.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&ue===n.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Ne),_.props=d,_.state=Ne,_.context=X,d=ne):(typeof _.componentDidUpdate!="function"||D===n.memoizedProps&&ue===n.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===n.memoizedProps&&ue===n.memoizedState||(i.flags|=1024),d=!1)}return ic(n,i,l,d,v,y)}function ic(n,i,l,d,y,v){Xh(n,i);var _=(i.flags&128)!==0;if(!d&&!_)return y&&Jf(i,l,!1),Mr(n,i,v);d=i.stateNode,Pv.current=i;var D=_&&typeof l.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,n!==null&&_?(i.child=ws(i,n.child,null,v),i.child=ws(i,null,D,v)):Qt(n,i,D,v),i.memoizedState=d.state,y&&Jf(i,l,!0),i.child}function Gh(n){var i=n.stateNode;i.pendingContext?Qf(n,i.pendingContext,i.pendingContext!==i.context):i.context&&Qf(n,i.context,!1),Bu(n,i.containerInfo)}function Kh(n,i,l,d,y){return vs(),Ru(y),i.flags|=256,Qt(n,i,l,d),i.child}var sc={dehydrated:null,treeContext:null,retryLane:0};function oc(n){return{baseLanes:n,cachePool:null,transitions:null}}function Qh(n,i,l){var d=i.pendingProps,y=dt.current,v=!1,_=(i.flags&128)!==0,D;if((D=_)||(D=n!==null&&n.memoizedState===null?!1:(y&2)!==0),D?(v=!0,i.flags&=-129):(n===null||n.memoizedState!==null)&&(y|=1),nt(dt,y&1),n===null)return Mu(i),n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?((i.mode&1)===0?i.lanes=1:n.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(_=d.children,n=d.fallback,v?(d=i.mode,v=i.child,_={mode:"hidden",children:_},(d&1)===0&&v!==null?(v.childLanes=0,v.pendingProps=_):v=ra(_,d,0,null),n=Bi(n,d,l,null),v.return=i,n.return=i,v.sibling=n,i.child=v,i.child.memoizedState=oc(l),i.memoizedState=sc,n):lc(i,_));if(y=n.memoizedState,y!==null&&(D=y.dehydrated,D!==null))return Av(n,i,_,d,D,y,l);if(v){v=d.fallback,_=i.mode,y=n.child,D=y.sibling;var X={mode:"hidden",children:d.children};return(_&1)===0&&i.child!==y?(d=i.child,d.childLanes=0,d.pendingProps=X,i.deletions=null):(d=ui(y,X),d.subtreeFlags=y.subtreeFlags&14680064),D!==null?v=ui(D,v):(v=Bi(v,_,l,null),v.flags|=2),v.return=i,d.return=i,d.sibling=v,i.child=d,d=v,v=i.child,_=n.child.memoizedState,_=_===null?oc(l):{baseLanes:_.baseLanes|l,cachePool:null,transitions:_.transitions},v.memoizedState=_,v.childLanes=n.childLanes&~l,i.memoizedState=sc,d}return v=n.child,n=v.sibling,d=ui(v,{mode:"visible",children:d.children}),(i.mode&1)===0&&(d.lanes=l),d.return=i,d.sibling=null,n!==null&&(l=i.deletions,l===null?(i.deletions=[n],i.flags|=16):l.push(n)),i.child=d,i.memoizedState=null,d}function lc(n,i){return i=ra({mode:"visible",children:i},n.mode,0,null),i.return=n,n.child=i}function Ul(n,i,l,d){return d!==null&&Ru(d),ws(i,n.child,null,l),n=lc(i,i.pendingProps.children),n.flags|=2,i.memoizedState=null,n}function Av(n,i,l,d,y,v,_){if(l)return i.flags&256?(i.flags&=-257,d=tc(Error(r(422))),Ul(n,i,_,d)):i.memoizedState!==null?(i.child=n.child,i.flags|=128,null):(v=d.fallback,y=i.mode,d=ra({mode:"visible",children:d.children},y,0,null),v=Bi(v,y,_,null),v.flags|=2,d.return=i,v.return=i,d.sibling=v,i.child=d,(i.mode&1)!==0&&ws(i,n.child,null,_),i.child.memoizedState=oc(_),i.memoizedState=sc,v);if((i.mode&1)===0)return Ul(n,i,_,null);if(y.data==="$!"){if(d=y.nextSibling&&y.nextSibling.dataset,d)var D=d.dgst;return d=D,v=Error(r(419)),d=tc(v,d,void 0),Ul(n,i,_,d)}if(D=(_&n.childLanes)!==0,sn||D){if(d=Rt,d!==null){switch(_&-_){case 4:y=2;break;case 16:y=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:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(d.suspendedLanes|_))!==0?0:y,y!==0&&y!==v.retryLane&&(v.retryLane=y,Pr(n,y),Gn(d,n,y,-1))}return Nc(),d=tc(Error(r(421))),Ul(n,i,_,d)}return y.data==="$?"?(i.flags|=128,i.child=n.child,i=Wv.bind(null,n),y._reactRetry=i,null):(n=v.treeContext,Sn=Zr(y.nextSibling),wn=i,at=!0,Wn=null,n!==null&&(Pn[An++]=Ir,Pn[An++]=Tr,Pn[An++]=Ai,Ir=n.id,Tr=n.overflow,Ai=i),i=lc(i,d.children),i.flags|=4096,i)}function Zh(n,i,l){n.lanes|=i;var d=n.alternate;d!==null&&(d.lanes|=i),Fu(n.return,i,l)}function ac(n,i,l,d,y){var v=n.memoizedState;v===null?n.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:y}:(v.isBackwards=i,v.rendering=null,v.renderingStartTime=0,v.last=d,v.tail=l,v.tailMode=y)}function Jh(n,i,l){var d=i.pendingProps,y=d.revealOrder,v=d.tail;if(Qt(n,i,d.children,l),d=dt.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=i.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Zh(n,l,i);else if(n.tag===19)Zh(n,l,i);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===i)break e;for(;n.sibling===null;){if(n.return===null||n.return===i)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}d&=1}if(nt(dt,d),(i.mode&1)===0)i.memoizedState=null;else switch(y){case"forwards":for(l=i.child,y=null;l!==null;)n=l.alternate,n!==null&&Dl(n)===null&&(y=l),l=l.sibling;l=y,l===null?(y=i.child,i.child=null):(y=l.sibling,l.sibling=null),ac(i,!1,y,l,v);break;case"backwards":for(l=null,y=i.child,i.child=null;y!==null;){if(n=y.alternate,n!==null&&Dl(n)===null){i.child=y;break}n=y.sibling,y.sibling=l,l=y,y=n}ac(i,!0,l,null,v);break;case"together":ac(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Wl(n,i){(i.mode&1)===0&&n!==null&&(n.alternate=null,i.alternate=null,i.flags|=2)}function Mr(n,i,l){if(n!==null&&(i.dependencies=n.dependencies),Di|=i.lanes,(l&i.childLanes)===0)return null;if(n!==null&&i.child!==n.child)throw Error(r(153));if(i.child!==null){for(n=i.child,l=ui(n,n.pendingProps),i.child=l,l.return=i;n.sibling!==null;)n=n.sibling,l=l.sibling=ui(n,n.pendingProps),l.return=i;l.sibling=null}return i.child}function Mv(n,i,l){switch(i.tag){case 3:Gh(i),vs();break;case 5:hh(i);break;case 1:rn(i.type)&&jl(i);break;case 4:Bu(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,y=i.memoizedProps.value;nt(Ml,d._currentValue),d._currentValue=y;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(nt(dt,dt.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?Qh(n,i,l):(nt(dt,dt.current&1),n=Mr(n,i,l),n!==null?n.sibling:null);nt(dt,dt.current&1);break;case 19:if(d=(l&i.childLanes)!==0,(n.flags&128)!==0){if(d)return Jh(n,i,l);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),nt(dt,dt.current),d)break;return null;case 22:case 23:return i.lanes=0,Yh(n,i,l)}return Mr(n,i,l)}var ep,uc,tp,np;ep=function(n,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)n.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},uc=function(){},tp=function(n,i,l,d){var y=n.memoizedProps;if(y!==d){n=i.stateNode,zi(ar.current);var v=null;switch(l){case"input":y=Ve(n,y),d=Ve(n,d),v=[];break;case"select":y=j({},y,{value:void 0}),d=j({},d,{value:void 0}),v=[];break;case"textarea":y=Ht(n,y),d=Ht(n,d),v=[];break;default:typeof y.onClick!="function"&&typeof d.onClick=="function"&&(n.onclick=El)}pt(l,d);var _;l=null;for(ne in y)if(!d.hasOwnProperty(ne)&&y.hasOwnProperty(ne)&&y[ne]!=null)if(ne==="style"){var D=y[ne];for(_ in D)D.hasOwnProperty(_)&&(l||(l={}),l[_]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(o.hasOwnProperty(ne)?v||(v=[]):(v=v||[]).push(ne,null));for(ne in d){var X=d[ne];if(D=y!=null?y[ne]:void 0,d.hasOwnProperty(ne)&&X!==D&&(X!=null||D!=null))if(ne==="style")if(D){for(_ in D)!D.hasOwnProperty(_)||X&&X.hasOwnProperty(_)||(l||(l={}),l[_]="");for(_ in X)X.hasOwnProperty(_)&&D[_]!==X[_]&&(l||(l={}),l[_]=X[_])}else l||(v||(v=[]),v.push(ne,l)),l=X;else ne==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,D=D?D.__html:void 0,X!=null&&D!==X&&(v=v||[]).push(ne,X)):ne==="children"?typeof X!="string"&&typeof X!="number"||(v=v||[]).push(ne,""+X):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(o.hasOwnProperty(ne)?(X!=null&&ne==="onScroll"&&ot("scroll",n),v||D===X||(v=[])):(v=v||[]).push(ne,X))}l&&(v=v||[]).push("style",l);var ne=v;(i.updateQueue=ne)&&(i.flags|=4)}},np=function(n,i,l,d){l!==d&&(i.flags|=4)};function Eo(n,i){if(!at)switch(n.tailMode){case"hidden":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?n.tail=null:l.sibling=null;break;case"collapsed":l=n.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||n.tail===null?n.tail=null:n.tail.sibling=null:d.sibling=null}}function Yt(n){var i=n.alternate!==null&&n.alternate.child===n.child,l=0,d=0;if(i)for(var y=n.child;y!==null;)l|=y.lanes|y.childLanes,d|=y.subtreeFlags&14680064,d|=y.flags&14680064,y.return=n,y=y.sibling;else for(y=n.child;y!==null;)l|=y.lanes|y.childLanes,d|=y.subtreeFlags,d|=y.flags,y.return=n,y=y.sibling;return n.subtreeFlags|=d,n.childLanes=l,i}function Rv(n,i,l){var d=i.pendingProps;switch(Pu(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yt(i),null;case 1:return rn(i.type)&&bl(),Yt(i),null;case 3:return d=i.stateNode,Ns(),lt(nn),lt(Ut),Uu(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(n===null||n.child===null)&&(Pl(i)?i.flags|=4:n===null||n.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Wn!==null&&(wc(Wn),Wn=null))),uc(n,i),Yt(i),null;case 5:Hu(i);var y=zi(vo.current);if(l=i.type,n!==null&&i.stateNode!=null)tp(n,i,l,d,y),n.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!d){if(i.stateNode===null)throw Error(r(166));return Yt(i),null}if(n=zi(ar.current),Pl(i)){d=i.stateNode,l=i.type;var v=i.memoizedProps;switch(d[lr]=i,d[po]=v,n=(i.mode&1)!==0,l){case"dialog":ot("cancel",d),ot("close",d);break;case"iframe":case"object":case"embed":ot("load",d);break;case"video":case"audio":for(y=0;y<co.length;y++)ot(co[y],d);break;case"source":ot("error",d);break;case"img":case"image":case"link":ot("error",d),ot("load",d);break;case"details":ot("toggle",d);break;case"input":We(d,v),ot("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!v.multiple},ot("invalid",d);break;case"textarea":pn(d,v),ot("invalid",d)}pt(l,v),y=null;for(var _ in v)if(v.hasOwnProperty(_)){var D=v[_];_==="children"?typeof D=="string"?d.textContent!==D&&(v.suppressHydrationWarning!==!0&&Nl(d.textContent,D,n),y=["children",D]):typeof D=="number"&&d.textContent!==""+D&&(v.suppressHydrationWarning!==!0&&Nl(d.textContent,D,n),y=["children",""+D]):o.hasOwnProperty(_)&&D!=null&&_==="onScroll"&&ot("scroll",d)}switch(l){case"input":Pe(d),It(d,v,!0);break;case"textarea":Pe(d),Jt(d);break;case"select":case"option":break;default:typeof v.onClick=="function"&&(d.onclick=El)}d=y,i.updateQueue=d,d!==null&&(i.flags|=4)}else{_=y.nodeType===9?y:y.ownerDocument,n==="http://www.w3.org/1999/xhtml"&&(n=ie(l)),n==="http://www.w3.org/1999/xhtml"?l==="script"?(n=_.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild)):typeof d.is=="string"?n=_.createElement(l,{is:d.is}):(n=_.createElement(l),l==="select"&&(_=n,d.multiple?_.multiple=!0:d.size&&(_.size=d.size))):n=_.createElementNS(n,l),n[lr]=i,n[po]=d,ep(n,i,!1,!1),i.stateNode=n;e:{switch(_=en(l,d),l){case"dialog":ot("cancel",n),ot("close",n),y=d;break;case"iframe":case"object":case"embed":ot("load",n),y=d;break;case"video":case"audio":for(y=0;y<co.length;y++)ot(co[y],n);y=d;break;case"source":ot("error",n),y=d;break;case"img":case"image":case"link":ot("error",n),ot("load",n),y=d;break;case"details":ot("toggle",n),y=d;break;case"input":We(n,d),y=Ve(n,d),ot("invalid",n);break;case"option":y=d;break;case"select":n._wrapperState={wasMultiple:!!d.multiple},y=j({},d,{value:void 0}),ot("invalid",n);break;case"textarea":pn(n,d),y=Ht(n,d),ot("invalid",n);break;default:y=d}pt(l,y),D=y;for(v in D)if(D.hasOwnProperty(v)){var X=D[v];v==="style"?yt(n,X):v==="dangerouslySetInnerHTML"?(X=X?X.__html:void 0,X!=null&&$e(n,X)):v==="children"?typeof X=="string"?(l!=="textarea"||X!=="")&&Be(n,X):typeof X=="number"&&Be(n,""+X):v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&v!=="autoFocus"&&(o.hasOwnProperty(v)?X!=null&&v==="onScroll"&&ot("scroll",n):X!=null&&N(n,v,X,_))}switch(l){case"input":Pe(n),It(n,d,!1);break;case"textarea":Pe(n),Jt(n);break;case"option":d.value!=null&&n.setAttribute("value",""+se(d.value));break;case"select":n.multiple=!!d.multiple,v=d.value,v!=null?Tt(n,!!d.multiple,v,!1):d.defaultValue!=null&&Tt(n,!!d.multiple,d.defaultValue,!0);break;default:typeof y.onClick=="function"&&(n.onclick=El)}switch(l){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Yt(i),null;case 6:if(n&&i.stateNode!=null)np(n,i,n.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(r(166));if(l=zi(vo.current),zi(ar.current),Pl(i)){if(d=i.stateNode,l=i.memoizedProps,d[lr]=i,(v=d.nodeValue!==l)&&(n=wn,n!==null))switch(n.tag){case 3:Nl(d.nodeValue,l,(n.mode&1)!==0);break;case 5:n.memoizedProps.suppressHydrationWarning!==!0&&Nl(d.nodeValue,l,(n.mode&1)!==0)}v&&(i.flags|=4)}else d=(l.nodeType===9?l:l.ownerDocument).createTextNode(d),d[lr]=i,i.stateNode=d}return Yt(i),null;case 13:if(lt(dt),d=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(at&&Sn!==null&&(i.mode&1)!==0&&(i.flags&128)===0)sh(),vs(),i.flags|=98560,v=!1;else if(v=Pl(i),d!==null&&d.dehydrated!==null){if(n===null){if(!v)throw Error(r(318));if(v=i.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[lr]=i}else vs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Yt(i),v=!1}else Wn!==null&&(wc(Wn),Wn=null),v=!0;if(!v)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(d=d!==null,d!==(n!==null&&n.memoizedState!==null)&&d&&(i.child.flags|=8192,(i.mode&1)!==0&&(n===null||(dt.current&1)!==0?_t===0&&(_t=3):Nc())),i.updateQueue!==null&&(i.flags|=4),Yt(i),null);case 4:return Ns(),uc(n,i),n===null&&fo(i.stateNode.containerInfo),Yt(i),null;case 10:return Du(i.type._context),Yt(i),null;case 17:return rn(i.type)&&bl(),Yt(i),null;case 19:if(lt(dt),v=i.memoizedState,v===null)return Yt(i),null;if(d=(i.flags&128)!==0,_=v.rendering,_===null)if(d)Eo(v,!1);else{if(_t!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(_=Dl(n),_!==null){for(i.flags|=128,Eo(v,!1),d=_.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),i.subtreeFlags=0,d=l,l=i.child;l!==null;)v=l,n=d,v.flags&=14680066,_=v.alternate,_===null?(v.childLanes=0,v.lanes=n,v.child=null,v.subtreeFlags=0,v.memoizedProps=null,v.memoizedState=null,v.updateQueue=null,v.dependencies=null,v.stateNode=null):(v.childLanes=_.childLanes,v.lanes=_.lanes,v.child=_.child,v.subtreeFlags=0,v.deletions=null,v.memoizedProps=_.memoizedProps,v.memoizedState=_.memoizedState,v.updateQueue=_.updateQueue,v.type=_.type,n=_.dependencies,v.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),l=l.sibling;return nt(dt,dt.current&1|2),i.child}n=n.sibling}v.tail!==null&&st()>js&&(i.flags|=128,d=!0,Eo(v,!1),i.lanes=4194304)}else{if(!d)if(n=Dl(_),n!==null){if(i.flags|=128,d=!0,l=n.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),Eo(v,!0),v.tail===null&&v.tailMode==="hidden"&&!_.alternate&&!at)return Yt(i),null}else 2*st()-v.renderingStartTime>js&&l!==1073741824&&(i.flags|=128,d=!0,Eo(v,!1),i.lanes=4194304);v.isBackwards?(_.sibling=i.child,i.child=_):(l=v.last,l!==null?l.sibling=_:i.child=_,v.last=_)}return v.tail!==null?(i=v.tail,v.rendering=i,v.tail=i.sibling,v.renderingStartTime=st(),i.sibling=null,l=dt.current,nt(dt,d?l&1|2:l&1),i):(Yt(i),null);case 22:case 23:return kc(),d=i.memoizedState!==null,n!==null&&n.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(kn&1073741824)!==0&&(Yt(i),i.subtreeFlags&6&&(i.flags|=8192)):Yt(i),null;case 24:return null;case 25:return null}throw Error(r(156,i.tag))}function zv(n,i){switch(Pu(i),i.tag){case 1:return rn(i.type)&&bl(),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Ns(),lt(nn),lt(Ut),Uu(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 5:return Hu(i),null;case 13:if(lt(dt),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(r(340));vs()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return lt(dt),null;case 4:return Ns(),null;case 10:return Du(i.type._context),null;case 22:case 23:return kc(),null;case 24:return null;default:return null}}var Yl=!1,Xt=!1,Lv=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Cs(n,i){var l=n.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(d){mt(n,i,d)}else l.current=null}function cc(n,i,l){try{l()}catch(d){mt(n,i,d)}}var rp=!1;function Dv(n,i){if(ku=vt,n=zf(),pu(n)){if("selectionStart"in n)var l={start:n.selectionStart,end:n.selectionEnd};else e:{l=(l=n.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var y=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var _=0,D=-1,X=-1,ne=0,de=0,he=n,ue=null;t:for(;;){for(var Se;he!==l||y!==0&&he.nodeType!==3||(D=_+y),he!==v||d!==0&&he.nodeType!==3||(X=_+d),he.nodeType===3&&(_+=he.nodeValue.length),(Se=he.firstChild)!==null;)ue=he,he=Se;for(;;){if(he===n)break t;if(ue===l&&++ne===y&&(D=_),ue===v&&++de===d&&(X=_),(Se=he.nextSibling)!==null)break;he=ue,ue=he.parentNode}he=Se}l=D===-1||X===-1?null:{start:D,end:X}}else l=null}l=l||{start:0,end:0}}else l=null;for(Nu={focusedElem:n,selectionRange:l},vt=!1,ke=i;ke!==null;)if(i=ke,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,ke=n;else for(;ke!==null;){i=ke;try{var Ne=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Ne!==null){var be=Ne.memoizedProps,wt=Ne.memoizedState,ee=i.stateNode,G=ee.getSnapshotBeforeUpdate(i.elementType===i.type?be:Yn(i.type,be),wt);ee.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var te=i.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ye){mt(i,i.return,ye)}if(n=i.sibling,n!==null){n.return=i.return,ke=n;break}ke=i.return}return Ne=rp,rp=!1,Ne}function Co(n,i,l){var d=i.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var y=d=d.next;do{if((y.tag&n)===n){var v=y.destroy;y.destroy=void 0,v!==void 0&&cc(i,l,v)}y=y.next}while(y!==d)}}function Xl(n,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&n)===n){var d=l.create;l.destroy=d()}l=l.next}while(l!==i)}}function dc(n){var i=n.ref;if(i!==null){var l=n.stateNode;switch(n.tag){case 5:n=l;break;default:n=l}typeof i=="function"?i(n):i.current=n}}function ip(n){var i=n.alternate;i!==null&&(n.alternate=null,ip(i)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(i=n.stateNode,i!==null&&(delete i[lr],delete i[po],delete i[ju],delete i[vv],delete i[wv])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function sp(n){return n.tag===5||n.tag===3||n.tag===4}function op(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||sp(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function fc(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(n,i):l.insertBefore(n,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(n,l)):(i=l,i.appendChild(n)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=El));else if(d!==4&&(n=n.child,n!==null))for(fc(n,i,l),n=n.sibling;n!==null;)fc(n,i,l),n=n.sibling}function hc(n,i,l){var d=n.tag;if(d===5||d===6)n=n.stateNode,i?l.insertBefore(n,i):l.appendChild(n);else if(d!==4&&(n=n.child,n!==null))for(hc(n,i,l),n=n.sibling;n!==null;)hc(n,i,l),n=n.sibling}var $t=null,Xn=!1;function ii(n,i,l){for(l=l.child;l!==null;)lp(n,i,l),l=l.sibling}function lp(n,i,l){if(tn&&typeof tn.onCommitFiberUnmount=="function")try{tn.onCommitFiberUnmount(Er,l)}catch{}switch(l.tag){case 5:Xt||Cs(l,i);case 6:var d=$t,y=Xn;$t=null,ii(n,i,l),$t=d,Xn=y,$t!==null&&(Xn?(n=$t,l=l.stateNode,n.nodeType===8?n.parentNode.removeChild(l):n.removeChild(l)):$t.removeChild(l.stateNode));break;case 18:$t!==null&&(Xn?(n=$t,l=l.stateNode,n.nodeType===8?bu(n.parentNode,l):n.nodeType===1&&bu(n,l),Ye(n)):bu($t,l.stateNode));break;case 4:d=$t,y=Xn,$t=l.stateNode.containerInfo,Xn=!0,ii(n,i,l),$t=d,Xn=y;break;case 0:case 11:case 14:case 15:if(!Xt&&(d=l.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){y=d=d.next;do{var v=y,_=v.destroy;v=v.tag,_!==void 0&&((v&2)!==0||(v&4)!==0)&&cc(l,i,_),y=y.next}while(y!==d)}ii(n,i,l);break;case 1:if(!Xt&&(Cs(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=l.memoizedProps,d.state=l.memoizedState,d.componentWillUnmount()}catch(D){mt(l,i,D)}ii(n,i,l);break;case 21:ii(n,i,l);break;case 22:l.mode&1?(Xt=(d=Xt)||l.memoizedState!==null,ii(n,i,l),Xt=d):ii(n,i,l);break;default:ii(n,i,l)}}function ap(n){var i=n.updateQueue;if(i!==null){n.updateQueue=null;var l=n.stateNode;l===null&&(l=n.stateNode=new Lv),i.forEach(function(d){var y=Yv.bind(null,n,d);l.has(d)||(l.add(d),d.then(y,y))})}}function qn(n,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var y=l[d];try{var v=n,_=i,D=_;e:for(;D!==null;){switch(D.tag){case 5:$t=D.stateNode,Xn=!1;break e;case 3:$t=D.stateNode.containerInfo,Xn=!0;break e;case 4:$t=D.stateNode.containerInfo,Xn=!0;break e}D=D.return}if($t===null)throw Error(r(160));lp(v,_,y),$t=null,Xn=!1;var X=y.alternate;X!==null&&(X.return=null),y.return=null}catch(ne){mt(y,i,ne)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)up(i,n),i=i.sibling}function up(n,i){var l=n.alternate,d=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:if(qn(i,n),cr(n),d&4){try{Co(3,n,n.return),Xl(3,n)}catch(be){mt(n,n.return,be)}try{Co(5,n,n.return)}catch(be){mt(n,n.return,be)}}break;case 1:qn(i,n),cr(n),d&512&&l!==null&&Cs(l,l.return);break;case 5:if(qn(i,n),cr(n),d&512&&l!==null&&Cs(l,l.return),n.flags&32){var y=n.stateNode;try{Be(y,"")}catch(be){mt(n,n.return,be)}}if(d&4&&(y=n.stateNode,y!=null)){var v=n.memoizedProps,_=l!==null?l.memoizedProps:v,D=n.type,X=n.updateQueue;if(n.updateQueue=null,X!==null)try{D==="input"&&v.type==="radio"&&v.name!=null&&Oe(y,v),en(D,_);var ne=en(D,v);for(_=0;_<X.length;_+=2){var de=X[_],he=X[_+1];de==="style"?yt(y,he):de==="dangerouslySetInnerHTML"?$e(y,he):de==="children"?Be(y,he):N(y,de,he,ne)}switch(D){case"input":tt(y,v);break;case"textarea":mn(y,v);break;case"select":var ue=y._wrapperState.wasMultiple;y._wrapperState.wasMultiple=!!v.multiple;var Se=v.value;Se!=null?Tt(y,!!v.multiple,Se,!1):ue!==!!v.multiple&&(v.defaultValue!=null?Tt(y,!!v.multiple,v.defaultValue,!0):Tt(y,!!v.multiple,v.multiple?[]:"",!1))}y[po]=v}catch(be){mt(n,n.return,be)}}break;case 6:if(qn(i,n),cr(n),d&4){if(n.stateNode===null)throw Error(r(162));y=n.stateNode,v=n.memoizedProps;try{y.nodeValue=v}catch(be){mt(n,n.return,be)}}break;case 3:if(qn(i,n),cr(n),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Ye(i.containerInfo)}catch(be){mt(n,n.return,be)}break;case 4:qn(i,n),cr(n);break;case 13:qn(i,n),cr(n),y=n.child,y.flags&8192&&(v=y.memoizedState!==null,y.stateNode.isHidden=v,!v||y.alternate!==null&&y.alternate.memoizedState!==null||(gc=st())),d&4&&ap(n);break;case 22:if(de=l!==null&&l.memoizedState!==null,n.mode&1?(Xt=(ne=Xt)||de,qn(i,n),Xt=ne):qn(i,n),cr(n),d&8192){if(ne=n.memoizedState!==null,(n.stateNode.isHidden=ne)&&!de&&(n.mode&1)!==0)for(ke=n,de=n.child;de!==null;){for(he=ke=de;ke!==null;){switch(ue=ke,Se=ue.child,ue.tag){case 0:case 11:case 14:case 15:Co(4,ue,ue.return);break;case 1:Cs(ue,ue.return);var Ne=ue.stateNode;if(typeof Ne.componentWillUnmount=="function"){d=ue,l=ue.return;try{i=d,Ne.props=i.memoizedProps,Ne.state=i.memoizedState,Ne.componentWillUnmount()}catch(be){mt(d,l,be)}}break;case 5:Cs(ue,ue.return);break;case 22:if(ue.memoizedState!==null){fp(he);continue}}Se!==null?(Se.return=ue,ke=Se):fp(he)}de=de.sibling}e:for(de=null,he=n;;){if(he.tag===5){if(de===null){de=he;try{y=he.stateNode,ne?(v=y.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none"):(D=he.stateNode,X=he.memoizedProps.style,_=X!=null&&X.hasOwnProperty("display")?X.display:null,D.style.display=Pt("display",_))}catch(be){mt(n,n.return,be)}}}else if(he.tag===6){if(de===null)try{he.stateNode.nodeValue=ne?"":he.memoizedProps}catch(be){mt(n,n.return,be)}}else if((he.tag!==22&&he.tag!==23||he.memoizedState===null||he===n)&&he.child!==null){he.child.return=he,he=he.child;continue}if(he===n)break e;for(;he.sibling===null;){if(he.return===null||he.return===n)break e;de===he&&(de=null),he=he.return}de===he&&(de=null),he.sibling.return=he.return,he=he.sibling}}break;case 19:qn(i,n),cr(n),d&4&&ap(n);break;case 21:break;default:qn(i,n),cr(n)}}function cr(n){var i=n.flags;if(i&2){try{e:{for(var l=n.return;l!==null;){if(sp(l)){var d=l;break e}l=l.return}throw Error(r(160))}switch(d.tag){case 5:var y=d.stateNode;d.flags&32&&(Be(y,""),d.flags&=-33);var v=op(n);hc(n,v,y);break;case 3:case 4:var _=d.stateNode.containerInfo,D=op(n);fc(n,D,_);break;default:throw Error(r(161))}}catch(X){mt(n,n.return,X)}n.flags&=-3}i&4096&&(n.flags&=-4097)}function Fv(n,i,l){ke=n,cp(n)}function cp(n,i,l){for(var d=(n.mode&1)!==0;ke!==null;){var y=ke,v=y.child;if(y.tag===22&&d){var _=y.memoizedState!==null||Yl;if(!_){var D=y.alternate,X=D!==null&&D.memoizedState!==null||Xt;D=Yl;var ne=Xt;if(Yl=_,(Xt=X)&&!ne)for(ke=y;ke!==null;)_=ke,X=_.child,_.tag===22&&_.memoizedState!==null?hp(y):X!==null?(X.return=_,ke=X):hp(y);for(;v!==null;)ke=v,cp(v),v=v.sibling;ke=y,Yl=D,Xt=ne}dp(n)}else(y.subtreeFlags&8772)!==0&&v!==null?(v.return=y,ke=v):dp(n)}}function dp(n){for(;ke!==null;){var i=ke;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:Xt||Xl(5,i);break;case 1:var d=i.stateNode;if(i.flags&4&&!Xt)if(l===null)d.componentDidMount();else{var y=i.elementType===i.type?l.memoizedProps:Yn(i.type,l.memoizedProps);d.componentDidUpdate(y,l.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var v=i.updateQueue;v!==null&&fh(i,v,d);break;case 3:var _=i.updateQueue;if(_!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}fh(i,_,l)}break;case 5:var D=i.stateNode;if(l===null&&i.flags&4){l=D;var X=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":X.autoFocus&&l.focus();break;case"img":X.src&&(l.src=X.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var ne=i.alternate;if(ne!==null){var de=ne.memoizedState;if(de!==null){var he=de.dehydrated;he!==null&&Ye(he)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}Xt||i.flags&512&&dc(i)}catch(ue){mt(i,i.return,ue)}}if(i===n){ke=null;break}if(l=i.sibling,l!==null){l.return=i.return,ke=l;break}ke=i.return}}function fp(n){for(;ke!==null;){var i=ke;if(i===n){ke=null;break}var l=i.sibling;if(l!==null){l.return=i.return,ke=l;break}ke=i.return}}function hp(n){for(;ke!==null;){var i=ke;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{Xl(4,i)}catch(X){mt(i,l,X)}break;case 1:var d=i.stateNode;if(typeof d.componentDidMount=="function"){var y=i.return;try{d.componentDidMount()}catch(X){mt(i,y,X)}}var v=i.return;try{dc(i)}catch(X){mt(i,v,X)}break;case 5:var _=i.return;try{dc(i)}catch(X){mt(i,_,X)}}}catch(X){mt(i,i.return,X)}if(i===n){ke=null;break}var D=i.sibling;if(D!==null){D.return=i.return,ke=D;break}ke=i.return}}var Ov=Math.ceil,ql=I.ReactCurrentDispatcher,pc=I.ReactCurrentOwner,zn=I.ReactCurrentBatchConfig,Ge=0,Rt=null,Nt=null,Bt=0,kn=0,bs=Jr(0),_t=0,bo=null,Di=0,Gl=0,mc=0,jo=null,on=null,gc=0,js=1/0,Rr=null,Kl=!1,yc=null,si=null,Ql=!1,oi=null,Zl=0,_o=0,xc=null,Jl=-1,ea=0;function Zt(){return(Ge&6)!==0?st():Jl!==-1?Jl:Jl=st()}function li(n){return(n.mode&1)===0?1:(Ge&2)!==0&&Bt!==0?Bt&-Bt:kv.transition!==null?(ea===0&&(ea=qr()),ea):(n=Ke,n!==0||(n=window.event,n=n===void 0?16:mf(n.type)),n)}function Gn(n,i,l,d){if(50<_o)throw _o=0,xc=null,Error(r(185));Hn(n,l,d),((Ge&2)===0||n!==Rt)&&(n===Rt&&((Ge&2)===0&&(Gl|=l),_t===4&&ai(n,Bt)),ln(n,d),l===1&&Ge===0&&(i.mode&1)===0&&(js=st()+500,_l&&ti()))}function ln(n,i){var l=n.callbackNode;Zs(n,i);var d=et(n,n===Rt?Bt:0);if(d===0)l!==null&&Ei(l),n.callbackNode=null,n.callbackPriority=0;else if(i=d&-d,n.callbackPriority!==i){if(l!=null&&Ei(l),i===1)n.tag===0?Sv(mp.bind(null,n)):eh(mp.bind(null,n)),yv(function(){(Ge&6)===0&&ti()}),l=null;else{switch(fl(d)){case 1:l=Ci;break;case 4:l=bi;break;case 16:l=Nr;break;case 536870912:l=ts;break;default:l=Nr}l=Np(l,pp.bind(null,n))}n.callbackPriority=i,n.callbackNode=l}}function pp(n,i){if(Jl=-1,ea=0,(Ge&6)!==0)throw Error(r(327));var l=n.callbackNode;if(_s()&&n.callbackNode!==l)return null;var d=et(n,n===Rt?Bt:0);if(d===0)return null;if((d&30)!==0||(d&n.expiredLanes)!==0||i)i=ta(n,d);else{i=d;var y=Ge;Ge|=2;var v=yp();(Rt!==n||Bt!==i)&&(Rr=null,js=st()+500,Oi(n,i));do try{Hv();break}catch(D){gp(n,D)}while(!0);Lu(),ql.current=v,Ge=y,Nt!==null?i=0:(Rt=null,Bt=0,i=_t)}if(i!==0){if(i===2&&(y=ji(n),y!==0&&(d=y,i=vc(n,y))),i===1)throw l=bo,Oi(n,0),ai(n,d),ln(n,st()),l;if(i===6)ai(n,d);else{if(y=n.current.alternate,(d&30)===0&&!$v(y)&&(i=ta(n,d),i===2&&(v=ji(n),v!==0&&(d=v,i=vc(n,v))),i===1))throw l=bo,Oi(n,0),ai(n,d),ln(n,st()),l;switch(n.finishedWork=y,n.finishedLanes=d,i){case 0:case 1:throw Error(r(345));case 2:$i(n,on,Rr);break;case 3:if(ai(n,d),(d&130023424)===d&&(i=gc+500-st(),10<i)){if(et(n,0)!==0)break;if(y=n.suspendedLanes,(y&d)!==d){Zt(),n.pingedLanes|=n.suspendedLanes&y;break}n.timeoutHandle=Cu($i.bind(null,n,on,Rr),i);break}$i(n,on,Rr);break;case 4:if(ai(n,d),(d&4194240)===d)break;for(i=n.eventTimes,y=-1;0<d;){var _=31-Ot(d);v=1<<_,_=i[_],_>y&&(y=_),d&=~v}if(d=y,d=st()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Ov(d/1960))-d,10<d){n.timeoutHandle=Cu($i.bind(null,n,on,Rr),d);break}$i(n,on,Rr);break;case 5:$i(n,on,Rr);break;default:throw Error(r(329))}}}return ln(n,st()),n.callbackNode===l?pp.bind(null,n):null}function vc(n,i){var l=jo;return n.current.memoizedState.isDehydrated&&(Oi(n,i).flags|=256),n=ta(n,i),n!==2&&(i=on,on=l,i!==null&&wc(i)),n}function wc(n){on===null?on=n:on.push.apply(on,n)}function $v(n){for(var i=n;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var d=0;d<l.length;d++){var y=l[d],v=y.getSnapshot;y=y.value;try{if(!Un(v(),y))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===n)break;for(;i.sibling===null;){if(i.return===null||i.return===n)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ai(n,i){for(i&=~mc,i&=~Gl,n.suspendedLanes|=i,n.pingedLanes&=~i,n=n.expirationTimes;0<i;){var l=31-Ot(i),d=1<<l;n[l]=-1,i&=~d}}function mp(n){if((Ge&6)!==0)throw Error(r(327));_s();var i=et(n,0);if((i&1)===0)return ln(n,st()),null;var l=ta(n,i);if(n.tag!==0&&l===2){var d=ji(n);d!==0&&(i=d,l=vc(n,d))}if(l===1)throw l=bo,Oi(n,0),ai(n,i),ln(n,st()),l;if(l===6)throw Error(r(345));return n.finishedWork=n.current.alternate,n.finishedLanes=i,$i(n,on,Rr),ln(n,st()),null}function Sc(n,i){var l=Ge;Ge|=1;try{return n(i)}finally{Ge=l,Ge===0&&(js=st()+500,_l&&ti())}}function Fi(n){oi!==null&&oi.tag===0&&(Ge&6)===0&&_s();var i=Ge;Ge|=1;var l=zn.transition,d=Ke;try{if(zn.transition=null,Ke=1,n)return n()}finally{Ke=d,zn.transition=l,Ge=i,(Ge&6)===0&&ti()}}function kc(){kn=bs.current,lt(bs)}function Oi(n,i){n.finishedWork=null,n.finishedLanes=0;var l=n.timeoutHandle;if(l!==-1&&(n.timeoutHandle=-1,gv(l)),Nt!==null)for(l=Nt.return;l!==null;){var d=l;switch(Pu(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&bl();break;case 3:Ns(),lt(nn),lt(Ut),Uu();break;case 5:Hu(d);break;case 4:Ns();break;case 13:lt(dt);break;case 19:lt(dt);break;case 10:Du(d.type._context);break;case 22:case 23:kc()}l=l.return}if(Rt=n,Nt=n=ui(n.current,null),Bt=kn=i,_t=0,bo=null,mc=Gl=Di=0,on=jo=null,Ri!==null){for(i=0;i<Ri.length;i++)if(l=Ri[i],d=l.interleaved,d!==null){l.interleaved=null;var y=d.next,v=l.pending;if(v!==null){var _=v.next;v.next=y,d.next=_}l.pending=d}Ri=null}return n}function gp(n,i){do{var l=Nt;try{if(Lu(),Fl.current=Hl,Ol){for(var d=ft.memoizedState;d!==null;){var y=d.queue;y!==null&&(y.pending=null),d=d.next}Ol=!1}if(Li=0,Mt=jt=ft=null,wo=!1,So=0,pc.current=null,l===null||l.return===null){_t=1,bo=i,Nt=null;break}e:{var v=n,_=l.return,D=l,X=i;if(i=Bt,D.flags|=32768,X!==null&&typeof X=="object"&&typeof X.then=="function"){var ne=X,de=D,he=de.tag;if((de.mode&1)===0&&(he===0||he===11||he===15)){var ue=de.alternate;ue?(de.updateQueue=ue.updateQueue,de.memoizedState=ue.memoizedState,de.lanes=ue.lanes):(de.updateQueue=null,de.memoizedState=null)}var Se=Bh(_);if(Se!==null){Se.flags&=-257,Hh(Se,_,D,v,i),Se.mode&1&&$h(v,ne,i),i=Se,X=ne;var Ne=i.updateQueue;if(Ne===null){var be=new Set;be.add(X),i.updateQueue=be}else Ne.add(X);break e}else{if((i&1)===0){$h(v,ne,i),Nc();break e}X=Error(r(426))}}else if(at&&D.mode&1){var wt=Bh(_);if(wt!==null){(wt.flags&65536)===0&&(wt.flags|=256),Hh(wt,_,D,v,i),Ru(Es(X,D));break e}}v=X=Es(X,D),_t!==4&&(_t=2),jo===null?jo=[v]:jo.push(v),v=_;do{switch(v.tag){case 3:v.flags|=65536,i&=-i,v.lanes|=i;var ee=Fh(v,X,i);dh(v,ee);break e;case 1:D=X;var G=v.type,te=v.stateNode;if((v.flags&128)===0&&(typeof G.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(si===null||!si.has(te)))){v.flags|=65536,i&=-i,v.lanes|=i;var ye=Oh(v,D,i);dh(v,ye);break e}}v=v.return}while(v!==null)}vp(l)}catch(Ie){i=Ie,Nt===l&&l!==null&&(Nt=l=l.return);continue}break}while(!0)}function yp(){var n=ql.current;return ql.current=Hl,n===null?Hl:n}function Nc(){(_t===0||_t===3||_t===2)&&(_t=4),Rt===null||(Di&268435455)===0&&(Gl&268435455)===0||ai(Rt,Bt)}function ta(n,i){var l=Ge;Ge|=2;var d=yp();(Rt!==n||Bt!==i)&&(Rr=null,Oi(n,i));do try{Bv();break}catch(y){gp(n,y)}while(!0);if(Lu(),Ge=l,ql.current=d,Nt!==null)throw Error(r(261));return Rt=null,Bt=0,_t}function Bv(){for(;Nt!==null;)xp(Nt)}function Hv(){for(;Nt!==null&&!In();)xp(Nt)}function xp(n){var i=kp(n.alternate,n,kn);n.memoizedProps=n.pendingProps,i===null?vp(n):Nt=i,pc.current=null}function vp(n){var i=n;do{var l=i.alternate;if(n=i.return,(i.flags&32768)===0){if(l=Rv(l,i,kn),l!==null){Nt=l;return}}else{if(l=zv(l,i),l!==null){l.flags&=32767,Nt=l;return}if(n!==null)n.flags|=32768,n.subtreeFlags=0,n.deletions=null;else{_t=6,Nt=null;return}}if(i=i.sibling,i!==null){Nt=i;return}Nt=i=n}while(i!==null);_t===0&&(_t=5)}function $i(n,i,l){var d=Ke,y=zn.transition;try{zn.transition=null,Ke=1,Vv(n,i,l,d)}finally{zn.transition=y,Ke=d}return null}function Vv(n,i,l,d){do _s();while(oi!==null);if((Ge&6)!==0)throw Error(r(327));l=n.finishedWork;var y=n.finishedLanes;if(l===null)return null;if(n.finishedWork=null,n.finishedLanes=0,l===n.current)throw Error(r(177));n.callbackNode=null,n.callbackPriority=0;var v=l.lanes|l.childLanes;if(is(n,v),n===Rt&&(Nt=Rt=null,Bt=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Ql||(Ql=!0,Np(Nr,function(){return _s(),null})),v=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||v){v=zn.transition,zn.transition=null;var _=Ke;Ke=1;var D=Ge;Ge|=4,pc.current=null,Dv(n,l),up(l,n),uv(Nu),vt=!!ku,Nu=ku=null,n.current=l,Fv(l),rr(),Ge=D,Ke=_,zn.transition=v}else n.current=l;if(Ql&&(Ql=!1,oi=n,Zl=y),v=n.pendingLanes,v===0&&(si=null),ns(l.stateNode),ln(n,st()),i!==null)for(d=n.onRecoverableError,l=0;l<i.length;l++)y=i[l],d(y.value,{componentStack:y.stack,digest:y.digest});if(Kl)throw Kl=!1,n=yc,yc=null,n;return(Zl&1)!==0&&n.tag!==0&&_s(),v=n.pendingLanes,(v&1)!==0?n===xc?_o++:(_o=0,xc=n):_o=0,ti(),null}function _s(){if(oi!==null){var n=fl(Zl),i=zn.transition,l=Ke;try{if(zn.transition=null,Ke=16>n?16:n,oi===null)var d=!1;else{if(n=oi,oi=null,Zl=0,(Ge&6)!==0)throw Error(r(331));var y=Ge;for(Ge|=4,ke=n.current;ke!==null;){var v=ke,_=v.child;if((ke.flags&16)!==0){var D=v.deletions;if(D!==null){for(var X=0;X<D.length;X++){var ne=D[X];for(ke=ne;ke!==null;){var de=ke;switch(de.tag){case 0:case 11:case 15:Co(8,de,v)}var he=de.child;if(he!==null)he.return=de,ke=he;else for(;ke!==null;){de=ke;var ue=de.sibling,Se=de.return;if(ip(de),de===ne){ke=null;break}if(ue!==null){ue.return=Se,ke=ue;break}ke=Se}}}var Ne=v.alternate;if(Ne!==null){var be=Ne.child;if(be!==null){Ne.child=null;do{var wt=be.sibling;be.sibling=null,be=wt}while(be!==null)}}ke=v}}if((v.subtreeFlags&2064)!==0&&_!==null)_.return=v,ke=_;else e:for(;ke!==null;){if(v=ke,(v.flags&2048)!==0)switch(v.tag){case 0:case 11:case 15:Co(9,v,v.return)}var ee=v.sibling;if(ee!==null){ee.return=v.return,ke=ee;break e}ke=v.return}}var G=n.current;for(ke=G;ke!==null;){_=ke;var te=_.child;if((_.subtreeFlags&2064)!==0&&te!==null)te.return=_,ke=te;else e:for(_=G;ke!==null;){if(D=ke,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Xl(9,D)}}catch(Ie){mt(D,D.return,Ie)}if(D===_){ke=null;break e}var ye=D.sibling;if(ye!==null){ye.return=D.return,ke=ye;break e}ke=D.return}}if(Ge=y,ti(),tn&&typeof tn.onPostCommitFiberRoot=="function")try{tn.onPostCommitFiberRoot(Er,n)}catch{}d=!0}return d}finally{Ke=l,zn.transition=i}}return!1}function wp(n,i,l){i=Es(l,i),i=Fh(n,i,1),n=ri(n,i,1),i=Zt(),n!==null&&(Hn(n,1,i),ln(n,i))}function mt(n,i,l){if(n.tag===3)wp(n,n,l);else for(;i!==null;){if(i.tag===3){wp(i,n,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(si===null||!si.has(d))){n=Es(l,n),n=Oh(i,n,1),i=ri(i,n,1),n=Zt(),i!==null&&(Hn(i,1,n),ln(i,n));break}}i=i.return}}function Uv(n,i,l){var d=n.pingCache;d!==null&&d.delete(i),i=Zt(),n.pingedLanes|=n.suspendedLanes&l,Rt===n&&(Bt&l)===l&&(_t===4||_t===3&&(Bt&130023424)===Bt&&500>st()-gc?Oi(n,0):mc|=l),ln(n,i)}function Sp(n,i){i===0&&((n.mode&1)===0?i=1:(i=Yr,Yr<<=1,(Yr&130023424)===0&&(Yr=4194304)));var l=Zt();n=Pr(n,i),n!==null&&(Hn(n,i,l),ln(n,l))}function Wv(n){var i=n.memoizedState,l=0;i!==null&&(l=i.retryLane),Sp(n,l)}function Yv(n,i){var l=0;switch(n.tag){case 13:var d=n.stateNode,y=n.memoizedState;y!==null&&(l=y.retryLane);break;case 19:d=n.stateNode;break;default:throw Error(r(314))}d!==null&&d.delete(i),Sp(n,l)}var kp;kp=function(n,i,l){if(n!==null)if(n.memoizedProps!==i.pendingProps||nn.current)sn=!0;else{if((n.lanes&l)===0&&(i.flags&128)===0)return sn=!1,Mv(n,i,l);sn=(n.flags&131072)!==0}else sn=!1,at&&(i.flags&1048576)!==0&&th(i,Tl,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;Wl(n,i),n=i.pendingProps;var y=gs(i,Ut.current);ks(i,l),y=Xu(null,i,d,n,y,l);var v=qu();return i.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,rn(d)?(v=!0,jl(i)):v=!1,i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,$u(i),y.updater=Vl,i.stateNode=y,y._reactInternals=i,ec(i,d,n,l),i=ic(null,i,d,!0,v,l)):(i.tag=0,at&&v&&Tu(i),Qt(null,i,y,l),i=i.child),i;case 16:d=i.elementType;e:{switch(Wl(n,i),n=i.pendingProps,y=d._init,d=y(d._payload),i.type=d,y=i.tag=qv(d),n=Yn(d,n),y){case 0:i=rc(null,i,d,n,l);break e;case 1:i=qh(null,i,d,n,l);break e;case 11:i=Vh(null,i,d,n,l);break e;case 14:i=Uh(null,i,d,Yn(d.type,n),l);break e}throw Error(r(306,d,""))}return i;case 0:return d=i.type,y=i.pendingProps,y=i.elementType===d?y:Yn(d,y),rc(n,i,d,y,l);case 1:return d=i.type,y=i.pendingProps,y=i.elementType===d?y:Yn(d,y),qh(n,i,d,y,l);case 3:e:{if(Gh(i),n===null)throw Error(r(387));d=i.pendingProps,v=i.memoizedState,y=v.element,ch(n,i),Ll(i,d,null,l);var _=i.memoizedState;if(d=_.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){y=Es(Error(r(423)),i),i=Kh(n,i,d,l,y);break e}else if(d!==y){y=Es(Error(r(424)),i),i=Kh(n,i,d,l,y);break e}else for(Sn=Zr(i.stateNode.containerInfo.firstChild),wn=i,at=!0,Wn=null,l=ah(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(vs(),d===y){i=Mr(n,i,l);break e}Qt(n,i,d,l)}i=i.child}return i;case 5:return hh(i),n===null&&Mu(i),d=i.type,y=i.pendingProps,v=n!==null?n.memoizedProps:null,_=y.children,Eu(d,y)?_=null:v!==null&&Eu(d,v)&&(i.flags|=32),Xh(n,i),Qt(n,i,_,l),i.child;case 6:return n===null&&Mu(i),null;case 13:return Qh(n,i,l);case 4:return Bu(i,i.stateNode.containerInfo),d=i.pendingProps,n===null?i.child=ws(i,null,d,l):Qt(n,i,d,l),i.child;case 11:return d=i.type,y=i.pendingProps,y=i.elementType===d?y:Yn(d,y),Vh(n,i,d,y,l);case 7:return Qt(n,i,i.pendingProps,l),i.child;case 8:return Qt(n,i,i.pendingProps.children,l),i.child;case 12:return Qt(n,i,i.pendingProps.children,l),i.child;case 10:e:{if(d=i.type._context,y=i.pendingProps,v=i.memoizedProps,_=y.value,nt(Ml,d._currentValue),d._currentValue=_,v!==null)if(Un(v.value,_)){if(v.children===y.children&&!nn.current){i=Mr(n,i,l);break e}}else for(v=i.child,v!==null&&(v.return=i);v!==null;){var D=v.dependencies;if(D!==null){_=v.child;for(var X=D.firstContext;X!==null;){if(X.context===d){if(v.tag===1){X=Ar(-1,l&-l),X.tag=2;var ne=v.updateQueue;if(ne!==null){ne=ne.shared;var de=ne.pending;de===null?X.next=X:(X.next=de.next,de.next=X),ne.pending=X}}v.lanes|=l,X=v.alternate,X!==null&&(X.lanes|=l),Fu(v.return,l,i),D.lanes|=l;break}X=X.next}}else if(v.tag===10)_=v.type===i.type?null:v.child;else if(v.tag===18){if(_=v.return,_===null)throw Error(r(341));_.lanes|=l,D=_.alternate,D!==null&&(D.lanes|=l),Fu(_,l,i),_=v.sibling}else _=v.child;if(_!==null)_.return=v;else for(_=v;_!==null;){if(_===i){_=null;break}if(v=_.sibling,v!==null){v.return=_.return,_=v;break}_=_.return}v=_}Qt(n,i,y.children,l),i=i.child}return i;case 9:return y=i.type,d=i.pendingProps.children,ks(i,l),y=Mn(y),d=d(y),i.flags|=1,Qt(n,i,d,l),i.child;case 14:return d=i.type,y=Yn(d,i.pendingProps),y=Yn(d.type,y),Uh(n,i,d,y,l);case 15:return Wh(n,i,i.type,i.pendingProps,l);case 17:return d=i.type,y=i.pendingProps,y=i.elementType===d?y:Yn(d,y),Wl(n,i),i.tag=1,rn(d)?(n=!0,jl(i)):n=!1,ks(i,l),Lh(i,d,y),ec(i,d,y,l),ic(null,i,d,!0,n,l);case 19:return Jh(n,i,l);case 22:return Yh(n,i,l)}throw Error(r(156,i.tag))};function Np(n,i){return Ni(n,i)}function Xv(n,i,l,d){this.tag=n,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ln(n,i,l,d){return new Xv(n,i,l,d)}function Ec(n){return n=n.prototype,!(!n||!n.isReactComponent)}function qv(n){if(typeof n=="function")return Ec(n)?1:0;if(n!=null){if(n=n.$$typeof,n===W)return 11;if(n===O)return 14}return 2}function ui(n,i){var l=n.alternate;return l===null?(l=Ln(n.tag,i,n.key,n.mode),l.elementType=n.elementType,l.type=n.type,l.stateNode=n.stateNode,l.alternate=n,n.alternate=l):(l.pendingProps=i,l.type=n.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=n.flags&14680064,l.childLanes=n.childLanes,l.lanes=n.lanes,l.child=n.child,l.memoizedProps=n.memoizedProps,l.memoizedState=n.memoizedState,l.updateQueue=n.updateQueue,i=n.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=n.sibling,l.index=n.index,l.ref=n.ref,l}function na(n,i,l,d,y,v){var _=2;if(d=n,typeof n=="function")Ec(n)&&(_=1);else if(typeof n=="string")_=5;else e:switch(n){case $:return Bi(l.children,y,v,i);case Q:_=8,y|=8;break;case U:return n=Ln(12,l,i,y|2),n.elementType=U,n.lanes=v,n;case J:return n=Ln(13,l,i,y),n.elementType=J,n.lanes=v,n;case P:return n=Ln(19,l,i,y),n.elementType=P,n.lanes=v,n;case K:return ra(l,y,v,i);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case q:_=10;break e;case L:_=9;break e;case W:_=11;break e;case O:_=14;break e;case F:_=16,d=null;break e}throw Error(r(130,n==null?n:typeof n,""))}return i=Ln(_,l,i,y),i.elementType=n,i.type=d,i.lanes=v,i}function Bi(n,i,l,d){return n=Ln(7,n,d,i),n.lanes=l,n}function ra(n,i,l,d){return n=Ln(22,n,d,i),n.elementType=K,n.lanes=l,n.stateNode={isHidden:!1},n}function Cc(n,i,l){return n=Ln(6,n,null,i),n.lanes=l,n}function bc(n,i,l){return i=Ln(4,n.children!==null?n.children:[],n.key,i),i.lanes=l,i.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},i}function Gv(n,i,l,d,y){this.tag=i,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_i(0),this.expirationTimes=_i(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_i(0),this.identifierPrefix=d,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function jc(n,i,l,d,y,v,_,D,X){return n=new Gv(n,i,l,D,X),i===1?(i=1,v===!0&&(i|=8)):i=0,v=Ln(3,null,null,i),n.current=v,v.stateNode=n,v.memoizedState={element:d,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},$u(v),n}function Kv(n,i,l){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:d==null?null:""+d,children:n,containerInfo:i,implementation:l}}function Ep(n){if(!n)return ei;n=n._reactInternals;e:{if(Ft(n)!==n||n.tag!==1)throw Error(r(170));var i=n;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(rn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(r(171))}if(n.tag===1){var l=n.type;if(rn(l))return Zf(n,l,i)}return i}function Cp(n,i,l,d,y,v,_,D,X){return n=jc(l,d,!0,n,y,v,_,D,X),n.context=Ep(null),l=n.current,d=Zt(),y=li(l),v=Ar(d,y),v.callback=i??null,ri(l,v,y),n.current.lanes=y,Hn(n,y,d),ln(n,d),n}function ia(n,i,l,d){var y=i.current,v=Zt(),_=li(y);return l=Ep(l),i.context===null?i.context=l:i.pendingContext=l,i=Ar(v,_),i.payload={element:n},d=d===void 0?null:d,d!==null&&(i.callback=d),n=ri(y,i,_),n!==null&&(Gn(n,y,_,v),zl(n,y,_)),_}function sa(n){if(n=n.current,!n.child)return null;switch(n.child.tag){case 5:return n.child.stateNode;default:return n.child.stateNode}}function bp(n,i){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var l=n.retryLane;n.retryLane=l!==0&&l<i?l:i}}function _c(n,i){bp(n,i),(n=n.alternate)&&bp(n,i)}function Qv(){return null}var jp=typeof reportError=="function"?reportError:function(n){console.error(n)};function Ic(n){this._internalRoot=n}oa.prototype.render=Ic.prototype.render=function(n){var i=this._internalRoot;if(i===null)throw Error(r(409));ia(n,i,null,null)},oa.prototype.unmount=Ic.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var i=n.containerInfo;Fi(function(){ia(null,n,null,null)}),i[jr]=null}};function oa(n){this._internalRoot=n}oa.prototype.unstable_scheduleHydration=function(n){if(n){var i=Gr();n={blockedOn:null,target:n,priority:i};for(var l=0;l<Vn.length&&i!==0&&i<Vn[l].priority;l++);Vn.splice(l,0,n),l===0&&oe(n)}};function Tc(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function la(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11&&(n.nodeType!==8||n.nodeValue!==" react-mount-point-unstable "))}function _p(){}function Zv(n,i,l,d,y){if(y){if(typeof d=="function"){var v=d;d=function(){var ne=sa(_);v.call(ne)}}var _=Cp(i,d,n,0,null,!1,!1,"",_p);return n._reactRootContainer=_,n[jr]=_.current,fo(n.nodeType===8?n.parentNode:n),Fi(),_}for(;y=n.lastChild;)n.removeChild(y);if(typeof d=="function"){var D=d;d=function(){var ne=sa(X);D.call(ne)}}var X=jc(n,0,!1,null,null,!1,!1,"",_p);return n._reactRootContainer=X,n[jr]=X.current,fo(n.nodeType===8?n.parentNode:n),Fi(function(){ia(i,X,l,d)}),X}function aa(n,i,l,d,y){var v=l._reactRootContainer;if(v){var _=v;if(typeof y=="function"){var D=y;y=function(){var X=sa(_);D.call(X)}}ia(i,_,n,y)}else _=Zv(l,i,n,y,d);return sa(_)}Js=function(n){switch(n.tag){case 3:var i=n.stateNode;if(i.current.memoizedState.isDehydrated){var l=Gt(i.pendingLanes);l!==0&&(ss(i,l|1),ln(i,st()),(Ge&6)===0&&(js=st()+500,ti()))}break;case 13:Fi(function(){var d=Pr(n,1);if(d!==null){var y=Zt();Gn(d,n,1,y)}}),_c(n,1)}},os=function(n){if(n.tag===13){var i=Pr(n,134217728);if(i!==null){var l=Zt();Gn(i,n,134217728,l)}_c(n,134217728)}},eo=function(n){if(n.tag===13){var i=li(n),l=Pr(n,i);if(l!==null){var d=Zt();Gn(l,n,i,d)}_c(n,i)}},Gr=function(){return Ke},hl=function(n,i){var l=Ke;try{return Ke=n,i()}finally{Ke=l}},$r=function(n,i,l){switch(i){case"input":if(tt(n,l),i=l.name,l.type==="radio"&&i!=null){for(l=n;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==n&&d.form===n.form){var y=Cl(d);if(!y)throw Error(r(90));Ee(d),tt(d,y)}}}break;case"textarea":mn(n,l);break;case"select":i=l.value,i!=null&&Tt(n,!!l.multiple,i,!1)}},wi=Sc,On=Fi;var Jv={usingClientEntryPoint:!1,Events:[mo,ps,Cl,yn,Br,Sc]},Io={findFiberByHostInstance:Ti,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ew={bundleType:Io.bundleType,version:Io.version,rendererPackageName:Io.rendererPackageName,rendererConfig:Io.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:I.ReactCurrentDispatcher,findHostInstanceByFiber:function(n){return n=ki(n),n===null?null:n.stateNode},findFiberByHostInstance:Io.findFiberByHostInstance||Qv,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 ua=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ua.isDisabled&&ua.supportsFiber)try{Er=ua.inject(ew),tn=ua}catch{}}return an.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Jv,an.createPortal=function(n,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tc(i))throw Error(r(200));return Kv(n,i,null,l)},an.createRoot=function(n,i){if(!Tc(n))throw Error(r(299));var l=!1,d="",y=jp;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(y=i.onRecoverableError)),i=jc(n,1,!1,null,null,l,!1,d,y),n[jr]=i.current,fo(n.nodeType===8?n.parentNode:n),new Ic(i)},an.findDOMNode=function(n){if(n==null)return null;if(n.nodeType===1)return n;var i=n._reactInternals;if(i===void 0)throw typeof n.render=="function"?Error(r(188)):(n=Object.keys(n).join(","),Error(r(268,n)));return n=ki(i),n=n===null?null:n.stateNode,n},an.flushSync=function(n){return Fi(n)},an.hydrate=function(n,i,l){if(!la(i))throw Error(r(200));return aa(null,n,i,!0,l)},an.hydrateRoot=function(n,i,l){if(!Tc(n))throw Error(r(405));var d=l!=null&&l.hydratedSources||null,y=!1,v="",_=jp;if(l!=null&&(l.unstable_strictMode===!0&&(y=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onRecoverableError!==void 0&&(_=l.onRecoverableError)),i=Cp(i,null,n,1,l??null,y,!1,v,_),n[jr]=i.current,fo(n),d)for(n=0;n<d.length;n++)l=d[n],y=l._getVersion,y=y(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,y]:i.mutableSourceEagerHydrationData.push(l,y);return new oa(i)},an.render=function(n,i,l){if(!la(i))throw Error(r(200));return aa(null,n,i,!1,l)},an.unmountComponentAtNode=function(n){if(!la(n))throw Error(r(40));return n._reactRootContainer?(Fi(function(){aa(null,null,n,!1,function(){n._reactRootContainer=null,n[jr]=null})}),!0):!1},an.unstable_batchedUpdates=Sc,an.unstable_renderSubtreeIntoContainer=function(n,i,l,d){if(!la(l))throw Error(r(200));if(n==null||n._reactInternals===void 0)throw Error(r(38));return aa(n,i,l,!1,d)},an.version="18.3.1-next-f1338f8080-20240426",an}var Lp;function Vg(){if(Lp)return Mc.exports;Lp=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Mc.exports=lw(),Mc.exports}var Dp;function aw(){if(Dp)return ca;Dp=1;var e=Vg();return ca.createRoot=e.createRoot,ca.hydrateRoot=e.hydrateRoot,ca}var uw=aw();const cw=tl(uw);function Ct(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,s;r<e.length;r++)(s=Ct(e[r]))!==""&&(t+=(t&&" ")+s);else for(let r in e)e[r]&&(t+=(t&&" ")+r);return t}var dw={value:()=>{}};function Va(){for(var e=0,t=arguments.length,r={},s;e<t;++e){if(!(s=arguments[e]+"")||s in r||/[\s.]/.test(s))throw new Error("illegal type: "+s);r[s]=[]}return new Na(r)}function Na(e){this._=e}function fw(e,t){return e.trim().split(/^|\s+/).map(function(r){var s="",o=r.indexOf(".");if(o>=0&&(s=r.slice(o+1),r=r.slice(0,o)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:s}})}Na.prototype=Va.prototype={constructor:Na,on:function(e,t){var r=this._,s=fw(e+"",r),o,a=-1,u=s.length;if(arguments.length<2){for(;++a<u;)if((o=(e=s[a]).type)&&(o=hw(r[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<u;)if(o=(e=s[a]).type)r[o]=Fp(r[o],e.name,t);else if(t==null)for(o in r)r[o]=Fp(r[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Na(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var r=new Array(o),s=0,o,a;s<o;++s)r[s]=arguments[s+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],s=0,o=a.length;s<o;++s)a[s].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var s=this._[e],o=0,a=s.length;o<a;++o)s[o].value.apply(t,r)}};function hw(e,t){for(var r=0,s=e.length,o;r<s;++r)if((o=e[r]).name===t)return o.value}function Fp(e,t,r){for(var s=0,o=e.length;s<o;++s)if(e[s].name===t){e[s]=dw,e=e.slice(0,s).concat(e.slice(s+1));break}return r!=null&&e.push({name:t,value:r}),e}var ud="http://www.w3.org/1999/xhtml";const Op={svg:"http://www.w3.org/2000/svg",xhtml:ud,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ua(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),Op.hasOwnProperty(t)?{space:Op[t],local:e}:e}function pw(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===ud&&t.documentElement.namespaceURI===ud?t.createElement(e):t.createElementNS(r,e)}}function mw(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ug(e){var t=Ua(e);return(t.local?mw:pw)(t)}function gw(){}function Rd(e){return e==null?gw:function(){return this.querySelector(e)}}function yw(e){typeof e!="function"&&(e=Rd(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=new Array(u),h,p,m=0;m<u;++m)(h=a[m])&&(p=e.call(h,h.__data__,m,a))&&("__data__"in h&&(p.__data__=h.__data__),c[m]=p);return new jn(s,this._parents)}function xw(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function vw(){return[]}function Wg(e){return e==null?vw:function(){return this.querySelectorAll(e)}}function ww(e){return function(){return xw(e.apply(this,arguments))}}function Sw(e){typeof e=="function"?e=ww(e):e=Wg(e);for(var t=this._groups,r=t.length,s=[],o=[],a=0;a<r;++a)for(var u=t[a],c=u.length,h,p=0;p<c;++p)(h=u[p])&&(s.push(e.call(h,h.__data__,p,u)),o.push(h));return new jn(s,o)}function Yg(e){return function(){return this.matches(e)}}function Xg(e){return function(t){return t.matches(e)}}var kw=Array.prototype.find;function Nw(e){return function(){return kw.call(this.children,e)}}function Ew(){return this.firstElementChild}function Cw(e){return this.select(e==null?Ew:Nw(typeof e=="function"?e:Xg(e)))}var bw=Array.prototype.filter;function jw(){return Array.from(this.children)}function _w(e){return function(){return bw.call(this.children,e)}}function Iw(e){return this.selectAll(e==null?jw:_w(typeof e=="function"?e:Xg(e)))}function Tw(e){typeof e!="function"&&(e=Yg(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=[],h,p=0;p<u;++p)(h=a[p])&&e.call(h,h.__data__,p,a)&&c.push(h);return new jn(s,this._parents)}function qg(e){return new Array(e.length)}function Pw(){return new jn(this._enter||this._groups.map(qg),this._parents)}function Ia(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ia.prototype={constructor:Ia,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 Aw(e){return function(){return e}}function Mw(e,t,r,s,o,a){for(var u=0,c,h=t.length,p=a.length;u<p;++u)(c=t[u])?(c.__data__=a[u],s[u]=c):r[u]=new Ia(e,a[u]);for(;u<h;++u)(c=t[u])&&(o[u]=c)}function Rw(e,t,r,s,o,a,u){var c,h,p=new Map,m=t.length,g=a.length,x=new Array(m),w;for(c=0;c<m;++c)(h=t[c])&&(x[c]=w=u.call(h,h.__data__,c,t)+"",p.has(w)?o[c]=h:p.set(w,h));for(c=0;c<g;++c)w=u.call(e,a[c],c,a)+"",(h=p.get(w))?(s[c]=h,h.__data__=a[c],p.delete(w)):r[c]=new Ia(e,a[c]);for(c=0;c<m;++c)(h=t[c])&&p.get(x[c])===h&&(o[c]=h)}function zw(e){return e.__data__}function Lw(e,t){if(!arguments.length)return Array.from(this,zw);var r=t?Rw:Mw,s=this._parents,o=this._groups;typeof e!="function"&&(e=Aw(e));for(var a=o.length,u=new Array(a),c=new Array(a),h=new Array(a),p=0;p<a;++p){var m=s[p],g=o[p],x=g.length,w=Dw(e.call(m,m&&m.__data__,p,s)),k=w.length,E=c[p]=new Array(k),C=u[p]=new Array(k),S=h[p]=new Array(x);r(m,g,E,C,S,w,t);for(var b=0,N=0,I,B;b<k;++b)if(I=E[b]){for(b>=N&&(N=b+1);!(B=C[N])&&++N<k;);I._next=B||null}}return u=new jn(u,s),u._enter=c,u._exit=h,u}function Dw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fw(){return new jn(this._exit||this._groups.map(qg),this._parents)}function Ow(e,t,r){var s=this.enter(),o=this,a=this.exit();return typeof e=="function"?(s=e(s),s&&(s=s.selection())):s=s.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),r==null?a.remove():r(a),s&&o?s.merge(o).order():o}function $w(e){for(var t=e.selection?e.selection():e,r=this._groups,s=t._groups,o=r.length,a=s.length,u=Math.min(o,a),c=new Array(o),h=0;h<u;++h)for(var p=r[h],m=s[h],g=p.length,x=c[h]=new Array(g),w,k=0;k<g;++k)(w=p[k]||m[k])&&(x[k]=w);for(;h<o;++h)c[h]=r[h];return new jn(c,this._parents)}function Bw(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var s=e[t],o=s.length-1,a=s[o],u;--o>=0;)(u=s[o])&&(a&&u.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(u,a),a=u);return this}function Hw(e){e||(e=Vw);function t(g,x){return g&&x?e(g.__data__,x.__data__):!g-!x}for(var r=this._groups,s=r.length,o=new Array(s),a=0;a<s;++a){for(var u=r[a],c=u.length,h=o[a]=new Array(c),p,m=0;m<c;++m)(p=u[m])&&(h[m]=p);h.sort(t)}return new jn(o,this._parents).order()}function Vw(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Uw(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ww(){return Array.from(this)}function Yw(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length;o<a;++o){var u=s[o];if(u)return u}return null}function Xw(){let e=0;for(const t of this)++e;return e}function qw(){return!this.node()}function Gw(e){for(var t=this._groups,r=0,s=t.length;r<s;++r)for(var o=t[r],a=0,u=o.length,c;a<u;++a)(c=o[a])&&e.call(c,c.__data__,a,o);return this}function Kw(e){return function(){this.removeAttribute(e)}}function Qw(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Zw(e,t){return function(){this.setAttribute(e,t)}}function Jw(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function e1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function t1(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function n1(e,t){var r=Ua(e);if(arguments.length<2){var s=this.node();return r.local?s.getAttributeNS(r.space,r.local):s.getAttribute(r)}return this.each((t==null?r.local?Qw:Kw:typeof t=="function"?r.local?t1:e1:r.local?Jw:Zw)(r,t))}function Gg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function r1(e){return function(){this.style.removeProperty(e)}}function i1(e,t,r){return function(){this.style.setProperty(e,t,r)}}function s1(e,t,r){return function(){var s=t.apply(this,arguments);s==null?this.style.removeProperty(e):this.style.setProperty(e,s,r)}}function o1(e,t,r){return arguments.length>1?this.each((t==null?r1:typeof t=="function"?s1:i1)(e,t,r??"")):Hs(this.node(),e)}function Hs(e,t){return e.style.getPropertyValue(t)||Gg(e).getComputedStyle(e,null).getPropertyValue(t)}function l1(e){return function(){delete this[e]}}function a1(e,t){return function(){this[e]=t}}function u1(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function c1(e,t){return arguments.length>1?this.each((t==null?l1:typeof t=="function"?u1:a1)(e,t)):this.node()[e]}function Kg(e){return e.trim().split(/^|\s+/)}function zd(e){return e.classList||new Qg(e)}function Qg(e){this._node=e,this._names=Kg(e.getAttribute("class")||"")}Qg.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 Zg(e,t){for(var r=zd(e),s=-1,o=t.length;++s<o;)r.add(t[s])}function Jg(e,t){for(var r=zd(e),s=-1,o=t.length;++s<o;)r.remove(t[s])}function d1(e){return function(){Zg(this,e)}}function f1(e){return function(){Jg(this,e)}}function h1(e,t){return function(){(t.apply(this,arguments)?Zg:Jg)(this,e)}}function p1(e,t){var r=Kg(e+"");if(arguments.length<2){for(var s=zd(this.node()),o=-1,a=r.length;++o<a;)if(!s.contains(r[o]))return!1;return!0}return this.each((typeof t=="function"?h1:t?d1:f1)(r,t))}function m1(){this.textContent=""}function g1(e){return function(){this.textContent=e}}function y1(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function x1(e){return arguments.length?this.each(e==null?m1:(typeof e=="function"?y1:g1)(e)):this.node().textContent}function v1(){this.innerHTML=""}function w1(e){return function(){this.innerHTML=e}}function S1(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function k1(e){return arguments.length?this.each(e==null?v1:(typeof e=="function"?S1:w1)(e)):this.node().innerHTML}function N1(){this.nextSibling&&this.parentNode.appendChild(this)}function E1(){return this.each(N1)}function C1(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function b1(){return this.each(C1)}function j1(e){var t=typeof e=="function"?e:Ug(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function _1(){return null}function I1(e,t){var r=typeof e=="function"?e:Ug(e),s=t==null?_1:typeof t=="function"?t:Rd(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),s.apply(this,arguments)||null)})}function T1(){var e=this.parentNode;e&&e.removeChild(this)}function P1(){return this.each(T1)}function A1(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function M1(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function R1(e){return this.select(e?M1:A1)}function z1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function L1(e){return function(t){e.call(this,t,this.__data__)}}function D1(e){return e.trim().split(/^|\s+/).map(function(t){var r="",s=t.indexOf(".");return s>=0&&(r=t.slice(s+1),t=t.slice(0,s)),{type:t,name:r}})}function F1(e){return function(){var t=this.__on;if(t){for(var r=0,s=-1,o=t.length,a;r<o;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++s]=a;++s?t.length=s:delete this.__on}}}function O1(e,t,r){return function(){var s=this.__on,o,a=L1(t);if(s){for(var u=0,c=s.length;u<c;++u)if((o=s[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=a,o.options=r),o.value=t;return}}this.addEventListener(e.type,a,r),o={type:e.type,name:e.name,value:t,listener:a,options:r},s?s.push(o):this.__on=[o]}}function $1(e,t,r){var s=D1(e+""),o,a=s.length,u;if(arguments.length<2){var c=this.node().__on;if(c){for(var h=0,p=c.length,m;h<p;++h)for(o=0,m=c[h];o<a;++o)if((u=s[o]).type===m.type&&u.name===m.name)return m.value}return}for(c=t?O1:F1,o=0;o<a;++o)this.each(c(s[o],t,r));return this}function ey(e,t,r){var s=Gg(e),o=s.CustomEvent;typeof o=="function"?o=new o(t,r):(o=s.document.createEvent("Event"),r?(o.initEvent(t,r.bubbles,r.cancelable),o.detail=r.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function B1(e,t){return function(){return ey(this,e,t)}}function H1(e,t){return function(){return ey(this,e,t.apply(this,arguments))}}function V1(e,t){return this.each((typeof t=="function"?H1:B1)(e,t))}function*U1(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var s=e[t],o=0,a=s.length,u;o<a;++o)(u=s[o])&&(yield u)}var ty=[null];function jn(e,t){this._groups=e,this._parents=t}function rl(){return new jn([[document.documentElement]],ty)}function W1(){return this}jn.prototype=rl.prototype={constructor:jn,select:yw,selectAll:Sw,selectChild:Cw,selectChildren:Iw,filter:Tw,data:Lw,enter:Pw,exit:Fw,join:Ow,merge:$w,selection:W1,order:Bw,sort:Hw,call:Uw,nodes:Ww,node:Yw,size:Xw,empty:qw,each:Gw,attr:n1,style:o1,property:c1,classed:p1,text:x1,html:k1,raise:E1,lower:b1,append:j1,insert:I1,remove:P1,clone:R1,datum:z1,on:$1,dispatch:V1,[Symbol.iterator]:U1};function Cn(e){return typeof e=="string"?new jn([[document.querySelector(e)]],[document.documentElement]):new jn([[e]],ty)}function Y1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kn(e,t){if(e=Y1(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var s=r.createSVGPoint();return s.x=e.clientX,s.y=e.clientY,s=s.matrixTransform(t.getScreenCTM().inverse()),[s.x,s.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const X1={passive:!1},Uo={capture:!0,passive:!1};function Lc(e){e.stopImmediatePropagation()}function Fs(e){e.preventDefault(),e.stopImmediatePropagation()}function ny(e){var t=e.document.documentElement,r=Cn(e).on("dragstart.drag",Fs,Uo);"onselectstart"in t?r.on("selectstart.drag",Fs,Uo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ry(e,t){var r=e.document.documentElement,s=Cn(e).on("dragstart.drag",null);t&&(s.on("click.drag",Fs,Uo),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in r?s.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}const da=e=>()=>e;function cd(e,{sourceEvent:t,subject:r,target:s,identifier:o,active:a,x:u,y:c,dx:h,dy:p,dispatch:m}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:m}})}cd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function q1(e){return!e.ctrlKey&&!e.button}function G1(){return this.parentNode}function K1(e,t){return t??{x:e.x,y:e.y}}function Q1(){return navigator.maxTouchPoints||"ontouchstart"in this}function iy(){var e=q1,t=G1,r=K1,s=Q1,o={},a=Va("start","drag","end"),u=0,c,h,p,m,g=0;function x(I){I.on("mousedown.drag",w).filter(s).on("touchstart.drag",C).on("touchmove.drag",S,X1).on("touchend.drag touchcancel.drag",b).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(I,B){if(!(m||!e.call(this,I,B))){var T=N(this,t.call(this,I,B),I,B,"mouse");T&&(Cn(I.view).on("mousemove.drag",k,Uo).on("mouseup.drag",E,Uo),ny(I.view),Lc(I),p=!1,c=I.clientX,h=I.clientY,T("start",I))}}function k(I){if(Fs(I),!p){var B=I.clientX-c,T=I.clientY-h;p=B*B+T*T>g}o.mouse("drag",I)}function E(I){Cn(I.view).on("mousemove.drag mouseup.drag",null),ry(I.view,p),Fs(I),o.mouse("end",I)}function C(I,B){if(e.call(this,I,B)){var T=I.changedTouches,$=t.call(this,I,B),Q=T.length,U,q;for(U=0;U<Q;++U)(q=N(this,$,I,B,T[U].identifier,T[U]))&&(Lc(I),q("start",I,T[U]))}}function S(I){var B=I.changedTouches,T=B.length,$,Q;for($=0;$<T;++$)(Q=o[B[$].identifier])&&(Fs(I),Q("drag",I,B[$]))}function b(I){var B=I.changedTouches,T=B.length,$,Q;for(m&&clearTimeout(m),m=setTimeout(function(){m=null},500),$=0;$<T;++$)(Q=o[B[$].identifier])&&(Lc(I),Q("end",I,B[$]))}function N(I,B,T,$,Q,U){var q=a.copy(),L=Kn(U||T,B),W,J,P;if((P=r.call(I,new cd("beforestart",{sourceEvent:T,target:x,identifier:Q,active:u,x:L[0],y:L[1],dx:0,dy:0,dispatch:q}),$))!=null)return W=P.x-L[0]||0,J=P.y-L[1]||0,function O(F,K,R){var V=L,j;switch(F){case"start":o[Q]=O,j=u++;break;case"end":delete o[Q],--u;case"drag":L=Kn(R||K,B),j=u;break}q.call(F,I,new cd(F,{sourceEvent:K,subject:P,target:x,identifier:Q,active:j,x:L[0]+W,y:L[1]+J,dx:L[0]-V[0],dy:L[1]-V[1],dispatch:q}),$)}}return x.filter=function(I){return arguments.length?(e=typeof I=="function"?I:da(!!I),x):e},x.container=function(I){return arguments.length?(t=typeof I=="function"?I:da(I),x):t},x.subject=function(I){return arguments.length?(r=typeof I=="function"?I:da(I),x):r},x.touchable=function(I){return arguments.length?(s=typeof I=="function"?I:da(!!I),x):s},x.on=function(){var I=a.on.apply(a,arguments);return I===a?x:I},x.clickDistance=function(I){return arguments.length?(g=(I=+I)*I,x):Math.sqrt(g)},x}function Ld(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function sy(e,t){var r=Object.create(e.prototype);for(var s in t)r[s]=t[s];return r}function il(){}var Wo=.7,Ta=1/Wo,Os="\\s*([+-]?\\d+)\\s*",Yo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",pr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Z1=/^#([0-9a-f]{3,8})$/,J1=new RegExp(`^rgb\\(${Os},${Os},${Os}\\)$`),eS=new RegExp(`^rgb\\(${pr},${pr},${pr}\\)$`),tS=new RegExp(`^rgba\\(${Os},${Os},${Os},${Yo}\\)$`),nS=new RegExp(`^rgba\\(${pr},${pr},${pr},${Yo}\\)$`),rS=new RegExp(`^hsl\\(${Yo},${pr},${pr}\\)$`),iS=new RegExp(`^hsla\\(${Yo},${pr},${pr},${Yo}\\)$`),$p={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};Ld(il,Yi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Bp,formatHex:Bp,formatHex8:sS,formatHsl:oS,formatRgb:Hp,toString:Hp});function Bp(){return this.rgb().formatHex()}function sS(){return this.rgb().formatHex8()}function oS(){return oy(this).formatHsl()}function Hp(){return this.rgb().formatRgb()}function Yi(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Z1.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?Vp(t):r===3?new cn(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?fa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?fa(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=J1.exec(e))?new cn(t[1],t[2],t[3],1):(t=eS.exec(e))?new cn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=tS.exec(e))?fa(t[1],t[2],t[3],t[4]):(t=nS.exec(e))?fa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=rS.exec(e))?Yp(t[1],t[2]/100,t[3]/100,1):(t=iS.exec(e))?Yp(t[1],t[2]/100,t[3]/100,t[4]):$p.hasOwnProperty(e)?Vp($p[e]):e==="transparent"?new cn(NaN,NaN,NaN,0):null}function Vp(e){return new cn(e>>16&255,e>>8&255,e&255,1)}function fa(e,t,r,s){return s<=0&&(e=t=r=NaN),new cn(e,t,r,s)}function lS(e){return e instanceof il||(e=Yi(e)),e?(e=e.rgb(),new cn(e.r,e.g,e.b,e.opacity)):new cn}function dd(e,t,r,s){return arguments.length===1?lS(e):new cn(e,t,r,s??1)}function cn(e,t,r,s){this.r=+e,this.g=+t,this.b=+r,this.opacity=+s}Ld(cn,dd,sy(il,{brighter(e){return e=e==null?Ta:Math.pow(Ta,e),new cn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Wo:Math.pow(Wo,e),new cn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new cn(Ui(this.r),Ui(this.g),Ui(this.b),Pa(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:Up,formatHex:Up,formatHex8:aS,formatRgb:Wp,toString:Wp}));function Up(){return`#${Vi(this.r)}${Vi(this.g)}${Vi(this.b)}`}function aS(){return`#${Vi(this.r)}${Vi(this.g)}${Vi(this.b)}${Vi((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wp(){const e=Pa(this.opacity);return`${e===1?"rgb(":"rgba("}${Ui(this.r)}, ${Ui(this.g)}, ${Ui(this.b)}${e===1?")":`, ${e})`}`}function Pa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ui(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Vi(e){return e=Ui(e),(e<16?"0":"")+e.toString(16)}function Yp(e,t,r,s){return s<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Qn(e,t,r,s)}function oy(e){if(e instanceof Qn)return new Qn(e.h,e.s,e.l,e.opacity);if(e instanceof il||(e=Yi(e)),!e)return new Qn;if(e instanceof Qn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,s=e.b/255,o=Math.min(t,r,s),a=Math.max(t,r,s),u=NaN,c=a-o,h=(a+o)/2;return c?(t===a?u=(r-s)/c+(r<s)*6:r===a?u=(s-t)/c+2:u=(t-r)/c+4,c/=h<.5?a+o:2-a-o,u*=60):c=h>0&&h<1?0:u,new Qn(u,c,h,e.opacity)}function uS(e,t,r,s){return arguments.length===1?oy(e):new Qn(e,t,r,s??1)}function Qn(e,t,r,s){this.h=+e,this.s=+t,this.l=+r,this.opacity=+s}Ld(Qn,uS,sy(il,{brighter(e){return e=e==null?Ta:Math.pow(Ta,e),new Qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Wo:Math.pow(Wo,e),new Qn(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,r=this.l,s=r+(r<.5?r:1-r)*t,o=2*r-s;return new cn(Dc(e>=240?e-240:e+120,o,s),Dc(e,o,s),Dc(e<120?e+240:e-120,o,s),this.opacity)},clamp(){return new Qn(Xp(this.h),ha(this.s),ha(this.l),Pa(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=Pa(this.opacity);return`${e===1?"hsl(":"hsla("}${Xp(this.h)}, ${ha(this.s)*100}%, ${ha(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Xp(e){return e=(e||0)%360,e<0?e+360:e}function ha(e){return Math.max(0,Math.min(1,e||0))}function Dc(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Dd=e=>()=>e;function cS(e,t){return function(r){return e+r*t}}function dS(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(s){return Math.pow(e+s*t,r)}}function fS(e){return(e=+e)==1?ly:function(t,r){return r-t?dS(t,r,e):Dd(isNaN(t)?r:t)}}function ly(e,t){var r=t-e;return r?cS(e,r):Dd(isNaN(e)?t:e)}const Aa=(function e(t){var r=fS(t);function s(o,a){var u=r((o=dd(o)).r,(a=dd(a)).r),c=r(o.g,a.g),h=r(o.b,a.b),p=ly(o.opacity,a.opacity);return function(m){return o.r=u(m),o.g=c(m),o.b=h(m),o.opacity=p(m),o+""}}return s.gamma=e,s})(1);function hS(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,s=t.slice(),o;return function(a){for(o=0;o<r;++o)s[o]=e[o]*(1-a)+t[o]*a;return s}}function pS(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mS(e,t){var r=t?t.length:0,s=e?Math.min(r,e.length):0,o=new Array(s),a=new Array(r),u;for(u=0;u<s;++u)o[u]=Oo(e[u],t[u]);for(;u<r;++u)a[u]=t[u];return function(c){for(u=0;u<s;++u)a[u]=o[u](c);return a}}function gS(e,t){var r=new Date;return e=+e,t=+t,function(s){return r.setTime(e*(1-s)+t*s),r}}function fr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function yS(e,t){var r={},s={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?r[o]=Oo(e[o],t[o]):s[o]=t[o];return function(a){for(o in r)s[o]=r[o](a);return s}}var fd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Fc=new RegExp(fd.source,"g");function xS(e){return function(){return e}}function vS(e){return function(t){return e(t)+""}}function ay(e,t){var r=fd.lastIndex=Fc.lastIndex=0,s,o,a,u=-1,c=[],h=[];for(e=e+"",t=t+"";(s=fd.exec(e))&&(o=Fc.exec(t));)(a=o.index)>r&&(a=t.slice(r,a),c[u]?c[u]+=a:c[++u]=a),(s=s[0])===(o=o[0])?c[u]?c[u]+=o:c[++u]=o:(c[++u]=null,h.push({i:u,x:fr(s,o)})),r=Fc.lastIndex;return r<t.length&&(a=t.slice(r),c[u]?c[u]+=a:c[++u]=a),c.length<2?h[0]?vS(h[0].x):xS(t):(t=h.length,function(p){for(var m=0,g;m<t;++m)c[(g=h[m]).i]=g.x(p);return c.join("")})}function Oo(e,t){var r=typeof t,s;return t==null||r==="boolean"?Dd(t):(r==="number"?fr:r==="string"?(s=Yi(t))?(t=s,Aa):ay:t instanceof Yi?Aa:t instanceof Date?gS:pS(t)?hS:Array.isArray(t)?mS:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?yS:fr)(e,t)}var qp=180/Math.PI,hd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function uy(e,t,r,s,o,a){var u,c,h;return(u=Math.sqrt(e*e+t*t))&&(e/=u,t/=u),(h=e*r+t*s)&&(r-=e*h,s-=t*h),(c=Math.sqrt(r*r+s*s))&&(r/=c,s/=c,h/=c),e*s<t*r&&(e=-e,t=-t,h=-h,u=-u),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*qp,skewX:Math.atan(h)*qp,scaleX:u,scaleY:c}}var pa;function wS(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?hd:uy(t.a,t.b,t.c,t.d,t.e,t.f)}function SS(e){return e==null||(pa||(pa=document.createElementNS("http://www.w3.org/2000/svg","g")),pa.setAttribute("transform",e),!(e=pa.transform.baseVal.consolidate()))?hd:(e=e.matrix,uy(e.a,e.b,e.c,e.d,e.e,e.f))}function cy(e,t,r,s){function o(p){return p.length?p.pop()+" ":""}function a(p,m,g,x,w,k){if(p!==g||m!==x){var E=w.push("translate(",null,t,null,r);k.push({i:E-4,x:fr(p,g)},{i:E-2,x:fr(m,x)})}else(g||x)&&w.push("translate("+g+t+x+r)}function u(p,m,g,x){p!==m?(p-m>180?m+=360:m-p>180&&(p+=360),x.push({i:g.push(o(g)+"rotate(",null,s)-2,x:fr(p,m)})):m&&g.push(o(g)+"rotate("+m+s)}function c(p,m,g,x){p!==m?x.push({i:g.push(o(g)+"skewX(",null,s)-2,x:fr(p,m)}):m&&g.push(o(g)+"skewX("+m+s)}function h(p,m,g,x,w,k){if(p!==g||m!==x){var E=w.push(o(w)+"scale(",null,",",null,")");k.push({i:E-4,x:fr(p,g)},{i:E-2,x:fr(m,x)})}else(g!==1||x!==1)&&w.push(o(w)+"scale("+g+","+x+")")}return function(p,m){var g=[],x=[];return p=e(p),m=e(m),a(p.translateX,p.translateY,m.translateX,m.translateY,g,x),u(p.rotate,m.rotate,g,x),c(p.skewX,m.skewX,g,x),h(p.scaleX,p.scaleY,m.scaleX,m.scaleY,g,x),p=m=null,function(w){for(var k=-1,E=x.length,C;++k<E;)g[(C=x[k]).i]=C.x(w);return g.join("")}}}var kS=cy(wS,"px, ","px)","deg)"),NS=cy(SS,", ",")",")"),ES=1e-12;function Gp(e){return((e=Math.exp(e))+1/e)/2}function CS(e){return((e=Math.exp(e))-1/e)/2}function bS(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ea=(function e(t,r,s){function o(a,u){var c=a[0],h=a[1],p=a[2],m=u[0],g=u[1],x=u[2],w=m-c,k=g-h,E=w*w+k*k,C,S;if(E<ES)S=Math.log(x/p)/t,C=function($){return[c+$*w,h+$*k,p*Math.exp(t*$*S)]};else{var b=Math.sqrt(E),N=(x*x-p*p+s*E)/(2*p*r*b),I=(x*x-p*p-s*E)/(2*x*r*b),B=Math.log(Math.sqrt(N*N+1)-N),T=Math.log(Math.sqrt(I*I+1)-I);S=(T-B)/t,C=function($){var Q=$*S,U=Gp(B),q=p/(r*b)*(U*bS(t*Q+B)-CS(B));return[c+q*w,h+q*k,p*U/Gp(t*Q+B)]}}return C.duration=S*1e3*t/Math.SQRT2,C}return o.rho=function(a){var u=Math.max(.001,+a),c=u*u,h=c*c;return e(u,c,h)},o})(Math.SQRT2,2,4);var Vs=0,Do=0,Po=0,dy=1e3,Ma,Fo,Ra=0,Xi=0,Wa=0,Xo=typeof performance=="object"&&performance.now?performance:Date,fy=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Fd(){return Xi||(fy(jS),Xi=Xo.now()+Wa)}function jS(){Xi=0}function za(){this._call=this._time=this._next=null}za.prototype=hy.prototype={constructor:za,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?Fd():+r)+(t==null?0:+t),!this._next&&Fo!==this&&(Fo?Fo._next=this:Ma=this,Fo=this),this._call=e,this._time=r,pd()},stop:function(){this._call&&(this._call=null,this._time=1/0,pd())}};function hy(e,t,r){var s=new za;return s.restart(e,t,r),s}function _S(){Fd(),++Vs;for(var e=Ma,t;e;)(t=Xi-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Vs}function Kp(){Xi=(Ra=Xo.now())+Wa,Vs=Do=0;try{_S()}finally{Vs=0,TS(),Xi=0}}function IS(){var e=Xo.now(),t=e-Ra;t>dy&&(Wa-=t,Ra=e)}function TS(){for(var e,t=Ma,r,s=1/0;t;)t._call?(s>t._time&&(s=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:Ma=r);Fo=e,pd(s)}function pd(e){if(!Vs){Do&&(Do=clearTimeout(Do));var t=e-Xi;t>24?(e<1/0&&(Do=setTimeout(Kp,e-Xo.now()-Wa)),Po&&(Po=clearInterval(Po))):(Po||(Ra=Xo.now(),Po=setInterval(IS,dy)),Vs=1,fy(Kp))}}function Qp(e,t,r){var s=new za;return t=t==null?0:+t,s.restart(o=>{s.stop(),e(o+t)},t,r),s}var PS=Va("start","end","cancel","interrupt"),AS=[],py=0,Zp=1,md=2,Ca=3,Jp=4,gd=5,ba=6;function Ya(e,t,r,s,o,a){var u=e.__transition;if(!u)e.__transition={};else if(r in u)return;MS(e,r,{name:t,index:s,group:o,on:PS,tween:AS,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:py})}function Od(e,t){var r=er(e,t);if(r.state>py)throw new Error("too late; already scheduled");return r}function xr(e,t){var r=er(e,t);if(r.state>Ca)throw new Error("too late; already running");return r}function er(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function MS(e,t,r){var s=e.__transition,o;s[t]=r,r.timer=hy(a,0,r.time);function a(p){r.state=Zp,r.timer.restart(u,r.delay,r.time),r.delay<=p&&u(p-r.delay)}function u(p){var m,g,x,w;if(r.state!==Zp)return h();for(m in s)if(w=s[m],w.name===r.name){if(w.state===Ca)return Qp(u);w.state===Jp?(w.state=ba,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete s[m]):+m<t&&(w.state=ba,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete s[m])}if(Qp(function(){r.state===Ca&&(r.state=Jp,r.timer.restart(c,r.delay,r.time),c(p))}),r.state=md,r.on.call("start",e,e.__data__,r.index,r.group),r.state===md){for(r.state=Ca,o=new Array(x=r.tween.length),m=0,g=-1;m<x;++m)(w=r.tween[m].value.call(e,e.__data__,r.index,r.group))&&(o[++g]=w);o.length=g+1}}function c(p){for(var m=p<r.duration?r.ease.call(null,p/r.duration):(r.timer.restart(h),r.state=gd,1),g=-1,x=o.length;++g<x;)o[g].call(e,m);r.state===gd&&(r.on.call("end",e,e.__data__,r.index,r.group),h())}function h(){r.state=ba,r.timer.stop(),delete s[t];for(var p in s)return;delete e.__transition}}function ja(e,t){var r=e.__transition,s,o,a=!0,u;if(r){t=t==null?null:t+"";for(u in r){if((s=r[u]).name!==t){a=!1;continue}o=s.state>md&&s.state<gd,s.state=ba,s.timer.stop(),s.on.call(o?"interrupt":"cancel",e,e.__data__,s.index,s.group),delete r[u]}a&&delete e.__transition}}function RS(e){return this.each(function(){ja(this,e)})}function zS(e,t){var r,s;return function(){var o=xr(this,e),a=o.tween;if(a!==r){s=r=a;for(var u=0,c=s.length;u<c;++u)if(s[u].name===t){s=s.slice(),s.splice(u,1);break}}o.tween=s}}function LS(e,t,r){var s,o;if(typeof r!="function")throw new Error;return function(){var a=xr(this,e),u=a.tween;if(u!==s){o=(s=u).slice();for(var c={name:t,value:r},h=0,p=o.length;h<p;++h)if(o[h].name===t){o[h]=c;break}h===p&&o.push(c)}a.tween=o}}function DS(e,t){var r=this._id;if(e+="",arguments.length<2){for(var s=er(this.node(),r).tween,o=0,a=s.length,u;o<a;++o)if((u=s[o]).name===e)return u.value;return null}return this.each((t==null?zS:LS)(r,e,t))}function $d(e,t,r){var s=e._id;return e.each(function(){var o=xr(this,s);(o.value||(o.value={}))[t]=r.apply(this,arguments)}),function(o){return er(o,s).value[t]}}function my(e,t){var r;return(typeof t=="number"?fr:t instanceof Yi?Aa:(r=Yi(t))?(t=r,Aa):ay)(e,t)}function FS(e){return function(){this.removeAttribute(e)}}function OS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function $S(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttribute(e);return u===o?null:u===s?a:a=t(s=u,r)}}function BS(e,t,r){var s,o=r+"",a;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===s?a:a=t(s=u,r)}}function HS(e,t,r){var s,o,a;return function(){var u,c=r(this),h;return c==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=c+"",u===h?null:u===s&&h===o?a:(o=h,a=t(s=u,c)))}}function VS(e,t,r){var s,o,a;return function(){var u,c=r(this),h;return c==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=c+"",u===h?null:u===s&&h===o?a:(o=h,a=t(s=u,c)))}}function US(e,t){var r=Ua(e),s=r==="transform"?NS:my;return this.attrTween(e,typeof t=="function"?(r.local?VS:HS)(r,s,$d(this,"attr."+e,t)):t==null?(r.local?OS:FS)(r):(r.local?BS:$S)(r,s,t))}function WS(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function YS(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function XS(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&YS(e,a)),r}return o._value=t,o}function qS(e,t){var r,s;function o(){var a=t.apply(this,arguments);return a!==s&&(r=(s=a)&&WS(e,a)),r}return o._value=t,o}function GS(e,t){var r="attr."+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;var s=Ua(e);return this.tween(r,(s.local?XS:qS)(s,t))}function KS(e,t){return function(){Od(this,e).delay=+t.apply(this,arguments)}}function QS(e,t){return t=+t,function(){Od(this,e).delay=t}}function ZS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?KS:QS)(t,e)):er(this.node(),t).delay}function JS(e,t){return function(){xr(this,e).duration=+t.apply(this,arguments)}}function ek(e,t){return t=+t,function(){xr(this,e).duration=t}}function tk(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?JS:ek)(t,e)):er(this.node(),t).duration}function nk(e,t){if(typeof t!="function")throw new Error;return function(){xr(this,e).ease=t}}function rk(e){var t=this._id;return arguments.length?this.each(nk(t,e)):er(this.node(),t).ease}function ik(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;xr(this,e).ease=r}}function sk(e){if(typeof e!="function")throw new Error;return this.each(ik(this._id,e))}function ok(e){typeof e!="function"&&(e=Yg(e));for(var t=this._groups,r=t.length,s=new Array(r),o=0;o<r;++o)for(var a=t[o],u=a.length,c=s[o]=[],h,p=0;p<u;++p)(h=a[p])&&e.call(h,h.__data__,p,a)&&c.push(h);return new Dr(s,this._parents,this._name,this._id)}function lk(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,s=t.length,o=r.length,a=Math.min(s,o),u=new Array(s),c=0;c<a;++c)for(var h=t[c],p=r[c],m=h.length,g=u[c]=new Array(m),x,w=0;w<m;++w)(x=h[w]||p[w])&&(g[w]=x);for(;c<s;++c)u[c]=t[c];return new Dr(u,this._parents,this._name,this._id)}function ak(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function uk(e,t,r){var s,o,a=ak(t)?Od:xr;return function(){var u=a(this,e),c=u.on;c!==s&&(o=(s=c).copy()).on(t,r),u.on=o}}function ck(e,t){var r=this._id;return arguments.length<2?er(this.node(),r).on.on(e):this.each(uk(r,e,t))}function dk(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function fk(){return this.on("end.remove",dk(this._id))}function hk(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Rd(e));for(var s=this._groups,o=s.length,a=new Array(o),u=0;u<o;++u)for(var c=s[u],h=c.length,p=a[u]=new Array(h),m,g,x=0;x<h;++x)(m=c[x])&&(g=e.call(m,m.__data__,x,c))&&("__data__"in m&&(g.__data__=m.__data__),p[x]=g,Ya(p[x],t,r,x,p,er(m,r)));return new Dr(a,this._parents,t,r)}function pk(e){var t=this._name,r=this._id;typeof e!="function"&&(e=Wg(e));for(var s=this._groups,o=s.length,a=[],u=[],c=0;c<o;++c)for(var h=s[c],p=h.length,m,g=0;g<p;++g)if(m=h[g]){for(var x=e.call(m,m.__data__,g,h),w,k=er(m,r),E=0,C=x.length;E<C;++E)(w=x[E])&&Ya(w,t,r,E,x,k);a.push(x),u.push(m)}return new Dr(a,u,t,r)}var mk=rl.prototype.constructor;function gk(){return new mk(this._groups,this._parents)}function yk(e,t){var r,s,o;return function(){var a=Hs(this,e),u=(this.style.removeProperty(e),Hs(this,e));return a===u?null:a===r&&u===s?o:o=t(r=a,s=u)}}function gy(e){return function(){this.style.removeProperty(e)}}function xk(e,t,r){var s,o=r+"",a;return function(){var u=Hs(this,e);return u===o?null:u===s?a:a=t(s=u,r)}}function vk(e,t,r){var s,o,a;return function(){var u=Hs(this,e),c=r(this),h=c+"";return c==null&&(h=c=(this.style.removeProperty(e),Hs(this,e))),u===h?null:u===s&&h===o?a:(o=h,a=t(s=u,c))}}function wk(e,t){var r,s,o,a="style."+t,u="end."+a,c;return function(){var h=xr(this,e),p=h.on,m=h.value[a]==null?c||(c=gy(t)):void 0;(p!==r||o!==m)&&(s=(r=p).copy()).on(u,o=m),h.on=s}}function Sk(e,t,r){var s=(e+="")=="transform"?kS:my;return t==null?this.styleTween(e,yk(e,s)).on("end.style."+e,gy(e)):typeof t=="function"?this.styleTween(e,vk(e,s,$d(this,"style."+e,t))).each(wk(this._id,e)):this.styleTween(e,xk(e,s,t),r).on("end.style."+e,null)}function kk(e,t,r){return function(s){this.style.setProperty(e,t.call(this,s),r)}}function Nk(e,t,r){var s,o;function a(){var u=t.apply(this,arguments);return u!==o&&(s=(o=u)&&kk(e,u,r)),s}return a._value=t,a}function Ek(e,t,r){var s="style."+(e+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(t==null)return this.tween(s,null);if(typeof t!="function")throw new Error;return this.tween(s,Nk(e,t,r??""))}function Ck(e){return function(){this.textContent=e}}function bk(e){return function(){var t=e(this);this.textContent=t??""}}function jk(e){return this.tween("text",typeof e=="function"?bk($d(this,"text",e)):Ck(e==null?"":e+""))}function _k(e){return function(t){this.textContent=e.call(this,t)}}function Ik(e){var t,r;function s(){var o=e.apply(this,arguments);return o!==r&&(t=(r=o)&&_k(o)),t}return s._value=e,s}function Tk(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,Ik(e))}function Pk(){for(var e=this._name,t=this._id,r=yy(),s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],c=u.length,h,p=0;p<c;++p)if(h=u[p]){var m=er(h,t);Ya(h,e,r,p,u,{time:m.time+m.delay+m.duration,delay:0,duration:m.duration,ease:m.ease})}return new Dr(s,this._parents,e,r)}function Ak(){var e,t,r=this,s=r._id,o=r.size();return new Promise(function(a,u){var c={value:u},h={value:function(){--o===0&&a()}};r.each(function(){var p=xr(this,s),m=p.on;m!==e&&(t=(e=m).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(h)),p.on=t}),o===0&&a()})}var Mk=0;function Dr(e,t,r,s){this._groups=e,this._parents=t,this._name=r,this._id=s}function yy(){return++Mk}var zr=rl.prototype;Dr.prototype={constructor:Dr,select:hk,selectAll:pk,selectChild:zr.selectChild,selectChildren:zr.selectChildren,filter:ok,merge:lk,selection:gk,transition:Pk,call:zr.call,nodes:zr.nodes,node:zr.node,size:zr.size,empty:zr.empty,each:zr.each,on:ck,attr:US,attrTween:GS,style:Sk,styleTween:Ek,text:jk,textTween:Tk,remove:fk,tween:DS,delay:ZS,duration:tk,ease:rk,easeVarying:sk,end:Ak,[Symbol.iterator]:zr[Symbol.iterator]};function Rk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var zk={time:null,delay:0,duration:250,ease:Rk};function Lk(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function Dk(e){var t,r;e instanceof Dr?(t=e._id,e=e._name):(t=yy(),(r=zk).time=Fd(),e=e==null?null:e+"");for(var s=this._groups,o=s.length,a=0;a<o;++a)for(var u=s[a],c=u.length,h,p=0;p<c;++p)(h=u[p])&&Ya(h,e,t,p,u,r||Lk(h,t));return new Dr(s,this._parents,e,t)}rl.prototype.interrupt=RS;rl.prototype.transition=Dk;const ma=e=>()=>e;function Fk(e,{sourceEvent:t,target:r,transform:s,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:o}})}function Lr(e,t,r){this.k=e,this.x=t,this.y=r}Lr.prototype={constructor:Lr,scale:function(e){return e===1?this:new Lr(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Lr(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 Xa=new Lr(1,0,0);xy.prototype=Lr.prototype;function xy(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Xa;return e.__zoom}function Oc(e){e.stopImmediatePropagation()}function Ao(e){e.preventDefault(),e.stopImmediatePropagation()}function Ok(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function $k(){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 em(){return this.__zoom||Xa}function Bk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Hk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vk(e,t,r){var s=e.invertX(t[0][0])-r[0][0],o=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],u=e.invertY(t[1][1])-r[1][1];return e.translate(o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o),u>a?(a+u)/2:Math.min(0,a)||Math.max(0,u))}function vy(){var e=Ok,t=$k,r=Vk,s=Bk,o=Hk,a=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,h=Ea,p=Va("start","zoom","end"),m,g,x,w=500,k=150,E=0,C=10;function S(P){P.property("__zoom",em).on("wheel.zoom",Q,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",L).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",J).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}S.transform=function(P,O,F,K){var R=P.selection?P.selection():P;R.property("__zoom",em),P!==R?B(P,O,F,K):R.interrupt().each(function(){T(this,arguments).event(K).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},S.scaleBy=function(P,O,F,K){S.scaleTo(P,function(){var R=this.__zoom.k,V=typeof O=="function"?O.apply(this,arguments):O;return R*V},F,K)},S.scaleTo=function(P,O,F,K){S.transform(P,function(){var R=t.apply(this,arguments),V=this.__zoom,j=F==null?I(R):typeof F=="function"?F.apply(this,arguments):F,z=V.invert(j),Y=typeof O=="function"?O.apply(this,arguments):O;return r(N(b(V,Y),j,z),R,u)},F,K)},S.translateBy=function(P,O,F,K){S.transform(P,function(){return r(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof F=="function"?F.apply(this,arguments):F),t.apply(this,arguments),u)},null,K)},S.translateTo=function(P,O,F,K,R){S.transform(P,function(){var V=t.apply(this,arguments),j=this.__zoom,z=K==null?I(V):typeof K=="function"?K.apply(this,arguments):K;return r(Xa.translate(z[0],z[1]).scale(j.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof F=="function"?-F.apply(this,arguments):-F),V,u)},K,R)};function b(P,O){return O=Math.max(a[0],Math.min(a[1],O)),O===P.k?P:new Lr(O,P.x,P.y)}function N(P,O,F){var K=O[0]-F[0]*P.k,R=O[1]-F[1]*P.k;return K===P.x&&R===P.y?P:new Lr(P.k,K,R)}function I(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function B(P,O,F,K){P.on("start.zoom",function(){T(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(K).end()}).tween("zoom",function(){var R=this,V=arguments,j=T(R,V).event(K),z=t.apply(R,V),Y=F==null?I(z):typeof F=="function"?F.apply(R,V):F,A=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),le=R.__zoom,fe=typeof O=="function"?O.apply(R,V):O,ce=h(le.invert(Y).concat(A/le.k),fe.invert(Y).concat(A/fe.k));return function(ve){if(ve===1)ve=fe;else{var se=ce(ve),xe=A/se[2];ve=new Lr(xe,Y[0]-se[0]*xe,Y[1]-se[1]*xe)}j.zoom(null,ve)}})}function T(P,O,F){return!F&&P.__zooming||new $(P,O)}function $(P,O){this.that=P,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,O),this.taps=0}$.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,O){return this.mouse&&P!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var O=Cn(this.that).datum();p.call(P,this.that,new Fk(P,{sourceEvent:this.sourceEvent,target:S,transform:this.that.__zoom,dispatch:p}),O)}};function Q(P,...O){if(!e.apply(this,arguments))return;var F=T(this,O).event(P),K=this.__zoom,R=Math.max(a[0],Math.min(a[1],K.k*Math.pow(2,s.apply(this,arguments)))),V=Kn(P);if(F.wheel)(F.mouse[0][0]!==V[0]||F.mouse[0][1]!==V[1])&&(F.mouse[1]=K.invert(F.mouse[0]=V)),clearTimeout(F.wheel);else{if(K.k===R)return;F.mouse=[V,K.invert(V)],ja(this),F.start()}Ao(P),F.wheel=setTimeout(j,k),F.zoom("mouse",r(N(b(K,R),F.mouse[0],F.mouse[1]),F.extent,u));function j(){F.wheel=null,F.end()}}function U(P,...O){if(x||!e.apply(this,arguments))return;var F=P.currentTarget,K=T(this,O,!0).event(P),R=Cn(P.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",A,!0),V=Kn(P,F),j=P.clientX,z=P.clientY;ny(P.view),Oc(P),K.mouse=[V,this.__zoom.invert(V)],ja(this),K.start();function Y(le){if(Ao(le),!K.moved){var fe=le.clientX-j,ce=le.clientY-z;K.moved=fe*fe+ce*ce>E}K.event(le).zoom("mouse",r(N(K.that.__zoom,K.mouse[0]=Kn(le,F),K.mouse[1]),K.extent,u))}function A(le){R.on("mousemove.zoom mouseup.zoom",null),ry(le.view,K.moved),Ao(le),K.event(le).end()}}function q(P,...O){if(e.apply(this,arguments)){var F=this.__zoom,K=Kn(P.changedTouches?P.changedTouches[0]:P,this),R=F.invert(K),V=F.k*(P.shiftKey?.5:2),j=r(N(b(F,V),K,R),t.apply(this,O),u);Ao(P),c>0?Cn(this).transition().duration(c).call(B,j,K,P):Cn(this).call(S.transform,j,K,P)}}function L(P,...O){if(e.apply(this,arguments)){var F=P.touches,K=F.length,R=T(this,O,P.changedTouches.length===K).event(P),V,j,z,Y;for(Oc(P),j=0;j<K;++j)z=F[j],Y=Kn(z,this),Y=[Y,this.__zoom.invert(Y),z.identifier],R.touch0?!R.touch1&&R.touch0[2]!==Y[2]&&(R.touch1=Y,R.taps=0):(R.touch0=Y,V=!0,R.taps=1+!!m);m&&(m=clearTimeout(m)),V&&(R.taps<2&&(g=Y[0],m=setTimeout(function(){m=null},w)),ja(this),R.start())}}function W(P,...O){if(this.__zooming){var F=T(this,O).event(P),K=P.changedTouches,R=K.length,V,j,z,Y;for(Ao(P),V=0;V<R;++V)j=K[V],z=Kn(j,this),F.touch0&&F.touch0[2]===j.identifier?F.touch0[0]=z:F.touch1&&F.touch1[2]===j.identifier&&(F.touch1[0]=z);if(j=F.that.__zoom,F.touch1){var A=F.touch0[0],le=F.touch0[1],fe=F.touch1[0],ce=F.touch1[1],ve=(ve=fe[0]-A[0])*ve+(ve=fe[1]-A[1])*ve,se=(se=ce[0]-le[0])*se+(se=ce[1]-le[1])*se;j=b(j,Math.sqrt(ve/se)),z=[(A[0]+fe[0])/2,(A[1]+fe[1])/2],Y=[(le[0]+ce[0])/2,(le[1]+ce[1])/2]}else if(F.touch0)z=F.touch0[0],Y=F.touch0[1];else return;F.zoom("touch",r(N(j,z,Y),F.extent,u))}}function J(P,...O){if(this.__zooming){var F=T(this,O).event(P),K=P.changedTouches,R=K.length,V,j;for(Oc(P),x&&clearTimeout(x),x=setTimeout(function(){x=null},w),V=0;V<R;++V)j=K[V],F.touch0&&F.touch0[2]===j.identifier?delete F.touch0:F.touch1&&F.touch1[2]===j.identifier&&delete F.touch1;if(F.touch1&&!F.touch0&&(F.touch0=F.touch1,delete F.touch1),F.touch0)F.touch0[1]=this.__zoom.invert(F.touch0[0]);else if(F.end(),F.taps===2&&(j=Kn(j,this),Math.hypot(g[0]-j[0],g[1]-j[1])<C)){var z=Cn(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return S.wheelDelta=function(P){return arguments.length?(s=typeof P=="function"?P:ma(+P),S):s},S.filter=function(P){return arguments.length?(e=typeof P=="function"?P:ma(!!P),S):e},S.touchable=function(P){return arguments.length?(o=typeof P=="function"?P:ma(!!P),S):o},S.extent=function(P){return arguments.length?(t=typeof P=="function"?P:ma([[+P[0][0],+P[0][1]],[+P[1][0],+P[1][1]]]),S):t},S.scaleExtent=function(P){return arguments.length?(a[0]=+P[0],a[1]=+P[1],S):[a[0],a[1]]},S.translateExtent=function(P){return arguments.length?(u[0][0]=+P[0][0],u[1][0]=+P[1][0],u[0][1]=+P[0][1],u[1][1]=+P[1][1],S):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},S.constrain=function(P){return arguments.length?(r=P,S):r},S.duration=function(P){return arguments.length?(c=+P,S):c},S.interpolate=function(P){return arguments.length?(h=P,S):h},S.on=function(){var P=p.on.apply(p,arguments);return P===p?S:P},S.clickDistance=function(P){return arguments.length?(E=(P=+P)*P,S):Math.sqrt(E)},S.tapDistance=function(P){return arguments.length?(C=+P,S):C},S}const gr={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.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 React Flow 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:r,targetHandle:s})=>`Couldn't create edge for ${e} handle id: "${e==="source"?r:s}", 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."},qo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],wy=["Enter"," ","Escape"],Sy={"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:r})=>`Moved selected node ${e}. New position, x: ${t}, y: ${r}`,"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 qi;(function(e){e.Strict="strict",e.Loose="loose"})(qi||(qi={}));var Wi;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Wi||(Wi={}));var Go;(function(e){e.Partial="partial",e.Full="full"})(Go||(Go={}));const ky={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var pi;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(pi||(pi={}));var Ko;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ko||(Ko={}));var Te;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Te||(Te={}));const tm={[Te.Left]:Te.Right,[Te.Right]:Te.Left,[Te.Top]:Te.Bottom,[Te.Bottom]:Te.Top};function Ny(e){return e===null?null:e?"valid":"invalid"}const Ey=e=>"id"in e&&"source"in e&&"target"in e,Uk=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Bd=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),sl=(e,t=[0,0])=>{const{width:r,height:s}=Fr(e),o=e.origin??t,a=r*o[0],u=s*o[1];return{x:e.position.x-a,y:e.position.y-u}},Wk=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const r=e.reduce((s,o)=>{const a=typeof o=="string";let u=!t.nodeLookup&&!a?o:void 0;t.nodeLookup&&(u=a?t.nodeLookup.get(o):Bd(o)?o:t.nodeLookup.get(o.id));const c=u?La(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return qa(s,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ga(r)},ol=(e,t={})=>{let r={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(r=qa(r,La(o)),s=!0)}),s?Ga(r):{x:0,y:0,width:0,height:0}},Hd=(e,t,[r,s,o]=[0,0,1],a=!1,u=!1)=>{const c={...al(t,[r,s,o]),width:t.width/o,height:t.height/o},h=[];for(const p of e.values()){const{measured:m,selectable:g=!0,hidden:x=!1}=p;if(u&&!g||x)continue;const w=m.width??p.width??p.initialWidth??null,k=m.height??p.height??p.initialHeight??null,E=Qo(c,Ws(p)),C=(w??0)*(k??0),S=a&&E>0;(!p.internals.handleBounds||S||E>=C||p.dragging)&&h.push(p)}return h},Yk=(e,t)=>{const r=new Set;return e.forEach(s=>{r.add(s.id)}),t.filter(s=>r.has(s.source)||r.has(s.target))};function Xk(e,t){const r=new Map,s=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!o.hidden)&&(!s||s.has(o.id))&&r.set(o.id,o)}),r}async function qk({nodes:e,width:t,height:r,panZoom:s,minZoom:o,maxZoom:a},u){if(e.size===0)return Promise.resolve(!0);const c=Xk(e,u),h=ol(c),p=Vd(h,t,r,(u==null?void 0:u.minZoom)??o,(u==null?void 0:u.maxZoom)??a,(u==null?void 0:u.padding)??.1);return await s.setViewport(p,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),Promise.resolve(!0)}function Cy({nodeId:e,nextPosition:t,nodeLookup:r,nodeOrigin:s=[0,0],nodeExtent:o,onError:a}){const u=r.get(e),c=u.parentId?r.get(u.parentId):void 0,{x:h,y:p}=c?c.internals.positionAbsolute:{x:0,y:0},m=u.origin??s;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!c)a==null||a("005",gr.error005());else{const w=c.measured.width,k=c.measured.height;w&&k&&(g=[[h,p],[h+w,p+k]])}else c&&Ys(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const x=Ys(g)?Gi(t,g,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(a==null||a("015",gr.error015())),{position:{x:x.x-h+(u.measured.width??0)*m[0],y:x.y-p+(u.measured.height??0)*m[1]},positionAbsolute:x}}async function Gk({nodesToRemove:e=[],edgesToRemove:t=[],nodes:r,edges:s,onBeforeDelete:o}){const a=new Set(e.map(x=>x.id)),u=[];for(const x of r){if(x.deletable===!1)continue;const w=a.has(x.id),k=!w&&x.parentId&&u.find(E=>E.id===x.parentId);(w||k)&&u.push(x)}const c=new Set(t.map(x=>x.id)),h=s.filter(x=>x.deletable!==!1),m=Yk(u,h);for(const x of h)c.has(x.id)&&!m.find(k=>k.id===x.id)&&m.push(x);if(!o)return{edges:m,nodes:u};const g=await o({nodes:u,edges:m});return typeof g=="boolean"?g?{edges:m,nodes:u}:{edges:[],nodes:[]}:g}const Us=(e,t=0,r=1)=>Math.min(Math.max(e,t),r),Gi=(e={x:0,y:0},t,r)=>({x:Us(e.x,t[0][0],t[1][0]-((r==null?void 0:r.width)??0)),y:Us(e.y,t[0][1],t[1][1]-((r==null?void 0:r.height)??0))});function by(e,t,r){const{width:s,height:o}=Fr(r),{x:a,y:u}=r.internals.positionAbsolute;return Gi(e,[[a,u],[a+s,u+o]],t)}const nm=(e,t,r)=>e<t?Us(Math.abs(e-t),1,t)/t:e>r?-Us(Math.abs(e-r),1,t)/t:0,jy=(e,t,r=15,s=40)=>{const o=nm(e.x,s,t.width-s)*r,a=nm(e.y,s,t.height-s)*r;return[o,a]},qa=(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)}),yd=({x:e,y:t,width:r,height:s})=>({x:e,y:t,x2:e+r,y2:t+s}),Ga=({x:e,y:t,x2:r,y2:s})=>({x:e,y:t,width:r-e,height:s-t}),Ws=(e,t=[0,0])=>{var o,a;const{x:r,y:s}=Bd(e)?e.internals.positionAbsolute:sl(e,t);return{x:r,y:s,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},La=(e,t=[0,0])=>{var o,a;const{x:r,y:s}=Bd(e)?e.internals.positionAbsolute:sl(e,t);return{x:r,y:s,x2:r+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:s+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},_y=(e,t)=>Ga(qa(yd(e),yd(t))),Qo=(e,t)=>{const r=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),s=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(r*s)},rm=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),Kk=(e,t)=>{},ll=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),al=({x:e,y:t},[r,s,o],a=!1,u=[1,1])=>{const c={x:(e-r)/o,y:(t-s)/o};return a?ll(c,u):c},Da=({x:e,y:t},[r,s,o])=>({x:e*o+r,y:t*o+s});function Is(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(r)}if(typeof e=="string"&&e.endsWith("%")){const r=parseFloat(e);if(!Number.isNaN(r))return Math.floor(t*r*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Qk(e,t,r){if(typeof e=="string"||typeof e=="number"){const s=Is(e,r),o=Is(e,t);return{top:s,right:o,bottom:s,left:o,x:o*2,y:s*2}}if(typeof e=="object"){const s=Is(e.top??e.y??0,r),o=Is(e.bottom??e.y??0,r),a=Is(e.left??e.x??0,t),u=Is(e.right??e.x??0,t);return{top:s,right:u,bottom:o,left:a,x:a+u,y:s+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Zk(e,t,r,s,o,a){const{x:u,y:c}=Da(e,[t,r,s]),{x:h,y:p}=Da({x:e.x+e.width,y:e.y+e.height},[t,r,s]),m=o-h,g=a-p;return{left:Math.floor(u),top:Math.floor(c),right:Math.floor(m),bottom:Math.floor(g)}}const Vd=(e,t,r,s,o,a)=>{const u=Qk(a,t,r),c=(t-u.x)/e.width,h=(r-u.y)/e.height,p=Math.min(c,h),m=Us(p,s,o),g=e.x+e.width/2,x=e.y+e.height/2,w=t/2-g*m,k=r/2-x*m,E=Zk(e,w,k,m,t,r),C={left:Math.min(E.left-u.left,0),top:Math.min(E.top-u.top,0),right:Math.min(E.right-u.right,0),bottom:Math.min(E.bottom-u.bottom,0)};return{x:w-C.left+C.right,y:k-C.top+C.bottom,zoom:m}},Zo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ys(e){return e!=null&&e!=="parent"}function Fr(e){var t,r;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight??0}}function Iy(e){var t,r;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((r=e.measured)==null?void 0:r.height)??e.height??e.initialHeight)!==void 0}function Ty(e,t={width:0,height:0},r,s,o){const a={...e},u=s.get(r);if(u){const c=u.origin||o;a.x+=u.internals.positionAbsolute.x-(t.width??0)*c[0],a.y+=u.internals.positionAbsolute.y-(t.height??0)*c[1]}return a}function im(e,t){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}function Jk(){let e,t;return{promise:new Promise((s,o)=>{e=s,t=o}),resolve:e,reject:t}}function eN(e){return{...Sy,...e||{}}}function $o(e,{snapGrid:t=[0,0],snapToGrid:r=!1,transform:s,containerBounds:o}){const{x:a,y:u}=Jn(e),c=al({x:a-((o==null?void 0:o.left)??0),y:u-((o==null?void 0:o.top)??0)},s),{x:h,y:p}=r?ll(c,t):c;return{xSnapped:h,ySnapped:p,...c}}const Ud=e=>({width:e.offsetWidth,height:e.offsetHeight}),Py=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},tN=["INPUT","SELECT","TEXTAREA"];function Ay(e){var s,o;const t=((o=(s=e.composedPath)==null?void 0:s.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:tN.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const My=e=>"clientX"in e,Jn=(e,t)=>{var a,u;const r=My(e),s=r?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,o=r?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:s-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},sm=(e,t,r,s,o)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(u=>{const c=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(c.left-r.left)/s,y:(c.top-r.top)/s,...Ud(u)}})};function Ry({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:o,sourceControlY:a,targetControlX:u,targetControlY:c}){const h=e*.125+o*.375+u*.375+r*.125,p=t*.125+a*.375+c*.375+s*.125,m=Math.abs(h-e),g=Math.abs(p-t);return[h,p,m,g]}function ga(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function om({pos:e,x1:t,y1:r,x2:s,y2:o,c:a}){switch(e){case Te.Left:return[t-ga(t-s,a),r];case Te.Right:return[t+ga(s-t,a),r];case Te.Top:return[t,r-ga(r-o,a)];case Te.Bottom:return[t,r+ga(o-r,a)]}}function zy({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:s,targetY:o,targetPosition:a=Te.Top,curvature:u=.25}){const[c,h]=om({pos:r,x1:e,y1:t,x2:s,y2:o,c:u}),[p,m]=om({pos:a,x1:s,y1:o,x2:e,y2:t,c:u}),[g,x,w,k]=Ry({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:c,sourceControlY:h,targetControlX:p,targetControlY:m});return[`M${e},${t} C${c},${h} ${p},${m} ${s},${o}`,g,x,w,k]}function Ly({sourceX:e,sourceY:t,targetX:r,targetY:s}){const o=Math.abs(r-e)/2,a=r<e?r+o:r-o,u=Math.abs(s-t)/2,c=s<t?s+u:s-u;return[a,c,o,u]}function nN({sourceNode:e,targetNode:t,selected:r=!1,zIndex:s=0,elevateOnSelect:o=!1,zIndexMode:a="basic"}){if(a==="manual")return s;const u=o&&r?s+1e3:s,c=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return u+c}function rN({sourceNode:e,targetNode:t,width:r,height:s,transform:o}){const a=qa(La(e),La(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:r/o[2],height:s/o[2]};return Qo(u,Ga(a))>0}const Dy=({source:e,sourceHandle:t,target:r,targetHandle:s})=>`xy-edge__${e}${t||""}-${r}${s||""}`,iN=(e,t)=>t.some(r=>r.source===e.source&&r.target===e.target&&(r.sourceHandle===e.sourceHandle||!r.sourceHandle&&!e.sourceHandle)&&(r.targetHandle===e.targetHandle||!r.targetHandle&&!e.targetHandle)),Fy=(e,t,r={})=>{if(!e.source||!e.target)return t;const s=r.getEdgeId||Dy;let o;return Ey(e)?o={...e}:o={...e,id:s(e)},iN(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))},sN=(e,t,r,s={shouldReplaceId:!0})=>{const{id:o,...a}=e;if(!t.source||!t.target||!r.find(p=>p.id===e.id))return r;const c=s.getEdgeId||Dy,h={...a,id:s.shouldReplaceId?c(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return r.filter(p=>p.id!==o).concat(h)};function Oy({sourceX:e,sourceY:t,targetX:r,targetY:s}){const[o,a,u,c]=Ly({sourceX:e,sourceY:t,targetX:r,targetY:s});return[`M ${e},${t}L ${r},${s}`,o,a,u,c]}const lm={[Te.Left]:{x:-1,y:0},[Te.Right]:{x:1,y:0},[Te.Top]:{x:0,y:-1},[Te.Bottom]:{x:0,y:1}},oN=({source:e,sourcePosition:t=Te.Bottom,target:r})=>t===Te.Left||t===Te.Right?e.x<r.x?{x:1,y:0}:{x:-1,y:0}:e.y<r.y?{x:0,y:1}:{x:0,y:-1},am=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function lN({source:e,sourcePosition:t=Te.Bottom,target:r,targetPosition:s=Te.Top,center:o,offset:a,stepPosition:u}){const c=lm[t],h=lm[s],p={x:e.x+c.x*a,y:e.y+c.y*a},m={x:r.x+h.x*a,y:r.y+h.y*a},g=oN({source:p,sourcePosition:t,target:m}),x=g.x!==0?"x":"y",w=g[x];let k=[],E,C;const S={x:0,y:0},b={x:0,y:0},[,,N,I]=Ly({sourceX:e.x,sourceY:e.y,targetX:r.x,targetY:r.y});if(c[x]*h[x]===-1){x==="x"?(E=o.x??p.x+(m.x-p.x)*u,C=o.y??(p.y+m.y)/2):(E=o.x??(p.x+m.x)/2,C=o.y??p.y+(m.y-p.y)*u);const T=[{x:E,y:p.y},{x:E,y:m.y}],$=[{x:p.x,y:C},{x:m.x,y:C}];c[x]===w?k=x==="x"?T:$:k=x==="x"?$:T}else{const T=[{x:p.x,y:m.y}],$=[{x:m.x,y:p.y}];if(x==="x"?k=c.x===w?$:T:k=c.y===w?T:$,t===s){const W=Math.abs(e[x]-r[x]);if(W<=a){const J=Math.min(a-1,a-W);c[x]===w?S[x]=(p[x]>e[x]?-1:1)*J:b[x]=(m[x]>r[x]?-1:1)*J}}if(t!==s){const W=x==="x"?"y":"x",J=c[x]===h[W],P=p[W]>m[W],O=p[W]<m[W];(c[x]===1&&(!J&&P||J&&O)||c[x]!==1&&(!J&&O||J&&P))&&(k=x==="x"?T:$)}const Q={x:p.x+S.x,y:p.y+S.y},U={x:m.x+b.x,y:m.y+b.y},q=Math.max(Math.abs(Q.x-k[0].x),Math.abs(U.x-k[0].x)),L=Math.max(Math.abs(Q.y-k[0].y),Math.abs(U.y-k[0].y));q>=L?(E=(Q.x+U.x)/2,C=k[0].y):(E=k[0].x,C=(Q.y+U.y)/2)}return[[e,{x:p.x+S.x,y:p.y+S.y},...k,{x:m.x+b.x,y:m.y+b.y},r],E,C,N,I]}function aN(e,t,r,s){const o=Math.min(am(e,t)/2,am(t,r)/2,s),{x:a,y:u}=t;if(e.x===a&&a===r.x||e.y===u&&u===r.y)return`L${a} ${u}`;if(e.y===u){const p=e.x<r.x?-1:1,m=e.y<r.y?1:-1;return`L ${a+o*p},${u}Q ${a},${u} ${a},${u+o*m}`}const c=e.x<r.x?1:-1,h=e.y<r.y?-1:1;return`L ${a},${u+o*h}Q ${a},${u} ${a+o*c},${u}`}function xd({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:s,targetY:o,targetPosition:a=Te.Top,borderRadius:u=5,centerX:c,centerY:h,offset:p=20,stepPosition:m=.5}){const[g,x,w,k,E]=lN({source:{x:e,y:t},sourcePosition:r,target:{x:s,y:o},targetPosition:a,center:{x:c,y:h},offset:p,stepPosition:m});return[g.reduce((S,b,N)=>{let I="";return N>0&&N<g.length-1?I=aN(g[N-1],b,g[N+1],u):I=`${N===0?"M":"L"}${b.x} ${b.y}`,S+=I,S},""),x,w,k,E]}function um(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function uN(e){var g;const{sourceNode:t,targetNode:r}=e;if(!um(t)||!um(r))return null;const s=t.internals.handleBounds||cm(t.handles),o=r.internals.handleBounds||cm(r.handles),a=dm((s==null?void 0:s.source)??[],e.sourceHandle),u=dm(e.connectionMode===qi.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!a||!u)return(g=e.onError)==null||g.call(e,"008",gr.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(a==null?void 0:a.position)||Te.Bottom,h=(u==null?void 0:u.position)||Te.Top,p=Ki(t,a,c),m=Ki(r,u,h);return{sourceX:p.x,sourceY:p.y,targetX:m.x,targetY:m.y,sourcePosition:c,targetPosition:h}}function cm(e){if(!e)return null;const t=[],r=[];for(const s of e)s.width=s.width??1,s.height=s.height??1,s.type==="source"?t.push(s):s.type==="target"&&r.push(s);return{source:t,target:r}}function Ki(e,t,r=Te.Left,s=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,a=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:u,height:c}=t??Fr(e);if(s)return{x:o+u/2,y:a+c/2};switch((t==null?void 0:t.position)??r){case Te.Top:return{x:o+u/2,y:a};case Te.Right:return{x:o+u,y:a+c/2};case Te.Bottom:return{x:o+u/2,y:a+c};case Te.Left:return{x:o,y:a+c/2}}}function dm(e,t){return e&&(t?e.find(r=>r.id===t):e[0])||null}function vd(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(s=>`${s}=${e[s]}`).join("&")}`:""}function cN(e,{id:t,defaultColor:r,defaultMarkerStart:s,defaultMarkerEnd:o}){const a=new Set;return e.reduce((u,c)=>([c.markerStart||s,c.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=vd(h,t);a.has(p)||(u.push({id:p,color:h.color||r,...h}),a.add(p))}}),u),[]).sort((u,c)=>u.id.localeCompare(c.id))}const $y=1e3,dN=10,Wd={nodeOrigin:[0,0],nodeExtent:qo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},fN={...Wd,checkEquality:!0};function Yd(e,t){const r={...e};for(const s in t)t[s]!==void 0&&(r[s]=t[s]);return r}function hN(e,t,r){const s=Yd(Wd,r);for(const o of e.values())if(o.parentId)qd(o,e,t,s);else{const a=sl(o,s.nodeOrigin),u=Ys(o.extent)?o.extent:s.nodeExtent,c=Gi(a,u,Fr(o));o.internals.positionAbsolute=c}}function pN(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const r=[],s=[];for(const o of e.handles){const a={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?r.push(a):o.type==="target"&&s.push(a)}return{source:r,target:s}}function Xd(e){return e==="manual"}function wd(e,t,r,s={}){var p,m;const o=Yd(fN,s),a={i:0},u=new Map(t),c=o!=null&&o.elevateNodesOnSelect&&!Xd(o.zIndexMode)?$y:0;let h=e.length>0;t.clear(),r.clear();for(const g of e){let x=u.get(g.id);if(o.checkEquality&&g===(x==null?void 0:x.internals.userNode))t.set(g.id,x);else{const w=sl(g,o.nodeOrigin),k=Ys(g.extent)?g.extent:o.nodeExtent,E=Gi(w,k,Fr(g));x={...o.defaults,...g,measured:{width:(p=g.measured)==null?void 0:p.width,height:(m=g.measured)==null?void 0:m.height},internals:{positionAbsolute:E,handleBounds:pN(g,x),z:By(g,c,o.zIndexMode),userNode:g}},t.set(g.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(h=!1),g.parentId&&qd(x,t,r,s,a)}return h}function mN(e,t){if(!e.parentId)return;const r=t.get(e.parentId);r?r.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function qd(e,t,r,s,o){const{elevateNodesOnSelect:a,nodeOrigin:u,nodeExtent:c,zIndexMode:h}=Yd(Wd,s),p=e.parentId,m=t.get(p);if(!m){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}mN(e,r),o&&!m.parentId&&m.internals.rootParentIndex===void 0&&h==="auto"&&(m.internals.rootParentIndex=++o.i,m.internals.z=m.internals.z+o.i*dN),o&&m.internals.rootParentIndex!==void 0&&(o.i=m.internals.rootParentIndex);const g=a&&!Xd(h)?$y:0,{x,y:w,z:k}=gN(e,m,u,c,g,h),{positionAbsolute:E}=e.internals,C=x!==E.x||w!==E.y;(C||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:C?{x,y:w}:E,z:k}})}function By(e,t,r){const s=Zn(e.zIndex)?e.zIndex:0;return Xd(r)?s:s+(e.selected?t:0)}function gN(e,t,r,s,o,a){const{x:u,y:c}=t.internals.positionAbsolute,h=Fr(e),p=sl(e,r),m=Ys(e.extent)?Gi(p,e.extent,h):p;let g=Gi({x:u+m.x,y:c+m.y},s,h);e.extent==="parent"&&(g=by(g,h,t));const x=By(e,o,a),w=t.internals.z??0;return{x:g.x,y:g.y,z:w>=x?w+1:x}}function Gd(e,t,r,s=[0,0]){var u;const o=[],a=new Map;for(const c of e){const h=t.get(c.parentId);if(!h)continue;const p=((u=a.get(c.parentId))==null?void 0:u.expandedRect)??Ws(h),m=_y(p,c.rect);a.set(c.parentId,{expandedRect:m,parent:h})}return a.size>0&&a.forEach(({expandedRect:c,parent:h},p)=>{var N;const m=h.internals.positionAbsolute,g=Fr(h),x=h.origin??s,w=c.x<m.x?Math.round(Math.abs(m.x-c.x)):0,k=c.y<m.y?Math.round(Math.abs(m.y-c.y)):0,E=Math.max(g.width,Math.round(c.width)),C=Math.max(g.height,Math.round(c.height)),S=(E-g.width)*x[0],b=(C-g.height)*x[1];(w>0||k>0||S||b)&&(o.push({id:p,type:"position",position:{x:h.position.x-w+S,y:h.position.y-k+b}}),(N=r.get(p))==null||N.forEach(I=>{e.some(B=>B.id===I.id)||o.push({id:I.id,type:"position",position:{x:I.position.x+w,y:I.position.y+k}})})),(g.width<c.width||g.height<c.height||w||k)&&o.push({id:p,type:"dimensions",setAttributes:!0,dimensions:{width:E+(w?x[0]*w-S:0),height:C+(k?x[1]*k-b:0)}})}),o}function yN(e,t,r,s,o,a,u){const c=s==null?void 0:s.querySelector(".xyflow__viewport");let h=!1;if(!c)return{changes:[],updatedInternals:h};const p=[],m=window.getComputedStyle(c),{m22:g}=new window.DOMMatrixReadOnly(m.transform),x=[];for(const w of e.values()){const k=t.get(w.id);if(!k)continue;if(k.hidden){t.set(k.id,{...k,internals:{...k.internals,handleBounds:void 0}}),h=!0;continue}const E=Ud(w.nodeElement),C=k.measured.width!==E.width||k.measured.height!==E.height;if(!!(E.width&&E.height&&(C||!k.internals.handleBounds||w.force))){const b=w.nodeElement.getBoundingClientRect(),N=Ys(k.extent)?k.extent:a;let{positionAbsolute:I}=k.internals;k.parentId&&k.extent==="parent"?I=by(I,E,t.get(k.parentId)):N&&(I=Gi(I,N,E));const B={...k,measured:E,internals:{...k.internals,positionAbsolute:I,handleBounds:{source:sm("source",w.nodeElement,b,g,k.id),target:sm("target",w.nodeElement,b,g,k.id)}}};t.set(k.id,B),k.parentId&&qd(B,t,r,{nodeOrigin:o,zIndexMode:u}),h=!0,C&&(p.push({id:k.id,type:"dimensions",dimensions:E}),k.expandParent&&k.parentId&&x.push({id:k.id,parentId:k.parentId,rect:Ws(B,o)}))}}if(x.length>0){const w=Gd(x,t,r,o);p.push(...w)}return{changes:p,updatedInternals:h}}async function xN({delta:e,panZoom:t,transform:r,translateExtent:s,width:o,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const u=await t.setViewportConstrained({x:r[0]+e.x,y:r[1]+e.y,zoom:r[2]},[[0,0],[o,a]],s),c=!!u&&(u.x!==r[0]||u.y!==r[1]||u.k!==r[2]);return Promise.resolve(c)}function fm(e,t,r,s,o,a){let u=o;const c=s.get(u)||new Map;s.set(u,c.set(r,t)),u=`${o}-${e}`;const h=s.get(u)||new Map;if(s.set(u,h.set(r,t)),a){u=`${o}-${e}-${a}`;const p=s.get(u)||new Map;s.set(u,p.set(r,t))}}function Hy(e,t,r){e.clear(),t.clear();for(const s of r){const{source:o,target:a,sourceHandle:u=null,targetHandle:c=null}=s,h={edgeId:s.id,source:o,target:a,sourceHandle:u,targetHandle:c},p=`${o}-${u}--${a}-${c}`,m=`${a}-${c}--${o}-${u}`;fm("source",h,m,e,o,u),fm("target",h,p,e,a,c),t.set(s.id,s)}}function Vy(e,t){if(!e.parentId)return!1;const r=t.get(e.parentId);return r?r.selected?!0:Vy(r,t):!1}function hm(e,t,r){var o;let s=e;do{if((o=s==null?void 0:s.matches)!=null&&o.call(s,t))return!0;if(s===r)return!1;s=s==null?void 0:s.parentElement}while(s);return!1}function vN(e,t,r,s){const o=new Map;for(const[a,u]of e)if((u.selected||u.id===s)&&(!u.parentId||!Vy(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const c=e.get(a);c&&o.set(a,{id:a,position:c.position||{x:0,y:0},distance:{x:r.x-c.internals.positionAbsolute.x,y:r.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return o}function $c({nodeId:e,dragItems:t,nodeLookup:r,dragging:s=!0}){var u,c,h;const o=[];for(const[p,m]of t){const g=(u=r.get(p))==null?void 0:u.internals.userNode;g&&o.push({...g,position:m.position,dragging:s})}if(!e)return[o[0],o];const a=(c=r.get(e))==null?void 0:c.internals.userNode;return[a?{...a,position:((h=t.get(e))==null?void 0:h.position)||a.position,dragging:s}:o[0],o]}function wN({dragItems:e,snapGrid:t,x:r,y:s}){const o=e.values().next().value;if(!o)return null;const a={x:r-o.distance.x,y:s-o.distance.y},u=ll(a,t);return{x:u.x-a.x,y:u.y-a.y}}function SN({onNodeMouseDown:e,getStoreItems:t,onDragStart:r,onDrag:s,onDragStop:o}){let a={x:null,y:null},u=0,c=new Map,h=!1,p={x:0,y:0},m=null,g=!1,x=null,w=!1,k=!1,E=null;function C({noDragClassName:b,handleSelector:N,domNode:I,isSelectable:B,nodeId:T,nodeClickDistance:$=0}){x=Cn(I);function Q({x:W,y:J}){const{nodeLookup:P,nodeExtent:O,snapGrid:F,snapToGrid:K,nodeOrigin:R,onNodeDrag:V,onSelectionDrag:j,onError:z,updateNodePositions:Y}=t();a={x:W,y:J};let A=!1;const le=c.size>1,fe=le&&O?yd(ol(c)):null,ce=le&&K?wN({dragItems:c,snapGrid:F,x:W,y:J}):null;for(const[ve,se]of c){if(!P.has(ve))continue;let xe={x:W-se.distance.x,y:J-se.distance.y};K&&(xe=ce?{x:Math.round(xe.x+ce.x),y:Math.round(xe.y+ce.y)}:ll(xe,F));let je=null;if(le&&O&&!se.extent&&fe){const{positionAbsolute:Ce}=se.internals,Ve=Ce.x-fe.x+O[0][0],We=Ce.x+se.measured.width-fe.x2+O[1][0],Oe=Ce.y-fe.y+O[0][1],tt=Ce.y+se.measured.height-fe.y2+O[1][1];je=[[Ve,Oe],[We,tt]]}const{position:Pe,positionAbsolute:Ee}=Cy({nodeId:ve,nextPosition:xe,nodeLookup:P,nodeExtent:je||O,nodeOrigin:R,onError:z});A=A||se.position.x!==Pe.x||se.position.y!==Pe.y,se.position=Pe,se.internals.positionAbsolute=Ee}if(k=k||A,!!A&&(Y(c,!0),E&&(s||V||!T&&j))){const[ve,se]=$c({nodeId:T,dragItems:c,nodeLookup:P});s==null||s(E,c,ve,se),V==null||V(E,ve,se),T||j==null||j(E,se)}}async function U(){if(!m)return;const{transform:W,panBy:J,autoPanSpeed:P,autoPanOnNodeDrag:O}=t();if(!O){h=!1,cancelAnimationFrame(u);return}const[F,K]=jy(p,m,P);(F!==0||K!==0)&&(a.x=(a.x??0)-F/W[2],a.y=(a.y??0)-K/W[2],await J({x:F,y:K})&&Q(a)),u=requestAnimationFrame(U)}function q(W){var le;const{nodeLookup:J,multiSelectionActive:P,nodesDraggable:O,transform:F,snapGrid:K,snapToGrid:R,selectNodesOnDrag:V,onNodeDragStart:j,onSelectionDragStart:z,unselectNodesAndEdges:Y}=t();g=!0,(!V||!B)&&!P&&T&&((le=J.get(T))!=null&&le.selected||Y()),B&&V&&T&&(e==null||e(T));const A=$o(W.sourceEvent,{transform:F,snapGrid:K,snapToGrid:R,containerBounds:m});if(a=A,c=vN(J,O,A,T),c.size>0&&(r||j||!T&&z)){const[fe,ce]=$c({nodeId:T,dragItems:c,nodeLookup:J});r==null||r(W.sourceEvent,c,fe,ce),j==null||j(W.sourceEvent,fe,ce),T||z==null||z(W.sourceEvent,ce)}}const L=iy().clickDistance($).on("start",W=>{const{domNode:J,nodeDragThreshold:P,transform:O,snapGrid:F,snapToGrid:K}=t();m=(J==null?void 0:J.getBoundingClientRect())||null,w=!1,k=!1,E=W.sourceEvent,P===0&&q(W),a=$o(W.sourceEvent,{transform:O,snapGrid:F,snapToGrid:K,containerBounds:m}),p=Jn(W.sourceEvent,m)}).on("drag",W=>{const{autoPanOnNodeDrag:J,transform:P,snapGrid:O,snapToGrid:F,nodeDragThreshold:K,nodeLookup:R}=t(),V=$o(W.sourceEvent,{transform:P,snapGrid:O,snapToGrid:F,containerBounds:m});if(E=W.sourceEvent,(W.sourceEvent.type==="touchmove"&&W.sourceEvent.touches.length>1||T&&!R.has(T))&&(w=!0),!w){if(!h&&J&&g&&(h=!0,U()),!g){const j=Jn(W.sourceEvent,m),z=j.x-p.x,Y=j.y-p.y;Math.sqrt(z*z+Y*Y)>K&&q(W)}(a.x!==V.xSnapped||a.y!==V.ySnapped)&&c&&g&&(p=Jn(W.sourceEvent,m),Q(V))}}).on("end",W=>{if(!(!g||w)&&(h=!1,g=!1,cancelAnimationFrame(u),c.size>0)){const{nodeLookup:J,updateNodePositions:P,onNodeDragStop:O,onSelectionDragStop:F}=t();if(k&&(P(c,!1),k=!1),o||O||!T&&F){const[K,R]=$c({nodeId:T,dragItems:c,nodeLookup:J,dragging:!1});o==null||o(W.sourceEvent,c,K,R),O==null||O(W.sourceEvent,K,R),T||F==null||F(W.sourceEvent,R)}}}).filter(W=>{const J=W.target;return!W.button&&(!b||!hm(J,`.${b}`,I))&&(!N||hm(J,N,I))});x.call(L)}function S(){x==null||x.on(".drag",null)}return{update:C,destroy:S}}function kN(e,t,r){const s=[],o={x:e.x-r,y:e.y-r,width:r*2,height:r*2};for(const a of t.values())Qo(o,Ws(a))>0&&s.push(a);return s}const NN=250;function EN(e,t,r,s){var c,h;let o=[],a=1/0;const u=kN(e,r,t+NN);for(const p of u){const m=[...((c=p.internals.handleBounds)==null?void 0:c.source)??[],...((h=p.internals.handleBounds)==null?void 0:h.target)??[]];for(const g of m){if(s.nodeId===g.nodeId&&s.type===g.type&&s.id===g.id)continue;const{x,y:w}=Ki(p,g,g.position,!0),k=Math.sqrt(Math.pow(x-e.x,2)+Math.pow(w-e.y,2));k>t||(k<a?(o=[{...g,x,y:w}],a=k):k===a&&o.push({...g,x,y:w}))}}if(!o.length)return null;if(o.length>1){const p=s.type==="source"?"target":"source";return o.find(m=>m.type===p)??o[0]}return o[0]}function Uy(e,t,r,s,o,a=!1){var p,m,g;const u=s.get(e);if(!u)return null;const c=o==="strict"?(p=u.internals.handleBounds)==null?void 0:p[t]:[...((m=u.internals.handleBounds)==null?void 0:m.source)??[],...((g=u.internals.handleBounds)==null?void 0:g.target)??[]],h=(r?c==null?void 0:c.find(x=>x.id===r):c==null?void 0:c[0])??null;return h&&a?{...h,...Ki(u,h,h.position,!0)}:h}function Wy(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function CN(e,t){let r=null;return t?r=!0:e&&!t&&(r=!1),r}const Yy=()=>!0;function bN(e,{connectionMode:t,connectionRadius:r,handleId:s,nodeId:o,edgeUpdaterType:a,isTarget:u,domNode:c,nodeLookup:h,lib:p,autoPanOnConnect:m,flowId:g,panBy:x,cancelConnection:w,onConnectStart:k,onConnect:E,onConnectEnd:C,isValidConnection:S=Yy,onReconnectEnd:b,updateConnection:N,getTransform:I,getFromHandle:B,autoPanSpeed:T,dragThreshold:$=1,handleDomNode:Q}){const U=Py(e.target);let q=0,L;const{x:W,y:J}=Jn(e),P=Wy(a,Q),O=c==null?void 0:c.getBoundingClientRect();let F=!1;if(!O||!P)return;const K=Uy(o,P,s,h,t);if(!K)return;let R=Jn(e,O),V=!1,j=null,z=!1,Y=null;function A(){if(!m||!O)return;const[Pe,Ee]=jy(R,O,T);x({x:Pe,y:Ee}),q=requestAnimationFrame(A)}const le={...K,nodeId:o,type:P,position:K.position},fe=h.get(o);let ve={inProgress:!0,isValid:null,from:Ki(fe,le,Te.Left,!0),fromHandle:le,fromPosition:le.position,fromNode:fe,to:R,toHandle:null,toPosition:tm[le.position],toNode:null,pointer:R};function se(){F=!0,N(ve),k==null||k(e,{nodeId:o,handleId:s,handleType:P})}$===0&&se();function xe(Pe){if(!F){const{x:tt,y:It}=Jn(Pe),bt=tt-W,gt=It-J;if(!(bt*bt+gt*gt>$*$))return;se()}if(!B()||!le){je(Pe);return}const Ee=I();R=Jn(Pe,O),L=EN(al(R,Ee,!1,[1,1]),r,h,le),V||(A(),V=!0);const Ce=Xy(Pe,{handle:L,connectionMode:t,fromNodeId:o,fromHandleId:s,fromType:u?"target":"source",isValidConnection:S,doc:U,lib:p,flowId:g,nodeLookup:h});Y=Ce.handleDomNode,j=Ce.connection,z=CN(!!L,Ce.isValid);const Ve=h.get(o),We=Ve?Ki(Ve,le,Te.Left,!0):ve.from,Oe={...ve,from:We,isValid:z,to:Ce.toHandle&&z?Da({x:Ce.toHandle.x,y:Ce.toHandle.y},Ee):R,toHandle:Ce.toHandle,toPosition:z&&Ce.toHandle?Ce.toHandle.position:tm[le.position],toNode:Ce.toHandle?h.get(Ce.toHandle.nodeId):null,pointer:R};N(Oe),ve=Oe}function je(Pe){if(!("touches"in Pe&&Pe.touches.length>0)){if(F){(L||Y)&&j&&z&&(E==null||E(j));const{inProgress:Ee,...Ce}=ve,Ve={...Ce,toPosition:ve.toHandle?ve.toPosition:null};C==null||C(Pe,Ve),a&&(b==null||b(Pe,Ve))}w(),cancelAnimationFrame(q),V=!1,z=!1,j=null,Y=null,U.removeEventListener("mousemove",xe),U.removeEventListener("mouseup",je),U.removeEventListener("touchmove",xe),U.removeEventListener("touchend",je)}}U.addEventListener("mousemove",xe),U.addEventListener("mouseup",je),U.addEventListener("touchmove",xe),U.addEventListener("touchend",je)}function Xy(e,{handle:t,connectionMode:r,fromNodeId:s,fromHandleId:o,fromType:a,doc:u,lib:c,flowId:h,isValidConnection:p=Yy,nodeLookup:m}){const g=a==="target",x=t?u.querySelector(`.${c}-flow__handle[data-id="${h}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:w,y:k}=Jn(e),E=u.elementFromPoint(w,k),C=E!=null&&E.classList.contains(`${c}-flow__handle`)?E:x,S={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const b=Wy(void 0,C),N=C.getAttribute("data-nodeid"),I=C.getAttribute("data-handleid"),B=C.classList.contains("connectable"),T=C.classList.contains("connectableend");if(!N||!b)return S;const $={source:g?N:s,sourceHandle:g?I:o,target:g?s:N,targetHandle:g?o:I};S.connection=$;const U=B&&T&&(r===qi.Strict?g&&b==="source"||!g&&b==="target":N!==s||I!==o);S.isValid=U&&p($),S.toHandle=Uy(N,b,I,m,r,!0)}return S}const Sd={onPointerDown:bN,isValid:Xy};function jN({domNode:e,panZoom:t,getTransform:r,getViewScale:s}){const o=Cn(e);function a({translateExtent:c,width:h,height:p,zoomStep:m=1,pannable:g=!0,zoomable:x=!0,inversePan:w=!1}){const k=N=>{if(N.sourceEvent.type!=="wheel"||!t)return;const I=r(),B=N.sourceEvent.ctrlKey&&Zo()?10:1,T=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*m,$=I[2]*Math.pow(2,T*B);t.scaleTo($)};let E=[0,0];const C=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(E=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},S=N=>{const I=r();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!t)return;const B=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],T=[B[0]-E[0],B[1]-E[1]];E=B;const $=s()*Math.max(I[2],Math.log(I[2]))*(w?-1:1),Q={x:I[0]-T[0]*$,y:I[1]-T[1]*$},U=[[0,0],[h,p]];t.setViewportConstrained({x:Q.x,y:Q.y,zoom:I[2]},U,c)},b=vy().on("start",C).on("zoom",g?S:null).on("zoom.wheel",x?k:null);o.call(b,{})}function u(){o.on("zoom",null)}return{update:a,destroy:u,pointer:Kn}}const Ka=e=>({x:e.x,y:e.y,zoom:e.k}),Bc=({x:e,y:t,zoom:r})=>Xa.translate(e,t).scale(r),Ls=(e,t)=>e.target.closest(`.${t}`),qy=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),_N=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Hc=(e,t=0,r=_N,s=()=>{})=>{const o=typeof t=="number"&&t>0;return o||s(),o?e.transition().duration(t).ease(r).on("end",s):e},Gy=e=>{const t=e.ctrlKey&&Zo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function IN({zoomPanValues:e,noWheelClassName:t,d3Selection:r,d3Zoom:s,panOnScrollMode:o,panOnScrollSpeed:a,zoomOnPinch:u,onPanZoomStart:c,onPanZoom:h,onPanZoomEnd:p}){return m=>{if(Ls(m,t))return m.ctrlKey&&m.preventDefault(),!1;m.preventDefault(),m.stopImmediatePropagation();const g=r.property("__zoom").k||1;if(m.ctrlKey&&u){const C=Kn(m),S=Gy(m),b=g*Math.pow(2,S);s.scaleTo(r,b,C,m);return}const x=m.deltaMode===1?20:1;let w=o===Wi.Vertical?0:m.deltaX*x,k=o===Wi.Horizontal?0:m.deltaY*x;!Zo()&&m.shiftKey&&o!==Wi.Vertical&&(w=m.deltaY*x,k=0),s.translateBy(r,-(w/g)*a,-(k/g)*a,{internal:!0});const E=Ka(r.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h==null||h(m,E),e.panScrollTimeout=setTimeout(()=>{p==null||p(m,E),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,c==null||c(m,E))}}function TN({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:r}){return function(s,o){const a=s.type==="wheel",u=!t&&a&&!s.ctrlKey,c=Ls(s,e);if(s.ctrlKey&&a&&c&&s.preventDefault(),u||c)return null;s.preventDefault(),r.call(this,s,o)}}function PN({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:r}){return s=>{var a,u,c;if((a=s.sourceEvent)!=null&&a.internal)return;const o=Ka(s.transform);e.mouseButton=((u=s.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((c=s.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),r&&(r==null||r(s.sourceEvent,o))}}function AN({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:r,onTransformChange:s,onPanZoom:o}){return a=>{var u,c;e.usedRightMouseButton=!!(r&&qy(t,e.mouseButton??0)),(u=a.sourceEvent)!=null&&u.sync||s([a.transform.x,a.transform.y,a.transform.k]),o&&!((c=a.sourceEvent)!=null&&c.internal)&&(o==null||o(a.sourceEvent,Ka(a.transform)))}}function MN({zoomPanValues:e,panOnDrag:t,panOnScroll:r,onDraggingChange:s,onPanZoomEnd:o,onPaneContextMenu:a}){return u=>{var c;if(!((c=u.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,a&&qy(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&a(u.sourceEvent),e.usedRightMouseButton=!1,s(!1),o)){const h=Ka(u.transform);e.prevViewport=h,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(u.sourceEvent,h)},r?150:0)}}}function RN({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:r,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:a,userSelectionActive:u,noWheelClassName:c,noPanClassName:h,lib:p,connectionInProgress:m}){return g=>{var C;const x=e||t,w=r&&g.ctrlKey,k=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Ls(g,`${p}-flow__node`)||Ls(g,`${p}-flow__edge`)))return!0;if(!s&&!x&&!o&&!a&&!r||u||m&&!k||Ls(g,c)&&k||Ls(g,h)&&(!k||o&&k&&!e)||!r&&g.ctrlKey&&k)return!1;if(!r&&g.type==="touchstart"&&((C=g.touches)==null?void 0:C.length)>1)return g.preventDefault(),!1;if(!x&&!o&&!w&&k||!s&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(s)&&!s.includes(g.button)&&g.type==="mousedown")return!1;const E=Array.isArray(s)&&s.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||k)&&E}}function zN({domNode:e,minZoom:t,maxZoom:r,translateExtent:s,viewport:o,onPanZoom:a,onPanZoomStart:u,onPanZoomEnd:c,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},m=e.getBoundingClientRect(),g=vy().scaleExtent([t,r]).translateExtent(s),x=Cn(e).call(g);b({x:o.x,y:o.y,zoom:Us(o.zoom,t,r)},[[0,0],[m.width,m.height]],s);const w=x.on("wheel.zoom"),k=x.on("dblclick.zoom");g.wheelDelta(Gy);function E(L,W){return x?new Promise(J=>{g==null||g.interpolate((W==null?void 0:W.interpolate)==="linear"?Oo:Ea).transform(Hc(x,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>J(!0)),L)}):Promise.resolve(!1)}function C({noWheelClassName:L,noPanClassName:W,onPaneContextMenu:J,userSelectionActive:P,panOnScroll:O,panOnDrag:F,panOnScrollMode:K,panOnScrollSpeed:R,preventScrolling:V,zoomOnPinch:j,zoomOnScroll:z,zoomOnDoubleClick:Y,zoomActivationKeyPressed:A,lib:le,onTransformChange:fe,connectionInProgress:ce,paneClickDistance:ve,selectionOnDrag:se}){P&&!p.isZoomingOrPanning&&S();const xe=O&&!A&&!P;g.clickDistance(se?1/0:!Zn(ve)||ve<0?0:ve);const je=xe?IN({zoomPanValues:p,noWheelClassName:L,d3Selection:x,d3Zoom:g,panOnScrollMode:K,panOnScrollSpeed:R,zoomOnPinch:j,onPanZoomStart:u,onPanZoom:a,onPanZoomEnd:c}):TN({noWheelClassName:L,preventScrolling:V,d3ZoomHandler:w});if(x.on("wheel.zoom",je,{passive:!1}),!P){const Ee=PN({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});g.on("start",Ee);const Ce=AN({zoomPanValues:p,panOnDrag:F,onPaneContextMenu:!!J,onPanZoom:a,onTransformChange:fe});g.on("zoom",Ce);const Ve=MN({zoomPanValues:p,panOnDrag:F,panOnScroll:O,onPaneContextMenu:J,onPanZoomEnd:c,onDraggingChange:h});g.on("end",Ve)}const Pe=RN({zoomActivationKeyPressed:A,panOnDrag:F,zoomOnScroll:z,panOnScroll:O,zoomOnDoubleClick:Y,zoomOnPinch:j,userSelectionActive:P,noPanClassName:W,noWheelClassName:L,lib:le,connectionInProgress:ce});g.filter(Pe),Y?x.on("dblclick.zoom",k):x.on("dblclick.zoom",null)}function S(){g.on("zoom",null)}async function b(L,W,J){const P=Bc(L),O=g==null?void 0:g.constrain()(P,W,J);return O&&await E(O),new Promise(F=>F(O))}async function N(L,W){const J=Bc(L);return await E(J,W),new Promise(P=>P(J))}function I(L){if(x){const W=Bc(L),J=x.property("__zoom");(J.k!==L.zoom||J.x!==L.x||J.y!==L.y)&&(g==null||g.transform(x,W,null,{sync:!0}))}}function B(){const L=x?xy(x.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}function T(L,W){return x?new Promise(J=>{g==null||g.interpolate((W==null?void 0:W.interpolate)==="linear"?Oo:Ea).scaleTo(Hc(x,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>J(!0)),L)}):Promise.resolve(!1)}function $(L,W){return x?new Promise(J=>{g==null||g.interpolate((W==null?void 0:W.interpolate)==="linear"?Oo:Ea).scaleBy(Hc(x,W==null?void 0:W.duration,W==null?void 0:W.ease,()=>J(!0)),L)}):Promise.resolve(!1)}function Q(L){g==null||g.scaleExtent(L)}function U(L){g==null||g.translateExtent(L)}function q(L){const W=!Zn(L)||L<0?0:L;g==null||g.clickDistance(W)}return{update:C,destroy:S,setViewport:N,setViewportConstrained:b,getViewport:B,scaleTo:T,scaleBy:$,setScaleExtent:Q,setTranslateExtent:U,syncViewport:I,setClickDistance:q}}var Qi;(function(e){e.Line="line",e.Handle="handle"})(Qi||(Qi={}));const LN=["top-left","top-right","bottom-left","bottom-right"],DN=["top","right","bottom","left"];function FN({width:e,prevWidth:t,height:r,prevHeight:s,affectsX:o,affectsY:a}){const u=e-t,c=r-s,h=[u>0?1:u<0?-1:0,c>0?1:c<0?-1:0];return u&&o&&(h[0]=h[0]*-1),c&&a&&(h[1]=h[1]*-1),h}function pm(e){const t=e.includes("right")||e.includes("left"),r=e.includes("bottom")||e.includes("top"),s=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:r,affectsX:s,affectsY:o}}function di(e,t){return Math.max(0,t-e)}function fi(e,t){return Math.max(0,e-t)}function ya(e,t,r){return Math.max(0,t-e,e-r)}function mm(e,t){return e?!t:t}function ON(e,t,r,s,o,a,u,c){let{affectsX:h,affectsY:p}=t;const{isHorizontal:m,isVertical:g}=t,x=m&&g,{xSnapped:w,ySnapped:k}=r,{minWidth:E,maxWidth:C,minHeight:S,maxHeight:b}=s,{x:N,y:I,width:B,height:T,aspectRatio:$}=e;let Q=Math.floor(m?w-e.pointerX:0),U=Math.floor(g?k-e.pointerY:0);const q=B+(h?-Q:Q),L=T+(p?-U:U),W=-a[0]*B,J=-a[1]*T;let P=ya(q,E,C),O=ya(L,S,b);if(u){let R=0,V=0;h&&Q<0?R=di(N+Q+W,u[0][0]):!h&&Q>0&&(R=fi(N+q+W,u[1][0])),p&&U<0?V=di(I+U+J,u[0][1]):!p&&U>0&&(V=fi(I+L+J,u[1][1])),P=Math.max(P,R),O=Math.max(O,V)}if(c){let R=0,V=0;h&&Q>0?R=fi(N+Q,c[0][0]):!h&&Q<0&&(R=di(N+q,c[1][0])),p&&U>0?V=fi(I+U,c[0][1]):!p&&U<0&&(V=di(I+L,c[1][1])),P=Math.max(P,R),O=Math.max(O,V)}if(o){if(m){const R=ya(q/$,S,b)*$;if(P=Math.max(P,R),u){let V=0;!h&&!p||h&&!p&&x?V=fi(I+J+q/$,u[1][1])*$:V=di(I+J+(h?Q:-Q)/$,u[0][1])*$,P=Math.max(P,V)}if(c){let V=0;!h&&!p||h&&!p&&x?V=di(I+q/$,c[1][1])*$:V=fi(I+(h?Q:-Q)/$,c[0][1])*$,P=Math.max(P,V)}}if(g){const R=ya(L*$,E,C)/$;if(O=Math.max(O,R),u){let V=0;!h&&!p||p&&!h&&x?V=fi(N+L*$+W,u[1][0])/$:V=di(N+(p?U:-U)*$+W,u[0][0])/$,O=Math.max(O,V)}if(c){let V=0;!h&&!p||p&&!h&&x?V=di(N+L*$,c[1][0])/$:V=fi(N+(p?U:-U)*$,c[0][0])/$,O=Math.max(O,V)}}}U=U+(U<0?O:-O),Q=Q+(Q<0?P:-P),o&&(x?q>L*$?U=(mm(h,p)?-Q:Q)/$:Q=(mm(h,p)?-U:U)*$:m?(U=Q/$,p=h):(Q=U*$,h=p));const F=h?N+Q:N,K=p?I+U:I;return{width:B+(h?-Q:Q),height:T+(p?-U:U),x:a[0]*Q*(h?-1:1)+F,y:a[1]*U*(p?-1:1)+K}}const Ky={width:0,height:0,x:0,y:0},$N={...Ky,pointerX:0,pointerY:0,aspectRatio:1};function BN(e){return[[0,0],[e.measured.width,e.measured.height]]}function HN(e,t,r){const s=t.position.x+e.position.x,o=t.position.y+e.position.y,a=e.measured.width??0,u=e.measured.height??0,c=r[0]*a,h=r[1]*u;return[[s-c,o-h],[s+a-c,o+u-h]]}function VN({domNode:e,nodeId:t,getStoreItems:r,onChange:s,onEnd:o}){const a=Cn(e);let u={controlDirection:pm("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:p,boundaries:m,keepAspectRatio:g,resizeDirection:x,onResizeStart:w,onResize:k,onResizeEnd:E,shouldResize:C}){let S={...Ky},b={...$N};u={boundaries:m,resizeDirection:x,keepAspectRatio:g,controlDirection:pm(p)};let N,I=null,B=[],T,$,Q,U=!1;const q=iy().on("start",L=>{const{nodeLookup:W,transform:J,snapGrid:P,snapToGrid:O,nodeOrigin:F,paneDomNode:K}=r();if(N=W.get(t),!N)return;I=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:R,ySnapped:V}=$o(L.sourceEvent,{transform:J,snapGrid:P,snapToGrid:O,containerBounds:I});S={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},b={...S,pointerX:R,pointerY:V,aspectRatio:S.width/S.height},T=void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(T=W.get(N.parentId),$=T&&N.extent==="parent"?BN(T):void 0),B=[],Q=void 0;for(const[j,z]of W)if(z.parentId===t&&(B.push({id:j,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const Y=HN(z,N,z.origin??F);Q?Q=[[Math.min(Y[0][0],Q[0][0]),Math.min(Y[0][1],Q[0][1])],[Math.max(Y[1][0],Q[1][0]),Math.max(Y[1][1],Q[1][1])]]:Q=Y}w==null||w(L,{...S})}).on("drag",L=>{const{transform:W,snapGrid:J,snapToGrid:P,nodeOrigin:O}=r(),F=$o(L.sourceEvent,{transform:W,snapGrid:J,snapToGrid:P,containerBounds:I}),K=[];if(!N)return;const{x:R,y:V,width:j,height:z}=S,Y={},A=N.origin??O,{width:le,height:fe,x:ce,y:ve}=ON(b,u.controlDirection,F,u.boundaries,u.keepAspectRatio,A,$,Q),se=le!==j,xe=fe!==z,je=ce!==R&&se,Pe=ve!==V&&xe;if(!je&&!Pe&&!se&&!xe)return;if((je||Pe||A[0]===1||A[1]===1)&&(Y.x=je?ce:S.x,Y.y=Pe?ve:S.y,S.x=Y.x,S.y=Y.y,B.length>0)){const We=ce-R,Oe=ve-V;for(const tt of B)tt.position={x:tt.position.x-We+A[0]*(le-j),y:tt.position.y-Oe+A[1]*(fe-z)},K.push(tt)}if((se||xe)&&(Y.width=se&&(!u.resizeDirection||u.resizeDirection==="horizontal")?le:S.width,Y.height=xe&&(!u.resizeDirection||u.resizeDirection==="vertical")?fe:S.height,S.width=Y.width,S.height=Y.height),T&&N.expandParent){const We=A[0]*(Y.width??0);Y.x&&Y.x<We&&(S.x=We,b.x=b.x-(Y.x-We));const Oe=A[1]*(Y.height??0);Y.y&&Y.y<Oe&&(S.y=Oe,b.y=b.y-(Y.y-Oe))}const Ee=FN({width:S.width,prevWidth:j,height:S.height,prevHeight:z,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),Ce={...S,direction:Ee};(C==null?void 0:C(L,Ce))!==!1&&(U=!0,k==null||k(L,Ce),s(Y,K))}).on("end",L=>{U&&(E==null||E(L,{...S}),o==null||o({...S}),U=!1)});a.call(q)}function h(){a.on(".drag",null)}return{update:c,destroy:h}}var Vc={exports:{}},Uc={},Wc={exports:{}},Yc={};/**
|
|
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 gm;function UN(){if(gm)return Yc;gm=1;var e=nl();function t(g,x){return g===x&&(g!==0||1/g===1/x)||g!==g&&x!==x}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,a=e.useLayoutEffect,u=e.useDebugValue;function c(g,x){var w=x(),k=s({inst:{value:w,getSnapshot:x}}),E=k[0].inst,C=k[1];return a(function(){E.value=w,E.getSnapshot=x,h(E)&&C({inst:E})},[g,w,x]),o(function(){return h(E)&&C({inst:E}),g(function(){h(E)&&C({inst:E})})},[g]),u(w),w}function h(g){var x=g.getSnapshot;g=g.value;try{var w=x();return!r(g,w)}catch{return!0}}function p(g,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:c;return Yc.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,Yc}var ym;function WN(){return ym||(ym=1,Wc.exports=UN()),Wc.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 xm;function YN(){if(xm)return Uc;xm=1;var e=nl(),t=WN();function r(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var s=typeof Object.is=="function"?Object.is:r,o=t.useSyncExternalStore,a=e.useRef,u=e.useEffect,c=e.useMemo,h=e.useDebugValue;return Uc.useSyncExternalStoreWithSelector=function(p,m,g,x,w){var k=a(null);if(k.current===null){var E={hasValue:!1,value:null};k.current=E}else E=k.current;k=c(function(){function S(T){if(!b){if(b=!0,N=T,T=x(T),w!==void 0&&E.hasValue){var $=E.value;if(w($,T))return I=$}return I=T}if($=I,s(N,T))return $;var Q=x(T);return w!==void 0&&w($,Q)?(N=T,$):(N=T,I=Q)}var b=!1,N,I,B=g===void 0?null:g;return[function(){return S(m())},B===null?void 0:function(){return S(B())}]},[m,g,x,w]);var C=o(p,k[0],k[1]);return u(function(){E.hasValue=!0,E.value=C},[C]),h(C),C},Uc}var vm;function XN(){return vm||(vm=1,Vc.exports=YN()),Vc.exports}var qN=XN();const GN=tl(qN),KN={},wm=e=>{let t;const r=new Set,s=(m,g)=>{const x=typeof m=="function"?m(t):m;if(!Object.is(x,t)){const w=t;t=g??(typeof x!="object"||x===null)?x:Object.assign({},t,x),r.forEach(k=>k(t,w))}},o=()=>t,h={setState:s,getState:o,getInitialState:()=>p,subscribe:m=>(r.add(m),()=>r.delete(m)),destroy:()=>{(KN?"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."),r.clear()}},p=t=e(s,o,h);return h},QN=e=>e?wm(e):wm,{useDebugValue:ZN}=Hg,{useSyncExternalStoreWithSelector:JN}=GN,eE=e=>e;function Qy(e,t=eE,r){const s=JN(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return ZN(s),s}const Sm=(e,t)=>{const r=QN(e),s=(o,a=t)=>Qy(r,o,a);return Object.assign(s,r),s},tE=(e,t)=>e?Sm(e,t):Sm;function ut(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[s,o]of e)if(!Object.is(o,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(const s of r)if(!Object.prototype.hasOwnProperty.call(t,s)||!Object.is(e[s],t[s]))return!1;return!0}Vg();const Qa=M.createContext(null),nE=Qa.Provider,Zy=gr.error001();function qe(e,t){const r=M.useContext(Qa);if(r===null)throw new Error(Zy);return Qy(r,e,t)}function ct(){const e=M.useContext(Qa);if(e===null)throw new Error(Zy);return M.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const km={display:"none"},rE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Jy="react-flow__node-desc",ex="react-flow__edge-desc",iE="react-flow__aria-live",sE=e=>e.ariaLiveMessage,oE=e=>e.ariaLabelConfig;function lE({rfId:e}){const t=qe(sE);return f.jsx("div",{id:`${iE}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:rE,children:t})}function aE({rfId:e,disableKeyboardA11y:t}){const r=qe(oE);return f.jsxs(f.Fragment,{children:[f.jsx("div",{id:`${Jy}-${e}`,style:km,children:t?r["node.a11yDescription.default"]:r["node.a11yDescription.keyboardDisabled"]}),f.jsx("div",{id:`${ex}-${e}`,style:km,children:r["edge.a11yDescription.default"]}),!t&&f.jsx(lE,{rfId:e})]})}const Za=M.forwardRef(({position:e="top-left",children:t,className:r,style:s,...o},a)=>{const u=`${e}`.split("-");return f.jsx("div",{className:Ct(["react-flow__panel",r,...u]),style:s,ref:a,...o,children:t})});Za.displayName="Panel";function uE({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:f.jsx(Za,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:f.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const cE=e=>{const t=[],r=[];for(const[,s]of e.nodeLookup)s.selected&&t.push(s.internals.userNode);for(const[,s]of e.edgeLookup)s.selected&&r.push(s);return{selectedNodes:t,selectedEdges:r}},xa=e=>e.id;function dE(e,t){return ut(e.selectedNodes.map(xa),t.selectedNodes.map(xa))&&ut(e.selectedEdges.map(xa),t.selectedEdges.map(xa))}function fE({onSelectionChange:e}){const t=ct(),{selectedNodes:r,selectedEdges:s}=qe(cE,dE);return M.useEffect(()=>{const o={nodes:r,edges:s};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(a=>a(o))},[r,s,e]),null}const hE=e=>!!e.onSelectionChangeHandlers;function pE({onSelectionChange:e}){const t=qe(hE);return e||t?f.jsx(fE,{onSelectionChange:e}):null}const tx=[0,0],mE={x:0,y:0,zoom:1},gE=["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"],Nm=[...gE,"rfId"],yE=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}),Em={translateExtent:qo,nodeOrigin:tx,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function xE(e){const{setNodes:t,setEdges:r,setMinZoom:s,setMaxZoom:o,setTranslateExtent:a,setNodeExtent:u,reset:c,setDefaultNodesAndEdges:h}=qe(yE,ut),p=ct();M.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{m.current=Em,c()}),[]);const m=M.useRef(Em);return M.useEffect(()=>{for(const g of Nm){const x=e[g],w=m.current[g];x!==w&&(typeof e[g]>"u"||(g==="nodes"?t(x):g==="edges"?r(x):g==="minZoom"?s(x):g==="maxZoom"?o(x):g==="translateExtent"?a(x):g==="nodeExtent"?u(x):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:eN(x)}):g==="fitView"?p.setState({fitViewQueued:x}):g==="fitViewOptions"?p.setState({fitViewOptions:x}):p.setState({[g]:x})))}m.current=e},Nm.map(g=>e[g])),null}function Cm(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function vE(e){var s;const[t,r]=M.useState(e==="system"?null:e);return M.useEffect(()=>{if(e!=="system"){r(e);return}const o=Cm(),a=()=>r(o!=null&&o.matches?"dark":"light");return a(),o==null||o.addEventListener("change",a),()=>{o==null||o.removeEventListener("change",a)}},[e]),t!==null?t:(s=Cm())!=null&&s.matches?"dark":"light"}const bm=typeof document<"u"?document:null;function Jo(e=null,t={target:bm,actInsideInputWithModifier:!0}){const[r,s]=M.useState(!1),o=M.useRef(!1),a=M.useRef(new Set([])),[u,c]=M.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
|
|
57
|
-
`).replace(`
|
|
58
|
-
|
|
59
|
-
`,`
|
|
60
|
-
+`).split(`
|
|
61
|
-
`)),m=p.reduce((g,x)=>g.concat(...x),[]);return[p,m]}return[[],[]]},[e]);return M.useEffect(()=>{const h=(t==null?void 0:t.target)??bm,p=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const m=w=>{var C,S;if(o.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!o.current||o.current&&!p)&&Ay(w))return!1;const E=_m(w.code,c);if(a.current.add(w[E]),jm(u,a.current,!1)){const b=((S=(C=w.composedPath)==null?void 0:C.call(w))==null?void 0:S[0])||w.target,N=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";t.preventDefault!==!1&&(o.current||!N)&&w.preventDefault(),s(!0)}},g=w=>{const k=_m(w.code,c);jm(u,a.current,!0)?(s(!1),a.current.clear()):a.current.delete(w[k]),w.key==="Meta"&&a.current.clear(),o.current=!1},x=()=>{a.current.clear(),s(!1)};return h==null||h.addEventListener("keydown",m),h==null||h.addEventListener("keyup",g),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{h==null||h.removeEventListener("keydown",m),h==null||h.removeEventListener("keyup",g),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[e,s]),r}function jm(e,t,r){return e.filter(s=>r||s.length===t.size).some(s=>s.every(o=>t.has(o)))}function _m(e,t){return t.includes(e)?"code":"key"}const wE=()=>{const e=ct();return M.useMemo(()=>({zoomIn:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:r}=e.getState();return r?r.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,r)=>{const{panZoom:s}=e.getState();return s?s.scaleTo(t,{duration:r==null?void 0:r.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,r)=>{const{transform:[s,o,a],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??s,y:t.y??o,zoom:t.zoom??a},r),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,r,s]=e.getState().transform;return{x:t,y:r,zoom:s}},setCenter:async(t,r,s)=>e.getState().setCenter(t,r,s),fitBounds:async(t,r)=>{const{width:s,height:o,minZoom:a,maxZoom:u,panZoom:c}=e.getState(),h=Vd(t,s,o,a,u,(r==null?void 0:r.padding)??.1);return c?(await c.setViewport(h,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,r={})=>{const{transform:s,snapGrid:o,snapToGrid:a,domNode:u}=e.getState();if(!u)return t;const{x:c,y:h}=u.getBoundingClientRect(),p={x:t.x-c,y:t.y-h},m=r.snapGrid??o,g=r.snapToGrid??a;return al(p,s,g,m)},flowToScreenPosition:t=>{const{transform:r,domNode:s}=e.getState();if(!s)return t;const{x:o,y:a}=s.getBoundingClientRect(),u=Da(t,r);return{x:u.x+o,y:u.y+a}}}),[])};function nx(e,t){const r=[],s=new Map,o=[];for(const a of e)if(a.type==="add"){o.push(a);continue}else if(a.type==="remove"||a.type==="replace")s.set(a.id,[a]);else{const u=s.get(a.id);u?u.push(a):s.set(a.id,[a])}for(const a of t){const u=s.get(a.id);if(!u){r.push(a);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){r.push({...u[0].item});continue}const c={...a};for(const h of u)SE(h,c);r.push(c)}return o.length&&o.forEach(a=>{a.index!==void 0?r.splice(a.index,0,{...a.item}):r.push({...a.item})}),r}function SE(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 rx(e,t){return nx(e,t)}function ix(e,t){return nx(e,t)}function Hi(e,t){return{id:e,type:"select",selected:t}}function Ds(e,t=new Set,r=!1){const s=[];for(const[o,a]of e){const u=t.has(o);!(a.selected===void 0&&!u)&&a.selected!==u&&(r&&(a.selected=u),s.push(Hi(a.id,u)))}return s}function Im({items:e=[],lookup:t}){var o;const r=[],s=new Map(e.map(a=>[a.id,a]));for(const[a,u]of e.entries()){const c=t.get(u.id),h=((o=c==null?void 0:c.internals)==null?void 0:o.userNode)??c;h!==void 0&&h!==u&&r.push({id:u.id,item:u,type:"replace"}),h===void 0&&r.push({item:u,type:"add",index:a})}for(const[a]of t)s.get(a)===void 0&&r.push({id:a,type:"remove"});return r}function Tm(e){return{id:e.id,type:"remove"}}const Pm=e=>Uk(e),kE=e=>Ey(e);function sx(e){return M.forwardRef(e)}const NE=typeof window<"u"?M.useLayoutEffect:M.useEffect;function Am(e){const[t,r]=M.useState(BigInt(0)),[s]=M.useState(()=>EE(()=>r(o=>o+BigInt(1))));return NE(()=>{const o=s.get();o.length&&(e(o),s.reset())},[t]),s}function EE(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:r=>{t.push(r),e()}}}const ox=M.createContext(null);function CE({children:e}){const t=ct(),r=M.useCallback(c=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:m,onNodesChange:g,nodeLookup:x,fitViewQueued:w,onNodesChangeMiddlewareMap:k}=t.getState();let E=h;for(const S of c)E=typeof S=="function"?S(E):S;let C=Im({items:E,lookup:x});for(const S of k.values())C=S(C);m&&p(E),C.length>0?g==null||g(C):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:S,nodes:b,setNodes:N}=t.getState();S&&N(b)})},[]),s=Am(r),o=M.useCallback(c=>{const{edges:h=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:x}=t.getState();let w=h;for(const k of c)w=typeof k=="function"?k(w):k;m?p(w):g&&g(Im({items:w,lookup:x}))},[]),a=Am(o),u=M.useMemo(()=>({nodeQueue:s,edgeQueue:a}),[]);return f.jsx(ox.Provider,{value:u,children:e})}function bE(){const e=M.useContext(ox);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const jE=e=>!!e.panZoom;function Kd(){const e=wE(),t=ct(),r=bE(),s=qe(jE),o=M.useMemo(()=>{const a=g=>t.getState().nodeLookup.get(g),u=g=>{r.nodeQueue.push(g)},c=g=>{r.edgeQueue.push(g)},h=g=>{var S,b;const{nodeLookup:x,nodeOrigin:w}=t.getState(),k=Pm(g)?g:x.get(g.id),E=k.parentId?Ty(k.position,k.measured,k.parentId,x,w):k.position,C={...k,position:E,width:((S=k.measured)==null?void 0:S.width)??k.width,height:((b=k.measured)==null?void 0:b.height)??k.height};return Ws(C)},p=(g,x,w={replace:!1})=>{u(k=>k.map(E=>{if(E.id===g){const C=typeof x=="function"?x(E):x;return w.replace&&Pm(C)?C:{...E,...C}}return E}))},m=(g,x,w={replace:!1})=>{c(k=>k.map(E=>{if(E.id===g){const C=typeof x=="function"?x(E):x;return w.replace&&kE(C)?C:{...E,...C}}return E}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>{var x;return(x=a(g))==null?void 0:x.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(x=>({...x}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:u,setEdges:c,addNodes:g=>{const x=Array.isArray(g)?g:[g];r.nodeQueue.push(w=>[...w,...x])},addEdges:g=>{const x=Array.isArray(g)?g:[g];r.edgeQueue.push(w=>[...w,...x])},toObject:()=>{const{nodes:g=[],edges:x=[],transform:w}=t.getState(),[k,E,C]=w;return{nodes:g.map(S=>({...S})),edges:x.map(S=>({...S})),viewport:{x:k,y:E,zoom:C}}},deleteElements:async({nodes:g=[],edges:x=[]})=>{const{nodes:w,edges:k,onNodesDelete:E,onEdgesDelete:C,triggerNodeChanges:S,triggerEdgeChanges:b,onDelete:N,onBeforeDelete:I}=t.getState(),{nodes:B,edges:T}=await Gk({nodesToRemove:g,edgesToRemove:x,nodes:w,edges:k,onBeforeDelete:I}),$=T.length>0,Q=B.length>0;if($){const U=T.map(Tm);C==null||C(T),b(U)}if(Q){const U=B.map(Tm);E==null||E(B),S(U)}return(Q||$)&&(N==null||N({nodes:B,edges:T})),{deletedNodes:B,deletedEdges:T}},getIntersectingNodes:(g,x=!0,w)=>{const k=rm(g),E=k?g:h(g),C=w!==void 0;return E?(w||t.getState().nodes).filter(S=>{const b=t.getState().nodeLookup.get(S.id);if(b&&!k&&(S.id===g.id||!b.internals.positionAbsolute))return!1;const N=Ws(C?S:b),I=Qo(N,E);return x&&I>0||I>=N.width*N.height||I>=E.width*E.height}):[]},isNodeIntersecting:(g,x,w=!0)=>{const E=rm(g)?g:h(g);if(!E)return!1;const C=Qo(E,x);return w&&C>0||C>=x.width*x.height||C>=E.width*E.height},updateNode:p,updateNodeData:(g,x,w={replace:!1})=>{p(g,k=>{const E=typeof x=="function"?x(k):x;return w.replace?{...k,data:E}:{...k,data:{...k.data,...E}}},w)},updateEdge:m,updateEdgeData:(g,x,w={replace:!1})=>{m(g,k=>{const E=typeof x=="function"?x(k):x;return w.replace?{...k,data:E}:{...k,data:{...k.data,...E}}},w)},getNodesBounds:g=>{const{nodeLookup:x,nodeOrigin:w}=t.getState();return Wk(g,{nodeLookup:x,nodeOrigin:w})},getHandleConnections:({type:g,id:x,nodeId:w})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${w}-${g}${x?`-${x}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:g,handleId:x,nodeId:w})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${w}${g?x?`-${g}-${x}`:`-${g}`:""}`))==null?void 0:k.values())??[])},fitView:async g=>{const x=t.getState().fitViewResolver??Jk();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:x}),r.nodeQueue.push(w=>[...w]),x.promise}}},[]);return M.useMemo(()=>({...o,...e,viewportInitialized:s}),[s])}const Mm=e=>e.selected,_E=typeof window<"u"?window:void 0;function IE({deleteKeyCode:e,multiSelectionKeyCode:t}){const r=ct(),{deleteElements:s}=Kd(),o=Jo(e,{actInsideInputWithModifier:!1}),a=Jo(t,{target:_E});M.useEffect(()=>{if(o){const{edges:u,nodes:c}=r.getState();s({nodes:c.filter(Mm),edges:u.filter(Mm)}),r.setState({nodesSelectionActive:!1})}},[o]),M.useEffect(()=>{r.setState({multiSelectionActive:a})},[a])}function TE(e){const t=ct();M.useEffect(()=>{const r=()=>{var o,a,u,c;if(!e.current||!(((a=(o=e.current).checkVisibility)==null?void 0:a.call(o))??!0))return!1;const s=Ud(e.current);(s.height===0||s.width===0)&&((c=(u=t.getState()).onError)==null||c.call(u,"004",gr.error004())),t.setState({width:s.width||500,height:s.height||500})};if(e.current){r(),window.addEventListener("resize",r);const s=new ResizeObserver(()=>r());return s.observe(e.current),()=>{window.removeEventListener("resize",r),s&&e.current&&s.unobserve(e.current)}}},[])}const Ja={position:"absolute",width:"100%",height:"100%",top:0,left:0},PE=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function AE({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:r=!0,panOnScroll:s=!1,panOnScrollSpeed:o=.5,panOnScrollMode:a=Wi.Free,zoomOnDoubleClick:u=!0,panOnDrag:c=!0,defaultViewport:h,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:x,preventScrolling:w=!0,children:k,noWheelClassName:E,noPanClassName:C,onViewportChange:S,isControlledViewport:b,paneClickDistance:N,selectionOnDrag:I}){const B=ct(),T=M.useRef(null),{userSelectionActive:$,lib:Q,connectionInProgress:U}=qe(PE,ut),q=Jo(x),L=M.useRef();TE(T);const W=M.useCallback(J=>{S==null||S({x:J[0],y:J[1],zoom:J[2]}),b||B.setState({transform:J})},[S,b]);return M.useEffect(()=>{if(T.current){L.current=zN({domNode:T.current,minZoom:m,maxZoom:g,translateExtent:p,viewport:h,onDraggingChange:F=>B.setState({paneDragging:F}),onPanZoomStart:(F,K)=>{const{onViewportChangeStart:R,onMoveStart:V}=B.getState();V==null||V(F,K),R==null||R(K)},onPanZoom:(F,K)=>{const{onViewportChange:R,onMove:V}=B.getState();V==null||V(F,K),R==null||R(K)},onPanZoomEnd:(F,K)=>{const{onViewportChangeEnd:R,onMoveEnd:V}=B.getState();V==null||V(F,K),R==null||R(K)}});const{x:J,y:P,zoom:O}=L.current.getViewport();return B.setState({panZoom:L.current,transform:[J,P,O],domNode:T.current.closest(".react-flow")}),()=>{var F;(F=L.current)==null||F.destroy()}}},[]),M.useEffect(()=>{var J;(J=L.current)==null||J.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:r,panOnScroll:s,panOnScrollSpeed:o,panOnScrollMode:a,zoomOnDoubleClick:u,panOnDrag:c,zoomActivationKeyPressed:q,preventScrolling:w,noPanClassName:C,userSelectionActive:$,noWheelClassName:E,lib:Q,onTransformChange:W,connectionInProgress:U,selectionOnDrag:I,paneClickDistance:N})},[e,t,r,s,o,a,u,c,q,w,C,$,E,Q,W,U,I,N]),f.jsx("div",{className:"react-flow__renderer",ref:T,style:Ja,children:k})}const ME=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function RE(){const{userSelectionActive:e,userSelectionRect:t}=qe(ME,ut);return e&&t?f.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 Xc=(e,t)=>r=>{r.target===t.current&&(e==null||e(r))},zE=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function LE({isSelecting:e,selectionKeyPressed:t,selectionMode:r=Go.Full,panOnDrag:s,paneClickDistance:o,selectionOnDrag:a,onSelectionStart:u,onSelectionEnd:c,onPaneClick:h,onPaneContextMenu:p,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:x,onPaneMouseLeave:w,children:k}){const E=ct(),{userSelectionActive:C,elementsSelectable:S,dragging:b,connectionInProgress:N}=qe(zE,ut),I=S&&(e||C),B=M.useRef(null),T=M.useRef(),$=M.useRef(new Set),Q=M.useRef(new Set),U=M.useRef(!1),q=R=>{if(U.current||N){U.current=!1;return}h==null||h(R),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},L=R=>{if(Array.isArray(s)&&(s!=null&&s.includes(2))){R.preventDefault();return}p==null||p(R)},W=m?R=>m(R):void 0,J=R=>{U.current&&(R.stopPropagation(),U.current=!1)},P=R=>{var fe,ce;const{domNode:V}=E.getState();if(T.current=V==null?void 0:V.getBoundingClientRect(),!T.current)return;const j=R.target===B.current;if(!j&&!!R.target.closest(".nokey")||!e||!(a&&j||t)||R.button!==0||!R.isPrimary)return;(ce=(fe=R.target)==null?void 0:fe.setPointerCapture)==null||ce.call(fe,R.pointerId),U.current=!1;const{x:A,y:le}=Jn(R.nativeEvent,T.current);E.setState({userSelectionRect:{width:0,height:0,startX:A,startY:le,x:A,y:le}}),j||(R.stopPropagation(),R.preventDefault())},O=R=>{const{userSelectionRect:V,transform:j,nodeLookup:z,edgeLookup:Y,connectionLookup:A,triggerNodeChanges:le,triggerEdgeChanges:fe,defaultEdgeOptions:ce,resetSelectedElements:ve}=E.getState();if(!T.current||!V)return;const{x:se,y:xe}=Jn(R.nativeEvent,T.current),{startX:je,startY:Pe}=V;if(!U.current){const Oe=t?0:o;if(Math.hypot(se-je,xe-Pe)<=Oe)return;ve(),u==null||u(R)}U.current=!0;const Ee={startX:je,startY:Pe,x:se<je?se:je,y:xe<Pe?xe:Pe,width:Math.abs(se-je),height:Math.abs(xe-Pe)},Ce=$.current,Ve=Q.current;$.current=new Set(Hd(z,Ee,j,r===Go.Partial,!0).map(Oe=>Oe.id)),Q.current=new Set;const We=(ce==null?void 0:ce.selectable)??!0;for(const Oe of $.current){const tt=A.get(Oe);if(tt)for(const{edgeId:It}of tt.values()){const bt=Y.get(It);bt&&(bt.selectable??We)&&Q.current.add(It)}}if(!im(Ce,$.current)){const Oe=Ds(z,$.current,!0);le(Oe)}if(!im(Ve,Q.current)){const Oe=Ds(Y,Q.current);fe(Oe)}E.setState({userSelectionRect:Ee,userSelectionActive:!0,nodesSelectionActive:!1})},F=R=>{var V,j;R.button===0&&((j=(V=R.target)==null?void 0:V.releasePointerCapture)==null||j.call(V,R.pointerId),!C&&R.target===B.current&&E.getState().userSelectionRect&&(q==null||q(R)),E.setState({userSelectionActive:!1,userSelectionRect:null}),U.current&&(c==null||c(R),E.setState({nodesSelectionActive:$.current.size>0})))},K=s===!0||Array.isArray(s)&&s.includes(0);return f.jsxs("div",{className:Ct(["react-flow__pane",{draggable:K,dragging:b,selection:e}]),onClick:I?void 0:Xc(q,B),onContextMenu:Xc(L,B),onWheel:Xc(W,B),onPointerEnter:I?void 0:g,onPointerMove:I?O:x,onPointerUp:I?F:void 0,onPointerDownCapture:I?P:void 0,onClickCapture:I?J:void 0,onPointerLeave:w,ref:B,style:Ja,children:[k,f.jsx(RE,{})]})}function kd({id:e,store:t,unselect:r=!1,nodeRef:s}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:u,nodeLookup:c,onError:h}=t.getState(),p=c.get(e);if(!p){h==null||h("012",gr.error012(e));return}t.setState({nodesSelectionActive:!1}),p.selected?(r||p.selected&&u)&&(a({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var m;return(m=s==null?void 0:s.current)==null?void 0:m.blur()})):o([e])}function lx({nodeRef:e,disabled:t=!1,noDragClassName:r,handleSelector:s,nodeId:o,isSelectable:a,nodeClickDistance:u}){const c=ct(),[h,p]=M.useState(!1),m=M.useRef();return M.useEffect(()=>{m.current=SN({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{kd({id:g,store:c,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),M.useEffect(()=>{var g,x;if(t)(g=m.current)==null||g.destroy();else if(e.current)return(x=m.current)==null||x.update({noDragClassName:r,handleSelector:s,domNode:e.current,isSelectable:a,nodeId:o,nodeClickDistance:u}),()=>{var w;(w=m.current)==null||w.destroy()}},[r,s,t,a,e,o]),h}const DE=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function ax(){const e=ct();return M.useCallback(r=>{const{nodeExtent:s,snapToGrid:o,snapGrid:a,nodesDraggable:u,onError:c,updateNodePositions:h,nodeLookup:p,nodeOrigin:m}=e.getState(),g=new Map,x=DE(u),w=o?a[0]:5,k=o?a[1]:5,E=r.direction.x*w*r.factor,C=r.direction.y*k*r.factor;for(const[,S]of p){if(!x(S))continue;let b={x:S.internals.positionAbsolute.x+E,y:S.internals.positionAbsolute.y+C};o&&(b=ll(b,a));const{position:N,positionAbsolute:I}=Cy({nodeId:S.id,nextPosition:b,nodeLookup:p,nodeExtent:s,nodeOrigin:m,onError:c});S.position=N,S.internals.positionAbsolute=I,g.set(S.id,S)}h(g)},[])}const Qd=M.createContext(null),FE=Qd.Provider;Qd.Consumer;const ux=()=>M.useContext(Qd),OE=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),$E=(e,t,r)=>s=>{const{connectionClickStartHandle:o,connectionMode:a,connection:u}=s,{fromHandle:c,toHandle:h,isValid:p}=u,m=(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===t&&(h==null?void 0:h.type)===r;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===r,connectingTo:m,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===r,isPossibleEndHandle:a===qi.Strict?(c==null?void 0:c.type)!==r:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!o,valid:m&&p}};function BE({type:e="source",position:t=Te.Top,isValidConnection:r,isConnectable:s=!0,isConnectableStart:o=!0,isConnectableEnd:a=!0,id:u,onConnect:c,children:h,className:p,onMouseDown:m,onTouchStart:g,...x},w){var O,F;const k=u||null,E=e==="target",C=ct(),S=ux(),{connectOnClick:b,noPanClassName:N,rfId:I}=qe(OE,ut),{connectingFrom:B,connectingTo:T,clickConnecting:$,isPossibleEndHandle:Q,connectionInProcess:U,clickConnectionInProcess:q,valid:L}=qe($E(S,k,e),ut);S||(F=(O=C.getState()).onError)==null||F.call(O,"010",gr.error010());const W=K=>{const{defaultEdgeOptions:R,onConnect:V,hasDefaultEdges:j}=C.getState(),z={...R,...K};if(j){const{edges:Y,setEdges:A}=C.getState();A(Fy(z,Y))}V==null||V(z),c==null||c(z)},J=K=>{if(!S)return;const R=My(K.nativeEvent);if(o&&(R&&K.button===0||!R)){const V=C.getState();Sd.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:E,handleId:k,nodeId:S,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:V.onConnectEnd,updateConnection:V.updateConnection,onConnect:W,isValidConnection:r||V.isValidConnection,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed,dragThreshold:V.connectionDragThreshold})}R?m==null||m(K):g==null||g(K)},P=K=>{const{onClickConnectStart:R,onClickConnectEnd:V,connectionClickStartHandle:j,connectionMode:z,isValidConnection:Y,lib:A,rfId:le,nodeLookup:fe,connection:ce}=C.getState();if(!S||!j&&!o)return;if(!j){R==null||R(K.nativeEvent,{nodeId:S,handleId:k,handleType:e}),C.setState({connectionClickStartHandle:{nodeId:S,type:e,id:k}});return}const ve=Py(K.target),se=r||Y,{connection:xe,isValid:je}=Sd.isValid(K.nativeEvent,{handle:{nodeId:S,id:k,type:e},connectionMode:z,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:se,flowId:le,doc:ve,lib:A,nodeLookup:fe});je&&xe&&W(xe);const Pe=structuredClone(ce);delete Pe.inProgress,Pe.toPosition=Pe.toHandle?Pe.toHandle.position:null,V==null||V(K,Pe),C.setState({connectionClickStartHandle:null})};return f.jsx("div",{"data-handleid":k,"data-nodeid":S,"data-handlepos":t,"data-id":`${I}-${S}-${k}-${e}`,className:Ct(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",N,p,{source:!E,target:E,connectable:s,connectablestart:o,connectableend:a,clickconnecting:$,connectingfrom:B,connectingto:T,valid:L,connectionindicator:s&&(!U||Q)&&(U||q?a:o)}]),onMouseDown:J,onTouchStart:J,onClick:b?P:void 0,ref:w,...x,children:h})}const mi=M.memo(sx(BE));function HE({data:e,isConnectable:t,sourcePosition:r=Te.Bottom}){return f.jsxs(f.Fragment,{children:[e==null?void 0:e.label,f.jsx(mi,{type:"source",position:r,isConnectable:t})]})}function VE({data:e,isConnectable:t,targetPosition:r=Te.Top,sourcePosition:s=Te.Bottom}){return f.jsxs(f.Fragment,{children:[f.jsx(mi,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label,f.jsx(mi,{type:"source",position:s,isConnectable:t})]})}function UE(){return null}function WE({data:e,isConnectable:t,targetPosition:r=Te.Top}){return f.jsxs(f.Fragment,{children:[f.jsx(mi,{type:"target",position:r,isConnectable:t}),e==null?void 0:e.label]})}const Fa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Rm={input:HE,default:VE,output:WE,group:UE};function YE(e){var t,r,s,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((r=e.style)==null?void 0:r.height)}:{width:e.width??((s=e.style)==null?void 0:s.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const XE=e=>{const{width:t,height:r,x:s,y:o}=ol(e.nodeLookup,{filter:a=>!!a.selected});return{width:Zn(t)?t:null,height:Zn(r)?r:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${s}px,${o}px)`}};function qE({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:r}){const s=ct(),{width:o,height:a,transformString:u,userSelectionActive:c}=qe(XE,ut),h=ax(),p=M.useRef(null);if(M.useEffect(()=>{var x;r||(x=p.current)==null||x.focus({preventScroll:!0})},[r]),lx({nodeRef:p}),c||!o||!a)return null;const m=e?x=>{const w=s.getState().nodes.filter(k=>k.selected);e(x,w)}:void 0,g=x=>{Object.prototype.hasOwnProperty.call(Fa,x.key)&&(x.preventDefault(),h({direction:Fa[x.key],factor:x.shiftKey?4:1}))};return f.jsx("div",{className:Ct(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:f.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:r?void 0:-1,onKeyDown:r?void 0:g,style:{width:o,height:a}})})}const zm=typeof window<"u"?window:void 0,GE=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function cx({children:e,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,paneClickDistance:c,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:m,selectionMode:g,onSelectionStart:x,onSelectionEnd:w,multiSelectionKeyCode:k,panActivationKeyCode:E,zoomActivationKeyCode:C,elementsSelectable:S,zoomOnScroll:b,zoomOnPinch:N,panOnScroll:I,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:$,panOnDrag:Q,defaultViewport:U,translateExtent:q,minZoom:L,maxZoom:W,preventScrolling:J,onSelectionContextMenu:P,noWheelClassName:O,noPanClassName:F,disableKeyboardA11y:K,onViewportChange:R,isControlledViewport:V}){const{nodesSelectionActive:j,userSelectionActive:z}=qe(GE,ut),Y=Jo(p,{target:zm}),A=Jo(E,{target:zm}),le=A||Q,fe=A||I,ce=m&&le!==!0,ve=Y||z||ce;return IE({deleteKeyCode:h,multiSelectionKeyCode:k}),f.jsx(AE,{onPaneContextMenu:a,elementsSelectable:S,zoomOnScroll:b,zoomOnPinch:N,panOnScroll:fe,panOnScrollSpeed:B,panOnScrollMode:T,zoomOnDoubleClick:$,panOnDrag:!Y&&le,defaultViewport:U,translateExtent:q,minZoom:L,maxZoom:W,zoomActivationKeyCode:C,preventScrolling:J,noWheelClassName:O,noPanClassName:F,onViewportChange:R,isControlledViewport:V,paneClickDistance:c,selectionOnDrag:ce,children:f.jsxs(LE,{onSelectionStart:x,onSelectionEnd:w,onPaneClick:t,onPaneMouseEnter:r,onPaneMouseMove:s,onPaneMouseLeave:o,onPaneContextMenu:a,onPaneScroll:u,panOnDrag:le,isSelecting:!!ve,selectionMode:g,selectionKeyPressed:Y,paneClickDistance:c,selectionOnDrag:ce,children:[e,j&&f.jsx(qE,{onSelectionContextMenu:P,noPanClassName:F,disableKeyboardA11y:K})]})})}cx.displayName="FlowRenderer";const KE=M.memo(cx),QE=e=>t=>e?Hd(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(r=>r.id):Array.from(t.nodeLookup.keys());function ZE(e){return qe(M.useCallback(QE(e),[e]),ut)}const JE=e=>e.updateNodeInternals;function eC(){const e=qe(JE),[t]=M.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(r=>{const s=new Map;r.forEach(o=>{const a=o.target.getAttribute("data-id");s.set(a,{id:a,nodeElement:o.target,force:!0})}),e(s)}));return M.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function tC({node:e,nodeType:t,hasDimensions:r,resizeObserver:s}){const o=ct(),a=M.useRef(null),u=M.useRef(null),c=M.useRef(e.sourcePosition),h=M.useRef(e.targetPosition),p=M.useRef(t),m=r&&!!e.internals.handleBounds;return M.useEffect(()=>{a.current&&!e.hidden&&(!m||u.current!==a.current)&&(u.current&&(s==null||s.unobserve(u.current)),s==null||s.observe(a.current),u.current=a.current)},[m,e.hidden]),M.useEffect(()=>()=>{u.current&&(s==null||s.unobserve(u.current),u.current=null)},[]),M.useEffect(()=>{if(a.current){const g=p.current!==t,x=c.current!==e.sourcePosition,w=h.current!==e.targetPosition;(g||x||w)&&(p.current=t,c.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function nC({id:e,onClick:t,onMouseEnter:r,onMouseMove:s,onMouseLeave:o,onContextMenu:a,onDoubleClick:u,nodesDraggable:c,elementsSelectable:h,nodesConnectable:p,nodesFocusable:m,resizeObserver:g,noDragClassName:x,noPanClassName:w,disableKeyboardA11y:k,rfId:E,nodeTypes:C,nodeClickDistance:S,onError:b}){const{node:N,internals:I,isParent:B}=qe(se=>{const xe=se.nodeLookup.get(e),je=se.parentLookup.has(e);return{node:xe,internals:xe.internals,isParent:je}},ut);let T=N.type||"default",$=(C==null?void 0:C[T])||Rm[T];$===void 0&&(b==null||b("003",gr.error003(T)),T="default",$=(C==null?void 0:C.default)||Rm.default);const Q=!!(N.draggable||c&&typeof N.draggable>"u"),U=!!(N.selectable||h&&typeof N.selectable>"u"),q=!!(N.connectable||p&&typeof N.connectable>"u"),L=!!(N.focusable||m&&typeof N.focusable>"u"),W=ct(),J=Iy(N),P=tC({node:N,nodeType:T,hasDimensions:J,resizeObserver:g}),O=lx({nodeRef:P,disabled:N.hidden||!Q,noDragClassName:x,handleSelector:N.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:S}),F=ax();if(N.hidden)return null;const K=Fr(N),R=YE(N),V=U||Q||t||r||s||o,j=r?se=>r(se,{...I.userNode}):void 0,z=s?se=>s(se,{...I.userNode}):void 0,Y=o?se=>o(se,{...I.userNode}):void 0,A=a?se=>a(se,{...I.userNode}):void 0,le=u?se=>u(se,{...I.userNode}):void 0,fe=se=>{const{selectNodesOnDrag:xe,nodeDragThreshold:je}=W.getState();U&&(!xe||!Q||je>0)&&kd({id:e,store:W,nodeRef:P}),t&&t(se,{...I.userNode})},ce=se=>{if(!(Ay(se.nativeEvent)||k)){if(wy.includes(se.key)&&U){const xe=se.key==="Escape";kd({id:e,store:W,unselect:xe,nodeRef:P})}else if(Q&&N.selected&&Object.prototype.hasOwnProperty.call(Fa,se.key)){se.preventDefault();const{ariaLabelConfig:xe}=W.getState();W.setState({ariaLiveMessage:xe["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~I.positionAbsolute.x,y:~~I.positionAbsolute.y})}),F({direction:Fa[se.key],factor:se.shiftKey?4:1})}}},ve=()=>{var Ve;if(k||!((Ve=P.current)!=null&&Ve.matches(":focus-visible")))return;const{transform:se,width:xe,height:je,autoPanOnNodeFocus:Pe,setCenter:Ee}=W.getState();if(!Pe)return;Hd(new Map([[e,N]]),{x:0,y:0,width:xe,height:je},se,!0).length>0||Ee(N.position.x+K.width/2,N.position.y+K.height/2,{zoom:se[2]})};return f.jsx("div",{className:Ct(["react-flow__node",`react-flow__node-${T}`,{[w]:Q},N.className,{selected:N.selected,selectable:U,parent:B,draggable:Q,dragging:O}]),ref:P,style:{zIndex:I.z,transform:`translate(${I.positionAbsolute.x}px,${I.positionAbsolute.y}px)`,pointerEvents:V?"all":"none",visibility:J?"visible":"hidden",...N.style,...R},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:z,onMouseLeave:Y,onContextMenu:A,onClick:fe,onDoubleClick:le,onKeyDown:L?ce:void 0,tabIndex:L?0:void 0,onFocus:L?ve:void 0,role:N.ariaRole??(L?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${Jy}-${E}`,"aria-label":N.ariaLabel,...N.domAttributes,children:f.jsx(FE,{value:e,children:f.jsx($,{id:e,data:N.data,type:T,positionAbsoluteX:I.positionAbsolute.x,positionAbsoluteY:I.positionAbsolute.y,selected:N.selected??!1,selectable:U,draggable:Q,deletable:N.deletable??!0,isConnectable:q,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:O,dragHandle:N.dragHandle,zIndex:I.z,parentId:N.parentId,...K})})})}var rC=M.memo(nC);const iC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function dx(e){const{nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:o,onError:a}=qe(iC,ut),u=ZE(e.onlyRenderVisibleElements),c=eC();return f.jsx("div",{className:"react-flow__nodes",style:Ja,children:u.map(h=>f.jsx(rC,{id:h,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:c,nodesDraggable:t,nodesConnectable:r,nodesFocusable:s,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:a},h))})}dx.displayName="NodeRenderer";const sC=M.memo(dx);function oC(e){return qe(M.useCallback(r=>{if(!e)return r.edges.map(o=>o.id);const s=[];if(r.width&&r.height)for(const o of r.edges){const a=r.nodeLookup.get(o.source),u=r.nodeLookup.get(o.target);a&&u&&rN({sourceNode:a,targetNode:u,width:r.width,height:r.height,transform:r.transform})&&s.push(o.id)}return s},[e]),ut)}const lC=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e}};return f.jsx("polyline",{className:"arrow",style:r,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},aC=({color:e="none",strokeWidth:t=1})=>{const r={strokeWidth:t,...e&&{stroke:e,fill:e}};return f.jsx("polyline",{className:"arrowclosed",style:r,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Lm={[Ko.Arrow]:lC,[Ko.ArrowClosed]:aC};function uC(e){const t=ct();return M.useMemo(()=>{var o,a;return Object.prototype.hasOwnProperty.call(Lm,e)?Lm[e]:((a=(o=t.getState()).onError)==null||a.call(o,"009",gr.error009(e)),null)},[e])}const cC=({id:e,type:t,color:r,width:s=12.5,height:o=12.5,markerUnits:a="strokeWidth",strokeWidth:u,orient:c="auto-start-reverse"})=>{const h=uC(t);return h?f.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${s}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0",children:f.jsx(h,{color:r,strokeWidth:u})}):null},fx=({defaultColor:e,rfId:t})=>{const r=qe(a=>a.edges),s=qe(a=>a.defaultEdgeOptions),o=M.useMemo(()=>cN(r,{id:t,defaultColor:e,defaultMarkerStart:s==null?void 0:s.markerStart,defaultMarkerEnd:s==null?void 0:s.markerEnd}),[r,s,t,e]);return o.length?f.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:f.jsx("defs",{children:o.map(a=>f.jsx(cC,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};fx.displayName="MarkerDefinitions";var dC=M.memo(fx);function hx({x:e,y:t,label:r,labelStyle:s,labelShowBg:o=!0,labelBgStyle:a,labelBgPadding:u=[2,4],labelBgBorderRadius:c=2,children:h,className:p,...m}){const[g,x]=M.useState({x:1,y:0,width:0,height:0}),w=Ct(["react-flow__edge-textwrapper",p]),k=M.useRef(null);return M.useEffect(()=>{if(k.current){const E=k.current.getBBox();x({x:E.x,y:E.y,width:E.width,height:E.height})}},[r]),r?f.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:w,visibility:g.width?"visible":"hidden",...m,children:[o&&f.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),f.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:k,style:s,children:r}),h]}):null}hx.displayName="EdgeText";const fC=M.memo(hx);function eu({path:e,labelX:t,labelY:r,label:s,labelStyle:o,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:h,interactionWidth:p=20,...m}){return f.jsxs(f.Fragment,{children:[f.jsx("path",{...m,d:e,fill:"none",className:Ct(["react-flow__edge-path",m.className])}),p?f.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,s&&Zn(t)&&Zn(r)?f.jsx(fC,{x:t,y:r,label:s,labelStyle:o,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:h}):null]})}function Dm({pos:e,x1:t,y1:r,x2:s,y2:o}){return e===Te.Left||e===Te.Right?[.5*(t+s),r]:[t,.5*(r+o)]}function px({sourceX:e,sourceY:t,sourcePosition:r=Te.Bottom,targetX:s,targetY:o,targetPosition:a=Te.Top}){const[u,c]=Dm({pos:r,x1:e,y1:t,x2:s,y2:o}),[h,p]=Dm({pos:a,x1:s,y1:o,x2:e,y2:t}),[m,g,x,w]=Ry({sourceX:e,sourceY:t,targetX:s,targetY:o,sourceControlX:u,sourceControlY:c,targetControlX:h,targetControlY:p});return[`M${e},${t} C${u},${c} ${h},${p} ${s},${o}`,m,g,x,w]}function mx(e){return M.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:u,targetPosition:c,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:C,interactionWidth:S})=>{const[b,N,I]=px({sourceX:r,sourceY:s,sourcePosition:u,targetX:o,targetY:a,targetPosition:c}),B=e.isInternal?void 0:t;return f.jsx(eu,{id:B,path:b,labelX:N,labelY:I,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:C,interactionWidth:S})})}const hC=mx({isInternal:!1}),gx=mx({isInternal:!0});hC.displayName="SimpleBezierEdge";gx.displayName="SimpleBezierEdgeInternal";function yx(e){return M.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,sourcePosition:w=Te.Bottom,targetPosition:k=Te.Top,markerEnd:E,markerStart:C,pathOptions:S,interactionWidth:b})=>{const[N,I,B]=xd({sourceX:r,sourceY:s,sourcePosition:w,targetX:o,targetY:a,targetPosition:k,borderRadius:S==null?void 0:S.borderRadius,offset:S==null?void 0:S.offset,stepPosition:S==null?void 0:S.stepPosition}),T=e.isInternal?void 0:t;return f.jsx(eu,{id:T,path:N,labelX:I,labelY:B,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:E,markerStart:C,interactionWidth:b})})}const xx=yx({isInternal:!1}),vx=yx({isInternal:!0});xx.displayName="SmoothStepEdge";vx.displayName="SmoothStepEdgeInternal";function wx(e){return M.memo(({id:t,...r})=>{var o;const s=e.isInternal?void 0:t;return f.jsx(xx,{...r,id:s,pathOptions:M.useMemo(()=>{var a;return{borderRadius:0,offset:(a=r.pathOptions)==null?void 0:a.offset}},[(o=r.pathOptions)==null?void 0:o.offset])})})}const pC=wx({isInternal:!1}),Sx=wx({isInternal:!0});pC.displayName="StepEdge";Sx.displayName="StepEdgeInternal";function kx(e){return M.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:k,interactionWidth:E})=>{const[C,S,b]=Oy({sourceX:r,sourceY:s,targetX:o,targetY:a}),N=e.isInternal?void 0:t;return f.jsx(eu,{id:N,path:C,labelX:S,labelY:b,label:u,labelStyle:c,labelShowBg:h,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:x,markerEnd:w,markerStart:k,interactionWidth:E})})}const mC=kx({isInternal:!1}),Nx=kx({isInternal:!0});mC.displayName="StraightEdge";Nx.displayName="StraightEdgeInternal";function Ex(e){return M.memo(({id:t,sourceX:r,sourceY:s,targetX:o,targetY:a,sourcePosition:u=Te.Bottom,targetPosition:c=Te.Top,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:C,pathOptions:S,interactionWidth:b})=>{const[N,I,B]=zy({sourceX:r,sourceY:s,sourcePosition:u,targetX:o,targetY:a,targetPosition:c,curvature:S==null?void 0:S.curvature}),T=e.isInternal?void 0:t;return f.jsx(eu,{id:T,path:N,labelX:I,labelY:B,label:h,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:x,labelBgBorderRadius:w,style:k,markerEnd:E,markerStart:C,interactionWidth:b})})}const gC=Ex({isInternal:!1}),Cx=Ex({isInternal:!0});gC.displayName="BezierEdge";Cx.displayName="BezierEdgeInternal";const Fm={default:Cx,straight:Nx,step:Sx,smoothstep:vx,simplebezier:gx},Om={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},yC=(e,t,r)=>r===Te.Left?e-t:r===Te.Right?e+t:e,xC=(e,t,r)=>r===Te.Top?e-t:r===Te.Bottom?e+t:e,$m="react-flow__edgeupdater";function Bm({position:e,centerX:t,centerY:r,radius:s=10,onMouseDown:o,onMouseEnter:a,onMouseOut:u,type:c}){return f.jsx("circle",{onMouseDown:o,onMouseEnter:a,onMouseOut:u,className:Ct([$m,`${$m}-${c}`]),cx:yC(t,s,e),cy:xC(r,s,e),r:s,stroke:"transparent",fill:"transparent"})}function vC({isReconnectable:e,reconnectRadius:t,edge:r,sourceX:s,sourceY:o,targetX:a,targetY:u,sourcePosition:c,targetPosition:h,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,setReconnecting:x,setUpdateHover:w}){const k=ct(),E=(I,B)=>{if(I.button!==0)return;const{autoPanOnConnect:T,domNode:$,isValidConnection:Q,connectionMode:U,connectionRadius:q,lib:L,onConnectStart:W,onConnectEnd:J,cancelConnection:P,nodeLookup:O,rfId:F,panBy:K,updateConnection:R}=k.getState(),V=B.type==="target",j=(A,le)=>{x(!1),g==null||g(A,r,B.type,le)},z=A=>p==null?void 0:p(r,A),Y=(A,le)=>{x(!0),m==null||m(I,r,B.type),W==null||W(A,le)};Sd.onPointerDown(I.nativeEvent,{autoPanOnConnect:T,connectionMode:U,connectionRadius:q,domNode:$,handleId:B.id,nodeId:B.nodeId,nodeLookup:O,isTarget:V,edgeUpdaterType:B.type,lib:L,flowId:F,cancelConnection:P,panBy:K,isValidConnection:Q,onConnect:z,onConnectStart:Y,onConnectEnd:J,onReconnectEnd:j,updateConnection:R,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:I.currentTarget})},C=I=>E(I,{nodeId:r.target,id:r.targetHandle??null,type:"target"}),S=I=>E(I,{nodeId:r.source,id:r.sourceHandle??null,type:"source"}),b=()=>w(!0),N=()=>w(!1);return f.jsxs(f.Fragment,{children:[(e===!0||e==="source")&&f.jsx(Bm,{position:c,centerX:s,centerY:o,radius:t,onMouseDown:C,onMouseEnter:b,onMouseOut:N,type:"source"}),(e===!0||e==="target")&&f.jsx(Bm,{position:h,centerX:a,centerY:u,radius:t,onMouseDown:S,onMouseEnter:b,onMouseOut:N,type:"target"})]})}function wC({id:e,edgesFocusable:t,edgesReconnectable:r,elementsSelectable:s,onClick:o,onDoubleClick:a,onContextMenu:u,onMouseEnter:c,onMouseMove:h,onMouseLeave:p,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:w,rfId:k,edgeTypes:E,noPanClassName:C,onError:S,disableKeyboardA11y:b}){let N=qe(Ee=>Ee.edgeLookup.get(e));const I=qe(Ee=>Ee.defaultEdgeOptions);N=I?{...I,...N}:N;let B=N.type||"default",T=(E==null?void 0:E[B])||Fm[B];T===void 0&&(S==null||S("011",gr.error011(B)),B="default",T=(E==null?void 0:E.default)||Fm.default);const $=!!(N.focusable||t&&typeof N.focusable>"u"),Q=typeof g<"u"&&(N.reconnectable||r&&typeof N.reconnectable>"u"),U=!!(N.selectable||s&&typeof N.selectable>"u"),q=M.useRef(null),[L,W]=M.useState(!1),[J,P]=M.useState(!1),O=ct(),{zIndex:F,sourceX:K,sourceY:R,targetX:V,targetY:j,sourcePosition:z,targetPosition:Y}=qe(M.useCallback(Ee=>{const Ce=Ee.nodeLookup.get(N.source),Ve=Ee.nodeLookup.get(N.target);if(!Ce||!Ve)return{zIndex:N.zIndex,...Om};const We=uN({id:e,sourceNode:Ce,targetNode:Ve,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:Ee.connectionMode,onError:S});return{zIndex:nN({selected:N.selected,zIndex:N.zIndex,sourceNode:Ce,targetNode:Ve,elevateOnSelect:Ee.elevateEdgesOnSelect,zIndexMode:Ee.zIndexMode}),...We||Om}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),ut),A=M.useMemo(()=>N.markerStart?`url('#${vd(N.markerStart,k)}')`:void 0,[N.markerStart,k]),le=M.useMemo(()=>N.markerEnd?`url('#${vd(N.markerEnd,k)}')`:void 0,[N.markerEnd,k]);if(N.hidden||K===null||R===null||V===null||j===null)return null;const fe=Ee=>{var Oe;const{addSelectedEdges:Ce,unselectNodesAndEdges:Ve,multiSelectionActive:We}=O.getState();U&&(O.setState({nodesSelectionActive:!1}),N.selected&&We?(Ve({nodes:[],edges:[N]}),(Oe=q.current)==null||Oe.blur()):Ce([e])),o&&o(Ee,N)},ce=a?Ee=>{a(Ee,{...N})}:void 0,ve=u?Ee=>{u(Ee,{...N})}:void 0,se=c?Ee=>{c(Ee,{...N})}:void 0,xe=h?Ee=>{h(Ee,{...N})}:void 0,je=p?Ee=>{p(Ee,{...N})}:void 0,Pe=Ee=>{var Ce;if(!b&&wy.includes(Ee.key)&&U){const{unselectNodesAndEdges:Ve,addSelectedEdges:We}=O.getState();Ee.key==="Escape"?((Ce=q.current)==null||Ce.blur(),Ve({edges:[N]})):We([e])}};return f.jsx("svg",{style:{zIndex:F},children:f.jsxs("g",{className:Ct(["react-flow__edge",`react-flow__edge-${B}`,N.className,C,{selected:N.selected,animated:N.animated,inactive:!U&&!o,updating:L,selectable:U}]),onClick:fe,onDoubleClick:ce,onContextMenu:ve,onMouseEnter:se,onMouseMove:xe,onMouseLeave:je,onKeyDown:$?Pe:void 0,tabIndex:$?0:void 0,role:N.ariaRole??($?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":$?`${ex}-${k}`:void 0,ref:q,...N.domAttributes,children:[!J&&f.jsx(T,{id:e,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:U,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:K,sourceY:R,targetX:V,targetY:j,sourcePosition:z,targetPosition:Y,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:A,markerEnd:le,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),Q&&f.jsx(vC,{edge:N,isReconnectable:Q,reconnectRadius:m,onReconnect:g,onReconnectStart:x,onReconnectEnd:w,sourceX:K,sourceY:R,targetX:V,targetY:j,sourcePosition:z,targetPosition:Y,setUpdateHover:W,setReconnecting:P})]})})}var SC=M.memo(wC);const kC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function bx({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:r,edgeTypes:s,noPanClassName:o,onReconnect:a,onEdgeContextMenu:u,onEdgeMouseEnter:c,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:x,onReconnectStart:w,onReconnectEnd:k,disableKeyboardA11y:E}){const{edgesFocusable:C,edgesReconnectable:S,elementsSelectable:b,onError:N}=qe(kC,ut),I=oC(t);return f.jsxs("div",{className:"react-flow__edges",children:[f.jsx(dC,{defaultColor:e,rfId:r}),I.map(B=>f.jsx(SC,{id:B,edgesFocusable:C,edgesReconnectable:S,elementsSelectable:b,noPanClassName:o,onReconnect:a,onContextMenu:u,onMouseEnter:c,onMouseMove:h,onMouseLeave:p,onClick:m,reconnectRadius:g,onDoubleClick:x,onReconnectStart:w,onReconnectEnd:k,rfId:r,onError:N,edgeTypes:s,disableKeyboardA11y:E},B))]})}bx.displayName="EdgeRenderer";const NC=M.memo(bx),EC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CC({children:e}){const t=qe(EC);return f.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function bC(e){const t=Kd(),r=M.useRef(!1);M.useEffect(()=>{!r.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),r.current=!0)},[e,t.viewportInitialized])}const jC=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function _C(e){const t=qe(jC),r=ct();return M.useEffect(()=>{e&&(t==null||t(e),r.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function IC(e){return e.connection.inProgress?{...e.connection,to:al(e.connection.to,e.transform)}:{...e.connection}}function TC(e){return IC}function PC(e){const t=TC();return qe(t,ut)}const AC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function MC({containerStyle:e,style:t,type:r,component:s}){const{nodesConnectable:o,width:a,height:u,isValid:c,inProgress:h}=qe(AC,ut);return!(a&&o&&h)?null:f.jsx("svg",{style:e,width:a,height:u,className:"react-flow__connectionline react-flow__container",children:f.jsx("g",{className:Ct(["react-flow__connection",Ny(c)]),children:f.jsx(jx,{style:t,type:r,CustomComponent:s,isValid:c})})})}const jx=({style:e,type:t=pi.Bezier,CustomComponent:r,isValid:s})=>{const{inProgress:o,from:a,fromNode:u,fromHandle:c,fromPosition:h,to:p,toNode:m,toHandle:g,toPosition:x,pointer:w}=PC();if(!o)return;if(r)return f.jsx(r,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:c,fromX:a.x,fromY:a.y,toX:p.x,toY:p.y,fromPosition:h,toPosition:x,connectionStatus:Ny(s),toNode:m,toHandle:g,pointer:w});let k="";const E={sourceX:a.x,sourceY:a.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:x};switch(t){case pi.Bezier:[k]=zy(E);break;case pi.SimpleBezier:[k]=px(E);break;case pi.Step:[k]=xd({...E,borderRadius:0});break;case pi.SmoothStep:[k]=xd(E);break;default:[k]=Oy(E)}return f.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};jx.displayName="ConnectionLine";const RC={};function Hm(e=RC){M.useRef(e),ct(),M.useEffect(()=>{},[e])}function zC(){ct(),M.useRef(!1),M.useEffect(()=>{},[])}function _x({nodeTypes:e,edgeTypes:t,onInit:r,onNodeClick:s,onEdgeClick:o,onNodeDoubleClick:a,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:x,onSelectionEnd:w,connectionLineType:k,connectionLineStyle:E,connectionLineComponent:C,connectionLineContainerStyle:S,selectionKeyCode:b,selectionOnDrag:N,selectionMode:I,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:$,deleteKeyCode:Q,onlyRenderVisibleElements:U,elementsSelectable:q,defaultViewport:L,translateExtent:W,minZoom:J,maxZoom:P,preventScrolling:O,defaultMarkerColor:F,zoomOnScroll:K,zoomOnPinch:R,panOnScroll:V,panOnScrollSpeed:j,panOnScrollMode:z,zoomOnDoubleClick:Y,panOnDrag:A,onPaneClick:le,onPaneMouseEnter:fe,onPaneMouseMove:ce,onPaneMouseLeave:ve,onPaneScroll:se,onPaneContextMenu:xe,paneClickDistance:je,nodeClickDistance:Pe,onEdgeContextMenu:Ee,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ve,onEdgeMouseLeave:We,reconnectRadius:Oe,onReconnect:tt,onReconnectStart:It,onReconnectEnd:bt,noDragClassName:gt,noWheelClassName:Tt,noPanClassName:Ht,disableKeyboardA11y:pn,nodeExtent:mn,rfId:Jt,viewport:ie,onViewportChange:me}){return Hm(e),Hm(t),zC(),bC(r),_C(ie),f.jsx(KE,{onPaneClick:le,onPaneMouseEnter:fe,onPaneMouseMove:ce,onPaneMouseLeave:ve,onPaneContextMenu:xe,onPaneScroll:se,paneClickDistance:je,deleteKeyCode:Q,selectionKeyCode:b,selectionOnDrag:N,selectionMode:I,onSelectionStart:x,onSelectionEnd:w,multiSelectionKeyCode:B,panActivationKeyCode:T,zoomActivationKeyCode:$,elementsSelectable:q,zoomOnScroll:K,zoomOnPinch:R,zoomOnDoubleClick:Y,panOnScroll:V,panOnScrollSpeed:j,panOnScrollMode:z,panOnDrag:A,defaultViewport:L,translateExtent:W,minZoom:J,maxZoom:P,onSelectionContextMenu:g,preventScrolling:O,noDragClassName:gt,noWheelClassName:Tt,noPanClassName:Ht,disableKeyboardA11y:pn,onViewportChange:me,isControlledViewport:!!ie,children:f.jsxs(CC,{children:[f.jsx(NC,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:tt,onReconnectStart:It,onReconnectEnd:bt,onlyRenderVisibleElements:U,onEdgeContextMenu:Ee,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ve,onEdgeMouseLeave:We,reconnectRadius:Oe,defaultMarkerColor:F,noPanClassName:Ht,disableKeyboardA11y:pn,rfId:Jt}),f.jsx(MC,{style:E,type:k,component:C,containerStyle:S}),f.jsx("div",{className:"react-flow__edgelabel-renderer"}),f.jsx(sC,{nodeTypes:e,onNodeClick:s,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:m,nodeClickDistance:Pe,onlyRenderVisibleElements:U,noPanClassName:Ht,noDragClassName:gt,disableKeyboardA11y:pn,nodeExtent:mn,rfId:Jt}),f.jsx("div",{className:"react-flow__viewport-portal"})]})})}_x.displayName="GraphView";const LC=M.memo(_x),Vm=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:u,fitViewOptions:c,minZoom:h=.5,maxZoom:p=2,nodeOrigin:m,nodeExtent:g,zIndexMode:x="basic"}={})=>{const w=new Map,k=new Map,E=new Map,C=new Map,S=s??t??[],b=r??e??[],N=m??[0,0],I=g??qo;Hy(E,C,S);const B=wd(b,w,k,{nodeOrigin:N,nodeExtent:I,zIndexMode:x});let T=[0,0,1];if(u&&o&&a){const $=ol(w,{filter:L=>!!((L.width||L.initialWidth)&&(L.height||L.initialHeight))}),{x:Q,y:U,zoom:q}=Vd($,o,a,h,p,(c==null?void 0:c.padding)??.1);T=[Q,U,q]}return{rfId:"1",width:o??0,height:a??0,transform:T,nodes:b,nodesInitialized:B,nodeLookup:w,parentLookup:k,edges:S,edgeLookup:C,connectionLookup:E,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:r!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:qo,nodeExtent:I,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:qi.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,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:u??!1,fitViewOptions:c,fitViewResolver:null,connection:{...ky},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:Kk,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Sy,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},DC=({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:u,fitViewOptions:c,minZoom:h,maxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x})=>tE((w,k)=>{async function E(){const{nodeLookup:C,panZoom:S,fitViewOptions:b,fitViewResolver:N,width:I,height:B,minZoom:T,maxZoom:$}=k();S&&(await qk({nodes:C,width:I,height:B,panZoom:S,minZoom:T,maxZoom:$},b),N==null||N.resolve(!0),w({fitViewResolver:null}))}return{...Vm({nodes:e,edges:t,width:o,height:a,fitView:u,fitViewOptions:c,minZoom:h,maxZoom:p,nodeOrigin:m,nodeExtent:g,defaultNodes:r,defaultEdges:s,zIndexMode:x}),setNodes:C=>{const{nodeLookup:S,parentLookup:b,nodeOrigin:N,elevateNodesOnSelect:I,fitViewQueued:B,zIndexMode:T}=k(),$=wd(C,S,b,{nodeOrigin:N,nodeExtent:g,elevateNodesOnSelect:I,checkEquality:!0,zIndexMode:T});B&&$?(E(),w({nodes:C,nodesInitialized:$,fitViewQueued:!1,fitViewOptions:void 0})):w({nodes:C,nodesInitialized:$})},setEdges:C=>{const{connectionLookup:S,edgeLookup:b}=k();Hy(S,b,C),w({edges:C})},setDefaultNodesAndEdges:(C,S)=>{if(C){const{setNodes:b}=k();b(C),w({hasDefaultNodes:!0})}if(S){const{setEdges:b}=k();b(S),w({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:S,nodeLookup:b,parentLookup:N,domNode:I,nodeOrigin:B,nodeExtent:T,debug:$,fitViewQueued:Q,zIndexMode:U}=k(),{changes:q,updatedInternals:L}=yN(C,b,N,I,B,T,U);L&&(hN(b,N,{nodeOrigin:B,nodeExtent:T,zIndexMode:U}),Q?(E(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),(q==null?void 0:q.length)>0&&($&&console.log("React Flow: trigger node changes",q),S==null||S(q)))},updateNodePositions:(C,S=!1)=>{const b=[];let N=[];const{nodeLookup:I,triggerNodeChanges:B,connection:T,updateConnection:$,onNodesChangeMiddlewareMap:Q}=k();for(const[U,q]of C){const L=I.get(U),W=!!(L!=null&&L.expandParent&&(L!=null&&L.parentId)&&(q!=null&&q.position)),J={id:U,type:"position",position:W?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:S};if(L&&T.inProgress&&T.fromNode.id===L.id){const P=Ki(L,T.fromHandle,Te.Left,!0);$({...T,from:P})}W&&L.parentId&&b.push({id:U,parentId:L.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),N.push(J)}if(b.length>0){const{parentLookup:U,nodeOrigin:q}=k(),L=Gd(b,I,U,q);N.push(...L)}for(const U of Q.values())N=U(N);B(N)},triggerNodeChanges:C=>{const{onNodesChange:S,setNodes:b,nodes:N,hasDefaultNodes:I,debug:B}=k();if(C!=null&&C.length){if(I){const T=rx(C,N);b(T)}B&&console.log("React Flow: trigger node changes",C),S==null||S(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:S,setEdges:b,edges:N,hasDefaultEdges:I,debug:B}=k();if(C!=null&&C.length){if(I){const T=ix(C,N);b(T)}B&&console.log("React Flow: trigger edge changes",C),S==null||S(C)}},addSelectedNodes:C=>{const{multiSelectionActive:S,edgeLookup:b,nodeLookup:N,triggerNodeChanges:I,triggerEdgeChanges:B}=k();if(S){const T=C.map($=>Hi($,!0));I(T);return}I(Ds(N,new Set([...C]),!0)),B(Ds(b))},addSelectedEdges:C=>{const{multiSelectionActive:S,edgeLookup:b,nodeLookup:N,triggerNodeChanges:I,triggerEdgeChanges:B}=k();if(S){const T=C.map($=>Hi($,!0));B(T);return}B(Ds(b,new Set([...C]))),I(Ds(N,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:S}={})=>{const{edges:b,nodes:N,nodeLookup:I,triggerNodeChanges:B,triggerEdgeChanges:T}=k(),$=C||N,Q=S||b,U=$.map(L=>{const W=I.get(L.id);return W&&(W.selected=!1),Hi(L.id,!1)}),q=Q.map(L=>Hi(L.id,!1));B(U),T(q)},setMinZoom:C=>{const{panZoom:S,maxZoom:b}=k();S==null||S.setScaleExtent([C,b]),w({minZoom:C})},setMaxZoom:C=>{const{panZoom:S,minZoom:b}=k();S==null||S.setScaleExtent([b,C]),w({maxZoom:C})},setTranslateExtent:C=>{var S;(S=k().panZoom)==null||S.setTranslateExtent(C),w({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:S,triggerNodeChanges:b,triggerEdgeChanges:N,elementsSelectable:I}=k();if(!I)return;const B=S.reduce(($,Q)=>Q.selected?[...$,Hi(Q.id,!1)]:$,[]),T=C.reduce(($,Q)=>Q.selected?[...$,Hi(Q.id,!1)]:$,[]);b(B),N(T)},setNodeExtent:C=>{const{nodes:S,nodeLookup:b,parentLookup:N,nodeOrigin:I,elevateNodesOnSelect:B,nodeExtent:T,zIndexMode:$}=k();C[0][0]===T[0][0]&&C[0][1]===T[0][1]&&C[1][0]===T[1][0]&&C[1][1]===T[1][1]||(wd(S,b,N,{nodeOrigin:I,nodeExtent:C,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:$}),w({nodeExtent:C}))},panBy:C=>{const{transform:S,width:b,height:N,panZoom:I,translateExtent:B}=k();return xN({delta:C,panZoom:I,transform:S,translateExtent:B,width:b,height:N})},setCenter:async(C,S,b)=>{const{width:N,height:I,maxZoom:B,panZoom:T}=k();if(!T)return Promise.resolve(!1);const $=typeof(b==null?void 0:b.zoom)<"u"?b.zoom:B;return await T.setViewport({x:N/2-C*$,y:I/2-S*$,zoom:$},{duration:b==null?void 0:b.duration,ease:b==null?void 0:b.ease,interpolate:b==null?void 0:b.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{w({connection:{...ky}})},updateConnection:C=>{w({connection:C})},reset:()=>w({...Vm()})}},Object.is);function Ix({initialNodes:e,initialEdges:t,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:a,initialMinZoom:u,initialMaxZoom:c,initialFitViewOptions:h,fitView:p,nodeOrigin:m,nodeExtent:g,zIndexMode:x,children:w}){const[k]=M.useState(()=>DC({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,width:o,height:a,fitView:p,minZoom:u,maxZoom:c,fitViewOptions:h,nodeOrigin:m,nodeExtent:g,zIndexMode:x}));return f.jsx(nE,{value:k,children:f.jsx(CE,{children:w})})}function FC({children:e,nodes:t,edges:r,defaultNodes:s,defaultEdges:o,width:a,height:u,fitView:c,fitViewOptions:h,minZoom:p,maxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:w}){return M.useContext(Qa)?f.jsx(f.Fragment,{children:e}):f.jsx(Ix,{initialNodes:t,initialEdges:r,defaultNodes:s,defaultEdges:o,initialWidth:a,initialHeight:u,fitView:c,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:m,nodeOrigin:g,nodeExtent:x,zIndexMode:w,children:e})}const OC={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function $C({nodes:e,edges:t,defaultNodes:r,defaultEdges:s,className:o,nodeTypes:a,edgeTypes:u,onNodeClick:c,onEdgeClick:h,onInit:p,onMove:m,onMoveStart:g,onMoveEnd:x,onConnect:w,onConnectStart:k,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:S,onNodeMouseEnter:b,onNodeMouseMove:N,onNodeMouseLeave:I,onNodeContextMenu:B,onNodeDoubleClick:T,onNodeDragStart:$,onNodeDrag:Q,onNodeDragStop:U,onNodesDelete:q,onEdgesDelete:L,onDelete:W,onSelectionChange:J,onSelectionDragStart:P,onSelectionDrag:O,onSelectionDragStop:F,onSelectionContextMenu:K,onSelectionStart:R,onSelectionEnd:V,onBeforeDelete:j,connectionMode:z,connectionLineType:Y=pi.Bezier,connectionLineStyle:A,connectionLineComponent:le,connectionLineContainerStyle:fe,deleteKeyCode:ce="Backspace",selectionKeyCode:ve="Shift",selectionOnDrag:se=!1,selectionMode:xe=Go.Full,panActivationKeyCode:je="Space",multiSelectionKeyCode:Pe=Zo()?"Meta":"Control",zoomActivationKeyCode:Ee=Zo()?"Meta":"Control",snapToGrid:Ce,snapGrid:Ve,onlyRenderVisibleElements:We=!1,selectNodesOnDrag:Oe,nodesDraggable:tt,autoPanOnNodeFocus:It,nodesConnectable:bt,nodesFocusable:gt,nodeOrigin:Tt=tx,edgesFocusable:Ht,edgesReconnectable:pn,elementsSelectable:mn=!0,defaultViewport:Jt=mE,minZoom:ie=.5,maxZoom:me=2,translateExtent:pe=qo,preventScrolling:$e=!0,nodeExtent:Be,defaultMarkerColor:ht="#b1b1b7",zoomOnScroll:gn=!0,zoomOnPinch:Pt=!0,panOnScroll:yt=!1,panOnScrollSpeed:_n=.5,panOnScrollMode:pt=Wi.Free,zoomOnDoubleClick:en=!0,panOnDrag:At=!0,onPaneClick:Or,onPaneMouseEnter:$r,onPaneMouseMove:Vt,onPaneMouseLeave:tr,onPaneScroll:Fn,onPaneContextMenu:yn,paneClickDistance:Br=1,nodeClickDistance:wi=0,children:On,onReconnect:vr,onReconnectStart:Ji,onReconnectEnd:wr,onEdgeContextMenu:Sr,onEdgeDoubleClick:$n,onEdgeMouseEnter:Hr,onEdgeMouseMove:Vr,onEdgeMouseLeave:Dt,reconnectRadius:kr=10,onNodesChange:St,onEdgesChange:Gs,noDragClassName:xn="nodrag",noWheelClassName:es="nowheel",noPanClassName:Ft="nopan",fitView:Si,fitViewOptions:Bn,connectOnClick:xt,attributionPosition:ki,proOptions:nr,defaultEdgeOptions:Ni,elevateNodesOnSelect:Ei=!0,elevateEdgesOnSelect:In=!1,disableKeyboardA11y:rr=!1,autoPanOnConnect:st,autoPanOnNodeDrag:Ks,autoPanSpeed:Ci,connectionRadius:bi,isValidConnection:Nr,onError:Qs,style:ts,id:Er,nodeDragThreshold:tn,connectionDragThreshold:ns,viewport:Ot,onViewportChange:Ur,width:rs,height:ir,colorMode:Wr="light",debug:Yr,onScroll:Gt,ariaLabelConfig:et,zIndexMode:Xr="basic",...Zs},ji){const qr=Er||"1",_i=vE(Wr),Hn=M.useCallback(is=>{is.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Gt==null||Gt(is)},[Gt]);return f.jsx("div",{"data-testid":"rf__wrapper",...Zs,onScroll:Hn,style:{...ts,...OC},ref:ji,className:Ct(["react-flow",o,_i]),id:Er,role:"application",children:f.jsxs(FC,{nodes:e,edges:t,width:rs,height:ir,fitView:Si,fitViewOptions:Bn,minZoom:ie,maxZoom:me,nodeOrigin:Tt,nodeExtent:Be,zIndexMode:Xr,children:[f.jsx(LC,{onInit:p,onNodeClick:c,onEdgeClick:h,onNodeMouseEnter:b,onNodeMouseMove:N,onNodeMouseLeave:I,onNodeContextMenu:B,onNodeDoubleClick:T,nodeTypes:a,edgeTypes:u,connectionLineType:Y,connectionLineStyle:A,connectionLineComponent:le,connectionLineContainerStyle:fe,selectionKeyCode:ve,selectionOnDrag:se,selectionMode:xe,deleteKeyCode:ce,multiSelectionKeyCode:Pe,panActivationKeyCode:je,zoomActivationKeyCode:Ee,onlyRenderVisibleElements:We,defaultViewport:Jt,translateExtent:pe,minZoom:ie,maxZoom:me,preventScrolling:$e,zoomOnScroll:gn,zoomOnPinch:Pt,zoomOnDoubleClick:en,panOnScroll:yt,panOnScrollSpeed:_n,panOnScrollMode:pt,panOnDrag:At,onPaneClick:Or,onPaneMouseEnter:$r,onPaneMouseMove:Vt,onPaneMouseLeave:tr,onPaneScroll:Fn,onPaneContextMenu:yn,paneClickDistance:Br,nodeClickDistance:wi,onSelectionContextMenu:K,onSelectionStart:R,onSelectionEnd:V,onReconnect:vr,onReconnectStart:Ji,onReconnectEnd:wr,onEdgeContextMenu:Sr,onEdgeDoubleClick:$n,onEdgeMouseEnter:Hr,onEdgeMouseMove:Vr,onEdgeMouseLeave:Dt,reconnectRadius:kr,defaultMarkerColor:ht,noDragClassName:xn,noWheelClassName:es,noPanClassName:Ft,rfId:qr,disableKeyboardA11y:rr,nodeExtent:Be,viewport:Ot,onViewportChange:Ur}),f.jsx(xE,{nodes:e,edges:t,defaultNodes:r,defaultEdges:s,onConnect:w,onConnectStart:k,onConnectEnd:E,onClickConnectStart:C,onClickConnectEnd:S,nodesDraggable:tt,autoPanOnNodeFocus:It,nodesConnectable:bt,nodesFocusable:gt,edgesFocusable:Ht,edgesReconnectable:pn,elementsSelectable:mn,elevateNodesOnSelect:Ei,elevateEdgesOnSelect:In,minZoom:ie,maxZoom:me,nodeExtent:Be,onNodesChange:St,onEdgesChange:Gs,snapToGrid:Ce,snapGrid:Ve,connectionMode:z,translateExtent:pe,connectOnClick:xt,defaultEdgeOptions:Ni,fitView:Si,fitViewOptions:Bn,onNodesDelete:q,onEdgesDelete:L,onDelete:W,onNodeDragStart:$,onNodeDrag:Q,onNodeDragStop:U,onSelectionDrag:O,onSelectionDragStart:P,onSelectionDragStop:F,onMove:m,onMoveStart:g,onMoveEnd:x,noPanClassName:Ft,nodeOrigin:Tt,rfId:qr,autoPanOnConnect:st,autoPanOnNodeDrag:Ks,autoPanSpeed:Ci,onError:Qs,connectionRadius:bi,isValidConnection:Nr,selectNodesOnDrag:Oe,nodeDragThreshold:tn,connectionDragThreshold:ns,onBeforeDelete:j,debug:Yr,ariaLabelConfig:et,zIndexMode:Xr}),f.jsx(pE,{onSelectionChange:J}),On,f.jsx(uE,{proOptions:nr,position:ki}),f.jsx(aE,{rfId:qr,disableKeyboardA11y:rr})]})})}var Tx=sx($C);function BC(e){const[t,r]=M.useState(e),s=M.useCallback(o=>r(a=>rx(o,a)),[]);return[t,r,s]}function HC(e){const[t,r]=M.useState(e),s=M.useCallback(o=>r(a=>ix(o,a)),[]);return[t,r,s]}function VC({dimensions:e,lineWidth:t,variant:r,className:s}){return f.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ct(["react-flow__background-pattern",r,s])})}function UC({radius:e,className:t}){return f.jsx("circle",{cx:e,cy:e,r:e,className:Ct(["react-flow__background-pattern","dots",t])})}var mr;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(mr||(mr={}));const WC={[mr.Dots]:1,[mr.Lines]:1,[mr.Cross]:6},YC=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Px({id:e,variant:t=mr.Dots,gap:r=20,size:s,lineWidth:o=1,offset:a=0,color:u,bgColor:c,style:h,className:p,patternClassName:m}){const g=M.useRef(null),{transform:x,patternId:w}=qe(YC,ut),k=s||WC[t],E=t===mr.Dots,C=t===mr.Cross,S=Array.isArray(r)?r:[r,r],b=[S[0]*x[2]||1,S[1]*x[2]||1],N=k*x[2],I=Array.isArray(a)?a:[a,a],B=C?[N,N]:b,T=[I[0]*x[2]||1+B[0]/2,I[1]*x[2]||1+B[1]/2],$=`${w}${e||""}`;return f.jsxs("svg",{className:Ct(["react-flow__background",p]),style:{...h,...Ja,"--xy-background-color-props":c,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[f.jsx("pattern",{id:$,x:x[0]%b[0],y:x[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:E?f.jsx(UC,{radius:N/2,className:m}):f.jsx(VC,{dimensions:B,lineWidth:o,variant:t,className:m})}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${$})`})]})}Px.displayName="Background";const Ax=M.memo(Px);function XC(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:f.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function qC(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:f.jsx("path",{d:"M0 0h32v4.2H0z"})})}function GC(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:f.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 KC(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 QC(){return f.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:f.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 va({children:e,className:t,...r}){return f.jsx("button",{type:"button",className:Ct(["react-flow__controls-button",t]),...r,children:e})}const ZC=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Mx({style:e,showZoom:t=!0,showFitView:r=!0,showInteractive:s=!0,fitViewOptions:o,onZoomIn:a,onZoomOut:u,onFitView:c,onInteractiveChange:h,className:p,children:m,position:g="bottom-left",orientation:x="vertical","aria-label":w}){const k=ct(),{isInteractive:E,minZoomReached:C,maxZoomReached:S,ariaLabelConfig:b}=qe(ZC,ut),{zoomIn:N,zoomOut:I,fitView:B}=Kd(),T=()=>{N(),a==null||a()},$=()=>{I(),u==null||u()},Q=()=>{B(o),c==null||c()},U=()=>{k.setState({nodesDraggable:!E,nodesConnectable:!E,elementsSelectable:!E}),h==null||h(!E)},q=x==="horizontal"?"horizontal":"vertical";return f.jsxs(Za,{className:Ct(["react-flow__controls",q,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":w??b["controls.ariaLabel"],children:[t&&f.jsxs(f.Fragment,{children:[f.jsx(va,{onClick:T,className:"react-flow__controls-zoomin",title:b["controls.zoomIn.ariaLabel"],"aria-label":b["controls.zoomIn.ariaLabel"],disabled:S,children:f.jsx(XC,{})}),f.jsx(va,{onClick:$,className:"react-flow__controls-zoomout",title:b["controls.zoomOut.ariaLabel"],"aria-label":b["controls.zoomOut.ariaLabel"],disabled:C,children:f.jsx(qC,{})})]}),r&&f.jsx(va,{className:"react-flow__controls-fitview",onClick:Q,title:b["controls.fitView.ariaLabel"],"aria-label":b["controls.fitView.ariaLabel"],children:f.jsx(GC,{})}),s&&f.jsx(va,{className:"react-flow__controls-interactive",onClick:U,title:b["controls.interactive.ariaLabel"],"aria-label":b["controls.interactive.ariaLabel"],children:E?f.jsx(QC,{}):f.jsx(KC,{})}),m]})}Mx.displayName="Controls";const Rx=M.memo(Mx);function JC({id:e,x:t,y:r,width:s,height:o,style:a,color:u,strokeColor:c,strokeWidth:h,className:p,borderRadius:m,shapeRendering:g,selected:x,onClick:w}){const{background:k,backgroundColor:E}=a||{},C=u||k||E;return f.jsx("rect",{className:Ct(["react-flow__minimap-node",{selected:x},p]),x:t,y:r,rx:m,ry:m,width:s,height:o,style:{fill:C,stroke:c,strokeWidth:h},shapeRendering:g,onClick:w?S=>w(S,e):void 0})}const eb=M.memo(JC),tb=e=>e.nodes.map(t=>t.id),qc=e=>e instanceof Function?e:()=>e;function nb({nodeStrokeColor:e,nodeColor:t,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:a=eb,onClick:u}){const c=qe(tb,ut),h=qc(t),p=qc(e),m=qc(r),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return f.jsx(f.Fragment,{children:c.map(x=>f.jsx(ib,{id:x,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:m,nodeBorderRadius:s,nodeStrokeWidth:o,NodeComponent:a,onClick:u,shapeRendering:g},x))})}function rb({id:e,nodeColorFunc:t,nodeStrokeColorFunc:r,nodeClassNameFunc:s,nodeBorderRadius:o,nodeStrokeWidth:a,shapeRendering:u,NodeComponent:c,onClick:h}){const{node:p,x:m,y:g,width:x,height:w}=qe(k=>{const{internals:E}=k.nodeLookup.get(e),C=E.userNode,{x:S,y:b}=E.positionAbsolute,{width:N,height:I}=Fr(C);return{node:C,x:S,y:b,width:N,height:I}},ut);return!p||p.hidden||!Iy(p)?null:f.jsx(c,{x:m,y:g,width:x,height:w,style:p.style,selected:!!p.selected,className:s(p),color:t(p),borderRadius:o,strokeColor:r(p),strokeWidth:a,shapeRendering:u,onClick:h,id:p.id})}const ib=M.memo(rb);var sb=M.memo(nb);const ob=200,lb=150,ab=e=>!e.hidden,ub=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?_y(ol(e.nodeLookup,{filter:ab}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},cb="react-flow__minimap-desc";function zx({style:e,className:t,nodeStrokeColor:r,nodeColor:s,nodeClassName:o="",nodeBorderRadius:a=5,nodeStrokeWidth:u,nodeComponent:c,bgColor:h,maskColor:p,maskStrokeColor:m,maskStrokeWidth:g,position:x="bottom-right",onClick:w,onNodeClick:k,pannable:E=!1,zoomable:C=!1,ariaLabel:S,inversePan:b,zoomStep:N=1,offsetScale:I=5}){const B=ct(),T=M.useRef(null),{boundingRect:$,viewBB:Q,rfId:U,panZoom:q,translateExtent:L,flowWidth:W,flowHeight:J,ariaLabelConfig:P}=qe(ub,ut),O=(e==null?void 0:e.width)??ob,F=(e==null?void 0:e.height)??lb,K=$.width/O,R=$.height/F,V=Math.max(K,R),j=V*O,z=V*F,Y=I*V,A=$.x-(j-$.width)/2-Y,le=$.y-(z-$.height)/2-Y,fe=j+Y*2,ce=z+Y*2,ve=`${cb}-${U}`,se=M.useRef(0),xe=M.useRef();se.current=V,M.useEffect(()=>{if(T.current&&q)return xe.current=jN({domNode:T.current,panZoom:q,getTransform:()=>B.getState().transform,getViewScale:()=>se.current}),()=>{var Ce;(Ce=xe.current)==null||Ce.destroy()}},[q]),M.useEffect(()=>{var Ce;(Ce=xe.current)==null||Ce.update({translateExtent:L,width:W,height:J,inversePan:b,pannable:E,zoomStep:N,zoomable:C})},[E,C,b,N,L,W,J]);const je=w?Ce=>{var Oe;const[Ve,We]=((Oe=xe.current)==null?void 0:Oe.pointer(Ce))||[0,0];w(Ce,{x:Ve,y:We})}:void 0,Pe=k?M.useCallback((Ce,Ve)=>{const We=B.getState().nodeLookup.get(Ve).internals.userNode;k(Ce,We)},[]):void 0,Ee=S??P["minimap.ariaLabel"];return f.jsx(Za,{position:x,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*V:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:Ct(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:f.jsxs("svg",{width:O,height:F,viewBox:`${A} ${le} ${fe} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ve,ref:T,onClick:je,children:[Ee&&f.jsx("title",{id:ve,children:Ee}),f.jsx(sb,{onClick:Pe,nodeColor:s,nodeStrokeColor:r,nodeBorderRadius:a,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:c}),f.jsx("path",{className:"react-flow__minimap-mask",d:`M${A-Y},${le-Y}h${fe+Y*2}v${ce+Y*2}h${-fe-Y*2}z
|
|
62
|
-
M${Q.x},${Q.y}h${Q.width}v${Q.height}h${-Q.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}zx.displayName="MiniMap";M.memo(zx);const db=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,fb={[Qi.Line]:"right",[Qi.Handle]:"bottom-right"};function hb({nodeId:e,position:t,variant:r=Qi.Handle,className:s,style:o=void 0,children:a,color:u,minWidth:c=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:x,autoScale:w=!0,shouldResize:k,onResizeStart:E,onResize:C,onResizeEnd:S}){const b=ux(),N=typeof e=="string"?e:b,I=ct(),B=M.useRef(null),T=r===Qi.Handle,$=qe(M.useCallback(db(T&&w),[T,w]),ut),Q=M.useRef(null),U=t??fb[r];M.useEffect(()=>{if(!(!B.current||!N))return Q.current||(Q.current=VN({domNode:B.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:L,transform:W,snapGrid:J,snapToGrid:P,nodeOrigin:O,domNode:F}=I.getState();return{nodeLookup:L,transform:W,snapGrid:J,snapToGrid:P,nodeOrigin:O,paneDomNode:F}},onChange:(L,W)=>{const{triggerNodeChanges:J,nodeLookup:P,parentLookup:O,nodeOrigin:F}=I.getState(),K=[],R={x:L.x,y:L.y},V=P.get(N);if(V&&V.expandParent&&V.parentId){const j=V.origin??F,z=L.width??V.measured.width??0,Y=L.height??V.measured.height??0,A={id:V.id,parentId:V.parentId,rect:{width:z,height:Y,...Ty({x:L.x??V.position.x,y:L.y??V.position.y},{width:z,height:Y},V.parentId,P,j)}},le=Gd([A],P,O,F);K.push(...le),R.x=L.x?Math.max(j[0]*z,L.x):void 0,R.y=L.y?Math.max(j[1]*Y,L.y):void 0}if(R.x!==void 0&&R.y!==void 0){const j={id:N,type:"position",position:{...R}};K.push(j)}if(L.width!==void 0&&L.height!==void 0){const z={id:N,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:L.width,height:L.height}};K.push(z)}for(const j of W){const z={...j,type:"position"};K.push(z)}J(K)},onEnd:({width:L,height:W})=>{const J={id:N,type:"dimensions",resizing:!1,dimensions:{width:L,height:W}};I.getState().triggerNodeChanges([J])}})),Q.current.update({controlPosition:U,boundaries:{minWidth:c,minHeight:h,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:x,onResizeStart:E,onResize:C,onResizeEnd:S,shouldResize:k}),()=>{var L;(L=Q.current)==null||L.destroy()}},[U,c,h,p,m,g,E,C,S,k]);const q=U.split("-");return f.jsx("div",{className:Ct(["react-flow__resize-control","nodrag",...q,r,s]),ref:B,style:{...o,scale:$,...u&&{[T?"backgroundColor":"borderColor"]:u}},children:a})}const Um=M.memo(hb);function pb({nodeId:e,isVisible:t=!0,handleClassName:r,handleStyle:s,lineClassName:o,lineStyle:a,color:u,minWidth:c=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,autoScale:x=!0,shouldResize:w,onResizeStart:k,onResize:E,onResizeEnd:C}){return t?f.jsxs(f.Fragment,{children:[DN.map(S=>f.jsx(Um,{className:o,style:a,nodeId:e,position:S,variant:Qi.Line,color:u,minWidth:c,minHeight:h,maxWidth:p,maxHeight:m,onResizeStart:k,keepAspectRatio:g,autoScale:x,shouldResize:w,onResize:E,onResizeEnd:C},S)),LN.map(S=>f.jsx(Um,{className:r,style:s,nodeId:e,position:S,color:u,minWidth:c,minHeight:h,maxWidth:p,maxHeight:m,onResizeStart:k,keepAspectRatio:g,autoScale:x,shouldResize:w,onResize:E,onResizeEnd:C},S))]}):null}function mb(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),o=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(o),t&&(s.href=t),o.href=e,o.href}const gb=(()=>{let e=0;const t=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)})();function gi(e){const t=[];for(let r=0,s=e.length;r<s;r++)t.push(e[r]);return t}let Ts=null;function Lx(e={}){return Ts||(e.includeStyleProperties?(Ts=e.includeStyleProperties,Ts):(Ts=gi(window.getComputedStyle(document.documentElement)),Ts))}function Oa(e,t){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(t);return s?parseFloat(s.replace("px","")):0}function yb(e){const t=Oa(e,"border-left-width"),r=Oa(e,"border-right-width");return e.clientWidth+t+r}function xb(e){const t=Oa(e,"border-top-width"),r=Oa(e,"border-bottom-width");return e.clientHeight+t+r}function Dx(e,t={}){const r=t.width||yb(e),s=t.height||xb(e);return{width:r,height:s}}function vb(){let e,t;try{t=process}catch{}const r=t&&t.env?t.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const Nn=16384;function wb(e){(e.width>Nn||e.height>Nn)&&(e.width>Nn&&e.height>Nn?e.width>e.height?(e.height*=Nn/e.width,e.width=Nn):(e.width*=Nn/e.height,e.height=Nn):e.width>Nn?(e.height*=Nn/e.width,e.width=Nn):(e.width*=Nn/e.height,e.height=Nn))}function $a(e){return new Promise((t,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>t(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function Sb(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(t=>`data:image/svg+xml;charset=utf-8,${t}`)}async function kb(e,t,r){const s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg"),a=document.createElementNS(s,"foreignObject");return o.setAttribute("width",`${t}`),o.setAttribute("height",`${r}`),o.setAttribute("viewBox",`0 0 ${t} ${r}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("externalResourcesRequired","true"),o.appendChild(a),a.appendChild(e),Sb(o)}const dn=(e,t)=>{if(e instanceof t)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===t.name||dn(r,t)};function Nb(e){const t=e.getPropertyValue("content");return`${e.cssText} content: '${t.replace(/'|"/g,"")}';`}function Eb(e,t){return Lx(t).map(r=>{const s=e.getPropertyValue(r),o=e.getPropertyPriority(r);return`${r}: ${s}${o?" !important":""};`}).join(" ")}function Cb(e,t,r,s){const o=`.${e}:${t}`,a=r.cssText?Nb(r):Eb(r,s);return document.createTextNode(`${o}{${a}}`)}function Wm(e,t,r,s){const o=window.getComputedStyle(e,r),a=o.getPropertyValue("content");if(a===""||a==="none")return;const u=gb();try{t.className=`${t.className} ${u}`}catch{return}const c=document.createElement("style");c.appendChild(Cb(u,r,o,s)),t.appendChild(c)}function bb(e,t,r){Wm(e,t,":before",r),Wm(e,t,":after",r)}const Ym="application/font-woff",Xm="image/jpeg",jb={woff:Ym,woff2:Ym,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Xm,jpeg:Xm,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function _b(e){const t=/\.([^./]*?)$/g.exec(e);return t?t[1]:""}function Zd(e){const t=_b(e).toLowerCase();return jb[t]||""}function Ib(e){return e.split(/,/)[1]}function Nd(e){return e.search(/^(data:)/)!==-1}function Tb(e,t){return`data:${t};base64,${e}`}async function Fx(e,t,r){const s=await fetch(e,t);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const o=await s.blob();return new Promise((a,u)=>{const c=new FileReader;c.onerror=u,c.onloadend=()=>{try{a(r({res:s,result:c.result}))}catch(h){u(h)}},c.readAsDataURL(o)})}const Gc={};function Pb(e,t,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),t?`[${t}]${s}`:s}async function Jd(e,t,r){const s=Pb(e,t,r.includeQueryParams);if(Gc[s]!=null)return Gc[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let o;try{const a=await Fx(e,r.fetchRequestInit,({res:u,result:c})=>(t||(t=u.headers.get("Content-Type")||""),Ib(c)));o=Tb(a,t)}catch(a){o=r.imagePlaceholder||"";let u=`Failed to fetch resource: ${e}`;a&&(u=typeof a=="string"?a:a.message),u&&console.warn(u)}return Gc[s]=o,o}async function Ab(e){const t=e.toDataURL();return t==="data:,"?e.cloneNode(!1):$a(t)}async function Mb(e,t){if(e.currentSrc){const a=document.createElement("canvas"),u=a.getContext("2d");a.width=e.clientWidth,a.height=e.clientHeight,u==null||u.drawImage(e,0,0,a.width,a.height);const c=a.toDataURL();return $a(c)}const r=e.poster,s=Zd(r),o=await Jd(r,s,t);return $a(o)}async function Rb(e,t){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await tu(e.contentDocument.body,t,!0)}catch{}return e.cloneNode(!1)}async function zb(e,t){return dn(e,HTMLCanvasElement)?Ab(e):dn(e,HTMLVideoElement)?Mb(e,t):dn(e,HTMLIFrameElement)?Rb(e,t):e.cloneNode(Ox(e))}const Lb=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",Ox=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function Db(e,t,r){var s,o;if(Ox(t))return t;let a=[];return Lb(e)&&e.assignedNodes?a=gi(e.assignedNodes()):dn(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?a=gi(e.contentDocument.body.childNodes):a=gi(((o=e.shadowRoot)!==null&&o!==void 0?o:e).childNodes),a.length===0||dn(e,HTMLVideoElement)||await a.reduce((u,c)=>u.then(()=>tu(c,r)).then(h=>{h&&t.appendChild(h)}),Promise.resolve()),t}function Fb(e,t,r){const s=t.style;if(!s)return;const o=window.getComputedStyle(e);o.cssText?(s.cssText=o.cssText,s.transformOrigin=o.transformOrigin):Lx(r).forEach(a=>{let u=o.getPropertyValue(a);a==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),dn(e,HTMLIFrameElement)&&a==="display"&&u==="inline"&&(u="block"),a==="d"&&t.getAttribute("d")&&(u=`path(${t.getAttribute("d")})`),s.setProperty(a,u,o.getPropertyPriority(a))})}function Ob(e,t){dn(e,HTMLTextAreaElement)&&(t.innerHTML=e.value),dn(e,HTMLInputElement)&&t.setAttribute("value",e.value)}function $b(e,t){if(dn(e,HTMLSelectElement)){const s=Array.from(t.children).find(o=>e.value===o.getAttribute("value"));s&&s.setAttribute("selected","")}}function Bb(e,t,r){return dn(t,Element)&&(Fb(e,t,r),bb(e,t,r),Ob(e,t),$b(e,t)),t}async function Hb(e,t){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let a=0;a<r.length;a++){const c=r[a].getAttribute("xlink:href");if(c){const h=e.querySelector(c),p=document.querySelector(c);!h&&p&&!s[c]&&(s[c]=await tu(p,t,!0))}}const o=Object.values(s);if(o.length){const a="http://www.w3.org/1999/xhtml",u=document.createElementNS(a,"svg");u.setAttribute("xmlns",a),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const c=document.createElementNS(a,"defs");u.appendChild(c);for(let h=0;h<o.length;h++)c.appendChild(o[h]);e.appendChild(u)}return e}async function tu(e,t,r){return!r&&t.filter&&!t.filter(e)?null:Promise.resolve(e).then(s=>zb(s,t)).then(s=>Db(e,s,t)).then(s=>Bb(e,s,t)).then(s=>Hb(s,t))}const $x=/url\((['"]?)([^'"]+?)\1\)/g,Vb=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Ub=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Wb(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Yb(e){const t=[];return e.replace($x,(r,s,o)=>(t.push(o),r)),t.filter(r=>!Nd(r))}async function Xb(e,t,r,s,o){try{const a=r?mb(t,r):t,u=Zd(t);let c;return o||(c=await Jd(a,u,s)),e.replace(Wb(t),`$1${c}$3`)}catch{}return e}function qb(e,{preferredFontFormat:t}){return t?e.replace(Ub,r=>{for(;;){const[s,,o]=Vb.exec(r)||[];if(!o)return"";if(o===t)return`src: ${s};`}}):e}function Bx(e){return e.search($x)!==-1}async function Hx(e,t,r){if(!Bx(e))return e;const s=qb(e,r);return Yb(s).reduce((a,u)=>a.then(c=>Xb(c,u,t,r)),Promise.resolve(s))}async function Ps(e,t,r){var s;const o=(s=t.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(o){const a=await Hx(o,null,r);return t.style.setProperty(e,a,t.style.getPropertyPriority(e)),!0}return!1}async function Gb(e,t){await Ps("background",e,t)||await Ps("background-image",e,t),await Ps("mask",e,t)||await Ps("-webkit-mask",e,t)||await Ps("mask-image",e,t)||await Ps("-webkit-mask-image",e,t)}async function Kb(e,t){const r=dn(e,HTMLImageElement);if(!(r&&!Nd(e.src))&&!(dn(e,SVGImageElement)&&!Nd(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,o=await Jd(s,Zd(s),t);await new Promise((a,u)=>{e.onload=a,e.onerror=t.onImageErrorHandler?(...h)=>{try{a(t.onImageErrorHandler(...h))}catch(p){u(p)}}:u;const c=e;c.decode&&(c.decode=a),c.loading==="lazy"&&(c.loading="eager"),r?(e.srcset="",e.src=o):e.href.baseVal=o})}async function Qb(e,t){const s=gi(e.childNodes).map(o=>Vx(o,t));await Promise.all(s).then(()=>e)}async function Vx(e,t){dn(e,Element)&&(await Gb(e,t),await Kb(e,t),await Qb(e,t))}function Zb(e,t){const{style:r}=e;t.backgroundColor&&(r.backgroundColor=t.backgroundColor),t.width&&(r.width=`${t.width}px`),t.height&&(r.height=`${t.height}px`);const s=t.style;return s!=null&&Object.keys(s).forEach(o=>{r[o]=s[o]}),e}const qm={};async function Gm(e){let t=qm[e];if(t!=null)return t;const s=await(await fetch(e)).text();return t={url:e,cssText:s},qm[e]=t,t}async function Km(e,t){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,a=(r.match(/url\([^)]+\)/g)||[]).map(async u=>{let c=u.replace(s,"$1");return c.startsWith("https://")||(c=new URL(c,e.url).href),Fx(c,t.fetchRequestInit,({result:h})=>(r=r.replace(u,`url(${h})`),[u,h]))});return Promise.all(a).then(()=>r)}function Qm(e){if(e==null)return[];const t=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const o=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const h=o.exec(s);if(h===null)break;t.push(h[0])}s=s.replace(o,"");const a=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",c=new RegExp(u,"gi");for(;;){let h=a.exec(s);if(h===null){if(h=c.exec(s),h===null)break;a.lastIndex=c.lastIndex}else c.lastIndex=a.lastIndex;t.push(h[0])}return t}async function Jb(e,t){const r=[],s=[];return e.forEach(o=>{if("cssRules"in o)try{gi(o.cssRules||[]).forEach((a,u)=>{if(a.type===CSSRule.IMPORT_RULE){let c=u+1;const h=a.href,p=Gm(h).then(m=>Km(m,t)).then(m=>Qm(m).forEach(g=>{try{o.insertRule(g,g.startsWith("@import")?c+=1:o.cssRules.length)}catch(x){console.error("Error inserting rule from remote css",{rule:g,error:x})}})).catch(m=>{console.error("Error loading remote css",m.toString())});s.push(p)}})}catch(a){const u=e.find(c=>c.href==null)||document.styleSheets[0];o.href!=null&&s.push(Gm(o.href).then(c=>Km(c,t)).then(c=>Qm(c).forEach(h=>{u.insertRule(h,u.cssRules.length)})).catch(c=>{console.error("Error loading remote stylesheet",c)})),console.error("Error inlining remote css file",a)}}),Promise.all(s).then(()=>(e.forEach(o=>{if("cssRules"in o)try{gi(o.cssRules||[]).forEach(a=>{r.push(a)})}catch(a){console.error(`Error while reading CSS rules from ${o.href}`,a)}}),r))}function ej(e){return e.filter(t=>t.type===CSSRule.FONT_FACE_RULE).filter(t=>Bx(t.style.getPropertyValue("src")))}async function tj(e,t){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=gi(e.ownerDocument.styleSheets),s=await Jb(r,t);return ej(s)}function Ux(e){return e.trim().replace(/["']/g,"")}function nj(e){const t=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(a=>{t.add(Ux(a))}),Array.from(s.children).forEach(a=>{a instanceof HTMLElement&&r(a)})}return r(e),t}async function rj(e,t){const r=await tj(e,t),s=nj(e);return(await Promise.all(r.filter(a=>s.has(Ux(a.style.fontFamily))).map(a=>{const u=a.parentStyleSheet?a.parentStyleSheet.href:null;return Hx(a.cssText,u,t)}))).join(`
|
|
63
|
-
`)}async function ij(e,t){const r=t.fontEmbedCSS!=null?t.fontEmbedCSS:t.skipFonts?null:await rj(e,t);if(r){const s=document.createElement("style"),o=document.createTextNode(r);s.appendChild(o),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function Wx(e,t={}){const{width:r,height:s}=Dx(e,t),o=await tu(e,t,!0);return await ij(o,t),await Vx(o,t),Zb(o,t),await kb(o,r,s)}async function sj(e,t={}){const{width:r,height:s}=Dx(e,t),o=await Wx(e,t),a=await $a(o),u=document.createElement("canvas"),c=u.getContext("2d"),h=t.pixelRatio||vb(),p=t.canvasWidth||r,m=t.canvasHeight||s;return u.width=p*h,u.height=m*h,t.skipAutoScale||wb(u),u.style.width=`${p}`,u.style.height=`${m}`,t.backgroundColor&&(c.fillStyle=t.backgroundColor,c.fillRect(0,0,u.width,u.height)),c.drawImage(a,0,0,u.width,u.height),u}async function oj(e,t={}){return(await sj(e,t)).toDataURL()}function lj({feature:e,onClose:t}){return f.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},onClick:t,children:f.jsxs("div",{style:{background:"#1e1e2e",border:"1px solid #444",borderRadius:12,padding:"32px 40px",maxWidth:420,textAlign:"center"},onClick:r=>r.stopPropagation(),children:[f.jsx("div",{style:{fontSize:32,marginBottom:12},children:"🔒"}),f.jsxs("h2",{style:{color:"#fff",margin:"0 0 8px",fontSize:20},children:[e," is a Pro feature"]}),f.jsxs("p",{style:{color:"#aaa",margin:"0 0 24px",fontSize:14,lineHeight:1.5},children:["Upgrade to Pro for ",e.toLowerCase(),", drift detection, premium agents, and more."]}),f.jsx("a",{href:"https://heartbyte.io/archbyte/pricing",target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",background:"#7c3aed",color:"#fff",padding:"10px 28px",borderRadius:8,textDecoration:"none",fontWeight:600,fontSize:14},children:"Upgrade to Pro"}),f.jsx("button",{onClick:t,style:{display:"block",margin:"16px auto 0",background:"none",border:"none",color:"#888",cursor:"pointer",fontSize:13},children:"Maybe later"})]})})}function Zm({trigger:e,triggerClassName:t,contentClassName:r,children:s,disabled:o}){const[a,u]=M.useState(!1),c=M.useRef(null);return M.useEffect(()=>{if(!a)return;const h=m=>{c.current&&!c.current.contains(m.target)&&u(!1)},p=()=>u(!1);return document.addEventListener("mousedown",h),document.addEventListener("dropdown:closeall",p),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("dropdown:closeall",p)}},[a]),f.jsxs("div",{ref:c,className:"dropdown-wrapper",children:[f.jsx("button",{className:t,onClick:()=>!o&&u(!a),disabled:o,children:e}),a&&f.jsx("div",{className:`dropdown-menu ${r||""}`,onClick:()=>u(!1),children:s})]})}const aj={presentation:"#1971c2",application:"#e67700",data:"#2f9e44",external:"#9c36b5",deployment:"#c92a2a"},Jm={frontend:"■",backend:"⬡",service:"⬡",worker:"⚙",gateway:"⬥",database:"⎕",external:"☁",component:"●",cli:"❯",library:"≡"};function uj({data:e,selected:t}){var p,m,g,x,w;const r=e,s=r.label.split(`
|
|
64
|
-
`),o=s[0],a=s.slice(1).join(`
|
|
65
|
-
`),u=["arch-node",r.layer,r.active?"active":"",r.highlighted?"highlighted":"",r.locked?"locked":"",r.isConnected===!0?"connected":"",r.isConnected===!1?"dimmed":"",r.changeType?`change-${r.changeType}`:"",r.healthScore!=null?r.healthScore>=75?"health-green":r.healthScore>=50?"health-amber":"health-red":"",(p=r.healthFlags)!=null&&p.isOrphan?"health-orphan":"",(m=r.healthFlags)!=null&&m.isHub?"health-hub":"",(g=r.healthFlags)!=null&&g.inCycle?"health-cycle":"",(x=r.pendingFiles)!=null&&x.length?"has-pending-changes":""].filter(Boolean).join(" "),c=aj[r.layer]||"#868e96",h=Jm[r.nodeType]||Jm.component;return f.jsxs(f.Fragment,{children:[f.jsx(pb,{color:c,isVisible:t,minWidth:100,minHeight:60}),f.jsxs("div",{className:u,style:{minWidth:r.width||130,width:"100%",height:"100%"},children:[f.jsx(mi,{type:"target",position:Te.Top}),f.jsx(mi,{type:"target",position:Te.Left}),f.jsx("div",{className:"node-type-icon",children:h}),f.jsxs("div",{className:"node-content",children:[f.jsx("div",{className:"label",children:o}),a&&f.jsx("div",{className:"sublabel",children:a}),r.description&&f.jsx("div",{className:"node-desc",children:r.description})]}),r.techStack&&r.techStack.length>0&&f.jsx("div",{className:"node-tech-row",children:r.techStack.slice(0,3).map((k,E)=>f.jsx("span",{className:"node-tech-pill",children:k},E))}),r.changeType&&f.jsx("div",{className:`change-indicator change-${r.changeType}`,children:r.changeType==="added"?"+":r.changeType==="modified"?"~":"-"}),r.pendingFiles&&r.pendingFiles.length>0&&f.jsxs("div",{className:"pending-change-badge",children:[r.pendingFiles.some(k=>k.event==="add")?"+":"~",r.pendingFiles.length]}),((w=r.healthFlags)==null?void 0:w.isHub)&&r.healthScore!=null&&f.jsx("div",{className:"health-hub-badge",children:"HUB"}),f.jsx(mi,{type:"source",position:Te.Bottom}),f.jsx(mi,{type:"source",position:Te.Right})]})]})}const Yx=M.memo(uj),cj={develop:"#2f9e44",development:"#2f9e44",dev:"#2f9e44",staging:"#e67700",stage:"#e67700",production:"#c92a2a",prod:"#c92a2a"};function dj({selectedEnvironment:e,environments:t,onSelectEnvironment:r}){if(!t||Object.keys(t).length===0)return null;const s=Object.keys(t);return f.jsx("div",{className:"environment-tabs",children:s.map(o=>{var p;const a=e===o,u=t==null?void 0:t[o],c=(u==null?void 0:u.color)||cj[o]||"#6b7280",h=(u==null?void 0:u.label)||o.charAt(0).toUpperCase()+o.slice(1);return f.jsxs("button",{className:`env-tab ${a?"selected":""}`,onClick:()=>r(o),style:{"--env-color":c},children:[f.jsx("span",{className:"env-indicator"}),f.jsx("span",{className:"env-label",children:h}),a&&u&&f.jsx("span",{className:"env-meta",children:[u.deployment,u.scaling,(p=u.urlPatterns||u.urls)==null?void 0:p[0]].filter(Boolean).join(" | ")})]},o)})})}const fj=M.memo(dj);function yi({children:e,className:t,style:r}){const s=M.useRef(null),[o,a]=M.useState({x:0,y:0}),u=M.useRef(!1),c=M.useRef({x:0,y:0}),h=M.useRef({x:0,y:0}),p=M.useCallback(m=>{const g=m.target;if(!g.closest("[data-drag-handle]")||g.closest("button"))return;u.current=!0,c.current={x:m.clientX,y:m.clientY},h.current={...o},m.preventDefault();const w=E=>{u.current&&a({x:h.current.x+(E.clientX-c.current.x),y:h.current.y+(E.clientY-c.current.y)})},k=()=>{u.current=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",w),document.addEventListener("mouseup",k)},[o]);return f.jsx("div",{ref:s,className:t,style:{...r,transform:`translate(${o.x}px, ${o.y}px)`},onMouseDown:p,children:e})}function hj(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function pj(e){return new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function mj({visible:e,onClose:t}){const[r,s]=M.useState(null),o=M.useCallback(async()=>{try{const a=await fetch("/api/stats");a.ok&&s(await a.json())}catch{}},[]);return M.useEffect(()=>{e&&o()},[e,o]),!e||!r?null:f.jsxs(yi,{className:"stats-overlay",children:[f.jsxs("div",{className:"stats-overlay-header","data-drag-handle":!0,children:[f.jsx("span",{className:"stats-overlay-title",children:"Architecture Stats"}),f.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),(r.durationMs||r.filesScanned||r.analyzedAt)&&f.jsxs("div",{className:"stats-scan-info",children:[r.durationMs!=null&&f.jsx("span",{className:"scan-info-item",children:hj(r.durationMs)}),r.filesScanned!=null&&f.jsxs("span",{className:"scan-info-item",children:[r.filesScanned.toLocaleString()," files"]}),r.tokenUsage&&f.jsxs("span",{className:"scan-info-item",children:[(r.tokenUsage.input+r.tokenUsage.output).toLocaleString()," tokens"]}),r.analyzedAt&&f.jsx("span",{className:"scan-info-item",children:pj(r.analyzedAt)})]}),f.jsxs("div",{className:"stats-grid",children:[f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:r.components}),f.jsx("div",{className:"stat-label",children:"Components"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:r.totalConnections}),f.jsx("div",{className:"stat-label",children:"Connections"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:r.databases}),f.jsx("div",{className:"stat-label",children:"Databases"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:r.externalServices}),f.jsx("div",{className:"stat-label",children:"External"})]}),f.jsxs("div",{className:`stat-card ${r.orphans>0?"highlight":""}`,children:[f.jsx("div",{className:"stat-value",children:r.orphans}),f.jsx("div",{className:"stat-label",children:"Orphans"})]}),f.jsxs("div",{className:"stat-card",children:[f.jsx("div",{className:"stat-value",children:r.flows}),f.jsx("div",{className:"stat-label",children:"Flows"})]})]})]})}const gj=M.memo(mj);function yj({visible:e,onClose:t,builtinRules:r,customRules:s,onAddRule:o,onDeleteRule:a,onSave:u,saving:c}){const[h,p]=M.useState("builtin"),[m,g]=M.useState(""),[x,w]=M.useState(""),[k,E]=M.useState(""),[C,S]=M.useState("warn");if(!e)return null;const b=()=>{!m.trim()||!x.trim()||!k.trim()||(o({name:m.trim(),from:x.trim(),to:k.trim(),level:C}),g(""),w(""),E(""),S("warn"))};return f.jsxs(f.Fragment,{children:[f.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:999},onClick:t}),f.jsxs("div",{className:"rules-config-modal",children:[f.jsxs("div",{className:"rules-modal-header",children:[f.jsx("span",{className:"rules-modal-title",children:"Configure Rules"}),f.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),f.jsxs("div",{className:"rules-modal-tabs",children:[f.jsx("button",{className:`rules-modal-tab ${h==="builtin"?"active":""}`,onClick:()=>p("builtin"),children:"Built-in"}),f.jsx("button",{className:`rules-modal-tab ${h==="custom"?"active":""}`,onClick:()=>p("custom"),children:"Custom"})]}),f.jsxs("div",{className:"rules-modal-content",children:[h==="builtin"&&f.jsxs("div",{children:[f.jsx("div",{className:"rules-section-title",children:"Built-in Architecture Rules"}),r.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No built-in rules available"}):r.map(N=>f.jsxs("div",{className:"rule-config-item",children:[f.jsx("div",{className:"rule-config-name",children:N.name}),f.jsx("div",{className:"rule-config-desc",children:N.description||"No description"})]},N.name))]}),h==="custom"&&f.jsxs("div",{children:[f.jsx("div",{className:"rules-section-title",children:"Custom Rules"}),s.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"12px 0"},children:"No custom rules yet"}):s.map((N,I)=>f.jsxs("div",{className:"rule-config-item custom",children:[f.jsxs("div",{className:"rule-config-name",children:[N.name,f.jsx("span",{className:`rule-level-badge ${N.level}`,children:N.level})]}),f.jsxs("div",{className:"rule-config-matcher",children:[N.from," → ",N.to]}),f.jsx("button",{className:"panel-btn red small rule-delete-btn",onClick:()=>a(I),children:"x"})]},I)),f.jsxs("div",{className:"rule-add-form",children:[f.jsx("div",{className:"rule-add-title",children:"Add Custom Rule"}),f.jsx("input",{type:"text",placeholder:"Rule name",value:m,onChange:N=>g(N.target.value),className:"rule-input"}),f.jsxs("div",{className:"rule-add-row",children:[f.jsx("input",{type:"text",placeholder:"From (e.g. layer:presentation)",value:x,onChange:N=>w(N.target.value),className:"rule-input"}),f.jsx("span",{className:"rule-arrow",children:"→"}),f.jsx("input",{type:"text",placeholder:"To (e.g. layer:data)",value:k,onChange:N=>E(N.target.value),className:"rule-input"})]}),f.jsxs("div",{className:"rule-add-row",children:[f.jsxs("select",{value:C,onChange:N=>S(N.target.value),className:"rule-select",children:[f.jsx("option",{value:"warn",children:"warn"}),f.jsx("option",{value:"error",children:"error"})]}),f.jsx("button",{className:"panel-btn green small",onClick:b,children:"Add"})]})]}),f.jsx("div",{className:"rules-save-row",children:f.jsx("button",{className:"panel-btn cyan",onClick:u,disabled:c,children:c?"Saving...":"Save & Re-audit"})})]})]})]})]})}const xj=M.memo(yj);function Lt(e,t){fetch("/api/ui-event",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({event:e,detail:t})}).catch(()=>{})}function vj(e){return e>=75?"var(--accent-green)":e>=50?"var(--accent-amber)":"var(--accent-red)"}function wj({visible:e,onClose:t,onHighlightNode:r}){var Q;const[s,o]=M.useState(null),[a,u]=M.useState(!1),[c,h]=M.useState(!1),[p,m]=M.useState([]),[g,x]=M.useState(!1),[w,k]=M.useState("issues"),[E,C]=M.useState({issues:{rules:!1,structural:!1},metrics:{metrics:!1,components:!1}}),S=(U,q)=>{C(L=>({...L,[U]:{...L[U],[q]:!L[U][q]}}))},b=M.useCallback(async()=>{var U;Lt("audit-run"),u(!0);try{const q=await fetch("/api/audit");if(q.ok){const L=await q.json();o(L),(U=L.rules)!=null&&U.custom&&m(L.rules.custom)}}catch{}u(!1)},[]);M.useEffect(()=>{e&&b()},[e,b]);const N=async()=>{x(!0);try{await fetch("/api/rules",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({custom:p})}),await b()}catch{}x(!1)},I=U=>{m(p.filter((q,L)=>L!==U))};if(!e)return null;const B=(s==null?void 0:s.issues.filter(U=>U.type==="rule-violation"))||[],T=(s==null?void 0:s.issues.filter(U=>U.type==="structural"))||[],$=s?[...s.nodes].sort((U,q)=>U.modularityIndex-q.modularityIndex):[];return f.jsxs(yi,{className:"audit-panel",children:[f.jsxs("div",{className:"audit-header","data-drag-handle":!0,children:[f.jsx("span",{className:"audit-title",children:"Architecture Audit"}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("button",{className:"panel-btn cyan small",onClick:b,disabled:a,children:a?"...":"Re-audit"}),f.jsx("button",{className:`panel-btn small ${c?"cyan":""}`,onClick:()=>h(!c),children:"Config"}),f.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]})]}),f.jsxs("div",{className:"audit-tabs",children:[f.jsx("button",{className:`audit-tab ${w==="issues"?"active":""}`,onClick:()=>k("issues"),children:"Issues"}),f.jsx("button",{className:`audit-tab ${w==="metrics"?"active":""}`,onClick:()=>k("metrics"),children:"Metrics"})]}),a&&!s?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:12},children:"Auditing..."}):s?f.jsxs(f.Fragment,{children:[w==="issues"&&f.jsxs(f.Fragment,{children:[B.length>0&&f.jsxs("div",{className:"audit-section",children:[f.jsxs("div",{className:"audit-section-header",onClick:()=>S("issues","rules"),children:[f.jsx("span",{className:"audit-section-toggle",children:E.issues.rules?"▼":"▶"}),f.jsxs("span",{className:"audit-section-title",children:["Rule Violations (",B.length,")"]})]}),E.issues.rules&&f.jsx("div",{className:"audit-section-content",children:B.map((U,q)=>f.jsxs("div",{className:`audit-issue ${U.level}`,onClick:()=>{U.nodeIds&&U.nodeIds.length>0&&r(U.nodeIds[0])},children:[f.jsxs("div",{className:"audit-issue-rule",children:[U.rule,U.ruleType==="custom"&&f.jsx("span",{className:"rule-type-badge custom",children:"custom"})]}),f.jsx("div",{className:"audit-issue-message",children:U.message})]},q))})]}),T.length>0&&f.jsxs("div",{className:"audit-section",children:[f.jsxs("div",{className:"audit-section-header",onClick:()=>S("issues","structural"),children:[f.jsx("span",{className:"audit-section-toggle",children:E.issues.structural?"▼":"▶"}),f.jsxs("span",{className:"audit-section-title",children:["Structural Issues (",T.length,")"]})]}),E.issues.structural&&f.jsx("div",{className:"audit-section-content",children:T.map((U,q)=>f.jsxs("div",{className:`audit-issue ${U.level}`,onClick:()=>{U.nodeIds&&U.nodeIds.length>0&&r(U.nodeIds[0])},children:[f.jsx("div",{className:"audit-issue-rule",children:U.metric}),f.jsx("div",{className:"audit-issue-message",children:U.message})]},q))})]})]}),w==="metrics"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"audit-section",children:[f.jsxs("div",{className:"audit-section-header",onClick:()=>S("metrics","metrics"),children:[f.jsx("span",{className:"audit-section-toggle",children:E.metrics.metrics?"▼":"▶"}),f.jsx("span",{className:"audit-section-title",children:"Architecture Metrics"})]}),E.metrics.metrics&&f.jsx("div",{className:"audit-section-content",children:f.jsxs("div",{className:"audit-metrics",children:[f.jsxs("div",{className:"audit-metric-row",children:[f.jsx("span",{className:"audit-metric-label",children:"Circular Dependencies"}),f.jsx("span",{style:{color:s.metrics.circularDependencies>0?"var(--accent-red)":"var(--accent-green)"},children:s.metrics.circularDependencies})]}),f.jsxs("div",{className:"audit-metric-row",children:[f.jsx("span",{className:"audit-metric-label",children:"High-Degree Hubs"}),f.jsx("span",{style:{color:s.metrics.highDegreeHubCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.highDegreeHubCount})]}),f.jsxs("div",{className:"audit-metric-row",children:[f.jsx("span",{className:"audit-metric-label",children:"Disconnected"}),f.jsx("span",{style:{color:s.metrics.disconnectedComponentCount>0?"var(--accent-amber)":"var(--accent-green)"},children:s.metrics.disconnectedComponentCount})]})]})})]}),f.jsxs("div",{className:"audit-section",children:[f.jsxs("div",{className:"audit-section-header",onClick:()=>S("metrics","components"),children:[f.jsx("span",{className:"audit-section-toggle",children:E.metrics.components?"▼":"▶"}),f.jsxs("span",{className:"audit-section-title",children:["Component Health (",s.nodes.length,")"]})]}),E.metrics.components&&f.jsx("div",{className:"audit-section-content",children:$.map(U=>f.jsxs("div",{className:"audit-component-item",onClick:()=>r(U.id),children:[f.jsx("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:vj(U.modularityIndex),flexShrink:0},title:`Health: ${U.modularityIndex}/100`}),f.jsxs("div",{className:"audit-component-info",children:[f.jsx("div",{className:"audit-component-name",children:U.label}),f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)"},children:[U.inDegree,"↓ ",U.outDegree,"↑"]})]})]},U.id))})]})]}),f.jsx(xj,{visible:c,onClose:()=>h(!1),builtinRules:((Q=s.rules)==null?void 0:Q.builtin)||[],customRules:p,onAddRule:U=>{m([...p,U])},onDeleteRule:U=>I(U),onSave:N,saving:g})]}):null]})}const Sj=M.memo(wj);function kj({visible:e}){const[t,r]=M.useState([]),[s,o]=M.useState(null),[a,u]=M.useState(null),[c,h]=M.useState(!0),[p,m]=M.useState(null),[g,x]=M.useState(null),w=M.useRef(null),k=M.useCallback(async()=>{try{const b=await fetch("/api/workflow/list");b.ok&&r(await b.json())}catch{}h(!1)},[]),E=M.useCallback(async b=>{try{const N=await fetch(`/api/workflow/status/${b}`);if(N.ok){const I=await N.json();u(I),I&&p===b&&(I.status==="completed"||I.status==="failed")&&(m(null),k())}}catch{}},[p,k]);M.useEffect(()=>{if(e){k();const b=setInterval(k,p?3e3:1e4);return()=>clearInterval(b)}},[e,k,p]),M.useEffect(()=>(w.current&&clearInterval(w.current),s&&(E(s),w.current=setInterval(()=>E(s),p?3e3:1e4)),()=>{w.current&&clearInterval(w.current)}),[s,E,p]);const C=async b=>{Lt("workflow-run",b),x(null);try{const N=await fetch(`/api/workflow/run/${b}`,{method:"POST"});if(N.ok)m(b);else{const I=await N.json();x(I.error||"Failed to start workflow")}}catch{x("Failed to connect to server")}},S=async b=>{x(null);try{(await fetch("/api/workflow/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:b})})).ok&&(u(null),k())}catch{}};return e?c?f.jsx("div",{className:"ops-section",children:f.jsx("div",{className:"ops-empty",children:"Loading..."})}):t.length===0?f.jsx("div",{className:"ops-section",children:f.jsxs("div",{className:"ops-empty",children:["No workflows available.",f.jsx("span",{className:"ops-hint",children:"Run: archbyte workflow --list"})]})}):f.jsxs("div",{className:"ops-section",children:[g&&f.jsx("div",{className:"wf-error",children:g}),t.map(b=>{const N=s===b.id,I=p===b.id;return f.jsxs("div",{className:"wf-item",children:[f.jsxs("div",{className:"wf-header",onClick:()=>o(N?null:b.id),children:[f.jsxs("div",{className:"wf-header-left",children:[f.jsx("span",{className:"wf-expand",children:N?"−":"+"}),f.jsx("span",{className:"wf-name",children:b.name}),b.builtin&&f.jsx("span",{className:"wf-tag",children:"built-in"})]}),(I||b.status)&&f.jsx("span",{className:`wf-status ${I?"running":b.status}`,children:I?"running":b.status==="completed"?"done":b.status})]}),N&&f.jsxs("div",{className:"wf-detail",children:[f.jsx("div",{className:"wf-desc",children:b.description}),a&&a.workflowId===b.id?f.jsxs("div",{className:"wf-steps",children:[Object.entries(a.steps).map(([B,T])=>f.jsxs("div",{className:`wf-step ${T.status}`,children:[f.jsx("span",{className:"wf-step-icon",children:T.status==="completed"?"✓":T.status==="running"?"▶":T.status==="failed"?"✗":"○"}),f.jsx("span",{className:"wf-step-id",children:B})]},B)),(()=>{const B=Object.keys(a.steps).length,T=Object.values(a.steps).filter(Q=>Q.status==="completed").length,$=B>0?Math.round(T/B*100):0;return f.jsxs("div",{className:"wf-progress",children:[f.jsx("div",{className:"wf-progress-bar",children:f.jsx("div",{className:"wf-progress-fill",style:{width:`${$}%`}})}),f.jsxs("span",{className:"wf-progress-label",children:[$,"%"]})]})})()]}):f.jsx("div",{className:"wf-steps-preview",children:b.steps.length>0?b.steps.join(" → "):"No state yet"}),f.jsxs("div",{className:"wf-actions",children:[f.jsx("button",{className:"panel-btn cyan",disabled:I,onClick:()=>C(b.id),children:I?"Running...":"Run"}),(b.status==="completed"||b.status==="failed")&&!I&&f.jsx("button",{className:"panel-btn amber",onClick:()=>S(b.id),children:"Reset"})]})]})]},b.id)})]}):null}const Nj=M.memo(kj);function Ej({projectInfo:e}){const[t,r]=M.useState(!1),s=M.useRef(null);return M.useEffect(()=>{if(!t)return;const o=a=>{s.current&&!s.current.contains(a.target)&&r(!1)};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[t]),e?f.jsxs("div",{className:"project-info-wrapper",ref:s,children:[f.jsx("button",{className:"project-info-trigger",onClick:()=>r(!t),children:e.name}),t&&f.jsxs("div",{className:"project-info-popup",children:[f.jsxs("div",{className:"project-info-header",children:[f.jsx("span",{className:"project-info-name",children:e.name}),e.primaryLanguage&&f.jsx("span",{className:"project-info-lang",children:e.primaryLanguage})]}),e.description&&f.jsx("p",{className:"project-info-desc",children:e.description}),e.isMonorepo&&f.jsx("div",{className:"project-info-badge",children:"Monorepo"}),e.workspacePath&&f.jsxs("a",{className:"project-info-vscode",href:`vscode://file${e.workspacePath}`,title:"Open folder in VS Code",children:[f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:f.jsx("path",{d:"M17.583 2.214L12.52 6.768 7.84 3.96 2.4 5.88v12.24l5.44 1.92 4.68-2.808 5.063 4.554L21.6 19.8V4.2l-4.017-1.986zM7.84 15.12V8.88l4.68 3.12-4.68 3.12zm9.743 2.544l-3.96-3.564 3.96-3.564v7.128z"})}),"Open in VS Code"]})]})]}):null}const Cj={architecture:Yx},bj=1500;function jj({flow:e,architecture:t,onClose:r}){var w;const[s,o]=M.useState(0),[a,u]=M.useState(new Set([(w=e.steps[0])==null?void 0:w.edge])),[c,h]=M.useState(!0),{flowNodeIds:p,flowEdges:m}=M.useMemo(()=>{const k=new Set(e.steps.map(S=>S.edge)),E=t.edges.filter(S=>k.has(S.id)),C=new Set;return E.forEach(S=>{C.add(S.source),C.add(S.target)}),{flowNodeIds:C,flowEdges:E}},[e,t]),g=M.useMemo(()=>{const k=t.nodes.filter(q=>p.has(q.id)),E=320,C=140,S=80,b=80,N=new Map,I=new Map;p.forEach(q=>{N.set(q,0),I.set(q,[])}),m.forEach(q=>{p.has(q.source)&&p.has(q.target)&&(I.get(q.source).push(q.target),N.set(q.target,(N.get(q.target)||0)+1))});const B=new Map,T=[];for(N.forEach((q,L)=>{q===0&&(T.push(L),B.set(L,0))});T.length>0;){const q=T.shift(),L=B.get(q);for(const W of I.get(q)||[]){const J=L+1;(!B.has(W)||B.get(W)<J)&&B.set(W,J),N.set(W,N.get(W)-1),N.get(W)===0&&T.push(W)}}k.forEach(q=>{B.has(q.id)||B.set(q.id,0)});const $=new Map;k.forEach(q=>{const L=B.get(q.id);$.has(L)||$.set(L,[]),$.get(L).push(q)});const Q=[...$.keys()].sort((q,L)=>q-L),U=new Map;return Q.forEach((q,L)=>{$.get(q).forEach((J,P)=>{U.set(J.id,{x:S+L*E,y:b+P*C})})}),k.map(q=>{const L=U.get(q.id)||{x:S,y:b};return{id:q.id,type:"architecture",position:L,data:{label:q.label,layer:q.layer,nodeType:q.type,width:q.width,height:q.height,path:q.path,techStack:q.techStack,description:q.description},style:{width:q.width,zIndex:1}}})},[t,p,m]);M.useEffect(()=>{if(!c)return;const k=setInterval(()=>{o(E=>{const C=E+1;if(C>=e.steps.length)return u(new Set([e.steps[0].edge])),0;const S=new Set;for(let b=0;b<=C;b++)S.add(e.steps[b].edge);return u(S),C})},bj);return()=>clearInterval(k)},[c,e]);const x=M.useMemo(()=>{const k=new Map;return e.steps.forEach((E,C)=>{k.has(E.edge)||k.set(E.edge,C+1)}),m.map(E=>{const C=a.has(E.id),S=k.get(E.id);return{id:E.id,source:E.source,target:E.target,label:C&&S?`${S}`:void 0,labelStyle:C&&S?{fill:"#fff",fontWeight:700,fontSize:13,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:C&&S?{fill:e.color,fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:C?e.color:E.color||"var(--border-color)",strokeWidth:C?5:2,opacity:C?1:.3,filter:C?"brightness(0.85) saturate(1.4)":void 0},animated:C,type:"smoothstep"}})},[m,a,e]);return f.jsx("div",{className:"flow-hud-overlay",children:f.jsxs(yi,{className:"flow-hud-panel",children:[f.jsxs("div",{className:"flow-hud-header","data-drag-handle":!0,children:[f.jsxs("div",{className:"flow-hud-title",children:[f.jsx("span",{className:"flow-hud-dot",style:{background:e.color}}),f.jsx("span",{children:e.name})]}),f.jsxs("div",{className:"flow-hud-controls",children:[c?f.jsx("button",{className:"flow-hud-btn",onClick:()=>h(!1),title:"Pause",children:"⏸"}):f.jsx("button",{className:"flow-hud-btn",onClick:()=>h(!0),title:"Play",children:"▶"}),f.jsx("button",{className:"flow-hud-close",onClick:r,title:"Close",children:"✕"})]})]}),f.jsx("div",{className:"flow-hud-description",children:e.description}),f.jsx("div",{className:"flow-hud-canvas",children:f.jsxs(Tx,{nodes:g,edges:x,nodeTypes:Cj,fitView:!0,fitViewOptions:{padding:.3},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,panOnDrag:!0,zoomOnScroll:!0,minZoom:.3,maxZoom:2,proOptions:{hideAttribution:!0},children:[f.jsx(Ax,{variant:mr.Dots,gap:20,size:1,color:"var(--grid-color)"}),f.jsx(Rx,{showInteractive:!1})]})}),f.jsx("div",{className:"flow-hud-steps",children:e.steps.map((k,E)=>f.jsxs("div",{className:`flow-hud-step ${E<=s?"active":""} ${E===s?"current":""}`,style:{borderColor:E<=s?e.color:void 0},children:[f.jsx("span",{className:"flow-hud-step-num",style:{background:E<=s?e.color:void 0},children:E+1}),k.label]},E))})]})})}function _j(e){return f.jsx(Ix,{children:f.jsx(jj,{...e})})}const Ij=M.memo(_j),Tj=[{key:"anthropic",name:"Anthropic",icon:"A",models:"Claude 3.5 Sonnet, Claude 3 Opus",description:"Advanced reasoning and code analysis",requiresKey:!0},{key:"openai",name:"OpenAI",icon:"O",models:"GPT-4o, GPT-4 Turbo",description:"Versatile general-purpose models",requiresKey:!0},{key:"google",name:"Google",icon:"G",models:"Gemini 1.5 Pro, Gemini 1.5 Flash",description:"Fast multimodal analysis",requiresKey:!0}];function Pj({onComplete:e}){const[t,r]=M.useState(1),[s,o]=M.useState(null),[a,u]=M.useState(""),[c,h]=M.useState(!1),[p,m]=M.useState(null),g=E=>{o(E),u(""),m(null),E.requiresKey?r(2):r(3)},x=()=>{if(!a.trim()){m("API key is required");return}m(null),r(3)},w=async()=>{if(s){h(!0),m(null);try{const E={provider:s.key};s.requiresKey&&a.trim()&&(E.apiKey=a.trim());const C=await fetch("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(E)});if(!C.ok){const S=await C.json();throw new Error(S.error||"Failed to save configuration")}e()}catch(E){m(E instanceof Error?E.message:"Failed to save configuration"),h(!1)}}},k=()=>{m(null),t===3&&(s!=null&&s.requiresKey)?r(2):t===3&&!(s!=null&&s.requiresKey)?r(1):(r(1),o(null),u(""))};return f.jsx("div",{style:Le.overlay,onClick:E=>E.stopPropagation(),children:f.jsxs("div",{style:Le.modal,children:[f.jsxs("div",{style:Le.header,children:[f.jsx("div",{style:Le.headerIcon,children:"⚙"}),f.jsx("h2",{style:Le.title,children:"Set Up Your AI Provider"}),f.jsx("p",{style:Le.subtitle,children:"ArchByte uses AI to analyze your codebase and generate architecture diagrams. Choose a provider to get started."})]}),f.jsx("div",{style:Le.stepIndicator,children:[1,2,3].map(E=>f.jsxs("div",{style:Le.stepRow,children:[f.jsx("div",{style:{...Le.stepDot,background:E<=t?"#7c3aed":"#3a3a4a",color:E<=t?"#fff":"#888"},children:E}),f.jsx("span",{style:{...Le.stepLabel,color:E<=t?"#ccc":"#666"},children:E===1?"Provider":E===2?"API Key":"Confirm"}),E<3&&f.jsx("div",{style:{...Le.stepLine,background:E<t?"#7c3aed":"#3a3a4a"}})]},E))}),t===1&&f.jsx("div",{style:Le.stepContent,children:f.jsx("div",{style:Le.providerGrid,children:Tj.map(E=>f.jsxs("button",{style:{...Le.providerCard,borderColor:(s==null?void 0:s.key)===E.key?"#7c3aed":"#5a5a7a"},onClick:()=>g(E),onMouseEnter:C=>{C.currentTarget.style.borderColor="#7c3aed",C.currentTarget.style.background="#2a2a3e"},onMouseLeave:C=>{(s==null?void 0:s.key)!==E.key&&(C.currentTarget.style.borderColor="#5a5a7a"),C.currentTarget.style.background="#252536"},children:[f.jsx("div",{style:Le.providerIcon,children:E.icon}),f.jsx("div",{style:Le.providerName,children:E.name}),f.jsx("div",{style:Le.providerModels,children:E.models}),f.jsx("div",{style:Le.providerDesc,children:E.description}),!E.requiresKey&&f.jsx("div",{style:Le.noKeyBadge,children:"No API key needed"})]},E.key))})}),t===2&&s&&f.jsx("div",{style:Le.stepContent,children:f.jsxs("div",{style:Le.keySection,children:[f.jsxs("div",{style:Le.selectedProviderBadge,children:[f.jsx("span",{style:Le.providerIconSmall,children:s.icon}),f.jsx("span",{children:s.name})]}),f.jsx("label",{style:Le.label,children:"API Key"}),f.jsx("input",{type:"password",value:a,onChange:E=>{u(E.target.value),m(null)},placeholder:`Enter your ${s.name} API key`,style:Le.input,autoFocus:!0,onKeyDown:E=>{E.key==="Enter"&&x()}}),f.jsxs("p",{style:Le.keyHint,children:["Your key is stored locally in ",f.jsx("code",{style:Le.code,children:".archbyte/config.json"})," and never sent to external servers."]}),p&&f.jsx("div",{style:Le.error,children:p}),f.jsxs("div",{style:Le.buttonRow,children:[f.jsx("button",{style:Le.backBtn,onClick:k,children:"Back"}),f.jsx("button",{style:{...Le.primaryBtn,opacity:a.trim()?1:.5,cursor:a.trim()?"pointer":"not-allowed"},onClick:x,disabled:!a.trim(),children:"Continue"})]})]})}),t===3&&s&&f.jsx("div",{style:Le.stepContent,children:f.jsxs("div",{style:Le.confirmSection,children:[f.jsx("div",{style:Le.confirmIcon,children:"✓"}),f.jsx("h3",{style:Le.confirmTitle,children:"Ready to Analyze"}),f.jsxs("div",{style:Le.confirmDetails,children:[f.jsxs("div",{style:Le.confirmRow,children:[f.jsx("span",{style:Le.confirmLabel,children:"Provider"}),f.jsxs("span",{style:Le.confirmValue,children:[f.jsx("span",{style:Le.providerIconSmall,children:s.icon}),s.name]})]}),f.jsxs("div",{style:Le.confirmRow,children:[f.jsx("span",{style:Le.confirmLabel,children:"Models"}),f.jsx("span",{style:Le.confirmValue,children:s.models})]}),s.requiresKey&&f.jsxs("div",{style:Le.confirmRow,children:[f.jsx("span",{style:Le.confirmLabel,children:"API Key"}),f.jsxs("span",{style:Le.confirmValue,children:["*".repeat(Math.min(a.length,8)),"...",a.slice(-4)]})]})]}),p&&f.jsx("div",{style:Le.error,children:p}),f.jsxs("div",{style:Le.buttonRow,children:[f.jsx("button",{style:Le.backBtn,onClick:k,children:"Back"}),f.jsx("button",{style:{...Le.runBtn,opacity:c?.6:1,cursor:c?"wait":"pointer"},onClick:w,disabled:c,children:c?"Saving...":"Run First Analysis"})]})]})})]})})}const Le={overlay:{position:"fixed",inset:0,background:"rgba(0, 0, 0, 0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,backdropFilter:"blur(4px)"},modal:{background:"#1e1e2e",border:"1px solid #5a5a7a",borderRadius:16,padding:"36px 40px",maxWidth:600,width:"90vw",maxHeight:"90vh",overflowY:"auto"},header:{textAlign:"center",marginBottom:24},headerIcon:{fontSize:36,marginBottom:8,color:"#7c3aed"},title:{color:"#fff",margin:"0 0 8px",fontSize:22,fontWeight:700},subtitle:{color:"#999",margin:0,fontSize:14,lineHeight:1.5},stepIndicator:{display:"flex",alignItems:"center",justifyContent:"center",gap:0,marginBottom:28},stepRow:{display:"flex",alignItems:"center",gap:6},stepDot:{width:26,height:26,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:700,flexShrink:0},stepLabel:{fontSize:12,fontWeight:500},stepLine:{width:40,height:2,marginLeft:6,marginRight:6,borderRadius:1},stepContent:{minHeight:200},providerGrid:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:14},providerCard:{background:"#252536",border:"1px solid #5a5a7a",borderRadius:12,padding:"20px 16px",cursor:"pointer",textAlign:"left",transition:"border-color 0.15s, background 0.15s",display:"flex",flexDirection:"column",gap:6},providerIcon:{width:40,height:40,borderRadius:10,background:"#3a3a5a",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,fontWeight:800,color:"#7c3aed",marginBottom:4},providerName:{color:"#fff",fontSize:16,fontWeight:600},providerModels:{color:"#aaa",fontSize:12,lineHeight:1.4},providerDesc:{color:"#777",fontSize:11,lineHeight:1.4},noKeyBadge:{marginTop:4,fontSize:10,color:"#4ade80",fontWeight:600,textTransform:"uppercase",letterSpacing:.5},keySection:{display:"flex",flexDirection:"column",gap:14},selectedProviderBadge:{display:"inline-flex",alignItems:"center",gap:8,background:"#2a2a3e",border:"1px solid #5a5a7a",borderRadius:8,padding:"8px 14px",color:"#ccc",fontSize:14,fontWeight:500,alignSelf:"flex-start"},providerIconSmall:{width:22,height:22,borderRadius:6,background:"#3a3a5a",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:12,fontWeight:800,color:"#7c3aed"},label:{color:"#ccc",fontSize:13,fontWeight:600},input:{width:"100%",padding:"12px 14px",background:"#161622",border:"1px solid #5a5a7a",borderRadius:8,color:"#fff",fontSize:14,outline:"none",fontFamily:"'JetBrains Mono', monospace",boxSizing:"border-box"},keyHint:{color:"#777",fontSize:12,margin:0,lineHeight:1.4},code:{background:"#2a2a3e",padding:"2px 6px",borderRadius:4,fontSize:11,color:"#aaa"},error:{color:"#f87171",fontSize:13,padding:"8px 12px",background:"rgba(248, 113, 113, 0.1)",border:"1px solid rgba(248, 113, 113, 0.3)",borderRadius:8},buttonRow:{display:"flex",justifyContent:"flex-end",gap:10,marginTop:8},backBtn:{padding:"10px 20px",background:"transparent",border:"1px solid #5a5a7a",borderRadius:8,color:"#aaa",fontSize:14,cursor:"pointer",fontWeight:500},primaryBtn:{padding:"10px 24px",background:"#7c3aed",border:"none",borderRadius:8,color:"#fff",fontSize:14,cursor:"pointer",fontWeight:600},confirmSection:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:12},confirmIcon:{width:52,height:52,borderRadius:"50%",background:"rgba(124, 58, 237, 0.15)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:26,color:"#7c3aed"},confirmTitle:{color:"#fff",fontSize:18,fontWeight:600,margin:0},confirmDetails:{width:"100%",maxWidth:360,background:"#252536",border:"1px solid #5a5a7a",borderRadius:10,padding:"14px 18px",display:"flex",flexDirection:"column",gap:10,textAlign:"left"},confirmRow:{display:"flex",justifyContent:"space-between",alignItems:"center"},confirmLabel:{color:"#888",fontSize:13},confirmValue:{color:"#ddd",fontSize:13,fontWeight:500,display:"inline-flex",alignItems:"center",gap:6},runBtn:{padding:"12px 28px",background:"linear-gradient(135deg, #7c3aed, #6d28d9)",border:"none",borderRadius:8,color:"#fff",fontSize:15,cursor:"pointer",fontWeight:700,letterSpacing:.3}},Aj={"security-audit":{label:"Security Audit",icon:"⚠",color:"var(--accent-red)"},compliance:{label:"Compliance",icon:"☑",color:"var(--accent-cyan)"},performance:{label:"Performance",icon:"⚡",color:"var(--accent-amber)"},"dependency-risk":{label:"Dependency Risk",icon:"⬢",color:"#c084fc"},migration:{label:"Migration Plan",icon:"→",color:"var(--accent-green)"},"api-contracts":{label:"API Contracts",icon:"↔",color:"#60a5fa"},"drift-detection":{label:"Drift Detection",icon:"◎",color:"#f472b6"}},xi={critical:0,high:1,medium:2,low:3};function ul({severity:e}){const t={critical:"var(--accent-red)",high:"hsl(25 95% 53%)",medium:"var(--accent-amber)",low:"var(--accent-green)"},r={critical:"hsl(0 90% 55% / 0.15)",high:"hsl(25 95% 53% / 0.15)",medium:"hsl(38 92% 50% / 0.15)",low:"hsl(142 76% 42% / 0.15)"},s={critical:"hsl(0 90% 55% / 0.3)",high:"hsl(25 95% 53% / 0.3)",medium:"hsl(38 92% 50% / 0.3)",low:"hsl(142 76% 42% / 0.3)"};return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:t[e],background:r[e],border:`1px solid ${s[e]}`,whiteSpace:"nowrap"},children:e})}function Mj({value:e}){const t=Math.round(e*100);return f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[f.jsx("div",{style:{flex:1,height:3,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:`${t}%`,height:"100%",borderRadius:2,background:t>=80?"var(--accent-green)":t>=50?"var(--accent-amber)":"var(--accent-red)"}})}),f.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600,minWidth:28},children:[t,"%"]})]})}function Rj({status:e}){const r={compliant:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},partial:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},"non-compliant":{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"}}[e];return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r.color,background:r.bg,border:`1px solid ${r.border}`},children:e})}function zj({status:e}){const r={completed:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},"in-progress":{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"},pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",border:"var(--border-color)"}}[e];return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r.color,background:r.bg,border:`1px solid ${r.border}`},children:e})}function Lj({driftType:e}){const r={added:{color:"var(--accent-green)",bg:"hsl(142 76% 42% / 0.15)",border:"hsl(142 76% 42% / 0.3)"},removed:{color:"var(--accent-red)",bg:"hsl(0 90% 55% / 0.15)",border:"hsl(0 90% 55% / 0.3)"},modified:{color:"var(--accent-amber)",bg:"hsl(38 92% 50% / 0.15)",border:"hsl(38 92% 50% / 0.3)"}}[e];return f.jsx("span",{style:{fontSize:9,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.5px",padding:"1px 6px",borderRadius:3,color:r.color,background:r.bg,border:`1px solid ${r.border}`},children:e})}function Dj({data:e}){const t=[...e.findings].sort((r,s)=>xi[r.severity]-xi[s.severity]);return t.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No findings"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:r.owaspId}),f.jsx(ul,{severity:r.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:r.title}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),r.affectedComponent&&f.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Component: ",r.affectedComponent]})]},s))})}function Fj({data:e}){return e.statuses.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No compliance data"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:e.statuses.map((t,r)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:6},children:[f.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:t.framework}),f.jsx(Rj,{status:t.status})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[f.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:t.controls>0?`${Math.round(t.passing/t.controls*100)}%`:"0%",height:"100%",borderRadius:2,background:t.status==="compliant"?"var(--accent-green)":t.status==="partial"?"var(--accent-amber)":"var(--accent-red)",transition:"width 0.3s"}})}),f.jsxs("span",{style:{fontSize:10,color:"var(--text-muted)",fontWeight:500,minWidth:40,textAlign:"right"},children:[t.passing,"/",t.controls]})]}),t.findings.length>0&&f.jsx("div",{style:{marginTop:4},children:t.findings.map((s,o)=>f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"2px 0",lineHeight:1.4},children:["- ",s]},o))})]},r))})}function Oj({data:e}){const t=[...e.bottlenecks].sort((r,s)=>xi[r.severity]-xi[s.severity]);return t.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No bottlenecks detected"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:r.component}),f.jsx(ul,{severity:r.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:r.metric}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),r.recommendation&&f.jsx("div",{style:{fontSize:10,color:"var(--accent-cyan)",marginTop:4,fontStyle:"italic"},children:r.recommendation})]},s))})}function $j({data:e}){const t=[...e.risks].sort((r,s)=>s.riskScore-r.riskScore);return t.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No risks identified"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsxs("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)",fontFamily:"'JetBrains Mono', monospace"},children:[r.package,f.jsxs("span",{style:{fontSize:9,color:"var(--text-muted)",marginLeft:4},children:["@",r.version]})]}),f.jsx(ul,{severity:r.severity})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[f.jsx("span",{style:{fontSize:9,color:"var(--text-muted)",fontWeight:600},children:"Risk"}),f.jsx("div",{style:{flex:1,height:4,borderRadius:2,background:"var(--bg-hover)"},children:f.jsx("div",{style:{width:`${r.riskScore}%`,height:"100%",borderRadius:2,background:r.riskScore>=75?"var(--accent-red)":r.riskScore>=50?"var(--accent-amber)":"var(--accent-green)",transition:"width 0.3s"}})}),f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",minWidth:28},children:r.riskScore})]}),r.reasons.length>0&&f.jsx("div",{style:{marginTop:2},children:r.reasons.map((o,a)=>f.jsxs("div",{style:{fontSize:10,color:"var(--text-secondary)",padding:"1px 0",lineHeight:1.4},children:["- ",o]},a))})]},s))})}function Bj({data:e}){const t=[...e.steps].sort((r,s)=>r.order-s.order);return t.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No migration plan"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.status==="completed"?"var(--accent-green)":r.status==="in-progress"?"var(--accent-amber)":"var(--border-color)"}`,opacity:r.status==="completed"?.7:1},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsxs("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)"},children:["Step ",r.order]}),f.jsx(zj,{status:r.status})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:2},children:r.title}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),r.estimatedEffort&&f.jsxs("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:["Effort: ",r.estimatedEffort]})]},s))})}function Hj({data:e}){const t=[...e.mismatches].sort((r,s)=>xi[r.severity]-xi[s.severity]);return t.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No mismatches found"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--accent-cyan)",fontFamily:"'JetBrains Mono', monospace"},children:r.endpoint}),f.jsx(ul,{severity:r.severity})]}),f.jsx("div",{style:{fontSize:11,color:"var(--text-primary)",fontWeight:500,marginBottom:4},children:r.field}),f.jsxs("div",{style:{display:"flex",gap:8,fontSize:10},children:[f.jsxs("div",{style:{flex:1},children:[f.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Spec"}),f.jsx("div",{style:{color:"var(--accent-green)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(142 76% 42% / 0.08)",borderRadius:3},children:r.specValue})]}),f.jsxs("div",{style:{flex:1},children:[f.jsx("div",{style:{color:"var(--text-muted)",fontSize:9,marginBottom:2},children:"Impl"}),f.jsx("div",{style:{color:"var(--accent-red)",fontFamily:"'JetBrains Mono', monospace",fontSize:10,padding:"3px 6px",background:"hsl(0 90% 55% / 0.08)",borderRadius:3},children:r.implValue})]})]})]},s))})}function Vj({data:e}){const t=[...e.detections].sort((r,s)=>xi[r.severity]-xi[s.severity]);return t.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,padding:"8px 0"},children:"No drift detected"}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((r,s)=>f.jsxs("div",{style:{padding:"8px 10px",background:"var(--bg-tertiary)",borderRadius:6,borderLeft:`3px solid ${r.severity==="critical"?"var(--accent-red)":r.severity==="high"?"hsl(25 95% 53%)":r.severity==="medium"?"var(--accent-amber)":"var(--accent-green)"}`},children:[f.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace"},children:r.component}),f.jsxs("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[f.jsx(Lj,{driftType:r.driftType}),f.jsx(ul,{severity:r.severity})]})]}),f.jsx("div",{style:{fontSize:10,color:"var(--text-secondary)",lineHeight:1.4},children:r.description}),f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:4,fontFamily:"'JetBrains Mono', monospace"},children:new Date(r.detectedAt).toLocaleString()})]},s))})}function Uj({visible:e,onClose:t,results:r}){const[s,o]=M.useState(new Set),[a,u]=M.useState(!1),[c,h]=M.useState([]),p=M.useCallback(C=>{o(S=>{const b=new Set(S);return b.has(C)?b.delete(C):b.add(C),b})},[]),m=M.useCallback(async()=>{u(!0);try{const C=await fetch("/api/premium-agents/results");if(C.ok){const S=await C.json();Array.isArray(S)&&h(S)}}catch{}u(!1)},[]);M.useEffect(()=>{e&&m()},[e,m]);const g=r.length>0?r:c,x=new Map;g.forEach(C=>{x.set(C.agentId,C)});const w=["security-audit","compliance","performance","dependency-risk","migration","api-contracts","drift-detection"];function k(C){const S=C.data;switch(S.agentId){case"security-audit":return S.findings.length;case"compliance":return S.statuses.length;case"performance":return S.bottlenecks.length;case"dependency-risk":return S.risks.length;case"migration":return S.steps.length;case"api-contracts":return S.mismatches.length;case"drift-detection":return S.detections.length}}function E(C){const S=C.data;switch(S.agentId){case"security-audit":return f.jsx(Dj,{data:S});case"compliance":return f.jsx(Fj,{data:S});case"performance":return f.jsx(Oj,{data:S});case"dependency-risk":return f.jsx($j,{data:S});case"migration":return f.jsx(Bj,{data:S});case"api-contracts":return f.jsx(Hj,{data:S});case"drift-detection":return f.jsx(Vj,{data:S})}}return e?f.jsxs(yi,{style:{position:"absolute",top:60,right:16,background:"var(--bg-secondary)",backdropFilter:"blur(12px)",borderRadius:12,border:"1px solid var(--border-color)",zIndex:10,width:320,maxHeight:"calc(100vh - 200px)",overflowY:"auto",boxShadow:"0 2px 12px var(--shadow-color)"},children:[f.jsxs("div",{"data-drag-handle":!0,style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 14px 8px",borderBottom:"1px solid var(--border-color)",cursor:"grab"},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"1px",color:"var(--text-muted)"},children:"Pro Agents"}),f.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"1px 6px",borderRadius:3,background:"#7c3aed",color:"#fff"},children:"PRO"})]}),f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[f.jsx("button",{className:"panel-btn cyan small",onClick:m,disabled:a,children:a?"...":"Refresh"}),f.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]})]}),f.jsx("div",{style:{padding:"8px 10px 12px"},children:a&&g.length===0?f.jsx("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:"Loading agent results..."}):g.length===0?f.jsxs("div",{style:{color:"var(--text-muted)",fontSize:11,textAlign:"center",padding:20},children:["No premium agent results yet.",f.jsx("span",{style:{display:"block",marginTop:6,fontSize:10,color:"var(--accent-cyan)",opacity:.7,fontFamily:"'JetBrains Mono', monospace"},children:"Run agents to see results here"})]}):f.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:w.map(C=>{const S=x.get(C);if(!S)return null;const b=Aj[C],N=s.has(C),I=k(S);return f.jsxs("div",{style:{borderRadius:8,border:"1px solid var(--border-color)",overflow:"hidden"},children:[f.jsxs("div",{onClick:()=>p(C),style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 10px",background:N?"var(--bg-tertiary)":"transparent",cursor:"pointer",transition:"background 0.15s",userSelect:"none"},onMouseEnter:B=>{N||(B.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:B=>{N||(B.currentTarget.style.background="transparent")},children:[f.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.jsx("span",{style:{fontSize:12},children:b.icon}),f.jsx("span",{style:{fontSize:11,fontWeight:600,color:"var(--text-primary)"},children:b.label}),I>0&&f.jsx("span",{style:{fontSize:9,fontWeight:600,padding:"0px 5px",borderRadius:8,background:"var(--bg-hover)",color:"var(--text-secondary)"},children:I})]}),f.jsx("div",{style:{display:"flex",alignItems:"center",gap:6},children:f.jsx("span",{style:{fontSize:10,color:"var(--text-muted)",fontFamily:"'JetBrains Mono', monospace",transition:"transform 0.2s",transform:N?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"})})]}),N&&f.jsxs("div",{style:{padding:"6px 10px 10px"},children:[f.jsxs("div",{style:{marginBottom:8},children:[f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginBottom:3,fontWeight:500},children:"Confidence"}),f.jsx(Mj,{value:S.confidence})]}),E(S),f.jsx("div",{style:{fontSize:9,color:"var(--text-muted)",marginTop:8,textAlign:"right",fontFamily:"'JetBrains Mono', monospace"},children:new Date(S.timestamp).toLocaleString()})]})]},C)})})}),g.length>0&&f.jsxs("div",{style:{padding:"8px 14px",borderTop:"1px solid var(--border-color)",fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:[g.length," of ",w.length," agents reporting"]})]}):null}const Wj=M.memo(Uj);function Yj({session:e,onSelectRun:t,selectedRunId:r}){const[s,o]=M.useState(null),[a,u]=M.useState({x:0,y:0}),{phases:c,lanes:h,sessionStart:p,sessionDuration:m,timeMarkers:g}=M.useMemo(()=>{const $=e.runs;if($.length===0)return{phases:[],lanes:[],sessionStart:0,sessionDuration:1,timeMarkers:[]};const Q=[],U=new Set;for(const F of $)U.has(F.phase)||(U.add(F.phase),Q.push(F.phase));const q=Math.min(...$.map(F=>new Date(F.startedAt).getTime())),L=Math.max(...$.map(F=>F.completedAt?new Date(F.completedAt).getTime():new Date(F.startedAt).getTime()+(F.elapsedSeconds??1)*1e3)),W=Math.max(L-q,1e3),J=Q.map(F=>({phase:F,runs:$.filter(K=>K.phase===F)})),P=[],O=W/4;for(let F=0;F<=4;F++)P.push(q+O*F);return{phases:Q,lanes:J,sessionStart:q,sessionDuration:W,timeMarkers:P}},[e]);if(e.runs.length===0)return f.jsx("div",{className:"sessions-empty",children:"No runs in this session"});const x=48,w=6,E=120+12,C=30,S=28,b=500,N=S+h.length*(x+w)+16,I=$=>E+($-p)/m*b,B=$=>$<1e3?`${$}ms`:`${($/1e3).toFixed(1)}s`,T=$=>{switch($){case"success":return"var(--accent-green, #2ecc71)";case"error":return"var(--accent-red, #e74c3c)";case"running":return"var(--accent-cyan, #00bcd4)";case"skipped":return"var(--text-muted, #666)";default:return"var(--text-muted, #666)"}};return f.jsxs("div",{className:"session-timeline",children:[f.jsxs("svg",{width:E+b+20,height:N,className:"session-timeline-svg",children:[g.map(($,Q)=>{const U=I($),q=(($-p)/1e3).toFixed(1);return f.jsxs("g",{children:[f.jsx("line",{x1:U,y1:S-4,x2:U,y2:N,stroke:"var(--border-subtle, #333)",strokeWidth:.5,strokeDasharray:"3,3"}),f.jsxs("text",{x:U,y:S-8,textAnchor:"middle",className:"session-timeline-axis-label",children:[q,"s"]})]},Q)}),h.map(($,Q)=>{const U=S+Q*(x+w);return f.jsxs("g",{children:[f.jsx("rect",{x:0,y:U,width:E+b+20,height:x,rx:6,fill:"var(--bg-elevated, rgba(255,255,255,0.03))"}),f.jsx("text",{x:8,y:U+x/2+4,className:"session-timeline-phase-label",children:$.phase}),$.runs.map(q=>{const L=new Date(q.startedAt).getTime(),W=q.completedAt?new Date(q.completedAt).getTime():L+(q.elapsedSeconds??1)*1e3,J=I(L),P=I(W),O=Math.max(P-J,6),F=U+(x-C)/2,K=q.runId===r,R=(s==null?void 0:s.runId)===q.runId;return f.jsxs("g",{className:`session-timeline-bar ${q.status}${K?" selected":""}`,onClick:()=>t(q),onMouseEnter:V=>{o(q);const j=V.target.closest("svg").getBoundingClientRect();u({x:V.clientX-j.left,y:F-8})},onMouseLeave:()=>o(null),style:{cursor:"pointer"},children:[f.jsx("rect",{x:J,y:F,width:O,height:C,rx:4,fill:T(q.status),opacity:K||R?1:.75,stroke:K?"var(--accent-cyan, #00bcd4)":"none",strokeWidth:K?2:0}),O>50&&f.jsx("text",{x:J+O/2,y:F+C/2+4,textAnchor:"middle",className:"session-timeline-bar-label",children:q.agent}),q.status==="running"&&f.jsx("rect",{x:J,y:F,width:O,height:C,rx:4,fill:"none",stroke:"var(--accent-cyan, #00bcd4)",strokeWidth:2,className:"session-timeline-pulse"})]},q.runId)})]},$.phase)})]}),s&&f.jsxs("div",{className:"session-timeline-tooltip",style:{left:a.x,top:a.y},children:[f.jsx("div",{className:"session-timeline-tooltip-title",children:s.agent}),f.jsxs("div",{className:"session-timeline-tooltip-row",children:[f.jsx("span",{children:"Model:"})," ",f.jsx("span",{children:s.model})]}),f.jsxs("div",{className:"session-timeline-tooltip-row",children:[f.jsx("span",{children:"Duration:"})," ",f.jsx("span",{children:B((s.elapsedSeconds??0)*1e3)})]}),s.tokens&&f.jsxs("div",{className:"session-timeline-tooltip-row",children:[f.jsx("span",{children:"Tokens:"})," ",f.jsx("span",{children:s.tokens.input+s.tokens.output})]}),f.jsxs("div",{className:"session-timeline-tooltip-row",children:[f.jsx("span",{children:"Status:"})," ",f.jsx("span",{className:`session-status-${s.status}`,children:s.status})]})]})]})}function Xj(e,t){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const qj=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gj=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kj={};function eg(e,t){return(Kj.jsx?Gj:qj).test(e)}const Qj=/[ \t\n\f\r]/g;function Zj(e){return typeof e=="object"?e.type==="text"?tg(e.value):!1:tg(e)}function tg(e){return e.replace(Qj,"")===""}class cl{constructor(t,r,s){this.normal=r,this.property=t,s&&(this.space=s)}}cl.prototype.normal={};cl.prototype.property={};cl.prototype.space=void 0;function Xx(e,t){const r={},s={};for(const o of e)Object.assign(r,o.property),Object.assign(s,o.normal);return new cl(r,s,t)}function Ed(e){return e.toLowerCase()}class hn{constructor(t,r){this.attribute=r,this.property=t}}hn.prototype.attribute="";hn.prototype.booleanish=!1;hn.prototype.boolean=!1;hn.prototype.commaOrSpaceSeparated=!1;hn.prototype.commaSeparated=!1;hn.prototype.defined=!1;hn.prototype.mustUseProperty=!1;hn.prototype.number=!1;hn.prototype.overloadedBoolean=!1;hn.prototype.property="";hn.prototype.spaceSeparated=!1;hn.prototype.space=void 0;let Jj=0;const He=Zi(),Et=Zi(),Cd=Zi(),ge=Zi(),rt=Zi(),$s=Zi(),En=Zi();function Zi(){return 2**++Jj}const bd=Object.freeze(Object.defineProperty({__proto__:null,boolean:He,booleanish:Et,commaOrSpaceSeparated:En,commaSeparated:$s,number:ge,overloadedBoolean:Cd,spaceSeparated:rt},Symbol.toStringTag,{value:"Module"})),Kc=Object.keys(bd);class ef extends hn{constructor(t,r,s,o){let a=-1;if(super(t,r),ng(this,"space",o),typeof s=="number")for(;++a<Kc.length;){const u=Kc[a];ng(this,Kc[a],(s&bd[u])===bd[u])}}}ef.prototype.defined=!0;function ng(e,t,r){r&&(e[t]=r)}function Xs(e){const t={},r={};for(const[s,o]of Object.entries(e.properties)){const a=new ef(s,e.transform(e.attributes||{},s),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(a.mustUseProperty=!0),t[s]=a,r[Ed(s)]=s,r[Ed(a.attribute)]=s}return new cl(t,r,e.space)}const qx=Xs({properties:{ariaActiveDescendant:null,ariaAtomic:Et,ariaAutoComplete:null,ariaBusy:Et,ariaChecked:Et,ariaColCount:ge,ariaColIndex:ge,ariaColSpan:ge,ariaControls:rt,ariaCurrent:null,ariaDescribedBy:rt,ariaDetails:null,ariaDisabled:Et,ariaDropEffect:rt,ariaErrorMessage:null,ariaExpanded:Et,ariaFlowTo:rt,ariaGrabbed:Et,ariaHasPopup:null,ariaHidden:Et,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rt,ariaLevel:ge,ariaLive:null,ariaModal:Et,ariaMultiLine:Et,ariaMultiSelectable:Et,ariaOrientation:null,ariaOwns:rt,ariaPlaceholder:null,ariaPosInSet:ge,ariaPressed:Et,ariaReadOnly:Et,ariaRelevant:null,ariaRequired:Et,ariaRoleDescription:rt,ariaRowCount:ge,ariaRowIndex:ge,ariaRowSpan:ge,ariaSelected:Et,ariaSetSize:ge,ariaSort:null,ariaValueMax:ge,ariaValueMin:ge,ariaValueNow:ge,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Gx(e,t){return t in e?e[t]:t}function Kx(e,t){return Gx(e,t.toLowerCase())}const e2=Xs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$s,acceptCharset:rt,accessKey:rt,action:null,allow:null,allowFullScreen:He,allowPaymentRequest:He,allowUserMedia:He,alt:null,as:null,async:He,autoCapitalize:null,autoComplete:rt,autoFocus:He,autoPlay:He,blocking:rt,capture:null,charSet:null,checked:He,cite:null,className:rt,cols:ge,colSpan:null,content:null,contentEditable:Et,controls:He,controlsList:rt,coords:ge|$s,crossOrigin:null,data:null,dateTime:null,decoding:null,default:He,defer:He,dir:null,dirName:null,disabled:He,download:Cd,draggable:Et,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:He,formTarget:null,headers:rt,height:ge,hidden:Cd,high:ge,href:null,hrefLang:null,htmlFor:rt,httpEquiv:rt,id:null,imageSizes:null,imageSrcSet:null,inert:He,inputMode:null,integrity:null,is:null,isMap:He,itemId:null,itemProp:rt,itemRef:rt,itemScope:He,itemType:rt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:He,low:ge,manifest:null,max:null,maxLength:ge,media:null,method:null,min:null,minLength:ge,multiple:He,muted:He,name:null,nonce:null,noModule:He,noValidate:He,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:He,optimum:ge,pattern:null,ping:rt,placeholder:null,playsInline:He,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:He,referrerPolicy:null,rel:rt,required:He,reversed:He,rows:ge,rowSpan:ge,sandbox:rt,scope:null,scoped:He,seamless:He,selected:He,shadowRootClonable:He,shadowRootDelegatesFocus:He,shadowRootMode:null,shape:null,size:ge,sizes:null,slot:null,span:ge,spellCheck:Et,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ge,step:null,style:null,tabIndex:ge,target:null,title:null,translate:null,type:null,typeMustMatch:He,useMap:null,value:Et,width:ge,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rt,axis:null,background:null,bgColor:null,border:ge,borderColor:null,bottomMargin:ge,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:He,declare:He,event:null,face:null,frame:null,frameBorder:null,hSpace:ge,leftMargin:ge,link:null,longDesc:null,lowSrc:null,marginHeight:ge,marginWidth:ge,noResize:He,noHref:He,noShade:He,noWrap:He,object:null,profile:null,prompt:null,rev:null,rightMargin:ge,rules:null,scheme:null,scrolling:Et,standby:null,summary:null,text:null,topMargin:ge,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ge,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:He,disableRemotePlayback:He,prefix:null,property:null,results:ge,security:null,unselectable:null},space:"html",transform:Kx}),t2=Xs({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",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:En,accentHeight:ge,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ge,amplitude:ge,arabicForm:null,ascent:ge,attributeName:null,attributeType:null,azimuth:ge,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ge,by:null,calcMode:null,capHeight:ge,className:rt,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:ge,diffuseConstant:ge,direction:null,display:null,dur:null,divisor:ge,dominantBaseline:null,download:He,dx:null,dy:null,edgeMode:null,editable:null,elevation:ge,enableBackground:null,end:null,event:null,exponent:ge,externalResourcesRequired:null,fill:null,fillOpacity:ge,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:$s,g2:$s,glyphName:$s,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ge,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ge,horizOriginX:ge,horizOriginY:ge,id:null,ideographic:ge,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ge,k:ge,k1:ge,k2:ge,k3:ge,k4:ge,kernelMatrix:En,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ge,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ge,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:ge,overlineThickness:ge,paintOrder:null,panose1:null,path:null,pathLength:ge,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ge,pointsAtY:ge,pointsAtZ:ge,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:En,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:En,rev:En,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:En,requiredFeatures:En,requiredFonts:En,requiredFormats:En,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:ge,specularExponent:ge,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ge,strikethroughThickness:ge,string:null,stroke:null,strokeDashArray:En,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ge,strokeOpacity:ge,strokeWidth:null,style:null,surfaceScale:ge,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:En,tabIndex:ge,tableValues:null,target:null,targetX:ge,targetY:ge,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:En,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ge,underlineThickness:ge,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ge,values:null,vAlphabetic:ge,vMathematical:ge,vectorEffect:null,vHanging:ge,vIdeographic:ge,version:null,vertAdvY:ge,vertOriginX:ge,vertOriginY:ge,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ge,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Gx}),Qx=Xs({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()}}),Zx=Xs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Kx}),Jx=Xs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),n2={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"},r2=/[A-Z]/g,rg=/-[a-z]/g,i2=/^data[-\w.:]+$/i;function s2(e,t){const r=Ed(t);let s=t,o=hn;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&i2.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(rg,l2);s="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!rg.test(a)){let u=a.replace(r2,o2);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}o=ef}return new o(s,t)}function o2(e){return"-"+e.toLowerCase()}function l2(e){return e.charAt(1).toUpperCase()}const a2=Xx([qx,e2,Qx,Zx,Jx],"html"),tf=Xx([qx,t2,Qx,Zx,Jx],"svg");function u2(e){return e.join(" ").trim()}var As={},Qc,ig;function c2(){if(ig)return Qc;ig=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,h=`
|
|
66
|
-
`,p="/",m="*",g="",x="comment",w="declaration";function k(C,S){if(typeof C!="string")throw new TypeError("First argument must be a string");if(!C)return[];S=S||{};var b=1,N=1;function I(P){var O=P.match(t);O&&(b+=O.length);var F=P.lastIndexOf(h);N=~F?P.length-F:N+P.length}function B(){var P={line:b,column:N};return function(O){return O.position=new T(P),U(),O}}function T(P){this.start=P,this.end={line:b,column:N},this.source=S.source}T.prototype.content=C;function $(P){var O=new Error(S.source+":"+b+":"+N+": "+P);if(O.reason=P,O.filename=S.source,O.line=b,O.column=N,O.source=C,!S.silent)throw O}function Q(P){var O=P.exec(C);if(O){var F=O[0];return I(F),C=C.slice(F.length),O}}function U(){Q(r)}function q(P){var O;for(P=P||[];O=L();)O!==!1&&P.push(O);return P}function L(){var P=B();if(!(p!=C.charAt(0)||m!=C.charAt(1))){for(var O=2;g!=C.charAt(O)&&(m!=C.charAt(O)||p!=C.charAt(O+1));)++O;if(O+=2,g===C.charAt(O-1))return $("End of comment missing");var F=C.slice(2,O-2);return N+=2,I(F),C=C.slice(O),N+=2,P({type:x,comment:F})}}function W(){var P=B(),O=Q(s);if(O){if(L(),!Q(o))return $("property missing ':'");var F=Q(a),K=P({type:w,property:E(O[0].replace(e,g)),value:F?E(F[0].replace(e,g)):g});return Q(u),K}}function J(){var P=[];q(P);for(var O;O=W();)O!==!1&&(P.push(O),q(P));return P}return U(),J()}function E(C){return C?C.replace(c,g):g}return Qc=k,Qc}var sg;function d2(){if(sg)return As;sg=1;var e=As&&As.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(As,"__esModule",{value:!0}),As.default=r;const t=e(c2());function r(s,o){let a=null;if(!s||typeof s!="string")return a;const u=(0,t.default)(s),c=typeof o=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:p,value:m}=h;c?o(p,m,h):m&&(a=a||{},a[p]=m)}),a}return As}var Mo={},og;function f2(){if(og)return Mo;og=1,Object.defineProperty(Mo,"__esModule",{value:!0}),Mo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,a=function(p){return!p||r.test(p)||e.test(p)},u=function(p,m){return m.toUpperCase()},c=function(p,m){return"".concat(m,"-")},h=function(p,m){return m===void 0&&(m={}),a(p)?p:(p=p.toLowerCase(),m.reactCompat?p=p.replace(o,c):p=p.replace(s,c),p.replace(t,u))};return Mo.camelCase=h,Mo}var Ro,lg;function h2(){if(lg)return Ro;lg=1;var e=Ro&&Ro.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t=e(d2()),r=f2();function s(o,a){var u={};return!o||typeof o!="string"||(0,t.default)(o,function(c,h){c&&h&&(u[(0,r.camelCase)(c,a)]=h)}),u}return s.default=s,Ro=s,Ro}var p2=h2();const m2=tl(p2),e0=t0("end"),nf=t0("start");function t0(e){return t;function t(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function g2(e){const t=nf(e),r=e0(e);if(t&&r)return{start:t,end:r}}function Bo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ag(e.position):"start"in e||"end"in e?ag(e):"line"in e||"column"in e?jd(e):""}function jd(e){return ug(e&&e.line)+":"+ug(e&&e.column)}function ag(e){return jd(e&&e.start)+"-"+jd(e&&e.end)}function ug(e){return e&&typeof e=="number"?e:1}class qt extends Error{constructor(t,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let o="",a={},u=!1;if(r&&("line"in r&&"column"in r?a={place:r}:"start"in r&&"end"in r?a={place:r}:"type"in r?a={ancestors:[r],place:r.position}:a={...r}),typeof t=="string"?o=t:!a.cause&&t&&(u=!0,o=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof s=="string"){const h=s.indexOf(":");h===-1?a.ruleId=s:(a.source=s.slice(0,h),a.ruleId=s.slice(h+1))}if(!a.place&&a.ancestors&&a.ancestors){const h=a.ancestors[a.ancestors.length-1];h&&(a.place=h.position)}const c=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=c?c.line:void 0,this.name=Bo(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=u&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qt.prototype.file="";qt.prototype.name="";qt.prototype.reason="";qt.prototype.message="";qt.prototype.stack="";qt.prototype.column=void 0;qt.prototype.line=void 0;qt.prototype.ancestors=void 0;qt.prototype.cause=void 0;qt.prototype.fatal=void 0;qt.prototype.place=void 0;qt.prototype.ruleId=void 0;qt.prototype.source=void 0;const rf={}.hasOwnProperty,y2=new Map,x2=/[A-Z]/g,v2=new Set(["table","tbody","thead","tfoot","tr"]),w2=new Set(["td","th"]),n0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function S2(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let s;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=I2(r,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");s=_2(r,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?tf:a2,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=r0(o,e,void 0);return a&&typeof a!="string"?a:o.create(e,o.Fragment,{children:a||void 0},void 0)}function r0(e,t,r){if(t.type==="element")return k2(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return N2(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return C2(e,t,r);if(t.type==="mdxjsEsm")return E2(e,t);if(t.type==="root")return b2(e,t,r);if(t.type==="text")return j2(e,t)}function k2(e,t,r){const s=e.schema;let o=s;t.tagName.toLowerCase()==="svg"&&s.space==="html"&&(o=tf,e.schema=o),e.ancestors.push(t);const a=s0(e,t.tagName,!1),u=T2(e,t);let c=of(e,t);return v2.has(t.tagName)&&(c=c.filter(function(h){return typeof h=="string"?!Zj(h):!0})),i0(e,u,a,t),sf(u,c),e.ancestors.pop(),e.schema=s,e.create(t,a,u,r)}function N2(e,t){if(t.data&&t.data.estree&&e.evaluater){const s=t.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}el(e,t.position)}function E2(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);el(e,t.position)}function C2(e,t,r){const s=e.schema;let o=s;t.name==="svg"&&s.space==="html"&&(o=tf,e.schema=o),e.ancestors.push(t);const a=t.name===null?e.Fragment:s0(e,t.name,!0),u=P2(e,t),c=of(e,t);return i0(e,u,a,t),sf(u,c),e.ancestors.pop(),e.schema=s,e.create(t,a,u,r)}function b2(e,t,r){const s={};return sf(s,of(e,t)),e.create(t,e.Fragment,s,r)}function j2(e,t){return t.value}function i0(e,t,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=s)}function sf(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function _2(e,t,r){return s;function s(o,a,u,c){const p=Array.isArray(u.children)?r:t;return c?p(a,u,c):p(a,u)}}function I2(e,t){return r;function r(s,o,a,u){const c=Array.isArray(a.children),h=nf(s);return t(o,a,u,c,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function T2(e,t){const r={};let s,o;for(o in t.properties)if(o!=="children"&&rf.call(t.properties,o)){const a=A2(e,o,t.properties[o]);if(a){const[u,c]=a;e.tableCellAlignToStyle&&u==="align"&&typeof c=="string"&&w2.has(t.tagName)?s=c:r[u]=c}}if(s){const a=r.style||(r.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function P2(e,t){const r={};for(const s of t.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const a=s.data.estree.body[0];a.type;const u=a.expression;u.type;const c=u.properties[0];c.type,Object.assign(r,e.evaluater.evaluateExpression(c.argument))}else el(e,t.position);else{const o=s.name;let a;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const c=s.value.data.estree.body[0];c.type,a=e.evaluater.evaluateExpression(c.expression)}else el(e,t.position);else a=s.value===null?!0:s.value;r[o]=a}return r}function of(e,t){const r=[];let s=-1;const o=e.passKeys?new Map:y2;for(;++s<t.children.length;){const a=t.children[s];let u;if(e.passKeys){const h=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(h){const p=o.get(h)||0;u=h+"-"+p,o.set(h,p+1)}}const c=r0(e,a,u);c!==void 0&&r.push(c)}return r}function A2(e,t,r){const s=s2(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?Xj(r):u2(r)),s.property==="style"){let o=typeof r=="object"?r:M2(e,String(r));return e.stylePropertyNameCase==="css"&&(o=R2(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&s.space?n2[s.property]||s.property:s.attribute,r]}}function M2(e,t){try{return m2(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,o=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=n0+"#cannot-parse-style-attribute",o}}function s0(e,t,r){let s;if(!r)s={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let a=-1,u;for(;++a<o.length;){const c=eg(o[a])?{type:"Identifier",name:o[a]}:{type:"Literal",value:o[a]};u=u?{type:"MemberExpression",object:u,property:c,computed:!!(a&&c.type==="Literal"),optional:!1}:c}s=u}else s=eg(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(s.type==="Literal"){const o=s.value;return rf.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(s);el(e)}function el(e,t){const r=new qt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=n0+"#cannot-handle-mdx-estrees-without-createevaluater",r}function R2(e){const t={};let r;for(r in e)rf.call(e,r)&&(t[z2(r)]=e[r]);return t}function z2(e){let t=e.replace(x2,L2);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function L2(e){return"-"+e.toLowerCase()}const Zc={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"]},D2={};function F2(e,t){const r=D2,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return o0(e,s,o)}function o0(e,t,r){if(O2(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return cg(e.children,t,r)}return Array.isArray(e)?cg(e,t,r):""}function cg(e,t,r){const s=[];let o=-1;for(;++o<e.length;)s[o]=o0(e[o],t,r);return s.join("")}function O2(e){return!!(e&&typeof e=="object")}const dg=document.createElement("i");function lf(e){const t="&"+e+";";dg.innerHTML=t;const r=dg.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function yr(e,t,r,s){const o=e.length;let a=0,u;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,s.length<1e4)u=Array.from(s),u.unshift(t,r),e.splice(...u);else for(r&&e.splice(t,r);a<s.length;)u=s.slice(a,a+1e4),u.unshift(t,0),e.splice(...u),a+=1e4,t+=1e4}function Dn(e,t){return e.length>0?(yr(e,e.length,0,t),e):t}const fg={}.hasOwnProperty;function $2(e){const t={};let r=-1;for(;++r<e.length;)B2(t,e[r]);return t}function B2(e,t){let r;for(r in t){const o=(fg.call(e,r)?e[r]:void 0)||(e[r]={}),a=t[r];let u;if(a)for(u in a){fg.call(o,u)||(o[u]=[]);const c=a[u];H2(o[u],Array.isArray(c)?c:c?[c]:[])}}}function H2(e,t){let r=-1;const s=[];for(;++r<t.length;)(t[r].add==="after"?e:s).push(t[r]);yr(e,0,0,s)}function l0(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Bs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hr=vi(/[A-Za-z]/),bn=vi(/[\dA-Za-z]/),V2=vi(/[#-'*+\--9=?A-Z^-~]/);function _d(e){return e!==null&&(e<32||e===127)}const Id=vi(/\d/),U2=vi(/[\dA-Fa-f]/),W2=vi(/[!-/:-@[-`{-~]/);function Fe(e){return e!==null&&e<-2}function fn(e){return e!==null&&(e<0||e===32)}function Je(e){return e===-2||e===-1||e===32}const Y2=vi(new RegExp("\\p{P}|\\p{S}","u")),X2=vi(/\s/);function vi(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function qs(e){const t=[];let r=-1,s=0,o=0;for(;++r<e.length;){const a=e.charCodeAt(r);let u="";if(a===37&&bn(e.charCodeAt(r+1))&&bn(e.charCodeAt(r+2)))o=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(u=String.fromCharCode(a));else if(a>55295&&a<57344){const c=e.charCodeAt(r+1);a<56320&&c>56319&&c<57344?(u=String.fromCharCode(a,c),o=1):u="�"}else u=String.fromCharCode(a);u&&(t.push(e.slice(s,r),encodeURIComponent(u)),s=r+o+1,u=""),o&&(r+=o,o=0)}return t.join("")+e.slice(s)}function it(e,t,r,s){const o=s?s-1:Number.POSITIVE_INFINITY;let a=0;return u;function u(h){return Je(h)?(e.enter(r),c(h)):t(h)}function c(h){return Je(h)&&a++<o?(e.consume(h),c):(e.exit(r),t(h))}}const q2={tokenize:G2};function G2(e){const t=e.attempt(this.parser.constructs.contentInitial,s,o);let r;return t;function s(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),it(e,t,"linePrefix")}function o(c){return e.enter("paragraph"),a(c)}function a(c){const h=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=h),r=h,u(c)}function u(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Fe(c)?(e.consume(c),e.exit("chunkText"),a):(e.consume(c),u)}}const K2={tokenize:Q2},hg={tokenize:Z2};function Q2(e){const t=this,r=[];let s=0,o,a,u;return c;function c(N){if(s<r.length){const I=r[s];return t.containerState=I[1],e.attempt(I[0].continuation,h,p)(N)}return p(N)}function h(N){if(s++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();const I=t.events.length;let B=I,T;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){T=t.events[B][1].end;break}S(s);let $=I;for(;$<t.events.length;)t.events[$][1].end={...T},$++;return yr(t.events,B+1,0,t.events.slice(I)),t.events.length=$,p(N)}return c(N)}function p(N){if(s===r.length){if(!o)return x(N);if(o.currentConstruct&&o.currentConstruct.concrete)return k(N);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(hg,m,g)(N)}function m(N){return o&&b(),S(s),x(N)}function g(N){return t.parser.lazy[t.now().line]=s!==r.length,u=t.now().offset,k(N)}function x(N){return t.containerState={},e.attempt(hg,w,k)(N)}function w(N){return s++,r.push([t.currentConstruct,t.containerState]),x(N)}function k(N){if(N===null){o&&b(),S(0),e.consume(N);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:a}),E(N)}function E(N){if(N===null){C(e.exit("chunkFlow"),!0),S(0),e.consume(N);return}return Fe(N)?(e.consume(N),C(e.exit("chunkFlow")),s=0,t.interrupt=void 0,c):(e.consume(N),E)}function C(N,I){const B=t.sliceStream(N);if(I&&B.push(null),N.previous=a,a&&(a.next=N),a=N,o.defineSkip(N.start),o.write(B),t.parser.lazy[N.start.line]){let T=o.events.length;for(;T--;)if(o.events[T][1].start.offset<u&&(!o.events[T][1].end||o.events[T][1].end.offset>u))return;const $=t.events.length;let Q=$,U,q;for(;Q--;)if(t.events[Q][0]==="exit"&&t.events[Q][1].type==="chunkFlow"){if(U){q=t.events[Q][1].end;break}U=!0}for(S(s),T=$;T<t.events.length;)t.events[T][1].end={...q},T++;yr(t.events,Q+1,0,t.events.slice($)),t.events.length=T}}function S(N){let I=r.length;for(;I-- >N;){const B=r[I];t.containerState=B[1],B[0].exit.call(t,e)}r.length=N}function b(){o.write([null]),a=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Z2(e,t,r){return it(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function pg(e){if(e===null||fn(e)||X2(e))return 1;if(Y2(e))return 2}function af(e,t,r){const s=[];let o=-1;for(;++o<e.length;){const a=e[o].resolveAll;a&&!s.includes(a)&&(t=a(t,r),s.push(a))}return t}const Td={name:"attention",resolveAll:J2,tokenize:e_};function J2(e,t){let r=-1,s,o,a,u,c,h,p,m;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&t.sliceSerialize(e[s][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;h=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const g={...e[s][1].end},x={...e[r][1].start};mg(g,-h),mg(x,h),u={type:h>1?"strongSequence":"emphasisSequence",start:g,end:{...e[s][1].end}},c={type:h>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:x},a={type:h>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},o={type:h>1?"strong":"emphasis",start:{...u.start},end:{...c.end}},e[s][1].end={...u.start},e[r][1].start={...c.end},p=[],e[s][1].end.offset-e[s][1].start.offset&&(p=Dn(p,[["enter",e[s][1],t],["exit",e[s][1],t]])),p=Dn(p,[["enter",o,t],["enter",u,t],["exit",u,t],["enter",a,t]]),p=Dn(p,af(t.parser.constructs.insideSpan.null,e.slice(s+1,r),t)),p=Dn(p,[["exit",a,t],["enter",c,t],["exit",c,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(m=2,p=Dn(p,[["enter",e[r][1],t],["exit",e[r][1],t]])):m=0,yr(e,s-1,r-s+3,p),r=s+p.length-m-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function e_(e,t){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,o=pg(s);let a;return u;function u(h){return a=h,e.enter("attentionSequence"),c(h)}function c(h){if(h===a)return e.consume(h),c;const p=e.exit("attentionSequence"),m=pg(h),g=!m||m===2&&o||r.includes(h),x=!o||o===2&&m||r.includes(s);return p._open=!!(a===42?g:g&&(o||!x)),p._close=!!(a===42?x:x&&(m||!g)),t(h)}}function mg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const t_={name:"autolink",tokenize:n_};function n_(e,t,r){let s=0;return o;function o(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(w){return hr(w)?(e.consume(w),u):w===64?r(w):p(w)}function u(w){return w===43||w===45||w===46||bn(w)?(s=1,c(w)):p(w)}function c(w){return w===58?(e.consume(w),s=0,h):(w===43||w===45||w===46||bn(w))&&s++<32?(e.consume(w),c):(s=0,p(w))}function h(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):w===null||w===32||w===60||_d(w)?r(w):(e.consume(w),h)}function p(w){return w===64?(e.consume(w),m):V2(w)?(e.consume(w),p):r(w)}function m(w){return bn(w)?g(w):r(w)}function g(w){return w===46?(e.consume(w),s=0,m):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),t):x(w)}function x(w){if((w===45||bn(w))&&s++<63){const k=w===45?x:g;return e.consume(w),k}return r(w)}}const nu={partial:!0,tokenize:r_};function r_(e,t,r){return s;function s(a){return Je(a)?it(e,o,"linePrefix")(a):o(a)}function o(a){return a===null||Fe(a)?t(a):r(a)}}const a0={continuation:{tokenize:s_},exit:o_,name:"blockQuote",tokenize:i_};function i_(e,t,r){const s=this;return o;function o(u){if(u===62){const c=s.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),a}return r(u)}function a(u){return Je(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function s_(e,t,r){const s=this;return o;function o(u){return Je(u)?it(e,a,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):a(u)}function a(u){return e.attempt(a0,t,r)(u)}}function o_(e){e.exit("blockQuote")}const u0={name:"characterEscape",tokenize:l_};function l_(e,t,r){return s;function s(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),o}function o(a){return W2(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(a)}}const c0={name:"characterReference",tokenize:a_};function a_(e,t,r){const s=this;let o=0,a,u;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),h}function h(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),a=31,u=bn,m(g))}function p(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,u=U2,m):(e.enter("characterReferenceValue"),a=7,u=Id,m(g))}function m(g){if(g===59&&o){const x=e.exit("characterReferenceValue");return u===bn&&!lf(s.sliceSerialize(x))?r(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&o++<a?(e.consume(g),m):r(g)}}const gg={partial:!0,tokenize:c_},yg={concrete:!0,name:"codeFenced",tokenize:u_};function u_(e,t,r){const s=this,o={partial:!0,tokenize:B};let a=0,u=0,c;return h;function h(T){return p(T)}function p(T){const $=s.events[s.events.length-1];return a=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,c=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(T)}function m(T){return T===c?(u++,e.consume(T),m):u<3?r(T):(e.exit("codeFencedFenceSequence"),Je(T)?it(e,g,"whitespace")(T):g(T))}function g(T){return T===null||Fe(T)?(e.exit("codeFencedFence"),s.interrupt?t(T):e.check(gg,E,I)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(T))}function x(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(T)):Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),it(e,w,"whitespace")(T)):T===96&&T===c?r(T):(e.consume(T),x)}function w(T){return T===null||Fe(T)?g(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(T))}function k(T){return T===null||Fe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(T)):T===96&&T===c?r(T):(e.consume(T),k)}function E(T){return e.attempt(o,I,C)(T)}function C(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),S}function S(T){return a>0&&Je(T)?it(e,b,"linePrefix",a+1)(T):b(T)}function b(T){return T===null||Fe(T)?e.check(gg,E,I)(T):(e.enter("codeFlowValue"),N(T))}function N(T){return T===null||Fe(T)?(e.exit("codeFlowValue"),b(T)):(e.consume(T),N)}function I(T){return e.exit("codeFenced"),t(T)}function B(T,$,Q){let U=0;return q;function q(O){return T.enter("lineEnding"),T.consume(O),T.exit("lineEnding"),L}function L(O){return T.enter("codeFencedFence"),Je(O)?it(T,W,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):W(O)}function W(O){return O===c?(T.enter("codeFencedFenceSequence"),J(O)):Q(O)}function J(O){return O===c?(U++,T.consume(O),J):U>=u?(T.exit("codeFencedFenceSequence"),Je(O)?it(T,P,"whitespace")(O):P(O)):Q(O)}function P(O){return O===null||Fe(O)?(T.exit("codeFencedFence"),$(O)):Q(O)}}}function c_(e,t,r){const s=this;return o;function o(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a)}function a(u){return s.parser.lazy[s.now().line]?r(u):t(u)}}const Jc={name:"codeIndented",tokenize:f_},d_={partial:!0,tokenize:h_};function f_(e,t,r){const s=this;return o;function o(p){return e.enter("codeIndented"),it(e,a,"linePrefix",5)(p)}function a(p){const m=s.events[s.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?u(p):r(p)}function u(p){return p===null?h(p):Fe(p)?e.attempt(d_,u,h)(p):(e.enter("codeFlowValue"),c(p))}function c(p){return p===null||Fe(p)?(e.exit("codeFlowValue"),u(p)):(e.consume(p),c)}function h(p){return e.exit("codeIndented"),t(p)}}function h_(e,t,r){const s=this;return o;function o(u){return s.parser.lazy[s.now().line]?r(u):Fe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):it(e,a,"linePrefix",5)(u)}function a(u){const c=s.events[s.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(u):Fe(u)?o(u):r(u)}}const p_={name:"codeText",previous:g_,resolve:m_,tokenize:y_};function m_(e){let t=e.length-4,r=3,s,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(s=r;++s<t;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(s=r-1,t++;++s<=t;)o===void 0?s!==t&&e[s][1].type!=="lineEnding"&&(o=s):(s===t||e[s][1].type==="lineEnding")&&(e[o][1].type="codeTextData",s!==o+2&&(e[o][1].end=e[s-1][1].end,e.splice(o+2,s-o-2),t-=s-o-2,s=o+2),o=void 0);return e}function g_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function y_(e,t,r){let s=0,o,a;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),s++,c):(e.exit("codeTextSequence"),h(g))}function h(g){return g===null?r(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),h):g===96?(a=e.enter("codeTextSequence"),o=0,m(g)):Fe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("codeTextData"),p(g))}function p(g){return g===null||g===32||g===96||Fe(g)?(e.exit("codeTextData"),h(g)):(e.consume(g),p)}function m(g){return g===96?(e.consume(g),o++,m):o===s?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(a.type="codeTextData",p(g))}}class x_{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,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(t,s):t>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(t,r,s){const o=r||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return s&&zo(this.left,s),a.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),zo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zo(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 r=this.left.splice(t,Number.POSITIVE_INFINITY);zo(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zo(this.left,r.reverse())}}}function zo(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function d0(e){const t={};let r=-1,s,o,a,u,c,h,p;const m=new x_(e);for(;++r<m.length;){for(;r in t;)r=t[r];if(s=m.get(r),r&&s[1].type==="chunkFlow"&&m.get(r-1)[1].type==="listItemPrefix"&&(h=s[1]._tokenizer.events,a=0,a<h.length&&h[a][1].type==="lineEndingBlank"&&(a+=2),a<h.length&&h[a][1].type==="content"))for(;++a<h.length&&h[a][1].type!=="content";)h[a][1].type==="chunkText"&&(h[a][1]._isInFirstContentOfListItem=!0,a++);if(s[0]==="enter")s[1].contentType&&(Object.assign(t,v_(m,r)),r=t[r],p=!0);else if(s[1]._container){for(a=r,o=void 0;a--;)if(u=m.get(a),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(m.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=a);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(s[1].end={...m.get(o)[1].start},c=m.slice(o,r),c.unshift(s),m.splice(o,r-o+1,c))}}return yr(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!p}function v_(e,t){const r=e.get(t)[1],s=e.get(t)[2];let o=t-1;const a=[];let u=r._tokenizer;u||(u=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const c=u.events,h=[],p={};let m,g,x=-1,w=r,k=0,E=0;const C=[E];for(;w;){for(;e.get(++o)[1]!==w;);a.push(o),w._tokenizer||(m=s.sliceStream(w),w.next||m.push(null),g&&u.defineSkip(w.start),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(m),w._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=w,w=w.next}for(w=r;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(E=x+1,C.push(E),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(u.events=[],w?(w._tokenizer=void 0,w.previous=void 0):C.pop(),x=C.length;x--;){const S=c.slice(C[x],C[x+1]),b=a.pop();h.push([b,b+S.length-1]),e.splice(b,2,S)}for(h.reverse(),x=-1;++x<h.length;)p[k+h[x][0]]=k+h[x][1],k+=h[x][1]-h[x][0]-1;return p}const w_={resolve:k_,tokenize:N_},S_={partial:!0,tokenize:E_};function k_(e){return d0(e),e}function N_(e,t){let r;return s;function s(c){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(c)}function o(c){return c===null?a(c):Fe(c)?e.check(S_,u,a)(c):(e.consume(c),o)}function a(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function u(c){return e.consume(c),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function E_(e,t,r){const s=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),it(e,a,"linePrefix")}function a(u){if(u===null||Fe(u))return r(u);const c=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(u):e.interrupt(s.parser.constructs.flow,r,t)(u)}}function f0(e,t,r,s,o,a,u,c,h){const p=h||Number.POSITIVE_INFINITY;let m=0;return g;function g(S){return S===60?(e.enter(s),e.enter(o),e.enter(a),e.consume(S),e.exit(a),x):S===null||S===32||S===41||_d(S)?r(S):(e.enter(s),e.enter(u),e.enter(c),e.enter("chunkString",{contentType:"string"}),E(S))}function x(S){return S===62?(e.enter(a),e.consume(S),e.exit(a),e.exit(o),e.exit(s),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),w(S))}function w(S){return S===62?(e.exit("chunkString"),e.exit(c),x(S)):S===null||S===60||Fe(S)?r(S):(e.consume(S),S===92?k:w)}function k(S){return S===60||S===62||S===92?(e.consume(S),w):w(S)}function E(S){return!m&&(S===null||S===41||fn(S))?(e.exit("chunkString"),e.exit(c),e.exit(u),e.exit(s),t(S)):m<p&&S===40?(e.consume(S),m++,E):S===41?(e.consume(S),m--,E):S===null||S===32||S===40||_d(S)?r(S):(e.consume(S),S===92?C:E)}function C(S){return S===40||S===41||S===92?(e.consume(S),E):E(S)}}function h0(e,t,r,s,o,a){const u=this;let c=0,h;return p;function p(w){return e.enter(s),e.enter(o),e.consume(w),e.exit(o),e.enter(a),m}function m(w){return c>999||w===null||w===91||w===93&&!h||w===94&&!c&&"_hiddenFootnoteSupport"in u.parser.constructs?r(w):w===93?(e.exit(a),e.enter(o),e.consume(w),e.exit(o),e.exit(s),t):Fe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===null||w===91||w===93||Fe(w)||c++>999?(e.exit("chunkString"),m(w)):(e.consume(w),h||(h=!Je(w)),w===92?x:g)}function x(w){return w===91||w===92||w===93?(e.consume(w),c++,g):g(w)}}function p0(e,t,r,s,o,a){let u;return c;function c(x){return x===34||x===39||x===40?(e.enter(s),e.enter(o),e.consume(x),e.exit(o),u=x===40?41:x,h):r(x)}function h(x){return x===u?(e.enter(o),e.consume(x),e.exit(o),e.exit(s),t):(e.enter(a),p(x))}function p(x){return x===u?(e.exit(a),h(u)):x===null?r(x):Fe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),it(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===u||x===null||Fe(x)?(e.exit("chunkString"),p(x)):(e.consume(x),x===92?g:m)}function g(x){return x===u||x===92?(e.consume(x),m):m(x)}}function Ho(e,t){let r;return s;function s(o){return Fe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,s):Je(o)?it(e,s,r?"linePrefix":"lineSuffix")(o):t(o)}}const C_={name:"definition",tokenize:j_},b_={partial:!0,tokenize:__};function j_(e,t,r){const s=this;let o;return a;function a(w){return e.enter("definition"),u(w)}function u(w){return h0.call(s,e,c,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function c(w){return o=Bs(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),h):r(w)}function h(w){return fn(w)?Ho(e,p)(w):p(w)}function p(w){return f0(e,m,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return e.attempt(b_,g,g)(w)}function g(w){return Je(w)?it(e,x,"whitespace")(w):x(w)}function x(w){return w===null||Fe(w)?(e.exit("definition"),s.parser.defined.push(o),t(w)):r(w)}}function __(e,t,r){return s;function s(c){return fn(c)?Ho(e,o)(c):r(c)}function o(c){return p0(e,a,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function a(c){return Je(c)?it(e,u,"whitespace")(c):u(c)}function u(c){return c===null||Fe(c)?t(c):r(c)}}const I_={name:"hardBreakEscape",tokenize:T_};function T_(e,t,r){return s;function s(a){return e.enter("hardBreakEscape"),e.consume(a),o}function o(a){return Fe(a)?(e.exit("hardBreakEscape"),t(a)):r(a)}}const P_={name:"headingAtx",resolve:A_,tokenize:M_};function A_(e,t){let r=e.length-2,s=3,o,a;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(o={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},a={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},yr(e,s,r-s+1,[["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t]])),e}function M_(e,t,r){let s=0;return o;function o(m){return e.enter("atxHeading"),a(m)}function a(m){return e.enter("atxHeadingSequence"),u(m)}function u(m){return m===35&&s++<6?(e.consume(m),u):m===null||fn(m)?(e.exit("atxHeadingSequence"),c(m)):r(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),h(m)):m===null||Fe(m)?(e.exit("atxHeading"),t(m)):Je(m)?it(e,c,"whitespace")(m):(e.enter("atxHeadingText"),p(m))}function h(m){return m===35?(e.consume(m),h):(e.exit("atxHeadingSequence"),c(m))}function p(m){return m===null||m===35||fn(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),p)}}const R_=["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"],xg=["pre","script","style","textarea"],z_={concrete:!0,name:"htmlFlow",resolveTo:F_,tokenize:O_},L_={partial:!0,tokenize:B_},D_={partial:!0,tokenize:$_};function F_(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 O_(e,t,r){const s=this;let o,a,u,c,h;return p;function p(A){return m(A)}function m(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),g}function g(A){return A===33?(e.consume(A),x):A===47?(e.consume(A),a=!0,E):A===63?(e.consume(A),o=3,s.interrupt?t:j):hr(A)?(e.consume(A),u=String.fromCharCode(A),C):r(A)}function x(A){return A===45?(e.consume(A),o=2,w):A===91?(e.consume(A),o=5,c=0,k):hr(A)?(e.consume(A),o=4,s.interrupt?t:j):r(A)}function w(A){return A===45?(e.consume(A),s.interrupt?t:j):r(A)}function k(A){const le="CDATA[";return A===le.charCodeAt(c++)?(e.consume(A),c===le.length?s.interrupt?t:W:k):r(A)}function E(A){return hr(A)?(e.consume(A),u=String.fromCharCode(A),C):r(A)}function C(A){if(A===null||A===47||A===62||fn(A)){const le=A===47,fe=u.toLowerCase();return!le&&!a&&xg.includes(fe)?(o=1,s.interrupt?t(A):W(A)):R_.includes(u.toLowerCase())?(o=6,le?(e.consume(A),S):s.interrupt?t(A):W(A)):(o=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(A):a?b(A):N(A))}return A===45||bn(A)?(e.consume(A),u+=String.fromCharCode(A),C):r(A)}function S(A){return A===62?(e.consume(A),s.interrupt?t:W):r(A)}function b(A){return Je(A)?(e.consume(A),b):q(A)}function N(A){return A===47?(e.consume(A),q):A===58||A===95||hr(A)?(e.consume(A),I):Je(A)?(e.consume(A),N):q(A)}function I(A){return A===45||A===46||A===58||A===95||bn(A)?(e.consume(A),I):B(A)}function B(A){return A===61?(e.consume(A),T):Je(A)?(e.consume(A),B):N(A)}function T(A){return A===null||A===60||A===61||A===62||A===96?r(A):A===34||A===39?(e.consume(A),h=A,$):Je(A)?(e.consume(A),T):Q(A)}function $(A){return A===h?(e.consume(A),h=null,U):A===null||Fe(A)?r(A):(e.consume(A),$)}function Q(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||fn(A)?B(A):(e.consume(A),Q)}function U(A){return A===47||A===62||Je(A)?N(A):r(A)}function q(A){return A===62?(e.consume(A),L):r(A)}function L(A){return A===null||Fe(A)?W(A):Je(A)?(e.consume(A),L):r(A)}function W(A){return A===45&&o===2?(e.consume(A),F):A===60&&o===1?(e.consume(A),K):A===62&&o===4?(e.consume(A),z):A===63&&o===3?(e.consume(A),j):A===93&&o===5?(e.consume(A),V):Fe(A)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(L_,Y,J)(A)):A===null||Fe(A)?(e.exit("htmlFlowData"),J(A)):(e.consume(A),W)}function J(A){return e.check(D_,P,Y)(A)}function P(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),O}function O(A){return A===null||Fe(A)?J(A):(e.enter("htmlFlowData"),W(A))}function F(A){return A===45?(e.consume(A),j):W(A)}function K(A){return A===47?(e.consume(A),u="",R):W(A)}function R(A){if(A===62){const le=u.toLowerCase();return xg.includes(le)?(e.consume(A),z):W(A)}return hr(A)&&u.length<8?(e.consume(A),u+=String.fromCharCode(A),R):W(A)}function V(A){return A===93?(e.consume(A),j):W(A)}function j(A){return A===62?(e.consume(A),z):A===45&&o===2?(e.consume(A),j):W(A)}function z(A){return A===null||Fe(A)?(e.exit("htmlFlowData"),Y(A)):(e.consume(A),z)}function Y(A){return e.exit("htmlFlow"),t(A)}}function $_(e,t,r){const s=this;return o;function o(u){return Fe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):r(u)}function a(u){return s.parser.lazy[s.now().line]?r(u):t(u)}}function B_(e,t,r){return s;function s(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(nu,t,r)}}const H_={name:"htmlText",tokenize:V_};function V_(e,t,r){const s=this;let o,a,u;return c;function c(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),h}function h(j){return j===33?(e.consume(j),p):j===47?(e.consume(j),B):j===63?(e.consume(j),N):hr(j)?(e.consume(j),Q):r(j)}function p(j){return j===45?(e.consume(j),m):j===91?(e.consume(j),a=0,k):hr(j)?(e.consume(j),b):r(j)}function m(j){return j===45?(e.consume(j),w):r(j)}function g(j){return j===null?r(j):j===45?(e.consume(j),x):Fe(j)?(u=g,K(j)):(e.consume(j),g)}function x(j){return j===45?(e.consume(j),w):g(j)}function w(j){return j===62?F(j):j===45?x(j):g(j)}function k(j){const z="CDATA[";return j===z.charCodeAt(a++)?(e.consume(j),a===z.length?E:k):r(j)}function E(j){return j===null?r(j):j===93?(e.consume(j),C):Fe(j)?(u=E,K(j)):(e.consume(j),E)}function C(j){return j===93?(e.consume(j),S):E(j)}function S(j){return j===62?F(j):j===93?(e.consume(j),S):E(j)}function b(j){return j===null||j===62?F(j):Fe(j)?(u=b,K(j)):(e.consume(j),b)}function N(j){return j===null?r(j):j===63?(e.consume(j),I):Fe(j)?(u=N,K(j)):(e.consume(j),N)}function I(j){return j===62?F(j):N(j)}function B(j){return hr(j)?(e.consume(j),T):r(j)}function T(j){return j===45||bn(j)?(e.consume(j),T):$(j)}function $(j){return Fe(j)?(u=$,K(j)):Je(j)?(e.consume(j),$):F(j)}function Q(j){return j===45||bn(j)?(e.consume(j),Q):j===47||j===62||fn(j)?U(j):r(j)}function U(j){return j===47?(e.consume(j),F):j===58||j===95||hr(j)?(e.consume(j),q):Fe(j)?(u=U,K(j)):Je(j)?(e.consume(j),U):F(j)}function q(j){return j===45||j===46||j===58||j===95||bn(j)?(e.consume(j),q):L(j)}function L(j){return j===61?(e.consume(j),W):Fe(j)?(u=L,K(j)):Je(j)?(e.consume(j),L):U(j)}function W(j){return j===null||j===60||j===61||j===62||j===96?r(j):j===34||j===39?(e.consume(j),o=j,J):Fe(j)?(u=W,K(j)):Je(j)?(e.consume(j),W):(e.consume(j),P)}function J(j){return j===o?(e.consume(j),o=void 0,O):j===null?r(j):Fe(j)?(u=J,K(j)):(e.consume(j),J)}function P(j){return j===null||j===34||j===39||j===60||j===61||j===96?r(j):j===47||j===62||fn(j)?U(j):(e.consume(j),P)}function O(j){return j===47||j===62||fn(j)?U(j):r(j)}function F(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):r(j)}function K(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),R}function R(j){return Je(j)?it(e,V,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):V(j)}function V(j){return e.enter("htmlTextData"),u(j)}}const uf={name:"labelEnd",resolveAll:X_,resolveTo:q_,tokenize:G_},U_={tokenize:K_},W_={tokenize:Q_},Y_={tokenize:Z_};function X_(e){let t=-1;const r=[];for(;++t<e.length;){const s=e[t][1];if(r.push(e[t]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const o=s.type==="labelImage"?4:2;s.type="data",t+=o}}return e.length!==r.length&&yr(e,0,e.length,r),e}function q_(e,t){let r=e.length,s=0,o,a,u,c;for(;r--;)if(o=e[r][1],a){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(a=r,o.type!=="labelLink")){s=2;break}}else o.type==="labelEnd"&&(u=r);const h={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[a][1].start},end:{...e[u][1].end}},m={type:"labelText",start:{...e[a+s+2][1].end},end:{...e[u-2][1].start}};return c=[["enter",h,t],["enter",p,t]],c=Dn(c,e.slice(a+1,a+s+3)),c=Dn(c,[["enter",m,t]]),c=Dn(c,af(t.parser.constructs.insideSpan.null,e.slice(a+s+4,u-3),t)),c=Dn(c,[["exit",m,t],e[u-2],e[u-1],["exit",p,t]]),c=Dn(c,e.slice(u+1)),c=Dn(c,[["exit",h,t]]),yr(e,a,e.length,c),e}function G_(e,t,r){const s=this;let o=s.events.length,a,u;for(;o--;)if((s.events[o][1].type==="labelImage"||s.events[o][1].type==="labelLink")&&!s.events[o][1]._balanced){a=s.events[o][1];break}return c;function c(x){return a?a._inactive?g(x):(u=s.parser.defined.includes(Bs(s.sliceSerialize({start:a.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),h):r(x)}function h(x){return x===40?e.attempt(U_,m,u?m:g)(x):x===91?e.attempt(W_,m,u?p:g)(x):u?m(x):g(x)}function p(x){return e.attempt(Y_,m,g)(x)}function m(x){return t(x)}function g(x){return a._balanced=!0,r(x)}}function K_(e,t,r){return s;function s(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return fn(g)?Ho(e,a)(g):a(g)}function a(g){return g===41?m(g):f0(e,u,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return fn(g)?Ho(e,h)(g):m(g)}function c(g){return r(g)}function h(g){return g===34||g===39||g===40?p0(e,p,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):m(g)}function p(g){return fn(g)?Ho(e,m)(g):m(g)}function m(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):r(g)}}function Q_(e,t,r){const s=this;return o;function o(c){return h0.call(s,e,a,u,"reference","referenceMarker","referenceString")(c)}function a(c){return s.parser.defined.includes(Bs(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?t(c):r(c)}function u(c){return r(c)}}function Z_(e,t,r){return s;function s(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),o}function o(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):r(a)}}const J_={name:"labelStartImage",resolveAll:uf.resolveAll,tokenize:eI};function eI(e,t,r){const s=this;return o;function o(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),a}function a(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),u):r(c)}function u(c){return c===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(c):t(c)}}const tI={name:"labelStartLink",resolveAll:uf.resolveAll,tokenize:nI};function nI(e,t,r){const s=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),a}function a(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(u):t(u)}}const ed={name:"lineEnding",tokenize:rI};function rI(e,t){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),it(e,t,"linePrefix")}}const _a={name:"thematicBreak",tokenize:iI};function iI(e,t,r){let s=0,o;return a;function a(p){return e.enter("thematicBreak"),u(p)}function u(p){return o=p,c(p)}function c(p){return p===o?(e.enter("thematicBreakSequence"),h(p)):s>=3&&(p===null||Fe(p))?(e.exit("thematicBreak"),t(p)):r(p)}function h(p){return p===o?(e.consume(p),s++,h):(e.exit("thematicBreakSequence"),Je(p)?it(e,c,"whitespace")(p):c(p))}}const un={continuation:{tokenize:aI},exit:cI,name:"list",tokenize:lI},sI={partial:!0,tokenize:dI},oI={partial:!0,tokenize:uI};function lI(e,t,r){const s=this,o=s.events[s.events.length-1];let a=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return c;function c(w){const k=s.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!s.containerState.marker||w===s.containerState.marker:Id(w)){if(s.containerState.type||(s.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(_a,r,p)(w):p(w);if(!s.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(w)}return r(w)}function h(w){return Id(w)&&++u<10?(e.consume(w),h):(!s.interrupt||u<2)&&(s.containerState.marker?w===s.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),p(w)):r(w)}function p(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||w,e.check(nu,s.interrupt?r:m,e.attempt(sI,x,g))}function m(w){return s.containerState.initialBlankLine=!0,a++,x(w)}function g(w){return Je(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),x):r(w)}function x(w){return s.containerState.size=a+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(w)}}function aI(e,t,r){const s=this;return s.containerState._closeFlow=void 0,e.check(nu,o,a);function o(c){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,it(e,t,"listItemIndent",s.containerState.size+1)(c)}function a(c){return s.containerState.furtherBlankLines||!Je(c)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,u(c)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(oI,t,u)(c))}function u(c){return s.containerState._closeFlow=!0,s.interrupt=void 0,it(e,e.attempt(un,t,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function uI(e,t,r){const s=this;return it(e,o,"listItemIndent",s.containerState.size+1);function o(a){const u=s.events[s.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===s.containerState.size?t(a):r(a)}}function cI(e){e.exit(this.containerState.type)}function dI(e,t,r){const s=this;return it(e,o,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(a){const u=s.events[s.events.length-1];return!Je(a)&&u&&u[1].type==="listItemPrefixWhitespace"?t(a):r(a)}}const vg={name:"setextUnderline",resolveTo:fI,tokenize:hI};function fI(e,t){let r=e.length,s,o,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!a&&e[r][1].type==="definition"&&(a=r);const u={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",a?(e.splice(o,0,["enter",u,t]),e.splice(a+1,0,["exit",e[s][1],t]),e[s][1].end={...e[a][1].end}):e[s][1]=u,e.push(["exit",u,t]),e}function hI(e,t,r){const s=this;let o;return a;function a(p){let m=s.events.length,g;for(;m--;)if(s.events[m][1].type!=="lineEnding"&&s.events[m][1].type!=="linePrefix"&&s.events[m][1].type!=="content"){g=s.events[m][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||g)?(e.enter("setextHeadingLine"),o=p,u(p)):r(p)}function u(p){return e.enter("setextHeadingLineSequence"),c(p)}function c(p){return p===o?(e.consume(p),c):(e.exit("setextHeadingLineSequence"),Je(p)?it(e,h,"lineSuffix")(p):h(p))}function h(p){return p===null||Fe(p)?(e.exit("setextHeadingLine"),t(p)):r(p)}}const pI={tokenize:mI};function mI(e){const t=this,r=e.attempt(nu,s,e.attempt(this.parser.constructs.flowInitial,o,it(e,e.attempt(this.parser.constructs.flow,o,e.attempt(w_,o)),"linePrefix")));return r;function s(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const gI={resolveAll:g0()},yI=m0("string"),xI=m0("text");function m0(e){return{resolveAll:g0(e==="text"?vI:void 0),tokenize:t};function t(r){const s=this,o=this.parser.constructs[e],a=r.attempt(o,u,c);return u;function u(m){return p(m)?a(m):c(m)}function c(m){if(m===null){r.consume(m);return}return r.enter("data"),r.consume(m),h}function h(m){return p(m)?(r.exit("data"),a(m)):(r.consume(m),h)}function p(m){if(m===null)return!0;const g=o[m];let x=-1;if(g)for(;++x<g.length;){const w=g[x];if(!w.previous||w.previous.call(s,s.previous))return!0}return!1}}}function g0(e){return t;function t(r,s){let o=-1,a;for(;++o<=r.length;)a===void 0?r[o]&&r[o][1].type==="data"&&(a=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==a+2&&(r[a][1].end=r[o-1][1].end,r.splice(a+2,o-a-2),o=a+2),a=void 0);return e?e(r,s):r}}function vI(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const s=e[r-1][1],o=t.sliceStream(s);let a=o.length,u=-1,c=0,h;for(;a--;){const p=o[a];if(typeof p=="string"){for(u=p.length;p.charCodeAt(u-1)===32;)c++,u--;if(u)break;u=-1}else if(p===-2)h=!0,c++;else if(p!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){const p={type:r===e.length||h||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?u:s.start._bufferIndex+u,_index:s.start._index+a,line:s.end.line,column:s.end.column-c,offset:s.end.offset-c},end:{...s.end}};s.end={...p.start},s.start.offset===s.end.offset?Object.assign(s,p):(e.splice(r,0,["enter",p,t],["exit",p,t]),r+=2)}r++}return e}const wI={42:un,43:un,45:un,48:un,49:un,50:un,51:un,52:un,53:un,54:un,55:un,56:un,57:un,62:a0},SI={91:C_},kI={[-2]:Jc,[-1]:Jc,32:Jc},NI={35:P_,42:_a,45:[vg,_a],60:z_,61:vg,95:_a,96:yg,126:yg},EI={38:c0,92:u0},CI={[-5]:ed,[-4]:ed,[-3]:ed,33:J_,38:c0,42:Td,60:[t_,H_],91:tI,92:[I_,u0],93:uf,95:Td,96:p_},bI={null:[Td,gI]},jI={null:[42,95]},_I={null:[]},II=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:jI,contentInitial:SI,disable:_I,document:wI,flow:NI,flowInitial:kI,insideSpan:bI,string:EI,text:CI},Symbol.toStringTag,{value:"Module"}));function TI(e,t,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const o={},a=[];let u=[],c=[];const h={attempt:$(B),check:$(T),consume:b,enter:N,exit:I,interrupt:$(T,{interrupt:!0})},p={code:null,containerState:{},defineSkip:E,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:w,write:g};let m=t.tokenize.call(p,h);return t.resolveAll&&a.push(t),p;function g(L){return u=Dn(u,L),C(),u[u.length-1]!==null?[]:(Q(t,0),p.events=af(a,p.events,p),p.events)}function x(L,W){return AI(w(L),W)}function w(L){return PI(u,L)}function k(){const{_bufferIndex:L,_index:W,line:J,column:P,offset:O}=s;return{_bufferIndex:L,_index:W,line:J,column:P,offset:O}}function E(L){o[L.line]=L.column,q()}function C(){let L;for(;s._index<u.length;){const W=u[s._index];if(typeof W=="string")for(L=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===L&&s._bufferIndex<W.length;)S(W.charCodeAt(s._bufferIndex));else S(W)}}function S(L){m=m(L)}function b(L){Fe(L)?(s.line++,s.column=1,s.offset+=L===-3?2:1,q()):L!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===u[s._index].length&&(s._bufferIndex=-1,s._index++)),p.previous=L}function N(L,W){const J=W||{};return J.type=L,J.start=k(),p.events.push(["enter",J,p]),c.push(J),J}function I(L){const W=c.pop();return W.end=k(),p.events.push(["exit",W,p]),W}function B(L,W){Q(L,W.from)}function T(L,W){W.restore()}function $(L,W){return J;function J(P,O,F){let K,R,V,j;return Array.isArray(P)?Y(P):"tokenize"in P?Y([P]):z(P);function z(ce){return ve;function ve(se){const xe=se!==null&&ce[se],je=se!==null&&ce.null,Pe=[...Array.isArray(xe)?xe:xe?[xe]:[],...Array.isArray(je)?je:je?[je]:[]];return Y(Pe)(se)}}function Y(ce){return K=ce,R=0,ce.length===0?F:A(ce[R])}function A(ce){return ve;function ve(se){return j=U(),V=ce,ce.partial||(p.currentConstruct=ce),ce.name&&p.parser.constructs.disable.null.includes(ce.name)?fe():ce.tokenize.call(W?Object.assign(Object.create(p),W):p,h,le,fe)(se)}}function le(ce){return L(V,j),O}function fe(ce){return j.restore(),++R<K.length?A(K[R]):F}}}function Q(L,W){L.resolveAll&&!a.includes(L)&&a.push(L),L.resolve&&yr(p.events,W,p.events.length-W,L.resolve(p.events.slice(W),p)),L.resolveTo&&(p.events=L.resolveTo(p.events,p))}function U(){const L=k(),W=p.previous,J=p.currentConstruct,P=p.events.length,O=Array.from(c);return{from:P,restore:F};function F(){s=L,p.previous=W,p.currentConstruct=J,p.events.length=P,c=O,q()}}function q(){s.line in o&&s.column<2&&(s.column=o[s.line],s.offset+=o[s.line]-1)}}function PI(e,t){const r=t.start._index,s=t.start._bufferIndex,o=t.end._index,a=t.end._bufferIndex;let u;if(r===o)u=[e[r].slice(s,a)];else{if(u=e.slice(r,o),s>-1){const c=u[0];typeof c=="string"?u[0]=c.slice(s):u.shift()}a>0&&u.push(e[o].slice(0,a))}return u}function AI(e,t){let r=-1;const s=[];let o;for(;++r<e.length;){const a=e[r];let u;if(typeof a=="string")u=a;else switch(a){case-5:{u="\r";break}case-4:{u=`
|
|
67
|
-
`;break}case-3:{u=`\r
|
|
68
|
-
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&o)continue;u=" ";break}default:u=String.fromCharCode(a)}o=a===-2,s.push(u)}return s.join("")}function MI(e){const s={constructs:$2([II,...(e||{}).extensions||[]]),content:o(q2),defined:[],document:o(K2),flow:o(pI),lazy:{},string:o(yI),text:o(xI)};return s;function o(a){return u;function u(c){return TI(s,a,c)}}}function RI(e){for(;!d0(e););return e}const wg=/[\0\t\n\r]/g;function zI(){let e=1,t="",r=!0,s;return o;function o(a,u,c){const h=[];let p,m,g,x,w;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(u||void 0).decode(a)),g=0,t="",r&&(a.charCodeAt(0)===65279&&g++,r=void 0);g<a.length;){if(wg.lastIndex=g,p=wg.exec(a),x=p&&p.index!==void 0?p.index:a.length,w=a.charCodeAt(x),!p){t=a.slice(g);break}if(w===10&&g===x&&s)h.push(-3),s=void 0;else switch(s&&(h.push(-5),s=void 0),g<x&&(h.push(a.slice(g,x)),e+=x-g),w){case 0:{h.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,h.push(-2);e++<m;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:s=!0,e=1}g=x+1}return c&&(s&&h.push(-5),t&&h.push(t),h.push(null)),h}}const LI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function DI(e){return e.replace(LI,FI)}function FI(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const o=r.charCodeAt(1),a=o===120||o===88;return l0(r.slice(a?2:1),a?16:10)}return lf(r)||e}const y0={}.hasOwnProperty;function OI(e,t,r){return t&&typeof t=="object"&&(r=t,t=void 0),$I(r)(RI(MI(r).document().write(zI()(e,t,!0))))}function $I(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(bt),autolinkProtocol:U,autolinkEmail:U,atxHeading:a(We),blockQuote:a(je),characterEscape:U,characterReference:U,codeFenced:a(Pe),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:a(Pe,u),codeText:a(Ee,u),codeTextData:U,data:U,codeFlowValue:U,definition:a(Ce),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:a(Ve),hardBreakEscape:a(Oe),hardBreakTrailing:a(Oe),htmlFlow:a(tt,u),htmlFlowData:U,htmlText:a(tt,u),htmlTextData:U,image:a(It),label:u,link:a(bt),listItem:a(Tt),listItemValue:x,listOrdered:a(gt,g),listUnordered:a(gt),paragraph:a(Ht),reference:A,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:a(We),strong:a(pn),thematicBreak:a(Jt)},exit:{atxHeading:h(),atxHeadingSequence:B,autolink:h(),autolinkEmail:xe,autolinkProtocol:se,blockQuote:h(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:ce,characterReference:ve,codeFenced:h(C),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:q,codeIndented:h(S),codeText:h(O),codeTextData:q,data:q,definition:h(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:N,emphasis:h(),hardBreakEscape:h(W),hardBreakTrailing:h(W),htmlFlow:h(J),htmlFlowData:q,htmlText:h(P),htmlTextData:q,image:h(K),label:V,labelText:R,lineEnding:L,link:h(F),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:le,resourceDestinationString:j,resourceTitleString:z,resource:Y,setextHeading:h(Q),setextHeadingLineSequence:$,setextHeadingText:T,strong:h(),thematicBreak:h()}};x0(t,(e||{}).mdastExtensions||[]);const r={};return s;function s(ie){let me={type:"root",children:[]};const pe={stack:[me],tokenStack:[],config:t,enter:c,exit:p,buffer:u,resume:m,data:r},$e=[];let Be=-1;for(;++Be<ie.length;)if(ie[Be][1].type==="listOrdered"||ie[Be][1].type==="listUnordered")if(ie[Be][0]==="enter")$e.push(Be);else{const ht=$e.pop();Be=o(ie,ht,Be)}for(Be=-1;++Be<ie.length;){const ht=t[ie[Be][0]];y0.call(ht,ie[Be][1].type)&&ht[ie[Be][1].type].call(Object.assign({sliceSerialize:ie[Be][2].sliceSerialize},pe),ie[Be][1])}if(pe.tokenStack.length>0){const ht=pe.tokenStack[pe.tokenStack.length-1];(ht[1]||Sg).call(pe,void 0,ht[0])}for(me.position={start:hi(ie.length>0?ie[0][1].start:{line:1,column:1,offset:0}),end:hi(ie.length>0?ie[ie.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<t.transforms.length;)me=t.transforms[Be](me)||me;return me}function o(ie,me,pe){let $e=me-1,Be=-1,ht=!1,gn,Pt,yt,_n;for(;++$e<=pe;){const pt=ie[$e];switch(pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{pt[0]==="enter"?Be++:Be--,_n=void 0;break}case"lineEndingBlank":{pt[0]==="enter"&&(gn&&!_n&&!Be&&!yt&&(yt=$e),_n=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_n=void 0}if(!Be&&pt[0]==="enter"&&pt[1].type==="listItemPrefix"||Be===-1&&pt[0]==="exit"&&(pt[1].type==="listUnordered"||pt[1].type==="listOrdered")){if(gn){let en=$e;for(Pt=void 0;en--;){const At=ie[en];if(At[1].type==="lineEnding"||At[1].type==="lineEndingBlank"){if(At[0]==="exit")continue;Pt&&(ie[Pt][1].type="lineEndingBlank",ht=!0),At[1].type="lineEnding",Pt=en}else if(!(At[1].type==="linePrefix"||At[1].type==="blockQuotePrefix"||At[1].type==="blockQuotePrefixWhitespace"||At[1].type==="blockQuoteMarker"||At[1].type==="listItemIndent"))break}yt&&(!Pt||yt<Pt)&&(gn._spread=!0),gn.end=Object.assign({},Pt?ie[Pt][1].start:pt[1].end),ie.splice(Pt||$e,0,["exit",gn,pt[2]]),$e++,pe++}if(pt[1].type==="listItemPrefix"){const en={type:"listItem",_spread:!1,start:Object.assign({},pt[1].start),end:void 0};gn=en,ie.splice($e,0,["enter",en,pt[2]]),$e++,pe++,yt=void 0,_n=!0}}}return ie[me][1]._spread=ht,pe}function a(ie,me){return pe;function pe($e){c.call(this,ie($e),$e),me&&me.call(this,$e)}}function u(){this.stack.push({type:"fragment",children:[]})}function c(ie,me,pe){this.stack[this.stack.length-1].children.push(ie),this.stack.push(ie),this.tokenStack.push([me,pe||void 0]),ie.position={start:hi(me.start),end:void 0}}function h(ie){return me;function me(pe){ie&&ie.call(this,pe),p.call(this,pe)}}function p(ie,me){const pe=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==ie.type&&(me?me.call(this,ie,$e[0]):($e[1]||Sg).call(this,ie,$e[0]));else throw new Error("Cannot close `"+ie.type+"` ("+Bo({start:ie.start,end:ie.end})+"): it’s not open");pe.position.end=hi(ie.end)}function m(){return F2(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(ie){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(ie),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.lang=ie}function k(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.meta=ie}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie.replace(/(\r?\n|\r)$/g,"")}function b(ie){const me=this.resume(),pe=this.stack[this.stack.length-1];pe.label=me,pe.identifier=Bs(this.sliceSerialize(ie)).toLowerCase()}function N(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.title=ie}function I(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.url=ie}function B(ie){const me=this.stack[this.stack.length-1];if(!me.depth){const pe=this.sliceSerialize(ie).length;me.depth=pe}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function $(ie){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(ie).codePointAt(0)===61?1:2}function Q(){this.data.setextHeadingSlurpLineEnding=void 0}function U(ie){const pe=this.stack[this.stack.length-1].children;let $e=pe[pe.length-1];(!$e||$e.type!=="text")&&($e=mn(),$e.position={start:hi(ie.start),end:void 0},pe.push($e)),this.stack.push($e)}function q(ie){const me=this.stack.pop();me.value+=this.sliceSerialize(ie),me.position.end=hi(ie.end)}function L(ie){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const pe=me.children[me.children.length-1];pe.position.end=hi(ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(U.call(this,ie),q.call(this,ie))}function W(){this.data.atHardBreak=!0}function J(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function P(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function O(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.value=ie}function F(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=me,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function K(){const ie=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";ie.type+="Reference",ie.referenceType=me,delete ie.url,delete ie.title}else delete ie.identifier,delete ie.label;this.data.referenceType=void 0}function R(ie){const me=this.sliceSerialize(ie),pe=this.stack[this.stack.length-2];pe.label=DI(me),pe.identifier=Bs(me).toLowerCase()}function V(){const ie=this.stack[this.stack.length-1],me=this.resume(),pe=this.stack[this.stack.length-1];if(this.data.inReference=!0,pe.type==="link"){const $e=ie.children;pe.children=$e}else pe.alt=me}function j(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.url=ie}function z(){const ie=this.resume(),me=this.stack[this.stack.length-1];me.title=ie}function Y(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function le(ie){const me=this.resume(),pe=this.stack[this.stack.length-1];pe.label=me,pe.identifier=Bs(this.sliceSerialize(ie)).toLowerCase(),this.data.referenceType="full"}function fe(ie){this.data.characterReferenceType=ie.type}function ce(ie){const me=this.sliceSerialize(ie),pe=this.data.characterReferenceType;let $e;pe?($e=l0(me,pe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=lf(me);const Be=this.stack[this.stack.length-1];Be.value+=$e}function ve(ie){const me=this.stack.pop();me.position.end=hi(ie.end)}function se(ie){q.call(this,ie);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(ie)}function xe(ie){q.call(this,ie);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(ie)}function je(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function Ee(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ve(){return{type:"emphasis",children:[]}}function We(){return{type:"heading",depth:0,children:[]}}function Oe(){return{type:"break"}}function tt(){return{type:"html",value:""}}function It(){return{type:"image",title:null,url:"",alt:null}}function bt(){return{type:"link",title:null,url:"",children:[]}}function gt(ie){return{type:"list",ordered:ie.type==="listOrdered",start:null,spread:ie._spread,children:[]}}function Tt(ie){return{type:"listItem",spread:ie._spread,checked:null,children:[]}}function Ht(){return{type:"paragraph",children:[]}}function pn(){return{type:"strong",children:[]}}function mn(){return{type:"text",value:""}}function Jt(){return{type:"thematicBreak"}}}function hi(e){return{line:e.line,column:e.column,offset:e.offset}}function x0(e,t){let r=-1;for(;++r<t.length;){const s=t[r];Array.isArray(s)?x0(e,s):BI(e,s)}}function BI(e,t){let r;for(r in t)if(y0.call(t,r))switch(r){case"canContainEols":{const s=t[r];s&&e[r].push(...s);break}case"transforms":{const s=t[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=t[r];s&&Object.assign(e[r],s);break}}}function Sg(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Bo({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Bo({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Bo({start:t.start,end:t.end})+") is still open")}function HI(e){const t=this;t.parser=r;function r(s){return OI(s,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function VI(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function UI(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
69
|
-
`}]}function WI(e,t){const r=t.value?t.value+`
|
|
70
|
-
`:"",s={},o=t.lang?t.lang.split(/\s+/):[];o.length>0&&(s.className=["language-"+o[0]]);let a={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function YI(e,t){const r={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function XI(e,t){const r={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function qI(e,t){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(t.identifier).toUpperCase(),o=qs(s.toLowerCase()),a=e.footnoteOrder.indexOf(s);let u,c=e.footnoteCounts.get(s);c===void 0?(c=0,e.footnoteOrder.push(s),u=e.footnoteOrder.length):u=a+1,c+=1,e.footnoteCounts.set(s,c);const h={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+o,id:r+"fnref-"+o+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const p={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,p),e.applyData(t,p)}function GI(e,t){const r={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KI(e,t){if(e.options.allowDangerousHtml){const r={type:"raw",value:t.value};return e.patch(t,r),e.applyData(t,r)}}function v0(e,t){const r=t.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+s}];const o=e.all(t),a=o[0];a&&a.type==="text"?a.value="["+a.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=s:o.push({type:"text",value:s}),o}function QI(e,t){const r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return v0(e,t);const o={src:qs(s.url||""),alt:t.alt};s.title!==null&&s.title!==void 0&&(o.title=s.title);const a={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,a),e.applyData(t,a)}function ZI(e,t){const r={src:qs(t.url)};t.alt!==null&&t.alt!==void 0&&(r.alt=t.alt),t.title!==null&&t.title!==void 0&&(r.title=t.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,s),e.applyData(t,s)}function JI(e,t){const r={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(t,s),e.applyData(t,s)}function eT(e,t){const r=String(t.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return v0(e,t);const o={href:qs(s.url||"")};s.title!==null&&s.title!==void 0&&(o.title=s.title);const a={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function tT(e,t){const r={href:qs(t.url)};t.title!==null&&t.title!==void 0&&(r.title=t.title);const s={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function nT(e,t,r){const s=e.all(t),o=r?rT(r):w0(t),a={},u=[];if(typeof t.checked=="boolean"){const m=s[0];let g;m&&m.type==="element"&&m.tagName==="p"?g=m:(g={type:"element",tagName:"p",properties:{},children:[]},s.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let c=-1;for(;++c<s.length;){const m=s[c];(o||c!==0||m.type!=="element"||m.tagName!=="p")&&u.push({type:"text",value:`
|
|
71
|
-
`}),m.type==="element"&&m.tagName==="p"&&!o?u.push(...m.children):u.push(m)}const h=s[s.length-1];h&&(o||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
72
|
-
`});const p={type:"element",tagName:"li",properties:a,children:u};return e.patch(t,p),e.applyData(t,p)}function rT(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const r=e.children;let s=-1;for(;!t&&++s<r.length;)t=w0(r[s])}return t}function w0(e){const t=e.spread;return t??e.children.length>1}function iT(e,t){const r={},s=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(r.start=t.start);++o<s.length;){const u=s[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const a={type:"element",tagName:t.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function sT(e,t){const r={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oT(e,t){const r={type:"root",children:e.wrap(e.all(t))};return e.patch(t,r),e.applyData(t,r)}function lT(e,t){const r={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function aT(e,t){const r=e.all(t),s=r.shift(),o=[];if(s){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(t.children[0],u),o.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},c=nf(t.children[1]),h=e0(t.children[t.children.length-1]);c&&h&&(u.position={start:c,end:h}),o.push(u)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)}function uT(e,t,r){const s=r?r.children:void 0,a=(s?s.indexOf(t):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,c=u?u.length:t.children.length;let h=-1;const p=[];for(;++h<c;){const g=t.children[h],x={},w=u?u[h]:void 0;w&&(x.align=w);let k={type:"element",tagName:a,properties:x,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),p.push(k)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,m),e.applyData(t,m)}function cT(e,t){const r={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}const kg=9,Ng=32;function dT(e){const t=String(e),r=/\r?\n|\r/g;let s=r.exec(t),o=0;const a=[];for(;s;)a.push(Eg(t.slice(o,s.index),o>0,!0),s[0]),o=s.index+s[0].length,s=r.exec(t);return a.push(Eg(t.slice(o),o>0,!1)),a.join("")}function Eg(e,t,r){let s=0,o=e.length;if(t){let a=e.codePointAt(s);for(;a===kg||a===Ng;)s++,a=e.codePointAt(s)}if(r){let a=e.codePointAt(o-1);for(;a===kg||a===Ng;)o--,a=e.codePointAt(o-1)}return o>s?e.slice(s,o):""}function fT(e,t){const r={type:"text",value:dT(String(t.value))};return e.patch(t,r),e.applyData(t,r)}function hT(e,t){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,r),e.applyData(t,r)}const pT={blockquote:VI,break:UI,code:WI,delete:YI,emphasis:XI,footnoteReference:qI,heading:GI,html:KI,imageReference:QI,image:ZI,inlineCode:JI,linkReference:eT,link:tT,listItem:nT,list:iT,paragraph:sT,root:oT,strong:lT,table:aT,tableCell:cT,tableRow:uT,text:fT,thematicBreak:hT,toml:wa,yaml:wa,definition:wa,footnoteDefinition:wa};function wa(){}const S0=-1,ru=0,Vo=1,Ba=2,cf=3,df=4,ff=5,hf=6,k0=7,N0=8,Cg=typeof self=="object"?self:globalThis,mT=(e,t)=>{const r=(o,a)=>(e.set(a,o),o),s=o=>{if(e.has(o))return e.get(o);const[a,u]=t[o];switch(a){case ru:case S0:return r(u,o);case Vo:{const c=r([],o);for(const h of u)c.push(s(h));return c}case Ba:{const c=r({},o);for(const[h,p]of u)c[s(h)]=s(p);return c}case cf:return r(new Date(u),o);case df:{const{source:c,flags:h}=u;return r(new RegExp(c,h),o)}case ff:{const c=r(new Map,o);for(const[h,p]of u)c.set(s(h),s(p));return c}case hf:{const c=r(new Set,o);for(const h of u)c.add(s(h));return c}case k0:{const{name:c,message:h}=u;return r(new Cg[c](h),o)}case N0:return r(BigInt(u),o);case"BigInt":return r(Object(BigInt(u)),o);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:c}=new Uint8Array(u);return r(new DataView(c),u)}}return r(new Cg[a](u),o)};return s},bg=e=>mT(new Map,e)(0),Ms="",{toString:gT}={},{keys:yT}=Object,Lo=e=>{const t=typeof e;if(t!=="object"||!e)return[ru,t];const r=gT.call(e).slice(8,-1);switch(r){case"Array":return[Vo,Ms];case"Object":return[Ba,Ms];case"Date":return[cf,Ms];case"RegExp":return[df,Ms];case"Map":return[ff,Ms];case"Set":return[hf,Ms];case"DataView":return[Vo,r]}return r.includes("Array")?[Vo,r]:r.includes("Error")?[k0,r]:[Ba,r]},Sa=([e,t])=>e===ru&&(t==="function"||t==="symbol"),xT=(e,t,r,s)=>{const o=(u,c)=>{const h=s.push(u)-1;return r.set(c,h),h},a=u=>{if(r.has(u))return r.get(u);let[c,h]=Lo(u);switch(c){case ru:{let m=u;switch(h){case"bigint":c=N0,m=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);m=null;break;case"undefined":return o([S0],u)}return o([c,m],u)}case Vo:{if(h){let x=u;return h==="DataView"?x=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(x=new Uint8Array(u)),o([h,[...x]],u)}const m=[],g=o([c,m],u);for(const x of u)m.push(a(x));return g}case Ba:{if(h)switch(h){case"BigInt":return o([h,u.toString()],u);case"Boolean":case"Number":case"String":return o([h,u.valueOf()],u)}if(t&&"toJSON"in u)return a(u.toJSON());const m=[],g=o([c,m],u);for(const x of yT(u))(e||!Sa(Lo(u[x])))&&m.push([a(x),a(u[x])]);return g}case cf:return o([c,u.toISOString()],u);case df:{const{source:m,flags:g}=u;return o([c,{source:m,flags:g}],u)}case ff:{const m=[],g=o([c,m],u);for(const[x,w]of u)(e||!(Sa(Lo(x))||Sa(Lo(w))))&&m.push([a(x),a(w)]);return g}case hf:{const m=[],g=o([c,m],u);for(const x of u)(e||!Sa(Lo(x)))&&m.push(a(x));return g}}const{message:p}=u;return o([c,{name:h,message:p}],u)};return a},jg=(e,{json:t,lossy:r}={})=>{const s=[];return xT(!(t||r),!!t,new Map,s)(e),s},Ha=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?bg(jg(e,t)):structuredClone(e):(e,t)=>bg(jg(e,t));function vT(e,t){const r=[{type:"text",value:"↩"}];return t>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),r}function wT(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ST(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||vT,s=e.options.footnoteBackLabel||wT,o=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let h=-1;for(;++h<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[h]);if(!p)continue;const m=e.all(p),g=String(p.identifier).toUpperCase(),x=qs(g.toLowerCase());let w=0;const k=[],E=e.footnoteCounts.get(g);for(;E!==void 0&&++w<=E;){k.length>0&&k.push({type:"text",value:" "});let b=typeof r=="string"?r:r(h,w);typeof b=="string"&&(b={type:"text",value:b}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(h,w),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const C=m[m.length-1];if(C&&C.type==="element"&&C.tagName==="p"){const b=C.children[C.children.length-1];b&&b.type==="text"?b.value+=" ":C.children.push({type:"text",value:" "}),C.children.push(...k)}else m.push(...k);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(m,!0)};e.patch(p,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Ha(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
73
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
74
|
-
`}]}}const E0=(function(e){if(e==null)return CT;if(typeof e=="function")return iu(e);if(typeof e=="object")return Array.isArray(e)?kT(e):NT(e);if(typeof e=="string")return ET(e);throw new Error("Expected function, string, or object as test")});function kT(e){const t=[];let r=-1;for(;++r<e.length;)t[r]=E0(e[r]);return iu(s);function s(...o){let a=-1;for(;++a<t.length;)if(t[a].apply(this,o))return!0;return!1}}function NT(e){const t=e;return iu(r);function r(s){const o=s;let a;for(a in e)if(o[a]!==t[a])return!1;return!0}}function ET(e){return iu(t);function t(r){return r&&r.type===e}}function iu(e){return t;function t(r,s,o){return!!(bT(r)&&e.call(this,r,typeof s=="number"?s:void 0,o||void 0))}}function CT(){return!0}function bT(e){return e!==null&&typeof e=="object"&&"type"in e}const C0=[],jT=!0,_g=!1,_T="skip";function IT(e,t,r,s){let o;typeof t=="function"&&typeof r!="function"?(s=r,r=t):o=t;const a=E0(o),u=s?-1:1;c(e,void 0,[])();function c(h,p,m){const g=h&&typeof h=="object"?h:{};if(typeof g.type=="string"){const w=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(h.type+(w?"<"+w+">":""))+")"})}return x;function x(){let w=C0,k,E,C;if((!t||a(h,p,m[m.length-1]||void 0))&&(w=TT(r(h,m)),w[0]===_g))return w;if("children"in h&&h.children){const S=h;if(S.children&&w[0]!==_T)for(E=(s?S.children.length:-1)+u,C=m.concat(S);E>-1&&E<S.children.length;){const b=S.children[E];if(k=c(b,E,C)(),k[0]===_g)return k;E=typeof k[1]=="number"?k[1]:E+u}}return w}}}function TT(e){return Array.isArray(e)?e:typeof e=="number"?[jT,e]:e==null?C0:[e]}function b0(e,t,r,s){let o,a,u;typeof t=="function"&&typeof r!="function"?(a=void 0,u=t,o=r):(a=t,u=r,o=s),IT(e,a,c,o);function c(h,p){const m=p[p.length-1],g=m?m.children.indexOf(h):void 0;return u(h,g,m)}}const Pd={}.hasOwnProperty,PT={};function AT(e,t){const r=t||PT,s=new Map,o=new Map,a=new Map,u={...pT,...r.handlers},c={all:p,applyData:RT,definitionById:s,footnoteById:o,footnoteCounts:a,footnoteOrder:[],handlers:u,one:h,options:r,patch:MT,wrap:LT};return b0(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const g=m.type==="definition"?s:o,x=String(m.identifier).toUpperCase();g.has(x)||g.set(x,m)}}),c;function h(m,g){const x=m.type,w=c.handlers[x];if(Pd.call(c.handlers,x)&&w)return w(c,m,g);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in m){const{children:E,...C}=m,S=Ha(C);return S.children=c.all(m),S}return Ha(m)}return(c.options.unknownHandler||zT)(c,m,g)}function p(m){const g=[];if("children"in m){const x=m.children;let w=-1;for(;++w<x.length;){const k=c.one(x[w],m);if(k){if(w&&x[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Ig(k.value)),!Array.isArray(k)&&k.type==="element")){const E=k.children[0];E&&E.type==="text"&&(E.value=Ig(E.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function MT(e,t){e.position&&(t.position=g2(e))}function RT(e,t){let r=t;if(e&&e.data){const s=e.data.hName,o=e.data.hChildren,a=e.data.hProperties;if(typeof s=="string")if(r.type==="element")r.tagName=s;else{const u="children"in r?r.children:[r];r={type:"element",tagName:s,properties:{},children:u}}r.type==="element"&&a&&Object.assign(r.properties,Ha(a)),"children"in r&&r.children&&o!==null&&o!==void 0&&(r.children=o)}return r}function zT(e,t){const r=t.data||{},s="value"in t&&!(Pd.call(r,"hProperties")||Pd.call(r,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function LT(e,t){const r=[];let s=-1;for(t&&r.push({type:"text",value:`
|
|
75
|
-
`});++s<e.length;)s&&r.push({type:"text",value:`
|
|
76
|
-
`}),r.push(e[s]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
77
|
-
`}),r}function Ig(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}function Tg(e,t){const r=AT(e,t),s=r.one(e,void 0),o=ST(r),a=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return o&&a.children.push({type:"text",value:`
|
|
78
|
-
`},o),a}function DT(e,t){return e&&"run"in e?async function(r,s){const o=Tg(r,{file:s,...t});await e.run(o,s)}:function(r,s){return Tg(r,{file:s,...e||t})}}function Pg(e){if(e)throw e}var td,Ag;function FT(){if(Ag)return td;Ag=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=function(p){return typeof Array.isArray=="function"?Array.isArray(p):t.call(p)==="[object Array]"},a=function(p){if(!p||t.call(p)!=="[object Object]")return!1;var m=e.call(p,"constructor"),g=p.constructor&&p.constructor.prototype&&e.call(p.constructor.prototype,"isPrototypeOf");if(p.constructor&&!m&&!g)return!1;var x;for(x in p);return typeof x>"u"||e.call(p,x)},u=function(p,m){r&&m.name==="__proto__"?r(p,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):p[m.name]=m.newValue},c=function(p,m){if(m==="__proto__")if(e.call(p,m)){if(s)return s(p,m).value}else return;return p[m]};return td=function h(){var p,m,g,x,w,k,E=arguments[0],C=1,S=arguments.length,b=!1;for(typeof E=="boolean"&&(b=E,E=arguments[1]||{},C=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});C<S;++C)if(p=arguments[C],p!=null)for(m in p)g=c(E,m),x=c(p,m),E!==x&&(b&&x&&(a(x)||(w=o(x)))?(w?(w=!1,k=g&&o(g)?g:[]):k=g&&a(g)?g:{},u(E,{name:m,newValue:h(b,k,x)})):typeof x<"u"&&u(E,{name:m,newValue:x}));return E},td}var OT=FT();const nd=tl(OT);function Ad(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 $T(){const e=[],t={run:r,use:s};return t;function r(...o){let a=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...o);function c(h,...p){const m=e[++a];let g=-1;if(h){u(h);return}for(;++g<o.length;)(p[g]===null||p[g]===void 0)&&(p[g]=o[g]);o=p,m?BT(m,c)(...p):u(null,...p)}}function s(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function BT(e,t){let r;return s;function s(...u){const c=e.length>u.length;let h;c&&u.push(o);try{h=e.apply(this,u)}catch(p){const m=p;if(c&&r)throw m;return o(m)}c||(h&&h.then&&typeof h.then=="function"?h.then(a,o):h instanceof Error?o(h):a(h))}function o(u,...c){r||(r=!0,t(u,...c))}function a(u){o(null,u)}}const dr={basename:HT,dirname:VT,extname:UT,join:WT,sep:"/"};function HT(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dl(e);let r=0,s=-1,o=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(a){r=o+1;break}}else s<0&&(a=!0,s=o+1);return s<0?"":e.slice(r,s)}if(t===e)return"";let u=-1,c=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(a){r=o+1;break}}else u<0&&(a=!0,u=o+1),c>-1&&(e.codePointAt(o)===t.codePointAt(c--)?c<0&&(s=o):(c=-1,s=u));return r===s?s=u:s<0&&(s=e.length),e.slice(r,s)}function VT(e){if(dl(e),e.length===0)return".";let t=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){t=r;break}}else s||(s=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function UT(e){dl(e);let t=e.length,r=-1,s=0,o=-1,a=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){s=t+1;break}continue}r<0&&(u=!0,r=t+1),c===46?o<0?o=t:a!==1&&(a=1):o>-1&&(a=-1)}return o<0||r<0||a===0||a===1&&o===r-1&&o===s+1?"":e.slice(o,r)}function WT(...e){let t=-1,r;for(;++t<e.length;)dl(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":YT(r)}function YT(e){dl(e);const t=e.codePointAt(0)===47;let r=XT(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function XT(e,t){let r="",s=0,o=-1,a=0,u=-1,c,h;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(o===u-1||a===1))if(o!==u-1&&a===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(h=r.lastIndexOf("/"),h!==r.length-1){h<0?(r="",s=0):(r=r.slice(0,h),s=r.length-1-r.lastIndexOf("/")),o=u,a=0;continue}}else if(r.length>0){r="",s=0,o=u,a=0;continue}}t&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(o+1,u):r=e.slice(o+1,u),s=u-o-1;o=u,a=0}else c===46&&a>-1?a++:a=-1}return r}function dl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const qT={cwd:GT};function GT(){return"/"}function Md(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function KT(e){if(typeof e=="string")e=new URL(e);else if(!Md(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 QT(e)}function QT(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const t=e.pathname;let r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){const s=t.codePointAt(r+2);if(s===70||s===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const rd=["history","path","basename","stem","extname","dirname"];class j0{constructor(t){let r;t?Md(t)?r={path:t}:typeof t=="string"||ZT(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":qT.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<rd.length;){const a=rd[s];a in r&&r[a]!==void 0&&r[a]!==null&&(this[a]=a==="history"?[...r[a]]:r[a])}let o;for(o in r)rd.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?dr.basename(this.path):void 0}set basename(t){sd(t,"basename"),id(t,"basename"),this.path=dr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?dr.dirname(this.path):void 0}set dirname(t){Mg(this.basename,"dirname"),this.path=dr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?dr.extname(this.path):void 0}set extname(t){if(id(t,"extname"),Mg(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=dr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Md(t)&&(t=KT(t)),sd(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?dr.basename(this.path,this.extname):void 0}set stem(t){sd(t,"stem"),id(t,"stem"),this.path=dr.join(this.dirname||"",t+(this.extname||""))}fail(t,r,s){const o=this.message(t,r,s);throw o.fatal=!0,o}info(t,r,s){const o=this.message(t,r,s);return o.fatal=void 0,o}message(t,r,s){const o=new qt(t,r,s);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function id(e,t){if(e&&e.includes(dr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+dr.sep+"`")}function sd(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Mg(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function ZT(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const JT=(function(e){const s=this.constructor.prototype,o=s[e],a=function(){return o.apply(a,arguments)};return Object.setPrototypeOf(a,s),a}),eP={}.hasOwnProperty;class pf extends JT{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=$T()}copy(){const t=new pf;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];t.use(...s)}return t.data(nd(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(ad("data",this.frozen),this.namespace[t]=r,this):eP.call(this.namespace,t)&&this.namespace[t]||void 0:t?(ad("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[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const o=r.call(t,...s);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const r=ka(t),s=this.parser||this.Parser;return od("parse",s),s(String(r),r)}process(t,r){const s=this;return this.freeze(),od("process",this.parser||this.Parser),ld("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(a,u){const c=ka(t),h=s.parse(c);s.run(h,c,function(m,g,x){if(m||!g||!x)return p(m);const w=g,k=s.stringify(w,x);rP(k)?x.value=k:x.result=k,p(m,x)});function p(m,g){m||!g?u(m):a?a(g):r(void 0,g)}}}processSync(t){let r=!1,s;return this.freeze(),od("processSync",this.parser||this.Parser),ld("processSync",this.compiler||this.Compiler),this.process(t,o),zg("processSync","process",r),s;function o(a,u){r=!0,Pg(a),s=u}}run(t,r,s){Rg(t),this.freeze();const o=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?a(void 0,s):new Promise(a);function a(u,c){const h=ka(r);o.run(t,h,p);function p(m,g,x){const w=g||t;m?c(m):u?u(w):s(void 0,w,x)}}}runSync(t,r){let s=!1,o;return this.run(t,r,a),zg("runSync","run",s),o;function a(u,c){Pg(u),o=c,s=!0}}stringify(t,r){this.freeze();const s=ka(r),o=this.compiler||this.Compiler;return ld("stringify",o),Rg(t),o(t,s)}use(t,...r){const s=this.attachers,o=this.namespace;if(ad("use",this.frozen),t!=null)if(typeof t=="function")h(t,r);else if(typeof t=="object")Array.isArray(t)?c(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function a(p){if(typeof p=="function")h(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[m,...g]=p;h(m,g)}else u(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function u(p){if(!("plugins"in p)&&!("settings"in p))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");c(p.plugins),p.settings&&(o.settings=nd(!0,o.settings,p.settings))}function c(p){let m=-1;if(p!=null)if(Array.isArray(p))for(;++m<p.length;){const g=p[m];a(g)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function h(p,m){let g=-1,x=-1;for(;++g<s.length;)if(s[g][0]===p){x=g;break}if(x===-1)s.push([p,...m]);else if(m.length>0){let[w,...k]=m;const E=s[x][1];Ad(E)&&Ad(w)&&(w=nd(!0,E,w)),s[x]=[p,w,...k]}}}}const tP=new pf().freeze();function od(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function ld(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ad(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 Rg(e){if(!Ad(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function zg(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ka(e){return nP(e)?e:new j0(e)}function nP(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function rP(e){return typeof e=="string"||iP(e)}function iP(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sP="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Lg=[],Dg={allowDangerousHtml:!0},oP=/^(https?|ircs?|mailto|xmpp)$/i,lP=[{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:"className",id:"remove-classname"},{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 Fg(e){const t=aP(e),r=uP(e);return cP(t.runSync(t.parse(r),r),e)}function aP(e){const t=e.rehypePlugins||Lg,r=e.remarkPlugins||Lg,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Dg}:Dg;return tP().use(HI).use(r).use(DT,s).use(t)}function uP(e){const t=e.children||"",r=new j0;return typeof t=="string"&&(r.value=t),r}function cP(e,t){const r=t.allowedElements,s=t.allowElement,o=t.components,a=t.disallowedElements,u=t.skipHtml,c=t.unwrapDisallowed,h=t.urlTransform||dP;for(const m of lP)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+sP+m.id,void 0);return b0(e,p),S2(e,{Fragment:f.Fragment,components:o,ignoreInvalidStyle:!0,jsx:f.jsx,jsxs:f.jsxs,passKeys:!0,passNode:!0});function p(m,g,x){if(m.type==="raw"&&x&&typeof g=="number")return u?x.children.splice(g,1):x.children[g]={type:"text",value:m.value},g;if(m.type==="element"){let w;for(w in Zc)if(Object.hasOwn(Zc,w)&&Object.hasOwn(m.properties,w)){const k=m.properties[w],E=Zc[w];(E===null||E.includes(m.tagName))&&(m.properties[w]=h(String(k||""),w,m))}}if(m.type==="element"){let w=r?!r.includes(m.tagName):a?a.includes(m.tagName):!1;if(!w&&s&&typeof g=="number"&&(w=!s(m,g,x)),w&&x&&typeof g=="number")return c&&m.children?x.children.splice(g,1,...m.children):x.children.splice(g,1),g}}}function dP(e){const t=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||s!==-1&&t>s||oP.test(e.slice(0,t))?e:""}function fP({run:e,onClose:t}){var a,u;const[r,s]=M.useState(!1),o=e.status==="success"?"var(--accent-green, #2ecc71)":e.status==="error"?"var(--accent-red, #e74c3c)":e.status==="running"?"var(--accent-cyan, #00bcd4)":"var(--text-muted, #666)";return f.jsxs("div",{className:"session-run-detail",children:[f.jsxs("div",{className:"session-run-detail-header",children:[f.jsx("div",{className:"session-run-detail-status",style:{background:o}}),f.jsx("h3",{className:"session-run-detail-title",children:e.agent}),f.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),f.jsxs("div",{className:"session-run-detail-grid",children:[f.jsxs("div",{className:"session-run-detail-field",children:[f.jsx("span",{className:"session-run-detail-label",children:"Phase"}),f.jsx("span",{className:"session-run-detail-value",children:e.phase})]}),f.jsxs("div",{className:"session-run-detail-field",children:[f.jsx("span",{className:"session-run-detail-label",children:"Pass"}),f.jsx("span",{className:"session-run-detail-value",children:e.passId})]}),f.jsxs("div",{className:"session-run-detail-field",children:[f.jsx("span",{className:"session-run-detail-label",children:"Model"}),f.jsx("span",{className:"session-run-detail-value",children:e.model})]}),f.jsxs("div",{className:"session-run-detail-field",children:[f.jsx("span",{className:"session-run-detail-label",children:"Status"}),f.jsx("span",{className:"session-run-detail-value",style:{color:o},children:e.status})]}),f.jsxs("div",{className:"session-run-detail-field",children:[f.jsx("span",{className:"session-run-detail-label",children:"Duration"}),f.jsx("span",{className:"session-run-detail-value",children:e.elapsedSeconds!=null?`${e.elapsedSeconds.toFixed(1)}s`:"—"})]}),f.jsxs("div",{className:"session-run-detail-field",children:[f.jsx("span",{className:"session-run-detail-label",children:"Iteration"}),f.jsx("span",{className:"session-run-detail-value",children:e.iteration})]})]}),((a=e.artifacts)==null?void 0:a.output)&&f.jsxs("div",{className:"session-run-detail-section",children:[f.jsx("h4",{className:"session-run-detail-section-title",children:"Output"}),f.jsx("div",{className:"session-run-artifact",children:f.jsx("div",{className:"session-run-artifact-content",children:f.jsx(Fg,{children:e.artifacts.output})})})]}),((u=e.artifacts)==null?void 0:u.prompt)&&f.jsxs("div",{className:"session-run-detail-section",children:[f.jsxs("button",{className:"session-run-artifact-toggle",onClick:()=>s(!r),children:[f.jsx("span",{children:r?"▾":"▸"}),f.jsx("span",{children:"System Prompt"})]}),r&&f.jsx("div",{className:"session-run-artifact",children:f.jsx("div",{className:"session-run-artifact-content",children:f.jsx(Fg,{children:e.artifacts.prompt})})})]}),e.tokens&&f.jsxs("div",{className:"session-run-detail-section",children:[f.jsx("h4",{className:"session-run-detail-section-title",children:"Tokens"}),f.jsxs("div",{className:"session-run-detail-tokens",children:[f.jsxs("div",{className:"session-run-detail-token-bar",children:[f.jsx("span",{className:"session-run-detail-token-label",children:"Input"}),f.jsx("div",{className:"session-run-detail-token-fill",style:{width:`${Math.min(100,e.tokens.input/Math.max(e.tokens.input+e.tokens.output,1)*100)}%`,background:"var(--accent-cyan, #00bcd4)"}}),f.jsx("span",{className:"session-run-detail-token-count",children:e.tokens.input.toLocaleString()})]}),f.jsxs("div",{className:"session-run-detail-token-bar",children:[f.jsx("span",{className:"session-run-detail-token-label",children:"Output"}),f.jsx("div",{className:"session-run-detail-token-fill",style:{width:`${Math.min(100,e.tokens.output/Math.max(e.tokens.input+e.tokens.output,1)*100)}%`,background:"var(--accent-green, #2ecc71)"}}),f.jsx("span",{className:"session-run-detail-token-count",children:e.tokens.output.toLocaleString()})]})]})]}),e.cost&&f.jsxs("div",{className:"session-run-detail-section",children:[f.jsx("h4",{className:"session-run-detail-section-title",children:"Cost"}),f.jsxs("span",{className:"session-run-detail-cost",children:["$",e.cost.total.toFixed(4)]})]}),e.toolCalls&&e.toolCalls.length>0&&f.jsxs("div",{className:"session-run-detail-section",children:[f.jsxs("h4",{className:"session-run-detail-section-title",children:["Tool Calls (",e.toolCalls.length,")"]}),f.jsx("div",{className:"session-run-detail-tools",children:e.toolCalls.map((c,h)=>f.jsxs("div",{className:"session-run-detail-tool",children:[f.jsx("span",{className:`session-run-detail-tool-status ${c.success?"success":"error"}`,children:c.success?"✓":"✗"}),f.jsx("span",{className:"session-run-detail-tool-name",children:c.name}),f.jsxs("span",{className:"session-run-detail-tool-duration",children:[c.durationMs,"ms"]})]},h))})]}),e.error&&f.jsxs("div",{className:"session-run-detail-section",children:[f.jsx("h4",{className:"session-run-detail-section-title session-run-detail-error-title",children:"Error"}),f.jsx("pre",{className:"session-run-detail-error",children:e.error})]}),f.jsxs("div",{className:"session-run-detail-timestamps",children:[f.jsxs("span",{children:["Started: ",new Date(e.startedAt).toLocaleTimeString()]}),e.completedAt&&f.jsxs("span",{children:["Completed: ",new Date(e.completedAt).toLocaleTimeString()]})]})]})}const hP=50,Og={user:"User",assistant:"Response",thinking:"Thinking",tool_use:"Tool Use",tool_result:"Tool Result",system:"System"};function pP({events:e,runs:t}){const[r,s]=M.useState("all"),[o,a]=M.useState(new Set(["user","assistant","tool_use","tool_result","system"])),[u,c]=M.useState(1),[h,p]=M.useState(new Set),m=M.useMemo(()=>{const b=[{id:"all",label:"All agents"}];for(const N of t){const I=N.agentType==="orchestrator"?void 0:N.passId.replace("agent-","");b.push({id:I||"orchestrator",label:N.agent})}return b},[t]),g=M.useMemo(()=>e.filter(b=>o.has(b.type)?r==="all"?!0:r==="orchestrator"?!b.agentId:b.agentId===r:!1),[e,r,o]),x=g.slice(0,u*hP),w=x.length<g.length,k=b=>{a(N=>{const I=new Set(N);return I.has(b)?I.delete(b):I.add(b),I}),c(1)},E=b=>{p(N=>{const I=new Set(N);return I.has(b)?I.delete(b):I.add(b),I})},C=b=>{if(!b)return"";try{return new Date(b).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return b}},S=b=>{if(!b)return"transcript-badge-orchestrator";const N=t.find(B=>B.passId===`agent-${b}`);return`transcript-badge-${(N==null?void 0:N.agentType)||"general"}`};return f.jsxs("div",{className:"session-transcript",children:[f.jsxs("div",{className:"session-transcript-filters",children:[f.jsx("select",{className:"session-transcript-agent-select",value:r,onChange:b=>{s(b.target.value),c(1)},children:m.map(b=>f.jsx("option",{value:b.id,children:b.label},b.id))}),f.jsx("div",{className:"session-transcript-type-toggles",children:Object.entries(Og).map(([b,N])=>f.jsx("button",{className:`session-transcript-type-btn session-transcript-type-${b} ${o.has(b)?"active":""}`,onClick:()=>k(b),children:N},b))})]}),f.jsxs("div",{className:"session-transcript-count",children:[g.length," events",r!=="all"?" (filtered)":""]}),f.jsx("div",{className:"session-transcript-events",children:x.map((b,N)=>{const I=h.has(N),B=b.type==="thinking"||b.type==="tool_use"||b.type==="tool_result";return f.jsxs("div",{className:`session-transcript-event session-transcript-event-${b.type}`,onClick:B?()=>E(N):void 0,children:[f.jsxs("div",{className:"session-transcript-event-meta",children:[f.jsx("span",{className:"session-transcript-time",children:C(b.timestamp)}),b.agentId?f.jsx("span",{className:`session-transcript-badge ${S(b.agentId)}`,children:b.agentSlug||b.agentId}):f.jsx("span",{className:"session-transcript-badge transcript-badge-orchestrator",children:"orchestrator"}),f.jsx("span",{className:`session-transcript-type-label session-transcript-type-${b.type}`,children:Og[b.type]||b.type}),b.toolName&&f.jsx("span",{className:"session-transcript-tool-badge",children:b.toolName}),B&&f.jsx("span",{className:"session-transcript-expand",children:I?"▼":"▶"})]}),b.type==="user"&&b.text&&f.jsx("div",{className:"session-transcript-text",children:b.text}),b.type==="assistant"&&b.text&&f.jsx("div",{className:"session-transcript-text",children:b.text}),b.type==="thinking"&&f.jsx("div",{className:`session-transcript-text session-transcript-collapsible ${I?"":"collapsed"}`,children:b.text}),b.type==="tool_use"&&f.jsx("div",{className:`session-transcript-text session-transcript-collapsible ${I?"":"collapsed"}`,children:b.toolInput}),b.type==="tool_result"&&f.jsxs("div",{className:`session-transcript-text session-transcript-collapsible ${I?"":"collapsed"}`,children:[f.jsx("span",{className:b.toolSuccess===!1?"session-transcript-error":"session-transcript-success",children:b.toolSuccess===!1?"ERROR: ":""}),b.toolResult]}),b.type==="system"&&b.text&&f.jsx("div",{className:"session-transcript-text session-transcript-system-text",children:b.text})]},N)})}),w&&f.jsxs("button",{className:"session-transcript-load-more",onClick:()=>c(b=>b+1),children:["Load more (",g.length-x.length," remaining)"]})]})}function mP({files:e,onClose:t}){const r=M.useMemo(()=>{const o=new Set;return e.filter(a=>o.has(a.path)?!1:(o.add(a.path),!0))},[e]),s=o=>{try{return new Date(o).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return o}};return f.jsxs("div",{className:"session-payload",children:[f.jsxs("div",{className:"session-payload-header",children:[f.jsxs("span",{children:["Files sent to cloud (",e.length," reads, ",r.length," unique)"]}),f.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]}),f.jsx("div",{className:"session-payload-table",children:f.jsxs("table",{children:[f.jsx("thead",{children:f.jsxs("tr",{children:[f.jsx("th",{children:"Path"}),f.jsx("th",{children:"Time"}),f.jsx("th",{children:"Agent"})]})}),f.jsx("tbody",{children:e.map((o,a)=>f.jsxs("tr",{children:[f.jsx("td",{className:"session-payload-path",title:o.path,children:o.path.length>60?"..."+o.path.slice(-57):o.path}),f.jsx("td",{className:"session-payload-time",children:s(o.timestamp)}),f.jsx("td",{className:"session-payload-agent",children:o.agentId||"orchestrator"})]},a))})]})})]})}const $g="";function gP({visible:e,onClose:t}){const[r,s]=M.useState(null),[o,a]=M.useState(null),[u,c]=M.useState(null),[h,p]=M.useState(null),[m,g]=M.useState("transcript"),[x,w]=M.useState(!1),[k,E]=M.useState("all"),[C,S]=M.useState(!1),[b,N]=M.useState(!1),I=M.useRef(null),B=M.useCallback(async()=>{try{const P=await fetch(`${$g}/api/sessions`);if(P.ok){const O=await P.json();s(O),!o&&O.sessions.length>0&&a(O.sessions[0].sessionId)}}catch{}},[o]),T=M.useCallback(async P=>{S(!0),p(null),w(!1);try{const O=await fetch(`${$g}/api/sessions/${encodeURIComponent(P)}`);if(O.ok){const F=await O.json();c(F);const K=F.transcript&&F.transcript.length>0,R=F.runs&&F.runs.length>0;I.current?(g(I.current),I.current=null):F.source==="claude-transcript"&&K?g("transcript"):R&&g("runs")}}catch{}finally{S(!1)}},[]);if(M.useEffect(()=>{e&&B()},[e,B]),M.useEffect(()=>{o&&T(o)},[o,T]),M.useEffect(()=>(window.__sessionsRefresh=B,()=>{delete window.__sessionsRefresh}),[B]),!e)return null;const $=P=>new Date(P).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),Q=P=>{switch(P){case"success":return"✓";case"error":return"✗";case"running":return"○";case"partial":return"◑";default:return"—"}},U=P=>{switch(P){case"implementation":return"🛠";case"exploration":return"🔍";case"conversation":return"💬";default:return""}},q=(r==null?void 0:r.sessions.filter(P=>k==="all"||P.category===k||!P.category&&k==="other"))??[],L=((r==null?void 0:r.sessions)??[]).reduce((P,O)=>{const F=O.category||"other";return P[F]=(P[F]||0)+1,P},{}),W=(u==null?void 0:u.transcript)&&u.transcript.length>0,J=(u==null?void 0:u.runs)&&u.runs.length>0;return f.jsxs(yi,{className:`sessions-panel${b?" sessions-panel-expanded":""}`,children:[f.jsxs("div",{className:"sessions-header","data-drag-handle":!0,children:[f.jsx("span",{className:"sessions-title",children:"Sessions"}),f.jsxs("div",{className:"sessions-header-actions",children:[f.jsx("button",{className:"sessions-expand-btn",onClick:()=>N(!b),title:b?"Collapse":"Expand",children:b?"➖":"➕"}),f.jsx("button",{className:"panel-close-btn",onClick:t,children:"x"})]})]}),f.jsxs("div",{className:"sessions-tabs",children:[f.jsx("button",{className:`sessions-tab ${m==="transcript"?"active":""}`,onClick:()=>g("transcript"),disabled:!W&&!C,children:"Transcript"}),f.jsx("button",{className:`sessions-tab ${m==="runs"?"active":""}`,onClick:()=>g("runs"),disabled:!J&&!C,children:"Runs"})]}),f.jsxs("div",{className:"sessions-category-filter",children:[f.jsxs("button",{className:`sessions-category-btn ${k==="all"?"active":""}`,onClick:()=>E("all"),children:["All (",(r==null?void 0:r.sessions.length)??0,")"]}),L.implementation&&f.jsxs("button",{className:`sessions-category-btn sessions-cat-implementation ${k==="implementation"?"active":""}`,onClick:()=>E("implementation"),children:["🛠"," Build (",L.implementation,")"]}),L.exploration&&f.jsxs("button",{className:`sessions-category-btn sessions-cat-exploration ${k==="exploration"?"active":""}`,onClick:()=>E("exploration"),children:["🔍"," Explore (",L.exploration,")"]}),L.conversation&&f.jsxs("button",{className:`sessions-category-btn sessions-cat-conversation ${k==="conversation"?"active":""}`,onClick:()=>E("conversation"),children:["💬"," Chat (",L.conversation,")"]}),L.other&&f.jsxs("button",{className:`sessions-category-btn ${k==="other"?"active":""}`,onClick:()=>E("other"),children:["Other (",L.other,")"]})]}),f.jsx("div",{className:"sessions-selector",children:f.jsx("select",{className:"sessions-select",value:o??"",onChange:P=>a(P.target.value||null),children:q.length===0?f.jsx("option",{value:"",children:"No sessions found"}):q.map(P=>f.jsxs("option",{value:P.sessionId,children:[Q(P.status)," ",U(P.category)," ",$(P.startedAt),P.label?` — ${P.label}`:` — ${P.runCount} runs`," (",P.source,")"]},P.sessionId))})}),u&&!C&&f.jsxs("div",{className:"sessions-summary",children:[f.jsxs("div",{className:"sessions-summary-item",children:[f.jsx("span",{className:"sessions-summary-value",children:u.summary.totalRuns}),f.jsx("span",{className:"sessions-summary-label",children:"runs"})]}),f.jsxs("div",{className:"sessions-summary-item",children:[f.jsxs("span",{className:"sessions-summary-value",children:[u.summary.totalElapsedSeconds.toFixed(1),"s"]}),f.jsx("span",{className:"sessions-summary-label",children:"elapsed"})]}),f.jsxs("div",{className:"sessions-summary-item",children:[f.jsxs("span",{className:"sessions-summary-value",children:[((u.summary.totalTokens.input+u.summary.totalTokens.output)/1e3).toFixed(1),"k"]}),f.jsx("span",{className:"sessions-summary-label",children:"tokens"})]}),u.cloudStats&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"sessions-summary-item",children:[f.jsxs("span",{className:"sessions-summary-value sessions-summary-cost",children:["$",u.cloudStats.estimatedCost.total.toFixed(2)]}),f.jsx("span",{className:"sessions-summary-label",children:"cost"})]}),f.jsxs("div",{className:"sessions-summary-item",children:[f.jsx("span",{className:"sessions-summary-value",children:u.cloudStats.apiCalls}),f.jsx("span",{className:"sessions-summary-label",children:"api calls"})]}),u.payload&&u.payload.length>0&&f.jsx("div",{className:"sessions-summary-item",children:f.jsxs("button",{className:"sessions-payload-btn",onClick:()=>w(!x),children:[u.payload.length," files sent"]})})]}),f.jsx("div",{className:`sessions-status sessions-status-${u.status}`,children:u.status})]}),x&&(u==null?void 0:u.payload)&&f.jsx(mP,{files:u.payload,onClose:()=>w(!1)}),m==="transcript"&&f.jsxs("div",{className:"sessions-content",children:[C&&f.jsx("div",{className:"sessions-loading",children:"Loading transcript..."}),!C&&W&&f.jsx(pP,{events:u.transcript,runs:u.runs}),!C&&!W&&f.jsx("div",{className:"sessions-empty",children:"No transcript available for this session"})]}),m==="runs"&&f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"sessions-content",children:[C&&f.jsx("div",{className:"sessions-loading",children:"Loading session..."}),!C&&!u&&f.jsxs("div",{className:"sessions-empty",children:["Run ",f.jsx("code",{children:"archbyte analyze"})," to create your first session"]}),!C&&u&&f.jsx(Yj,{session:u,onSelectRun:p,selectedRunId:h==null?void 0:h.runId})]}),h&&f.jsx(fP,{run:h,onClose:()=>p(null)})]})]})}function Rs(e,t){return!e||e.length===0?!0:e.includes(t)}const yP=1500,xP={architecture:Yx};function vP(e,t){const u=["presentation","application","data","external","deployment"],c={};e.forEach(m=>{const g=m.layer||"application";c[g]||(c[g]=[]),c[g].push(m)});const h=new Map;let p=100;return u.forEach(m=>{const g=c[m]||[];g.forEach((x,w)=>{h.set(x.id,{x:100+w*250,y:p})}),g.length>0&&(p+=180)}),Object.entries(c).forEach(([m,g])=>{u.includes(m)||(g.forEach((x,w)=>{h.set(x.id,{x:100+w*250,y:p})}),p+=180)}),e.map(m=>{const g=m.userPositioned?{x:m.x,y:m.y}:h.get(m.id)||{x:100,y:100};return{id:m.id,type:"architecture",position:g,data:{label:m.label,layer:m.layer,nodeType:m.type,width:m.width,height:m.height,path:m.path,techStack:m.techStack,description:m.description},style:{width:m.width,zIndex:1}}})}function Bg(e,t="#64748b"){return e.map(r=>({id:r.id,source:r.source,target:r.target,label:void 0,labelStyle:void 0,labelBgStyle:void 0,labelBgPadding:[4,3],style:{stroke:r.color||t,strokeWidth:2,...r.style==="dashed"&&{strokeDasharray:"8 4"}},animated:r.animated||!1,type:"smoothstep",markerEnd:{type:Ko.ArrowClosed,width:16,height:16,color:r.color||t}}))}function zs({title:e,defaultOpen:t,children:r}){const[s,o]=M.useState(t??!1);return f.jsxs("div",{className:`dd-section ${s?"open":""}`,children:[f.jsxs("button",{className:"dd-section-header",onClick:()=>o(!s),children:[f.jsx("span",{className:"dd-section-chevron",children:s?"▾":"▸"}),f.jsx("span",{className:"dd-section-title",children:e})]}),s&&f.jsx("div",{className:"dd-section-content",children:r})]})}function _0(e,t,r=0){return e.slice(0,50).map((s,o)=>{const a=s.path.replace(t+"/","").split("/").pop()||s.path,u=r*12;return s.type==="directory"?f.jsxs("div",{children:[f.jsxs("div",{className:"dd-tree-entry dir",style:{paddingLeft:u},children:[f.jsx("span",{className:"dd-tree-icon",children:"📁"})," ",a,"/"]}),s.children&&_0(s.children,t,r+1)]},o):f.jsxs("div",{className:"dd-tree-entry file",style:{paddingLeft:u},children:[f.jsx("span",{className:"dd-tree-icon",children:"📄"})," ",a]},o)})}function wP(){var Vn;const[e,t,r]=BC([]),[s,o,a]=HC([]),[u,c]=M.useState(null),[h,p]=M.useState(!1),[m,g]=M.useState(null),[x]=M.useState([]),[w,k]=M.useState(!0),[E,C]=M.useState(null),[S,b]=M.useState({loggedIn:!1,email:null,tier:"free",features:{analyze:!0,validate:!0,workflows:!1,chat:!1,premiumAgents:!1}}),[N,I]=M.useState(!1),[B,T]=M.useState(null),[$,Q]=M.useState(!1),[U,q]=M.useState(null),[L,W]=M.useState(!1),[J,P]=M.useState(null),[,O]=M.useState(null),[F,K]=M.useState(null),[R,V]=M.useState(null),[j,z]=M.useState(-1),[Y,A]=M.useState(!1),[le,fe]=M.useState(new Set),[ce,ve]=M.useState(!1),[se,xe]=M.useState(new Set),[je,Pe]=M.useState(new Set),[Ee,Ce]=M.useState(null),[Ve,We]=M.useState("layer"),[Oe,tt]=M.useState(!1),[It,bt]=M.useState(!1),[gt,Tt]=M.useState(!1),[Ht,pn]=M.useState(!1),[mn,Jt]=M.useState(!1),[ie,me]=M.useState([]),[pe,$e]=M.useState(null),[Be,ht]=M.useState(!1),[gn,Pt]=M.useState(!1),[yt,_n]=M.useState("develop"),[,pt]=M.useState([]),[en,At]=M.useState(),[Or,$r]=M.useState(null),[Vt,tr]=M.useState(null),[Fn,yn]=M.useState(new Map),[Br,wi]=M.useState(!1),On=M.useRef([]),[vr,Ji]=M.useState([]),wr=50,[,Sr]=M.useState([]),[,$n]=M.useState([]),[Hr,Vr]=M.useState(new Set),[Dt,kr]=M.useState(new Set),[St,Gs]=M.useState(()=>{const H=localStorage.getItem("archbyte-theme");return H==="dark"||H==="light"?H:"light"});M.useEffect(()=>{document.documentElement.setAttribute("data-theme",St),localStorage.setItem("archbyte-theme",St)},[St]);const[xn]=M.useState(()=>!!window.__ARCHBYTE_DATA__),[es,Ft]=M.useState(!1),[Si,Bn]=M.useState(!1),[xt,ki]=M.useState(null),nr=St==="dark"?"#64748b":"#94a3b8",Ni="#fff",Ei=20,In=10,rr=M.useCallback(async()=>{const H=window.__ARCHBYTE_DATA__;if(H){Ur(H),b({loggedIn:!0,email:null,tier:"premium",features:{analyze:!0,validate:!0,workflows:!0,chat:!0,premiumAgents:!0}}),I(!0),p(!0),k(!1);return}try{await tn()}catch(Z){console.error("Failed to load architecture:",Z),C("Failed to connect to server"),Ot()}finally{k(!1)}},[]),st=async()=>{try{const H=await fetch("/api/tools-git");if(H.ok){const Z=await H.json();tr(Z)}}catch{}},Ks=async()=>{try{const H=await fetch("/api/config");if(H.ok){const Z=await H.json();if(O(Z),Z.environments){At(Z.environments);const re=Object.keys(Z.environments);re.length>0&&!re.includes(yt)&&_n(re[0])}}}catch{}},Ci=async()=>{try{const H=await fetch("/api/license");if(H.ok){const Z=await H.json();b(Z),I(!0)}}catch{I(!0)}},bi=async()=>{try{const H=await fetch("/api/project");if(H.ok){const Z=await H.json();Z&&K(Z)}}catch{}},Nr=async()=>{try{const H=await fetch("/api/analysis-status");if(H.ok){const Z=await H.json();(Z==null?void 0:Z.status)==="error"&&Z.error?q(Z.error):q(null)}}catch{}},Qs=async()=>{try{const H=await fetch("/api/changes/pending");if(H.ok){const Z=await H.json();Z.count>0&&P({count:Z.count,files:Z.files||[],componentChanges:Z.componentChanges||[],unmapped:Z.unmapped||[]})}}catch{}},ts=M.useCallback(async()=>{Lt("quick-scan");try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"static"})})}catch(H){console.error("Failed to start quick re-analysis:",H)}},[]),Er=M.useCallback(async()=>{Lt("re-analyze");try{await fetch("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:"llm"})})}catch(H){console.error("Failed to start full re-analysis:",H)}},[]),tn=async()=>{const H="/events",Z="/api/architecture";st(),Ks(),bi(),Ci(),Nr(),Qs();try{const re=new EventSource(H);return re.onopen=()=>{console.log("SSE connected"),p(!0),C(null)},re.onmessage=ae=>{try{const oe=JSON.parse(ae.data);if(console.log("SSE message:",oe.type),oe.architecture&&Ur(oe.architecture),oe.type==="git_update"&&oe.gitInfo&&pt(oe.gitInfo),oe.type==="premium_agent_result"&&oe.premiumResults&&me(oe.premiumResults),oe.type==="changes:detected"&&P({count:oe.count,files:oe.files||[],componentChanges:oe.componentChanges||[],unmapped:oe.unmapped||[]}),oe.type==="changes:cleared"&&P(null),oe.type==="analyzing:started"&&(W(!0),P(null)),oe.type==="session:update"){const we=window.__sessionsRefresh;we&&we()}oe.type==="analyzing:finished"&&(W(!1),oe.success===!1&&oe.error?q(oe.error):(q(null),bi(),Nr()))}catch(oe){console.error("Failed to parse SSE message:",oe)}},re.onerror=ae=>{console.error("SSE error:",ae),re.close(),p(!1),ns(Z)},()=>re.close()}catch{ns(Z)}},ns=async H=>{try{const Z=await fetch(H);if(Z.ok){const re=await Z.json();Ur(re),p(!0)}else Ot()}catch{Ot()}},Ot=()=>{const H={nodes:[{id:"frontend",type:"component",label:`Frontend
|
|
79
|
-
(Web App)`,layer:"presentation",x:150,y:170,width:200,height:100,color:"#d0ebff"},{id:"backend",type:"service",label:`Backend
|
|
80
|
-
(API)`,layer:"application",x:150,y:370,width:200,height:100,color:"#ffe8cc"},{id:"database",type:"database",label:"Database",layer:"data",x:150,y:570,width:200,height:80,color:"#b2f2bb"}],edges:[{id:"e1",source:"frontend",target:"backend",color:"#1971c2"},{id:"e2",source:"backend",target:"database",color:"#2f9e44"}],flows:[],lastUpdated:new Date().toISOString(),version:1};Ur(H)},Ur=H=>{c(H),g(H.lastUpdated),H.gitInfo&&pt(H.gitInfo),H.environments&&At(H.environments)};M.useEffect(()=>{if(!u)return;const H=u.nodes.filter(oe=>Rs(oe.environments,yt)&&!se.has(oe.id)&&!je.has(oe.layer)),Z=new Set(H.map(oe=>oe.id)),re=u.edges.filter(oe=>Rs(oe.environments,yt)&&Z.has(oe.source)&&Z.has(oe.target)),ae=vP(H);t(ae),o(Bg(re,nr))},[u,yt,se,je,nr]),M.useEffect(()=>{var Z;if(!((Z=J==null?void 0:J.componentChanges)!=null&&Z.length))return;const H=new Map;for(const re of J.componentChanges)H.set(re.componentId,re.files);t(re=>re.map(ae=>{const oe=H.get(ae.id);return oe?{...ae,data:{...ae.data,pendingFiles:oe}}:ae.data.pendingFiles?{...ae,data:{...ae.data,pendingFiles:null}}:ae}))},[J,t]),M.useEffect(()=>{rr()},[rr]),M.useEffect(()=>{if(!Y||!R)return;const H=setInterval(()=>{z(Z=>{const re=Z+1;if(re>=R.steps.length)return fe(new Set([R.steps[0].edge])),0;const ae=new Set;for(let oe=0;oe<=re;oe++)ae.add(R.steps[oe].edge);return fe(ae),re})},yP);return()=>clearInterval(H)},[Y,R]),M.useEffect(()=>{if(!u)return;const H=u.nodes.filter(we=>Rs(we.environments,yt)),Z=new Set(H.map(we=>we.id)),re=u.edges.filter(we=>Rs(we.environments,yt)&&Z.has(we.source)&&Z.has(we.target)),ae=new Map;R&&R.steps.forEach((we,Ae)=>{ae.has(we.edge)||ae.set(we.edge,Ae+1)});const oe=re.map(we=>{const Ae=le.has(we.id),_e=R==null?void 0:R.steps.some(Ye=>Ye.edge===we.id),Me=ae.get(we.id);return{id:we.id,source:we.source,target:we.target,label:Ae&&Me?`${Me}`:void 0,labelStyle:Ae&&Me?{fill:Ni,fontWeight:700,fontSize:12,fontFamily:"'JetBrains Mono', monospace",transform:"translateY(-22px)"}:void 0,labelBgStyle:Ae&&Me?{fill:(R==null?void 0:R.color)||"#3b82f6",fillOpacity:.95,rx:10,ry:10,transform:"translateY(-22px)"}:void 0,labelBgPadding:[6,4],style:{stroke:Ae?(R==null?void 0:R.color)||we.color:we.color||nr,strokeWidth:Ae?6:3,opacity:R?_e?1:.15:1,filter:Ae?"brightness(0.85) saturate(1.4)":void 0},animated:Ae,type:"smoothstep"}});o(oe)},[le,R,u,yt,nr,Ni]);const rs=H=>{Lt("flow-select",H.name),V(H),z(0),fe(new Set([H.steps[0].edge])),A(!0),ve(!0)},ir=()=>{if(A(!1),V(null),z(-1),fe(new Set),ve(!1),u){const H=u.nodes.filter(ae=>Rs(ae.environments,yt)),Z=new Set(H.map(ae=>ae.id)),re=u.edges.filter(ae=>Rs(ae.environments,yt)&&Z.has(ae.source)&&Z.has(ae.target));o(Bg(re,nr))}},Wr=()=>{A(!1)},Yr=()=>{R&&A(!0)},Gt=M.useRef(se);M.useEffect(()=>{Gt.current=se},[se]);const et=M.useCallback(()=>{Sr(H=>{const Z={nodes:[...On.current],edges:[...s],hiddenNodeIds:new Set(Gt.current)},re=[...H,Z];return re.length>wr&&re.shift(),re}),$n([])},[s]),Xr=M.useCallback(H=>{$r(H),setTimeout(()=>$r(null),3e3)},[]),Zs=M.useCallback(()=>{xe(new Set)},[]);M.useCallback(H=>{Pe(Z=>{const re=new Set(Z);return re.has(H)?re.delete(H):re.add(H),re})},[]);const ji=M.useCallback((H,Z)=>{if(!u)return;const re=u.nodes.find(ae=>ae.id===Z.id);re&&(Lt("node-click",`${re.id} (${re.label})`),ki(re),Bn(!0))},[u]),qr=M.useCallback(()=>{Lt("pane-click"),Ce(null)},[]);M.useEffect(()=>{On.current=e},[e]);const _i=M.useCallback(H=>{r(H);const Z=H.some(ae=>ae.type==="position"&&ae.dragging===!1&&ae.position),re=H.some(ae=>ae.type==="dimensions"&&ae.dimensions&&ae.resizing===!1);(Z||re)&&et(),H.forEach(ae=>{if(ae.type==="position"&&ae.dragging===!1&&ae.position){const oe=On.current.find(we=>we.id===ae.id);oe&&yn(we=>{var Me,Ye,Qe,vt;const Ae=new Map(we),_e=Ae.get(ae.id);return Ae.set(ae.id,{id:ae.id,x:ae.position.x,y:ae.position.y,width:(_e==null?void 0:_e.width)??((Me=oe.style)==null?void 0:Me.width)??((Ye=oe.data)==null?void 0:Ye.width)??100,height:(_e==null?void 0:_e.height)??((Qe=oe.style)==null?void 0:Qe.height)??((vt=oe.data)==null?void 0:vt.height)??60}),Ae})}if(ae.type==="dimensions"&&ae.dimensions&&ae.resizing===!1){const oe=On.current.find(we=>we.id===ae.id);oe&&yn(we=>{const Ae=new Map(we),_e=Ae.get(ae.id);return Ae.set(ae.id,{id:ae.id,x:(_e==null?void 0:_e.x)??oe.position.x,y:(_e==null?void 0:_e.y)??oe.position.y,width:ae.dimensions.width,height:ae.dimensions.height}),Ae})}})},[r,et]),Hn=M.useCallback(async()=>{if(Fn.size!==0){Lt("save-positions"),wi(!0);try{const H=Array.from(Fn.values()),Z=await fetch("/api/update-positions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:H})});if(Z.ok)yn(new Map),console.log("Changes saved successfully");else{const re=await Z.json();console.error("Failed to save changes:",re)}}catch(H){console.error("Error saving changes:",H)}finally{wi(!1)}}},[Fn]),is=M.useCallback(()=>{yn(new Map),rr()},[rr]),ss=M.useCallback(()=>{Sr(H=>{if(H.length===0)return H;const Z=[...H],re=Z.pop();if($n(ae=>[...ae,{nodes:[...On.current],edges:[...s],hiddenNodeIds:new Set(Gt.current)}]),t(re.nodes),o(re.edges),xe(re.hiddenNodeIds),u){const ae=new Map;re.nodes.forEach(oe=>{var Ae,_e,Me,Ye;const we=u.nodes.find(Qe=>Qe.id===oe.id);if(we){const Qe=oe.position.x,vt=oe.position.y,Xe=((Ae=oe.style)==null?void 0:Ae.width)??((_e=oe.data)==null?void 0:_e.width)??100,kt=((Me=oe.style)==null?void 0:Me.height)??((Ye=oe.data)==null?void 0:Ye.height)??60;(Qe!==we.x||vt!==we.y||Xe!==we.width||kt!==we.height)&&ae.set(oe.id,{id:oe.id,x:Qe,y:vt,width:Xe,height:kt})}}),yn(ae)}return Z})},[s,t,o,u]),Ke=M.useCallback(()=>{$n(H=>{if(H.length===0)return H;const Z=[...H],re=Z.pop();if(Sr(ae=>[...ae,{nodes:[...On.current],edges:[...s],hiddenNodeIds:new Set(Gt.current)}]),t(re.nodes),o(re.edges),xe(re.hiddenNodeIds),u){const ae=new Map;re.nodes.forEach(oe=>{var Ae,_e,Me,Ye;const we=u.nodes.find(Qe=>Qe.id===oe.id);if(we){const Qe=oe.position.x,vt=oe.position.y,Xe=((Ae=oe.style)==null?void 0:Ae.width)??((_e=oe.data)==null?void 0:_e.width)??100,kt=((Me=oe.style)==null?void 0:Me.height)??((Ye=oe.data)==null?void 0:Ye.height)??60;(Qe!==we.x||vt!==we.y||Xe!==we.width||kt!==we.height)&&ae.set(oe.id,{id:oe.id,x:Qe,y:vt,width:Xe,height:kt})}}),yn(ae)}return Z})},[s,t,o,u]),fl=M.useCallback(({nodes:H})=>{kr(new Set(H.map(Z=>Z.id))),H.length===1?Ce(H[0].id):H.length===0&&Ce(null)},[]),Js=M.useCallback(()=>{if(Dt.size===0&&!Ee)return;et();const H=Dt.size>0?Dt:new Set([Ee]);xe(Z=>new Set([...Z,...H])),kr(new Set),Ce(null)},[Dt,Ee,et]),os=M.useCallback(()=>{const H=Dt.size>0?Dt:Ee?new Set([Ee]):new Set;if(H.size===0)return;const Z=e.filter(re=>H.has(re.id));Ji(Z)},[e,Dt,Ee]),eo=M.useCallback(()=>{if(vr.length===0)return;et();const H=50,Z=vr.map((re,ae)=>{var oe;return{...re,id:`${re.id}-copy-${Date.now()}-${ae}`,position:{x:re.position.x+H,y:re.position.y+H},selected:!0,data:{...re.data,label:`${((oe=re.data)==null?void 0:oe.label)||re.id} (copy)`}}});t(re=>[...re.map(ae=>({...ae,selected:!1})),...Z]),Z.forEach(re=>{yn(ae=>{var we,Ae,_e,Me;const oe=new Map(ae);return oe.set(re.id,{id:re.id,x:re.position.x,y:re.position.y,width:((we=re.style)==null?void 0:we.width)||((Ae=re.data)==null?void 0:Ae.width)||100,height:((_e=re.style)==null?void 0:_e.height)||((Me=re.data)==null?void 0:Me.height)||60}),oe})})},[vr,t,et]),Gr=M.useCallback((H,Z)=>{const re=Dt.size>0?Dt:Ee?new Set([Ee]):new Set;re.size!==0&&(et(),t(ae=>ae.map(oe=>{if(re.has(oe.id)&&!Hr.has(oe.id)){const we={x:oe.position.x+H,y:oe.position.y+Z};return yn(Ae=>{var Me,Ye,Qe,vt;const _e=new Map(Ae);return _e.set(oe.id,{id:oe.id,x:we.x,y:we.y,width:((Me=oe.style)==null?void 0:Me.width)||((Ye=oe.data)==null?void 0:Ye.width)||100,height:((Qe=oe.style)==null?void 0:Qe.height)||((vt=oe.data)==null?void 0:vt.height)||60}),_e}),{...oe,position:we}}return oe})))},[Dt,Ee,Hr,t,et]),hl=M.useCallback(H=>{const Z={id:`edge-${H.source}-${H.target}-${Date.now()}`,source:H.source,target:H.target,type:"smoothstep",animated:!0,style:{stroke:St==="dark"?"#868e96":"#6b7280",strokeWidth:2}};o(re=>Fy(Z,re))},[o,St]),to=M.useCallback((H,Z)=>{et(),o(re=>sN(H,Z,re))},[o,et]),ls=M.useCallback(async()=>{Lt("export","png");const H=document.querySelector(".react-flow");if(H){Ft(!0);try{const Z=await oj(H,{backgroundColor:St==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)",quality:1,pixelRatio:2}),re=document.createElement("a");re.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.png`,re.href=Z,re.click()}catch(Z){console.error("Failed to export PNG:",Z)}finally{Ft(!1)}}},[St]),sr=M.useCallback(async()=>{Lt("export","svg");const H=document.querySelector(".react-flow");if(H){Ft(!0);try{const Z=await Wx(H,{backgroundColor:St==="dark"?"hsl(222, 47%, 5%)":"hsl(220, 20%, 97%)"}),re=document.createElement("a");re.download=`architecture-diagram-${new Date().toISOString().split("T")[0]}.svg`,re.href=Z,re.click()}catch(Z){console.error("Failed to export SVG:",Z)}finally{Ft(!1)}}},[St]),Kt=M.useCallback(async H=>{Lt("export",H),Ft(!0);try{const Z=await fetch(`/api/export?format=${H}`);if(!Z.ok)throw new Error("Export failed");const re=await Z.blob(),ae=H==="mermaid"?"mmd":H==="plantuml"?"puml":H==="markdown"?"md":H,oe=document.createElement("a");oe.download=`architecture.${ae}`,oe.href=URL.createObjectURL(re),oe.click(),URL.revokeObjectURL(oe.href)}catch(Z){console.error(`Failed to export ${H}:`,Z)}finally{Ft(!1)}},[]);M.useCallback(()=>{if(!u)return;et();const H=250,Z=100,re=100,ae=e.map((oe,we)=>({...oe,position:{x:Z+we*H,y:re}}));t(ae),We("horizontal")},[u,e,t,et]),M.useCallback(()=>{if(!u)return;et();const H=150,Z=100,re=100,ae=e.map((oe,we)=>({...oe,position:{x:Z,y:re+we*H}}));t(ae),We("vertical")},[u,e,t,et]),M.useCallback(()=>{if(!u)return;et();const H=280,Z=180,re=100,ae=100,oe=Math.ceil(Math.sqrt(e.length)),we=e.map((Ae,_e)=>({...Ae,position:{x:re+_e%oe*H,y:ae+Math.floor(_e/oe)*Z}}));t(we),We("grid")},[u,e,t,et]),M.useCallback(()=>{if(!u)return;et();const H=320,Z=160,re=100,ae=100,oe=new Set(e.map(Xe=>Xe.id)),we=new Map,Ae=new Map;oe.forEach(Xe=>{we.set(Xe,0),Ae.set(Xe,[])}),s.forEach(Xe=>{oe.has(Xe.source)&&oe.has(Xe.target)&&(Ae.get(Xe.source).push(Xe.target),we.set(Xe.target,(we.get(Xe.target)||0)+1))});const _e=new Map,Me=[];for(we.forEach((Xe,kt)=>{Xe===0&&(Me.push(kt),_e.set(kt,0))});Me.length>0;){const Xe=Me.shift(),kt=_e.get(Xe);for(const Tn of Ae.get(Xe)||[]){const br=kt+1;(!_e.has(Tn)||_e.get(Tn)<br)&&_e.set(Tn,br),we.set(Tn,we.get(Tn)-1),we.get(Tn)===0&&Me.push(Tn)}}e.forEach(Xe=>{_e.has(Xe.id)||_e.set(Xe.id,0)});const Ye=new Map;e.forEach(Xe=>{const kt=_e.get(Xe.id);Ye.has(kt)||Ye.set(kt,[]),Ye.get(kt).push(Xe)});const Qe=[];[...Ye.keys()].sort((Xe,kt)=>Xe-kt).forEach((Xe,kt)=>{Ye.get(Xe).forEach((br,no)=>{Qe.push({...br,position:{x:re+kt*H,y:ae+no*Z}})})}),t(Qe),We("flow")},[u,e,s,t,et]),M.useCallback(()=>{if(!u)return;et();const H=250,Z=180,re=100,ae=100,oe={};e.forEach(Me=>{var Qe;const Ye=((Qe=Me.data)==null?void 0:Qe.layer)||"application";oe[Ye]||(oe[Ye]=[]),oe[Ye].push(Me)});const we=["presentation","application","data","external","deployment"];let Ae=ae;const _e=[];we.forEach(Me=>{const Ye=oe[Me]||[];Ye.forEach((Qe,vt)=>{_e.push({...Qe,position:{x:re+vt*H,y:Ae}})}),Ye.length>0&&(Ae+=Z)}),Object.entries(oe).forEach(([Me,Ye])=>{we.includes(Me)||(Ye.forEach((Qe,vt)=>{_e.push({...Qe,position:{x:re+vt*H,y:Ae}})}),Ae+=Z)}),t(_e),We("layer")},[u,e,t,et]);const or=M.useCallback(async H=>{Lt("deep-drill",H),ht(!0),Pt(!0),$e(null);try{const Z=await fetch(`/api/component/${encodeURIComponent(H)}/deep`);if(Z.ok){const re=await Z.json();$e(re)}}catch{}ht(!1)},[]),Ii=M.useCallback((H,Z)=>{if(!u)return;const re=u.nodes.find(ae=>ae.id===Z.id);re&&(ki(re),Bn(!0))},[u]);M.useEffect(()=>{const H=Z=>{if(Z.target instanceof HTMLInputElement||Z.target instanceof HTMLTextAreaElement)return;const ae=navigator.platform.toUpperCase().indexOf("MAC")>=0?Z.metaKey:Z.ctrlKey;if(Z.key==="Backspace"||Z.key==="Delete"){Z.preventDefault(),Js();return}if(ae&&Z.key==="c"){Z.preventDefault(),os();return}if(ae&&Z.key==="v"){Z.preventDefault(),eo();return}if(ae&&Z.shiftKey&&Z.key==="z"){Z.preventDefault(),Ke();return}if(ae&&Z.key==="z"){Z.preventDefault(),ss();return}if(ae&&Z.key==="s"){Z.preventDefault(),Hn();return}if(Z.key==="Escape"){Bn(!1),Pt(!1),ir();return}if(Z.key==="ArrowUp"){Z.preventDefault(),Gr(0,Z.shiftKey?-In*5:-In);return}if(Z.key==="ArrowDown"){Z.preventDefault(),Gr(0,Z.shiftKey?In*5:In);return}if(Z.key==="ArrowLeft"){Z.preventDefault(),Gr(Z.shiftKey?-In*5:-In,0);return}if(Z.key==="ArrowRight"){Z.preventDefault(),Gr(Z.shiftKey?In*5:In,0);return}};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[Js,os,eo,Hn,Gr,ss,Ke]);const Cr=M.useMemo(()=>u?u.nodes.filter(H=>se.has(H.id)):[],[u,se]);return M.useEffect(()=>{u&&t(H=>H.map(Z=>({...Z,data:{...Z.data,highlighted:Z.id===Or}})))},[Or,u]),w?f.jsx("div",{className:"app",children:f.jsxs("div",{className:"loading",children:[f.jsx("div",{className:"loading-spinner"}),"Loading architecture..."]})}):f.jsxs("div",{className:"app",children:[f.jsxs("div",{className:"branding-header",children:[f.jsxs("div",{className:"archbyte-brand",children:[f.jsx("span",{className:"archbyte-name",children:"ArchByte"}),F?f.jsx(Ej,{projectInfo:F}):f.jsx("span",{className:"archbyte-tagline",children:"See what agents build. As they build it."})]}),S.loggedIn&&f.jsx("div",{className:"branding-account",children:S.email&&f.jsxs("span",{className:"account-email",children:[S.email,S.tier==="premium"&&f.jsx("span",{className:"account-pro-tag",children:"PRO"})]})})]}),f.jsxs("div",{className:"toolbar",children:[f.jsxs("div",{className:"toolbar-left",children:[f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"Analyze"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsxs(Zm,{trigger:R?f.jsxs(f.Fragment,{children:[f.jsx("span",{className:"flow-dot-inline",style:{background:R.color}}),R.name]}):f.jsx(f.Fragment,{children:"▶ Flows ▾"}),triggerClassName:`toolbar-btn ${R?"has-active-flow":""}`,children:[R&&f.jsxs(f.Fragment,{children:[f.jsx("button",{className:"dropdown-item flow-clear",onClick:ir,children:"⏹ Clear active flow"}),f.jsx("div",{className:"dropdown-separator"})]}),u!=null&&u.flows&&u.flows.length>0?(()=>{const H=["user-journey","data-pipeline","system","deployment","error-recovery"],Z={"user-journey":"User Journey","data-pipeline":"Data Pipeline",system:"System",deployment:"Deployment","error-recovery":"Error / Recovery"},re={"user-journey":"#3b82f6","data-pipeline":"#22c55e",system:"#f59e0b",deployment:"#a855f7","error-recovery":"#ef4444"},ae={};for(const Ae of u.flows){const _e=Ae.category||"system";ae[_e]||(ae[_e]=[]),ae[_e].push(Ae)}const oe=[];for(const Ae of H){const _e=ae[Ae];if(_e!=null&&_e.length){oe.push(f.jsxs("div",{className:"flow-category-header",children:[f.jsx("span",{className:"flow-dot-inline",style:{background:re[Ae]}}),Z[Ae]||Ae]},`cat-${Ae}`));for(const Me of _e)oe.push(f.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(R==null?void 0:R.id)===Me.id?"active":""}`,onClick:()=>{(R==null?void 0:R.id)===Me.id?ir():rs(Me)},children:[f.jsx("span",{className:"flow-dot-inline",style:{background:Me.color}}),f.jsx("span",{className:"flow-dropdown-name",children:Me.name}),(R==null?void 0:R.id)===Me.id&&f.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Me.id))}}const we=new Set(H);for(const[Ae,_e]of Object.entries(ae))if(!we.has(Ae)&&_e!=null&&_e.length){oe.push(f.jsxs("div",{className:"flow-category-header",children:[f.jsx("span",{className:"flow-dot-inline",style:{background:"#6b7280"}}),Ae]},`cat-${Ae}`));for(const Me of _e)oe.push(f.jsxs("button",{className:`dropdown-item flow-dropdown-item ${(R==null?void 0:R.id)===Me.id?"active":""}`,onClick:()=>{(R==null?void 0:R.id)===Me.id?ir():rs(Me)},children:[f.jsx("span",{className:"flow-dot-inline",style:{background:Me.color}}),f.jsx("span",{className:"flow-dropdown-name",children:Me.name}),(R==null?void 0:R.id)===Me.id&&f.jsx("span",{className:"active-badge",children:"ACTIVE"})]},Me.id))}return oe})():f.jsx("span",{className:"dropdown-item disabled",children:"No flows defined"})]}),f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.audit?"":"premium-locked"} ${It?"active":""}`,onClick:()=>{if(!S.features.audit){T("Audit");return}Lt("audit-toggle",It?"close":"open"),bt(!It)},children:"Audit"})]})]}),!xn&&f.jsxs("div",{className:"toolbar-section",children:[f.jsx("span",{className:"toolbar-section-label",children:"Ops"}),f.jsxs("div",{className:"toolbar-section-items",children:[f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.workflows?"":"premium-locked"} ${gt?"active":""}`,title:S.features.workflows?"":"Available in Pro",onClick:()=>{if(!S.features.workflows){T("Workflows");return}Lt("workflows-toggle",gt?"close":"open"),Tt(!gt),Jt(!1)},children:"Workflows"}),f.jsx("button",{className:`toolbar-btn premium-btn ${S.features.premiumAgents?"":"premium-locked"} ${mn?"active":""}`,title:S.features.premiumAgents?"":"Available in Pro",onClick:()=>{if(!S.features.premiumAgents){T("Pro Agents");return}Lt("agents-toggle",mn?"close":"open"),mn?Jt(!1):(Jt(!0),Tt(!1))},children:"Agents"}),f.jsx("button",{className:`toolbar-btn ${Ht?"active":""}`,onClick:()=>{Lt("sessions-toggle",Ht?"close":"open"),pn(!Ht)},children:"Sessions"})]})]})]}),f.jsxs("div",{className:"toolbar-right",children:[L&&!xn&&f.jsxs("span",{className:"toolbar-analyzing",children:[f.jsx("span",{className:"analyzing-pulse"}),"Re-analyzing..."]}),U&&!xn&&f.jsx("button",{className:"toolbar-btn toolbar-error-btn",onClick:()=>q(null),title:U,children:"Analysis failed"}),f.jsx("button",{className:`toolbar-btn ${Oe?"active":""}`,onClick:()=>{Lt("stats-toggle",Oe?"close":"open"),tt(!Oe)},children:"Stats"}),f.jsxs(Zm,{trigger:es?"Exporting...":"↓ Export ▾",triggerClassName:"toolbar-btn",disabled:es,children:[f.jsx("div",{className:"dropdown-label",children:"Image"}),f.jsx("button",{className:"dropdown-item",onClick:ls,children:"PNG"}),f.jsx("button",{className:"dropdown-item",onClick:sr,children:"SVG"}),f.jsx("div",{className:"dropdown-separator"}),f.jsx("div",{className:"dropdown-label",children:"Diagram"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Kt("mermaid"),children:"Mermaid"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Kt("plantuml"),children:"PlantUML"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Kt("dot"),children:"DOT"}),f.jsx("div",{className:"dropdown-separator"}),f.jsx("div",{className:"dropdown-label",children:"Document"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Kt("markdown"),children:"Markdown"}),f.jsx("button",{className:"dropdown-item",onClick:()=>Kt("json"),children:"JSON"}),f.jsx("div",{className:"dropdown-separator"}),f.jsx("div",{className:"dropdown-label",children:"Interactive"}),f.jsx("button",{className:`dropdown-item ${S.tier!=="premium"?"premium-locked":""}`,onClick:()=>{if(S.tier!=="premium"){T("HTML Export");return}Kt("html")},children:"HTML"})]}),f.jsx("button",{className:"toolbar-btn-icon",onClick:()=>{const H=St==="dark"?"light":"dark";Lt("theme-toggle",H),Gs(H)},title:`Switch to ${St==="dark"?"light":"dark"} mode`,children:St==="dark"?"☀":"☽"})]})]}),J&&J.count>0&&!L&&!xn&&f.jsxs("div",{className:"changes-banner",children:[f.jsx("span",{className:"changes-banner-pulse"}),f.jsxs("span",{className:"changes-banner-text",children:[J.componentChanges.length>0?`${J.componentChanges.length} component${J.componentChanges.length!==1?"s":""} affected`:`${J.count} file${J.count!==1?"s":""} changed`,f.jsxs("span",{className:"changes-banner-file-count",children:["(",J.count," file",J.count!==1?"s":"",")"]})]}),J.componentChanges.length>0&&f.jsxs("div",{className:"changes-banner-components",children:[J.componentChanges.map(H=>{const Z=H.files.some(ae=>ae.event==="add"),re=H.files.some(ae=>ae.event==="unlink");return f.jsxs("button",{className:"changes-component-chip",onClick:()=>Xr(H.componentId),children:[Z&&f.jsx("span",{className:"changes-event-dot new"}),re&&f.jsx("span",{className:"changes-event-dot del"}),!Z&&!re&&f.jsx("span",{className:"changes-event-dot mod"}),H.componentName,f.jsx("span",{className:"changes-component-count",children:H.files.length})]},H.componentId)}),J.unmapped.length>0&&f.jsxs("span",{className:"changes-component-chip unmapped",title:J.unmapped.map(H=>`${H.event==="add"?"+":H.event==="unlink"?"-":"~"} ${H.path}`).join(`
|
|
81
|
-
`),children:["Other",f.jsx("span",{className:"changes-component-count",children:J.unmapped.length})]})]}),f.jsxs("div",{className:"changes-banner-actions",children:[f.jsx("button",{className:"changes-banner-btn quick",onClick:ts,title:"Fast re-scan using static analysis only (~2s)",children:"Quick Scan"}),f.jsx("button",{className:"changes-banner-btn full",onClick:Er,title:"Full re-scan using AI agents for deeper analysis",children:"Re-analyze"})]}),f.jsx("button",{className:"changes-banner-dismiss",onClick:()=>P(null),title:"Dismiss",children:"x"})]}),f.jsx(fj,{selectedEnvironment:yt,environments:en,onSelectEnvironment:_n}),f.jsxs("div",{className:"canvas-container",children:[f.jsx("div",{className:"watermark",children:"archbyte"}),f.jsxs(Tx,{nodes:e.map(H=>({...H,draggable:!Hr.has(H.id),data:{...H.data,locked:Hr.has(H.id)}})),edges:s.map(H=>{var Z;return{...H,style:{...H.style,opacity:1,strokeWidth:((Z=H.style)==null?void 0:Z.strokeWidth)||2}}}),onNodesChange:_i,onEdgesChange:a,onNodeClick:(H,Z)=>{ji(H,Z)},onNodeDoubleClick:Ii,onPaneClick:()=>{qr(),document.dispatchEvent(new Event("dropdown:closeall"))},onConnect:hl,onReconnect:to,edgesReconnectable:!0,onSelectionChange:fl,nodeTypes:xP,connectionMode:qi.Loose,snapToGrid:!0,snapGrid:[Ei,Ei],selectionOnDrag:!0,selectNodesOnDrag:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.1,maxZoom:2,attributionPosition:"bottom-left",deleteKeyCode:null,children:[f.jsx(Ax,{color:St==="dark"?"hsl(220 25% 15%)":"hsl(220 15% 82%)",gap:20,variant:mr.Dots}),f.jsx(Rx,{})]}),Si&&xt&&f.jsxs(yi,{className:"node-details-panel",children:[f.jsxs("div",{className:"node-details-header","data-drag-handle":!0,children:[f.jsxs("div",{children:[f.jsx("div",{className:"node-details-title",children:xt.label.split(`
|
|
82
|
-
`)[0]}),f.jsxs("div",{className:"node-details-type-row",children:[f.jsxs("span",{children:[xt.layer," • ",xt.type]}),xt.path&&f.jsx("button",{className:"panel-btn small green",onClick:()=>{or(xt.id),Bn(!1)},disabled:Be,children:Be?"...":"INSPECT"})]})]}),f.jsx("button",{className:"panel-close-btn",onClick:()=>Bn(!1),children:"×"})]}),xt.path&&f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Path"}),f.jsx("div",{className:"node-details-path",style:{userSelect:"text"},children:xt.path})]}),xt.techStack&&xt.techStack.length>0&&f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Tech Stack"}),f.jsx("div",{className:"node-details-tech-stack",children:xt.techStack.map((H,Z)=>f.jsx("span",{className:"tech-badge",children:H},Z))})]}),f.jsxs("div",{className:"node-details-section",children:[f.jsx("div",{className:"node-details-section-title",children:"Connections"}),f.jsxs("div",{className:"node-details-connections",children:[u==null?void 0:u.edges.filter(H=>H.source===xt.id||H.target===xt.id).map(H=>{const Z=H.source===xt.id,re=Z?H.target:H.source,ae=u==null?void 0:u.nodes.find(oe=>oe.id===re);return f.jsxs("div",{className:"connection-item-detailed",onClick:()=>Xr(re),style:{cursor:"pointer"},title:`Click to highlight ${(ae==null?void 0:ae.label.split(`
|
|
83
|
-
`)[0])||re}`,children:[f.jsxs("div",{className:"connection-header",children:[f.jsx("span",{className:"connection-arrow",children:Z?"→":"←"}),f.jsx("span",{className:"connection-target",children:(ae==null?void 0:ae.label.split(`
|
|
84
|
-
`)[0])||re})]}),H.label&&f.jsx("div",{className:"connection-label",children:H.label})]},H.id)}),(u==null?void 0:u.edges.filter(H=>H.source===xt.id||H.target===xt.id).length)===0&&f.jsx("span",{style:{color:"var(--text-muted)"},children:"No connections"})]})]}),(()=>{var Z;const H=(Z=J==null?void 0:J.componentChanges)==null?void 0:Z.find(re=>re.componentId===xt.id);return!H||H.files.length===0?null:f.jsxs("div",{className:"pending-sticky-note",children:[f.jsxs("div",{className:"pending-sticky-header",children:[H.files.length," file",H.files.length!==1?"s":""," changed"]}),H.files.slice(0,8).map((re,ae)=>f.jsxs("div",{className:`pending-file-row ${re.event}`,children:[f.jsx("span",{className:"pending-file-event",children:re.event==="add"?"+":re.event==="unlink"?"-":"~"}),f.jsx("span",{className:"pending-file-name",children:re.path.split("/").pop()})]},ae)),H.files.length>8&&f.jsxs("div",{className:"pending-file-more",children:["+",H.files.length-8," more"]})]})})()]}),gn&&f.jsxs(yi,{className:"deep-drill-panel",children:[f.jsxs("div",{className:"deep-drill-header","data-drag-handle":!0,children:[f.jsxs("div",{children:[f.jsx("div",{className:"deep-drill-title",children:(pe==null?void 0:pe.componentName)||"INSPECT"}),f.jsx("div",{className:"deep-drill-subtitle",children:(pe==null?void 0:pe.componentPath)||"Scanning..."})]}),f.jsx("button",{className:"panel-close-btn",onClick:()=>Pt(!1),children:"x"})]}),Be&&f.jsxs("div",{className:"deep-drill-loading",children:[f.jsx("div",{className:"loading-spinner"}),"Scanning component..."]}),pe&&!Be&&f.jsxs("div",{className:"deep-drill-body",children:[f.jsxs("div",{className:"deep-drill-meta",children:["Scanned in ",pe.durationMs,"ms"]}),f.jsxs(zs,{title:"Metrics",defaultOpen:!0,children:[f.jsxs("div",{className:"dd-metric-grid",children:[f.jsxs("div",{className:"dd-metric-card",children:[f.jsx("div",{className:"dd-metric-value",children:pe.metrics.fileCount}),f.jsx("div",{className:"dd-metric-label",children:"Files"})]}),f.jsxs("div",{className:"dd-metric-card",children:[f.jsx("div",{className:"dd-metric-value",children:pe.metrics.codeFileCount}),f.jsx("div",{className:"dd-metric-label",children:"Code Files"})]}),f.jsxs("div",{className:"dd-metric-card",children:[f.jsx("div",{className:"dd-metric-value",children:pe.metrics.totalLines.toLocaleString()}),f.jsx("div",{className:"dd-metric-label",children:"Lines"})]})]}),pe.metrics.languages.length>0&&f.jsx("div",{className:"dd-lang-badges",children:pe.metrics.languages.map(H=>f.jsxs("span",{className:"dd-lang-badge",children:[H.language," (",H.files,")"]},H.language))})]}),(pe.structure.keyFiles.length>0||pe.structure.publicExports.length>0)&&f.jsxs(zs,{title:"Internal Structure",children:[pe.structure.keyFiles.length>0&&f.jsx("div",{className:"dd-key-files",children:pe.structure.keyFiles.slice(0,10).map((H,Z)=>f.jsxs("div",{className:"dd-key-file-item",children:[f.jsx("span",{className:"dd-role-badge",children:H.role}),f.jsx("span",{className:"dd-file-path",children:H.path.replace(pe.componentPath+"/","")})]},Z))}),pe.structure.publicExports.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"dd-subsection-title",children:"Public Exports"}),f.jsx("div",{className:"dd-exports",children:pe.structure.publicExports.slice(0,15).map((H,Z)=>f.jsx("span",{className:"dd-export-name",children:H},Z))})]})]}),pe.dependencies.manifest&&f.jsxs(zs,{title:`Dependencies (${pe.dependencies.manifest})`,children:[pe.dependencies.production.length>0&&f.jsxs("div",{className:"dd-dep-list",children:[pe.dependencies.production.slice(0,15).map((H,Z)=>f.jsx("span",{className:`dd-dep-badge ${H.category?"categorized":""}`,title:H.category||H.name,children:H.displayName},Z)),pe.dependencies.production.length>15&&f.jsxs("span",{className:"dd-dep-more",children:["+",pe.dependencies.production.length-15," more"]})]}),pe.dependencies.development.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"dd-subsection-title",children:"Dev Dependencies"}),f.jsxs("div",{className:"dd-dep-list",children:[pe.dependencies.development.slice(0,10).map((H,Z)=>f.jsx("span",{className:"dd-dep-badge dev",title:H.category||H.name,children:H.displayName},Z)),pe.dependencies.development.length>10&&f.jsxs("span",{className:"dd-dep-more",children:["+",pe.dependencies.development.length-10," more"]})]})]})]}),pe.patterns.length>0&&f.jsx(zs,{title:"Code Patterns",children:pe.patterns.map((H,Z)=>f.jsxs("div",{className:"dd-pattern-group",children:[f.jsxs("div",{className:"dd-pattern-header",children:[f.jsx("span",{className:"dd-pattern-label",children:H.label}),f.jsx("span",{className:"dd-pattern-count",children:H.count})]}),f.jsx("div",{className:"dd-pattern-matches",children:H.matches.slice(0,3).map((re,ae)=>f.jsxs("div",{className:"dd-pattern-match",children:[f.jsxs("span",{className:"dd-match-file",children:[re.file.replace(pe.componentPath+"/",""),":",re.line]}),f.jsx("span",{className:"dd-match-content",children:re.content})]},ae))})]},Z))}),(pe.connections.outgoing.length>0||pe.connections.incoming.length>0)&&f.jsxs(zs,{title:"Connections",children:[pe.connections.outgoing.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"dd-subsection-title",children:"Outgoing"}),pe.connections.outgoing.map((H,Z)=>f.jsxs("div",{className:"dd-connection-item",children:[f.jsx("span",{className:"dd-conn-arrow",children:"->"}),f.jsx("span",{className:"dd-conn-name",children:H.targetName}),H.type&&f.jsx("span",{className:"dd-conn-type",children:H.type})]},Z))]}),pe.connections.incoming.length>0&&f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"dd-subsection-title",children:"Incoming"}),pe.connections.incoming.map((H,Z)=>f.jsxs("div",{className:"dd-connection-item",children:[f.jsx("span",{className:"dd-conn-arrow",children:"<-"}),f.jsx("span",{className:"dd-conn-name",children:H.sourceName}),H.type&&f.jsx("span",{className:"dd-conn-type",children:H.type})]},Z))]})]}),pe.fileTree.length>0&&f.jsx(zs,{title:"File Tree",children:f.jsx("div",{className:"dd-file-tree",children:_0(pe.fileTree,pe.componentPath)})})]})]}),Fn.size>0&&!xn&&f.jsxs("div",{className:"save-panel",children:[f.jsxs("span",{className:"save-panel-text",children:[Fn.size," unsaved change",Fn.size!==1?"s":""]}),f.jsx("button",{className:"save-btn",onClick:Hn,disabled:Br,children:Br?"Saving...":"Save Changes"}),f.jsx("button",{className:"discard-btn",onClick:is,disabled:Br,children:"Discard"})]}),Cr.length>0&&f.jsxs("div",{className:"hidden-nodes-panel",children:[f.jsxs("div",{className:"hidden-nodes-title",children:["Hidden (",Cr.length,")",f.jsx("button",{className:"panel-btn cyan small",onClick:Zs,children:"Show All"})]}),f.jsx("div",{className:"hidden-nodes-list",style:{maxHeight:220,overflowY:"auto"},children:Cr.map(H=>f.jsxs("div",{className:"hidden-node-item",children:[f.jsx("span",{className:"hidden-node-name",children:H.label.split(`
|
|
85
|
-
`)[0]}),f.jsx("button",{className:"panel-btn green small",onClick:()=>showNode(H.id),children:"Show"})]},H.id))})]}),R&&f.jsxs("div",{className:"flow-progress-bar",children:[f.jsx("span",{className:"flow-progress-dot",style:{background:R.color}}),f.jsx("span",{className:"flow-progress-name",children:R.name}),f.jsx("div",{className:"flow-progress-steps",children:R.steps.map((H,Z)=>f.jsx("div",{className:`flow-progress-step ${Z<=j?"active":""} ${Z===j?"current":""}`,style:{borderColor:Z<=j?R.color:void 0},title:H.label,children:H.label},Z))}),f.jsxs("div",{className:"flow-progress-controls",children:[Y?f.jsx("button",{className:"flow-progress-btn",onClick:Wr,title:"Pause",children:"⏸"}):f.jsx("button",{className:"flow-progress-btn",onClick:Yr,title:"Resume",children:"▶"}),f.jsx("button",{className:"flow-progress-btn stop",onClick:ir,title:"Stop",children:"⏹"})]})]}),ce&&R&&u&&f.jsx(Ij,{flow:R,architecture:u,onClose:ir}),f.jsx(gj,{visible:Oe,onClose:()=>tt(!1)}),f.jsx(Sj,{visible:It,onClose:()=>bt(!1),onHighlightNode:H=>{Xr(H)}}),gt&&f.jsxs(yi,{className:"ops-panel",children:[f.jsxs("div",{className:"ops-header","data-drag-handle":!0,children:[f.jsx("span",{className:"ops-panel-title",children:"Workflows"}),f.jsx("button",{className:"panel-close-btn",onClick:()=>Tt(!1),children:"x"})]}),f.jsx(Nj,{visible:!0})]}),f.jsx(gP,{visible:Ht,onClose:()=>pn(!1)}),f.jsx(Wj,{visible:mn,onClose:()=>Jt(!1),results:ie}),x.length>0&&f.jsxs("div",{className:"agent-panel",children:[f.jsx("div",{className:"agent-panel-title",children:"Agent Activity"}),x.map((H,Z)=>f.jsxs("div",{className:"agent-item",children:[f.jsx("div",{className:`agent-dot ${Z===0?"active":""}`}),f.jsx("span",{className:"agent-name",children:H.agentName}),f.jsx("span",{className:"agent-target",children:H.targetComponent||H.action})]},Z))]})]}),xn&&f.jsxs("a",{href:"https://archbyte.heartbyte.io",target:"_blank",rel:"noopener noreferrer",style:{position:"fixed",bottom:6,right:8,display:"inline-flex",alignItems:"center",gap:6,padding:"4px 10px",fontSize:11,fontWeight:500,color:"hsl(185 75% 50%)",background:"hsla(222, 47%, 8%, 0.85)",backdropFilter:"blur(8px)",border:"1px solid hsla(185, 75%, 50%, 0.25)",borderRadius:6,textDecoration:"none",zIndex:50,fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.02em"},children:[f.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[f.jsx("path",{d:"M12 2L2 7l10 5 10-5-10-5z"}),f.jsx("path",{d:"M2 17l10 5 10-5"}),f.jsx("path",{d:"M2 12l10 5 10-5"})]}),"archbyte.heartbyte.io"]}),f.jsxs("div",{className:"status-bar",children:[f.jsxs("div",{className:"status-left",children:[!xn&&f.jsxs("div",{className:"status-indicator",children:[f.jsx("div",{className:`status-dot ${h?"":"disconnected"}`}),f.jsx("span",{children:h?"Live":"Offline"})]}),xn&&f.jsx("span",{style:{color:"var(--text-dim)",fontSize:11},children:"Standalone Export"}),E&&!xn&&f.jsx("span",{style:{color:"var(--accent-red)"},children:E})]}),f.jsx("div",{className:"status-center",children:f.jsx("a",{href:"mailto:archbyte@heartbyte.io",style:{color:"var(--text-dim)",fontSize:11,textDecoration:"none"},children:"archbyte@heartbyte.io"})}),f.jsxs("div",{className:"status-right",children:[f.jsx("span",{children:m?`Updated ${new Date(m).toLocaleTimeString()}`:"Waiting..."}),Vt?f.jsxs("span",{className:"git-status",children:[Vt.repo&&f.jsx("a",{href:((Vn=Vt.remoteUrl)==null?void 0:Vn.replace(/^git@([^:]+):/,"https://$1/").replace(/\.git$/,""))||"#",target:"_blank",rel:"noopener noreferrer",className:"git-repo-badge",title:Vt.remoteUrl||"",children:Vt.repo}),f.jsx("span",{className:"git-branch",children:Vt.branch}),f.jsx("span",{className:"git-hash",children:Vt.commit})]}):f.jsxs("span",{children:["v",(u==null?void 0:u.version)||1]})]})]}),$&&f.jsx(Pj,{onComplete:()=>{Q(!1),rr()}}),B&&f.jsx(lj,{feature:B,onClose:()=>T(null)})]})}cw.createRoot(document.getElementById("root")).render(f.jsx(Hg.StrictMode,{children:f.jsx(wP,{})}));
|