overture-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,408 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ma=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ly(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var iC={exports:{}},hu={},sC={exports:{}},le={};/**
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 $o=Symbol.for("react.element"),mR=Symbol.for("react.portal"),gR=Symbol.for("react.fragment"),yR=Symbol.for("react.strict_mode"),vR=Symbol.for("react.profiler"),xR=Symbol.for("react.provider"),wR=Symbol.for("react.context"),bR=Symbol.for("react.forward_ref"),_R=Symbol.for("react.suspense"),SR=Symbol.for("react.memo"),NR=Symbol.for("react.lazy"),ax=Symbol.iterator;function ER(e){return e===null||typeof e!="object"?null:(e=ax&&e[ax]||e["@@iterator"],typeof e=="function"?e:null)}var oC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},aC=Object.assign,lC={};function ss(e,t,n){this.props=e,this.context=t,this.refs=lC,this.updater=n||oC}ss.prototype.isReactComponent={};ss.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ss.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uC(){}uC.prototype=ss.prototype;function Fy(e,t,n){this.props=e,this.context=t,this.refs=lC,this.updater=n||oC}var qy=Fy.prototype=new uC;qy.constructor=Fy;aC(qy,ss.prototype);qy.isPureReactComponent=!0;var lx=Array.isArray,cC=Object.prototype.hasOwnProperty,Vy={current:null},dC={key:!0,ref:!0,__self:!0,__source:!0};function fC(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)cC.call(t,r)&&!dC.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:$o,type:e,key:s,ref:o,props:i,_owner:Vy.current}}function CR(e,t){return{$$typeof:$o,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function $y(e){return typeof e=="object"&&e!==null&&e.$$typeof===$o}function kR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ux=/\/+/g;function gc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?kR(""+e.key):t.toString(36)}function Xa(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case $o:case mR:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+gc(o,0):r,lx(i)?(n="",e!=null&&(n=e.replace(ux,"$&/")+"/"),Xa(i,t,n,"",function(u){return u})):i!=null&&($y(i)&&(i=CR(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(ux,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",lx(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+gc(s,a);o+=Xa(s,t,n,l,i)}else if(l=ER(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+gc(s,a++),o+=Xa(s,t,n,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function ga(e,t,n){if(e==null)return e;var r=[],i=0;return Xa(e,r,"","",function(s){return t.call(n,s,i++)}),r}function PR(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var it={current:null},Qa={transition:null},jR={ReactCurrentDispatcher:it,ReactCurrentBatchConfig:Qa,ReactCurrentOwner:Vy};function hC(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:ga,forEach:function(e,t,n){ga(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ga(e,function(){t++}),t},toArray:function(e){return ga(e,function(t){return t})||[]},only:function(e){if(!$y(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=ss;le.Fragment=gR;le.Profiler=vR;le.PureComponent=Fy;le.StrictMode=yR;le.Suspense=_R;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jR;le.act=hC;le.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=aC({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Vy.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)cC.call(t,l)&&!dC.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:$o,type:e.type,key:i,ref:s,props:r,_owner:o}};le.createContext=function(e){return e={$$typeof:wR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:xR,_context:e},e.Consumer=e};le.createElement=fC;le.createFactory=function(e){var t=fC.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:bR,render:e}};le.isValidElement=$y;le.lazy=function(e){return{$$typeof:NR,_payload:{_status:-1,_result:e},_init:PR}};le.memo=function(e,t){return{$$typeof:SR,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=Qa.transition;Qa.transition={};try{e()}finally{Qa.transition=t}};le.unstable_act=hC;le.useCallback=function(e,t){return it.current.useCallback(e,t)};le.useContext=function(e){return it.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return it.current.useDeferredValue(e)};le.useEffect=function(e,t){return it.current.useEffect(e,t)};le.useId=function(){return it.current.useId()};le.useImperativeHandle=function(e,t,n){return it.current.useImperativeHandle(e,t,n)};le.useInsertionEffect=function(e,t){return it.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return it.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return it.current.useMemo(e,t)};le.useReducer=function(e,t,n){return it.current.useReducer(e,t,n)};le.useRef=function(e){return it.current.useRef(e)};le.useState=function(e){return it.current.useState(e)};le.useSyncExternalStore=function(e,t,n){return it.current.useSyncExternalStore(e,t,n)};le.useTransition=function(){return it.current.useTransition()};le.version="18.3.1";sC.exports=le;var T=sC.exports;const pu=Ly(T);/**
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 TR=T,MR=Symbol.for("react.element"),AR=Symbol.for("react.fragment"),IR=Object.prototype.hasOwnProperty,RR=TR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,DR={key:!0,ref:!0,__self:!0,__source:!0};function pC(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)IR.call(t,r)&&!DR.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:MR,type:e,key:s,ref:o,props:i,_owner:RR.current}}hu.Fragment=AR;hu.jsx=pC;hu.jsxs=pC;iC.exports=hu;var h=iC.exports,ug={},mC={exports:{}},St={},gC={exports:{}},yC={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(j,M){var q=j.length;j.push(M);e:for(;0<q;){var $=q-1>>>1,D=j[$];if(0<i(D,M))j[$]=M,j[q]=D,q=$;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var M=j[0],q=j.pop();if(q!==M){j[0]=q;e:for(var $=0,D=j.length,z=D>>>1;$<z;){var V=2*($+1)-1,U=j[V],W=V+1,Y=j[W];if(0>i(U,q))W<D&&0>i(Y,U)?(j[$]=Y,j[W]=q,$=W):(j[$]=U,j[V]=q,$=V);else if(W<D&&0>i(Y,q))j[$]=Y,j[W]=q,$=W;else break e}}return M}function i(j,M){var q=j.sortIndex-M.sortIndex;return q!==0?q:j.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,f=3,p=!1,m=!1,v=!1,w=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(j){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=j)r(u),M.sortIndex=M.expirationTime,t(l,M);else break;M=n(u)}}function b(j){if(v=!1,y(j),!m)if(n(l)!==null)m=!0,R(E);else{var M=n(u);M!==null&&O(b,M.startTime-j)}}function E(j,M){m=!1,v&&(v=!1,g(k),k=-1),p=!0;var q=f;try{for(y(M),d=n(l);d!==null&&(!(d.expirationTime>M)||j&&!S());){var $=d.callback;if(typeof $=="function"){d.callback=null,f=d.priorityLevel;var D=$(d.expirationTime<=M);M=e.unstable_now(),typeof D=="function"?d.callback=D:d===n(l)&&r(l),y(M)}else r(l);d=n(l)}if(d!==null)var z=!0;else{var V=n(u);V!==null&&O(b,V.startTime-M),z=!1}return z}finally{d=null,f=q,p=!1}}var C=!1,_=null,k=-1,I=5,F=-1;function S(){return!(e.unstable_now()-F<I)}function P(){if(_!==null){var j=e.unstable_now();F=j;var M=!0;try{M=_(!0,j)}finally{M?L():(C=!1,_=null)}}else C=!1}var L;if(typeof x=="function")L=function(){x(P)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,A=N.port2;N.port1.onmessage=P,L=function(){A.postMessage(null)}}else L=function(){w(P,0)};function R(j){_=j,C||(C=!0,L())}function O(j,M){k=w(function(){j(e.unstable_now())},M)}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(j){j.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,R(E))},e.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(j){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var q=f;f=M;try{return j()}finally{f=q}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(j,M){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var q=f;f=j;try{return M()}finally{f=q}},e.unstable_scheduleCallback=function(j,M,q){var $=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?$+q:$):q=$,j){case 1:var D=-1;break;case 2:D=250;break;case 5:D=1073741823;break;case 4:D=1e4;break;default:D=5e3}return D=q+D,j={id:c++,callback:M,priorityLevel:j,startTime:q,expirationTime:D,sortIndex:-1},q>$?(j.sortIndex=q,t(u,j),n(l)===null&&j===n(u)&&(v?(g(k),k=-1):v=!0,O(b,q-$))):(j.sortIndex=D,t(l,j),m||p||(m=!0,R(E))),j},e.unstable_shouldYield=S,e.unstable_wrapCallback=function(j){var M=f;return function(){var q=f;f=M;try{return j.apply(this,arguments)}finally{f=q}}}})(yC);gC.exports=yC;var OR=gC.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 LR=T,wt=OR;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var vC=new Set,oo={};function ti(e,t){zi(e,t),zi(e+"Capture",t)}function zi(e,t){for(oo[e]=t,e=0;e<t.length;e++)vC.add(t[e])}var Tn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cg=Object.prototype.hasOwnProperty,FR=/^[: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]*$/,cx={},dx={};function qR(e){return cg.call(dx,e)?!0:cg.call(cx,e)?!1:FR.test(e)?dx[e]=!0:(cx[e]=!0,!1)}function VR(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function $R(e,t,n,r){if(t===null||typeof t>"u"||VR(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function st(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var Ge={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ge[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ge[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ge[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ge[e]=new st(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ge[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ge[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ge[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ge[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ge[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var zy=/[\-:]([a-z])/g;function By(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(zy,By);Ge[t]=new st(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(zy,By);Ge[t]=new st(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(zy,By);Ge[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ge[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});Ge.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ge[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function Hy(e,t,n,r){var i=Ge.hasOwnProperty(t)?Ge[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&($R(t,n,i,r)&&(n=null),r||i===null?qR(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var qn=LR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ya=Symbol.for("react.element"),pi=Symbol.for("react.portal"),mi=Symbol.for("react.fragment"),Uy=Symbol.for("react.strict_mode"),dg=Symbol.for("react.profiler"),xC=Symbol.for("react.provider"),wC=Symbol.for("react.context"),Wy=Symbol.for("react.forward_ref"),fg=Symbol.for("react.suspense"),hg=Symbol.for("react.suspense_list"),Gy=Symbol.for("react.memo"),Zn=Symbol.for("react.lazy"),bC=Symbol.for("react.offscreen"),fx=Symbol.iterator;function ms(e){return e===null||typeof e!="object"?null:(e=fx&&e[fx]||e["@@iterator"],typeof e=="function"?e:null)}var Pe=Object.assign,yc;function js(e){if(yc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yc=t&&t[1]||""}return`
34
+ `+yc+e}var vc=!1;function xc(e,t){if(!e||vc)return"";vc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{vc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?js(e):""}function zR(e){switch(e.tag){case 5:return js(e.type);case 16:return js("Lazy");case 13:return js("Suspense");case 19:return js("SuspenseList");case 0:case 2:case 15:return e=xc(e.type,!1),e;case 11:return e=xc(e.type.render,!1),e;case 1:return e=xc(e.type,!0),e;default:return""}}function pg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case mi:return"Fragment";case pi:return"Portal";case dg:return"Profiler";case Uy:return"StrictMode";case fg:return"Suspense";case hg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wC:return(e.displayName||"Context")+".Consumer";case xC:return(e._context.displayName||"Context")+".Provider";case Wy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gy:return t=e.displayName||null,t!==null?t:pg(e.type)||"Memo";case Zn:t=e._payload,e=e._init;try{return pg(e(t))}catch{}}return null}function BR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pg(t);case 8:return t===Uy?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function mr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _C(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function HR(e){var t=_C(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function va(e){e._valueTracker||(e._valueTracker=HR(e))}function SC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=_C(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function yl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function mg(e,t){var n=t.checked;return Pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function hx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function NC(e,t){t=t.checked,t!=null&&Hy(e,"checked",t,!1)}function gg(e,t){NC(e,t);var n=mr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?yg(e,t.type,n):t.hasOwnProperty("defaultValue")&&yg(e,t.type,mr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function px(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function yg(e,t,n){(t!=="number"||yl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ts=Array.isArray;function Ii(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+mr(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function vg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return Pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mx(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(Ts(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:mr(n)}}function EC(e,t){var n=mr(t.value),r=mr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function gx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function CC(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xg(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?CC(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var xa,kC=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(xa=xa||document.createElement("div"),xa.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=xa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ao(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Hs={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},UR=["Webkit","ms","Moz","O"];Object.keys(Hs).forEach(function(e){UR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hs[t]=Hs[e]})});function PC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Hs.hasOwnProperty(e)&&Hs[e]?(""+t).trim():t+"px"}function jC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=PC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var WR=Pe({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 wg(e,t){if(t){if(WR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function bg(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _g=null;function Yy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sg=null,Ri=null,Di=null;function yx(e){if(e=Ho(e)){if(typeof Sg!="function")throw Error(B(280));var t=e.stateNode;t&&(t=xu(t),Sg(e.stateNode,e.type,t))}}function TC(e){Ri?Di?Di.push(e):Di=[e]:Ri=e}function MC(){if(Ri){var e=Ri,t=Di;if(Di=Ri=null,yx(e),t)for(e=0;e<t.length;e++)yx(t[e])}}function AC(e,t){return e(t)}function IC(){}var wc=!1;function RC(e,t,n){if(wc)return e(t,n);wc=!0;try{return AC(e,t,n)}finally{wc=!1,(Ri!==null||Di!==null)&&(IC(),MC())}}function lo(e,t){var n=e.stateNode;if(n===null)return null;var r=xu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var Ng=!1;if(Tn)try{var gs={};Object.defineProperty(gs,"passive",{get:function(){Ng=!0}}),window.addEventListener("test",gs,gs),window.removeEventListener("test",gs,gs)}catch{Ng=!1}function GR(e,t,n,r,i,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Us=!1,vl=null,xl=!1,Eg=null,YR={onError:function(e){Us=!0,vl=e}};function KR(e,t,n,r,i,s,o,a,l){Us=!1,vl=null,GR.apply(YR,arguments)}function XR(e,t,n,r,i,s,o,a,l){if(KR.apply(this,arguments),Us){if(Us){var u=vl;Us=!1,vl=null}else throw Error(B(198));xl||(xl=!0,Eg=u)}}function ni(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function DC(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function vx(e){if(ni(e)!==e)throw Error(B(188))}function QR(e){var t=e.alternate;if(!t){if(t=ni(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return vx(i),e;if(s===r)return vx(i),t;s=s.sibling}throw Error(B(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function OC(e){return e=QR(e),e!==null?LC(e):null}function LC(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=LC(e);if(t!==null)return t;e=e.sibling}return null}var FC=wt.unstable_scheduleCallback,xx=wt.unstable_cancelCallback,ZR=wt.unstable_shouldYield,JR=wt.unstable_requestPaint,Ie=wt.unstable_now,e3=wt.unstable_getCurrentPriorityLevel,Ky=wt.unstable_ImmediatePriority,qC=wt.unstable_UserBlockingPriority,wl=wt.unstable_NormalPriority,t3=wt.unstable_LowPriority,VC=wt.unstable_IdlePriority,mu=null,sn=null;function n3(e){if(sn&&typeof sn.onCommitFiberRoot=="function")try{sn.onCommitFiberRoot(mu,e,void 0,(e.current.flags&128)===128)}catch{}}var Ut=Math.clz32?Math.clz32:s3,r3=Math.log,i3=Math.LN2;function s3(e){return e>>>=0,e===0?32:31-(r3(e)/i3|0)|0}var wa=64,ba=4194304;function Ms(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function bl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Ms(a):(s&=o,s!==0&&(r=Ms(s)))}else o=n&~i,o!==0?r=Ms(o):s!==0&&(r=Ms(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Ut(t),i=1<<n,r|=e[n],t&=~i;return r}function o3(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function a3(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Ut(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=o3(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Cg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $C(){var e=wa;return wa<<=1,!(wa&4194240)&&(wa=64),e}function bc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function zo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ut(t),e[t]=n}function l3(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Ut(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Xy(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ut(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var me=0;function zC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var BC,Qy,HC,UC,WC,kg=!1,_a=[],or=null,ar=null,lr=null,uo=new Map,co=new Map,er=[],u3="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 wx(e,t){switch(e){case"focusin":case"focusout":or=null;break;case"dragenter":case"dragleave":ar=null;break;case"mouseover":case"mouseout":lr=null;break;case"pointerover":case"pointerout":uo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":co.delete(t.pointerId)}}function ys(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Ho(t),t!==null&&Qy(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function c3(e,t,n,r,i){switch(t){case"focusin":return or=ys(or,e,t,n,r,i),!0;case"dragenter":return ar=ys(ar,e,t,n,r,i),!0;case"mouseover":return lr=ys(lr,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return uo.set(s,ys(uo.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,co.set(s,ys(co.get(s)||null,e,t,n,r,i)),!0}return!1}function GC(e){var t=Rr(e.target);if(t!==null){var n=ni(t);if(n!==null){if(t=n.tag,t===13){if(t=DC(n),t!==null){e.blockedOn=t,WC(e.priority,function(){HC(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Za(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Pg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_g=r,n.target.dispatchEvent(r),_g=null}else return t=Ho(n),t!==null&&Qy(t),e.blockedOn=n,!1;t.shift()}return!0}function bx(e,t,n){Za(e)&&n.delete(t)}function d3(){kg=!1,or!==null&&Za(or)&&(or=null),ar!==null&&Za(ar)&&(ar=null),lr!==null&&Za(lr)&&(lr=null),uo.forEach(bx),co.forEach(bx)}function vs(e,t){e.blockedOn===t&&(e.blockedOn=null,kg||(kg=!0,wt.unstable_scheduleCallback(wt.unstable_NormalPriority,d3)))}function fo(e){function t(i){return vs(i,e)}if(0<_a.length){vs(_a[0],e);for(var n=1;n<_a.length;n++){var r=_a[n];r.blockedOn===e&&(r.blockedOn=null)}}for(or!==null&&vs(or,e),ar!==null&&vs(ar,e),lr!==null&&vs(lr,e),uo.forEach(t),co.forEach(t),n=0;n<er.length;n++)r=er[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<er.length&&(n=er[0],n.blockedOn===null);)GC(n),n.blockedOn===null&&er.shift()}var Oi=qn.ReactCurrentBatchConfig,_l=!0;function f3(e,t,n,r){var i=me,s=Oi.transition;Oi.transition=null;try{me=1,Zy(e,t,n,r)}finally{me=i,Oi.transition=s}}function h3(e,t,n,r){var i=me,s=Oi.transition;Oi.transition=null;try{me=4,Zy(e,t,n,r)}finally{me=i,Oi.transition=s}}function Zy(e,t,n,r){if(_l){var i=Pg(e,t,n,r);if(i===null)Mc(e,t,r,Sl,n),wx(e,r);else if(c3(i,e,t,n,r))r.stopPropagation();else if(wx(e,r),t&4&&-1<u3.indexOf(e)){for(;i!==null;){var s=Ho(i);if(s!==null&&BC(s),s=Pg(e,t,n,r),s===null&&Mc(e,t,r,Sl,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Mc(e,t,r,null,n)}}var Sl=null;function Pg(e,t,n,r){if(Sl=null,e=Yy(r),e=Rr(e),e!==null)if(t=ni(e),t===null)e=null;else if(n=t.tag,n===13){if(e=DC(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Sl=e,null}function YC(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(e3()){case Ky:return 1;case qC:return 4;case wl:case t3:return 16;case VC:return 536870912;default:return 16}default:return 16}}var ir=null,Jy=null,Ja=null;function KC(){if(Ja)return Ja;var e,t=Jy,n=t.length,r,i="value"in ir?ir.value:ir.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return Ja=i.slice(e,1<r?1-r:void 0)}function el(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Sa(){return!0}function _x(){return!1}function Nt(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Sa:_x,this.isPropagationStopped=_x,this}return Pe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Sa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Sa)},persist:function(){},isPersistent:Sa}),t}var os={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ev=Nt(os),Bo=Pe({},os,{view:0,detail:0}),p3=Nt(Bo),_c,Sc,xs,gu=Pe({},Bo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==xs&&(xs&&e.type==="mousemove"?(_c=e.screenX-xs.screenX,Sc=e.screenY-xs.screenY):Sc=_c=0,xs=e),_c)},movementY:function(e){return"movementY"in e?e.movementY:Sc}}),Sx=Nt(gu),m3=Pe({},gu,{dataTransfer:0}),g3=Nt(m3),y3=Pe({},Bo,{relatedTarget:0}),Nc=Nt(y3),v3=Pe({},os,{animationName:0,elapsedTime:0,pseudoElement:0}),x3=Nt(v3),w3=Pe({},os,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),b3=Nt(w3),_3=Pe({},os,{data:0}),Nx=Nt(_3),S3={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},N3={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"},E3={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function C3(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=E3[e])?!!t[e]:!1}function tv(){return C3}var k3=Pe({},Bo,{key:function(e){if(e.key){var t=S3[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=el(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?N3[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tv,charCode:function(e){return e.type==="keypress"?el(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?el(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),P3=Nt(k3),j3=Pe({},gu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ex=Nt(j3),T3=Pe({},Bo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tv}),M3=Nt(T3),A3=Pe({},os,{propertyName:0,elapsedTime:0,pseudoElement:0}),I3=Nt(A3),R3=Pe({},gu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),D3=Nt(R3),O3=[9,13,27,32],nv=Tn&&"CompositionEvent"in window,Ws=null;Tn&&"documentMode"in document&&(Ws=document.documentMode);var L3=Tn&&"TextEvent"in window&&!Ws,XC=Tn&&(!nv||Ws&&8<Ws&&11>=Ws),Cx=" ",kx=!1;function QC(e,t){switch(e){case"keyup":return O3.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ZC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gi=!1;function F3(e,t){switch(e){case"compositionend":return ZC(t);case"keypress":return t.which!==32?null:(kx=!0,Cx);case"textInput":return e=t.data,e===Cx&&kx?null:e;default:return null}}function q3(e,t){if(gi)return e==="compositionend"||!nv&&QC(e,t)?(e=KC(),Ja=Jy=ir=null,gi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return XC&&t.locale!=="ko"?null:t.data;default:return null}}var V3={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 Px(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!V3[e.type]:t==="textarea"}function JC(e,t,n,r){TC(r),t=Nl(t,"onChange"),0<t.length&&(n=new ev("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Gs=null,ho=null;function $3(e){ck(e,0)}function yu(e){var t=xi(e);if(SC(t))return e}function z3(e,t){if(e==="change")return t}var ek=!1;if(Tn){var Ec;if(Tn){var Cc="oninput"in document;if(!Cc){var jx=document.createElement("div");jx.setAttribute("oninput","return;"),Cc=typeof jx.oninput=="function"}Ec=Cc}else Ec=!1;ek=Ec&&(!document.documentMode||9<document.documentMode)}function Tx(){Gs&&(Gs.detachEvent("onpropertychange",tk),ho=Gs=null)}function tk(e){if(e.propertyName==="value"&&yu(ho)){var t=[];JC(t,ho,e,Yy(e)),RC($3,t)}}function B3(e,t,n){e==="focusin"?(Tx(),Gs=t,ho=n,Gs.attachEvent("onpropertychange",tk)):e==="focusout"&&Tx()}function H3(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yu(ho)}function U3(e,t){if(e==="click")return yu(t)}function W3(e,t){if(e==="input"||e==="change")return yu(t)}function G3(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gt=typeof Object.is=="function"?Object.is:G3;function po(e,t){if(Gt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!cg.call(t,i)||!Gt(e[i],t[i]))return!1}return!0}function Mx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ax(e,t){var n=Mx(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mx(n)}}function nk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?nk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rk(){for(var e=window,t=yl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=yl(e.document)}return t}function rv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Y3(e){var t=rk(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&nk(n.ownerDocument.documentElement,n)){if(r!==null&&rv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Ax(n,s);var o=Ax(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var K3=Tn&&"documentMode"in document&&11>=document.documentMode,yi=null,jg=null,Ys=null,Tg=!1;function Ix(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Tg||yi==null||yi!==yl(r)||(r=yi,"selectionStart"in r&&rv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ys&&po(Ys,r)||(Ys=r,r=Nl(jg,"onSelect"),0<r.length&&(t=new ev("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yi)))}function Na(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vi={animationend:Na("Animation","AnimationEnd"),animationiteration:Na("Animation","AnimationIteration"),animationstart:Na("Animation","AnimationStart"),transitionend:Na("Transition","TransitionEnd")},kc={},ik={};Tn&&(ik=document.createElement("div").style,"AnimationEvent"in window||(delete vi.animationend.animation,delete vi.animationiteration.animation,delete vi.animationstart.animation),"TransitionEvent"in window||delete vi.transitionend.transition);function vu(e){if(kc[e])return kc[e];if(!vi[e])return e;var t=vi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ik)return kc[e]=t[n];return e}var sk=vu("animationend"),ok=vu("animationiteration"),ak=vu("animationstart"),lk=vu("transitionend"),uk=new Map,Rx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function _r(e,t){uk.set(e,t),ti(t,[e])}for(var Pc=0;Pc<Rx.length;Pc++){var jc=Rx[Pc],X3=jc.toLowerCase(),Q3=jc[0].toUpperCase()+jc.slice(1);_r(X3,"on"+Q3)}_r(sk,"onAnimationEnd");_r(ok,"onAnimationIteration");_r(ak,"onAnimationStart");_r("dblclick","onDoubleClick");_r("focusin","onFocus");_r("focusout","onBlur");_r(lk,"onTransitionEnd");zi("onMouseEnter",["mouseout","mouseover"]);zi("onMouseLeave",["mouseout","mouseover"]);zi("onPointerEnter",["pointerout","pointerover"]);zi("onPointerLeave",["pointerout","pointerover"]);ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ti("onBeforeInput",["compositionend","keypress","textInput","paste"]);ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var As="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(" "),Z3=new Set("cancel close invalid load scroll toggle".split(" ").concat(As));function Dx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,XR(r,t,void 0,e),e.currentTarget=null}function ck(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Dx(i,a,u),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Dx(i,a,u),s=l}}}if(xl)throw e=Eg,xl=!1,Eg=null,e}function ye(e,t){var n=t[Dg];n===void 0&&(n=t[Dg]=new Set);var r=e+"__bubble";n.has(r)||(dk(t,e,2,!1),n.add(r))}function Tc(e,t,n){var r=0;t&&(r|=4),dk(n,e,r,t)}var Ea="_reactListening"+Math.random().toString(36).slice(2);function mo(e){if(!e[Ea]){e[Ea]=!0,vC.forEach(function(n){n!=="selectionchange"&&(Z3.has(n)||Tc(n,!1,e),Tc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ea]||(t[Ea]=!0,Tc("selectionchange",!1,t))}}function dk(e,t,n,r){switch(YC(t)){case 1:var i=f3;break;case 4:i=h3;break;default:i=Zy}n=i.bind(null,t,n,e),i=void 0,!Ng||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Mc(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Rr(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}RC(function(){var u=s,c=Yy(n),d=[];e:{var f=uk.get(e);if(f!==void 0){var p=ev,m=e;switch(e){case"keypress":if(el(n)===0)break e;case"keydown":case"keyup":p=P3;break;case"focusin":m="focus",p=Nc;break;case"focusout":m="blur",p=Nc;break;case"beforeblur":case"afterblur":p=Nc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Sx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=g3;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=M3;break;case sk:case ok:case ak:p=x3;break;case lk:p=I3;break;case"scroll":p=p3;break;case"wheel":p=D3;break;case"copy":case"cut":case"paste":p=b3;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Ex}var v=(t&4)!==0,w=!v&&e==="scroll",g=v?f!==null?f+"Capture":null:f;v=[];for(var x=u,y;x!==null;){y=x;var b=y.stateNode;if(y.tag===5&&b!==null&&(y=b,g!==null&&(b=lo(x,g),b!=null&&v.push(go(x,b,y)))),w)break;x=x.return}0<v.length&&(f=new p(f,m,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==_g&&(m=n.relatedTarget||n.fromElement)&&(Rr(m)||m[Mn]))break e;if((p||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=u,m=m?Rr(m):null,m!==null&&(w=ni(m),m!==w||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=u),p!==m)){if(v=Sx,b="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Ex,b="onPointerLeave",g="onPointerEnter",x="pointer"),w=p==null?f:xi(p),y=m==null?f:xi(m),f=new v(b,x+"leave",p,n,c),f.target=w,f.relatedTarget=y,b=null,Rr(c)===u&&(v=new v(g,x+"enter",m,n,c),v.target=y,v.relatedTarget=w,b=v),w=b,p&&m)t:{for(v=p,g=m,x=0,y=v;y;y=di(y))x++;for(y=0,b=g;b;b=di(b))y++;for(;0<x-y;)v=di(v),x--;for(;0<y-x;)g=di(g),y--;for(;x--;){if(v===g||g!==null&&v===g.alternate)break t;v=di(v),g=di(g)}v=null}else v=null;p!==null&&Ox(d,f,p,v,!1),m!==null&&w!==null&&Ox(d,w,m,v,!0)}}e:{if(f=u?xi(u):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var E=z3;else if(Px(f))if(ek)E=W3;else{E=H3;var C=B3}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(E=U3);if(E&&(E=E(e,u))){JC(d,E,n,c);break e}C&&C(e,f,u),e==="focusout"&&(C=f._wrapperState)&&C.controlled&&f.type==="number"&&yg(f,"number",f.value)}switch(C=u?xi(u):window,e){case"focusin":(Px(C)||C.contentEditable==="true")&&(yi=C,jg=u,Ys=null);break;case"focusout":Ys=jg=yi=null;break;case"mousedown":Tg=!0;break;case"contextmenu":case"mouseup":case"dragend":Tg=!1,Ix(d,n,c);break;case"selectionchange":if(K3)break;case"keydown":case"keyup":Ix(d,n,c)}var _;if(nv)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else gi?QC(e,n)&&(k="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(k="onCompositionStart");k&&(XC&&n.locale!=="ko"&&(gi||k!=="onCompositionStart"?k==="onCompositionEnd"&&gi&&(_=KC()):(ir=c,Jy="value"in ir?ir.value:ir.textContent,gi=!0)),C=Nl(u,k),0<C.length&&(k=new Nx(k,e,null,n,c),d.push({event:k,listeners:C}),_?k.data=_:(_=ZC(n),_!==null&&(k.data=_)))),(_=L3?F3(e,n):q3(e,n))&&(u=Nl(u,"onBeforeInput"),0<u.length&&(c=new Nx("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=_))}ck(d,t)})}function go(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Nl(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=lo(e,n),s!=null&&r.unshift(go(e,s,i)),s=lo(e,t),s!=null&&r.push(go(e,s,i))),e=e.return}return r}function di(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ox(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,i?(l=lo(n,s),l!=null&&o.unshift(go(n,l,a))):i||(l=lo(n,s),l!=null&&o.push(go(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var J3=/\r\n?/g,eD=/\u0000|\uFFFD/g;function Lx(e){return(typeof e=="string"?e:""+e).replace(J3,`
38
+ `).replace(eD,"")}function Ca(e,t,n){if(t=Lx(t),Lx(e)!==t&&n)throw Error(B(425))}function El(){}var Mg=null,Ag=null;function Ig(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Rg=typeof setTimeout=="function"?setTimeout:void 0,tD=typeof clearTimeout=="function"?clearTimeout:void 0,Fx=typeof Promise=="function"?Promise:void 0,nD=typeof queueMicrotask=="function"?queueMicrotask:typeof Fx<"u"?function(e){return Fx.resolve(null).then(e).catch(rD)}:Rg;function rD(e){setTimeout(function(){throw e})}function Ac(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),fo(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);fo(t)}function ur(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function qx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var as=Math.random().toString(36).slice(2),nn="__reactFiber$"+as,yo="__reactProps$"+as,Mn="__reactContainer$"+as,Dg="__reactEvents$"+as,iD="__reactListeners$"+as,sD="__reactHandles$"+as;function Rr(e){var t=e[nn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Mn]||n[nn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=qx(e);e!==null;){if(n=e[nn])return n;e=qx(e)}return t}e=n,n=e.parentNode}return null}function Ho(e){return e=e[nn]||e[Mn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function xu(e){return e[yo]||null}var Og=[],wi=-1;function Sr(e){return{current:e}}function ve(e){0>wi||(e.current=Og[wi],Og[wi]=null,wi--)}function ge(e,t){wi++,Og[wi]=e.current,e.current=t}var gr={},et=Sr(gr),ct=Sr(!1),Ur=gr;function Bi(e,t){var n=e.type.contextTypes;if(!n)return gr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function dt(e){return e=e.childContextTypes,e!=null}function Cl(){ve(ct),ve(et)}function Vx(e,t,n){if(et.current!==gr)throw Error(B(168));ge(et,t),ge(ct,n)}function fk(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(B(108,BR(e)||"Unknown",i));return Pe({},n,r)}function kl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||gr,Ur=et.current,ge(et,e),ge(ct,ct.current),!0}function $x(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=fk(e,t,Ur),r.__reactInternalMemoizedMergedChildContext=e,ve(ct),ve(et),ge(et,e)):ve(ct),ge(ct,n)}var wn=null,wu=!1,Ic=!1;function hk(e){wn===null?wn=[e]:wn.push(e)}function oD(e){wu=!0,hk(e)}function Nr(){if(!Ic&&wn!==null){Ic=!0;var e=0,t=me;try{var n=wn;for(me=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}wn=null,wu=!1}catch(i){throw wn!==null&&(wn=wn.slice(e+1)),FC(Ky,Nr),i}finally{me=t,Ic=!1}}return null}var bi=[],_i=0,Pl=null,jl=0,kt=[],Pt=0,Wr=null,bn=1,_n="";function Pr(e,t){bi[_i++]=jl,bi[_i++]=Pl,Pl=e,jl=t}function pk(e,t,n){kt[Pt++]=bn,kt[Pt++]=_n,kt[Pt++]=Wr,Wr=e;var r=bn;e=_n;var i=32-Ut(r)-1;r&=~(1<<i),n+=1;var s=32-Ut(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,bn=1<<32-Ut(t)+i|n<<i|r,_n=s+e}else bn=1<<s|n<<i|r,_n=e}function iv(e){e.return!==null&&(Pr(e,1),pk(e,1,0))}function sv(e){for(;e===Pl;)Pl=bi[--_i],bi[_i]=null,jl=bi[--_i],bi[_i]=null;for(;e===Wr;)Wr=kt[--Pt],kt[Pt]=null,_n=kt[--Pt],kt[Pt]=null,bn=kt[--Pt],kt[Pt]=null}var vt=null,yt=null,be=!1,$t=null;function mk(e,t){var n=jt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function zx(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,vt=e,yt=ur(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,vt=e,yt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Wr!==null?{id:bn,overflow:_n}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=jt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,vt=e,yt=null,!0):!1;default:return!1}}function Lg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Fg(e){if(be){var t=yt;if(t){var n=t;if(!zx(e,t)){if(Lg(e))throw Error(B(418));t=ur(n.nextSibling);var r=vt;t&&zx(e,t)?mk(r,n):(e.flags=e.flags&-4097|2,be=!1,vt=e)}}else{if(Lg(e))throw Error(B(418));e.flags=e.flags&-4097|2,be=!1,vt=e}}}function Bx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;vt=e}function ka(e){if(e!==vt)return!1;if(!be)return Bx(e),be=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ig(e.type,e.memoizedProps)),t&&(t=yt)){if(Lg(e))throw gk(),Error(B(418));for(;t;)mk(e,t),t=ur(t.nextSibling)}if(Bx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){yt=ur(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}yt=null}}else yt=vt?ur(e.stateNode.nextSibling):null;return!0}function gk(){for(var e=yt;e;)e=ur(e.nextSibling)}function Hi(){yt=vt=null,be=!1}function ov(e){$t===null?$t=[e]:$t.push(e)}var aD=qn.ReactCurrentBatchConfig;function ws(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function Pa(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Hx(e){var t=e._init;return t(e._payload)}function yk(e){function t(g,x){if(e){var y=g.deletions;y===null?(g.deletions=[x],g.flags|=16):y.push(x)}}function n(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function r(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function i(g,x){return g=hr(g,x),g.index=0,g.sibling=null,g}function s(g,x,y){return g.index=y,e?(y=g.alternate,y!==null?(y=y.index,y<x?(g.flags|=2,x):y):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,x,y,b){return x===null||x.tag!==6?(x=Vc(y,g.mode,b),x.return=g,x):(x=i(x,y),x.return=g,x)}function l(g,x,y,b){var E=y.type;return E===mi?c(g,x,y.props.children,b,y.key):x!==null&&(x.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Zn&&Hx(E)===x.type)?(b=i(x,y.props),b.ref=ws(g,x,y),b.return=g,b):(b=al(y.type,y.key,y.props,null,g.mode,b),b.ref=ws(g,x,y),b.return=g,b)}function u(g,x,y,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==y.containerInfo||x.stateNode.implementation!==y.implementation?(x=$c(y,g.mode,b),x.return=g,x):(x=i(x,y.children||[]),x.return=g,x)}function c(g,x,y,b,E){return x===null||x.tag!==7?(x=$r(y,g.mode,b,E),x.return=g,x):(x=i(x,y),x.return=g,x)}function d(g,x,y){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Vc(""+x,g.mode,y),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case ya:return y=al(x.type,x.key,x.props,null,g.mode,y),y.ref=ws(g,null,x),y.return=g,y;case pi:return x=$c(x,g.mode,y),x.return=g,x;case Zn:var b=x._init;return d(g,b(x._payload),y)}if(Ts(x)||ms(x))return x=$r(x,g.mode,y,null),x.return=g,x;Pa(g,x)}return null}function f(g,x,y,b){var E=x!==null?x.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:a(g,x,""+y,b);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ya:return y.key===E?l(g,x,y,b):null;case pi:return y.key===E?u(g,x,y,b):null;case Zn:return E=y._init,f(g,x,E(y._payload),b)}if(Ts(y)||ms(y))return E!==null?null:c(g,x,y,b,null);Pa(g,y)}return null}function p(g,x,y,b,E){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(y)||null,a(x,g,""+b,E);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case ya:return g=g.get(b.key===null?y:b.key)||null,l(x,g,b,E);case pi:return g=g.get(b.key===null?y:b.key)||null,u(x,g,b,E);case Zn:var C=b._init;return p(g,x,y,C(b._payload),E)}if(Ts(b)||ms(b))return g=g.get(y)||null,c(x,g,b,E,null);Pa(x,b)}return null}function m(g,x,y,b){for(var E=null,C=null,_=x,k=x=0,I=null;_!==null&&k<y.length;k++){_.index>k?(I=_,_=null):I=_.sibling;var F=f(g,_,y[k],b);if(F===null){_===null&&(_=I);break}e&&_&&F.alternate===null&&t(g,_),x=s(F,x,k),C===null?E=F:C.sibling=F,C=F,_=I}if(k===y.length)return n(g,_),be&&Pr(g,k),E;if(_===null){for(;k<y.length;k++)_=d(g,y[k],b),_!==null&&(x=s(_,x,k),C===null?E=_:C.sibling=_,C=_);return be&&Pr(g,k),E}for(_=r(g,_);k<y.length;k++)I=p(_,g,k,y[k],b),I!==null&&(e&&I.alternate!==null&&_.delete(I.key===null?k:I.key),x=s(I,x,k),C===null?E=I:C.sibling=I,C=I);return e&&_.forEach(function(S){return t(g,S)}),be&&Pr(g,k),E}function v(g,x,y,b){var E=ms(y);if(typeof E!="function")throw Error(B(150));if(y=E.call(y),y==null)throw Error(B(151));for(var C=E=null,_=x,k=x=0,I=null,F=y.next();_!==null&&!F.done;k++,F=y.next()){_.index>k?(I=_,_=null):I=_.sibling;var S=f(g,_,F.value,b);if(S===null){_===null&&(_=I);break}e&&_&&S.alternate===null&&t(g,_),x=s(S,x,k),C===null?E=S:C.sibling=S,C=S,_=I}if(F.done)return n(g,_),be&&Pr(g,k),E;if(_===null){for(;!F.done;k++,F=y.next())F=d(g,F.value,b),F!==null&&(x=s(F,x,k),C===null?E=F:C.sibling=F,C=F);return be&&Pr(g,k),E}for(_=r(g,_);!F.done;k++,F=y.next())F=p(_,g,k,F.value,b),F!==null&&(e&&F.alternate!==null&&_.delete(F.key===null?k:F.key),x=s(F,x,k),C===null?E=F:C.sibling=F,C=F);return e&&_.forEach(function(P){return t(g,P)}),be&&Pr(g,k),E}function w(g,x,y,b){if(typeof y=="object"&&y!==null&&y.type===mi&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ya:e:{for(var E=y.key,C=x;C!==null;){if(C.key===E){if(E=y.type,E===mi){if(C.tag===7){n(g,C.sibling),x=i(C,y.props.children),x.return=g,g=x;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Zn&&Hx(E)===C.type){n(g,C.sibling),x=i(C,y.props),x.ref=ws(g,C,y),x.return=g,g=x;break e}n(g,C);break}else t(g,C);C=C.sibling}y.type===mi?(x=$r(y.props.children,g.mode,b,y.key),x.return=g,g=x):(b=al(y.type,y.key,y.props,null,g.mode,b),b.ref=ws(g,x,y),b.return=g,g=b)}return o(g);case pi:e:{for(C=y.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===y.containerInfo&&x.stateNode.implementation===y.implementation){n(g,x.sibling),x=i(x,y.children||[]),x.return=g,g=x;break e}else{n(g,x);break}else t(g,x);x=x.sibling}x=$c(y,g.mode,b),x.return=g,g=x}return o(g);case Zn:return C=y._init,w(g,x,C(y._payload),b)}if(Ts(y))return m(g,x,y,b);if(ms(y))return v(g,x,y,b);Pa(g,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,x!==null&&x.tag===6?(n(g,x.sibling),x=i(x,y),x.return=g,g=x):(n(g,x),x=Vc(y,g.mode,b),x.return=g,g=x),o(g)):n(g,x)}return w}var Ui=yk(!0),vk=yk(!1),Tl=Sr(null),Ml=null,Si=null,av=null;function lv(){av=Si=Ml=null}function uv(e){var t=Tl.current;ve(Tl),e._currentValue=t}function qg(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Li(e,t){Ml=e,av=Si=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(lt=!0),e.firstContext=null)}function At(e){var t=e._currentValue;if(av!==e)if(e={context:e,memoizedValue:t,next:null},Si===null){if(Ml===null)throw Error(B(308));Si=e,Ml.dependencies={lanes:0,firstContext:e}}else Si=Si.next=e;return t}var Dr=null;function cv(e){Dr===null?Dr=[e]:Dr.push(e)}function xk(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,cv(t)):(n.next=i.next,i.next=n),t.interleaved=n,An(e,r)}function An(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Jn=!1;function dv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function wk(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Cn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function cr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,An(e,n)}return i=r.interleaved,i===null?(t.next=t,cv(r)):(t.next=i.next,i.next=t),r.interleaved=t,An(e,n)}function tl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xy(e,n)}}function Ux(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Al(e,t,n,r){var i=e.updateQueue;Jn=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var f=a.lane,p=a.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,v=a;switch(f=t,p=n,v.tag){case 1:if(m=v.payload,typeof m=="function"){d=m.call(p,d,f);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=v.payload,f=typeof m=="function"?m.call(p,d,f):m,f==null)break e;d=Pe({},d,f);break e;case 2:Jn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Yr|=o,e.lanes=o,e.memoizedState=d}}function Wx(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(B(191,i));i.call(r)}}}var Uo={},on=Sr(Uo),vo=Sr(Uo),xo=Sr(Uo);function Or(e){if(e===Uo)throw Error(B(174));return e}function fv(e,t){switch(ge(xo,t),ge(vo,e),ge(on,Uo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:xg(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=xg(t,e)}ve(on),ge(on,t)}function Wi(){ve(on),ve(vo),ve(xo)}function bk(e){Or(xo.current);var t=Or(on.current),n=xg(t,e.type);t!==n&&(ge(vo,e),ge(on,n))}function hv(e){vo.current===e&&(ve(on),ve(vo))}var Ee=Sr(0);function Il(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Rc=[];function pv(){for(var e=0;e<Rc.length;e++)Rc[e]._workInProgressVersionPrimary=null;Rc.length=0}var nl=qn.ReactCurrentDispatcher,Dc=qn.ReactCurrentBatchConfig,Gr=0,ke=null,qe=null,$e=null,Rl=!1,Ks=!1,wo=0,lD=0;function Ke(){throw Error(B(321))}function mv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gt(e[n],t[n]))return!1;return!0}function gv(e,t,n,r,i,s){if(Gr=s,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nl.current=e===null||e.memoizedState===null?fD:hD,e=n(r,i),Ks){s=0;do{if(Ks=!1,wo=0,25<=s)throw Error(B(301));s+=1,$e=qe=null,t.updateQueue=null,nl.current=pD,e=n(r,i)}while(Ks)}if(nl.current=Dl,t=qe!==null&&qe.next!==null,Gr=0,$e=qe=ke=null,Rl=!1,t)throw Error(B(300));return e}function yv(){var e=wo!==0;return wo=0,e}function en(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $e===null?ke.memoizedState=$e=e:$e=$e.next=e,$e}function It(){if(qe===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=$e===null?ke.memoizedState:$e.next;if(t!==null)$e=t,qe=e;else{if(e===null)throw Error(B(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},$e===null?ke.memoizedState=$e=e:$e=$e.next=e}return $e}function bo(e,t){return typeof t=="function"?t(e):t}function Oc(e){var t=It(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=qe,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,u=s;do{var c=u.lane;if((Gr&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,ke.lanes|=c,Yr|=c}u=u.next}while(u!==null&&u!==s);l===null?o=r:l.next=a,Gt(r,t.memoizedState)||(lt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,ke.lanes|=s,Yr|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Lc(e){var t=It(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Gt(s,t.memoizedState)||(lt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function _k(){}function Sk(e,t){var n=ke,r=It(),i=t(),s=!Gt(r.memoizedState,i);if(s&&(r.memoizedState=i,lt=!0),r=r.queue,vv(Ck.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||$e!==null&&$e.memoizedState.tag&1){if(n.flags|=2048,_o(9,Ek.bind(null,n,r,i,t),void 0,null),ze===null)throw Error(B(349));Gr&30||Nk(n,t,i)}return i}function Nk(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ek(e,t,n,r){t.value=n,t.getSnapshot=r,kk(t)&&Pk(e)}function Ck(e,t,n){return n(function(){kk(t)&&Pk(e)})}function kk(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gt(e,n)}catch{return!0}}function Pk(e){var t=An(e,1);t!==null&&Wt(t,e,1,-1)}function Gx(e){var t=en();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bo,lastRenderedState:e},t.queue=e,e=e.dispatch=dD.bind(null,ke,e),[t.memoizedState,e]}function _o(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ke.updateQueue,t===null?(t={lastEffect:null,stores:null},ke.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function jk(){return It().memoizedState}function rl(e,t,n,r){var i=en();ke.flags|=e,i.memoizedState=_o(1|t,n,void 0,r===void 0?null:r)}function bu(e,t,n,r){var i=It();r=r===void 0?null:r;var s=void 0;if(qe!==null){var o=qe.memoizedState;if(s=o.destroy,r!==null&&mv(r,o.deps)){i.memoizedState=_o(t,n,s,r);return}}ke.flags|=e,i.memoizedState=_o(1|t,n,s,r)}function Yx(e,t){return rl(8390656,8,e,t)}function vv(e,t){return bu(2048,8,e,t)}function Tk(e,t){return bu(4,2,e,t)}function Mk(e,t){return bu(4,4,e,t)}function Ak(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Ik(e,t,n){return n=n!=null?n.concat([e]):null,bu(4,4,Ak.bind(null,t,e),n)}function xv(){}function Rk(e,t){var n=It();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&mv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Dk(e,t){var n=It();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&mv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ok(e,t,n){return Gr&21?(Gt(n,t)||(n=$C(),ke.lanes|=n,Yr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,lt=!0),e.memoizedState=n)}function uD(e,t){var n=me;me=n!==0&&4>n?n:4,e(!0);var r=Dc.transition;Dc.transition={};try{e(!1),t()}finally{me=n,Dc.transition=r}}function Lk(){return It().memoizedState}function cD(e,t,n){var r=fr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Fk(e))qk(t,n);else if(n=xk(e,t,n,r),n!==null){var i=rt();Wt(n,e,r,i),Vk(n,t,r)}}function dD(e,t,n){var r=fr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Fk(e))qk(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Gt(a,o)){var l=t.interleaved;l===null?(i.next=i,cv(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=xk(e,t,i,r),n!==null&&(i=rt(),Wt(n,e,r,i),Vk(n,t,r))}}function Fk(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function qk(e,t){Ks=Rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vk(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Xy(e,n)}}var Dl={readContext:At,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useInsertionEffect:Ke,useLayoutEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useMutableSource:Ke,useSyncExternalStore:Ke,useId:Ke,unstable_isNewReconciler:!1},fD={readContext:At,useCallback:function(e,t){return en().memoizedState=[e,t===void 0?null:t],e},useContext:At,useEffect:Yx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,rl(4194308,4,Ak.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rl(4194308,4,e,t)},useInsertionEffect:function(e,t){return rl(4,2,e,t)},useMemo:function(e,t){var n=en();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=en();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=cD.bind(null,ke,e),[r.memoizedState,e]},useRef:function(e){var t=en();return e={current:e},t.memoizedState=e},useState:Gx,useDebugValue:xv,useDeferredValue:function(e){return en().memoizedState=e},useTransition:function(){var e=Gx(!1),t=e[0];return e=uD.bind(null,e[1]),en().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ke,i=en();if(be){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),ze===null)throw Error(B(349));Gr&30||Nk(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Yx(Ck.bind(null,r,s,e),[e]),r.flags|=2048,_o(9,Ek.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=en(),t=ze.identifierPrefix;if(be){var n=_n,r=bn;n=(r&~(1<<32-Ut(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=wo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=lD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},hD={readContext:At,useCallback:Rk,useContext:At,useEffect:vv,useImperativeHandle:Ik,useInsertionEffect:Tk,useLayoutEffect:Mk,useMemo:Dk,useReducer:Oc,useRef:jk,useState:function(){return Oc(bo)},useDebugValue:xv,useDeferredValue:function(e){var t=It();return Ok(t,qe.memoizedState,e)},useTransition:function(){var e=Oc(bo)[0],t=It().memoizedState;return[e,t]},useMutableSource:_k,useSyncExternalStore:Sk,useId:Lk,unstable_isNewReconciler:!1},pD={readContext:At,useCallback:Rk,useContext:At,useEffect:vv,useImperativeHandle:Ik,useInsertionEffect:Tk,useLayoutEffect:Mk,useMemo:Dk,useReducer:Lc,useRef:jk,useState:function(){return Lc(bo)},useDebugValue:xv,useDeferredValue:function(e){var t=It();return qe===null?t.memoizedState=e:Ok(t,qe.memoizedState,e)},useTransition:function(){var e=Lc(bo)[0],t=It().memoizedState;return[e,t]},useMutableSource:_k,useSyncExternalStore:Sk,useId:Lk,unstable_isNewReconciler:!1};function Ft(e,t){if(e&&e.defaultProps){t=Pe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Vg(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Pe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _u={isMounted:function(e){return(e=e._reactInternals)?ni(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=rt(),i=fr(e),s=Cn(r,i);s.payload=t,n!=null&&(s.callback=n),t=cr(e,s,i),t!==null&&(Wt(t,e,i,r),tl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=rt(),i=fr(e),s=Cn(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=cr(e,s,i),t!==null&&(Wt(t,e,i,r),tl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=rt(),r=fr(e),i=Cn(n,r);i.tag=2,t!=null&&(i.callback=t),t=cr(e,i,r),t!==null&&(Wt(t,e,r,n),tl(t,e,r))}};function Kx(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!po(n,r)||!po(i,s):!0}function $k(e,t,n){var r=!1,i=gr,s=t.contextType;return typeof s=="object"&&s!==null?s=At(s):(i=dt(t)?Ur:et.current,r=t.contextTypes,s=(r=r!=null)?Bi(e,i):gr),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_u,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Xx(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&_u.enqueueReplaceState(t,t.state,null)}function $g(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},dv(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=At(s):(s=dt(t)?Ur:et.current,i.context=Bi(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Vg(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&_u.enqueueReplaceState(i,i.state,null),Al(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function Gi(e,t){try{var n="",r=t;do n+=zR(r),r=r.return;while(r);var i=n}catch(s){i=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function Fc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function zg(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var mD=typeof WeakMap=="function"?WeakMap:Map;function zk(e,t,n){n=Cn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ll||(Ll=!0,Zg=r),zg(e,t)},n}function Bk(e,t,n){n=Cn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){zg(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){zg(e,t),typeof r!="function"&&(dr===null?dr=new Set([this]):dr.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Qx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new mD;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=jD.bind(null,e,t,n),t.then(e,e))}function Zx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Jx(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Cn(-1,1),t.tag=2,cr(n,t,1))),n.lanes|=1),e)}var gD=qn.ReactCurrentOwner,lt=!1;function nt(e,t,n,r){t.child=e===null?vk(t,null,n,r):Ui(t,e.child,n,r)}function e1(e,t,n,r,i){n=n.render;var s=t.ref;return Li(t,i),r=gv(e,t,n,r,s,i),n=yv(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,In(e,t,i)):(be&&n&&iv(t),t.flags|=1,nt(e,t,r,i),t.child)}function t1(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!kv(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Hk(e,t,s,r,i)):(e=al(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:po,n(o,r)&&e.ref===t.ref)return In(e,t,i)}return t.flags|=1,e=hr(s,r),e.ref=t.ref,e.return=t,t.child=e}function Hk(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(po(s,r)&&e.ref===t.ref)if(lt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(lt=!0);else return t.lanes=e.lanes,In(e,t,i)}return Bg(e,t,n,r,i)}function Uk(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ge(Ei,pt),pt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ge(Ei,pt),pt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ge(Ei,pt),pt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ge(Ei,pt),pt|=r;return nt(e,t,i,n),t.child}function Wk(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Bg(e,t,n,r,i){var s=dt(n)?Ur:et.current;return s=Bi(t,s),Li(t,i),n=gv(e,t,n,r,s,i),r=yv(),e!==null&&!lt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,In(e,t,i)):(be&&r&&iv(t),t.flags|=1,nt(e,t,n,i),t.child)}function n1(e,t,n,r,i){if(dt(n)){var s=!0;kl(t)}else s=!1;if(Li(t,i),t.stateNode===null)il(e,t),$k(t,n,r),$g(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=At(u):(u=dt(n)?Ur:et.current,u=Bi(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Xx(t,o,r,u),Jn=!1;var f=t.memoizedState;o.state=f,Al(t,r,o,i),l=t.memoizedState,a!==r||f!==l||ct.current||Jn?(typeof c=="function"&&(Vg(t,n,c,r),l=t.memoizedState),(a=Jn||Kx(t,n,a,r,f,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,wk(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:Ft(t.type,a),o.props=u,d=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=At(l):(l=dt(n)?Ur:et.current,l=Bi(t,l));var p=n.getDerivedStateFromProps;(c=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&Xx(t,o,r,l),Jn=!1,f=t.memoizedState,o.state=f,Al(t,r,o,i);var m=t.memoizedState;a!==d||f!==m||ct.current||Jn?(typeof p=="function"&&(Vg(t,n,p,r),m=t.memoizedState),(u=Jn||Kx(t,n,u,r,f,m,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Hg(e,t,n,r,s,i)}function Hg(e,t,n,r,i,s){Wk(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&$x(t,n,!1),In(e,t,s);r=t.stateNode,gD.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ui(t,e.child,null,s),t.child=Ui(t,null,a,s)):nt(e,t,a,s),t.memoizedState=r.state,i&&$x(t,n,!0),t.child}function Gk(e){var t=e.stateNode;t.pendingContext?Vx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Vx(e,t.context,!1),fv(e,t.containerInfo)}function r1(e,t,n,r,i){return Hi(),ov(i),t.flags|=256,nt(e,t,n,r),t.child}var Ug={dehydrated:null,treeContext:null,retryLane:0};function Wg(e){return{baseLanes:e,cachePool:null,transitions:null}}function Yk(e,t,n){var r=t.pendingProps,i=Ee.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),ge(Ee,i&1),e===null)return Fg(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=Eu(o,r,0,null),e=$r(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Wg(n),t.memoizedState=Ug,e):wv(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return yD(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=hr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=hr(a,s):(s=$r(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Wg(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Ug,r}return s=e.child,e=s.sibling,r=hr(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function wv(e,t){return t=Eu({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ja(e,t,n,r){return r!==null&&ov(r),Ui(t,e.child,null,n),e=wv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function yD(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Fc(Error(B(422))),ja(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=Eu({mode:"visible",children:r.children},i,0,null),s=$r(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Ui(t,e.child,null,o),t.child.memoizedState=Wg(o),t.memoizedState=Ug,s);if(!(t.mode&1))return ja(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(B(419)),r=Fc(s,r,void 0),ja(e,t,o,r)}if(a=(o&e.childLanes)!==0,lt||a){if(r=ze,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,An(e,i),Wt(r,e,i,-1))}return Cv(),r=Fc(Error(B(421))),ja(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=TD.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,yt=ur(i.nextSibling),vt=t,be=!0,$t=null,e!==null&&(kt[Pt++]=bn,kt[Pt++]=_n,kt[Pt++]=Wr,bn=e.id,_n=e.overflow,Wr=t),t=wv(t,r.children),t.flags|=4096,t)}function i1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),qg(e.return,t,n)}function qc(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Kk(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(nt(e,t,r.children,n),r=Ee.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&i1(e,n,t);else if(e.tag===19)i1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ge(Ee,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Il(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),qc(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Il(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}qc(t,!0,n,null,s);break;case"together":qc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function il(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function In(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=hr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vD(e,t,n){switch(t.tag){case 3:Gk(t),Hi();break;case 5:bk(t);break;case 1:dt(t.type)&&kl(t);break;case 4:fv(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;ge(Tl,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ge(Ee,Ee.current&1),t.flags|=128,null):n&t.child.childLanes?Yk(e,t,n):(ge(Ee,Ee.current&1),e=In(e,t,n),e!==null?e.sibling:null);ge(Ee,Ee.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kk(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ge(Ee,Ee.current),r)break;return null;case 22:case 23:return t.lanes=0,Uk(e,t,n)}return In(e,t,n)}var Xk,Gg,Qk,Zk;Xk=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Gg=function(){};Qk=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Or(on.current);var s=null;switch(n){case"input":i=mg(e,i),r=mg(e,r),s=[];break;case"select":i=Pe({},i,{value:void 0}),r=Pe({},r,{value:void 0}),s=[];break;case"textarea":i=vg(e,i),r=vg(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=El)}wg(n,r);var o;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var a=i[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(oo.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var l=r[u];if(a=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(oo.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ye("scroll",e),s||a===l||(s=[])):(s=s||[]).push(u,l))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}};Zk=function(e,t,n,r){n!==r&&(t.flags|=4)};function bs(e,t){if(!be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xD(e,t,n){var r=t.pendingProps;switch(sv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return dt(t.type)&&Cl(),Xe(t),null;case 3:return r=t.stateNode,Wi(),ve(ct),ve(et),pv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ka(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$t!==null&&(ty($t),$t=null))),Gg(e,t),Xe(t),null;case 5:hv(t);var i=Or(xo.current);if(n=t.type,e!==null&&t.stateNode!=null)Qk(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Xe(t),null}if(e=Or(on.current),ka(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[nn]=t,r[yo]=s,e=(t.mode&1)!==0,n){case"dialog":ye("cancel",r),ye("close",r);break;case"iframe":case"object":case"embed":ye("load",r);break;case"video":case"audio":for(i=0;i<As.length;i++)ye(As[i],r);break;case"source":ye("error",r);break;case"img":case"image":case"link":ye("error",r),ye("load",r);break;case"details":ye("toggle",r);break;case"input":hx(r,s),ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ye("invalid",r);break;case"textarea":mx(r,s),ye("invalid",r)}wg(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Ca(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Ca(r.textContent,a,e),i=["children",""+a]):oo.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ye("scroll",r)}switch(n){case"input":va(r),px(r,s,!0);break;case"textarea":va(r),gx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=El)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=CC(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[nn]=t,e[yo]=r,Xk(e,t,!1,!1),t.stateNode=e;e:{switch(o=bg(n,r),n){case"dialog":ye("cancel",e),ye("close",e),i=r;break;case"iframe":case"object":case"embed":ye("load",e),i=r;break;case"video":case"audio":for(i=0;i<As.length;i++)ye(As[i],e);i=r;break;case"source":ye("error",e),i=r;break;case"img":case"image":case"link":ye("error",e),ye("load",e),i=r;break;case"details":ye("toggle",e),i=r;break;case"input":hx(e,r),i=mg(e,r),ye("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Pe({},r,{value:void 0}),ye("invalid",e);break;case"textarea":mx(e,r),i=vg(e,r),ye("invalid",e);break;default:i=r}wg(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?jC(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&kC(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ao(e,l):typeof l=="number"&&ao(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(oo.hasOwnProperty(s)?l!=null&&s==="onScroll"&&ye("scroll",e):l!=null&&Hy(e,s,l,o))}switch(n){case"input":va(e),px(e,r,!1);break;case"textarea":va(e),gx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+mr(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?Ii(e,!!r.multiple,s,!1):r.defaultValue!=null&&Ii(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=El)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)Zk(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Or(xo.current),Or(on.current),ka(t)){if(r=t.stateNode,n=t.memoizedProps,r[nn]=t,(s=r.nodeValue!==n)&&(e=vt,e!==null))switch(e.tag){case 3:Ca(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ca(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[nn]=t,t.stateNode=r}return Xe(t),null;case 13:if(ve(Ee),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(be&&yt!==null&&t.mode&1&&!(t.flags&128))gk(),Hi(),t.flags|=98560,s=!1;else if(s=ka(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(B(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(B(317));s[nn]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xe(t),s=!1}else $t!==null&&(ty($t),$t=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Ee.current&1?Ve===0&&(Ve=3):Cv())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return Wi(),Gg(e,t),e===null&&mo(t.stateNode.containerInfo),Xe(t),null;case 10:return uv(t.type._context),Xe(t),null;case 17:return dt(t.type)&&Cl(),Xe(t),null;case 19:if(ve(Ee),s=t.memoizedState,s===null)return Xe(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)bs(s,!1);else{if(Ve!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Il(e),o!==null){for(t.flags|=128,bs(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ge(Ee,Ee.current&1|2),t.child}e=e.sibling}s.tail!==null&&Ie()>Yi&&(t.flags|=128,r=!0,bs(s,!1),t.lanes=4194304)}else{if(!r)if(e=Il(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),bs(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!be)return Xe(t),null}else 2*Ie()-s.renderingStartTime>Yi&&n!==1073741824&&(t.flags|=128,r=!0,bs(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ie(),t.sibling=null,n=Ee.current,ge(Ee,r?n&1|2:n&1),t):(Xe(t),null);case 22:case 23:return Ev(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function wD(e,t){switch(sv(t),t.tag){case 1:return dt(t.type)&&Cl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(),ve(ct),ve(et),pv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return hv(t),null;case 13:if(ve(Ee),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ve(Ee),null;case 4:return Wi(),null;case 10:return uv(t.type._context),null;case 22:case 23:return Ev(),null;case 24:return null;default:return null}}var Ta=!1,Ze=!1,bD=typeof WeakSet=="function"?WeakSet:Set,G=null;function Ni(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Te(e,t,r)}else n.current=null}function Yg(e,t,n){try{n()}catch(r){Te(e,t,r)}}var s1=!1;function _D(e,t){if(Mg=_l,e=rk(),rv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=o),f===s&&++c===r&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ag={focusedElem:e,selectionRange:n},_l=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var v=m.memoizedProps,w=m.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ft(t.type,v),w);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(b){Te(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return m=s1,s1=!1,m}function Xs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Yg(t,n,s)}i=i.next}while(i!==r)}}function Su(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Kg(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Jk(e){var t=e.alternate;t!==null&&(e.alternate=null,Jk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[nn],delete t[yo],delete t[Dg],delete t[iD],delete t[sD])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function eP(e){return e.tag===5||e.tag===3||e.tag===4}function o1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||eP(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=El));else if(r!==4&&(e=e.child,e!==null))for(Xg(e,t,n),e=e.sibling;e!==null;)Xg(e,t,n),e=e.sibling}function Qg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Qg(e,t,n),e=e.sibling;e!==null;)Qg(e,t,n),e=e.sibling}var He=null,qt=!1;function Wn(e,t,n){for(n=n.child;n!==null;)tP(e,t,n),n=n.sibling}function tP(e,t,n){if(sn&&typeof sn.onCommitFiberUnmount=="function")try{sn.onCommitFiberUnmount(mu,n)}catch{}switch(n.tag){case 5:Ze||Ni(n,t);case 6:var r=He,i=qt;He=null,Wn(e,t,n),He=r,qt=i,He!==null&&(qt?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(qt?(e=He,n=n.stateNode,e.nodeType===8?Ac(e.parentNode,n):e.nodeType===1&&Ac(e,n),fo(e)):Ac(He,n.stateNode));break;case 4:r=He,i=qt,He=n.stateNode.containerInfo,qt=!0,Wn(e,t,n),He=r,qt=i;break;case 0:case 11:case 14:case 15:if(!Ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Yg(n,t,o),i=i.next}while(i!==r)}Wn(e,t,n);break;case 1:if(!Ze&&(Ni(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Te(n,t,a)}Wn(e,t,n);break;case 21:Wn(e,t,n);break;case 22:n.mode&1?(Ze=(r=Ze)||n.memoizedState!==null,Wn(e,t,n),Ze=r):Wn(e,t,n);break;default:Wn(e,t,n)}}function a1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bD),t.forEach(function(r){var i=MD.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ot(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:He=a.stateNode,qt=!1;break e;case 3:He=a.stateNode.containerInfo,qt=!0;break e;case 4:He=a.stateNode.containerInfo,qt=!0;break e}a=a.return}if(He===null)throw Error(B(160));tP(s,o,i),He=null,qt=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){Te(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)nP(t,e),t=t.sibling}function nP(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ot(t,e),Jt(e),r&4){try{Xs(3,e,e.return),Su(3,e)}catch(v){Te(e,e.return,v)}try{Xs(5,e,e.return)}catch(v){Te(e,e.return,v)}}break;case 1:Ot(t,e),Jt(e),r&512&&n!==null&&Ni(n,n.return);break;case 5:if(Ot(t,e),Jt(e),r&512&&n!==null&&Ni(n,n.return),e.flags&32){var i=e.stateNode;try{ao(i,"")}catch(v){Te(e,e.return,v)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&NC(i,s),bg(a,o);var u=bg(a,s);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?jC(i,d):c==="dangerouslySetInnerHTML"?kC(i,d):c==="children"?ao(i,d):Hy(i,c,d,u)}switch(a){case"input":gg(i,s);break;case"textarea":EC(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?Ii(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?Ii(i,!!s.multiple,s.defaultValue,!0):Ii(i,!!s.multiple,s.multiple?[]:"",!1))}i[yo]=s}catch(v){Te(e,e.return,v)}}break;case 6:if(Ot(t,e),Jt(e),r&4){if(e.stateNode===null)throw Error(B(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(v){Te(e,e.return,v)}}break;case 3:if(Ot(t,e),Jt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{fo(t.containerInfo)}catch(v){Te(e,e.return,v)}break;case 4:Ot(t,e),Jt(e);break;case 13:Ot(t,e),Jt(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Sv=Ie())),r&4&&a1(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ze=(u=Ze)||c,Ot(t,e),Ze=u):Ot(t,e),Jt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(G=e,c=e.child;c!==null;){for(d=G=c;G!==null;){switch(f=G,p=f.child,f.tag){case 0:case 11:case 14:case 15:Xs(4,f,f.return);break;case 1:Ni(f,f.return);var m=f.stateNode;if(typeof m.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(v){Te(r,n,v)}}break;case 5:Ni(f,f.return);break;case 22:if(f.memoizedState!==null){u1(d);continue}}p!==null?(p.return=f,G=p):u1(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=PC("display",o))}catch(v){Te(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){Te(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ot(t,e),Jt(e),r&4&&a1(e);break;case 21:break;default:Ot(t,e),Jt(e)}}function Jt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(eP(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(ao(i,""),r.flags&=-33);var s=o1(e);Qg(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=o1(e);Xg(e,a,o);break;default:throw Error(B(161))}}catch(l){Te(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function SD(e,t,n){G=e,rP(e)}function rP(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var i=G,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ta;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Ze;a=Ta;var u=Ze;if(Ta=o,(Ze=l)&&!u)for(G=i;G!==null;)o=G,l=o.child,o.tag===22&&o.memoizedState!==null?c1(i):l!==null?(l.return=o,G=l):c1(i);for(;s!==null;)G=s,rP(s),s=s.sibling;G=i,Ta=a,Ze=u}l1(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,G=s):l1(e)}}function l1(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ze||Su(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ze)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ft(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&Wx(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Wx(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&fo(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Ze||t.flags&512&&Kg(t)}catch(f){Te(t,t.return,f)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function u1(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function c1(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Su(4,t)}catch(l){Te(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Te(t,i,l)}}var s=t.return;try{Kg(t)}catch(l){Te(t,s,l)}break;case 5:var o=t.return;try{Kg(t)}catch(l){Te(t,o,l)}}}catch(l){Te(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var ND=Math.ceil,Ol=qn.ReactCurrentDispatcher,bv=qn.ReactCurrentOwner,Tt=qn.ReactCurrentBatchConfig,de=0,ze=null,De=null,We=0,pt=0,Ei=Sr(0),Ve=0,So=null,Yr=0,Nu=0,_v=0,Qs=null,at=null,Sv=0,Yi=1/0,xn=null,Ll=!1,Zg=null,dr=null,Ma=!1,sr=null,Fl=0,Zs=0,Jg=null,sl=-1,ol=0;function rt(){return de&6?Ie():sl!==-1?sl:sl=Ie()}function fr(e){return e.mode&1?de&2&&We!==0?We&-We:aD.transition!==null?(ol===0&&(ol=$C()),ol):(e=me,e!==0||(e=window.event,e=e===void 0?16:YC(e.type)),e):1}function Wt(e,t,n,r){if(50<Zs)throw Zs=0,Jg=null,Error(B(185));zo(e,n,r),(!(de&2)||e!==ze)&&(e===ze&&(!(de&2)&&(Nu|=n),Ve===4&&tr(e,We)),ft(e,r),n===1&&de===0&&!(t.mode&1)&&(Yi=Ie()+500,wu&&Nr()))}function ft(e,t){var n=e.callbackNode;a3(e,t);var r=bl(e,e===ze?We:0);if(r===0)n!==null&&xx(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&xx(n),t===1)e.tag===0?oD(d1.bind(null,e)):hk(d1.bind(null,e)),nD(function(){!(de&6)&&Nr()}),n=null;else{switch(zC(r)){case 1:n=Ky;break;case 4:n=qC;break;case 16:n=wl;break;case 536870912:n=VC;break;default:n=wl}n=dP(n,iP.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function iP(e,t){if(sl=-1,ol=0,de&6)throw Error(B(327));var n=e.callbackNode;if(Fi()&&e.callbackNode!==n)return null;var r=bl(e,e===ze?We:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ql(e,r);else{t=r;var i=de;de|=2;var s=oP();(ze!==e||We!==t)&&(xn=null,Yi=Ie()+500,Vr(e,t));do try{kD();break}catch(a){sP(e,a)}while(!0);lv(),Ol.current=s,de=i,De!==null?t=0:(ze=null,We=0,t=Ve)}if(t!==0){if(t===2&&(i=Cg(e),i!==0&&(r=i,t=ey(e,i))),t===1)throw n=So,Vr(e,0),tr(e,r),ft(e,Ie()),n;if(t===6)tr(e,r);else{if(i=e.current.alternate,!(r&30)&&!ED(i)&&(t=ql(e,r),t===2&&(s=Cg(e),s!==0&&(r=s,t=ey(e,s))),t===1))throw n=So,Vr(e,0),tr(e,r),ft(e,Ie()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:jr(e,at,xn);break;case 3:if(tr(e,r),(r&130023424)===r&&(t=Sv+500-Ie(),10<t)){if(bl(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){rt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Rg(jr.bind(null,e,at,xn),t);break}jr(e,at,xn);break;case 4:if(tr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Ut(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=Ie()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ND(r/1960))-r,10<r){e.timeoutHandle=Rg(jr.bind(null,e,at,xn),r);break}jr(e,at,xn);break;case 5:jr(e,at,xn);break;default:throw Error(B(329))}}}return ft(e,Ie()),e.callbackNode===n?iP.bind(null,e):null}function ey(e,t){var n=Qs;return e.current.memoizedState.isDehydrated&&(Vr(e,t).flags|=256),e=ql(e,t),e!==2&&(t=at,at=n,t!==null&&ty(t)),e}function ty(e){at===null?at=e:at.push.apply(at,e)}function ED(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Gt(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function tr(e,t){for(t&=~_v,t&=~Nu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Ut(t),r=1<<n;e[n]=-1,t&=~r}}function d1(e){if(de&6)throw Error(B(327));Fi();var t=bl(e,0);if(!(t&1))return ft(e,Ie()),null;var n=ql(e,t);if(e.tag!==0&&n===2){var r=Cg(e);r!==0&&(t=r,n=ey(e,r))}if(n===1)throw n=So,Vr(e,0),tr(e,t),ft(e,Ie()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,jr(e,at,xn),ft(e,Ie()),null}function Nv(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(Yi=Ie()+500,wu&&Nr())}}function Kr(e){sr!==null&&sr.tag===0&&!(de&6)&&Fi();var t=de;de|=1;var n=Tt.transition,r=me;try{if(Tt.transition=null,me=1,e)return e()}finally{me=r,Tt.transition=n,de=t,!(de&6)&&Nr()}}function Ev(){pt=Ei.current,ve(Ei)}function Vr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,tD(n)),De!==null)for(n=De.return;n!==null;){var r=n;switch(sv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Cl();break;case 3:Wi(),ve(ct),ve(et),pv();break;case 5:hv(r);break;case 4:Wi();break;case 13:ve(Ee);break;case 19:ve(Ee);break;case 10:uv(r.type._context);break;case 22:case 23:Ev()}n=n.return}if(ze=e,De=e=hr(e.current,null),We=pt=t,Ve=0,So=null,_v=Nu=Yr=0,at=Qs=null,Dr!==null){for(t=0;t<Dr.length;t++)if(n=Dr[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}Dr=null}return e}function sP(e,t){do{var n=De;try{if(lv(),nl.current=Dl,Rl){for(var r=ke.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rl=!1}if(Gr=0,$e=qe=ke=null,Ks=!1,wo=0,bv.current=null,n===null||n.return===null){Ve=1,So=t,De=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=We,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var p=Zx(o);if(p!==null){p.flags&=-257,Jx(p,o,a,s,t),p.mode&1&&Qx(s,u,t),t=p,l=u;var m=t.updateQueue;if(m===null){var v=new Set;v.add(l),t.updateQueue=v}else m.add(l);break e}else{if(!(t&1)){Qx(s,u,t),Cv();break e}l=Error(B(426))}}else if(be&&a.mode&1){var w=Zx(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Jx(w,o,a,s,t),ov(Gi(l,a));break e}}s=l=Gi(l,a),Ve!==4&&(Ve=2),Qs===null?Qs=[s]:Qs.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var g=zk(s,l,t);Ux(s,g);break e;case 1:a=l;var x=s.type,y=s.stateNode;if(!(s.flags&128)&&(typeof x.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(dr===null||!dr.has(y)))){s.flags|=65536,t&=-t,s.lanes|=t;var b=Bk(s,a,t);Ux(s,b);break e}}s=s.return}while(s!==null)}lP(n)}catch(E){t=E,De===n&&n!==null&&(De=n=n.return);continue}break}while(!0)}function oP(){var e=Ol.current;return Ol.current=Dl,e===null?Dl:e}function Cv(){(Ve===0||Ve===3||Ve===2)&&(Ve=4),ze===null||!(Yr&268435455)&&!(Nu&268435455)||tr(ze,We)}function ql(e,t){var n=de;de|=2;var r=oP();(ze!==e||We!==t)&&(xn=null,Vr(e,t));do try{CD();break}catch(i){sP(e,i)}while(!0);if(lv(),de=n,Ol.current=r,De!==null)throw Error(B(261));return ze=null,We=0,Ve}function CD(){for(;De!==null;)aP(De)}function kD(){for(;De!==null&&!ZR();)aP(De)}function aP(e){var t=cP(e.alternate,e,pt);e.memoizedProps=e.pendingProps,t===null?lP(e):De=t,bv.current=null}function lP(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=wD(n,t),n!==null){n.flags&=32767,De=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ve=6,De=null;return}}else if(n=xD(n,t,pt),n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Ve===0&&(Ve=5)}function jr(e,t,n){var r=me,i=Tt.transition;try{Tt.transition=null,me=1,PD(e,t,n,r)}finally{Tt.transition=i,me=r}return null}function PD(e,t,n,r){do Fi();while(sr!==null);if(de&6)throw Error(B(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(l3(e,s),e===ze&&(De=ze=null,We=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ma||(Ma=!0,dP(wl,function(){return Fi(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Tt.transition,Tt.transition=null;var o=me;me=1;var a=de;de|=4,bv.current=null,_D(e,n),nP(n,e),Y3(Ag),_l=!!Mg,Ag=Mg=null,e.current=n,SD(n),JR(),de=a,me=o,Tt.transition=s}else e.current=n;if(Ma&&(Ma=!1,sr=e,Fl=i),s=e.pendingLanes,s===0&&(dr=null),n3(n.stateNode),ft(e,Ie()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ll)throw Ll=!1,e=Zg,Zg=null,e;return Fl&1&&e.tag!==0&&Fi(),s=e.pendingLanes,s&1?e===Jg?Zs++:(Zs=0,Jg=e):Zs=0,Nr(),null}function Fi(){if(sr!==null){var e=zC(Fl),t=Tt.transition,n=me;try{if(Tt.transition=null,me=16>e?16:e,sr===null)var r=!1;else{if(e=sr,sr=null,Fl=0,de&6)throw Error(B(331));var i=de;for(de|=4,G=e.current;G!==null;){var s=G,o=s.child;if(G.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(G=u;G!==null;){var c=G;switch(c.tag){case 0:case 11:case 15:Xs(8,c,s)}var d=c.child;if(d!==null)d.return=c,G=d;else for(;G!==null;){c=G;var f=c.sibling,p=c.return;if(Jk(c),c===u){G=null;break}if(f!==null){f.return=p,G=f;break}G=p}}}var m=s.alternate;if(m!==null){var v=m.child;if(v!==null){m.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}G=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,G=o;else e:for(;G!==null;){if(s=G,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Xs(9,s,s.return)}var g=s.sibling;if(g!==null){g.return=s.return,G=g;break e}G=s.return}}var x=e.current;for(G=x;G!==null;){o=G;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,G=y;else e:for(o=x;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Su(9,a)}}catch(E){Te(a,a.return,E)}if(a===o){G=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,G=b;break e}G=a.return}}if(de=i,Nr(),sn&&typeof sn.onPostCommitFiberRoot=="function")try{sn.onPostCommitFiberRoot(mu,e)}catch{}r=!0}return r}finally{me=n,Tt.transition=t}}return!1}function f1(e,t,n){t=Gi(n,t),t=zk(e,t,1),e=cr(e,t,1),t=rt(),e!==null&&(zo(e,1,t),ft(e,t))}function Te(e,t,n){if(e.tag===3)f1(e,e,n);else for(;t!==null;){if(t.tag===3){f1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(dr===null||!dr.has(r))){e=Gi(n,e),e=Bk(t,e,1),t=cr(t,e,1),e=rt(),t!==null&&(zo(t,1,e),ft(t,e));break}}t=t.return}}function jD(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=rt(),e.pingedLanes|=e.suspendedLanes&n,ze===e&&(We&n)===n&&(Ve===4||Ve===3&&(We&130023424)===We&&500>Ie()-Sv?Vr(e,0):_v|=n),ft(e,t)}function uP(e,t){t===0&&(e.mode&1?(t=ba,ba<<=1,!(ba&130023424)&&(ba=4194304)):t=1);var n=rt();e=An(e,t),e!==null&&(zo(e,t,n),ft(e,n))}function TD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),uP(e,n)}function MD(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),uP(e,n)}var cP;cP=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return lt=!1,vD(e,t,n);lt=!!(e.flags&131072)}else lt=!1,be&&t.flags&1048576&&pk(t,jl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;il(e,t),e=t.pendingProps;var i=Bi(t,et.current);Li(t,n),i=gv(null,t,r,e,i,n);var s=yv();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,dt(r)?(s=!0,kl(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,dv(t),i.updater=_u,t.stateNode=i,i._reactInternals=t,$g(t,r,e,n),t=Hg(null,t,r,!0,s,n)):(t.tag=0,be&&s&&iv(t),nt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(il(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=ID(r),e=Ft(r,e),i){case 0:t=Bg(null,t,r,e,n);break e;case 1:t=n1(null,t,r,e,n);break e;case 11:t=e1(null,t,r,e,n);break e;case 14:t=t1(null,t,r,Ft(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),Bg(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),n1(e,t,r,i,n);case 3:e:{if(Gk(t),e===null)throw Error(B(387));r=t.pendingProps,s=t.memoizedState,i=s.element,wk(e,t),Al(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Gi(Error(B(423)),t),t=r1(e,t,r,n,i);break e}else if(r!==i){i=Gi(Error(B(424)),t),t=r1(e,t,r,n,i);break e}else for(yt=ur(t.stateNode.containerInfo.firstChild),vt=t,be=!0,$t=null,n=vk(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hi(),r===i){t=In(e,t,n);break e}nt(e,t,r,n)}t=t.child}return t;case 5:return bk(t),e===null&&Fg(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,Ig(r,i)?o=null:s!==null&&Ig(r,s)&&(t.flags|=32),Wk(e,t),nt(e,t,o,n),t.child;case 6:return e===null&&Fg(t),null;case 13:return Yk(e,t,n);case 4:return fv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ui(t,null,r,n):nt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),e1(e,t,r,i,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,ge(Tl,r._currentValue),r._currentValue=o,s!==null)if(Gt(s.value,o)){if(s.children===i.children&&!ct.current){t=In(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Cn(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),qg(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(B(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),qg(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}nt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Li(t,n),i=At(i),r=r(i),t.flags|=1,nt(e,t,r,n),t.child;case 14:return r=t.type,i=Ft(r,t.pendingProps),i=Ft(r.type,i),t1(e,t,r,i,n);case 15:return Hk(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ft(r,i),il(e,t),t.tag=1,dt(r)?(e=!0,kl(t)):e=!1,Li(t,n),$k(t,r,i),$g(t,r,i,n),Hg(null,t,r,!0,e,n);case 19:return Kk(e,t,n);case 22:return Uk(e,t,n)}throw Error(B(156,t.tag))};function dP(e,t){return FC(e,t)}function AD(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jt(e,t,n,r){return new AD(e,t,n,r)}function kv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ID(e){if(typeof e=="function")return kv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Wy)return 11;if(e===Gy)return 14}return 2}function hr(e,t){var n=e.alternate;return n===null?(n=jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function al(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")kv(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case mi:return $r(n.children,i,s,t);case Uy:o=8,i|=8;break;case dg:return e=jt(12,n,t,i|2),e.elementType=dg,e.lanes=s,e;case fg:return e=jt(13,n,t,i),e.elementType=fg,e.lanes=s,e;case hg:return e=jt(19,n,t,i),e.elementType=hg,e.lanes=s,e;case bC:return Eu(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xC:o=10;break e;case wC:o=9;break e;case Wy:o=11;break e;case Gy:o=14;break e;case Zn:o=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=jt(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function $r(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function Eu(e,t,n,r){return e=jt(22,e,r,t),e.elementType=bC,e.lanes=n,e.stateNode={isHidden:!1},e}function Vc(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function $c(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function RD(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=bc(0),this.expirationTimes=bc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bc(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Pv(e,t,n,r,i,s,o,a,l){return e=new RD(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=jt(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},dv(s),e}function DD(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pi,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function fP(e){if(!e)return gr;e=e._reactInternals;e:{if(ni(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(dt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(dt(n))return fk(e,n,t)}return t}function hP(e,t,n,r,i,s,o,a,l){return e=Pv(n,r,!0,e,i,s,o,a,l),e.context=fP(null),n=e.current,r=rt(),i=fr(n),s=Cn(r,i),s.callback=t??null,cr(n,s,i),e.current.lanes=i,zo(e,i,r),ft(e,r),e}function Cu(e,t,n,r){var i=t.current,s=rt(),o=fr(i);return n=fP(n),t.context===null?t.context=n:t.pendingContext=n,t=Cn(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=cr(i,t,o),e!==null&&(Wt(e,i,o,s),tl(e,i,o)),o}function Vl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function h1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function jv(e,t){h1(e,t),(e=e.alternate)&&h1(e,t)}function OD(){return null}var pP=typeof reportError=="function"?reportError:function(e){console.error(e)};function Tv(e){this._internalRoot=e}ku.prototype.render=Tv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Cu(e,t,null,null)};ku.prototype.unmount=Tv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kr(function(){Cu(null,e,null,null)}),t[Mn]=null}};function ku(e){this._internalRoot=e}ku.prototype.unstable_scheduleHydration=function(e){if(e){var t=UC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<er.length&&t!==0&&t<er[n].priority;n++);er.splice(n,0,e),n===0&&GC(e)}};function Mv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Pu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function p1(){}function LD(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var u=Vl(o);s.call(u)}}var o=hP(t,r,e,0,null,!1,!1,"",p1);return e._reactRootContainer=o,e[Mn]=o.current,mo(e.nodeType===8?e.parentNode:e),Kr(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var u=Vl(l);a.call(u)}}var l=Pv(e,0,!1,null,null,!1,!1,"",p1);return e._reactRootContainer=l,e[Mn]=l.current,mo(e.nodeType===8?e.parentNode:e),Kr(function(){Cu(t,l,n,r)}),l}function ju(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=Vl(o);a.call(l)}}Cu(t,o,e,i)}else o=LD(n,t,e,i,r);return Vl(o)}BC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ms(t.pendingLanes);n!==0&&(Xy(t,n|1),ft(t,Ie()),!(de&6)&&(Yi=Ie()+500,Nr()))}break;case 13:Kr(function(){var r=An(e,1);if(r!==null){var i=rt();Wt(r,e,1,i)}}),jv(e,1)}};Qy=function(e){if(e.tag===13){var t=An(e,134217728);if(t!==null){var n=rt();Wt(t,e,134217728,n)}jv(e,134217728)}};HC=function(e){if(e.tag===13){var t=fr(e),n=An(e,t);if(n!==null){var r=rt();Wt(n,e,t,r)}jv(e,t)}};UC=function(){return me};WC=function(e,t){var n=me;try{return me=e,t()}finally{me=n}};Sg=function(e,t,n){switch(t){case"input":if(gg(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=xu(r);if(!i)throw Error(B(90));SC(r),gg(r,i)}}}break;case"textarea":EC(e,n);break;case"select":t=n.value,t!=null&&Ii(e,!!n.multiple,t,!1)}};AC=Nv;IC=Kr;var FD={usingClientEntryPoint:!1,Events:[Ho,xi,xu,TC,MC,Nv]},_s={findFiberByHostInstance:Rr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},qD={bundleType:_s.bundleType,version:_s.version,rendererPackageName:_s.rendererPackageName,rendererConfig:_s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=OC(e),e===null?null:e.stateNode},findFiberByHostInstance:_s.findFiberByHostInstance||OD,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 Aa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Aa.isDisabled&&Aa.supportsFiber)try{mu=Aa.inject(qD),sn=Aa}catch{}}St.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FD;St.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Mv(t))throw Error(B(200));return DD(e,t,null,n)};St.createRoot=function(e,t){if(!Mv(e))throw Error(B(299));var n=!1,r="",i=pP;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=Pv(e,1,!1,null,null,n,!1,r,i),e[Mn]=t.current,mo(e.nodeType===8?e.parentNode:e),new Tv(t)};St.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=OC(t),e=e===null?null:e.stateNode,e};St.flushSync=function(e){return Kr(e)};St.hydrate=function(e,t,n){if(!Pu(t))throw Error(B(200));return ju(null,e,t,!0,n)};St.hydrateRoot=function(e,t,n){if(!Mv(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=pP;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=hP(t,null,e,1,n??null,i,!1,s,o),e[Mn]=t.current,mo(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new ku(t)};St.render=function(e,t,n){if(!Pu(t))throw Error(B(200));return ju(null,e,t,!1,n)};St.unmountComponentAtNode=function(e){if(!Pu(e))throw Error(B(40));return e._reactRootContainer?(Kr(function(){ju(null,null,e,!1,function(){e._reactRootContainer=null,e[Mn]=null})}),!0):!1};St.unstable_batchedUpdates=Nv;St.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Pu(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return ju(e,t,n,!1,r)};St.version="18.3.1-next-f1338f8080-20240426";function mP(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mP)}catch(e){console.error(e)}}mP(),mC.exports=St;var Av=mC.exports,m1=Av;ug.createRoot=m1.createRoot,ug.hydrateRoot=m1.hydrateRoot;function Oe(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Oe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var VD={value:()=>{}};function Tu(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new ll(n)}function ll(e){this._=e}function $D(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ll.prototype=Tu.prototype={constructor:ll,on:function(e,t){var n=this._,r=$D(e+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(e=r[s]).type)&&(i=zD(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(i=(e=r[s]).type)n[i]=g1(n[i],e.name,t);else if(t==null)for(i in n)n[i]=g1(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new ll(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function zD(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function g1(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=VD,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var ny="http://www.w3.org/1999/xhtml";const y1={svg:"http://www.w3.org/2000/svg",xhtml:ny,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Mu(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),y1.hasOwnProperty(t)?{space:y1[t],local:e}:e}function BD(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===ny&&t.documentElement.namespaceURI===ny?t.createElement(e):t.createElementNS(n,e)}}function HD(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gP(e){var t=Mu(e);return(t.local?HD:BD)(t)}function UD(){}function Iv(e){return e==null?UD:function(){return this.querySelector(e)}}function WD(e){typeof e!="function"&&(e=Iv(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=new Array(o),l,u,c=0;c<o;++c)(l=s[c])&&(u=e.call(l,l.__data__,c,s))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new bt(r,this._parents)}function GD(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function YD(){return[]}function yP(e){return e==null?YD:function(){return this.querySelectorAll(e)}}function KD(e){return function(){return GD(e.apply(this,arguments))}}function XD(e){typeof e=="function"?e=KD(e):e=yP(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var o=t[s],a=o.length,l,u=0;u<a;++u)(l=o[u])&&(r.push(e.call(l,l.__data__,u,o)),i.push(l));return new bt(r,i)}function vP(e){return function(){return this.matches(e)}}function xP(e){return function(t){return t.matches(e)}}var QD=Array.prototype.find;function ZD(e){return function(){return QD.call(this.children,e)}}function JD(){return this.firstElementChild}function eO(e){return this.select(e==null?JD:ZD(typeof e=="function"?e:xP(e)))}var tO=Array.prototype.filter;function nO(){return Array.from(this.children)}function rO(e){return function(){return tO.call(this.children,e)}}function iO(e){return this.selectAll(e==null?nO:rO(typeof e=="function"?e:xP(e)))}function sO(e){typeof e!="function"&&(e=vP(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=[],l,u=0;u<o;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&a.push(l);return new bt(r,this._parents)}function wP(e){return new Array(e.length)}function oO(){return new bt(this._enter||this._groups.map(wP),this._parents)}function $l(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}$l.prototype={constructor:$l,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 aO(e){return function(){return e}}function lO(e,t,n,r,i,s){for(var o=0,a,l=t.length,u=s.length;o<u;++o)(a=t[o])?(a.__data__=s[o],r[o]=a):n[o]=new $l(e,s[o]);for(;o<l;++o)(a=t[o])&&(i[o]=a)}function uO(e,t,n,r,i,s,o){var a,l,u=new Map,c=t.length,d=s.length,f=new Array(c),p;for(a=0;a<c;++a)(l=t[a])&&(f[a]=p=o.call(l,l.__data__,a,t)+"",u.has(p)?i[a]=l:u.set(p,l));for(a=0;a<d;++a)p=o.call(e,s[a],a,s)+"",(l=u.get(p))?(r[a]=l,l.__data__=s[a],u.delete(p)):n[a]=new $l(e,s[a]);for(a=0;a<c;++a)(l=t[a])&&u.get(f[a])===l&&(i[a]=l)}function cO(e){return e.__data__}function dO(e,t){if(!arguments.length)return Array.from(this,cO);var n=t?uO:lO,r=this._parents,i=this._groups;typeof e!="function"&&(e=aO(e));for(var s=i.length,o=new Array(s),a=new Array(s),l=new Array(s),u=0;u<s;++u){var c=r[u],d=i[u],f=d.length,p=fO(e.call(c,c&&c.__data__,u,r)),m=p.length,v=a[u]=new Array(m),w=o[u]=new Array(m),g=l[u]=new Array(f);n(c,d,v,w,g,p,t);for(var x=0,y=0,b,E;x<m;++x)if(b=v[x]){for(x>=y&&(y=x+1);!(E=w[y])&&++y<m;);b._next=E||null}}return o=new bt(o,r),o._enter=a,o._exit=l,o}function fO(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function hO(){return new bt(this._exit||this._groups.map(wP),this._parents)}function pO(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function mO(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,o=Math.min(i,s),a=new Array(i),l=0;l<o;++l)for(var u=n[l],c=r[l],d=u.length,f=a[l]=new Array(d),p,m=0;m<d;++m)(p=u[m]||c[m])&&(f[m]=p);for(;l<i;++l)a[l]=n[l];return new bt(a,this._parents)}function gO(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function yO(e){e||(e=vO);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],a=o.length,l=i[s]=new Array(a),u,c=0;c<a;++c)(u=o[c])&&(l[c]=u);l.sort(t)}return new bt(i,this._parents).order()}function vO(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function xO(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wO(){return Array.from(this)}function bO(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function _O(){let e=0;for(const t of this)++e;return e}function SO(){return!this.node()}function NO(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,o=i.length,a;s<o;++s)(a=i[s])&&e.call(a,a.__data__,s,i);return this}function EO(e){return function(){this.removeAttribute(e)}}function CO(e){return function(){this.removeAttributeNS(e.space,e.local)}}function kO(e,t){return function(){this.setAttribute(e,t)}}function PO(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function jO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function TO(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function MO(e,t){var n=Mu(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?CO:EO:typeof t=="function"?n.local?TO:jO:n.local?PO:kO)(n,t))}function bP(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function AO(e){return function(){this.style.removeProperty(e)}}function IO(e,t,n){return function(){this.style.setProperty(e,t,n)}}function RO(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function DO(e,t,n){return arguments.length>1?this.each((t==null?AO:typeof t=="function"?RO:IO)(e,t,n??"")):Ki(this.node(),e)}function Ki(e,t){return e.style.getPropertyValue(t)||bP(e).getComputedStyle(e,null).getPropertyValue(t)}function OO(e){return function(){delete this[e]}}function LO(e,t){return function(){this[e]=t}}function FO(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function qO(e,t){return arguments.length>1?this.each((t==null?OO:typeof t=="function"?FO:LO)(e,t)):this.node()[e]}function _P(e){return e.trim().split(/^|\s+/)}function Rv(e){return e.classList||new SP(e)}function SP(e){this._node=e,this._names=_P(e.getAttribute("class")||"")}SP.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 NP(e,t){for(var n=Rv(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function EP(e,t){for(var n=Rv(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function VO(e){return function(){NP(this,e)}}function $O(e){return function(){EP(this,e)}}function zO(e,t){return function(){(t.apply(this,arguments)?NP:EP)(this,e)}}function BO(e,t){var n=_P(e+"");if(arguments.length<2){for(var r=Rv(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?zO:t?VO:$O)(n,t))}function HO(){this.textContent=""}function UO(e){return function(){this.textContent=e}}function WO(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function GO(e){return arguments.length?this.each(e==null?HO:(typeof e=="function"?WO:UO)(e)):this.node().textContent}function YO(){this.innerHTML=""}function KO(e){return function(){this.innerHTML=e}}function XO(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function QO(e){return arguments.length?this.each(e==null?YO:(typeof e=="function"?XO:KO)(e)):this.node().innerHTML}function ZO(){this.nextSibling&&this.parentNode.appendChild(this)}function JO(){return this.each(ZO)}function e4(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function t4(){return this.each(e4)}function n4(e){var t=typeof e=="function"?e:gP(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function r4(){return null}function i4(e,t){var n=typeof e=="function"?e:gP(e),r=t==null?r4:typeof t=="function"?t:Iv(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function s4(){var e=this.parentNode;e&&e.removeChild(this)}function o4(){return this.each(s4)}function a4(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function l4(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function u4(e){return this.select(e?l4:a4)}function c4(e){return arguments.length?this.property("__data__",e):this.node().__data__}function d4(e){return function(t){e.call(this,t,this.__data__)}}function f4(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function h4(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function p4(e,t,n){return function(){var r=this.__on,i,s=d4(t);if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function m4(e,t,n){var r=f4(e+""),i,s=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<s;++i)if((o=r[i]).type===c.type&&o.name===c.name)return c.value}return}for(a=t?p4:h4,i=0;i<s;++i)this.each(a(r[i],t,n));return this}function CP(e,t,n){var r=bP(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function g4(e,t){return function(){return CP(this,e,t)}}function y4(e,t){return function(){return CP(this,e,t.apply(this,arguments))}}function v4(e,t){return this.each((typeof t=="function"?y4:g4)(e,t))}function*x4(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var kP=[null];function bt(e,t){this._groups=e,this._parents=t}function Wo(){return new bt([[document.documentElement]],kP)}function w4(){return this}bt.prototype=Wo.prototype={constructor:bt,select:WD,selectAll:XD,selectChild:eO,selectChildren:iO,filter:sO,data:dO,enter:oO,exit:hO,join:pO,merge:mO,selection:w4,order:gO,sort:yO,call:xO,nodes:wO,node:bO,size:_O,empty:SO,each:NO,attr:MO,style:DO,property:qO,classed:BO,text:GO,html:QO,raise:JO,lower:t4,append:n4,insert:i4,remove:o4,clone:u4,datum:c4,on:m4,dispatch:v4,[Symbol.iterator]:x4};function gt(e){return typeof e=="string"?new bt([[document.querySelector(e)]],[document.documentElement]):new bt([[e]],kP)}function b4(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Vt(e,t){if(e=b4(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const _4={passive:!1},No={capture:!0,passive:!1};function zc(e){e.stopImmediatePropagation()}function qi(e){e.preventDefault(),e.stopImmediatePropagation()}function PP(e){var t=e.document.documentElement,n=gt(e).on("dragstart.drag",qi,No);"onselectstart"in t?n.on("selectstart.drag",qi,No):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function jP(e,t){var n=e.document.documentElement,r=gt(e).on("dragstart.drag",null);t&&(r.on("click.drag",qi,No),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ia=e=>()=>e;function ry(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:o,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}ry.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function S4(e){return!e.ctrlKey&&!e.button}function N4(){return this.parentNode}function E4(e,t){return t??{x:e.x,y:e.y}}function C4(){return navigator.maxTouchPoints||"ontouchstart"in this}function TP(){var e=S4,t=N4,n=E4,r=C4,i={},s=Tu("start","drag","end"),o=0,a,l,u,c,d=0;function f(b){b.on("mousedown.drag",p).filter(r).on("touchstart.drag",w).on("touchmove.drag",g,_4).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,E){if(!(c||!e.call(this,b,E))){var C=y(this,t.call(this,b,E),b,E,"mouse");C&&(gt(b.view).on("mousemove.drag",m,No).on("mouseup.drag",v,No),PP(b.view),zc(b),u=!1,a=b.clientX,l=b.clientY,C("start",b))}}function m(b){if(qi(b),!u){var E=b.clientX-a,C=b.clientY-l;u=E*E+C*C>d}i.mouse("drag",b)}function v(b){gt(b.view).on("mousemove.drag mouseup.drag",null),jP(b.view,u),qi(b),i.mouse("end",b)}function w(b,E){if(e.call(this,b,E)){var C=b.changedTouches,_=t.call(this,b,E),k=C.length,I,F;for(I=0;I<k;++I)(F=y(this,_,b,E,C[I].identifier,C[I]))&&(zc(b),F("start",b,C[I]))}}function g(b){var E=b.changedTouches,C=E.length,_,k;for(_=0;_<C;++_)(k=i[E[_].identifier])&&(qi(b),k("drag",b,E[_]))}function x(b){var E=b.changedTouches,C=E.length,_,k;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),_=0;_<C;++_)(k=i[E[_].identifier])&&(zc(b),k("end",b,E[_]))}function y(b,E,C,_,k,I){var F=s.copy(),S=Vt(I||C,E),P,L,N;if((N=n.call(b,new ry("beforestart",{sourceEvent:C,target:f,identifier:k,active:o,x:S[0],y:S[1],dx:0,dy:0,dispatch:F}),_))!=null)return P=N.x-S[0]||0,L=N.y-S[1]||0,function A(R,O,j){var M=S,q;switch(R){case"start":i[k]=A,q=o++;break;case"end":delete i[k],--o;case"drag":S=Vt(j||O,E),q=o;break}F.call(R,b,new ry(R,{sourceEvent:O,subject:N,target:f,identifier:k,active:q,x:S[0]+P,y:S[1]+L,dx:S[0]-M[0],dy:S[1]-M[1],dispatch:F}),_)}}return f.filter=function(b){return arguments.length?(e=typeof b=="function"?b:Ia(!!b),f):e},f.container=function(b){return arguments.length?(t=typeof b=="function"?b:Ia(b),f):t},f.subject=function(b){return arguments.length?(n=typeof b=="function"?b:Ia(b),f):n},f.touchable=function(b){return arguments.length?(r=typeof b=="function"?b:Ia(!!b),f):r},f.on=function(){var b=s.on.apply(s,arguments);return b===s?f:b},f.clickDistance=function(b){return arguments.length?(d=(b=+b)*b,f):Math.sqrt(d)},f}function Dv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function MP(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Go(){}var Eo=.7,zl=1/Eo,Vi="\\s*([+-]?\\d+)\\s*",Co="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",an="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",k4=/^#([0-9a-f]{3,8})$/,P4=new RegExp(`^rgb\\(${Vi},${Vi},${Vi}\\)$`),j4=new RegExp(`^rgb\\(${an},${an},${an}\\)$`),T4=new RegExp(`^rgba\\(${Vi},${Vi},${Vi},${Co}\\)$`),M4=new RegExp(`^rgba\\(${an},${an},${an},${Co}\\)$`),A4=new RegExp(`^hsl\\(${Co},${an},${an}\\)$`),I4=new RegExp(`^hsla\\(${Co},${an},${an},${Co}\\)$`),v1={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};Dv(Go,Xr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:x1,formatHex:x1,formatHex8:R4,formatHsl:D4,formatRgb:w1,toString:w1});function x1(){return this.rgb().formatHex()}function R4(){return this.rgb().formatHex8()}function D4(){return AP(this).formatHsl()}function w1(){return this.rgb().formatRgb()}function Xr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=k4.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?b1(t):n===3?new ut(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ra(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ra(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=P4.exec(e))?new ut(t[1],t[2],t[3],1):(t=j4.exec(e))?new ut(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=T4.exec(e))?Ra(t[1],t[2],t[3],t[4]):(t=M4.exec(e))?Ra(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=A4.exec(e))?N1(t[1],t[2]/100,t[3]/100,1):(t=I4.exec(e))?N1(t[1],t[2]/100,t[3]/100,t[4]):v1.hasOwnProperty(e)?b1(v1[e]):e==="transparent"?new ut(NaN,NaN,NaN,0):null}function b1(e){return new ut(e>>16&255,e>>8&255,e&255,1)}function Ra(e,t,n,r){return r<=0&&(e=t=n=NaN),new ut(e,t,n,r)}function O4(e){return e instanceof Go||(e=Xr(e)),e?(e=e.rgb(),new ut(e.r,e.g,e.b,e.opacity)):new ut}function iy(e,t,n,r){return arguments.length===1?O4(e):new ut(e,t,n,r??1)}function ut(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Dv(ut,iy,MP(Go,{brighter(e){return e=e==null?zl:Math.pow(zl,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Eo:Math.pow(Eo,e),new ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ut(zr(this.r),zr(this.g),zr(this.b),Bl(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:_1,formatHex:_1,formatHex8:L4,formatRgb:S1,toString:S1}));function _1(){return`#${Lr(this.r)}${Lr(this.g)}${Lr(this.b)}`}function L4(){return`#${Lr(this.r)}${Lr(this.g)}${Lr(this.b)}${Lr((isNaN(this.opacity)?1:this.opacity)*255)}`}function S1(){const e=Bl(this.opacity);return`${e===1?"rgb(":"rgba("}${zr(this.r)}, ${zr(this.g)}, ${zr(this.b)}${e===1?")":`, ${e})`}`}function Bl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Lr(e){return e=zr(e),(e<16?"0":"")+e.toString(16)}function N1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zt(e,t,n,r)}function AP(e){if(e instanceof zt)return new zt(e.h,e.s,e.l,e.opacity);if(e instanceof Go||(e=Xr(e)),!e)return new zt;if(e instanceof zt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,a=s-i,l=(s+i)/2;return a?(t===s?o=(n-r)/a+(n<r)*6:n===s?o=(r-t)/a+2:o=(t-n)/a+4,a/=l<.5?s+i:2-s-i,o*=60):a=l>0&&l<1?0:o,new zt(o,a,l,e.opacity)}function F4(e,t,n,r){return arguments.length===1?AP(e):new zt(e,t,n,r??1)}function zt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Dv(zt,F4,MP(Go,{brighter(e){return e=e==null?zl:Math.pow(zl,e),new zt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Eo:Math.pow(Eo,e),new zt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ut(Bc(e>=240?e-240:e+120,i,r),Bc(e,i,r),Bc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new zt(E1(this.h),Da(this.s),Da(this.l),Bl(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=Bl(this.opacity);return`${e===1?"hsl(":"hsla("}${E1(this.h)}, ${Da(this.s)*100}%, ${Da(this.l)*100}%${e===1?")":`, ${e})`}`}}));function E1(e){return e=(e||0)%360,e<0?e+360:e}function Da(e){return Math.max(0,Math.min(1,e||0))}function Bc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Ov=e=>()=>e;function q4(e,t){return function(n){return e+n*t}}function V4(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function $4(e){return(e=+e)==1?IP:function(t,n){return n-t?V4(t,n,e):Ov(isNaN(t)?n:t)}}function IP(e,t){var n=t-e;return n?q4(e,n):Ov(isNaN(e)?t:e)}const Hl=function e(t){var n=$4(t);function r(i,s){var o=n((i=iy(i)).r,(s=iy(s)).r),a=n(i.g,s.g),l=n(i.b,s.b),u=IP(i.opacity,s.opacity);return function(c){return i.r=o(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function z4(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function B4(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function H4(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)i[o]=Js(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(a){for(o=0;o<r;++o)s[o]=i[o](a);return s}}function U4(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function tn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function W4(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=Js(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var sy=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hc=new RegExp(sy.source,"g");function G4(e){return function(){return e}}function Y4(e){return function(t){return e(t)+""}}function RP(e,t){var n=sy.lastIndex=Hc.lastIndex=0,r,i,s,o=-1,a=[],l=[];for(e=e+"",t=t+"";(r=sy.exec(e))&&(i=Hc.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:tn(r,i)})),n=Hc.lastIndex;return n<t.length&&(s=t.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?l[0]?Y4(l[0].x):G4(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)a[(d=l[c]).i]=d.x(u);return a.join("")})}function Js(e,t){var n=typeof t,r;return t==null||n==="boolean"?Ov(t):(n==="number"?tn:n==="string"?(r=Xr(t))?(t=r,Hl):RP:t instanceof Xr?Hl:t instanceof Date?U4:B4(t)?z4:Array.isArray(t)?H4:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?W4:tn)(e,t)}var C1=180/Math.PI,oy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function DP(e,t,n,r,i,s){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*C1,skewX:Math.atan(l)*C1,scaleX:o,scaleY:a}}var Oa;function K4(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?oy:DP(t.a,t.b,t.c,t.d,t.e,t.f)}function X4(e){return e==null||(Oa||(Oa=document.createElementNS("http://www.w3.org/2000/svg","g")),Oa.setAttribute("transform",e),!(e=Oa.transform.baseVal.consolidate()))?oy:(e=e.matrix,DP(e.a,e.b,e.c,e.d,e.e,e.f))}function OP(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function s(u,c,d,f,p,m){if(u!==d||c!==f){var v=p.push("translate(",null,t,null,n);m.push({i:v-4,x:tn(u,d)},{i:v-2,x:tn(c,f)})}else(d||f)&&p.push("translate("+d+t+f+n)}function o(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:tn(u,c)})):c&&d.push(i(d)+"rotate("+c+r)}function a(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:tn(u,c)}):c&&d.push(i(d)+"skewX("+c+r)}function l(u,c,d,f,p,m){if(u!==d||c!==f){var v=p.push(i(p)+"scale(",null,",",null,")");m.push({i:v-4,x:tn(u,d)},{i:v-2,x:tn(c,f)})}else(d!==1||f!==1)&&p.push(i(p)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),s(u.translateX,u.translateY,c.translateX,c.translateY,d,f),o(u.rotate,c.rotate,d,f),a(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(p){for(var m=-1,v=f.length,w;++m<v;)d[(w=f[m]).i]=w.x(p);return d.join("")}}}var Q4=OP(K4,"px, ","px)","deg)"),Z4=OP(X4,", ",")",")"),J4=1e-12;function k1(e){return((e=Math.exp(e))+1/e)/2}function eL(e){return((e=Math.exp(e))-1/e)/2}function tL(e){return((e=Math.exp(2*e))-1)/(e+1)}const ul=function e(t,n,r){function i(s,o){var a=s[0],l=s[1],u=s[2],c=o[0],d=o[1],f=o[2],p=c-a,m=d-l,v=p*p+m*m,w,g;if(v<J4)g=Math.log(f/u)/t,w=function(_){return[a+_*p,l+_*m,u*Math.exp(t*_*g)]};else{var x=Math.sqrt(v),y=(f*f-u*u+r*v)/(2*u*n*x),b=(f*f-u*u-r*v)/(2*f*n*x),E=Math.log(Math.sqrt(y*y+1)-y),C=Math.log(Math.sqrt(b*b+1)-b);g=(C-E)/t,w=function(_){var k=_*g,I=k1(E),F=u/(n*x)*(I*tL(t*k+E)-eL(E));return[a+F*p,l+F*m,u*I/k1(t*k+E)]}}return w.duration=g*1e3*t/Math.SQRT2,w}return i.rho=function(s){var o=Math.max(.001,+s),a=o*o,l=a*a;return e(o,a,l)},i}(Math.SQRT2,2,4);var Xi=0,Is=0,Ss=0,LP=1e3,Ul,Rs,Wl=0,Qr=0,Au=0,ko=typeof performance=="object"&&performance.now?performance:Date,FP=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Lv(){return Qr||(FP(nL),Qr=ko.now()+Au)}function nL(){Qr=0}function Gl(){this._call=this._time=this._next=null}Gl.prototype=qP.prototype={constructor:Gl,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Lv():+n)+(t==null?0:+t),!this._next&&Rs!==this&&(Rs?Rs._next=this:Ul=this,Rs=this),this._call=e,this._time=n,ay()},stop:function(){this._call&&(this._call=null,this._time=1/0,ay())}};function qP(e,t,n){var r=new Gl;return r.restart(e,t,n),r}function rL(){Lv(),++Xi;for(var e=Ul,t;e;)(t=Qr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Xi}function P1(){Qr=(Wl=ko.now())+Au,Xi=Is=0;try{rL()}finally{Xi=0,sL(),Qr=0}}function iL(){var e=ko.now(),t=e-Wl;t>LP&&(Au-=t,Wl=e)}function sL(){for(var e,t=Ul,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ul=n);Rs=e,ay(r)}function ay(e){if(!Xi){Is&&(Is=clearTimeout(Is));var t=e-Qr;t>24?(e<1/0&&(Is=setTimeout(P1,e-ko.now()-Au)),Ss&&(Ss=clearInterval(Ss))):(Ss||(Wl=ko.now(),Ss=setInterval(iL,LP)),Xi=1,FP(P1))}}function j1(e,t,n){var r=new Gl;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var oL=Tu("start","end","cancel","interrupt"),aL=[],VP=0,T1=1,ly=2,cl=3,M1=4,uy=5,dl=6;function Iu(e,t,n,r,i,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;lL(e,n,{name:t,index:r,group:i,on:oL,tween:aL,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:VP})}function Fv(e,t){var n=Yt(e,t);if(n.state>VP)throw new Error("too late; already scheduled");return n}function dn(e,t){var n=Yt(e,t);if(n.state>cl)throw new Error("too late; already running");return n}function Yt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function lL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qP(s,0,n.time);function s(u){n.state=T1,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var c,d,f,p;if(n.state!==T1)return l();for(c in r)if(p=r[c],p.name===n.name){if(p.state===cl)return j1(o);p.state===M1?(p.state=dl,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[c]):+c<t&&(p.state=dl,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[c])}if(j1(function(){n.state===cl&&(n.state=M1,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=ly,n.on.call("start",e,e.__data__,n.index,n.group),n.state===ly){for(n.state=cl,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(p=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=p);i.length=d+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=uy,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===uy&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=dl,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function fl(e,t){var n=e.__transition,r,i,s=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){s=!1;continue}i=r.state>ly&&r.state<uy,r.state=dl,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}s&&delete e.__transition}}function uL(e){return this.each(function(){fl(this,e)})}function cL(e,t){var n,r;return function(){var i=dn(this,e),s=i.tween;if(s!==n){r=n=s;for(var o=0,a=r.length;o<a;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function dL(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=dn(this,e),o=s.tween;if(o!==r){i=(r=o).slice();for(var a={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=a;break}l===u&&i.push(a)}s.tween=i}}function fL(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Yt(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?cL:dL)(n,e,t))}function qv(e,t,n){var r=e._id;return e.each(function(){var i=dn(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Yt(i,r).value[t]}}function $P(e,t){var n;return(typeof t=="number"?tn:t instanceof Xr?Hl:(n=Xr(t))?(t=n,Hl):RP)(e,t)}function hL(e){return function(){this.removeAttribute(e)}}function pL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function mL(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttribute(e);return o===i?null:o===r?s:s=t(r=o,n)}}function gL(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?s:s=t(r=o,n)}}function yL(e,t,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a)))}}function vL(e,t,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a)))}}function xL(e,t){var n=Mu(e),r=n==="transform"?Z4:$P;return this.attrTween(e,typeof t=="function"?(n.local?vL:yL)(n,r,qv(this,"attr."+e,t)):t==null?(n.local?pL:hL)(n):(n.local?gL:mL)(n,r,t))}function wL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function bL(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function _L(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&bL(e,s)),n}return i._value=t,i}function SL(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&wL(e,s)),n}return i._value=t,i}function NL(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Mu(e);return this.tween(n,(r.local?_L:SL)(r,t))}function EL(e,t){return function(){Fv(this,e).delay=+t.apply(this,arguments)}}function CL(e,t){return t=+t,function(){Fv(this,e).delay=t}}function kL(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?EL:CL)(t,e)):Yt(this.node(),t).delay}function PL(e,t){return function(){dn(this,e).duration=+t.apply(this,arguments)}}function jL(e,t){return t=+t,function(){dn(this,e).duration=t}}function TL(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?PL:jL)(t,e)):Yt(this.node(),t).duration}function ML(e,t){if(typeof t!="function")throw new Error;return function(){dn(this,e).ease=t}}function AL(e){var t=this._id;return arguments.length?this.each(ML(t,e)):Yt(this.node(),t).ease}function IL(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;dn(this,e).ease=n}}function RL(e){if(typeof e!="function")throw new Error;return this.each(IL(this._id,e))}function DL(e){typeof e!="function"&&(e=vP(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=[],l,u=0;u<o;++u)(l=s[u])&&e.call(l,l.__data__,u,s)&&a.push(l);return new Rn(r,this._parents,this._name,this._id)}function OL(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),o=new Array(r),a=0;a<s;++a)for(var l=t[a],u=n[a],c=l.length,d=o[a]=new Array(c),f,p=0;p<c;++p)(f=l[p]||u[p])&&(d[p]=f);for(;a<r;++a)o[a]=t[a];return new Rn(o,this._parents,this._name,this._id)}function LL(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function FL(e,t,n){var r,i,s=LL(t)?Fv:dn;return function(){var o=s(this,e),a=o.on;a!==r&&(i=(r=a).copy()).on(t,n),o.on=i}}function qL(e,t){var n=this._id;return arguments.length<2?Yt(this.node(),n).on.on(e):this.each(FL(n,e,t))}function VL(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function $L(){return this.on("end.remove",VL(this._id))}function zL(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Iv(e));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var a=r[o],l=a.length,u=s[o]=new Array(l),c,d,f=0;f<l;++f)(c=a[f])&&(d=e.call(c,c.__data__,f,a))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Iu(u[f],t,n,f,u,Yt(c,n)));return new Rn(s,this._parents,t,n)}function BL(e){var t=this._name,n=this._id;typeof e!="function"&&(e=yP(e));for(var r=this._groups,i=r.length,s=[],o=[],a=0;a<i;++a)for(var l=r[a],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),p,m=Yt(c,n),v=0,w=f.length;v<w;++v)(p=f[v])&&Iu(p,t,n,v,f,m);s.push(f),o.push(c)}return new Rn(s,o,t,n)}var HL=Wo.prototype.constructor;function UL(){return new HL(this._groups,this._parents)}function WL(e,t){var n,r,i;return function(){var s=Ki(this,e),o=(this.style.removeProperty(e),Ki(this,e));return s===o?null:s===n&&o===r?i:i=t(n=s,r=o)}}function zP(e){return function(){this.style.removeProperty(e)}}function GL(e,t,n){var r,i=n+"",s;return function(){var o=Ki(this,e);return o===i?null:o===r?s:s=t(r=o,n)}}function YL(e,t,n){var r,i,s;return function(){var o=Ki(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Ki(this,e))),o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a))}}function KL(e,t){var n,r,i,s="style."+t,o="end."+s,a;return function(){var l=dn(this,e),u=l.on,c=l.value[s]==null?a||(a=zP(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(o,i=c),l.on=r}}function XL(e,t,n){var r=(e+="")=="transform"?Q4:$P;return t==null?this.styleTween(e,WL(e,r)).on("end.style."+e,zP(e)):typeof t=="function"?this.styleTween(e,YL(e,r,qv(this,"style."+e,t))).each(KL(this._id,e)):this.styleTween(e,GL(e,r,t),n).on("end.style."+e,null)}function QL(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function ZL(e,t,n){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&QL(e,o,n)),r}return s._value=t,s}function JL(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,ZL(e,t,n??""))}function e5(e){return function(){this.textContent=e}}function t5(e){return function(){var t=e(this);this.textContent=t??""}}function n5(e){return this.tween("text",typeof e=="function"?t5(qv(this,"text",e)):e5(e==null?"":e+""))}function r5(e){return function(t){this.textContent=e.call(this,t)}}function i5(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&r5(i)),t}return r._value=e,r}function s5(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,i5(e))}function o5(){for(var e=this._name,t=this._id,n=BP(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,u=0;u<a;++u)if(l=o[u]){var c=Yt(l,t);Iu(l,e,n,u,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Rn(r,this._parents,e,n)}function a5(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var a={value:o},l={value:function(){--i===0&&s()}};n.each(function(){var u=dn(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),u.on=t}),i===0&&s()})}var l5=0;function Rn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function BP(){return++l5}var yn=Wo.prototype;Rn.prototype={constructor:Rn,select:zL,selectAll:BL,selectChild:yn.selectChild,selectChildren:yn.selectChildren,filter:DL,merge:OL,selection:UL,transition:o5,call:yn.call,nodes:yn.nodes,node:yn.node,size:yn.size,empty:yn.empty,each:yn.each,on:qL,attr:xL,attrTween:NL,style:XL,styleTween:JL,text:n5,textTween:s5,remove:$L,tween:fL,delay:kL,duration:TL,ease:AL,easeVarying:RL,end:a5,[Symbol.iterator]:yn[Symbol.iterator]};function u5(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var c5={time:null,delay:0,duration:250,ease:u5};function d5(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function f5(e){var t,n;e instanceof Rn?(t=e._id,e=e._name):(t=BP(),(n=c5).time=Lv(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,u=0;u<a;++u)(l=o[u])&&Iu(l,e,t,u,o,n||d5(l,t));return new Rn(r,this._parents,e,t)}Wo.prototype.interrupt=uL;Wo.prototype.transition=f5;const La=e=>()=>e;function h5(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Sn(e,t,n){this.k=e,this.x=t,this.y=n}Sn.prototype={constructor:Sn,scale:function(e){return e===1?this:new Sn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Sn(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 Ru=new Sn(1,0,0);HP.prototype=Sn.prototype;function HP(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ru;return e.__zoom}function Uc(e){e.stopImmediatePropagation()}function Ns(e){e.preventDefault(),e.stopImmediatePropagation()}function p5(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function m5(){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 A1(){return this.__zoom||Ru}function g5(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function y5(){return navigator.maxTouchPoints||"ontouchstart"in this}function v5(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function UP(){var e=p5,t=m5,n=v5,r=g5,i=y5,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=ul,u=Tu("start","zoom","end"),c,d,f,p=500,m=150,v=0,w=10;function g(N){N.property("__zoom",A1).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",F).filter(i).on("touchstart.zoom",S).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(N,A,R,O){var j=N.selection?N.selection():N;j.property("__zoom",A1),N!==j?E(N,A,R,O):j.interrupt().each(function(){C(this,arguments).event(O).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},g.scaleBy=function(N,A,R,O){g.scaleTo(N,function(){var j=this.__zoom.k,M=typeof A=="function"?A.apply(this,arguments):A;return j*M},R,O)},g.scaleTo=function(N,A,R,O){g.transform(N,function(){var j=t.apply(this,arguments),M=this.__zoom,q=R==null?b(j):typeof R=="function"?R.apply(this,arguments):R,$=M.invert(q),D=typeof A=="function"?A.apply(this,arguments):A;return n(y(x(M,D),q,$),j,o)},R,O)},g.translateBy=function(N,A,R,O){g.transform(N,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),o)},null,O)},g.translateTo=function(N,A,R,O,j){g.transform(N,function(){var M=t.apply(this,arguments),q=this.__zoom,$=O==null?b(M):typeof O=="function"?O.apply(this,arguments):O;return n(Ru.translate($[0],$[1]).scale(q.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof R=="function"?-R.apply(this,arguments):-R),M,o)},O,j)};function x(N,A){return A=Math.max(s[0],Math.min(s[1],A)),A===N.k?N:new Sn(A,N.x,N.y)}function y(N,A,R){var O=A[0]-R[0]*N.k,j=A[1]-R[1]*N.k;return O===N.x&&j===N.y?N:new Sn(N.k,O,j)}function b(N){return[(+N[0][0]+ +N[1][0])/2,(+N[0][1]+ +N[1][1])/2]}function E(N,A,R,O){N.on("start.zoom",function(){C(this,arguments).event(O).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(O).end()}).tween("zoom",function(){var j=this,M=arguments,q=C(j,M).event(O),$=t.apply(j,M),D=R==null?b($):typeof R=="function"?R.apply(j,M):R,z=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),V=j.__zoom,U=typeof A=="function"?A.apply(j,M):A,W=l(V.invert(D).concat(z/V.k),U.invert(D).concat(z/U.k));return function(Y){if(Y===1)Y=U;else{var H=W(Y),X=z/H[2];Y=new Sn(X,D[0]-H[0]*X,D[1]-H[1]*X)}q.zoom(null,Y)}})}function C(N,A,R){return!R&&N.__zooming||new _(N,A)}function _(N,A){this.that=N,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(N,A),this.taps=0}_.prototype={event:function(N){return N&&(this.sourceEvent=N),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(N,A){return this.mouse&&N!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&N!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&N!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(N){var A=gt(this.that).datum();u.call(N,this.that,new h5(N,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:u}),A)}};function k(N,...A){if(!e.apply(this,arguments))return;var R=C(this,A).event(N),O=this.__zoom,j=Math.max(s[0],Math.min(s[1],O.k*Math.pow(2,r.apply(this,arguments)))),M=Vt(N);if(R.wheel)(R.mouse[0][0]!==M[0]||R.mouse[0][1]!==M[1])&&(R.mouse[1]=O.invert(R.mouse[0]=M)),clearTimeout(R.wheel);else{if(O.k===j)return;R.mouse=[M,O.invert(M)],fl(this),R.start()}Ns(N),R.wheel=setTimeout(q,m),R.zoom("mouse",n(y(x(O,j),R.mouse[0],R.mouse[1]),R.extent,o));function q(){R.wheel=null,R.end()}}function I(N,...A){if(f||!e.apply(this,arguments))return;var R=N.currentTarget,O=C(this,A,!0).event(N),j=gt(N.view).on("mousemove.zoom",D,!0).on("mouseup.zoom",z,!0),M=Vt(N,R),q=N.clientX,$=N.clientY;PP(N.view),Uc(N),O.mouse=[M,this.__zoom.invert(M)],fl(this),O.start();function D(V){if(Ns(V),!O.moved){var U=V.clientX-q,W=V.clientY-$;O.moved=U*U+W*W>v}O.event(V).zoom("mouse",n(y(O.that.__zoom,O.mouse[0]=Vt(V,R),O.mouse[1]),O.extent,o))}function z(V){j.on("mousemove.zoom mouseup.zoom",null),jP(V.view,O.moved),Ns(V),O.event(V).end()}}function F(N,...A){if(e.apply(this,arguments)){var R=this.__zoom,O=Vt(N.changedTouches?N.changedTouches[0]:N,this),j=R.invert(O),M=R.k*(N.shiftKey?.5:2),q=n(y(x(R,M),O,j),t.apply(this,A),o);Ns(N),a>0?gt(this).transition().duration(a).call(E,q,O,N):gt(this).call(g.transform,q,O,N)}}function S(N,...A){if(e.apply(this,arguments)){var R=N.touches,O=R.length,j=C(this,A,N.changedTouches.length===O).event(N),M,q,$,D;for(Uc(N),q=0;q<O;++q)$=R[q],D=Vt($,this),D=[D,this.__zoom.invert(D),$.identifier],j.touch0?!j.touch1&&j.touch0[2]!==D[2]&&(j.touch1=D,j.taps=0):(j.touch0=D,M=!0,j.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(j.taps<2&&(d=D[0],c=setTimeout(function(){c=null},p)),fl(this),j.start())}}function P(N,...A){if(this.__zooming){var R=C(this,A).event(N),O=N.changedTouches,j=O.length,M,q,$,D;for(Ns(N),M=0;M<j;++M)q=O[M],$=Vt(q,this),R.touch0&&R.touch0[2]===q.identifier?R.touch0[0]=$:R.touch1&&R.touch1[2]===q.identifier&&(R.touch1[0]=$);if(q=R.that.__zoom,R.touch1){var z=R.touch0[0],V=R.touch0[1],U=R.touch1[0],W=R.touch1[1],Y=(Y=U[0]-z[0])*Y+(Y=U[1]-z[1])*Y,H=(H=W[0]-V[0])*H+(H=W[1]-V[1])*H;q=x(q,Math.sqrt(Y/H)),$=[(z[0]+U[0])/2,(z[1]+U[1])/2],D=[(V[0]+W[0])/2,(V[1]+W[1])/2]}else if(R.touch0)$=R.touch0[0],D=R.touch0[1];else return;R.zoom("touch",n(y(q,$,D),R.extent,o))}}function L(N,...A){if(this.__zooming){var R=C(this,A).event(N),O=N.changedTouches,j=O.length,M,q;for(Uc(N),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),M=0;M<j;++M)q=O[M],R.touch0&&R.touch0[2]===q.identifier?delete R.touch0:R.touch1&&R.touch1[2]===q.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(q=Vt(q,this),Math.hypot(d[0]-q[0],d[1]-q[1])<w)){var $=gt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return g.wheelDelta=function(N){return arguments.length?(r=typeof N=="function"?N:La(+N),g):r},g.filter=function(N){return arguments.length?(e=typeof N=="function"?N:La(!!N),g):e},g.touchable=function(N){return arguments.length?(i=typeof N=="function"?N:La(!!N),g):i},g.extent=function(N){return arguments.length?(t=typeof N=="function"?N:La([[+N[0][0],+N[0][1]],[+N[1][0],+N[1][1]]]),g):t},g.scaleExtent=function(N){return arguments.length?(s[0]=+N[0],s[1]=+N[1],g):[s[0],s[1]]},g.translateExtent=function(N){return arguments.length?(o[0][0]=+N[0][0],o[1][0]=+N[1][0],o[0][1]=+N[0][1],o[1][1]=+N[1][1],g):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},g.constrain=function(N){return arguments.length?(n=N,g):n},g.duration=function(N){return arguments.length?(a=+N,g):a},g.interpolate=function(N){return arguments.length?(l=N,g):l},g.on=function(){var N=u.on.apply(u,arguments);return N===u?g:N},g.clickDistance=function(N){return arguments.length?(v=(N=+N)*N,g):Math.sqrt(v)},g.tapDistance=function(N){return arguments.length?(w=+N,g):w},g}const cn={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:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Po=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],WP=["Enter"," ","Escape"],GP={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Zr;(function(e){e.Strict="strict",e.Loose="loose"})(Zr||(Zr={}));var Br;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Br||(Br={}));var jo;(function(e){e.Partial="partial",e.Full="full"})(jo||(jo={}));const YP={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var nr;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(nr||(nr={}));var Yl;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Yl||(Yl={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const I1={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top};function KP(e){return e===null?null:e?"valid":"invalid"}const XP=e=>"id"in e&&"source"in e&&"target"in e,x5=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Vv=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Yo=(e,t=[0,0])=>{const{width:n,height:r}=Vn(e),i=e.origin??t,s=n*i[0],o=r*i[1];return{x:e.position.x-s,y:e.position.y-o}},w5=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const s=typeof i=="string";let o=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(i):Vv(i)?i:t.nodeLookup.get(i.id));const a=o?Kl(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Du(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ou(n)},Ko=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Du(n,Kl(i)),r=!0)}),r?Ou(n):{x:0,y:0,width:0,height:0}},$v=(e,t,[n,r,i]=[0,0,1],s=!1,o=!1)=>{const a={...Qo(t,[n,r,i]),width:t.width/i,height:t.height/i},l=[];for(const u of e.values()){const{measured:c,selectable:d=!0,hidden:f=!1}=u;if(o&&!d||f)continue;const p=c.width??u.width??u.initialWidth??null,m=c.height??u.height??u.initialHeight??null,v=To(a,Zi(u)),w=(p??0)*(m??0),g=s&&v>0;(!u.internals.handleBounds||g||v>=w||u.dragging)&&l.push(u)}return l},b5=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function _5(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function S5({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},o){if(e.size===0)return Promise.resolve(!0);const a=_5(e,o),l=Ko(a),u=zv(l,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await r.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function QP({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const o=n.get(e),a=o.parentId?n.get(o.parentId):void 0,{x:l,y:u}=a?a.internals.positionAbsolute:{x:0,y:0},c=o.origin??r;let d=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!a)s==null||s("005",cn.error005());else{const p=a.measured.width,m=a.measured.height;p&&m&&(d=[[l,u],[l+p,u+m]])}else a&&Ji(o.extent)&&(d=[[o.extent[0][0]+l,o.extent[0][1]+u],[o.extent[1][0]+l,o.extent[1][1]+u]]);const f=Ji(d)?Jr(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",cn.error015())),{position:{x:f.x-l+(o.measured.width??0)*c[0],y:f.y-u+(o.measured.height??0)*c[1]},positionAbsolute:f}}async function N5({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const p=s.has(f.id),m=!p&&f.parentId&&o.find(v=>v.id===f.parentId);(p||m)&&o.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),c=b5(o,l);for(const f of l)a.has(f.id)&&!c.find(m=>m.id===f.id)&&c.push(f);if(!i)return{edges:c,nodes:o};const d=await i({nodes:o,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:o}:{edges:[],nodes:[]}:d}const Qi=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Jr=(e={x:0,y:0},t,n)=>({x:Qi(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Qi(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ZP(e,t,n){const{width:r,height:i}=Vn(n),{x:s,y:o}=n.internals.positionAbsolute;return Jr(e,[[s,o],[s+r,o+i]],t)}const R1=(e,t,n)=>e<t?Qi(Math.abs(e-t),1,t)/t:e>n?-Qi(Math.abs(e-n),1,t)/t:0,JP=(e,t,n=15,r=40)=>{const i=R1(e.x,r,t.width-r)*n,s=R1(e.y,r,t.height-r)*n;return[i,s]},Du=(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)}),cy=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ou=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Zi=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Vv(e)?e.internals.positionAbsolute:Yo(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},Kl=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Vv(e)?e.internals.positionAbsolute:Yo(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},ej=(e,t)=>Ou(Du(cy(e),cy(t))),To=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},D1=e=>Bt(e.width)&&Bt(e.height)&&Bt(e.x)&&Bt(e.y),Bt=e=>!isNaN(e)&&isFinite(e),E5=(e,t)=>{},Xo=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Qo=({x:e,y:t},[n,r,i],s=!1,o=[1,1])=>{const a={x:(e-n)/i,y:(t-r)/i};return s?Xo(a,o):a},Xl=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function fi(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function C5(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=fi(e,n),i=fi(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=fi(e.top??e.y??0,n),i=fi(e.bottom??e.y??0,n),s=fi(e.left??e.x??0,t),o=fi(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:s,x:s+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function k5(e,t,n,r,i,s){const{x:o,y:a}=Xl(e,[t,n,r]),{x:l,y:u}=Xl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=i-l,d=s-u;return{left:Math.floor(o),top:Math.floor(a),right:Math.floor(c),bottom:Math.floor(d)}}const zv=(e,t,n,r,i,s)=>{const o=C5(s,t,n),a=(t-o.x)/e.width,l=(n-o.y)/e.height,u=Math.min(a,l),c=Qi(u,r,i),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*c,m=n/2-f*c,v=k5(e,p,m,c,t,n),w={left:Math.min(v.left-o.left,0),top:Math.min(v.top-o.top,0),right:Math.min(v.right-o.right,0),bottom:Math.min(v.bottom-o.bottom,0)};return{x:p-w.left+w.right,y:m-w.top+w.bottom,zoom:c}},Mo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ji(e){return e!=null&&e!=="parent"}function Vn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function tj(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function nj(e,t={width:0,height:0},n,r,i){const s={...e},o=r.get(n);if(o){const a=o.origin||i;s.x+=o.internals.positionAbsolute.x-(t.width??0)*a[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*a[1]}return s}function O1(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function P5(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function j5(e){return{...GP,...e||{}}}function eo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:o}=Ht(e),a=Qo({x:s-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:l,y:u}=n?Xo(a,t):a;return{xSnapped:l,ySnapped:u,...a}}const Bv=e=>({width:e.offsetWidth,height:e.offsetHeight}),rj=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},T5=["INPUT","SELECT","TEXTAREA"];function ij(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:T5.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const sj=e=>"clientX"in e,Ht=(e,t)=>{var s,o;const n=sj(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},L1=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const a=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Bv(o)}})};function oj({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:o,targetControlY:a}){const l=e*.125+i*.375+o*.375+n*.125,u=t*.125+s*.375+a*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}function Fa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function F1({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case K.Left:return[t-Fa(t-r,s),n];case K.Right:return[t+Fa(r-t,s),n];case K.Top:return[t,n-Fa(n-i,s)];case K.Bottom:return[t,n+Fa(i-n,s)]}}function aj({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,curvature:o=.25}){const[a,l]=F1({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[u,c]=F1({pos:s,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=oj({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${a},${l} ${u},${c} ${r},${i}`,d,f,p,m]}function lj({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,o=Math.abs(r-t)/2,a=r<t?r+o:r-o;return[s,a,i,o]}function M5({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const o=i&&n?r+1e3:r,a=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return o+a}function A5({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=Du(Kl(e),Kl(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return To(o,Ou(s))>0}const I5=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,R5=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),D5=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||I5;let i;return XP(e)?i={...e}:i={...e,id:r(e)},R5(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function uj({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,o,a]=lj({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,o,a]}const q1={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},O5=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},V1=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function L5({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:i,offset:s,stepPosition:o}){const a=q1[t],l=q1[r],u={x:e.x+a.x*s,y:e.y+a.y*s},c={x:n.x+l.x*s,y:n.y+l.y*s},d=O5({source:u,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",p=d[f];let m=[],v,w;const g={x:0,y:0},x={x:0,y:0},[,,y,b]=lj({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(v=i.x??u.x+(c.x-u.x)*o,w=i.y??(u.y+c.y)/2):(v=i.x??(u.x+c.x)/2,w=i.y??u.y+(c.y-u.y)*o);const C=[{x:v,y:u.y},{x:v,y:c.y}],_=[{x:u.x,y:w},{x:c.x,y:w}];a[f]===p?m=f==="x"?C:_:m=f==="x"?_:C}else{const C=[{x:u.x,y:c.y}],_=[{x:c.x,y:u.y}];if(f==="x"?m=a.x===p?_:C:m=a.y===p?C:_,t===r){const P=Math.abs(e[f]-n[f]);if(P<=s){const L=Math.min(s-1,s-P);a[f]===p?g[f]=(u[f]>e[f]?-1:1)*L:x[f]=(c[f]>n[f]?-1:1)*L}}if(t!==r){const P=f==="x"?"y":"x",L=a[f]===l[P],N=u[P]>c[P],A=u[P]<c[P];(a[f]===1&&(!L&&N||L&&A)||a[f]!==1&&(!L&&A||L&&N))&&(m=f==="x"?C:_)}const k={x:u.x+g.x,y:u.y+g.y},I={x:c.x+x.x,y:c.y+x.y},F=Math.max(Math.abs(k.x-m[0].x),Math.abs(I.x-m[0].x)),S=Math.max(Math.abs(k.y-m[0].y),Math.abs(I.y-m[0].y));F>=S?(v=(k.x+I.x)/2,w=m[0].y):(v=m[0].x,w=(k.y+I.y)/2)}return[[e,{x:u.x+g.x,y:u.y+g.y},...m,{x:c.x+x.x,y:c.y+x.y},n],v,w,y,b]}function F5(e,t,n,r){const i=Math.min(V1(e,t)/2,V1(t,n)/2,r),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${s+i*u},${o}Q ${s},${o} ${s},${o+i*c}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${o+i*l}Q ${s},${o} ${s+i*a},${o}`}function Ql({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,borderRadius:o=5,centerX:a,centerY:l,offset:u=20,stepPosition:c=.5}){const[d,f,p,m,v]=L5({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:a,y:l},offset:u,stepPosition:c});return[d.reduce((g,x,y)=>{let b="";return y>0&&y<d.length-1?b=F5(d[y-1],x,d[y+1],o):b=`${y===0?"M":"L"}${x.x} ${x.y}`,g+=b,g},""),f,p,m,v]}function $1(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function q5(e){var d;const{sourceNode:t,targetNode:n}=e;if(!$1(t)||!$1(n))return null;const r=t.internals.handleBounds||z1(t.handles),i=n.internals.handleBounds||z1(n.handles),s=B1((r==null?void 0:r.source)??[],e.sourceHandle),o=B1(e.connectionMode===Zr.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!s||!o)return(d=e.onError)==null||d.call(e,"008",cn.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(s==null?void 0:s.position)||K.Bottom,l=(o==null?void 0:o.position)||K.Top,u=ei(t,s,a),c=ei(n,o,l);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:a,targetPosition:l}}function z1(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function ei(e,t,n=K.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:a}=t??Vn(e);if(r)return{x:i+o/2,y:s+a/2};switch((t==null?void 0:t.position)??n){case K.Top:return{x:i+o/2,y:s};case K.Right:return{x:i+o,y:s+a/2};case K.Bottom:return{x:i+o/2,y:s+a};case K.Left:return{x:i,y:s+a/2}}}function B1(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function dy(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function V5(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((o,a)=>([a.markerStart||r,a.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){const u=dy(l,t);s.has(u)||(o.push({id:u,color:l.color||n,...l}),s.add(u))}}),o),[]).sort((o,a)=>o.id.localeCompare(a.id))}const cj=1e3,$5=10,Hv={nodeOrigin:[0,0],nodeExtent:Po,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},z5={...Hv,checkEquality:!0};function Uv(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function B5(e,t,n){const r=Uv(Hv,n);for(const i of e.values())if(i.parentId)Gv(i,e,t,r);else{const s=Yo(i,r.nodeOrigin),o=Ji(i.extent)?i.extent:r.nodeExtent,a=Jr(s,o,Vn(i));i.internals.positionAbsolute=a}}function H5(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function Wv(e){return e==="manual"}function fy(e,t,n,r={}){var u,c;const i=Uv(z5,r),s={i:0},o=new Map(t),a=i!=null&&i.elevateNodesOnSelect&&!Wv(i.zIndexMode)?cj:0;let l=e.length>0;t.clear(),n.clear();for(const d of e){let f=o.get(d.id);if(i.checkEquality&&d===(f==null?void 0:f.internals.userNode))t.set(d.id,f);else{const p=Yo(d,i.nodeOrigin),m=Ji(d.extent)?d.extent:i.nodeExtent,v=Jr(p,m,Vn(d));f={...i.defaults,...d,measured:{width:(u=d.measured)==null?void 0:u.width,height:(c=d.measured)==null?void 0:c.height},internals:{positionAbsolute:v,handleBounds:H5(d,f),z:dj(d,a,i.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(l=!1),d.parentId&&Gv(f,t,n,r,s)}return l}function U5(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Gv(e,t,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:a,zIndexMode:l}=Uv(Hv,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}U5(e,n),i&&!c.parentId&&c.internals.rootParentIndex===void 0&&l==="auto"&&(c.internals.rootParentIndex=++i.i,c.internals.z=c.internals.z+i.i*$5),i&&c.internals.rootParentIndex!==void 0&&(i.i=c.internals.rootParentIndex);const d=s&&!Wv(l)?cj:0,{x:f,y:p,z:m}=W5(e,c,o,a,d,l),{positionAbsolute:v}=e.internals,w=f!==v.x||p!==v.y;(w||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:w?{x:f,y:p}:v,z:m}})}function dj(e,t,n){const r=Bt(e.zIndex)?e.zIndex:0;return Wv(n)?r:r+(e.selected?t:0)}function W5(e,t,n,r,i,s){const{x:o,y:a}=t.internals.positionAbsolute,l=Vn(e),u=Yo(e,n),c=Ji(e.extent)?Jr(u,e.extent,l):u;let d=Jr({x:o+c.x,y:a+c.y},r,l);e.extent==="parent"&&(d=ZP(d,l,t));const f=dj(e,i,s),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function Yv(e,t,n,r=[0,0]){var o;const i=[],s=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const u=((o=s.get(a.parentId))==null?void 0:o.expandedRect)??Zi(l),c=ej(u,a.rect);s.set(a.parentId,{expandedRect:c,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},u)=>{var y;const c=l.internals.positionAbsolute,d=Vn(l),f=l.origin??r,p=a.x<c.x?Math.round(Math.abs(c.x-a.x)):0,m=a.y<c.y?Math.round(Math.abs(c.y-a.y)):0,v=Math.max(d.width,Math.round(a.width)),w=Math.max(d.height,Math.round(a.height)),g=(v-d.width)*f[0],x=(w-d.height)*f[1];(p>0||m>0||g||x)&&(i.push({id:u,type:"position",position:{x:l.position.x-p+g,y:l.position.y-m+x}}),(y=n.get(u))==null||y.forEach(b=>{e.some(E=>E.id===b.id)||i.push({id:b.id,type:"position",position:{x:b.position.x+p,y:b.position.y+m}})})),(d.width<a.width||d.height<a.height||p||m)&&i.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(p?f[0]*p-g:0),height:w+(m?f[1]*m-x:0)}})}),i}function G5(e,t,n,r,i,s,o){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const u=[],c=window.getComputedStyle(a),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const p of e.values()){const m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),l=!0;continue}const v=Bv(p.nodeElement),w=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(w||!m.internals.handleBounds||p.force))){const x=p.nodeElement.getBoundingClientRect(),y=Ji(m.extent)?m.extent:s;let{positionAbsolute:b}=m.internals;m.parentId&&m.extent==="parent"?b=ZP(b,v,t.get(m.parentId)):y&&(b=Jr(b,y,v));const E={...m,measured:v,internals:{...m.internals,positionAbsolute:b,handleBounds:{source:L1("source",p.nodeElement,x,d,m.id),target:L1("target",p.nodeElement,x,d,m.id)}}};t.set(m.id,E),m.parentId&&Gv(E,t,n,{nodeOrigin:i,zIndexMode:o}),l=!0,w&&(u.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&f.push({id:m.id,parentId:m.parentId,rect:Zi(E,i)}))}}if(f.length>0){const p=Yv(f,t,n,i);u.push(...p)}return{changes:u,updatedInternals:l}}async function Y5({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r),a=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(a)}function H1(e,t,n,r,i,s){let o=i;const a=r.get(o)||new Map;r.set(o,a.set(n,t)),o=`${i}-${e}`;const l=r.get(o)||new Map;if(r.set(o,l.set(n,t)),s){o=`${i}-${e}-${s}`;const u=r.get(o)||new Map;r.set(o,u.set(n,t))}}function fj(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:o=null,targetHandle:a=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:a},u=`${i}-${o}--${s}-${a}`,c=`${s}-${a}--${i}-${o}`;H1("source",l,c,e,i,o),H1("target",l,u,e,s,a),t.set(r.id,r)}}function hj(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:hj(n,t):!1}function U1(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function K5(e,t,n,r){const i=new Map;for(const[s,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!hj(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const a=e.get(s);a&&i.set(s,{id:s,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function Wc({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,a,l;const i=[];for(const[u,c]of t){const d=(o=n.get(u))==null?void 0:o.internals.userNode;d&&i.push({...d,position:c.position,dragging:r})}if(!e)return[i[0],i];const s=(a=n.get(e))==null?void 0:a.internals.userNode;return[s?{...s,position:((l=t.get(e))==null?void 0:l.position)||s.position,dragging:r}:i[0],i]}function X5({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},o=Xo(s,t);return{x:o.x-s.x,y:o.y-s.y}}function Q5({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},o=0,a=new Map,l=!1,u={x:0,y:0},c=null,d=!1,f=null,p=!1,m=!1,v=null;function w({noDragClassName:x,handleSelector:y,domNode:b,isSelectable:E,nodeId:C,nodeClickDistance:_=0}){f=gt(b);function k({x:P,y:L}){const{nodeLookup:N,nodeExtent:A,snapGrid:R,snapToGrid:O,nodeOrigin:j,onNodeDrag:M,onSelectionDrag:q,onError:$,updateNodePositions:D}=t();s={x:P,y:L};let z=!1;const V=a.size>1,U=V&&A?cy(Ko(a)):null,W=V&&O?X5({dragItems:a,snapGrid:R,x:P,y:L}):null;for(const[Y,H]of a){if(!N.has(Y))continue;let X={x:P-H.distance.x,y:L-H.distance.y};O&&(X=W?{x:Math.round(X.x+W.x),y:Math.round(X.y+W.y)}:Xo(X,R));let se=null;if(V&&A&&!H.extent&&U){const{positionAbsolute:Z}=H.internals,ce=Z.x-U.x+A[0][0],J=Z.x+H.measured.width-U.x2+A[1][0],ae=Z.y-U.y+A[0][1],ne=Z.y+H.measured.height-U.y2+A[1][1];se=[[ce,ae],[J,ne]]}const{position:re,positionAbsolute:ee}=QP({nodeId:Y,nextPosition:X,nodeLookup:N,nodeExtent:se||A,nodeOrigin:j,onError:$});z=z||H.position.x!==re.x||H.position.y!==re.y,H.position=re,H.internals.positionAbsolute=ee}if(m=m||z,!!z&&(D(a,!0),v&&(r||M||!C&&q))){const[Y,H]=Wc({nodeId:C,dragItems:a,nodeLookup:N});r==null||r(v,a,Y,H),M==null||M(v,Y,H),C||q==null||q(v,H)}}async function I(){if(!c)return;const{transform:P,panBy:L,autoPanSpeed:N,autoPanOnNodeDrag:A}=t();if(!A){l=!1,cancelAnimationFrame(o);return}const[R,O]=JP(u,c,N);(R!==0||O!==0)&&(s.x=(s.x??0)-R/P[2],s.y=(s.y??0)-O/P[2],await L({x:R,y:O})&&k(s)),o=requestAnimationFrame(I)}function F(P){var V;const{nodeLookup:L,multiSelectionActive:N,nodesDraggable:A,transform:R,snapGrid:O,snapToGrid:j,selectNodesOnDrag:M,onNodeDragStart:q,onSelectionDragStart:$,unselectNodesAndEdges:D}=t();d=!0,(!M||!E)&&!N&&C&&((V=L.get(C))!=null&&V.selected||D()),E&&M&&C&&(e==null||e(C));const z=eo(P.sourceEvent,{transform:R,snapGrid:O,snapToGrid:j,containerBounds:c});if(s=z,a=K5(L,A,z,C),a.size>0&&(n||q||!C&&$)){const[U,W]=Wc({nodeId:C,dragItems:a,nodeLookup:L});n==null||n(P.sourceEvent,a,U,W),q==null||q(P.sourceEvent,U,W),C||$==null||$(P.sourceEvent,W)}}const S=TP().clickDistance(_).on("start",P=>{const{domNode:L,nodeDragThreshold:N,transform:A,snapGrid:R,snapToGrid:O}=t();c=(L==null?void 0:L.getBoundingClientRect())||null,p=!1,m=!1,v=P.sourceEvent,N===0&&F(P),s=eo(P.sourceEvent,{transform:A,snapGrid:R,snapToGrid:O,containerBounds:c}),u=Ht(P.sourceEvent,c)}).on("drag",P=>{const{autoPanOnNodeDrag:L,transform:N,snapGrid:A,snapToGrid:R,nodeDragThreshold:O,nodeLookup:j}=t(),M=eo(P.sourceEvent,{transform:N,snapGrid:A,snapToGrid:R,containerBounds:c});if(v=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||C&&!j.has(C))&&(p=!0),!p){if(!l&&L&&d&&(l=!0,I()),!d){const q=Ht(P.sourceEvent,c),$=q.x-u.x,D=q.y-u.y;Math.sqrt($*$+D*D)>O&&F(P)}(s.x!==M.xSnapped||s.y!==M.ySnapped)&&a&&d&&(u=Ht(P.sourceEvent,c),k(M))}}).on("end",P=>{if(!(!d||p)&&(l=!1,d=!1,cancelAnimationFrame(o),a.size>0)){const{nodeLookup:L,updateNodePositions:N,onNodeDragStop:A,onSelectionDragStop:R}=t();if(m&&(N(a,!1),m=!1),i||A||!C&&R){const[O,j]=Wc({nodeId:C,dragItems:a,nodeLookup:L,dragging:!1});i==null||i(P.sourceEvent,a,O,j),A==null||A(P.sourceEvent,O,j),C||R==null||R(P.sourceEvent,j)}}}).filter(P=>{const L=P.target;return!P.button&&(!x||!U1(L,`.${x}`,b))&&(!y||U1(L,y,b))});f.call(S)}function g(){f==null||f.on(".drag",null)}return{update:w,destroy:g}}function Z5(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())To(i,Zi(s))>0&&r.push(s);return r}const J5=250;function eF(e,t,n,r){var a,l;let i=[],s=1/0;const o=Z5(e,n,t+J5);for(const u of o){const c=[...((a=u.internals.handleBounds)==null?void 0:a.source)??[],...((l=u.internals.handleBounds)==null?void 0:l.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:p}=ei(u,d,d.position,!0),m=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(p-e.y,2));m>t||(m<s?(i=[{...d,x:f,y:p}],s=m):m===s&&i.push({...d,x:f,y:p}))}}if(!i.length)return null;if(i.length>1){const u=r.type==="source"?"target":"source";return i.find(c=>c.type===u)??i[0]}return i[0]}function pj(e,t,n,r,i,s=!1){var u,c,d;const o=r.get(e);if(!o)return null;const a=i==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((c=o.internals.handleBounds)==null?void 0:c.source)??[],...((d=o.internals.handleBounds)==null?void 0:d.target)??[]],l=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return l&&s?{...l,...ei(o,l,l.position,!0)}:l}function mj(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function tF(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const gj=()=>!0;function nF(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:a,nodeLookup:l,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:v,onConnectEnd:w,isValidConnection:g=gj,onReconnectEnd:x,updateConnection:y,getTransform:b,getFromHandle:E,autoPanSpeed:C,dragThreshold:_=1,handleDomNode:k}){const I=rj(e.target);let F=0,S;const{x:P,y:L}=Ht(e),N=mj(s,k),A=a==null?void 0:a.getBoundingClientRect();let R=!1;if(!A||!N)return;const O=pj(i,N,r,l,t);if(!O)return;let j=Ht(e,A),M=!1,q=null,$=!1,D=null;function z(){if(!c||!A)return;const[re,ee]=JP(j,A,C);f({x:re,y:ee}),F=requestAnimationFrame(z)}const V={...O,nodeId:i,type:N,position:O.position},U=l.get(i);let Y={inProgress:!0,isValid:null,from:ei(U,V,K.Left,!0),fromHandle:V,fromPosition:V.position,fromNode:U,to:j,toHandle:null,toPosition:I1[V.position],toNode:null,pointer:j};function H(){R=!0,y(Y),m==null||m(e,{nodeId:i,handleId:r,handleType:N})}_===0&&H();function X(re){if(!R){const{x:ne,y:tt}=Ht(re),Ye=ne-P,hn=tt-L;if(!(Ye*Ye+hn*hn>_*_))return;H()}if(!E()||!V){se(re);return}const ee=b();j=Ht(re,A),S=eF(Qo(j,ee,!1,[1,1]),n,l,V),M||(z(),M=!0);const Z=yj(re,{handle:S,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:g,doc:I,lib:u,flowId:d,nodeLookup:l});D=Z.handleDomNode,q=Z.connection,$=tF(!!S,Z.isValid);const ce=l.get(i),J=ce?ei(ce,V,K.Left,!0):Y.from,ae={...Y,from:J,isValid:$,to:Z.toHandle&&$?Xl({x:Z.toHandle.x,y:Z.toHandle.y},ee):j,toHandle:Z.toHandle,toPosition:$&&Z.toHandle?Z.toHandle.position:I1[V.position],toNode:Z.toHandle?l.get(Z.toHandle.nodeId):null,pointer:j};y(ae),Y=ae}function se(re){if(!("touches"in re&&re.touches.length>0)){if(R){(S||D)&&q&&$&&(v==null||v(q));const{inProgress:ee,...Z}=Y,ce={...Z,toPosition:Y.toHandle?Y.toPosition:null};w==null||w(re,ce),s&&(x==null||x(re,ce))}p(),cancelAnimationFrame(F),M=!1,$=!1,q=null,D=null,I.removeEventListener("mousemove",X),I.removeEventListener("mouseup",se),I.removeEventListener("touchmove",X),I.removeEventListener("touchend",se)}}I.addEventListener("mousemove",X),I.addEventListener("mouseup",se),I.addEventListener("touchmove",X),I.addEventListener("touchend",se)}function yj(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:a,flowId:l,isValidConnection:u=gj,nodeLookup:c}){const d=s==="target",f=t?o.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:p,y:m}=Ht(e),v=o.elementFromPoint(p,m),w=v!=null&&v.classList.contains(`${a}-flow__handle`)?v:f,g={handleDomNode:w,isValid:!1,connection:null,toHandle:null};if(w){const x=mj(void 0,w),y=w.getAttribute("data-nodeid"),b=w.getAttribute("data-handleid"),E=w.classList.contains("connectable"),C=w.classList.contains("connectableend");if(!y||!x)return g;const _={source:d?y:r,sourceHandle:d?b:i,target:d?r:y,targetHandle:d?i:b};g.connection=_;const I=E&&C&&(n===Zr.Strict?d&&x==="source"||!d&&x==="target":y!==r||b!==i);g.isValid=I&&u(_),g.toHandle=pj(y,x,b,c,n,!0)}return g}const hy={onPointerDown:nF,isValid:yj};function rF({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=gt(e);function s({translateExtent:a,width:l,height:u,zoomStep:c=1,pannable:d=!0,zoomable:f=!0,inversePan:p=!1}){const m=y=>{if(y.sourceEvent.type!=="wheel"||!t)return;const b=n(),E=y.sourceEvent.ctrlKey&&Mo()?10:1,C=-y.sourceEvent.deltaY*(y.sourceEvent.deltaMode===1?.05:y.sourceEvent.deltaMode?1:.002)*c,_=b[2]*Math.pow(2,C*E);t.scaleTo(_)};let v=[0,0];const w=y=>{(y.sourceEvent.type==="mousedown"||y.sourceEvent.type==="touchstart")&&(v=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY])},g=y=>{const b=n();if(y.sourceEvent.type!=="mousemove"&&y.sourceEvent.type!=="touchmove"||!t)return;const E=[y.sourceEvent.clientX??y.sourceEvent.touches[0].clientX,y.sourceEvent.clientY??y.sourceEvent.touches[0].clientY],C=[E[0]-v[0],E[1]-v[1]];v=E;const _=r()*Math.max(b[2],Math.log(b[2]))*(p?-1:1),k={x:b[0]-C[0]*_,y:b[1]-C[1]*_},I=[[0,0],[l,u]];t.setViewportConstrained({x:k.x,y:k.y,zoom:b[2]},I,a)},x=UP().on("start",w).on("zoom",d?g:null).on("zoom.wheel",f?m:null);i.call(x,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:Vt}}const Lu=e=>({x:e.x,y:e.y,zoom:e.k}),Gc=({x:e,y:t,zoom:n})=>Ru.translate(e,t).scale(n),Ci=(e,t)=>e.target.closest(`.${t}`),vj=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),iF=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Yc=(e,t=0,n=iF,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},xj=e=>{const t=e.ctrlKey&&Mo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function sF({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:u}){return c=>{if(Ci(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&o){const w=Vt(c),g=xj(c),x=d*Math.pow(2,g);r.scaleTo(n,x,w,c);return}const f=c.deltaMode===1?20:1;let p=i===Br.Vertical?0:c.deltaX*f,m=i===Br.Horizontal?0:c.deltaY*f;!Mo()&&c.shiftKey&&i!==Br.Vertical&&(p=c.deltaY*f,m=0),r.translateBy(n,-(p/d)*s,-(m/d)*s,{internal:!0});const v=Lu(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(c,v),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(c,v))}}function oF({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",o=!t&&s&&!r.ctrlKey,a=Ci(r,e);if(r.ctrlKey&&s&&a&&r.preventDefault(),o||a)return null;r.preventDefault(),n.call(this,r,i)}}function aF({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,o,a;if((s=r.sourceEvent)!=null&&s.internal)return;const i=Lu(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function lF({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,a;e.usedRightMouseButton=!!(n&&vj(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((a=s.sourceEvent)!=null&&a.internal)&&(i==null||i(s.sourceEvent,Lu(s.transform)))}}function uF({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return o=>{var a;if(!((a=o.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,s&&vj(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const l=Lu(o.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,l)},n?150:0)}}}function cF({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:a,noPanClassName:l,lib:u,connectionInProgress:c}){return d=>{var w;const f=e||t,p=n&&d.ctrlKey,m=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Ci(d,`${u}-flow__node`)||Ci(d,`${u}-flow__edge`)))return!0;if(!r&&!f&&!i&&!s&&!n||o||c&&!m||Ci(d,a)&&m||Ci(d,l)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type==="touchstart"&&((w=d.touches)==null?void 0:w.length)>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&v}}function dF({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:a,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect(),d=UP().scaleExtent([t,n]).translateExtent(r),f=gt(e).call(d);x({x:i.x,y:i.y,zoom:Qi(i.zoom,t,n)},[[0,0],[c.width,c.height]],r);const p=f.on("wheel.zoom"),m=f.on("dblclick.zoom");d.wheelDelta(xj);function v(S,P){return f?new Promise(L=>{d==null||d.interpolate((P==null?void 0:P.interpolate)==="linear"?Js:ul).transform(Yc(f,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>L(!0)),S)}):Promise.resolve(!1)}function w({noWheelClassName:S,noPanClassName:P,onPaneContextMenu:L,userSelectionActive:N,panOnScroll:A,panOnDrag:R,panOnScrollMode:O,panOnScrollSpeed:j,preventScrolling:M,zoomOnPinch:q,zoomOnScroll:$,zoomOnDoubleClick:D,zoomActivationKeyPressed:z,lib:V,onTransformChange:U,connectionInProgress:W,paneClickDistance:Y,selectionOnDrag:H}){N&&!u.isZoomingOrPanning&&g();const X=A&&!z&&!N;d.clickDistance(H?1/0:!Bt(Y)||Y<0?0:Y);const se=X?sF({zoomPanValues:u,noWheelClassName:S,d3Selection:f,d3Zoom:d,panOnScrollMode:O,panOnScrollSpeed:j,zoomOnPinch:q,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:a}):oF({noWheelClassName:S,preventScrolling:M,d3ZoomHandler:p});if(f.on("wheel.zoom",se,{passive:!1}),!N){const ee=aF({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:o});d.on("start",ee);const Z=lF({zoomPanValues:u,panOnDrag:R,onPaneContextMenu:!!L,onPanZoom:s,onTransformChange:U});d.on("zoom",Z);const ce=uF({zoomPanValues:u,panOnDrag:R,panOnScroll:A,onPaneContextMenu:L,onPanZoomEnd:a,onDraggingChange:l});d.on("end",ce)}const re=cF({zoomActivationKeyPressed:z,panOnDrag:R,zoomOnScroll:$,panOnScroll:A,zoomOnDoubleClick:D,zoomOnPinch:q,userSelectionActive:N,noPanClassName:P,noWheelClassName:S,lib:V,connectionInProgress:W});d.filter(re),D?f.on("dblclick.zoom",m):f.on("dblclick.zoom",null)}function g(){d.on("zoom",null)}async function x(S,P,L){const N=Gc(S),A=d==null?void 0:d.constrain()(N,P,L);return A&&await v(A),new Promise(R=>R(A))}async function y(S,P){const L=Gc(S);return await v(L,P),new Promise(N=>N(L))}function b(S){if(f){const P=Gc(S),L=f.property("__zoom");(L.k!==S.zoom||L.x!==S.x||L.y!==S.y)&&(d==null||d.transform(f,P,null,{sync:!0}))}}function E(){const S=f?HP(f.node()):{x:0,y:0,k:1};return{x:S.x,y:S.y,zoom:S.k}}function C(S,P){return f?new Promise(L=>{d==null||d.interpolate((P==null?void 0:P.interpolate)==="linear"?Js:ul).scaleTo(Yc(f,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>L(!0)),S)}):Promise.resolve(!1)}function _(S,P){return f?new Promise(L=>{d==null||d.interpolate((P==null?void 0:P.interpolate)==="linear"?Js:ul).scaleBy(Yc(f,P==null?void 0:P.duration,P==null?void 0:P.ease,()=>L(!0)),S)}):Promise.resolve(!1)}function k(S){d==null||d.scaleExtent(S)}function I(S){d==null||d.translateExtent(S)}function F(S){const P=!Bt(S)||S<0?0:S;d==null||d.clickDistance(P)}return{update:w,destroy:g,setViewport:y,setViewportConstrained:x,getViewport:E,scaleTo:C,scaleBy:_,setScaleExtent:k,setTranslateExtent:I,syncViewport:b,setClickDistance:F}}var es;(function(e){e.Line="line",e.Handle="handle"})(es||(es={}));function fF({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const o=e-t,a=n-r,l=[o>0?1:o<0?-1:0,a>0?1:a<0?-1:0];return o&&i&&(l[0]=l[0]*-1),a&&s&&(l[1]=l[1]*-1),l}function W1(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Gn(e,t){return Math.max(0,t-e)}function Yn(e,t){return Math.max(0,e-t)}function qa(e,t,n){return Math.max(0,t-e,e-n)}function G1(e,t){return e?!t:t}function hF(e,t,n,r,i,s,o,a){let{affectsX:l,affectsY:u}=t;const{isHorizontal:c,isVertical:d}=t,f=c&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:v,maxWidth:w,minHeight:g,maxHeight:x}=r,{x:y,y:b,width:E,height:C,aspectRatio:_}=e;let k=Math.floor(c?p-e.pointerX:0),I=Math.floor(d?m-e.pointerY:0);const F=E+(l?-k:k),S=C+(u?-I:I),P=-s[0]*E,L=-s[1]*C;let N=qa(F,v,w),A=qa(S,g,x);if(o){let j=0,M=0;l&&k<0?j=Gn(y+k+P,o[0][0]):!l&&k>0&&(j=Yn(y+F+P,o[1][0])),u&&I<0?M=Gn(b+I+L,o[0][1]):!u&&I>0&&(M=Yn(b+S+L,o[1][1])),N=Math.max(N,j),A=Math.max(A,M)}if(a){let j=0,M=0;l&&k>0?j=Yn(y+k,a[0][0]):!l&&k<0&&(j=Gn(y+F,a[1][0])),u&&I>0?M=Yn(b+I,a[0][1]):!u&&I<0&&(M=Gn(b+S,a[1][1])),N=Math.max(N,j),A=Math.max(A,M)}if(i){if(c){const j=qa(F/_,g,x)*_;if(N=Math.max(N,j),o){let M=0;!l&&!u||l&&!u&&f?M=Yn(b+L+F/_,o[1][1])*_:M=Gn(b+L+(l?k:-k)/_,o[0][1])*_,N=Math.max(N,M)}if(a){let M=0;!l&&!u||l&&!u&&f?M=Gn(b+F/_,a[1][1])*_:M=Yn(b+(l?k:-k)/_,a[0][1])*_,N=Math.max(N,M)}}if(d){const j=qa(S*_,v,w)/_;if(A=Math.max(A,j),o){let M=0;!l&&!u||u&&!l&&f?M=Yn(y+S*_+P,o[1][0])/_:M=Gn(y+(u?I:-I)*_+P,o[0][0])/_,A=Math.max(A,M)}if(a){let M=0;!l&&!u||u&&!l&&f?M=Gn(y+S*_,a[1][0])/_:M=Yn(y+(u?I:-I)*_,a[0][0])/_,A=Math.max(A,M)}}}I=I+(I<0?A:-A),k=k+(k<0?N:-N),i&&(f?F>S*_?I=(G1(l,u)?-k:k)/_:k=(G1(l,u)?-I:I)*_:c?(I=k/_,u=l):(k=I*_,l=u));const R=l?y+k:y,O=u?b+I:b;return{width:E+(l?-k:k),height:C+(u?-I:I),x:s[0]*k*(l?-1:1)+R,y:s[1]*I*(u?-1:1)+O}}const wj={width:0,height:0,x:0,y:0},pF={...wj,pointerX:0,pointerY:0,aspectRatio:1};function mF(e){return[[0,0],[e.measured.width,e.measured.height]]}function gF(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,a=n[0]*s,l=n[1]*o;return[[r-a,i-l],[r+s-a,i+o-l]]}function yF({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=gt(e);let o={controlDirection:W1("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:u,boundaries:c,keepAspectRatio:d,resizeDirection:f,onResizeStart:p,onResize:m,onResizeEnd:v,shouldResize:w}){let g={...wj},x={...pF};o={boundaries:c,resizeDirection:f,keepAspectRatio:d,controlDirection:W1(u)};let y,b=null,E=[],C,_,k,I=!1;const F=TP().on("start",S=>{const{nodeLookup:P,transform:L,snapGrid:N,snapToGrid:A,nodeOrigin:R,paneDomNode:O}=n();if(y=P.get(t),!y)return;b=(O==null?void 0:O.getBoundingClientRect())??null;const{xSnapped:j,ySnapped:M}=eo(S.sourceEvent,{transform:L,snapGrid:N,snapToGrid:A,containerBounds:b});g={width:y.measured.width??0,height:y.measured.height??0,x:y.position.x??0,y:y.position.y??0},x={...g,pointerX:j,pointerY:M,aspectRatio:g.width/g.height},C=void 0,y.parentId&&(y.extent==="parent"||y.expandParent)&&(C=P.get(y.parentId),_=C&&y.extent==="parent"?mF(C):void 0),E=[],k=void 0;for(const[q,$]of P)if($.parentId===t&&(E.push({id:q,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const D=gF($,y,$.origin??R);k?k=[[Math.min(D[0][0],k[0][0]),Math.min(D[0][1],k[0][1])],[Math.max(D[1][0],k[1][0]),Math.max(D[1][1],k[1][1])]]:k=D}p==null||p(S,{...g})}).on("drag",S=>{const{transform:P,snapGrid:L,snapToGrid:N,nodeOrigin:A}=n(),R=eo(S.sourceEvent,{transform:P,snapGrid:L,snapToGrid:N,containerBounds:b}),O=[];if(!y)return;const{x:j,y:M,width:q,height:$}=g,D={},z=y.origin??A,{width:V,height:U,x:W,y:Y}=hF(x,o.controlDirection,R,o.boundaries,o.keepAspectRatio,z,_,k),H=V!==q,X=U!==$,se=W!==j&&H,re=Y!==M&&X;if(!se&&!re&&!H&&!X)return;if((se||re||z[0]===1||z[1]===1)&&(D.x=se?W:g.x,D.y=re?Y:g.y,g.x=D.x,g.y=D.y,E.length>0)){const J=W-j,ae=Y-M;for(const ne of E)ne.position={x:ne.position.x-J+z[0]*(V-q),y:ne.position.y-ae+z[1]*(U-$)},O.push(ne)}if((H||X)&&(D.width=H&&(!o.resizeDirection||o.resizeDirection==="horizontal")?V:g.width,D.height=X&&(!o.resizeDirection||o.resizeDirection==="vertical")?U:g.height,g.width=D.width,g.height=D.height),C&&y.expandParent){const J=z[0]*(D.width??0);D.x&&D.x<J&&(g.x=J,x.x=x.x-(D.x-J));const ae=z[1]*(D.height??0);D.y&&D.y<ae&&(g.y=ae,x.y=x.y-(D.y-ae))}const ee=fF({width:g.width,prevWidth:q,height:g.height,prevHeight:$,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),Z={...g,direction:ee};(w==null?void 0:w(S,Z))!==!1&&(I=!0,m==null||m(S,Z),r(D,O))}).on("end",S=>{I&&(v==null||v(S,{...g}),i==null||i({...g}),I=!1)});s.call(F)}function l(){s.on(".drag",null)}return{update:a,destroy:l}}var bj={exports:{}},_j={},Sj={exports:{}},Nj={};/**
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 ts=T;function vF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xF=typeof Object.is=="function"?Object.is:vF,wF=ts.useState,bF=ts.useEffect,_F=ts.useLayoutEffect,SF=ts.useDebugValue;function NF(e,t){var n=t(),r=wF({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return _F(function(){i.value=n,i.getSnapshot=t,Kc(i)&&s({inst:i})},[e,n,t]),bF(function(){return Kc(i)&&s({inst:i}),e(function(){Kc(i)&&s({inst:i})})},[e]),SF(n),n}function Kc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xF(e,n)}catch{return!0}}function EF(e,t){return t()}var CF=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?EF:NF;Nj.useSyncExternalStore=ts.useSyncExternalStore!==void 0?ts.useSyncExternalStore:CF;Sj.exports=Nj;var kF=Sj.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 Fu=T,PF=kF;function jF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var TF=typeof Object.is=="function"?Object.is:jF,MF=PF.useSyncExternalStore,AF=Fu.useRef,IF=Fu.useEffect,RF=Fu.useMemo,DF=Fu.useDebugValue;_j.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var s=AF(null);if(s.current===null){var o={hasValue:!1,value:null};s.current=o}else o=s.current;s=RF(function(){function l(p){if(!u){if(u=!0,c=p,p=r(p),i!==void 0&&o.hasValue){var m=o.value;if(i(m,p))return d=m}return d=p}if(m=d,TF(c,p))return m;var v=r(p);return i!==void 0&&i(m,v)?(c=p,m):(c=p,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var a=MF(e,s[0],s[1]);return IF(function(){o.hasValue=!0,o.value=a},[a]),DF(a),a};bj.exports=_j;var OF=bj.exports;const Ej=Ly(OF),LF={},Y1=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(m=>m(t,p))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(LF?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,i,l);return l},Cj=e=>e?Y1(e):Y1,{useDebugValue:FF}=pu,{useSyncExternalStoreWithSelector:qF}=Ej,VF=e=>e;function kj(e,t=VF,n){const r=qF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return FF(r),r}const K1=(e,t)=>{const n=Cj(e),r=(i,s=t)=>kj(n,i,s);return Object.assign(r,n),r},$F=(e,t)=>e?K1(e,t):K1;function _e(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const qu=T.createContext(null),zF=qu.Provider,Pj=cn.error001();function ue(e,t){const n=T.useContext(qu);if(n===null)throw new Error(Pj);return kj(n,e,t)}function Se(){const e=T.useContext(qu);if(e===null)throw new Error(Pj);return T.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const X1={display:"none"},BF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},jj="react-flow__node-desc",Tj="react-flow__edge-desc",HF="react-flow__aria-live",UF=e=>e.ariaLiveMessage,WF=e=>e.ariaLabelConfig;function GF({rfId:e}){const t=ue(UF);return h.jsx("div",{id:`${HF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:BF,children:t})}function YF({rfId:e,disableKeyboardA11y:t}){const n=ue(WF);return h.jsxs(h.Fragment,{children:[h.jsx("div",{id:`${jj}-${e}`,style:X1,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),h.jsx("div",{id:`${Tj}-${e}`,style:X1,children:n["edge.a11yDescription.default"]}),!t&&h.jsx(GF,{rfId:e})]})}const Vu=T.forwardRef(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{const o=`${e}`.split("-");return h.jsx("div",{className:Oe(["react-flow__panel",n,...o]),style:r,ref:s,...i,children:t})});Vu.displayName="Panel";function KF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:h.jsx(Vu,{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:h.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const XF=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Va=e=>e.id;function QF(e,t){return _e(e.selectedNodes.map(Va),t.selectedNodes.map(Va))&&_e(e.selectedEdges.map(Va),t.selectedEdges.map(Va))}function ZF({onSelectionChange:e}){const t=Se(),{selectedNodes:n,selectedEdges:r}=ue(XF,QF);return T.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}const JF=e=>!!e.onSelectionChangeHandlers;function eq({onSelectionChange:e}){const t=ue(JF);return e||t?h.jsx(ZF,{onSelectionChange:e}):null}const Mj=[0,0],tq={x:0,y:0,zoom:1},nq=["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"],Q1=[...nq,"rfId"],rq=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}),Z1={translateExtent:Po,nodeOrigin:Mj,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function iq(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:o,reset:a,setDefaultNodesAndEdges:l}=ue(rq,_e),u=Se();T.useEffect(()=>(l(e.defaultNodes,e.defaultEdges),()=>{c.current=Z1,a()}),[]);const c=T.useRef(Z1);return T.useEffect(()=>{for(const d of Q1){const f=e[d],p=c.current[d];f!==p&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?i(f):d==="translateExtent"?s(f):d==="nodeExtent"?o(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:j5(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}c.current=e},Q1.map(d=>e[d])),null}function J1(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function sq(e){var r;const[t,n]=T.useState(e==="system"?null:e);return T.useEffect(()=>{if(e!=="system"){n(e);return}const i=J1(),s=()=>n(i!=null&&i.matches?"dark":"light");return s(),i==null||i.addEventListener("change",s),()=>{i==null||i.removeEventListener("change",s)}},[e]),t!==null?t:(r=J1())!=null&&r.matches?"dark":"light"}const ew=typeof document<"u"?document:null;function Ao(e=null,t={target:ew,actInsideInputWithModifier:!0}){const[n,r]=T.useState(!1),i=T.useRef(!1),s=T.useRef(new Set([])),[o,a]=T.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
57
+ `).replace(`
58
+
59
+ `,`
60
+ +`).split(`
61
+ `)),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return T.useEffect(()=>{const l=(t==null?void 0:t.target)??ew,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=p=>{var w,g;if(i.current=p.ctrlKey||p.metaKey||p.shiftKey||p.altKey,(!i.current||i.current&&!u)&&ij(p))return!1;const v=nw(p.code,a);if(s.current.add(p[v]),tw(o,s.current,!1)){const x=((g=(w=p.composedPath)==null?void 0:w.call(p))==null?void 0:g[0])||p.target,y=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(i.current||!y)&&p.preventDefault(),r(!0)}},d=p=>{const m=nw(p.code,a);tw(o,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(p[m]),p.key==="Meta"&&s.current.clear(),i.current=!1},f=()=>{s.current.clear(),r(!1)};return l==null||l.addEventListener("keydown",c),l==null||l.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{l==null||l.removeEventListener("keydown",c),l==null||l.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function tw(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function nw(e,t){return t.includes(e)?"code":"key"}const oq=()=>{const e=Se();return T.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,i,s],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:i,minZoom:s,maxZoom:o,panZoom:a}=e.getState(),l=zv(t,r,i,s,o,(n==null?void 0:n.padding)??.1);return a?(await a.setViewport(l,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:i,snapToGrid:s,domNode:o}=e.getState();if(!o)return t;const{x:a,y:l}=o.getBoundingClientRect(),u={x:t.x-a,y:t.y-l},c=n.snapGrid??i,d=n.snapToGrid??s;return Qo(u,r,d,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:i,y:s}=r.getBoundingClientRect(),o=Xl(t,n);return{x:o.x+i,y:o.y+s}}}),[])};function Aj(e,t){const n=[],r=new Map,i=[];for(const s of e)if(s.type==="add"){i.push(s);continue}else if(s.type==="remove"||s.type==="replace")r.set(s.id,[s]);else{const o=r.get(s.id);o?o.push(s):r.set(s.id,[s])}for(const s of t){const o=r.get(s.id);if(!o){n.push(s);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const a={...s};for(const l of o)aq(l,a);n.push(a)}return i.length&&i.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function aq(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 Ij(e,t){return Aj(e,t)}function Rj(e,t){return Aj(e,t)}function Tr(e,t){return{id:e,type:"select",selected:t}}function ki(e,t=new Set,n=!1){const r=[];for(const[i,s]of e){const o=t.has(i);!(s.selected===void 0&&!o)&&s.selected!==o&&(n&&(s.selected=o),r.push(Tr(s.id,o)))}return r}function rw({items:e=[],lookup:t}){var i;const n=[],r=new Map(e.map(s=>[s.id,s]));for(const[s,o]of e.entries()){const a=t.get(o.id),l=((i=a==null?void 0:a.internals)==null?void 0:i.userNode)??a;l!==void 0&&l!==o&&n.push({id:o.id,item:o,type:"replace"}),l===void 0&&n.push({item:o,type:"add",index:s})}for(const[s]of t)r.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function iw(e){return{id:e.id,type:"remove"}}const sw=e=>x5(e),lq=e=>XP(e);function Dj(e){return T.forwardRef(e)}const uq=typeof window<"u"?T.useLayoutEffect:T.useEffect;function ow(e){const[t,n]=T.useState(BigInt(0)),[r]=T.useState(()=>cq(()=>n(i=>i+BigInt(1))));return uq(()=>{const i=r.get();i.length&&(e(i),r.reset())},[t]),r}function cq(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Oj=T.createContext(null);function dq({children:e}){const t=Se(),n=T.useCallback(a=>{const{nodes:l=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f,fitViewQueued:p,onNodesChangeMiddlewareMap:m}=t.getState();let v=l;for(const g of a)v=typeof g=="function"?g(v):g;let w=rw({items:v,lookup:f});for(const g of m.values())w=g(w);c&&u(v),w.length>0?d==null||d(w):p&&window.requestAnimationFrame(()=>{const{fitViewQueued:g,nodes:x,setNodes:y}=t.getState();g&&y(x)})},[]),r=ow(n),i=T.useCallback(a=>{const{edges:l=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState();let p=l;for(const m of a)p=typeof m=="function"?m(p):m;c?u(p):d&&d(rw({items:p,lookup:f}))},[]),s=ow(i),o=T.useMemo(()=>({nodeQueue:r,edgeQueue:s}),[]);return h.jsx(Oj.Provider,{value:o,children:e})}function fq(){const e=T.useContext(Oj);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const hq=e=>!!e.panZoom;function Kv(){const e=oq(),t=Se(),n=fq(),r=ue(hq),i=T.useMemo(()=>{const s=d=>t.getState().nodeLookup.get(d),o=d=>{n.nodeQueue.push(d)},a=d=>{n.edgeQueue.push(d)},l=d=>{var g,x;const{nodeLookup:f,nodeOrigin:p}=t.getState(),m=sw(d)?d:f.get(d.id),v=m.parentId?nj(m.position,m.measured,m.parentId,f,p):m.position,w={...m,position:v,width:((g=m.measured)==null?void 0:g.width)??m.width,height:((x=m.measured)==null?void 0:x.height)??m.height};return Zi(w)},u=(d,f,p={replace:!1})=>{o(m=>m.map(v=>{if(v.id===d){const w=typeof f=="function"?f(v):f;return p.replace&&sw(w)?w:{...v,...w}}return v}))},c=(d,f,p={replace:!1})=>{a(m=>m.map(v=>{if(v.id===d){const w=typeof f=="function"?f(v):f;return p.replace&&lq(w)?w:{...v,...w}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=s(d))==null?void 0:f.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:o,setEdges:a,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(p=>[...p,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(p=>[...p,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:p}=t.getState(),[m,v,w]=p;return{nodes:d.map(g=>({...g})),edges:f.map(g=>({...g})),viewport:{x:m,y:v,zoom:w}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:p,edges:m,onNodesDelete:v,onEdgesDelete:w,triggerNodeChanges:g,triggerEdgeChanges:x,onDelete:y,onBeforeDelete:b}=t.getState(),{nodes:E,edges:C}=await N5({nodesToRemove:d,edgesToRemove:f,nodes:p,edges:m,onBeforeDelete:b}),_=C.length>0,k=E.length>0;if(_){const I=C.map(iw);w==null||w(C),x(I)}if(k){const I=E.map(iw);v==null||v(E),g(I)}return(k||_)&&(y==null||y({nodes:E,edges:C})),{deletedNodes:E,deletedEdges:C}},getIntersectingNodes:(d,f=!0,p)=>{const m=D1(d),v=m?d:l(d),w=p!==void 0;return v?(p||t.getState().nodes).filter(g=>{const x=t.getState().nodeLookup.get(g.id);if(x&&!m&&(g.id===d.id||!x.internals.positionAbsolute))return!1;const y=Zi(w?g:x),b=To(y,v);return f&&b>0||b>=y.width*y.height||b>=v.width*v.height}):[]},isNodeIntersecting:(d,f,p=!0)=>{const v=D1(d)?d:l(d);if(!v)return!1;const w=To(v,f);return p&&w>0||w>=f.width*f.height||w>=v.width*v.height},updateNode:u,updateNodeData:(d,f,p={replace:!1})=>{u(d,m=>{const v=typeof f=="function"?f(m):f;return p.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},p)},updateEdge:c,updateEdgeData:(d,f,p={replace:!1})=>{c(d,m=>{const v=typeof f=="function"?f(m):f;return p.replace?{...m,data:v}:{...m,data:{...m.data,...v}}},p)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:p}=t.getState();return w5(d,{nodeLookup:f,nodeOrigin:p})},getHandleConnections:({type:d,id:f,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}-${d}${f?`-${f}`:""}`))==null?void 0:m.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:p})=>{var m;return Array.from(((m=t.getState().connectionLookup.get(`${p}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:m.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??P5();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(p=>[...p]),f.promise}}},[]);return T.useMemo(()=>({...i,...e,viewportInitialized:r}),[r])}const aw=e=>e.selected,pq=typeof window<"u"?window:void 0;function mq({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Se(),{deleteElements:r}=Kv(),i=Ao(e,{actInsideInputWithModifier:!1}),s=Ao(t,{target:pq});T.useEffect(()=>{if(i){const{edges:o,nodes:a}=n.getState();r({nodes:a.filter(aw),edges:o.filter(aw)}),n.setState({nodesSelectionActive:!1})}},[i]),T.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function gq(e){const t=Se();T.useEffect(()=>{const n=()=>{var i,s,o,a;if(!e.current||!(((s=(i=e.current).checkVisibility)==null?void 0:s.call(i))??!0))return!1;const r=Bv(e.current);(r.height===0||r.width===0)&&((a=(o=t.getState()).onError)==null||a.call(o,"004",cn.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const $u={position:"absolute",width:"100%",height:"100%",top:0,left:0},yq=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function vq({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:s=Br.Free,zoomOnDoubleClick:o=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:u,minZoom:c,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:v,noPanClassName:w,onViewportChange:g,isControlledViewport:x,paneClickDistance:y,selectionOnDrag:b}){const E=Se(),C=T.useRef(null),{userSelectionActive:_,lib:k,connectionInProgress:I}=ue(yq,_e),F=Ao(f),S=T.useRef();gq(C);const P=T.useCallback(L=>{g==null||g({x:L[0],y:L[1],zoom:L[2]}),x||E.setState({transform:L})},[g,x]);return T.useEffect(()=>{if(C.current){S.current=dF({domNode:C.current,minZoom:c,maxZoom:d,translateExtent:u,viewport:l,onDraggingChange:R=>E.setState({paneDragging:R}),onPanZoomStart:(R,O)=>{const{onViewportChangeStart:j,onMoveStart:M}=E.getState();M==null||M(R,O),j==null||j(O)},onPanZoom:(R,O)=>{const{onViewportChange:j,onMove:M}=E.getState();M==null||M(R,O),j==null||j(O)},onPanZoomEnd:(R,O)=>{const{onViewportChangeEnd:j,onMoveEnd:M}=E.getState();M==null||M(R,O),j==null||j(O)}});const{x:L,y:N,zoom:A}=S.current.getViewport();return E.setState({panZoom:S.current,transform:[L,N,A],domNode:C.current.closest(".react-flow")}),()=>{var R;(R=S.current)==null||R.destroy()}}},[]),T.useEffect(()=>{var L;(L=S.current)==null||L.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:s,zoomOnDoubleClick:o,panOnDrag:a,zoomActivationKeyPressed:F,preventScrolling:p,noPanClassName:w,userSelectionActive:_,noWheelClassName:v,lib:k,onTransformChange:P,connectionInProgress:I,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,s,o,a,F,p,w,_,v,k,P,I,b,y]),h.jsx("div",{className:"react-flow__renderer",ref:C,style:$u,children:m})}const xq=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function wq(){const{userSelectionActive:e,userSelectionRect:t}=ue(xq,_e);return e&&t?h.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)=>n=>{n.target===t.current&&(e==null||e(n))},bq=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function _q({isSelecting:e,selectionKeyPressed:t,selectionMode:n=jo.Full,panOnDrag:r,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:o,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:c,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:p,children:m}){const v=Se(),{userSelectionActive:w,elementsSelectable:g,dragging:x,connectionInProgress:y}=ue(bq,_e),b=g&&(e||w),E=T.useRef(null),C=T.useRef(),_=T.useRef(new Set),k=T.useRef(new Set),I=T.useRef(!1),F=j=>{if(I.current||y){I.current=!1;return}l==null||l(j),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},S=j=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){j.preventDefault();return}u==null||u(j)},P=c?j=>c(j):void 0,L=j=>{I.current&&(j.stopPropagation(),I.current=!1)},N=j=>{var U,W;const{domNode:M}=v.getState();if(C.current=M==null?void 0:M.getBoundingClientRect(),!C.current)return;const q=j.target===E.current;if(!q&&!!j.target.closest(".nokey")||!e||!(s&&q||t)||j.button!==0||!j.isPrimary)return;(W=(U=j.target)==null?void 0:U.setPointerCapture)==null||W.call(U,j.pointerId),I.current=!1;const{x:z,y:V}=Ht(j.nativeEvent,C.current);v.setState({userSelectionRect:{width:0,height:0,startX:z,startY:V,x:z,y:V}}),q||(j.stopPropagation(),j.preventDefault())},A=j=>{const{userSelectionRect:M,transform:q,nodeLookup:$,edgeLookup:D,connectionLookup:z,triggerNodeChanges:V,triggerEdgeChanges:U,defaultEdgeOptions:W,resetSelectedElements:Y}=v.getState();if(!C.current||!M)return;const{x:H,y:X}=Ht(j.nativeEvent,C.current),{startX:se,startY:re}=M;if(!I.current){const ae=t?0:i;if(Math.hypot(H-se,X-re)<=ae)return;Y(),o==null||o(j)}I.current=!0;const ee={startX:se,startY:re,x:H<se?H:se,y:X<re?X:re,width:Math.abs(H-se),height:Math.abs(X-re)},Z=_.current,ce=k.current;_.current=new Set($v($,ee,q,n===jo.Partial,!0).map(ae=>ae.id)),k.current=new Set;const J=(W==null?void 0:W.selectable)??!0;for(const ae of _.current){const ne=z.get(ae);if(ne)for(const{edgeId:tt}of ne.values()){const Ye=D.get(tt);Ye&&(Ye.selectable??J)&&k.current.add(tt)}}if(!O1(Z,_.current)){const ae=ki($,_.current,!0);V(ae)}if(!O1(ce,k.current)){const ae=ki(D,k.current);U(ae)}v.setState({userSelectionRect:ee,userSelectionActive:!0,nodesSelectionActive:!1})},R=j=>{var M,q;j.button===0&&((q=(M=j.target)==null?void 0:M.releasePointerCapture)==null||q.call(M,j.pointerId),!w&&j.target===E.current&&v.getState().userSelectionRect&&(F==null||F(j)),v.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(a==null||a(j),v.setState({nodesSelectionActive:_.current.size>0})))},O=r===!0||Array.isArray(r)&&r.includes(0);return h.jsxs("div",{className:Oe(["react-flow__pane",{draggable:O,dragging:x,selection:e}]),onClick:b?void 0:Xc(F,E),onContextMenu:Xc(S,E),onWheel:Xc(P,E),onPointerEnter:b?void 0:d,onPointerMove:b?A:f,onPointerUp:b?R:void 0,onPointerDownCapture:b?N:void 0,onClickCapture:b?L:void 0,onPointerLeave:p,ref:E,style:$u,children:[m,h.jsx(wq,{})]})}function py({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:s,multiSelectionActive:o,nodeLookup:a,onError:l}=t.getState(),u=a.get(e);if(!u){l==null||l("012",cn.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(s({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function Lj({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:s,nodeClickDistance:o}){const a=Se(),[l,u]=T.useState(!1),c=T.useRef();return T.useEffect(()=>{c.current=Q5({getStoreItems:()=>a.getState(),onNodeMouseDown:d=>{py({id:d,store:a,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),T.useEffect(()=>{var d,f;if(t)(d=c.current)==null||d.destroy();else if(e.current)return(f=c.current)==null||f.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:s,nodeId:i,nodeClickDistance:o}),()=>{var p;(p=c.current)==null||p.destroy()}},[n,r,t,s,e,i]),l}const Sq=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Fj(){const e=Se();return T.useCallback(n=>{const{nodeExtent:r,snapToGrid:i,snapGrid:s,nodesDraggable:o,onError:a,updateNodePositions:l,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,f=Sq(o),p=i?s[0]:5,m=i?s[1]:5,v=n.direction.x*p*n.factor,w=n.direction.y*m*n.factor;for(const[,g]of u){if(!f(g))continue;let x={x:g.internals.positionAbsolute.x+v,y:g.internals.positionAbsolute.y+w};i&&(x=Xo(x,s));const{position:y,positionAbsolute:b}=QP({nodeId:g.id,nextPosition:x,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:a});g.position=y,g.internals.positionAbsolute=b,d.set(g.id,g)}l(d)},[])}const Xv=T.createContext(null),Nq=Xv.Provider;Xv.Consumer;const qj=()=>T.useContext(Xv),Eq=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Cq=(e,t,n)=>r=>{const{connectionClickStartHandle:i,connectionMode:s,connection:o}=r,{fromHandle:a,toHandle:l,isValid:u}=o,c=(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n;return{connectingFrom:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,connectingTo:c,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.id)===t&&(i==null?void 0:i.type)===n,isPossibleEndHandle:s===Zr.Strict?(a==null?void 0:a.type)!==n:e!==(a==null?void 0:a.nodeId)||t!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!i,valid:c&&u}};function kq({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:s=!0,id:o,onConnect:a,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},p){var A,R;const m=o||null,v=e==="target",w=Se(),g=qj(),{connectOnClick:x,noPanClassName:y,rfId:b}=ue(Eq,_e),{connectingFrom:E,connectingTo:C,clickConnecting:_,isPossibleEndHandle:k,connectionInProcess:I,clickConnectionInProcess:F,valid:S}=ue(Cq(g,m,e),_e);g||(R=(A=w.getState()).onError)==null||R.call(A,"010",cn.error010());const P=O=>{const{defaultEdgeOptions:j,onConnect:M,hasDefaultEdges:q}=w.getState(),$={...j,...O};if(q){const{edges:D,setEdges:z}=w.getState();z(D5($,D))}M==null||M($),a==null||a($)},L=O=>{if(!g)return;const j=sj(O.nativeEvent);if(i&&(j&&O.button===0||!j)){const M=w.getState();hy.onPointerDown(O.nativeEvent,{handleDomNode:O.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:v,handleId:m,nodeId:g,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:M.onConnectEnd,updateConnection:M.updateConnection,onConnect:P,isValidConnection:n||M.isValidConnection,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}j?c==null||c(O):d==null||d(O)},N=O=>{const{onClickConnectStart:j,onClickConnectEnd:M,connectionClickStartHandle:q,connectionMode:$,isValidConnection:D,lib:z,rfId:V,nodeLookup:U,connection:W}=w.getState();if(!g||!q&&!i)return;if(!q){j==null||j(O.nativeEvent,{nodeId:g,handleId:m,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:g,type:e,id:m}});return}const Y=rj(O.target),H=n||D,{connection:X,isValid:se}=hy.isValid(O.nativeEvent,{handle:{nodeId:g,id:m,type:e},connectionMode:$,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:H,flowId:V,doc:Y,lib:z,nodeLookup:U});se&&X&&P(X);const re=structuredClone(W);delete re.inProgress,re.toPosition=re.toHandle?re.toHandle.position:null,M==null||M(O,re),w.setState({connectionClickStartHandle:null})};return h.jsx("div",{"data-handleid":m,"data-nodeid":g,"data-handlepos":t,"data-id":`${b}-${g}-${m}-${e}`,className:Oe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",y,u,{source:!v,target:v,connectable:r,connectablestart:i,connectableend:s,clickconnecting:_,connectingfrom:E,connectingto:C,valid:S,connectionindicator:r&&(!I||k)&&(I||F?s:i)}]),onMouseDown:L,onTouchStart:L,onClick:x?N:void 0,ref:p,...f,children:l})}const yr=T.memo(Dj(kq));function Pq({data:e,isConnectable:t,sourcePosition:n=K.Bottom}){return h.jsxs(h.Fragment,{children:[e==null?void 0:e.label,h.jsx(yr,{type:"source",position:n,isConnectable:t})]})}function jq({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:r=K.Bottom}){return h.jsxs(h.Fragment,{children:[h.jsx(yr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,h.jsx(yr,{type:"source",position:r,isConnectable:t})]})}function Tq(){return null}function Mq({data:e,isConnectable:t,targetPosition:n=K.Top}){return h.jsxs(h.Fragment,{children:[h.jsx(yr,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Zl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},lw={input:Pq,default:jq,output:Mq,group:Tq};function Aq(e){var t,n,r,i;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((i=e.style)==null?void 0:i.height)}}const Iq=e=>{const{width:t,height:n,x:r,y:i}=Ko(e.nodeLookup,{filter:s=>!!s.selected});return{width:Bt(t)?t:null,height:Bt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function Rq({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Se(),{width:i,height:s,transformString:o,userSelectionActive:a}=ue(Iq,_e),l=Fj(),u=T.useRef(null);if(T.useEffect(()=>{var f;n||(f=u.current)==null||f.focus({preventScroll:!0})},[n]),Lj({nodeRef:u}),a||!i||!s)return null;const c=e?f=>{const p=r.getState().nodes.filter(m=>m.selected);e(f,p)}:void 0,d=f=>{Object.prototype.hasOwnProperty.call(Zl,f.key)&&(f.preventDefault(),l({direction:Zl[f.key],factor:f.shiftKey?4:1}))};return h.jsx("div",{className:Oe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:h.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:d,style:{width:i,height:s}})})}const uw=typeof window<"u"?window:void 0,Dq=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Vj({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:v,zoomActivationKeyCode:w,elementsSelectable:g,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:E,panOnScrollMode:C,zoomOnDoubleClick:_,panOnDrag:k,defaultViewport:I,translateExtent:F,minZoom:S,maxZoom:P,preventScrolling:L,onSelectionContextMenu:N,noWheelClassName:A,noPanClassName:R,disableKeyboardA11y:O,onViewportChange:j,isControlledViewport:M}){const{nodesSelectionActive:q,userSelectionActive:$}=ue(Dq,_e),D=Ao(u,{target:uw}),z=Ao(v,{target:uw}),V=z||k,U=z||b,W=c&&V!==!0,Y=D||$||W;return mq({deleteKeyCode:l,multiSelectionKeyCode:m}),h.jsx(vq,{onPaneContextMenu:s,elementsSelectable:g,zoomOnScroll:x,zoomOnPinch:y,panOnScroll:U,panOnScrollSpeed:E,panOnScrollMode:C,zoomOnDoubleClick:_,panOnDrag:!D&&V,defaultViewport:I,translateExtent:F,minZoom:S,maxZoom:P,zoomActivationKeyCode:w,preventScrolling:L,noWheelClassName:A,noPanClassName:R,onViewportChange:j,isControlledViewport:M,paneClickDistance:a,selectionOnDrag:W,children:h.jsxs(_q,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:o,panOnDrag:V,isSelecting:!!Y,selectionMode:d,selectionKeyPressed:D,paneClickDistance:a,selectionOnDrag:W,children:[e,q&&h.jsx(Rq,{onSelectionContextMenu:N,noPanClassName:R,disableKeyboardA11y:O})]})})}Vj.displayName="FlowRenderer";const Oq=T.memo(Vj),Lq=e=>t=>e?$v(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Fq(e){return ue(T.useCallback(Lq(e),[e]),_e)}const qq=e=>e.updateNodeInternals;function Vq(){const e=ue(qq),[t]=T.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(i=>{const s=i.target.getAttribute("data-id");r.set(s,{id:s,nodeElement:i.target,force:!0})}),e(r)}));return T.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function $q({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const i=Se(),s=T.useRef(null),o=T.useRef(null),a=T.useRef(e.sourcePosition),l=T.useRef(e.targetPosition),u=T.useRef(t),c=n&&!!e.internals.handleBounds;return T.useEffect(()=>{s.current&&!e.hidden&&(!c||o.current!==s.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(s.current),o.current=s.current)},[c,e.hidden]),T.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),T.useEffect(()=>{if(s.current){const d=u.current!==t,f=a.current!==e.sourcePosition,p=l.current!==e.targetPosition;(d||f||p)&&(u.current=t,a.current=e.sourcePosition,l.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:s.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),s}function zq({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:s,onDoubleClick:o,nodesDraggable:a,elementsSelectable:l,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:v,nodeTypes:w,nodeClickDistance:g,onError:x}){const{node:y,internals:b,isParent:E}=ue(H=>{const X=H.nodeLookup.get(e),se=H.parentLookup.has(e);return{node:X,internals:X.internals,isParent:se}},_e);let C=y.type||"default",_=(w==null?void 0:w[C])||lw[C];_===void 0&&(x==null||x("003",cn.error003(C)),C="default",_=(w==null?void 0:w.default)||lw.default);const k=!!(y.draggable||a&&typeof y.draggable>"u"),I=!!(y.selectable||l&&typeof y.selectable>"u"),F=!!(y.connectable||u&&typeof y.connectable>"u"),S=!!(y.focusable||c&&typeof y.focusable>"u"),P=Se(),L=tj(y),N=$q({node:y,nodeType:C,hasDimensions:L,resizeObserver:d}),A=Lj({nodeRef:N,disabled:y.hidden||!k,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:g}),R=Fj();if(y.hidden)return null;const O=Vn(y),j=Aq(y),M=I||k||t||n||r||i,q=n?H=>n(H,{...b.userNode}):void 0,$=r?H=>r(H,{...b.userNode}):void 0,D=i?H=>i(H,{...b.userNode}):void 0,z=s?H=>s(H,{...b.userNode}):void 0,V=o?H=>o(H,{...b.userNode}):void 0,U=H=>{const{selectNodesOnDrag:X,nodeDragThreshold:se}=P.getState();I&&(!X||!k||se>0)&&py({id:e,store:P,nodeRef:N}),t&&t(H,{...b.userNode})},W=H=>{if(!(ij(H.nativeEvent)||m)){if(WP.includes(H.key)&&I){const X=H.key==="Escape";py({id:e,store:P,unselect:X,nodeRef:N})}else if(k&&y.selected&&Object.prototype.hasOwnProperty.call(Zl,H.key)){H.preventDefault();const{ariaLabelConfig:X}=P.getState();P.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),R({direction:Zl[H.key],factor:H.shiftKey?4:1})}}},Y=()=>{var ce;if(m||!((ce=N.current)!=null&&ce.matches(":focus-visible")))return;const{transform:H,width:X,height:se,autoPanOnNodeFocus:re,setCenter:ee}=P.getState();if(!re)return;$v(new Map([[e,y]]),{x:0,y:0,width:X,height:se},H,!0).length>0||ee(y.position.x+O.width/2,y.position.y+O.height/2,{zoom:H[2]})};return h.jsx("div",{className:Oe(["react-flow__node",`react-flow__node-${C}`,{[p]:k},y.className,{selected:y.selected,selectable:I,parent:E,draggable:k,dragging:A}]),ref:N,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:L?"visible":"hidden",...y.style,...j},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:q,onMouseMove:$,onMouseLeave:D,onContextMenu:z,onClick:U,onDoubleClick:V,onKeyDown:S?W:void 0,tabIndex:S?0:void 0,onFocus:S?Y:void 0,role:y.ariaRole??(S?"group":void 0),"aria-roledescription":"node","aria-describedby":m?void 0:`${jj}-${v}`,"aria-label":y.ariaLabel,...y.domAttributes,children:h.jsx(Nq,{value:e,children:h.jsx(_,{id:e,data:y.data,type:C,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:I,draggable:k,deletable:y.deletable??!0,isConnectable:F,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:A,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...O})})})}var Bq=T.memo(zq);const Hq=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function $j(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,onError:s}=ue(Hq,_e),o=Fq(e.onlyRenderVisibleElements),a=Vq();return h.jsx("div",{className:"react-flow__nodes",style:$u,children:o.map(l=>h.jsx(Bq,{id:l,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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:s},l))})}$j.displayName="NodeRenderer";const Uq=T.memo($j);function Wq(e){return ue(T.useCallback(n=>{if(!e)return n.edges.map(i=>i.id);const r=[];if(n.width&&n.height)for(const i of n.edges){const s=n.nodeLookup.get(i.source),o=n.nodeLookup.get(i.target);s&&o&&A5({sourceNode:s,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(i.id)}return r},[e]),_e)}const Gq=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return h.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Yq=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return h.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},cw={[Yl.Arrow]:Gq,[Yl.ArrowClosed]:Yq};function Kq(e){const t=Se();return T.useMemo(()=>{var i,s;return Object.prototype.hasOwnProperty.call(cw,e)?cw[e]:((s=(i=t.getState()).onError)==null||s.call(i,"009",cn.error009(e)),null)},[e])}const Xq=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:o,orient:a="auto-start-reverse"})=>{const l=Kq(t);return l?h.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:a,refX:"0",refY:"0",children:h.jsx(l,{color:n,strokeWidth:o})}):null},zj=({defaultColor:e,rfId:t})=>{const n=ue(s=>s.edges),r=ue(s=>s.defaultEdgeOptions),i=T.useMemo(()=>V5(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return i.length?h.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:h.jsx("defs",{children:i.map(s=>h.jsx(Xq,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};zj.displayName="MarkerDefinitions";var Qq=T.memo(zj);function Bj({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:s,labelBgPadding:o=[2,4],labelBgBorderRadius:a=2,children:l,className:u,...c}){const[d,f]=T.useState({x:1,y:0,width:0,height:0}),p=Oe(["react-flow__edge-textwrapper",u]),m=T.useRef(null);return T.useEffect(()=>{if(m.current){const v=m.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?h.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?"visible":"hidden",...c,children:[i&&h.jsx("rect",{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:"react-flow__edge-textbg",style:s,rx:a,ry:a}),h.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:m,style:r,children:n}),l]}):null}Bj.displayName="EdgeText";const Zq=T.memo(Bj);function Zo({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:u=20,...c}){return h.jsxs(h.Fragment,{children:[h.jsx("path",{...c,d:e,fill:"none",className:Oe(["react-flow__edge-path",c.className])}),u?h.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Bt(t)&&Bt(n)?h.jsx(Zq,{x:t,y:n,label:r,labelStyle:i,labelShowBg:s,labelBgStyle:o,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function dw({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===K.Left||e===K.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function Hj({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top}){const[o,a]=dw({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=dw({pos:s,x1:r,y1:i,x2:e,y2:t}),[c,d,f,p]=oj({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:a,targetControlX:l,targetControlY:u});return[`M${e},${t} C${o},${a} ${l},${u} ${r},${i}`,c,d,f,p]}function Uj(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o,targetPosition:a,label:l,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:w,interactionWidth:g})=>{const[x,y,b]=Hj({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:a}),E=e.isInternal?void 0:t;return h.jsx(Zo,{id:E,path:x,labelX:y,labelY:b,label:l,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:w,interactionWidth:g})})}const Jq=Uj({isInternal:!1}),Wj=Uj({isInternal:!0});Jq.displayName="SimpleBezierEdge";Wj.displayName="SimpleBezierEdgeInternal";function Gj(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:p=K.Bottom,targetPosition:m=K.Top,markerEnd:v,markerStart:w,pathOptions:g,interactionWidth:x})=>{const[y,b,E]=Ql({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:s,targetPosition:m,borderRadius:g==null?void 0:g.borderRadius,offset:g==null?void 0:g.offset,stepPosition:g==null?void 0:g.stepPosition}),C=e.isInternal?void 0:t;return h.jsx(Zo,{id:C,path:y,labelX:b,labelY:E,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:w,interactionWidth:x})})}const Yj=Gj({isInternal:!1}),Kj=Gj({isInternal:!0});Yj.displayName="SmoothStepEdge";Kj.displayName="SmoothStepEdgeInternal";function Xj(e){return T.memo(({id:t,...n})=>{var i;const r=e.isInternal?void 0:t;return h.jsx(Yj,{...n,id:r,pathOptions:T.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(i=n.pathOptions)==null?void 0:i.offset])})})}const eV=Xj({isInternal:!1}),Qj=Xj({isInternal:!0});eV.displayName="StepEdge";Qj.displayName="StepEdgeInternal";function Zj(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:v})=>{const[w,g,x]=uj({sourceX:n,sourceY:r,targetX:i,targetY:s}),y=e.isInternal?void 0:t;return h.jsx(Zo,{id:y,path:w,labelX:g,labelY:x,label:o,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:v})})}const tV=Zj({isInternal:!1}),Jj=Zj({isInternal:!0});tV.displayName="StraightEdge";Jj.displayName="StraightEdgeInternal";function eT(e){return T.memo(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:s,sourcePosition:o=K.Bottom,targetPosition:a=K.Top,label:l,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:w,pathOptions:g,interactionWidth:x})=>{const[y,b,E]=aj({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:s,targetPosition:a,curvature:g==null?void 0:g.curvature}),C=e.isInternal?void 0:t;return h.jsx(Zo,{id:C,path:y,labelX:b,labelY:E,label:l,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:v,markerStart:w,interactionWidth:x})})}const nV=eT({isInternal:!1}),tT=eT({isInternal:!0});nV.displayName="BezierEdge";tT.displayName="BezierEdgeInternal";const fw={default:tT,straight:Jj,step:Qj,smoothstep:Kj,simplebezier:Wj},hw={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},rV=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,iV=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,pw="react-flow__edgeupdater";function mw({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:s,onMouseOut:o,type:a}){return h.jsx("circle",{onMouseDown:i,onMouseEnter:s,onMouseOut:o,className:Oe([pw,`${pw}-${a}`]),cx:rV(t,r,e),cy:iV(n,r,e),r,stroke:"transparent",fill:"transparent"})}function sV({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:s,targetY:o,sourcePosition:a,targetPosition:l,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){const m=Se(),v=(b,E)=>{if(b.button!==0)return;const{autoPanOnConnect:C,domNode:_,isValidConnection:k,connectionMode:I,connectionRadius:F,lib:S,onConnectStart:P,onConnectEnd:L,cancelConnection:N,nodeLookup:A,rfId:R,panBy:O,updateConnection:j}=m.getState(),M=E.type==="target",q=(z,V)=>{f(!1),d==null||d(z,n,E.type,V)},$=z=>u==null?void 0:u(n,z),D=(z,V)=>{f(!0),c==null||c(b,n,E.type),P==null||P(z,V)};hy.onPointerDown(b.nativeEvent,{autoPanOnConnect:C,connectionMode:I,connectionRadius:F,domNode:_,handleId:E.id,nodeId:E.nodeId,nodeLookup:A,isTarget:M,edgeUpdaterType:E.type,lib:S,flowId:R,cancelConnection:N,panBy:O,isValidConnection:k,onConnect:$,onConnectStart:D,onConnectEnd:L,onReconnectEnd:q,updateConnection:j,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:b.currentTarget})},w=b=>v(b,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),g=b=>v(b,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>p(!0),y=()=>p(!1);return h.jsxs(h.Fragment,{children:[(e===!0||e==="source")&&h.jsx(mw,{position:a,centerX:r,centerY:i,radius:t,onMouseDown:w,onMouseEnter:x,onMouseOut:y,type:"source"}),(e===!0||e==="target")&&h.jsx(mw,{position:l,centerX:s,centerY:o,radius:t,onMouseDown:g,onMouseEnter:x,onMouseOut:y,type:"target"})]})}function oV({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:s,onContextMenu:o,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:v,noPanClassName:w,onError:g,disableKeyboardA11y:x}){let y=ue(ee=>ee.edgeLookup.get(e));const b=ue(ee=>ee.defaultEdgeOptions);y=b?{...b,...y}:y;let E=y.type||"default",C=(v==null?void 0:v[E])||fw[E];C===void 0&&(g==null||g("011",cn.error011(E)),E="default",C=(v==null?void 0:v.default)||fw.default);const _=!!(y.focusable||t&&typeof y.focusable>"u"),k=typeof d<"u"&&(y.reconnectable||n&&typeof y.reconnectable>"u"),I=!!(y.selectable||r&&typeof y.selectable>"u"),F=T.useRef(null),[S,P]=T.useState(!1),[L,N]=T.useState(!1),A=Se(),{zIndex:R,sourceX:O,sourceY:j,targetX:M,targetY:q,sourcePosition:$,targetPosition:D}=ue(T.useCallback(ee=>{const Z=ee.nodeLookup.get(y.source),ce=ee.nodeLookup.get(y.target);if(!Z||!ce)return{zIndex:y.zIndex,...hw};const J=q5({id:e,sourceNode:Z,targetNode:ce,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:ee.connectionMode,onError:g});return{zIndex:M5({selected:y.selected,zIndex:y.zIndex,sourceNode:Z,targetNode:ce,elevateOnSelect:ee.elevateEdgesOnSelect,zIndexMode:ee.zIndexMode}),...J||hw}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),_e),z=T.useMemo(()=>y.markerStart?`url('#${dy(y.markerStart,m)}')`:void 0,[y.markerStart,m]),V=T.useMemo(()=>y.markerEnd?`url('#${dy(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||O===null||j===null||M===null||q===null)return null;const U=ee=>{var ae;const{addSelectedEdges:Z,unselectNodesAndEdges:ce,multiSelectionActive:J}=A.getState();I&&(A.setState({nodesSelectionActive:!1}),y.selected&&J?(ce({nodes:[],edges:[y]}),(ae=F.current)==null||ae.blur()):Z([e])),i&&i(ee,y)},W=s?ee=>{s(ee,{...y})}:void 0,Y=o?ee=>{o(ee,{...y})}:void 0,H=a?ee=>{a(ee,{...y})}:void 0,X=l?ee=>{l(ee,{...y})}:void 0,se=u?ee=>{u(ee,{...y})}:void 0,re=ee=>{var Z;if(!x&&WP.includes(ee.key)&&I){const{unselectNodesAndEdges:ce,addSelectedEdges:J}=A.getState();ee.key==="Escape"?((Z=F.current)==null||Z.blur(),ce({edges:[y]})):J([e])}};return h.jsx("svg",{style:{zIndex:R},children:h.jsxs("g",{className:Oe(["react-flow__edge",`react-flow__edge-${E}`,y.className,w,{selected:y.selected,animated:y.animated,inactive:!I&&!i,updating:S,selectable:I}]),onClick:U,onDoubleClick:W,onContextMenu:Y,onMouseEnter:H,onMouseMove:X,onMouseLeave:se,onKeyDown:_?re:void 0,tabIndex:_?0:void 0,role:y.ariaRole??(_?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":_?`${Tj}-${m}`:void 0,ref:F,...y.domAttributes,children:[!L&&h.jsx(C,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:I,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:O,sourceY:j,targetX:M,targetY:q,sourcePosition:$,targetPosition:D,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:z,markerEnd:V,pathOptions:"pathOptions"in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),k&&h.jsx(sV,{edge:y,isReconnectable:k,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:O,sourceY:j,targetX:M,targetY:q,sourcePosition:$,targetPosition:D,setUpdateHover:P,setReconnecting:N})]})})}var aV=T.memo(oV);const lV=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function nT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:s,onEdgeContextMenu:o,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:v}){const{edgesFocusable:w,edgesReconnectable:g,elementsSelectable:x,onError:y}=ue(lV,_e),b=Wq(t);return h.jsxs("div",{className:"react-flow__edges",children:[h.jsx(Qq,{defaultColor:e,rfId:n}),b.map(E=>h.jsx(aV,{id:E,edgesFocusable:w,edgesReconnectable:g,elementsSelectable:x,noPanClassName:i,onReconnect:s,onContextMenu:o,onMouseEnter:a,onMouseMove:l,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:v},E))]})}nT.displayName="EdgeRenderer";const uV=T.memo(nT),cV=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function dV({children:e}){const t=ue(cV);return h.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function fV(e){const t=Kv(),n=T.useRef(!1);T.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const hV=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function pV(e){const t=ue(hV),n=Se();return T.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function mV(e){return e.connection.inProgress?{...e.connection,to:Qo(e.connection.to,e.transform)}:{...e.connection}}function gV(e){return mV}function yV(e){const t=gV();return ue(t,_e)}const vV=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function xV({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:i,width:s,height:o,isValid:a,inProgress:l}=ue(vV,_e);return!(s&&i&&l)?null:h.jsx("svg",{style:e,width:s,height:o,className:"react-flow__connectionline react-flow__container",children:h.jsx("g",{className:Oe(["react-flow__connection",KP(a)]),children:h.jsx(rT,{style:t,type:n,CustomComponent:r,isValid:a})})})}const rT=({style:e,type:t=nr.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:i,from:s,fromNode:o,fromHandle:a,fromPosition:l,to:u,toNode:c,toHandle:d,toPosition:f,pointer:p}=yV();if(!i)return;if(n)return h.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:a,fromX:s.x,fromY:s.y,toX:u.x,toY:u.y,fromPosition:l,toPosition:f,connectionStatus:KP(r),toNode:c,toHandle:d,pointer:p});let m="";const v={sourceX:s.x,sourceY:s.y,sourcePosition:l,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case nr.Bezier:[m]=aj(v);break;case nr.SimpleBezier:[m]=Hj(v);break;case nr.Step:[m]=Ql({...v,borderRadius:0});break;case nr.SmoothStep:[m]=Ql(v);break;default:[m]=uj(v)}return h.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};rT.displayName="ConnectionLine";const wV={};function gw(e=wV){T.useRef(e),Se(),T.useEffect(()=>{},[e])}function bV(){Se(),T.useRef(!1),T.useEffect(()=>{},[])}function iT({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:s,onEdgeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:v,connectionLineComponent:w,connectionLineContainerStyle:g,selectionKeyCode:x,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:E,panActivationKeyCode:C,zoomActivationKeyCode:_,deleteKeyCode:k,onlyRenderVisibleElements:I,elementsSelectable:F,defaultViewport:S,translateExtent:P,minZoom:L,maxZoom:N,preventScrolling:A,defaultMarkerColor:R,zoomOnScroll:O,zoomOnPinch:j,panOnScroll:M,panOnScrollSpeed:q,panOnScrollMode:$,zoomOnDoubleClick:D,panOnDrag:z,onPaneClick:V,onPaneMouseEnter:U,onPaneMouseMove:W,onPaneMouseLeave:Y,onPaneScroll:H,onPaneContextMenu:X,paneClickDistance:se,nodeClickDistance:re,onEdgeContextMenu:ee,onEdgeMouseEnter:Z,onEdgeMouseMove:ce,onEdgeMouseLeave:J,reconnectRadius:ae,onReconnect:ne,onReconnectStart:tt,onReconnectEnd:Ye,noDragClassName:hn,noWheelClassName:Qt,noPanClassName:ot,disableKeyboardA11y:Re,nodeExtent:Bn,rfId:pn,viewport:Hn,onViewportChange:Un}){return gw(e),gw(t),bV(),fV(n),pV(Hn),h.jsx(Oq,{onPaneClick:V,onPaneMouseEnter:U,onPaneMouseMove:W,onPaneMouseLeave:Y,onPaneContextMenu:X,onPaneScroll:H,paneClickDistance:se,deleteKeyCode:k,selectionKeyCode:x,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:E,panActivationKeyCode:C,zoomActivationKeyCode:_,elementsSelectable:F,zoomOnScroll:O,zoomOnPinch:j,zoomOnDoubleClick:D,panOnScroll:M,panOnScrollSpeed:q,panOnScrollMode:$,panOnDrag:z,defaultViewport:S,translateExtent:P,minZoom:L,maxZoom:N,onSelectionContextMenu:d,preventScrolling:A,noDragClassName:hn,noWheelClassName:Qt,noPanClassName:ot,disableKeyboardA11y:Re,onViewportChange:Un,isControlledViewport:!!Hn,children:h.jsxs(dV,{children:[h.jsx(uV,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:ne,onReconnectStart:tt,onReconnectEnd:Ye,onlyRenderVisibleElements:I,onEdgeContextMenu:ee,onEdgeMouseEnter:Z,onEdgeMouseMove:ce,onEdgeMouseLeave:J,reconnectRadius:ae,defaultMarkerColor:R,noPanClassName:ot,disableKeyboardA11y:Re,rfId:pn}),h.jsx(xV,{style:v,type:m,component:w,containerStyle:g}),h.jsx("div",{className:"react-flow__edgelabel-renderer"}),h.jsx(Uq,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:re,onlyRenderVisibleElements:I,noPanClassName:ot,noDragClassName:hn,disableKeyboardA11y:Re,nodeExtent:Bn,rfId:pn}),h.jsx("div",{className:"react-flow__viewport-portal"})]})})}iT.displayName="GraphView";const _V=T.memo(iT),yw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,fitViewOptions:a,minZoom:l=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:f="basic"}={})=>{const p=new Map,m=new Map,v=new Map,w=new Map,g=r??t??[],x=n??e??[],y=c??[0,0],b=d??Po;fj(v,w,g);const E=fy(x,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f});let C=[0,0,1];if(o&&i&&s){const _=Ko(p,{filter:S=>!!((S.width||S.initialWidth)&&(S.height||S.initialHeight))}),{x:k,y:I,zoom:F}=zv(_,i,s,l,u,(a==null?void 0:a.padding)??.1);C=[k,I,F]}return{rfId:"1",width:i??0,height:s??0,transform:C,nodes:x,nodesInitialized:E,nodeLookup:p,parentLookup:m,edges:g,edgeLookup:w,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:l,maxZoom:u,translateExtent:Po,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Zr.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:a,fitViewResolver:null,connection:{...YP},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:E5,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:GP,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},SV=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:o,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>$F((p,m)=>{async function v(){const{nodeLookup:w,panZoom:g,fitViewOptions:x,fitViewResolver:y,width:b,height:E,minZoom:C,maxZoom:_}=m();g&&(await S5({nodes:w,width:b,height:E,panZoom:g,minZoom:C,maxZoom:_},x),y==null||y.resolve(!0),p({fitViewResolver:null}))}return{...yw({nodes:e,edges:t,width:i,height:s,fitView:o,fitViewOptions:a,minZoom:l,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:w=>{const{nodeLookup:g,parentLookup:x,nodeOrigin:y,elevateNodesOnSelect:b,fitViewQueued:E,zIndexMode:C}=m(),_=fy(w,g,x,{nodeOrigin:y,nodeExtent:d,elevateNodesOnSelect:b,checkEquality:!0,zIndexMode:C});E&&_?(v(),p({nodes:w,nodesInitialized:_,fitViewQueued:!1,fitViewOptions:void 0})):p({nodes:w,nodesInitialized:_})},setEdges:w=>{const{connectionLookup:g,edgeLookup:x}=m();fj(g,x,w),p({edges:w})},setDefaultNodesAndEdges:(w,g)=>{if(w){const{setNodes:x}=m();x(w),p({hasDefaultNodes:!0})}if(g){const{setEdges:x}=m();x(g),p({hasDefaultEdges:!0})}},updateNodeInternals:w=>{const{triggerNodeChanges:g,nodeLookup:x,parentLookup:y,domNode:b,nodeOrigin:E,nodeExtent:C,debug:_,fitViewQueued:k,zIndexMode:I}=m(),{changes:F,updatedInternals:S}=G5(w,x,y,b,E,C,I);S&&(B5(x,y,{nodeOrigin:E,nodeExtent:C,zIndexMode:I}),k?(v(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),(F==null?void 0:F.length)>0&&(_&&console.log("React Flow: trigger node changes",F),g==null||g(F)))},updateNodePositions:(w,g=!1)=>{const x=[];let y=[];const{nodeLookup:b,triggerNodeChanges:E,connection:C,updateConnection:_,onNodesChangeMiddlewareMap:k}=m();for(const[I,F]of w){const S=b.get(I),P=!!(S!=null&&S.expandParent&&(S!=null&&S.parentId)&&(F!=null&&F.position)),L={id:I,type:"position",position:P?{x:Math.max(0,F.position.x),y:Math.max(0,F.position.y)}:F.position,dragging:g};if(S&&C.inProgress&&C.fromNode.id===S.id){const N=ei(S,C.fromHandle,K.Left,!0);_({...C,from:N})}P&&S.parentId&&x.push({id:I,parentId:S.parentId,rect:{...F.internals.positionAbsolute,width:F.measured.width??0,height:F.measured.height??0}}),y.push(L)}if(x.length>0){const{parentLookup:I,nodeOrigin:F}=m(),S=Yv(x,b,I,F);y.push(...S)}for(const I of k.values())y=I(y);E(y)},triggerNodeChanges:w=>{const{onNodesChange:g,setNodes:x,nodes:y,hasDefaultNodes:b,debug:E}=m();if(w!=null&&w.length){if(b){const C=Ij(w,y);x(C)}E&&console.log("React Flow: trigger node changes",w),g==null||g(w)}},triggerEdgeChanges:w=>{const{onEdgesChange:g,setEdges:x,edges:y,hasDefaultEdges:b,debug:E}=m();if(w!=null&&w.length){if(b){const C=Rj(w,y);x(C)}E&&console.log("React Flow: trigger edge changes",w),g==null||g(w)}},addSelectedNodes:w=>{const{multiSelectionActive:g,edgeLookup:x,nodeLookup:y,triggerNodeChanges:b,triggerEdgeChanges:E}=m();if(g){const C=w.map(_=>Tr(_,!0));b(C);return}b(ki(y,new Set([...w]),!0)),E(ki(x))},addSelectedEdges:w=>{const{multiSelectionActive:g,edgeLookup:x,nodeLookup:y,triggerNodeChanges:b,triggerEdgeChanges:E}=m();if(g){const C=w.map(_=>Tr(_,!0));E(C);return}E(ki(x,new Set([...w]))),b(ki(y,new Set,!0))},unselectNodesAndEdges:({nodes:w,edges:g}={})=>{const{edges:x,nodes:y,nodeLookup:b,triggerNodeChanges:E,triggerEdgeChanges:C}=m(),_=w||y,k=g||x,I=_.map(S=>{const P=b.get(S.id);return P&&(P.selected=!1),Tr(S.id,!1)}),F=k.map(S=>Tr(S.id,!1));E(I),C(F)},setMinZoom:w=>{const{panZoom:g,maxZoom:x}=m();g==null||g.setScaleExtent([w,x]),p({minZoom:w})},setMaxZoom:w=>{const{panZoom:g,minZoom:x}=m();g==null||g.setScaleExtent([x,w]),p({maxZoom:w})},setTranslateExtent:w=>{var g;(g=m().panZoom)==null||g.setTranslateExtent(w),p({translateExtent:w})},resetSelectedElements:()=>{const{edges:w,nodes:g,triggerNodeChanges:x,triggerEdgeChanges:y,elementsSelectable:b}=m();if(!b)return;const E=g.reduce((_,k)=>k.selected?[..._,Tr(k.id,!1)]:_,[]),C=w.reduce((_,k)=>k.selected?[..._,Tr(k.id,!1)]:_,[]);x(E),y(C)},setNodeExtent:w=>{const{nodes:g,nodeLookup:x,parentLookup:y,nodeOrigin:b,elevateNodesOnSelect:E,nodeExtent:C,zIndexMode:_}=m();w[0][0]===C[0][0]&&w[0][1]===C[0][1]&&w[1][0]===C[1][0]&&w[1][1]===C[1][1]||(fy(g,x,y,{nodeOrigin:b,nodeExtent:w,elevateNodesOnSelect:E,checkEquality:!1,zIndexMode:_}),p({nodeExtent:w}))},panBy:w=>{const{transform:g,width:x,height:y,panZoom:b,translateExtent:E}=m();return Y5({delta:w,panZoom:b,transform:g,translateExtent:E,width:x,height:y})},setCenter:async(w,g,x)=>{const{width:y,height:b,maxZoom:E,panZoom:C}=m();if(!C)return Promise.resolve(!1);const _=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:E;return await C.setViewport({x:y/2-w*_,y:b/2-g*_,zoom:_},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...YP}})},updateConnection:w=>{p({connection:w})},reset:()=>p({...yw()})}},Object.is);function sT({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:s,initialMinZoom:o,initialMaxZoom:a,initialFitViewOptions:l,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:p}){const[m]=T.useState(()=>SV({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:s,fitView:u,minZoom:o,maxZoom:a,fitViewOptions:l,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return h.jsx(zF,{value:m,children:h.jsx(dq,{children:p})})}function NV({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:s,height:o,fitView:a,fitViewOptions:l,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return T.useContext(qu)?h.jsx(h.Fragment,{children:e}):h.jsx(sT,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:s,initialHeight:o,fitView:a,initialFitViewOptions:l,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}const EV={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function CV({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:s,edgeTypes:o,onNodeClick:a,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:g,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:E,onNodeDoubleClick:C,onNodeDragStart:_,onNodeDrag:k,onNodeDragStop:I,onNodesDelete:F,onEdgesDelete:S,onDelete:P,onSelectionChange:L,onSelectionDragStart:N,onSelectionDrag:A,onSelectionDragStop:R,onSelectionContextMenu:O,onSelectionStart:j,onSelectionEnd:M,onBeforeDelete:q,connectionMode:$,connectionLineType:D=nr.Bezier,connectionLineStyle:z,connectionLineComponent:V,connectionLineContainerStyle:U,deleteKeyCode:W="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:H=!1,selectionMode:X=jo.Full,panActivationKeyCode:se="Space",multiSelectionKeyCode:re=Mo()?"Meta":"Control",zoomActivationKeyCode:ee=Mo()?"Meta":"Control",snapToGrid:Z,snapGrid:ce,onlyRenderVisibleElements:J=!1,selectNodesOnDrag:ae,nodesDraggable:ne,autoPanOnNodeFocus:tt,nodesConnectable:Ye,nodesFocusable:hn,nodeOrigin:Qt=Mj,edgesFocusable:ot,edgesReconnectable:Re,elementsSelectable:Bn=!0,defaultViewport:pn=tq,minZoom:Hn=.5,maxZoom:Un=2,translateExtent:mn=Po,preventScrolling:fa=!0,nodeExtent:ci,defaultMarkerColor:pc="#b1b1b7",zoomOnScroll:ha=!0,zoomOnPinch:Zt=!0,panOnScroll:gn=!1,panOnScrollSpeed:yI=.5,panOnScrollMode:vI=Br.Free,zoomOnDoubleClick:xI=!0,panOnDrag:wI=!0,onPaneClick:bI,onPaneMouseEnter:_I,onPaneMouseMove:SI,onPaneMouseLeave:NI,onPaneScroll:EI,onPaneContextMenu:CI,paneClickDistance:kI=1,nodeClickDistance:PI=0,children:jI,onReconnect:TI,onReconnectStart:MI,onReconnectEnd:AI,onEdgeContextMenu:II,onEdgeDoubleClick:RI,onEdgeMouseEnter:DI,onEdgeMouseMove:OI,onEdgeMouseLeave:LI,reconnectRadius:FI=10,onNodesChange:qI,onEdgesChange:VI,noDragClassName:$I="nodrag",noWheelClassName:zI="nowheel",noPanClassName:ex="nopan",fitView:tx,fitViewOptions:nx,connectOnClick:BI,attributionPosition:HI,proOptions:UI,defaultEdgeOptions:WI,elevateNodesOnSelect:GI=!0,elevateEdgesOnSelect:YI=!1,disableKeyboardA11y:rx=!1,autoPanOnConnect:KI,autoPanOnNodeDrag:XI,autoPanSpeed:QI,connectionRadius:ZI,isValidConnection:JI,onError:eR,style:tR,id:ix,nodeDragThreshold:nR,connectionDragThreshold:rR,viewport:iR,onViewportChange:sR,width:oR,height:aR,colorMode:lR="light",debug:uR,onScroll:pa,ariaLabelConfig:cR,zIndexMode:sx="basic",...dR},fR){const mc=ix||"1",hR=sq(lR),pR=T.useCallback(ox=>{ox.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),pa==null||pa(ox)},[pa]);return h.jsx("div",{"data-testid":"rf__wrapper",...dR,onScroll:pR,style:{...tR,...EV},ref:fR,className:Oe(["react-flow",i,hR]),id:ix,role:"application",children:h.jsxs(NV,{nodes:e,edges:t,width:oR,height:aR,fitView:tx,fitViewOptions:nx,minZoom:Hn,maxZoom:Un,nodeOrigin:Qt,nodeExtent:ci,zIndexMode:sx,children:[h.jsx(_V,{onInit:u,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:x,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:E,onNodeDoubleClick:C,nodeTypes:s,edgeTypes:o,connectionLineType:D,connectionLineStyle:z,connectionLineComponent:V,connectionLineContainerStyle:U,selectionKeyCode:Y,selectionOnDrag:H,selectionMode:X,deleteKeyCode:W,multiSelectionKeyCode:re,panActivationKeyCode:se,zoomActivationKeyCode:ee,onlyRenderVisibleElements:J,defaultViewport:pn,translateExtent:mn,minZoom:Hn,maxZoom:Un,preventScrolling:fa,zoomOnScroll:ha,zoomOnPinch:Zt,zoomOnDoubleClick:xI,panOnScroll:gn,panOnScrollSpeed:yI,panOnScrollMode:vI,panOnDrag:wI,onPaneClick:bI,onPaneMouseEnter:_I,onPaneMouseMove:SI,onPaneMouseLeave:NI,onPaneScroll:EI,onPaneContextMenu:CI,paneClickDistance:kI,nodeClickDistance:PI,onSelectionContextMenu:O,onSelectionStart:j,onSelectionEnd:M,onReconnect:TI,onReconnectStart:MI,onReconnectEnd:AI,onEdgeContextMenu:II,onEdgeDoubleClick:RI,onEdgeMouseEnter:DI,onEdgeMouseMove:OI,onEdgeMouseLeave:LI,reconnectRadius:FI,defaultMarkerColor:pc,noDragClassName:$I,noWheelClassName:zI,noPanClassName:ex,rfId:mc,disableKeyboardA11y:rx,nodeExtent:ci,viewport:iR,onViewportChange:sR}),h.jsx(iq,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:v,onClickConnectStart:w,onClickConnectEnd:g,nodesDraggable:ne,autoPanOnNodeFocus:tt,nodesConnectable:Ye,nodesFocusable:hn,edgesFocusable:ot,edgesReconnectable:Re,elementsSelectable:Bn,elevateNodesOnSelect:GI,elevateEdgesOnSelect:YI,minZoom:Hn,maxZoom:Un,nodeExtent:ci,onNodesChange:qI,onEdgesChange:VI,snapToGrid:Z,snapGrid:ce,connectionMode:$,translateExtent:mn,connectOnClick:BI,defaultEdgeOptions:WI,fitView:tx,fitViewOptions:nx,onNodesDelete:F,onEdgesDelete:S,onDelete:P,onNodeDragStart:_,onNodeDrag:k,onNodeDragStop:I,onSelectionDrag:A,onSelectionDragStart:N,onSelectionDragStop:R,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:ex,nodeOrigin:Qt,rfId:mc,autoPanOnConnect:KI,autoPanOnNodeDrag:XI,autoPanSpeed:QI,onError:eR,connectionRadius:ZI,isValidConnection:JI,selectNodesOnDrag:ae,nodeDragThreshold:nR,connectionDragThreshold:rR,onBeforeDelete:q,debug:uR,ariaLabelConfig:cR,zIndexMode:sx}),h.jsx(eq,{onSelectionChange:L}),jI,h.jsx(KF,{proOptions:UI,position:HI}),h.jsx(YF,{rfId:mc,disableKeyboardA11y:rx})]})})}var kV=Dj(CV);const PV=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function jV({children:e}){const t=ue(PV);return t?Av.createPortal(e,t):null}function TV(e){const[t,n]=T.useState(e),r=T.useCallback(i=>n(s=>Ij(i,s)),[]);return[t,n,r]}function MV(e){const[t,n]=T.useState(e),r=T.useCallback(i=>n(s=>Rj(i,s)),[]);return[t,n,r]}function AV({dimensions:e,lineWidth:t,variant:n,className:r}){return h.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Oe(["react-flow__background-pattern",n,r])})}function IV({radius:e,className:t}){return h.jsx("circle",{cx:e,cy:e,r:e,className:Oe(["react-flow__background-pattern","dots",t])})}var kn;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(kn||(kn={}));const RV={[kn.Dots]:1,[kn.Lines]:1,[kn.Cross]:6},DV=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function oT({id:e,variant:t=kn.Dots,gap:n=20,size:r,lineWidth:i=1,offset:s=0,color:o,bgColor:a,style:l,className:u,patternClassName:c}){const d=T.useRef(null),{transform:f,patternId:p}=ue(DV,_e),m=r||RV[t],v=t===kn.Dots,w=t===kn.Cross,g=Array.isArray(n)?n:[n,n],x=[g[0]*f[2]||1,g[1]*f[2]||1],y=m*f[2],b=Array.isArray(s)?s:[s,s],E=w?[y,y]:x,C=[b[0]*f[2]||1+E[0]/2,b[1]*f[2]||1+E[1]/2],_=`${p}${e||""}`;return h.jsxs("svg",{className:Oe(["react-flow__background",u]),style:{...l,...$u,"--xy-background-color-props":a,"--xy-background-pattern-color-props":o},ref:d,"data-testid":"rf__background",children:[h.jsx("pattern",{id:_,x:f[0]%x[0],y:f[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${C[0]},-${C[1]})`,children:v?h.jsx(IV,{radius:y/2,className:c}):h.jsx(AV,{dimensions:E,lineWidth:i,variant:t,className:c})}),h.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${_})`})]})}oT.displayName="Background";const OV=T.memo(oT);function LV(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:h.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function FV(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:h.jsx("path",{d:"M0 0h32v4.2H0z"})})}function qV(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:h.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 VV(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 $V(){return h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:h.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 $a({children:e,className:t,...n}){return h.jsx("button",{type:"button",className:Oe(["react-flow__controls-button",t]),...n,children:e})}const zV=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function aT({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:s,onZoomOut:o,onFitView:a,onInteractiveChange:l,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":p}){const m=Se(),{isInteractive:v,minZoomReached:w,maxZoomReached:g,ariaLabelConfig:x}=ue(zV,_e),{zoomIn:y,zoomOut:b,fitView:E}=Kv(),C=()=>{y(),s==null||s()},_=()=>{b(),o==null||o()},k=()=>{E(i),a==null||a()},I=()=>{m.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)},F=f==="horizontal"?"horizontal":"vertical";return h.jsxs(Vu,{className:Oe(["react-flow__controls",F,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":p??x["controls.ariaLabel"],children:[t&&h.jsxs(h.Fragment,{children:[h.jsx($a,{onClick:C,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:g,children:h.jsx(LV,{})}),h.jsx($a,{onClick:_,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:w,children:h.jsx(FV,{})})]}),n&&h.jsx($a,{className:"react-flow__controls-fitview",onClick:k,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:h.jsx(qV,{})}),r&&h.jsx($a,{className:"react-flow__controls-interactive",onClick:I,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:v?h.jsx($V,{}):h.jsx(VV,{})}),c]})}aT.displayName="Controls";const BV=T.memo(aT);function HV({id:e,x:t,y:n,width:r,height:i,style:s,color:o,strokeColor:a,strokeWidth:l,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:p}){const{background:m,backgroundColor:v}=s||{},w=o||m||v;return h.jsx("rect",{className:Oe(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:r,height:i,style:{fill:w,stroke:a,strokeWidth:l},shapeRendering:d,onClick:p?g=>p(g,e):void 0})}const UV=T.memo(HV),WV=e=>e.nodes.map(t=>t.id),Qc=e=>e instanceof Function?e:()=>e;function GV({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:s=UV,onClick:o}){const a=ue(WV,_e),l=Qc(t),u=Qc(e),c=Qc(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return h.jsx(h.Fragment,{children:a.map(f=>h.jsx(KV,{id:f,nodeColorFunc:l,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:s,onClick:o,shapeRendering:d},f))})}function YV({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:s,shapeRendering:o,NodeComponent:a,onClick:l}){const{node:u,x:c,y:d,width:f,height:p}=ue(m=>{const{internals:v}=m.nodeLookup.get(e),w=v.userNode,{x:g,y:x}=v.positionAbsolute,{width:y,height:b}=Vn(w);return{node:w,x:g,y:x,width:y,height:b}},_e);return!u||u.hidden||!tj(u)?null:h.jsx(a,{x:c,y:d,width:f,height:p,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:i,strokeColor:n(u),strokeWidth:s,shapeRendering:o,onClick:l,id:u.id})}const KV=T.memo(YV);var XV=T.memo(GV);const QV=200,ZV=150,JV=e=>!e.hidden,e$=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?ej(Ko(e.nodeLookup,{filter:JV}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},t$="react-flow__minimap-desc";function lT({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i="",nodeBorderRadius:s=5,nodeStrokeWidth:o,nodeComponent:a,bgColor:l,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:p,onNodeClick:m,pannable:v=!1,zoomable:w=!1,ariaLabel:g,inversePan:x,zoomStep:y=1,offsetScale:b=5}){const E=Se(),C=T.useRef(null),{boundingRect:_,viewBB:k,rfId:I,panZoom:F,translateExtent:S,flowWidth:P,flowHeight:L,ariaLabelConfig:N}=ue(e$,_e),A=(e==null?void 0:e.width)??QV,R=(e==null?void 0:e.height)??ZV,O=_.width/A,j=_.height/R,M=Math.max(O,j),q=M*A,$=M*R,D=b*M,z=_.x-(q-_.width)/2-D,V=_.y-($-_.height)/2-D,U=q+D*2,W=$+D*2,Y=`${t$}-${I}`,H=T.useRef(0),X=T.useRef();H.current=M,T.useEffect(()=>{if(C.current&&F)return X.current=rF({domNode:C.current,panZoom:F,getTransform:()=>E.getState().transform,getViewScale:()=>H.current}),()=>{var Z;(Z=X.current)==null||Z.destroy()}},[F]),T.useEffect(()=>{var Z;(Z=X.current)==null||Z.update({translateExtent:S,width:P,height:L,inversePan:x,pannable:v,zoomStep:y,zoomable:w})},[v,w,x,y,S,P,L]);const se=p?Z=>{var ae;const[ce,J]=((ae=X.current)==null?void 0:ae.pointer(Z))||[0,0];p(Z,{x:ce,y:J})}:void 0,re=m?T.useCallback((Z,ce)=>{const J=E.getState().nodeLookup.get(ce).internals.userNode;m(Z,J)},[]):void 0,ee=g??N["minimap.ariaLabel"];return h.jsx(Vu,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Oe(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:h.jsxs("svg",{width:A,height:R,viewBox:`${z} ${V} ${U} ${W}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Y,ref:C,onClick:se,children:[ee&&h.jsx("title",{id:Y,children:ee}),h.jsx(XV,{onClick:re,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:a}),h.jsx("path",{className:"react-flow__minimap-mask",d:`M${z-D},${V-D}h${U+D*2}v${W+D*2}h${-U-D*2}z
62
+ M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}lT.displayName="MiniMap";const n$=T.memo(lT),r$=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,i$={[es.Line]:"right",[es.Handle]:"bottom-right"};function s$({nodeId:e,position:t,variant:n=es.Handle,className:r,style:i=void 0,children:s,color:o,minWidth:a=10,minHeight:l=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:v,onResize:w,onResizeEnd:g}){const x=qj(),y=typeof e=="string"?e:x,b=Se(),E=T.useRef(null),C=n===es.Handle,_=ue(T.useCallback(r$(C&&p),[C,p]),_e),k=T.useRef(null),I=t??i$[n];T.useEffect(()=>{if(!(!E.current||!y))return k.current||(k.current=yF({domNode:E.current,nodeId:y,getStoreItems:()=>{const{nodeLookup:S,transform:P,snapGrid:L,snapToGrid:N,nodeOrigin:A,domNode:R}=b.getState();return{nodeLookup:S,transform:P,snapGrid:L,snapToGrid:N,nodeOrigin:A,paneDomNode:R}},onChange:(S,P)=>{const{triggerNodeChanges:L,nodeLookup:N,parentLookup:A,nodeOrigin:R}=b.getState(),O=[],j={x:S.x,y:S.y},M=N.get(y);if(M&&M.expandParent&&M.parentId){const q=M.origin??R,$=S.width??M.measured.width??0,D=S.height??M.measured.height??0,z={id:M.id,parentId:M.parentId,rect:{width:$,height:D,...nj({x:S.x??M.position.x,y:S.y??M.position.y},{width:$,height:D},M.parentId,N,q)}},V=Yv([z],N,A,R);O.push(...V),j.x=S.x?Math.max(q[0]*$,S.x):void 0,j.y=S.y?Math.max(q[1]*D,S.y):void 0}if(j.x!==void 0&&j.y!==void 0){const q={id:y,type:"position",position:{...j}};O.push(q)}if(S.width!==void 0&&S.height!==void 0){const $={id:y,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:S.width,height:S.height}};O.push($)}for(const q of P){const $={...q,type:"position"};O.push($)}L(O)},onEnd:({width:S,height:P})=>{const L={id:y,type:"dimensions",resizing:!1,dimensions:{width:S,height:P}};b.getState().triggerNodeChanges([L])}})),k.current.update({controlPosition:I,boundaries:{minWidth:a,minHeight:l,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:v,onResize:w,onResizeEnd:g,shouldResize:m}),()=>{var S;(S=k.current)==null||S.destroy()}},[I,a,l,u,c,d,v,w,g,m]);const F=I.split("-");return h.jsx("div",{className:Oe(["react-flow__resize-control","nodrag",...F,n,r]),ref:E,style:{...i,scale:_,...o&&{[C?"backgroundColor":"borderColor"]:o}},children:s})}T.memo(s$);const uT={},{useDebugValue:o$}=pu,{useSyncExternalStoreWithSelector:a$}=Ej;let vw=!1;const l$=e=>e;function u$(e,t=l$,n){(uT?"production":void 0)!=="production"&&n&&!vw&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),vw=!0);const r=a$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return o$(r),r}const xw=e=>{(uT?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Cj(e):e,n=(r,i)=>u$(t,r,i);return Object.assign(n,t),n},cT=e=>e?xw(e):xw,dT=(e,t)=>t?e.findIndex(n=>n.plan.id===t):e.length-1,Fe=(e,t,n)=>{const r=dT(e,t);if(r<0)return e;const i=[...e];return i[r]=n(i[r]),i},Ae=cT((e,t)=>({isConnected:!1,setConnected:n=>e({isConnected:n}),plans:[],addPlan:n=>e(r=>{const i=r.plans.findIndex(s=>s.plan.id===n.id);if(i>=0){const s=[...r.plans];return s[i]={...s[i],plan:n},{plans:s}}return{plans:[...r.plans,{plan:n,nodes:[],edges:[],completedCount:0,totalCount:0,currentNodeId:null}]}}),getPlanById:n=>t().plans.find(r=>r.plan.id===n),get plan(){const n=t(),r=n.plans[n.plans.length-1];return(r==null?void 0:r.plan)||null},get nodes(){const n=t(),r=n.plans[n.plans.length-1];return(r==null?void 0:r.nodes)||[]},get edges(){const n=t(),r=n.plans[n.plans.length-1];return(r==null?void 0:r.edges)||[]},get completedCount(){const n=t(),r=n.plans[n.plans.length-1];return(r==null?void 0:r.completedCount)||0},get totalCount(){const n=t(),r=n.plans[n.plans.length-1];return(r==null?void 0:r.totalCount)||0},get currentNodeId(){const n=t(),r=n.plans[n.plans.length-1];return(r==null?void 0:r.currentNodeId)||null},setPlan:n=>e(r=>{const i=r.plans.findIndex(s=>s.plan.id===n.id);if(i>=0){const s=[...r.plans];return s[i]={...s[i],plan:n},{plans:s}}return{plans:[...r.plans,{plan:n,nodes:[],edges:[],completedCount:0,totalCount:0,currentNodeId:null}]}}),updatePlanStatus:(n,r)=>e(i=>({plans:Fe(i.plans,r,s=>({...s,plan:{...s.plan,status:n}}))})),addNode:(n,r)=>e(i=>({plans:Fe(i.plans,r,s=>s.nodes.find(a=>a.id===n.id)?{...s,nodes:s.nodes.map(a=>{if(a.id!==n.id)return a;const l=n.dynamicFields.map(u=>{const c=a.dynamicFields.find(d=>d.id===u.id);return c!=null&&c.value?{...u,value:c.value}:u});return{...n,dynamicFields:l,attachments:a.attachments||n.attachments||[],metaInstructions:a.metaInstructions||n.metaInstructions,mcpServers:a.mcpServers||n.mcpServers}})}:{...s,nodes:[...s.nodes,{...n,attachments:n.attachments||[]}],totalCount:s.totalCount+1})})),addEdge:(n,r)=>e(i=>({plans:Fe(i.plans,r,s=>s.edges.some(a=>a.id===n.id)?s:{...s,edges:[...s.edges,n]})})),updateNode:(n,r,i)=>e(s=>({plans:Fe(s.plans,i,o=>({...o,nodes:o.nodes.map(a=>a.id===n?{...a,...r}:a)}))})),updateNodeStatus:(n,r,i,s)=>e(o=>({plans:Fe(o.plans,s,a=>{const l=a.nodes.map(u=>u.id===n?{...u,status:r,output:i??u.output}:u);return{...a,nodes:l,completedCount:l.filter(u=>u.status==="completed").length,currentNodeId:r==="active"?n:a.currentNodeId}})})),setSelectedBranch:(n,r,i)=>e(s=>({plans:Fe(s.plans,i,o=>({...o,nodes:o.nodes.map(a=>a.id===n?{...a,selectedBranchId:r}:a)}))})),updateFieldValue:(n,r,i,s)=>e(o=>({plans:Fe(o.plans,s,a=>({...a,nodes:a.nodes.map(l=>l.id===n?{...l,dynamicFields:l.dynamicFields.map(u=>u.id===r?{...u,value:i}:u)}:l)}))})),addAttachment:(n,r,i)=>e(s=>({plans:Fe(s.plans,i,o=>({...o,nodes:o.nodes.map(a=>a.id===n?{...a,attachments:[...a.attachments,r]}:a)}))})),removeAttachment:(n,r,i)=>e(s=>({plans:Fe(s.plans,i,o=>({...o,nodes:o.nodes.map(a=>a.id===n?{...a,attachments:a.attachments.filter(l=>l.id!==r)}:a)}))})),updateMetaInstructions:(n,r,i)=>e(s=>({plans:Fe(s.plans,i,o=>({...o,nodes:o.nodes.map(a=>a.id===n?{...a,metaInstructions:r}:a)}))})),addNodeMcpServer:(n,r,i)=>e(s=>({plans:Fe(s.plans,i,o=>({...o,nodes:o.nodes.map(a=>a.id===n?{...a,mcpServers:[...(a.mcpServers||[]).filter(l=>l.mcpId!==r.mcpId),r]}:a)}))})),removeNodeMcpServer:(n,r,i)=>e(s=>({plans:Fe(s.plans,i,o=>({...o,nodes:o.nodes.map(a=>a.id===n?{...a,mcpServers:(a.mcpServers||[]).filter(l=>l.mcpId!==r)}:a)}))})),addMcpServerToAllNodes:(n,r)=>e(i=>({plans:Fe(i.plans,r,s=>({...s,nodes:s.nodes.map(o=>({...o,mcpServers:[...(o.mcpServers||[]).filter(a=>a.mcpId!==n.mcpId),n]}))}))})),clearNodeMcpServers:(n,r)=>e(i=>({plans:Fe(i.plans,r,s=>({...s,nodes:s.nodes.map(o=>o.id===n?{...o,mcpServers:[]}:o)}))})),selectedNodeId:null,selectedPlanId:null,setSelectedNodeId:(n,r)=>e({selectedNodeId:n,selectedPlanId:r??null}),clearPlan:n=>e(r=>n?{plans:r.plans.filter(i=>i.plan.id!==n)}:{plans:r.plans.slice(0,-1)}),clearAllPlans:()=>e({plans:[],selectedNodeId:null,selectedPlanId:null}),approvePlan:n=>e(r=>({plans:Fe(r.plans,n,i=>({...i,plan:{...i.plan,status:"approved"}}))})),canApprove:n=>{var o;const r=t(),i=dT(r.plans,n);if(i<0)return!1;const s=r.plans[i];for(const a of s.nodes){for(const l of a.dynamicFields)if(l.required&&!l.value)return!1;if(a.type==="decision"&&a.branches&&!a.selectedBranchId)return!1}return((o=s.plan)==null?void 0:o.status)==="ready"},pendingRerun:null,requestRerun:(n,r)=>e({pendingRerun:{nodeId:n,mode:r}}),clearPendingRerun:()=>e({pendingRerun:null}),pauseExecution:n=>e(r=>({plans:Fe(r.plans,n,i=>({...i,plan:{...i.plan,status:"paused"}}))})),resumeExecution:n=>e(r=>({plans:Fe(r.plans,n,i=>({...i,plan:{...i.plan,status:"executing"}}))})),insertNodes:(n,r,i,s)=>e(o=>({plans:Fe(o.plans,s,a=>({...a,nodes:[...a.nodes,...n],edges:[...a.edges.filter(l=>!i.includes(l.id)),...r],totalCount:a.totalCount+n.length}))})),pendingInsert:null,setPendingInsert:n=>e({pendingInsert:n?{afterNodeId:n}:null}),removeNode:(n,r)=>e(i=>({plans:Fe(i.plans,r,s=>{const o=s.edges.filter(c=>c.to===n),a=s.edges.filter(c=>c.from===n),l=[];for(const c of o)for(const d of a)l.push({id:`edge_${c.from}_${d.to}`,from:c.from,to:d.to});const u=new Set([...o.map(c=>c.id),...a.map(c=>c.id)]);return{...s,nodes:s.nodes.filter(c=>c.id!==n),edges:[...s.edges.filter(c=>!u.has(c.id)),...l],totalCount:Math.max(0,s.totalCount-1)}}),selectedNodeId:t().selectedNodeId===n?null:t().selectedNodeId}))})),Es=()=>({plan:null,nodes:[],edges:[],fieldValues:{},selectedBranches:{},nodeConfigs:{}}),ri=cT((e,t)=>({tabs:[],activeTabId:null,projectData:new Map,historyEntries:[],isHistoryPanelOpen:!1,previousPlanData:new Map,currentDiff:null,showDiffView:!1,addTab:n=>e(r=>{if(r.tabs.find(o=>o.projectId===n.projectId))return{tabs:r.tabs.map(o=>({...o,isActive:o.projectId===n.projectId})),activeTabId:n.projectId};const s={projectId:n.projectId,projectName:n.projectName,workspacePath:n.workspacePath,isActive:!0,unreadUpdates:0,plans:[]};return{tabs:[...r.tabs.map(o=>({...o,isActive:!1})),s],activeTabId:n.projectId}}),removeTab:n=>e(r=>{const i=r.tabs.filter(a=>a.projectId!==n),s=new Map(r.projectData);s.delete(n);let o=r.activeTabId;return r.activeTabId===n&&(o=i.length>0?i[i.length-1].projectId:null,o&&i.forEach(a=>{a.isActive=a.projectId===o})),{tabs:i,activeTabId:o,projectData:s}}),setActiveTab:n=>e(r=>({tabs:r.tabs.map(i=>({...i,isActive:i.projectId===n,unreadUpdates:i.projectId===n?0:i.unreadUpdates})),activeTabId:n})),updateTabUnread:(n,r)=>e(i=>({tabs:i.tabs.map(s=>s.projectId===n?{...s,unreadUpdates:r}:s)})),incrementTabUnread:n=>e(r=>({tabs:r.tabs.map(i=>i.projectId===n&&!i.isActive?{...i,unreadUpdates:i.unreadUpdates+1}:i)})),initProjectData:n=>e(r=>{if(r.projectData.has(n))return r;const i=new Map(r.projectData);return i.set(n,Es()),{projectData:i}}),setProjectPlan:(n,r)=>e(i=>{var u;const s=new Map(i.projectData),o=s.get(n)||Es(),a=((u=o.plan)==null?void 0:u.id)===r.id;s.set(n,{...o,plan:r,nodes:a?o.nodes:[],edges:a?o.edges:[],fieldValues:a?o.fieldValues:{},selectedBranches:a?o.selectedBranches:{},nodeConfigs:a?o.nodeConfigs:{}});const l=i.tabs.map(c=>c.projectId===n?{...c,plans:[...c.plans.filter(d=>d.id!==r.id),r]}:c);return{projectData:s,tabs:l}}),addProjectNode:(n,r)=>e(i=>{const s=new Map(i.projectData),o=s.get(n)||Es();return o.nodes.some(l=>l.id===r.id)?s.set(n,{...o,nodes:o.nodes.map(l=>l.id===r.id?{...r,attachments:r.attachments||[]}:l)}):s.set(n,{...o,nodes:[...o.nodes,{...r,attachments:r.attachments||[]}]}),{projectData:s}}),addProjectEdge:(n,r)=>e(i=>{const s=new Map(i.projectData),o=s.get(n)||Es();return o.edges.some(l=>l.id===r.id)?{projectData:s}:(s.set(n,{...o,edges:[...o.edges,r]}),{projectData:s})}),updateProjectPlanStatus:(n,r)=>e(i=>{const s=new Map(i.projectData),o=s.get(n);return o!=null&&o.plan&&s.set(n,{...o,plan:{...o.plan,status:r}}),{projectData:s}}),updateProjectNodeStatus:(n,r,i,s)=>e(o=>{const a=new Map(o.projectData),l=a.get(n);return l&&a.set(n,{...l,nodes:l.nodes.map(u=>u.id===r?{...u,status:i,output:s??u.output}:u)}),{projectData:a}}),setProjectFieldValue:(n,r,i,s)=>e(o=>{const a=new Map(o.projectData),l=a.get(n);return l&&a.set(n,{...l,fieldValues:{...l.fieldValues,[`${r}:${i}`]:s},nodes:l.nodes.map(u=>u.id===r?{...u,dynamicFields:u.dynamicFields.map(c=>c.id===i?{...c,value:s}:c)}:u)}),{projectData:a}}),setProjectSelectedBranch:(n,r,i)=>e(s=>{const o=new Map(s.projectData),a=o.get(n);return a&&o.set(n,{...a,selectedBranches:{...a.selectedBranches,[r]:i},nodes:a.nodes.map(l=>l.id===r?{...l,selectedBranchId:i}:l)}),{projectData:o}}),setProjectNodeConfig:(n,r,i)=>e(s=>{const o=new Map(s.projectData),a=o.get(n);if(a){const l=a.nodeConfigs[r]||{fieldValues:{},attachments:[]};o.set(n,{...a,nodeConfigs:{...a.nodeConfigs,[r]:{...l,...i}}})}return{projectData:o}}),clearProjectData:n=>e(r=>{const i=new Map(r.projectData);return i.set(n,Es()),{projectData:i}}),setHistoryEntries:n=>e(r=>{const i=JSON.stringify(r.historyEntries),s=JSON.stringify(n);return i===s?r:{historyEntries:n}}),loadPlanFromHistory:n=>e(r=>{const i=n.plan.projectId,s=new Map(r.projectData);s.set(i,{plan:n.plan,nodes:n.nodes,edges:n.edges,fieldValues:n.fieldValues,selectedBranches:n.selectedBranches,nodeConfigs:n.nodeConfigs});const o=r.tabs.findIndex(l=>l.projectId===i);let a=r.tabs;if(o>=0)a=r.tabs.map(l=>({...l,isActive:l.projectId===i}));else{const l={projectId:i,projectName:n.plan.workspacePath.split("/").pop()||i,workspacePath:n.plan.workspacePath,isActive:!0,unreadUpdates:0,plans:[n.plan]};a=[...r.tabs.map(u=>({...u,isActive:!1})),l]}return{projectData:s,tabs:a,activeTabId:i}}),toggleHistoryPanel:()=>e(n=>({isHistoryPanelOpen:!n.isHistoryPanelOpen})),setPreviousPlanData:(n,r)=>e(i=>{const s=new Map(i.previousPlanData);return s.set(n,r),{previousPlanData:s}}),setCurrentDiff:n=>e({currentDiff:n}),setShowDiffView:n=>e({showDiffView:n}),getActiveProjectData:()=>{const n=t();return n.activeTabId&&n.projectData.get(n.activeTabId)||null},getProjectData:n=>t().projectData.get(n)||null,hasMultipleTabs:()=>t().tabs.length>1})),za="overture_history_cache",ww=1,bw={save(e){try{const t={version:ww,timestamp:Date.now(),entries:e};localStorage.setItem(za,JSON.stringify(t)),console.log("[Overture] History cached locally:",e.length,"entries")}catch(t){console.error("[Overture] Failed to cache history:",t)}},load(){try{const e=localStorage.getItem(za);if(!e)return null;const t=JSON.parse(e);return t.version!==ww?(console.log("[Overture] Cache version mismatch, clearing cache"),this.clear(),null):(console.log("[Overture] Loaded cached history:",t.entries.length,"entries"),t.entries)}catch(e){return console.error("[Overture] Failed to load cached history:",e),null}},clear(){try{localStorage.removeItem(za),console.log("[Overture] History cache cleared")}catch(e){console.error("[Overture] Failed to clear history cache:",e)}},getLastUpdated(){try{const e=localStorage.getItem(za);return e?JSON.parse(e).timestamp:null}catch{return null}},isStale(e=6e4){const t=this.getLastUpdated();return t?Date.now()-t>e:!0}},_w="ws://localhost:3030",c$=3e3;function Jo(){const e=T.useRef(null),t=T.useRef(null),n=T.useRef(()=>{}),{setConnected:r,setPlan:i,addNode:s,addEdge:o,updatePlanStatus:a,updateNodeStatus:l,clearPlan:u}=Ae(),c=ri;n.current=S=>{var L;console.log("[Overture] Received message:",S.type);const P="projectId"in S?S.projectId:void 0;switch(S.type){case"connected":console.log("[Overture] Server acknowledged connection");break;case"project_registered":{console.log("[Overture] ========== PROJECT REGISTERED =========="),console.log("[Overture] Project registered:",S.projectName),console.log("[Overture] Project ID:",S.projectId),console.log("[Overture] Workspace:",S.workspacePath),c.getState().addTab({projectId:S.projectId,projectName:S.projectName,workspacePath:S.workspacePath,agentType:"unknown"}),console.log("[Overture] activeTabId after addTab:",c.getState().activeTabId);break}case"projects_list":{console.log("[Overture] Projects list received:",S.projects.length);for(const N of S.projects)c.getState().addTab(N);break}case"history_entries":{console.log("[Overture] History entries received:",S.entries.length),c.getState().setHistoryEntries(S.entries),bw.save(S.entries);break}case"plan_loaded":{console.log("[Overture] Plan loaded from history:",S.plan.plan.id),c.getState().loadPlanFromHistory(S.plan),u(),i(S.plan.plan);for(const N of S.plan.nodes)s(N);for(const N of S.plan.edges)o(N);break}case"plan_started":{console.log("[Overture] ========== PLAN STARTED =========="),console.log("[Overture] Plan started:",S.plan),console.log("[Overture] Plan projectId from message:",P),P&&(console.log("[Overture] Initializing project data for:",P),c.getState().initProjectData(P),c.getState().setProjectPlan(P,S.plan),c.getState().incrementTabUnread(P),console.log("[Overture] activeTabId after plan_started:",c.getState().activeTabId)),i({...S.plan,status:"streaming"});break}case"node_added":{console.log("[Overture] Node added:",S.node.id),P&&c.getState().addProjectNode(P,S.node),s(S.node);break}case"edge_added":{console.log("[Overture] Edge added:",S.edge.id),P&&c.getState().addProjectEdge(P,S.edge),o(S.edge);break}case"plan_ready":{console.log("[Overture] Plan ready"),P&&(c.getState().updateProjectPlanStatus(P,"ready"),c.getState().incrementTabUnread(P)),a("ready");break}case"node_status_updated":{P&&c.getState().updateProjectNodeStatus(P,S.nodeId,S.status,S.output),l(S.nodeId,S.status,S.output);break}case"plan_completed":{P&&(c.getState().updateProjectPlanStatus(P,"completed"),c.getState().incrementTabUnread(P)),a("completed");break}case"plan_failed":{console.error("[Overture] Plan failed:",S.error),P&&(c.getState().updateProjectPlanStatus(P,"failed"),c.getState().incrementTabUnread(P)),a("failed");break}case"plan_paused":{console.log("[Overture] Plan paused"),P&&c.getState().updateProjectPlanStatus(P,"paused"),Ae.getState().pauseExecution();break}case"plan_resumed":{console.log("[Overture] Plan resumed"),P&&c.getState().updateProjectPlanStatus(P,"executing"),Ae.getState().resumeExecution();break}case"nodes_inserted":{console.log("[Overture] Nodes inserted:",S.nodes.length),Ae.getState().insertNodes(S.nodes,S.edges,S.removedEdgeIds);break}case"node_removed":{console.log("[Overture] Node removed:",S.nodeId);break}case"error":{console.error("[Overture] Server error:",S.message);break}case"resume_plan_info":{console.log("[Overture] Resume plan info received:",S.resumeInfo);break}case"plan_saved":{console.log("[Overture] Plan saved:",S.planId);break}case"plan_updated":{console.log("[Overture] Plan updated:",S.plan.plan.id),console.log("[Overture] Diff:",{addedNodes:S.diff.addedNodes.length,removedNodes:S.diff.removedNodes.length,modifiedNodes:S.diff.modifiedNodes.length}),c.getState().setCurrentDiff(S.diff),c.getState().setPreviousPlanData(S.projectId,{plan:S.previousPlan.plan,nodes:S.previousPlan.nodes,edges:S.previousPlan.edges,fieldValues:S.previousPlan.fieldValues,selectedBranches:S.previousPlan.selectedBranches,nodeConfigs:S.previousPlan.nodeConfigs}),c.getState().loadPlanFromHistory(S.plan),u(),i(S.plan.plan);for(const N of S.plan.nodes)s(N);for(const N of S.plan.edges)o(N);c.getState().setShowDiffView(!0);break}case"new_plan_created":{console.log("[Overture] New plan created for project:",S.projectId),c.getState().setCurrentDiff(null),c.getState().setShowDiffView(!1);break}case"plan_updated_incrementally":{console.log("[Overture] Plan updated incrementally:",{operationCount:S.operationCount,successCount:S.successCount,failCount:S.failCount}),((L=e.current)==null?void 0:L.readyState)===WebSocket.OPEN&&e.current.send(JSON.stringify({type:"get_history"}));break}case"node_replaced":{console.log("[Overture] Node replaced:",S.oldNodeId,"->",S.node.id);const N=S.oldNodeId!==S.node.id;P&&c.getState().addProjectNode(P,S.node),N?(Ae.getState().removeNode(S.oldNodeId),Ae.getState().addNode(S.node)):Ae.getState().updateNode(S.oldNodeId,S.node);break}default:console.warn("[Overture] Unknown message type:",S)}};const d=T.useCallback(()=>{var S;if(((S=e.current)==null?void 0:S.readyState)!==WebSocket.OPEN)try{console.log("[Overture] Connecting to WebSocket at",_w);const P=new WebSocket(_w);P.onopen=()=>{console.log("[Overture] Connected to server"),r(!0),P.send(JSON.stringify({type:"get_history"})),t.current&&(clearTimeout(t.current),t.current=null)},P.onclose=()=>{console.log("[Overture] Disconnected from server"),r(!1),t.current=window.setTimeout(()=>{console.log("[Overture] Attempting to reconnect..."),d()},3e3)},P.onerror=L=>{console.error("[Overture] WebSocket error:",L)},P.onmessage=L=>{try{const N=JSON.parse(L.data);n.current(N)}catch(N){console.error("[Overture] Failed to parse message:",N)}},e.current=P}catch(P){console.error("[Overture] Failed to connect:",P),r(!1)}},[r,u,i,s,o,a,l]),f=T.useCallback(S=>{var P;((P=e.current)==null?void 0:P.readyState)===WebSocket.OPEN?e.current.send(JSON.stringify(S)):console.warn("[Overture] Cannot send message - not connected")},[]),p=T.useCallback((S,P,L)=>{f({type:"rerun_request",nodeId:S,mode:P,projectId:L})},[f]),m=T.useCallback(S=>{f({type:"pause_execution",projectId:S})},[f]),v=T.useCallback(S=>{f({type:"resume_execution",projectId:S})},[f]),w=T.useCallback((S,P,L,N)=>{f({type:"insert_nodes",afterNodeId:S,nodes:P,edges:L,projectId:N})},[f]),g=T.useCallback((S,P)=>{Ae.getState().removeNode(S),f({type:"remove_node",nodeId:S,projectId:P})},[f]),x=T.useCallback(S=>{var D,z;const P=Ae.getState(),L=c.getState();console.log("[Overture] approvePlan called, projectId:",S),console.warn("multiProjectStore - activeTabId:",L.activeTabId),console.warn("multiProjectStore - tabs:",L.tabs.length);const N=S?L.projectData.get(S):null;console.warn("multiProjectStore - projectData for",S,":",N?`${N.nodes.length} nodes`:"null"),N&&N.nodes.length>0&&(console.warn("multiProjectStore - First node fields:"),N.nodes[0].dynamicFields.forEach((V,U)=>{console.warn(` Field ${U}: ${V.name} = "${V.value||"(empty)"}"`)}));const A=P.nodes,R=(N==null?void 0:N.nodes)||[],O=A.length>0?A:R;console.warn("Using nodes from:",A.length>0?"usePlanStore":"multiProjectStore","- count:",O.length);const j={};for(const V of O)for(const U of V.dynamicFields)U.value&&(j[`${V.id}.${U.name}`]=U.value);const M={};for(const V of O)V.type==="decision"&&V.selectedBranchId&&(M[V.id]=V.selectedBranchId);const q=new Map;for(const V of P.plans)for(const U of V.nodes)q.set(U.id,U);const $={};for(const V of O){const U={};for(const se of V.dynamicFields)U[se.name]=se.value||"";const W=q.get(V.id),Y=(((D=W==null?void 0:W.attachments)==null?void 0:D.length)??0)>0?W.attachments:V.attachments||[],H=(W==null?void 0:W.metaInstructions)||V.metaInstructions,X=(((z=W==null?void 0:W.mcpServers)==null?void 0:z.length)??0)>0?W.mcpServers:V.mcpServers;$[V.id]={fieldValues:U,attachments:Y,metaInstructions:H,mcpServers:X}}console.log("[Overture] nodeConfigs:",$),f({type:"approve_plan",fieldValues:j,selectedBranches:M,nodeConfigs:$,projectId:S}),Ae.getState().approvePlan()},[f]),y=T.useCallback(S=>{f({type:"subscribe_project",projectId:S})},[f]),b=T.useCallback(S=>{f({type:"get_history",projectId:S})},[f]),E=T.useCallback(S=>{f({type:"load_plan",planId:S})},[f]),C=T.useCallback((S,P)=>{f({type:"get_resume_info",projectId:S,planId:P})},[f]),_=T.useCallback(S=>{f({type:"save_plan",projectId:S})},[f]),k=T.useCallback(S=>{f({type:"request_plan_update",projectId:S})},[f]),I=T.useCallback(S=>{f({type:"create_new_plan",projectId:S})},[f]),F=T.useCallback(()=>{c.getState().setCurrentDiff(null),c.getState().setShowDiffView(!1)},[]);return T.useEffect(()=>{const S=bw.load();S&&(console.log("[Overture] Loading cached history on mount:",S.length,"entries"),c.getState().setHistoryEntries(S))},[]),T.useEffect(()=>(d(),()=>{var S;t.current&&clearTimeout(t.current),(S=e.current)==null||S.close()}),[d]),T.useEffect(()=>{const S=setInterval(()=>{var P;((P=e.current)==null?void 0:P.readyState)===WebSocket.OPEN&&e.current.send(JSON.stringify({type:"get_history"}))},c$);return()=>clearInterval(S)},[]),T.useEffect(()=>{const S=setInterval(()=>{const P=Ae.getState(),L=c.getState(),N=P.plans[0];if(N!=null&&N.plan&&["streaming","ready","approved","executing","paused"].includes(N.plan.status)){const A=L.activeTabId;A?(console.log("[Overture] Auto-saving plan for project:",A),_(A)):_()}},3e4);return()=>clearInterval(S)},[_]),{sendMessage:f,approvePlan:x,requestRerun:p,pauseExecution:m,resumeExecution:v,insertNodes:w,removeNode:g,subscribeProject:y,getHistory:b,loadPlan:E,getResumeInfo:C,savePlan:_,requestPlanUpdate:k,createNewPlan:I,closeDiffView:F}}const Qv=T.createContext({});function Zv(e){const t=T.useRef(null);return t.current===null&&(t.current=e()),t.current}const zu=T.createContext(null),Jv=T.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class d$ extends T.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function f$({children:e,isPresent:t}){const n=T.useId(),r=T.useRef(null),i=T.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=T.useContext(Jv);return T.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return s&&(c.nonce=s),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`
63
+ [data-motion-pop-id="${n}"] {
64
+ position: absolute !important;
65
+ width: ${o}px !important;
66
+ height: ${a}px !important;
67
+ top: ${l}px !important;
68
+ left: ${u}px !important;
69
+ }
70
+ `),()=>{document.head.removeChild(c)}},[t]),h.jsx(d$,{isPresent:t,childRef:r,sizeRef:i,children:T.cloneElement(e,{ref:r})})}const h$=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=Zv(p$),l=T.useId(),u=T.useCallback(d=>{a.set(d,!0);for(const f of a.values())if(!f)return;r&&r()},[a,r]),c=T.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:u,register:d=>(a.set(d,!1),()=>a.delete(d))}),s?[Math.random(),u]:[n,u]);return T.useMemo(()=>{a.forEach((d,f)=>a.set(f,!1))},[n]),T.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=h.jsx(f$,{isPresent:n,children:e})),h.jsx(zu.Provider,{value:c,children:e})};function p$(){return new Map}function fT(e=!0){const t=T.useContext(zu);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=T.useId();T.useEffect(()=>{e&&i(s)},[e]);const o=T.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const Ba=e=>e.key||"";function Sw(e){const t=[];return T.Children.forEach(e,n=>{T.isValidElement(n)&&t.push(n)}),t}const e0=typeof window<"u",hT=e0?T.useLayoutEffect:T.useEffect,Dn=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1})=>{const[a,l]=fT(o),u=T.useMemo(()=>Sw(e),[e]),c=o&&!a?[]:u.map(Ba),d=T.useRef(!0),f=T.useRef(u),p=Zv(()=>new Map),[m,v]=T.useState(u),[w,g]=T.useState(u);hT(()=>{d.current=!1,f.current=u;for(let b=0;b<w.length;b++){const E=Ba(w[b]);c.includes(E)?p.delete(E):p.get(E)!==!0&&p.set(E,!1)}},[w,c.length,c.join("-")]);const x=[];if(u!==m){let b=[...u];for(let E=0;E<w.length;E++){const C=w[E],_=Ba(C);c.includes(_)||(b.splice(E,0,C),x.push(C))}s==="wait"&&x.length&&(b=x),g(Sw(b)),v(u);return}const{forceRender:y}=T.useContext(Qv);return h.jsx(h.Fragment,{children:w.map(b=>{const E=Ba(b),C=o&&!a?!1:u===w||c.includes(E),_=()=>{if(p.has(E))p.set(E,!0);else return;let k=!0;p.forEach(I=>{I||(k=!1)}),k&&(y==null||y(),g(f.current),o&&(l==null||l()),r&&r())};return h.jsx(h$,{isPresent:C,initial:!d.current||n?void 0:!1,custom:C?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:C?void 0:_,children:b},E)})})},xt=e=>e;let pT=xt;function t0(e){let t;return()=>(t===void 0&&(t=e()),t)}const ns=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Pn=e=>e*1e3,jn=e=>e/1e3,m$={useManualTiming:!1};function g$(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){s.has(u)&&(l.schedule(u),e()),u(o)}const l={schedule:(u,c=!1,d=!1)=>{const p=d&&r?t:n;return c&&s.add(u),p.has(u)||p.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const Ha=["read","resolveKeyframes","update","preRender","render","postRender"],y$=40;function mT(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=Ha.reduce((g,x)=>(g[x]=g$(s),g),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:f}=o,p=()=>{const g=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(g-i.timestamp,y$),1),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),f.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(p))},m=()=>{n=!0,r=!0,i.isProcessing||e(p)};return{schedule:Ha.reduce((g,x)=>{const y=o[x];return g[x]=(b,E=!1,C=!1)=>(n||m(),y.schedule(b,E,C)),g},{}),cancel:g=>{for(let x=0;x<Ha.length;x++)o[Ha[x]].cancel(g)},state:i,steps:o}}const{schedule:we,cancel:vr,state:Ue,steps:Zc}=mT(typeof requestAnimationFrame<"u"?requestAnimationFrame:xt,!0),gT=T.createContext({strict:!1}),Nw={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},rs={};for(const e in Nw)rs[e]={isEnabled:t=>Nw[e].some(n=>!!t[n])};function v$(e){for(const t in e)rs[t]={...rs[t],...e[t]}}const x$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Jl(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||x$.has(e)}let yT=e=>!Jl(e);function w$(e){e&&(yT=t=>t.startsWith("on")?!Jl(t):e(t))}try{w$(require("@emotion/is-prop-valid").default)}catch{}function b$(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(yT(i)||n===!0&&Jl(i)||!t&&!Jl(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function _$(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const Bu=T.createContext({});function Io(e){return typeof e=="string"||Array.isArray(e)}function Hu(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const n0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],r0=["initial",...n0];function Uu(e){return Hu(e.animate)||r0.some(t=>Io(e[t]))}function vT(e){return!!(Uu(e)||e.variants)}function S$(e,t){if(Uu(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Io(n)?n:void 0,animate:Io(r)?r:void 0}}return e.inherit!==!1?t:{}}function N$(e){const{initial:t,animate:n}=S$(e,T.useContext(Bu));return T.useMemo(()=>({initial:t,animate:n}),[Ew(t),Ew(n)])}function Ew(e){return Array.isArray(e)?e.join(" "):e}const E$=Symbol.for("motionComponentSymbol");function Pi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function C$(e,t,n){return T.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Pi(n)&&(n.current=r))},[t])}const i0=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),k$="framerAppearId",xT="data-"+i0(k$),{schedule:s0}=mT(queueMicrotask,!1),wT=T.createContext({});function P$(e,t,n,r,i){var s,o;const{visualElement:a}=T.useContext(Bu),l=T.useContext(gT),u=T.useContext(zu),c=T.useContext(Jv).reducedMotion,d=T.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=d.current,p=T.useContext(wT);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&j$(d.current,n,i,p);const m=T.useRef(!1);T.useInsertionEffect(()=>{f&&m.current&&f.update(n,u)});const v=n[xT],w=T.useRef(!!v&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,v))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,v)));return hT(()=>{f&&(m.current=!0,window.MotionIsMounted=!0,f.updateFeatures(),s0.render(f.render),w.current&&f.animationState&&f.animationState.animateChanges())}),T.useEffect(()=>{f&&(!w.current&&f.animationState&&f.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var g;(g=window.MotionHandoffMarkAsComplete)===null||g===void 0||g.call(window,v)}),w.current=!1))}),f}function j$(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:bT(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Pi(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function bT(e){if(e)return e.options.allowProjection!==!1?e.projection:bT(e.parent)}function T$({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&v$(e);function a(u,c){let d;const f={...T.useContext(Jv),...u,layoutId:M$(u)},{isStatic:p}=f,m=N$(u),v=r(u,p);if(!p&&e0){A$();const w=I$(f);d=w.MeasureLayout,m.visualElement=P$(i,v,f,t,w.ProjectionNode)}return h.jsxs(Bu.Provider,{value:m,children:[d&&m.visualElement?h.jsx(d,{visualElement:m.visualElement,...f}):null,n(i,u,C$(v,m.visualElement,c),v,p,m.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=T.forwardRef(a);return l[E$]=i,l}function M$({layoutId:e}){const t=T.useContext(Qv).id;return t&&e!==void 0?t+"-"+e:e}function A$(e,t){T.useContext(gT).strict}function I$(e){const{drag:t,layout:n}=rs;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const R$=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function o0(e){return typeof e!="string"||e.includes("-")?!1:!!(R$.indexOf(e)>-1||/[A-Z]/u.test(e))}function Cw(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function a0(e,t,n,r){if(typeof t=="function"){const[i,s]=Cw(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=Cw(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const my=e=>Array.isArray(e),D$=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),O$=e=>my(e)?e[e.length-1]||0:e,Je=e=>!!(e&&e.getVelocity);function hl(e){const t=Je(e)?e.get():e;return D$(t)?t.toValue():t}function L$({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:F$(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const _T=e=>(t,n)=>{const r=T.useContext(Bu),i=T.useContext(zu),s=()=>L$(e,t,r,i);return n?s():Zv(s)};function F$(e,t,n,r){const i={},s=r(e,{});for(const f in s)i[f]=hl(s[f]);let{initial:o,animate:a}=e;const l=Uu(e),u=vT(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;if(d&&typeof d!="boolean"&&!Hu(d)){const f=Array.isArray(d)?d:[d];for(let p=0;p<f.length;p++){const m=a0(e,f[p]);if(m){const{transitionEnd:v,transition:w,...g}=m;for(const x in g){let y=g[x];if(Array.isArray(y)){const b=c?y.length-1:0;y=y[b]}y!==null&&(i[x]=y)}for(const x in v)i[x]=v[x]}}}return i}const ls=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ii=new Set(ls),ST=e=>t=>typeof t=="string"&&t.startsWith(e),NT=ST("--"),q$=ST("var(--"),l0=e=>q$(e)?V$.test(e.split("/*")[0].trim()):!1,V$=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ET=(e,t)=>t&&typeof e=="number"?t.transform(e):e,On=(e,t,n)=>n>t?t:n<e?e:n,us={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ro={...us,transform:e=>On(0,1,e)},Ua={...us,default:1},ea=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Qn=ea("deg"),ln=ea("%"),te=ea("px"),$$=ea("vh"),z$=ea("vw"),kw={...ln,parse:e=>ln.parse(e)/100,transform:e=>ln.transform(e*100)},B$={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,backgroundPositionX:te,backgroundPositionY:te},H$={rotate:Qn,rotateX:Qn,rotateY:Qn,rotateZ:Qn,scale:Ua,scaleX:Ua,scaleY:Ua,scaleZ:Ua,skew:Qn,skewX:Qn,skewY:Qn,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:Ro,originX:kw,originY:kw,originZ:te},Pw={...us,transform:Math.round},u0={...B$,...H$,zIndex:Pw,size:te,fillOpacity:Ro,strokeOpacity:Ro,numOctaves:Pw},U$={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},W$=ls.length;function G$(e,t,n){let r="",i=!0;for(let s=0;s<W$;s++){const o=ls[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=ET(a,u0[o]);if(!l){i=!1;const c=U$[o]||o;r+=`${c}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function c0(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(ii.has(l)){o=!0;continue}else if(NT(l)){i[l]=u;continue}else{const c=ET(u,u0[l]);l.startsWith("origin")?(a=!0,s[l]=c):r[l]=c}}if(t.transform||(o||n?r.transform=G$(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=s;r.transformOrigin=`${l} ${u} ${c}`}}const Y$={offset:"stroke-dashoffset",array:"stroke-dasharray"},K$={offset:"strokeDashoffset",array:"strokeDasharray"};function X$(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Y$:K$;e[s.offset]=te.transform(-r);const o=te.transform(t),a=te.transform(n);e[s.array]=`${o} ${a}`}function jw(e,t,n){return typeof e=="string"?e:te.transform(t+n*e)}function Q$(e,t,n){const r=jw(t,e.x,e.width),i=jw(n,e.y,e.height);return`${r} ${i}`}function d0(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,d){if(c0(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:m}=e;f.transform&&(m&&(p.transform=f.transform),delete f.transform),m&&(i!==void 0||s!==void 0||p.transform)&&(p.transformOrigin=Q$(m,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&X$(f,o,a,l,!1)}const f0=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),CT=()=>({...f0(),attrs:{}}),h0=e=>typeof e=="string"&&e.toLowerCase()==="svg";function kT(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const PT=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function jT(e,t,n,r){kT(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(PT.has(i)?i:i0(i),t.attrs[i])}const eu={};function Z$(e){Object.assign(eu,e)}function TT(e,{layout:t,layoutId:n}){return ii.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!eu[e]||e==="opacity")}function p0(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(Je(i[o])||t.style&&Je(t.style[o])||TT(o,e)||((r=n==null?void 0:n.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function MT(e,t,n){const r=p0(e,t,n);for(const i in e)if(Je(e[i])||Je(t[i])){const s=ls.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function J$(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const Tw=["x","y","width","height","cx","cy","r"],e8={useVisualState:_T({scrapeMotionValuesFromProps:MT,createRenderState:CT,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(ii.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<Tw.length;a++){const l=Tw[a];e[l]!==t[l]&&(o=!0)}o&&we.read(()=>{J$(n,r),we.render(()=>{d0(r,i,h0(n.tagName),e.transformTemplate),jT(n,r)})})}})},t8={useVisualState:_T({scrapeMotionValuesFromProps:p0,createRenderState:f0})};function AT(e,t,n){for(const r in t)!Je(t[r])&&!TT(r,n)&&(e[r]=t[r])}function n8({transformTemplate:e},t){return T.useMemo(()=>{const n=f0();return c0(n,t,e),Object.assign({},n.vars,n.style)},[t])}function r8(e,t){const n=e.style||{},r={};return AT(r,n,e),Object.assign(r,n8(e,t)),r}function i8(e,t){const n={},r=r8(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function s8(e,t,n,r){const i=T.useMemo(()=>{const s=CT();return d0(s,t,h0(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};AT(s,e.style,e),i.style={...s,...i.style}}return i}function o8(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(o0(n)?s8:i8)(r,s,o,n),u=b$(r,typeof n=="string",e),c=n!==T.Fragment?{...u,...l,ref:i}:{},{children:d}=r,f=T.useMemo(()=>Je(d)?d.get():d,[d]);return T.createElement(n,{...c,children:f})}}function a8(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...o0(r)?e8:t8,preloadedFeatures:e,useRender:o8(i),createVisualElement:t,Component:r};return T$(o)}}function IT(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Wu(e,t,n){const r=e.getProps();return a0(r,t,n!==void 0?n:r.custom,e)}const l8=t0(()=>window.ScrollTimeline!==void 0);class u8{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(l8()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class c8 extends u8{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function m0(e,t){return e?e[t]||e.default||e:void 0}const gy=2e4;function RT(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<gy;)t+=n,r=e.next(t);return t>=gy?1/0:t}function g0(e){return typeof e=="function"}function Mw(e,t){e.timeline=t,e.onfinish=null}const y0=e=>Array.isArray(e)&&typeof e[0]=="number",d8={linearEasing:void 0};function f8(e,t){const n=t0(e);return()=>{var r;return(r=d8[t])!==null&&r!==void 0?r:n()}}const tu=f8(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),DT=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(ns(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function OT(e){return!!(typeof e=="function"&&tu()||!e||typeof e=="string"&&(e in yy||tu())||y0(e)||Array.isArray(e)&&e.every(OT))}const Ds=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,yy={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ds([0,.65,.55,1]),circOut:Ds([.55,0,1,.45]),backIn:Ds([.31,.01,.66,-.59]),backOut:Ds([.33,1.53,.69,.99])};function LT(e,t){if(e)return typeof e=="function"&&tu()?DT(e,t):y0(e)?Ds(e):Array.isArray(e)?e.map(n=>LT(n,t)||yy.easeOut):yy[e]}const Lt={x:!1,y:!1};function FT(){return Lt.x||Lt.y}function h8(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=void 0)!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function qT(e,t){const n=h8(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function Aw(e){return t=>{t.pointerType==="touch"||FT()||e(t)}}function p8(e,t,n={}){const[r,i,s]=qT(e,n),o=Aw(a=>{const{target:l}=a,u=t(a);if(typeof u!="function"||!l)return;const c=Aw(d=>{u(d),l.removeEventListener("pointerleave",c)});l.addEventListener("pointerleave",c,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const VT=(e,t)=>t?e===t?!0:VT(e,t.parentElement):!1,v0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,m8=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function g8(e){return m8.has(e.tagName)||e.tabIndex!==-1}const Os=new WeakSet;function Iw(e){return t=>{t.key==="Enter"&&e(t)}}function Jc(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const y8=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=Iw(()=>{if(Os.has(n))return;Jc(n,"down");const i=Iw(()=>{Jc(n,"up")}),s=()=>Jc(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function Rw(e){return v0(e)&&!FT()}function v8(e,t,n={}){const[r,i,s]=qT(e,n),o=a=>{const l=a.currentTarget;if(!Rw(a)||Os.has(l))return;Os.add(l);const u=t(a),c=(p,m)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",f),!(!Rw(p)||!Os.has(l))&&(Os.delete(l),typeof u=="function"&&u(p,{success:m}))},d=p=>{c(p,n.useGlobalTarget||VT(l,p.target))},f=p=>{c(p,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",f,i)};return r.forEach(a=>{!g8(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",u=>y8(u,i),i)}),s}function x8(e){return e==="x"||e==="y"?Lt[e]?null:(Lt[e]=!0,()=>{Lt[e]=!1}):Lt.x||Lt.y?null:(Lt.x=Lt.y=!0,()=>{Lt.x=Lt.y=!1})}const $T=new Set(["width","height","top","left","right","bottom",...ls]);let pl;function w8(){pl=void 0}const un={now:()=>(pl===void 0&&un.set(Ue.isProcessing||m$.useManualTiming?Ue.timestamp:performance.now()),pl),set:e=>{pl=e,queueMicrotask(w8)}};function x0(e,t){e.indexOf(t)===-1&&e.push(t)}function w0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class b0{constructor(){this.subscriptions=[]}add(t){return x0(this.subscriptions,t),()=>w0(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function zT(e,t){return t?e*(1e3/t):0}const Dw=30,b8=e=>!isNaN(parseFloat(e));class _8{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=un.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=un.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=b8(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new b0);const r=this.events[t].add(n);return t==="change"?()=>{r(),we.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=un.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Dw)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Dw);return zT(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Do(e,t){return new _8(e,t)}function S8(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Do(n))}function N8(e,t){const n=Wu(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=O$(s[o]);S8(e,o,a)}}function E8(e){return!!(Je(e)&&e.add)}function vy(e,t){const n=e.getValue("willChange");if(E8(n))return n.add(t)}function BT(e){return e.props[xT]}const HT=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,C8=1e-7,k8=12;function P8(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=HT(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>C8&&++a<k8);return o}function ta(e,t,n,r){if(e===t&&n===r)return xt;const i=s=>P8(s,0,1,e,n);return s=>s===0||s===1?s:HT(i(s),t,r)}const UT=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,WT=e=>t=>1-e(1-t),GT=ta(.33,1.53,.69,.99),_0=WT(GT),YT=UT(_0),KT=e=>(e*=2)<1?.5*_0(e):.5*(2-Math.pow(2,-10*(e-1))),S0=e=>1-Math.sin(Math.acos(e)),XT=WT(S0),QT=UT(S0),ZT=e=>/^0[^.\s]+$/u.test(e);function j8(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ZT(e):!0}const to=e=>Math.round(e*1e5)/1e5,N0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function T8(e){return e==null}const M8=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,E0=(e,t)=>n=>!!(typeof n=="string"&&M8.test(n)&&n.startsWith(e)||t&&!T8(n)&&Object.prototype.hasOwnProperty.call(n,t)),JT=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(N0);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},A8=e=>On(0,255,e),ed={...us,transform:e=>Math.round(A8(e))},Fr={test:E0("rgb","red"),parse:JT("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+ed.transform(e)+", "+ed.transform(t)+", "+ed.transform(n)+", "+to(Ro.transform(r))+")"};function I8(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const xy={test:E0("#"),parse:I8,transform:Fr.transform},ji={test:E0("hsl","hue"),parse:JT("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ln.transform(to(t))+", "+ln.transform(to(n))+", "+to(Ro.transform(r))+")"},Qe={test:e=>Fr.test(e)||xy.test(e)||ji.test(e),parse:e=>Fr.test(e)?Fr.parse(e):ji.test(e)?ji.parse(e):xy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Fr.transform(e):ji.transform(e)},R8=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function D8(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(N0))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(R8))===null||n===void 0?void 0:n.length)||0)>0}const eM="number",tM="color",O8="var",L8="var(",Ow="${}",F8=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Oo(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(F8,l=>(Qe.test(l)?(r.color.push(s),i.push(tM),n.push(Qe.parse(l))):l.startsWith(L8)?(r.var.push(s),i.push(O8),n.push(l)):(r.number.push(s),i.push(eM),n.push(parseFloat(l))),++s,Ow)).split(Ow);return{values:n,split:a,indexes:r,types:i}}function nM(e){return Oo(e).values}function rM(e){const{split:t,types:n}=Oo(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===eM?s+=to(i[o]):a===tM?s+=Qe.transform(i[o]):s+=i[o]}return s}}const q8=e=>typeof e=="number"?0:e;function V8(e){const t=nM(e);return rM(e)(t.map(q8))}const xr={test:D8,parse:nM,createTransformer:rM,getAnimatableNone:V8},$8=new Set(["brightness","contrast","saturate","opacity"]);function z8(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(N0)||[];if(!r)return e;const i=n.replace(r,"");let s=$8.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const B8=/\b([a-z-]*)\(.*?\)/gu,wy={...xr,getAnimatableNone:e=>{const t=e.match(B8);return t?t.map(z8).join(" "):e}},H8={...u0,color:Qe,backgroundColor:Qe,outlineColor:Qe,fill:Qe,stroke:Qe,borderColor:Qe,borderTopColor:Qe,borderRightColor:Qe,borderBottomColor:Qe,borderLeftColor:Qe,filter:wy,WebkitFilter:wy},C0=e=>H8[e];function iM(e,t){let n=C0(e);return n!==wy&&(n=xr),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const U8=new Set(["auto","none","0"]);function W8(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!U8.has(s)&&Oo(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=iM(n,i)}const Lw=e=>e===us||e===te,Fw=(e,t)=>parseFloat(e.split(", ")[t]),qw=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Fw(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?Fw(s[1],e):0}},G8=new Set(["x","y","z"]),Y8=ls.filter(e=>!G8.has(e));function K8(e){const t=[];return Y8.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const is={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:qw(4,13),y:qw(5,14)};is.translateX=is.x;is.translateY=is.y;const Hr=new Set;let by=!1,_y=!1;function sM(){if(_y){const e=Array.from(Hr).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=K8(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}_y=!1,by=!1,Hr.forEach(e=>e.complete()),Hr.clear()}function oM(){Hr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(_y=!0)})}function X8(){oM(),sM()}class k0{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Hr.add(this),by||(by=!0,we.read(oM),we.resolveKeyframes(sM))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Hr.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Hr.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const aM=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Q8=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Z8(e){const t=Q8.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function lM(e,t,n=1){const[r,i]=Z8(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return aM(o)?parseFloat(o):o}return l0(i)?lM(i,t,n+1):i}const uM=e=>t=>t.test(e),J8={test:e=>e==="auto",parse:e=>e},cM=[us,te,ln,Qn,z$,$$,J8],Vw=e=>cM.find(uM(e));class dM extends k0{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),l0(u))){const c=lM(u,n.current);c!==void 0&&(t[l]=c),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!$T.has(r)||t.length!==2)return;const[i,s]=t,o=Vw(i),a=Vw(s);if(o!==a)if(Lw(o)&&Lw(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)j8(t[i])&&r.push(i);r.length&&W8(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=is[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=is[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const $w=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(xr.test(e)||e==="0")&&!e.startsWith("url("));function ez(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tz(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=$w(i,t),a=$w(s,t);return!o||!a?!1:ez(e)||(n==="spring"||g0(n))&&r}const nz=e=>e!==null;function Gu(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(nz),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const rz=40;class fM{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=un.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>rz?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&X8(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=un.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!tz(t,r,i,s))if(o)this.options.duration=0;else{l&&l(Gu(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const c=this.initPlayback(t,n);c!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ce=(e,t,n)=>e+(t-e)*n;function td(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function iz({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=td(l,a,e+1/3),s=td(l,a,e),o=td(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function nu(e,t){return n=>n>0?t:e}const nd=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},sz=[xy,Fr,ji],oz=e=>sz.find(t=>t.test(e));function zw(e){const t=oz(e);if(!t)return!1;let n=t.parse(e);return t===ji&&(n=iz(n)),n}const Bw=(e,t)=>{const n=zw(e),r=zw(t);if(!n||!r)return nu(e,t);const i={...n};return s=>(i.red=nd(n.red,r.red,s),i.green=nd(n.green,r.green,s),i.blue=nd(n.blue,r.blue,s),i.alpha=Ce(n.alpha,r.alpha,s),Fr.transform(i))},az=(e,t)=>n=>t(e(n)),na=(...e)=>e.reduce(az),Sy=new Set(["none","hidden"]);function lz(e,t){return Sy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function uz(e,t){return n=>Ce(e,t,n)}function P0(e){return typeof e=="number"?uz:typeof e=="string"?l0(e)?nu:Qe.test(e)?Bw:fz:Array.isArray(e)?hM:typeof e=="object"?Qe.test(e)?Bw:cz:nu}function hM(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>P0(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function cz(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=P0(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function dz(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],a=e.indexes[o][i[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const fz=(e,t)=>{const n=xr.createTransformer(t),r=Oo(e),i=Oo(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Sy.has(e)&&!i.values.length||Sy.has(t)&&!r.values.length?lz(e,t):na(hM(dz(r,i),i.values),n):nu(e,t)};function pM(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ce(e,t,n):P0(e)(e,t)}const hz=5;function mM(e,t,n){const r=Math.max(t-hz,0);return zT(n-e(r),t-r)}const je={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},rd=.001;function pz({duration:e=je.duration,bounce:t=je.bounce,velocity:n=je.velocity,mass:r=je.mass}){let i,s,o=1-t;o=On(je.minDamping,je.maxDamping,o),e=On(je.minDuration,je.maxDuration,jn(e)),o<1?(i=u=>{const c=u*o,d=c*e,f=c-n,p=Ny(u,o),m=Math.exp(-d);return rd-f/p*m},s=u=>{const d=u*o*e,f=d*n+n,p=Math.pow(o,2)*Math.pow(u,2)*e,m=Math.exp(-d),v=Ny(Math.pow(u,2),o);return(-i(u)+rd>0?-1:1)*((f-p)*m)/v}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-rd+c*d},s=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=gz(i,s,a);if(e=Pn(e),isNaN(l))return{stiffness:je.stiffness,damping:je.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const mz=12;function gz(e,t,n){let r=n;for(let i=1;i<mz;i++)r=r-e(r)/t(r);return r}function Ny(e,t){return e*Math.sqrt(1-t*t)}const yz=["duration","bounce"],vz=["stiffness","damping","mass"];function Hw(e,t){return t.some(n=>e[n]!==void 0)}function xz(e){let t={velocity:je.velocity,stiffness:je.stiffness,damping:je.damping,mass:je.mass,isResolvedFromDuration:!1,...e};if(!Hw(e,vz)&&Hw(e,yz))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*On(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:je.mass,stiffness:i,damping:s}}else{const n=pz(e);t={...t,...n,mass:je.mass},t.isResolvedFromDuration=!0}return t}function gM(e=je.visualDuration,t=je.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=xz({...n,velocity:-jn(n.velocity||0)}),m=f||0,v=u/(2*Math.sqrt(l*c)),w=o-s,g=jn(Math.sqrt(l/c)),x=Math.abs(w)<5;r||(r=x?je.restSpeed.granular:je.restSpeed.default),i||(i=x?je.restDelta.granular:je.restDelta.default);let y;if(v<1){const E=Ny(g,v);y=C=>{const _=Math.exp(-v*g*C);return o-_*((m+v*g*w)/E*Math.sin(E*C)+w*Math.cos(E*C))}}else if(v===1)y=E=>o-Math.exp(-g*E)*(w+(m+g*w)*E);else{const E=g*Math.sqrt(v*v-1);y=C=>{const _=Math.exp(-v*g*C),k=Math.min(E*C,300);return o-_*((m+v*g*w)*Math.sinh(k)+E*w*Math.cosh(k))/E}}const b={calculatedDuration:p&&d||null,next:E=>{const C=y(E);if(p)a.done=E>=d;else{let _=0;v<1&&(_=E===0?Pn(m):mM(y,E,C));const k=Math.abs(_)<=r,I=Math.abs(o-C)<=i;a.done=k&&I}return a.value=a.done?o:C,a},toString:()=>{const E=Math.min(RT(b),gy),C=DT(_=>b.next(E*_).value,E,30);return E+"ms "+C}};return b}function Uw({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},p=k=>a!==void 0&&k<a||l!==void 0&&k>l,m=k=>a===void 0?l:l===void 0||Math.abs(a-k)<Math.abs(l-k)?a:l;let v=n*t;const w=d+v,g=o===void 0?w:o(w);g!==w&&(v=g-d);const x=k=>-v*Math.exp(-k/r),y=k=>g+x(k),b=k=>{const I=x(k),F=y(k);f.done=Math.abs(I)<=u,f.value=f.done?g:F};let E,C;const _=k=>{p(f.value)&&(E=k,C=gM({keyframes:[f.value,m(f.value)],velocity:mM(y,k,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return _(0),{calculatedDuration:null,next:k=>{let I=!1;return!C&&E===void 0&&(I=!0,b(k),_(k)),E!==void 0&&k>=E?C.next(k-E):(!I&&b(k),f)}}}const wz=ta(.42,0,1,1),bz=ta(0,0,.58,1),yM=ta(.42,0,.58,1),_z=e=>Array.isArray(e)&&typeof e[0]!="number",Sz={linear:xt,easeIn:wz,easeInOut:yM,easeOut:bz,circIn:S0,circInOut:QT,circOut:XT,backIn:_0,backInOut:YT,backOut:GT,anticipate:KT},Ww=e=>{if(y0(e)){pT(e.length===4);const[t,n,r,i]=e;return ta(t,n,r,i)}else if(typeof e=="string")return Sz[e];return e};function Nz(e,t,n){const r=[],i=n||pM,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||xt:t;a=na(l,a)}r.push(a)}return r}function Ez(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(pT(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=Nz(t,r,i),l=a.length,u=c=>{if(o&&c<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(c<e[d+1]);d++);const f=ns(e[d],e[d+1],c);return a[d](f)};return n?c=>u(On(e[0],e[s-1],c)):u}function Cz(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=ns(0,t,r);e.push(Ce(n,1,i))}}function kz(e){const t=[0];return Cz(t,e.length-1),t}function Pz(e,t){return e.map(n=>n*t)}function jz(e,t){return e.map(()=>t||yM).splice(0,e.length-1)}function ru({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=_z(r)?r.map(Ww):Ww(r),s={done:!1,value:t[0]},o=Pz(n&&n.length===t.length?n:kz(t),e),a=Ez(o,t,{ease:Array.isArray(i)?i:jz(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const Tz=e=>{const t=({timestamp:n})=>e(n);return{start:()=>we.update(t,!0),stop:()=>vr(t),now:()=>Ue.isProcessing?Ue.timestamp:un.now()}},Mz={decay:Uw,inertia:Uw,tween:ru,keyframes:ru,spring:gM},Az=e=>e/100;class j0 extends fM{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=(i==null?void 0:i.KeyframeResolver)||k0,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=g0(n)?n:Mz[n]||ru;let l,u;a!==ru&&typeof t[0]!="number"&&(l=na(Az,pM(t[0],t[1])),t=[0,100]);const c=a({...this.options,keyframes:t});s==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=RT(c));const{calculatedDuration:d}=c,f=d+i,p=f*(r+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:f,totalDuration:p}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:k}=this.options;return{done:!0,value:k[k.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:f,repeat:p,repeatType:m,repeatDelay:v,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-c/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),x=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let y=this.currentTime,b=s;if(p){const k=Math.min(this.currentTime,c)/d;let I=Math.floor(k),F=k%1;!F&&k>=1&&(F=1),F===1&&I--,I=Math.min(I,p+1),!!(I%2)&&(m==="reverse"?(F=1-F,v&&(F-=v/d)):m==="mirror"&&(b=o)),y=On(0,1,F)*d}const E=x?{done:!1,value:l[0]}:b.next(y);a&&(E.value=a(E.value));let{done:C}=E;!x&&u!==null&&(C=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return _&&i!==void 0&&(E.value=Gu(l,this.options,i)),w&&w(E.value),_&&this.finish(),E}get duration(){const{resolved:t}=this;return t?jn(t.calculatedDuration):0}get time(){return jn(this.currentTime)}set time(t){t=Pn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=jn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Tz,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Iz=new Set(["opacity","clipPath","filter","transform"]);function Rz(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=LT(a,i);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const Dz=t0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),iu=10,Oz=2e4;function Lz(e){return g0(e.type)||e.type==="spring"||!OT(e.ease)}function Fz(e,t){const n=new j0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<Oz;)r=n.sample(s),i.push(r.value),s+=iu;return{times:void 0,keyframes:i,duration:s-iu,ease:"linear"}}const vM={anticipate:KT,backInOut:YT,circInOut:QT};function qz(e){return e in vM}class Gw extends fM{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new dM(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&tu()&&qz(s)&&(s=vM[s]),Lz(this.options)){const{onComplete:d,onUpdate:f,motionValue:p,element:m,...v}=this.options,w=Fz(t,v);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,i=w.times,s=w.ease,o="keyframes"}const c=Rz(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return c.startTime=u??this.calcStartTime(),this.pendingTimeline?(Mw(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:d}=this.options;a.set(Gu(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return jn(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return jn(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Pn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return xt;const{animation:r}=n;Mw(r,t)}return xt}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:d,element:f,...p}=this.options,m=new j0({...p,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),v=Pn(this.time);u.setWithVelocity(m.sample(v-iu).value,m.sample(v).value,iu)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return Dz()&&r&&Iz.has(r)&&!l&&!u&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const Vz={type:"spring",stiffness:500,damping:25,restSpeed:10},$z=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),zz={type:"keyframes",duration:.8},Bz={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Hz=(e,{keyframes:t})=>t.length>2?zz:ii.has(e)?e.startsWith("scale")?$z(t[1]):Vz:Bz;function Uz({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const T0=(e,t,n,r={},i,s)=>o=>{const a=m0(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Pn(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:f=>{t.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};Uz(a)||(c={...c,...Hz(e,c)}),c.duration&&(c.duration=Pn(c.duration)),c.repeatDelay&&(c.repeatDelay=Pn(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let d=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(d=!0)),d&&!s&&t.get()!==void 0){const f=Gu(c.keyframes,a);if(f!==void 0)return we.update(()=>{c.onUpdate(f),c.onComplete()}),new c8([])}return!s&&Gw.supports(c)?new Gw(c):new j0(c)};function Wz({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function xM(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const f=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),p=l[d];if(p===void 0||c&&Wz(c,d))continue;const m={delay:n,...m0(o||{},d)};let v=!1;if(window.MotionHandoffAnimation){const g=BT(e);if(g){const x=window.MotionHandoffAnimation(g,d,we);x!==null&&(m.startTime=x,v=!0)}}vy(e,d),f.start(T0(d,f,p,e.shouldReduceMotion&&$T.has(d)?{type:!1}:m,e,v));const w=f.animation;w&&u.push(w)}return a&&Promise.all(u).then(()=>{we.update(()=>{a&&N8(e,a)})}),u}function Ey(e,t,n={}){var r;const i=Wu(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(xM(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:d,staggerDirection:f}=s;return Gz(e,t,c+u,d,f,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function Gz(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(Yz).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(Ey(u,t,{...s,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function Yz(e,t){return e.sortNodePosition(t)}function Kz(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Ey(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Ey(e,t,n);else{const i=typeof t=="function"?Wu(e,t,n.custom):t;r=Promise.all(xM(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Xz=r0.length;function wM(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?wM(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Xz;n++){const r=r0[n],i=e.props[r];(Io(i)||i===!1)&&(t[r]=i)}return t}const Qz=[...n0].reverse(),Zz=n0.length;function Jz(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Kz(e,n,r)))}function eB(e){let t=Jz(e),n=Yw(),r=!0;const i=l=>(u,c)=>{var d;const f=Wu(e,c,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(f){const{transition:p,transitionEnd:m,...v}=f;u={...u,...v,...m}}return u};function s(l){t=l(e)}function o(l){const{props:u}=e,c=wM(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let w=0;w<Zz;w++){const g=Qz[w],x=n[g],y=u[g]!==void 0?u[g]:c[g],b=Io(y),E=g===l?x.isActive:null;E===!1&&(m=w);let C=y===c[g]&&y!==u[g]&&b;if(C&&r&&e.manuallyAnimateOnMount&&(C=!1),x.protectedKeys={...p},!x.isActive&&E===null||!y&&!x.prevProp||Hu(y)||typeof y=="boolean")continue;const _=tB(x.prevProp,y);let k=_||g===l&&x.isActive&&!C&&b||w>m&&b,I=!1;const F=Array.isArray(y)?y:[y];let S=F.reduce(i(g),{});E===!1&&(S={});const{prevResolvedValues:P={}}=x,L={...P,...S},N=O=>{k=!0,f.has(O)&&(I=!0,f.delete(O)),x.needsAnimating[O]=!0;const j=e.getValue(O);j&&(j.liveStyle=!1)};for(const O in L){const j=S[O],M=P[O];if(p.hasOwnProperty(O))continue;let q=!1;my(j)&&my(M)?q=!IT(j,M):q=j!==M,q?j!=null?N(O):f.add(O):j!==void 0&&f.has(O)?N(O):x.protectedKeys[O]=!0}x.prevProp=y,x.prevResolvedValues=S,x.isActive&&(p={...p,...S}),r&&e.blockInitialAnimation&&(k=!1),k&&(!(C&&_)||I)&&d.push(...F.map(O=>({animation:O,options:{type:g}})))}if(f.size){const w={};f.forEach(g=>{const x=e.getBaseTarget(g),y=e.getValue(g);y&&(y.liveStyle=!0),w[g]=x??null}),d.push({animation:w})}let v=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(v=!1),r=!1,v?t(d):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=e.variantChildren)===null||c===void 0||c.forEach(f=>{var p;return(p=f.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=Yw(),r=!0}}}function tB(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!IT(t,e):!1}function kr(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Yw(){return{animate:kr(!0),whileInView:kr(),whileHover:kr(),whileTap:kr(),whileDrag:kr(),whileFocus:kr(),exit:kr()}}class Er{constructor(t){this.isMounted=!1,this.node=t}update(){}}class nB extends Er{constructor(t){super(t),t.animationState||(t.animationState=eB(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Hu(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let rB=0;class iB extends Er{constructor(){super(...arguments),this.id=rB++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const sB={animation:{Feature:nB},exit:{Feature:iB}};function Lo(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function ra(e){return{point:{x:e.pageX,y:e.pageY}}}const oB=e=>t=>v0(t)&&e(t,ra(t));function no(e,t,n,r){return Lo(e,t,oB(n),r)}const Kw=(e,t)=>Math.abs(e-t);function aB(e,t){const n=Kw(e.x,t.x),r=Kw(e.y,t.y);return Math.sqrt(n**2+r**2)}class bM{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=sd(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,p=aB(d.offset,{x:0,y:0})>=3;if(!f&&!p)return;const{point:m}=d,{timestamp:v}=Ue;this.history.push({...m,timestamp:v});const{onStart:w,onMove:g}=this.handlers;f||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,d)},this.handlePointerMove=(d,f)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=id(f,this.transformPagePoint),we.update(this.updatePoint,!0)},this.handlePointerUp=(d,f)=>{this.end();const{onEnd:p,onSessionEnd:m,resumeAnimation:v}=this.handlers;if(this.dragSnapToOrigin&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=sd(d.type==="pointercancel"?this.lastMoveEventInfo:id(f,this.transformPagePoint),this.history);this.startEvent&&p&&p(d,w),m&&m(d,w)},!v0(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=ra(t),a=id(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Ue;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(t,sd(a,this.history)),this.removeListeners=na(no(this.contextWindow,"pointermove",this.handlePointerMove),no(this.contextWindow,"pointerup",this.handlePointerUp),no(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),vr(this.updatePoint)}}function id(e,t){return t?{point:t(e.point)}:e}function Xw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sd({point:e},t){return{point:e,delta:Xw(e,_M(t)),offset:Xw(e,lB(t)),velocity:uB(t,.1)}}function lB(e){return e[0]}function _M(e){return e[e.length-1]}function uB(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=_M(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Pn(t)));)n--;if(!r)return{x:0,y:0};const s=jn(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const SM=1e-4,cB=1-SM,dB=1+SM,NM=.01,fB=0-NM,hB=0+NM;function _t(e){return e.max-e.min}function pB(e,t,n){return Math.abs(e-t)<=n}function Qw(e,t,n,r=.5){e.origin=r,e.originPoint=Ce(t.min,t.max,e.origin),e.scale=_t(n)/_t(t),e.translate=Ce(n.min,n.max,e.origin)-e.originPoint,(e.scale>=cB&&e.scale<=dB||isNaN(e.scale))&&(e.scale=1),(e.translate>=fB&&e.translate<=hB||isNaN(e.translate))&&(e.translate=0)}function ro(e,t,n,r){Qw(e.x,t.x,n.x,r?r.originX:void 0),Qw(e.y,t.y,n.y,r?r.originY:void 0)}function Zw(e,t,n){e.min=n.min+t.min,e.max=e.min+_t(t)}function mB(e,t,n){Zw(e.x,t.x,n.x),Zw(e.y,t.y,n.y)}function Jw(e,t,n){e.min=t.min-n.min,e.max=e.min+_t(t)}function io(e,t,n){Jw(e.x,t.x,n.x),Jw(e.y,t.y,n.y)}function gB(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ce(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ce(n,e,r.max):Math.min(e,n)),e}function eb(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function yB(e,{top:t,left:n,bottom:r,right:i}){return{x:eb(e.x,n,i),y:eb(e.y,t,r)}}function tb(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function vB(e,t){return{x:tb(e.x,t.x),y:tb(e.y,t.y)}}function xB(e,t){let n=.5;const r=_t(e),i=_t(t);return i>r?n=ns(t.min,t.max-r,e.min):r>i&&(n=ns(e.min,e.max-i,t.min)),On(0,1,n)}function wB(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Cy=.35;function bB(e=Cy){return e===!1?e=0:e===!0&&(e=Cy),{x:nb(e,"left","right"),y:nb(e,"top","bottom")}}function nb(e,t,n){return{min:rb(e,t),max:rb(e,n)}}function rb(e,t){return typeof e=="number"?e:e[t]||0}const ib=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ti=()=>({x:ib(),y:ib()}),sb=()=>({min:0,max:0}),Me=()=>({x:sb(),y:sb()});function Ct(e){return[e("x"),e("y")]}function EM({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function _B({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function SB(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function od(e){return e===void 0||e===1}function ky({scale:e,scaleX:t,scaleY:n}){return!od(e)||!od(t)||!od(n)}function Mr(e){return ky(e)||CM(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function CM(e){return ob(e.x)||ob(e.y)}function ob(e){return e&&e!=="0%"}function su(e,t,n){const r=e-n,i=t*r;return n+i}function ab(e,t,n,r,i){return i!==void 0&&(e=su(e,i,r)),su(e,n,r)+t}function Py(e,t=0,n=1,r,i){e.min=ab(e.min,t,n,r,i),e.max=ab(e.max,t,n,r,i)}function kM(e,{x:t,y:n}){Py(e.x,t.translate,t.scale,t.originPoint),Py(e.y,n.translate,n.scale,n.originPoint)}const lb=.999999999999,ub=1.0000000000001;function NB(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ai(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,kM(e,o)),r&&Mr(s.latestValues)&&Ai(e,s.latestValues))}t.x<ub&&t.x>lb&&(t.x=1),t.y<ub&&t.y>lb&&(t.y=1)}function Mi(e,t){e.min=e.min+t,e.max=e.max+t}function cb(e,t,n,r,i=.5){const s=Ce(e.min,e.max,i);Py(e,t,n,s,r)}function Ai(e,t){cb(e.x,t.x,t.scaleX,t.scale,t.originX),cb(e.y,t.y,t.scaleY,t.scale,t.originY)}function PM(e,t){return EM(SB(e.getBoundingClientRect(),t))}function EB(e,t,n){const r=PM(e,n),{scroll:i}=t;return i&&(Mi(r.x,i.offset.x),Mi(r.y,i.offset.y)),r}const jM=({current:e})=>e?e.ownerDocument.defaultView:null,CB=new WeakMap;class kB{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Me(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(ra(c).point)},s=(c,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=x8(f),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ct(w=>{let g=this.getAxisMotionValue(w).get()||0;if(ln.test(g)){const{projection:x}=this.visualElement;if(x&&x.layout){const y=x.layout.layoutBox[w];y&&(g=_t(y)*(parseFloat(g)/100))}}this.originPoint[w]=g}),m&&we.postRender(()=>m(c,d)),vy(this.visualElement,"transform");const{animationState:v}=this.visualElement;v&&v.setActive("whileDrag",!0)},o=(c,d)=>{const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:v}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:w}=d;if(p&&this.currentDirection===null){this.currentDirection=PB(w),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,w),this.updateAxis("y",d.point,w),this.visualElement.render(),v&&v(c,d)},a=(c,d)=>this.stop(c,d),l=()=>Ct(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new bM(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:jM(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&we.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!Wa(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=gB(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&Pi(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=yB(i.layoutBox,n):this.constraints=!1,this.elastic=bB(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Ct(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=wB(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Pi(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=EB(r,i.root,this.visualElement.getTransformPagePoint());let o=vB(i.layout.layoutBox,s);if(n){const a=n(_B(o));this.hasMutatedConstraints=!!a,a&&(o=EM(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Ct(c=>{if(!Wa(c,n,this.currentDirection))return;let d=l&&l[c]||{};o&&(d={min:0,max:0});const f=i?200:1e6,p=i?40:1e7,m={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(c,m)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return vy(this.visualElement,t),r.start(T0(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ct(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ct(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ct(n=>{const{drag:r}=this.getProps();if(!Wa(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Ce(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Pi(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Ct(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=xB({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ct(o=>{if(!Wa(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Ce(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;CB.set(this.visualElement,this);const t=this.visualElement.current,n=no(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Pi(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),we.read(r);const o=Lo(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ct(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Cy,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function Wa(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function PB(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class jB extends Er{constructor(t){super(t),this.removeGroupControls=xt,this.removeListeners=xt,this.controls=new kB(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||xt}unmount(){this.removeGroupControls(),this.removeListeners()}}const db=e=>(t,n)=>{e&&we.postRender(()=>e(t,n))};class TB extends Er{constructor(){super(...arguments),this.removePointerDownListener=xt}onPointerDown(t){this.session=new bM(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:jM(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:db(t),onStart:db(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&we.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=no(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ml={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function fb(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Cs={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(te.test(e))e=parseFloat(e);else return e;const n=fb(e,t.target.x),r=fb(e,t.target.y);return`${n}% ${r}%`}},MB={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=xr.parse(e);if(i.length>5)return r;const s=xr.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=Ce(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class AB extends T.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Z$(IB),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),ml.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||we.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),s0.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function TM(e){const[t,n]=fT(),r=T.useContext(Qv);return h.jsx(AB,{...e,layoutGroup:r,switchLayoutGroup:T.useContext(wT),isPresent:t,safeToRemove:n})}const IB={borderRadius:{...Cs,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Cs,borderTopRightRadius:Cs,borderBottomLeftRadius:Cs,borderBottomRightRadius:Cs,boxShadow:MB};function RB(e,t,n){const r=Je(e)?e:Do(e);return r.start(T0("",r,t,n)),r.animation}function DB(e){return e instanceof SVGElement&&e.tagName!=="svg"}const OB=(e,t)=>e.depth-t.depth;class LB{constructor(){this.children=[],this.isDirty=!1}add(t){x0(this.children,t),this.isDirty=!0}remove(t){w0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(OB),this.isDirty=!1,this.children.forEach(t)}}function FB(e,t){const n=un.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(vr(r),e(s-t))};return we.read(r,!0),()=>vr(r)}const MM=["TopLeft","TopRight","BottomLeft","BottomRight"],qB=MM.length,hb=e=>typeof e=="string"?parseFloat(e):e,pb=e=>typeof e=="number"||te.test(e);function VB(e,t,n,r,i,s){i?(e.opacity=Ce(0,n.opacity!==void 0?n.opacity:1,$B(r)),e.opacityExit=Ce(t.opacity!==void 0?t.opacity:1,0,zB(r))):s&&(e.opacity=Ce(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<qB;o++){const a=`border${MM[o]}Radius`;let l=mb(t,a),u=mb(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||pb(l)===pb(u)?(e[a]=Math.max(Ce(hb(l),hb(u),r),0),(ln.test(u)||ln.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=Ce(t.rotate||0,n.rotate||0,r))}function mb(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const $B=AM(0,.5,XT),zB=AM(.5,.95,xt);function AM(e,t,n){return r=>r<e?0:r>t?1:n(ns(e,t,r))}function gb(e,t){e.min=t.min,e.max=t.max}function Et(e,t){gb(e.x,t.x),gb(e.y,t.y)}function yb(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vb(e,t,n,r,i){return e-=t,e=su(e,1/n,r),i!==void 0&&(e=su(e,1/i,r)),e}function BB(e,t=0,n=1,r=.5,i,s=e,o=e){if(ln.test(t)&&(t=parseFloat(t),t=Ce(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Ce(s.min,s.max,r);e===s&&(a-=t),e.min=vb(e.min,t,n,a,i),e.max=vb(e.max,t,n,a,i)}function xb(e,t,[n,r,i],s,o){BB(e,t[n],t[r],t[i],t.scale,s,o)}const HB=["x","scaleX","originX"],UB=["y","scaleY","originY"];function wb(e,t,n,r){xb(e.x,t,HB,n?n.x:void 0,r?r.x:void 0),xb(e.y,t,UB,n?n.y:void 0,r?r.y:void 0)}function bb(e){return e.translate===0&&e.scale===1}function IM(e){return bb(e.x)&&bb(e.y)}function _b(e,t){return e.min===t.min&&e.max===t.max}function WB(e,t){return _b(e.x,t.x)&&_b(e.y,t.y)}function Sb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function RM(e,t){return Sb(e.x,t.x)&&Sb(e.y,t.y)}function Nb(e){return _t(e.x)/_t(e.y)}function Eb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class GB{constructor(){this.members=[]}add(t){x0(this.members,t),t.scheduleRender()}remove(t){if(w0(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function YB(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:d,rotateY:f,skewX:p,skewY:m}=n;u&&(r=`perspective(${u}px) ${r}`),c&&(r+=`rotate(${c}deg) `),d&&(r+=`rotateX(${d}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),m&&(r+=`skewY(${m}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ar={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ls=typeof window<"u"&&window.MotionDebug!==void 0,ad=["","X","Y","Z"],KB={visibility:"hidden"},Cb=1e3;let XB=0;function ld(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function DM(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=BT(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",we,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&DM(r)}function OM({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=XB++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ls&&(Ar.totalNodes=Ar.resolvedTargetDeltas=Ar.recalculatedProjection=0),this.nodes.forEach(JB),this.nodes.forEach(i6),this.nodes.forEach(s6),this.nodes.forEach(e6),Ls&&window.MotionDebug.record(Ar)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new LB)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new b0),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=DB(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=FB(f,250),ml.hasAnimatedSinceResize&&(ml.hasAnimatedSinceResize=!1,this.nodes.forEach(Pb))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:p,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||c.getDefaultTransition()||c6,{onLayoutAnimationStart:w,onLayoutAnimationComplete:g}=c.getProps(),x=!this.targetLayout||!RM(this.targetLayout,m)||p,y=!f&&p;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||y||f&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,y);const b={...m0(v,"layout"),onPlay:w,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||Pb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,vr(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(o6),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&DM(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(kb);return}this.isUpdating||this.nodes.forEach(n6),this.isUpdating=!1,this.nodes.forEach(r6),this.nodes.forEach(QB),this.nodes.forEach(ZB),this.clearAllSnapshots();const a=un.now();Ue.delta=On(0,1e3/60,a-Ue.timestamp),Ue.timestamp=a,Ue.isProcessing=!0,Zc.update.process(Ue),Zc.preRender.process(Ue),Zc.render.process(Ue),Ue.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,s0.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(t6),this.sharedNodes.forEach(a6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,we.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){we.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Me(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!IM(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||Mr(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),d6(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return Me();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(f6))){const{scroll:c}=this.root;c&&(Mi(l.x,c.offset.x),Mi(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=Me();if(Et(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:d,options:f}=c;c!==this.root&&d&&f.layoutScroll&&(d.wasRoot&&Et(l,o),Mi(l.x,d.offset.x),Mi(l.y,d.offset.y))}return l}applyTransform(o,a=!1){const l=Me();Et(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Ai(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),Mr(c.latestValues)&&Ai(l,c.latestValues)}return Mr(this.latestValues)&&Ai(l,this.latestValues),l}removeTransform(o){const a=Me();Et(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Mr(u.latestValues))continue;ky(u.latestValues)&&u.updateSnapshot();const c=Me(),d=u.measurePageBox();Et(c,d),wb(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return Mr(this.latestValues)&&wb(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ue.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=Ue.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Me(),this.relativeTargetOrigin=Me(),io(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Me(),this.targetWithTransforms=Me()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),mB(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Et(this.target,this.layout.layoutBox),kM(this.target,this.targetDelta)):Et(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Me(),this.relativeTargetOrigin=Me(),io(this.relativeTargetOrigin,this.target,p.target),Et(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ls&&Ar.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ky(this.parent.latestValues)||CM(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Ue.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;Et(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;NB(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Me());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(yb(this.prevProjectionDelta.x,this.projectionDelta.x),yb(this.prevProjectionDelta.y,this.projectionDelta.y)),ro(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Eb(this.projectionDelta.x,this.prevProjectionDelta.x)||!Eb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),Ls&&Ar.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ti(),this.projectionDelta=Ti(),this.projectionDeltaWithTransform=Ti()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Ti();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=Me(),p=l?l.source:void 0,m=this.layout?this.layout.source:void 0,v=p!==m,w=this.getStack(),g=!w||w.members.length<=1,x=!!(v&&!g&&this.options.crossfade===!0&&!this.path.some(u6));this.animationProgress=0;let y;this.mixTargetDelta=b=>{const E=b/1e3;jb(d.x,o.x,E),jb(d.y,o.y,E),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(io(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),l6(this.relativeTarget,this.relativeTargetOrigin,f,E),y&&WB(this.relativeTarget,y)&&(this.isProjectionDirty=!1),y||(y=Me()),Et(y,this.relativeTarget)),v&&(this.animationValues=c,VB(c,u,this.latestValues,E,x,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(vr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=we.update(()=>{ml.hasAnimatedSinceResize=!0,this.currentAnimation=RB(0,Cb,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Cb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&LM(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Me();const d=_t(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const f=_t(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}Et(a,l),Ai(a,c),ro(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new GB),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&ld("z",o,u,this.animationValues);for(let c=0;c<ad.length;c++)ld(`rotate${ad[c]}`,o,u,this.animationValues),ld(`skew${ad[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return KB;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=hl(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const v={};return this.options.layoutId&&(v.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,v.pointerEvents=hl(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!Mr(this.latestValues)&&(v.transform=c?c({},""):"none",this.hasProjected=!1),v}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=YB(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:p,y:m}=this.projectionDelta;u.transformOrigin=`${p.origin*100}% ${m.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const v in eu){if(f[v]===void 0)continue;const{correct:w,applyTo:g}=eu[v],x=u.transform==="none"?f[v]:w(f[v],d);if(g){const y=g.length;for(let b=0;b<y;b++)u[g[b]]=x}else u[v]=x}return this.options.layoutId&&(u.pointerEvents=d===this?hl(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(kb),this.root.sharedNodes.clear()}}}function QB(e){e.updateLayout()}function ZB(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Ct(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=_t(f);f.min=r[d].min,f.max=f.min+p}):LM(s,n.layoutBox,r)&&Ct(d=>{const f=o?n.measuredBox[d]:n.layoutBox[d],p=_t(r[d]);f.max=f.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+p)});const a=Ti();ro(a,r,n.layoutBox);const l=Ti();o?ro(l,e.applyTransform(i,!0),n.measuredBox):ro(l,r,n.layoutBox);const u=!IM(a);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:p}=d;if(f&&p){const m=Me();io(m,n.layoutBox,f.layoutBox);const v=Me();io(v,r,p.layoutBox),RM(m,v)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=v,e.relativeTargetOrigin=m,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function JB(e){Ls&&Ar.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function e6(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function t6(e){e.clearSnapshot()}function kb(e){e.clearMeasurements()}function n6(e){e.isLayoutDirty=!1}function r6(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Pb(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function i6(e){e.resolveTargetDelta()}function s6(e){e.calcProjection()}function o6(e){e.resetSkewAndRotation()}function a6(e){e.removeLeadSnapshot()}function jb(e,t,n){e.translate=Ce(t.translate,0,n),e.scale=Ce(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Tb(e,t,n,r){e.min=Ce(t.min,n.min,r),e.max=Ce(t.max,n.max,r)}function l6(e,t,n,r){Tb(e.x,t.x,n.x,r),Tb(e.y,t.y,n.y,r)}function u6(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const c6={duration:.45,ease:[.4,0,.1,1]},Mb=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Ab=Mb("applewebkit/")&&!Mb("chrome/")?Math.round:xt;function Ib(e){e.min=Ab(e.min),e.max=Ab(e.max)}function d6(e){Ib(e.x),Ib(e.y)}function LM(e,t,n){return e==="position"||e==="preserve-aspect"&&!pB(Nb(t),Nb(n),.2)}function f6(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const h6=OM({attachResizeListener:(e,t)=>Lo(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ud={current:void 0},FM=OM({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ud.current){const e=new h6({});e.mount(window),e.setOptions({layoutScroll:!0}),ud.current=e}return ud.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),p6={pan:{Feature:TB},drag:{Feature:jB,ProjectionNode:FM,MeasureLayout:TM}};function Rb(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&we.postRender(()=>s(t,ra(t)))}class m6 extends Er{mount(){const{current:t}=this.node;t&&(this.unmount=p8(t,n=>(Rb(this.node,n,"Start"),r=>Rb(this.node,r,"End"))))}unmount(){}}class g6 extends Er{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=na(Lo(this.node.current,"focus",()=>this.onFocus()),Lo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Db(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&we.postRender(()=>s(t,ra(t)))}class y6 extends Er{mount(){const{current:t}=this.node;t&&(this.unmount=v8(t,n=>(Db(this.node,n,"Start"),(r,{success:i})=>Db(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const jy=new WeakMap,cd=new WeakMap,v6=e=>{const t=jy.get(e.target);t&&t(e)},x6=e=>{e.forEach(v6)};function w6({root:e,...t}){const n=e||document;cd.has(n)||cd.set(n,{});const r=cd.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(x6,{root:e,...t})),r[i]}function b6(e,t,n){const r=w6(t);return jy.set(e,n),r.observe(e),()=>{jy.delete(e),r.unobserve(e)}}const _6={some:0,all:1};class S6 extends Er{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:_6[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return b6(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(N6(t,n))&&this.startObserver()}unmount(){}}function N6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const E6={inView:{Feature:S6},tap:{Feature:y6},focus:{Feature:g6},hover:{Feature:m6}},C6={layout:{ProjectionNode:FM,MeasureLayout:TM}},Ty={current:null},qM={current:!1};function k6(){if(qM.current=!0,!!e0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ty.current=e.matches;e.addListener(t),t()}else Ty.current=!1}const P6=[...cM,Qe,xr],j6=e=>P6.find(uM(e)),Ob=new WeakMap;function T6(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Je(i))e.addValue(r,i);else if(Je(s))e.addValue(r,Do(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,Do(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Lb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class M6{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=k0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=un.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,we.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:c}=o;this.onUpdate=c,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=Uu(n),this.isVariantNode=vT(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...f}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in f){const m=f[p];l[p]!==void 0&&Je(m)&&m.set(l[p],!1)}}mount(t){this.current=t,Ob.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),qM.current||k6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ty.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ob.delete(this.current),this.projection&&this.projection.unmount(),vr(this.notifyUpdate),vr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=ii.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&we.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in rs){const n=rs[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Me()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Lb.length;r++){const i=Lb[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=T6(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Do(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(aM(i)||ZT(i))?i=parseFloat(i):!j6(i)&&xr.test(n)&&(i=iM(t,n)),this.setBaseTarget(t,Je(i)?i.get():i)),Je(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=a0(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Je(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new b0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class VM extends M6{constructor(){super(...arguments),this.KeyframeResolver=dM}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Je(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function A6(e){return window.getComputedStyle(e)}class I6 extends VM{constructor(){super(...arguments),this.type="html",this.renderInstance=kT}readValueFromInstance(t,n){if(ii.has(n)){const r=C0(n);return r&&r.default||0}else{const r=A6(t),i=(NT(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return PM(t,n)}build(t,n,r){c0(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return p0(t,n,r)}}class R6 extends VM{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Me}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ii.has(n)){const r=C0(n);return r&&r.default||0}return n=PT.has(n)?n:i0(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return MT(t,n,r)}build(t,n,r){d0(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){jT(t,n,r,i)}mount(t){this.isSVGTag=h0(t.tagName),super.mount(t)}}const D6=(e,t)=>o0(e)?new R6(t):new I6(t,{allowProjection:e!==T.Fragment}),O6=a8({...sB,...E6,...p6,...C6},D6),xe=_$(O6);/**
71
+ * @license lucide-react v0.316.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */var L6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
76
+ * @license lucide-react v0.316.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const F6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Q=(e,t)=>{const n=T.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...u},c)=>T.createElement("svg",{ref:c,...L6,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${F6(e)}`,a].join(" "),...u},[...t.map(([d,f])=>T.createElement(d,f)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/**
81
+ * @license lucide-react v0.316.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const My=Q("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
86
+ * @license lucide-react v0.316.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const q6=Q("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
91
+ * @license lucide-react v0.316.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const $M=Q("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
96
+ * @license lucide-react v0.316.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const ia=Q("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
101
+ * @license lucide-react v0.316.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const zM=Q("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
106
+ * @license lucide-react v0.316.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const BM=Q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
111
+ * @license lucide-react v0.316.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const V6=Q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
116
+ * @license lucide-react v0.316.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Ay=Q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
121
+ * @license lucide-react v0.316.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const $6=Q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
126
+ * @license lucide-react v0.316.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const HM=Q("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
131
+ * @license lucide-react v0.316.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const Fo=Q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
136
+ * @license lucide-react v0.316.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const Fb=Q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
141
+ * @license lucide-react v0.316.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const z6=Q("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
146
+ * @license lucide-react v0.316.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const B6=Q("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
151
+ * @license lucide-react v0.316.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const H6=Q("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
156
+ * @license lucide-react v0.316.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const UM=Q("FileCode",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 13-2 2 2 2",key:"17smn8"}],["path",{d:"m14 17 2-2-2-2",key:"14mezr"}]]);/**
161
+ * @license lucide-react v0.316.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const WM=Q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
166
+ * @license lucide-react v0.316.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const U6=Q("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
171
+ * @license lucide-react v0.316.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const W6=Q("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
176
+ * @license lucide-react v0.316.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const M0=Q("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
181
+ * @license lucide-react v0.316.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const G6=Q("FormInput",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M17 12h.01",key:"1m0b6t"}],["path",{d:"M7 12h.01",key:"eqddd0"}]]);/**
186
+ * @license lucide-react v0.316.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const Iy=Q("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
191
+ * @license lucide-react v0.316.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const qb=Q("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
196
+ * @license lucide-react v0.316.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const Y6=Q("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
201
+ * @license lucide-react v0.316.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const K6=Q("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
206
+ * @license lucide-react v0.316.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const X6=Q("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
211
+ * @license lucide-react v0.316.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const GM=Q("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
216
+ * @license lucide-react v0.316.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const Q6=Q("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
221
+ * @license lucide-react v0.316.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const Vb=Q("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
226
+ * @license lucide-react v0.316.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const Z6=Q("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/**
231
+ * @license lucide-react v0.316.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const qo=Q("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
236
+ * @license lucide-react v0.316.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const J6=Q("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
241
+ * @license lucide-react v0.316.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const sa=Q("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
246
+ * @license lucide-react v0.316.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const eH=Q("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
251
+ * @license lucide-react v0.316.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const A0=Q("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
256
+ * @license lucide-react v0.316.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const YM=Q("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z",key:"ymcmye"}]]);/**
261
+ * @license lucide-react v0.316.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const KM=Q("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
266
+ * @license lucide-react v0.316.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const Mt=Q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
271
+ * @license lucide-react v0.316.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const tH=Q("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
276
+ * @license lucide-react v0.316.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const $b=Q("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
281
+ * @license lucide-react v0.316.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const so=Q("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
286
+ * @license lucide-react v0.316.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const nH=Q("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
291
+ * @license lucide-react v0.316.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const dd=Q("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
296
+ * @license lucide-react v0.316.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const fd=Q("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
301
+ * @license lucide-react v0.316.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const rH=Q("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);/**
306
+ * @license lucide-react v0.316.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const iH=Q("ThumbsDown",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z",key:"s6e0r"}]]);/**
311
+ * @license lucide-react v0.316.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const sH=Q("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z",key:"y3tblf"}]]);/**
316
+ * @license lucide-react v0.316.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const $i=Q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
321
+ * @license lucide-react v0.316.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const oH=Q("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
326
+ * @license lucide-react v0.316.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const aH=Q("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
331
+ * @license lucide-react v0.316.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const lH=Q("Wifi",[["path",{d:"M5 13a10 10 0 0 1 14 0",key:"6v8j51"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
336
+ * @license lucide-react v0.316.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const I0=Q("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
341
+ * @license lucide-react v0.316.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const wr=Q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
346
+ * @license lucide-react v0.316.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const ou=Q("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function XM(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=XM(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fe(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=XM(e))&&(r&&(r+=" "),r+=t);return r}const uH={pending:HM,active:qo,completed:ia,failed:I0,skipped:nH},cH={low:"bg-accent-green/10 text-accent-green",medium:"bg-accent-yellow/10 text-accent-yellow",high:"bg-accent-red/10 text-accent-red"},dH=T.memo(function({data:t,selected:n}){const[r,i]=T.useState(!1),s=T.useRef(null),o=uH[t.status],a=t.isDisabledBranch,l=t.isUnexecuted,u=t.canModify&&!a,c=()=>{s.current&&(clearTimeout(s.current),s.current=null),i(!0)},d=()=>{s.current=setTimeout(()=>{i(!1)},300)},f=t.status==="active"&&!a,p=t.isNextToExecute&&!a,m=()=>f?["0 0 0 0 rgba(234, 179, 8, 0.4), 0 0 20px 5px rgba(234, 179, 8, 0.3)","0 0 0 0 rgba(234, 179, 8, 0.7), 0 0 30px 10px rgba(234, 179, 8, 0.5)","0 0 0 0 rgba(234, 179, 8, 0.4), 0 0 20px 5px rgba(234, 179, 8, 0.3)"]:p?["0 0 0 0 rgba(59, 130, 246, 0.3), 0 0 15px 3px rgba(59, 130, 246, 0.2)","0 0 0 0 rgba(59, 130, 246, 0.6), 0 0 25px 8px rgba(59, 130, 246, 0.4)","0 0 0 0 rgba(59, 130, 246, 0.3), 0 0 15px 3px rgba(59, 130, 246, 0.2)"]:"0 0 0 0 rgba(0, 0, 0, 0)";return h.jsxs(xe.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:a?.35:l?.5:1,scale:a?.95:1,y:0,filter:a?"grayscale(0.8)":l?"grayscale(0.5)":"grayscale(0)",boxShadow:m()},transition:{type:"spring",stiffness:300,damping:25,boxShadow:f||p?{duration:1.5,repeat:1/0,ease:"easeInOut"}:{duration:.3}},onMouseEnter:c,onMouseLeave:d,className:fe("px-4 py-3 rounded-xl min-w-[200px] max-w-[280px] relative overflow-visible","bg-surface/80 backdrop-blur-sm","border-2 transition-colors duration-200",{"border-border hover:border-border-subtle":t.status==="pending"&&!a&&!l&&!p,"border-accent-blue":p&&!a,"border-status-active":t.status==="active"&&!a,"border-status-completed shadow-glow-green":t.status==="completed"&&!a,"border-status-failed shadow-glow-red":t.status==="failed"&&!a,"border-border opacity-50":t.status==="skipped"||a,"border-border/50":l&&!p,"ring-2 ring-accent-blue ring-offset-2 ring-offset-canvas":n&&!a,"pointer-events-none":a}),children:[r&&u&&h.jsx("button",{onClick:v=>{var w;v.stopPropagation(),(w=t.onRemoveNode)==null||w.call(t,t.id)},onMouseEnter:c,onMouseLeave:d,className:"absolute -top-5 left-[calc(50%+16px)] z-50 text-white/60 hover:text-white hover:scale-110 transition-all",title:"Remove node",children:h.jsx(sa,{className:"w-5 h-5"})}),r&&u&&h.jsx("button",{onClick:v=>{var w;v.stopPropagation(),(w=t.onInsertNode)==null||w.call(t,t.id)},onMouseEnter:c,onMouseLeave:d,className:"absolute -bottom-8 left-[calc(50%+16px)] z-50 text-white/60 hover:text-white hover:scale-110 transition-all",title:"Insert node after",children:h.jsx(Mt,{className:"w-5 h-5"})}),h.jsx(yr,{type:"target",position:K.Top,className:"!w-3 !h-3 !bg-border !border-2 !border-surface"}),h.jsxs("div",{className:"flex items-start gap-3",children:[h.jsx("div",{className:fe("mt-0.5",{"text-text-muted":t.status==="pending"||t.status==="skipped","text-status-active":t.status==="active","text-status-completed":t.status==="completed","text-status-failed":t.status==="failed"}),children:t.status==="active"?h.jsx(xe.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:h.jsx(o,{className:"w-4 h-4"})}):h.jsx(o,{className:"w-4 h-4"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h3",{className:"font-medium text-sm text-text-primary truncate",children:t.title}),t.description&&h.jsx("p",{className:"text-xs text-text-muted mt-1 line-clamp-2",children:t.description})]})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-3 pt-2 border-t border-border",children:[t.complexity&&h.jsx("span",{className:fe("text-[10px] font-medium px-1.5 py-0.5 rounded",cH[t.complexity]),children:t.complexity}),t.dynamicFields&&t.dynamicFields.length>0&&h.jsx("span",{className:"text-[10px] text-text-muted",children:t.dynamicFields.filter(v=>v.required&&!v.value).length>0?`${t.dynamicFields.filter(v=>v.required&&!v.value).length} fields required`:`${t.dynamicFields.length} fields`})]}),h.jsx(yr,{type:"source",position:K.Bottom,className:"!w-3 !h-3 !bg-border !border-2 !border-surface"})]})}),fH=T.memo(function({data:t,selected:n}){const[r,i]=T.useState(!1),s=T.useRef(null),o=t.isDisabledBranch,a=t.isUnexecuted,l=t.status==="active"&&!o,u=t.canModify&&!o;return h.jsxs(xe.div,{initial:{opacity:0,scale:.8,y:20},animate:{opacity:o?.35:a?.5:1,scale:o?.95:1,y:0,filter:o?"grayscale(0.8)":a?"grayscale(0.5)":"grayscale(0)",boxShadow:l?["0 0 0 0 rgba(234, 179, 8, 0.4), 0 0 20px 5px rgba(234, 179, 8, 0.3)","0 0 0 0 rgba(234, 179, 8, 0.7), 0 0 30px 10px rgba(234, 179, 8, 0.5)","0 0 0 0 rgba(234, 179, 8, 0.4), 0 0 20px 5px rgba(234, 179, 8, 0.3)"]:"0 0 0 0 rgba(0, 0, 0, 0)"},transition:{type:"spring",stiffness:300,damping:25,boxShadow:l?{duration:1.5,repeat:1/0,ease:"easeInOut"}:{duration:.3}},onMouseEnter:()=>{s.current&&(clearTimeout(s.current),s.current=null),i(!0)},onMouseLeave:()=>{s.current=setTimeout(()=>{i(!1)},300)},className:fe("px-4 py-3 rounded-xl min-w-[240px] max-w-[320px] relative overflow-visible","bg-gradient-to-br from-accent-purple/10 to-accent-blue/10","backdrop-blur-sm","border-2 transition-colors duration-200",{"border-accent-purple/30 hover:border-accent-purple/50":!n&&!l&&!o,"border-status-active":l,"border-status-completed":t.status==="completed"&&!o,"ring-2 ring-accent-purple ring-offset-2 ring-offset-canvas":n&&!o,"border-border/50":a,"pointer-events-none":o}),children:[r&&u&&h.jsx("button",{onClick:c=>{var d;c.stopPropagation(),(d=t.onRemoveNode)==null||d.call(t,t.id)},onMouseEnter:()=>{s.current&&(clearTimeout(s.current),s.current=null),i(!0)},onMouseLeave:()=>{s.current=setTimeout(()=>{i(!1)},300)},className:"absolute -top-5 left-[calc(50%+16px)] z-50 text-white/60 hover:text-white hover:scale-110 transition-all",title:"Remove node",children:h.jsx(sa,{className:"w-5 h-5"})}),r&&u&&h.jsx("button",{onClick:c=>{var d;c.stopPropagation(),(d=t.onInsertNode)==null||d.call(t,t.id)},onMouseEnter:()=>{s.current&&(clearTimeout(s.current),s.current=null),i(!0)},onMouseLeave:()=>{s.current=setTimeout(()=>{i(!1)},300)},className:"absolute -bottom-8 left-[calc(50%+16px)] z-50 text-white/60 hover:text-white hover:scale-110 transition-all",title:"Insert node after",children:h.jsx(Mt,{className:"w-5 h-5"})}),h.jsx(yr,{type:"target",position:K.Top,className:"!w-3 !h-3 !bg-accent-purple !border-2 !border-surface"}),h.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[h.jsx("div",{className:fe("p-1.5 rounded-lg",l?"bg-status-active/20":"bg-accent-purple/20"),children:l?h.jsx(xe.div,{animate:{rotate:360},transition:{duration:2,repeat:1/0,ease:"linear"},children:h.jsx(Iy,{className:"w-4 h-4 text-status-active"})}):h.jsx(Iy,{className:fe("w-4 h-4",t.status==="completed"?"text-status-completed":"text-accent-purple")})}),h.jsxs("div",{className:"flex-1",children:[h.jsx("h3",{className:"font-medium text-sm text-text-primary",children:t.title}),h.jsx("p",{className:"text-[10px] text-text-muted",children:"Choose a path"})]})]}),t.branches&&h.jsx("div",{className:"space-y-2",children:t.branches.map(c=>h.jsxs("div",{className:fe("px-3 py-2 rounded-lg border transition-all cursor-pointer",{"border-accent-green bg-accent-green/10":t.selectedBranchId===c.id,"border-border hover:border-border-subtle bg-surface/50":t.selectedBranchId!==c.id}),children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-text-primary",children:c.label}),t.selectedBranchId===c.id&&h.jsx(BM,{className:"w-3 h-3 text-accent-green"})]}),c.description&&h.jsx("p",{className:"text-[10px] text-text-muted mt-1 line-clamp-2",children:c.description})]},c.id))}),!t.selectedBranchId&&t.branches&&t.branches.length>0&&h.jsx("div",{className:"mt-3 pt-2 border-t border-border",children:h.jsx("span",{className:"text-[10px] text-accent-yellow",children:"Selection required"})}),h.jsx(yr,{type:"source",position:K.Bottom,className:"!w-3 !h-3 !bg-accent-purple !border-2 !border-surface"})]})});function hH({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:s,style:o={},markerEnd:a,data:l,source:u}){const[c,d]=T.useState(!1),{plan:f,setPendingInsert:p}=Ae(),m=l||{},[v,w,g]=Ql({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:s}),x=(f==null?void 0:f.status)==="ready"&&!m.isDisabledEdge,y=T.useCallback(b=>{b.stopPropagation(),x&&u&&p(u)},[x,u,p]);return h.jsxs(h.Fragment,{children:[h.jsx(Zo,{path:v,markerEnd:a,style:o,interactionWidth:20,className:m.isActiveEdge?"edge-active-pulse":""}),h.jsx("path",{d:v,fill:"none",stroke:"transparent",strokeWidth:30,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),style:{cursor:x?"pointer":"default"}}),h.jsx(jV,{children:h.jsx(Dn,{children:c&&x&&h.jsx(xe.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.15},style:{position:"absolute",transform:`translate(-50%, -50%) translate(${w}px,${g}px)`,pointerEvents:"all"},className:"nodrag nopan",children:h.jsx("button",{onClick:y,className:`w-7 h-7 rounded-full bg-accent-blue text-white
351
+ flex items-center justify-center shadow-lg
352
+ hover:bg-accent-blue/90 hover:scale-110
353
+ transition-all duration-150 border-2 border-canvas`,title:"Insert node here",children:h.jsx(Mt,{className:"w-4 h-4"})})})})})]})}function R0(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var hd,zb;function pH(){if(zb)return hd;zb=1;function e(){this.__data__=[],this.size=0}return hd=e,hd}var pd,Bb;function cs(){if(Bb)return pd;Bb=1;function e(t,n){return t===n||t!==t&&n!==n}return pd=e,pd}var md,Hb;function Yu(){if(Hb)return md;Hb=1;var e=cs();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return md=t,md}var gd,Ub;function mH(){if(Ub)return gd;Ub=1;var e=Yu(),t=Array.prototype,n=t.splice;function r(i){var s=this.__data__,o=e(s,i);if(o<0)return!1;var a=s.length-1;return o==a?s.pop():n.call(s,o,1),--this.size,!0}return gd=r,gd}var yd,Wb;function gH(){if(Wb)return yd;Wb=1;var e=Yu();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return yd=t,yd}var vd,Gb;function yH(){if(Gb)return vd;Gb=1;var e=Yu();function t(n){return e(this.__data__,n)>-1}return vd=t,vd}var xd,Yb;function vH(){if(Yb)return xd;Yb=1;var e=Yu();function t(n,r){var i=this.__data__,s=e(i,n);return s<0?(++this.size,i.push([n,r])):i[s][1]=r,this}return xd=t,xd}var wd,Kb;function Ku(){if(Kb)return wd;Kb=1;var e=pH(),t=mH(),n=gH(),r=yH(),i=vH();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var u=o[a];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=i,wd=s,wd}var bd,Xb;function xH(){if(Xb)return bd;Xb=1;var e=Ku();function t(){this.__data__=new e,this.size=0}return bd=t,bd}var _d,Qb;function wH(){if(Qb)return _d;Qb=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return _d=e,_d}var Sd,Zb;function bH(){if(Zb)return Sd;Zb=1;function e(t){return this.__data__.get(t)}return Sd=e,Sd}var Nd,Jb;function _H(){if(Jb)return Nd;Jb=1;function e(t){return this.__data__.has(t)}return Nd=e,Nd}var Ed,e_;function QM(){if(e_)return Ed;e_=1;var e=typeof ma=="object"&&ma&&ma.Object===Object&&ma;return Ed=e,Ed}var Cd,t_;function Kt(){if(t_)return Cd;t_=1;var e=QM(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Cd=n,Cd}var kd,n_;function ds(){if(n_)return kd;n_=1;var e=Kt(),t=e.Symbol;return kd=t,kd}var Pd,r_;function SH(){if(r_)return Pd;r_=1;var e=ds(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function s(o){var a=n.call(o,i),l=o[i];try{o[i]=void 0;var u=!0}catch{}var c=r.call(o);return u&&(a?o[i]=l:delete o[i]),c}return Pd=s,Pd}var jd,i_;function NH(){if(i_)return jd;i_=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return jd=n,jd}var Td,s_;function si(){if(s_)return Td;s_=1;var e=ds(),t=SH(),n=NH(),r="[object Null]",i="[object Undefined]",s=e?e.toStringTag:void 0;function o(a){return a==null?a===void 0?i:r:s&&s in Object(a)?t(a):n(a)}return Td=o,Td}var Md,o_;function Rt(){if(o_)return Md;o_=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Md=e,Md}var Ad,a_;function oa(){if(a_)return Ad;a_=1;var e=si(),t=Rt(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",s="[object Proxy]";function o(a){if(!t(a))return!1;var l=e(a);return l==r||l==i||l==n||l==s}return Ad=o,Ad}var Id,l_;function EH(){if(l_)return Id;l_=1;var e=Kt(),t=e["__core-js_shared__"];return Id=t,Id}var Rd,u_;function CH(){if(u_)return Rd;u_=1;var e=EH(),t=function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function n(r){return!!t&&t in r}return Rd=n,Rd}var Dd,c_;function ZM(){if(c_)return Dd;c_=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return Dd=n,Dd}var Od,d_;function kH(){if(d_)return Od;d_=1;var e=oa(),t=CH(),n=Rt(),r=ZM(),i=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,o=Function.prototype,a=Object.prototype,l=o.toString,u=a.hasOwnProperty,c=RegExp("^"+l.call(u).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function d(f){if(!n(f)||t(f))return!1;var p=e(f)?c:s;return p.test(r(f))}return Od=d,Od}var Ld,f_;function PH(){if(f_)return Ld;f_=1;function e(t,n){return t==null?void 0:t[n]}return Ld=e,Ld}var Fd,h_;function oi(){if(h_)return Fd;h_=1;var e=kH(),t=PH();function n(r,i){var s=t(r,i);return e(s)?s:void 0}return Fd=n,Fd}var qd,p_;function D0(){if(p_)return qd;p_=1;var e=oi(),t=Kt(),n=e(t,"Map");return qd=n,qd}var Vd,m_;function Xu(){if(m_)return Vd;m_=1;var e=oi(),t=e(Object,"create");return Vd=t,Vd}var $d,g_;function jH(){if(g_)return $d;g_=1;var e=Xu();function t(){this.__data__=e?e(null):{},this.size=0}return $d=t,$d}var zd,y_;function TH(){if(y_)return zd;y_=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return zd=e,zd}var Bd,v_;function MH(){if(v_)return Bd;v_=1;var e=Xu(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(s){var o=this.__data__;if(e){var a=o[s];return a===t?void 0:a}return r.call(o,s)?o[s]:void 0}return Bd=i,Bd}var Hd,x_;function AH(){if(x_)return Hd;x_=1;var e=Xu(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var s=this.__data__;return e?s[i]!==void 0:n.call(s,i)}return Hd=r,Hd}var Ud,w_;function IH(){if(w_)return Ud;w_=1;var e=Xu(),t="__lodash_hash_undefined__";function n(r,i){var s=this.__data__;return this.size+=this.has(r)?0:1,s[r]=e&&i===void 0?t:i,this}return Ud=n,Ud}var Wd,b_;function RH(){if(b_)return Wd;b_=1;var e=jH(),t=TH(),n=MH(),r=AH(),i=IH();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var u=o[a];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=i,Wd=s,Wd}var Gd,__;function DH(){if(__)return Gd;__=1;var e=RH(),t=Ku(),n=D0();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Gd=r,Gd}var Yd,S_;function OH(){if(S_)return Yd;S_=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return Yd=e,Yd}var Kd,N_;function Qu(){if(N_)return Kd;N_=1;var e=OH();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Kd=t,Kd}var Xd,E_;function LH(){if(E_)return Xd;E_=1;var e=Qu();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Xd=t,Xd}var Qd,C_;function FH(){if(C_)return Qd;C_=1;var e=Qu();function t(n){return e(this,n).get(n)}return Qd=t,Qd}var Zd,k_;function qH(){if(k_)return Zd;k_=1;var e=Qu();function t(n){return e(this,n).has(n)}return Zd=t,Zd}var Jd,P_;function VH(){if(P_)return Jd;P_=1;var e=Qu();function t(n,r){var i=e(this,n),s=i.size;return i.set(n,r),this.size+=i.size==s?0:1,this}return Jd=t,Jd}var ef,j_;function O0(){if(j_)return ef;j_=1;var e=DH(),t=LH(),n=FH(),r=qH(),i=VH();function s(o){var a=-1,l=o==null?0:o.length;for(this.clear();++a<l;){var u=o[a];this.set(u[0],u[1])}}return s.prototype.clear=e,s.prototype.delete=t,s.prototype.get=n,s.prototype.has=r,s.prototype.set=i,ef=s,ef}var tf,T_;function $H(){if(T_)return tf;T_=1;var e=Ku(),t=D0(),n=O0(),r=200;function i(s,o){var a=this.__data__;if(a instanceof e){var l=a.__data__;if(!t||l.length<r-1)return l.push([s,o]),this.size=++a.size,this;a=this.__data__=new n(l)}return a.set(s,o),this.size=a.size,this}return tf=i,tf}var nf,M_;function Zu(){if(M_)return nf;M_=1;var e=Ku(),t=xH(),n=wH(),r=bH(),i=_H(),s=$H();function o(a){var l=this.__data__=new e(a);this.size=l.size}return o.prototype.clear=t,o.prototype.delete=n,o.prototype.get=r,o.prototype.has=i,o.prototype.set=s,nf=o,nf}var rf,A_;function L0(){if(A_)return rf;A_=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i&&n(t[r],r,t)!==!1;);return t}return rf=e,rf}var sf,I_;function JM(){if(I_)return sf;I_=1;var e=oi(),t=function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}}();return sf=t,sf}var of,R_;function Ju(){if(R_)return of;R_=1;var e=JM();function t(n,r,i){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:i,writable:!0}):n[r]=i}return of=t,of}var af,D_;function ec(){if(D_)return af;D_=1;var e=Ju(),t=cs(),n=Object.prototype,r=n.hasOwnProperty;function i(s,o,a){var l=s[o];(!(r.call(s,o)&&t(l,a))||a===void 0&&!(o in s))&&e(s,o,a)}return af=i,af}var lf,O_;function aa(){if(O_)return lf;O_=1;var e=ec(),t=Ju();function n(r,i,s,o){var a=!s;s||(s={});for(var l=-1,u=i.length;++l<u;){var c=i[l],d=o?o(s[c],r[c],c,s,r):void 0;d===void 0&&(d=r[c]),a?t(s,c,d):e(s,c,d)}return s}return lf=n,lf}var uf,L_;function zH(){if(L_)return uf;L_=1;function e(t,n){for(var r=-1,i=Array(t);++r<t;)i[r]=n(r);return i}return uf=e,uf}var cf,F_;function fn(){if(F_)return cf;F_=1;function e(t){return t!=null&&typeof t=="object"}return cf=e,cf}var df,q_;function BH(){if(q_)return df;q_=1;var e=si(),t=fn(),n="[object Arguments]";function r(i){return t(i)&&e(i)==n}return df=r,df}var ff,V_;function la(){if(V_)return ff;V_=1;var e=BH(),t=fn(),n=Object.prototype,r=n.hasOwnProperty,i=n.propertyIsEnumerable,s=e(function(){return arguments}())?e:function(o){return t(o)&&r.call(o,"callee")&&!i.call(o,"callee")};return ff=s,ff}var hf,$_;function Le(){if($_)return hf;$_=1;var e=Array.isArray;return hf=e,hf}var Fs={exports:{}},pf,z_;function HH(){if(z_)return pf;z_=1;function e(){return!1}return pf=e,pf}Fs.exports;var B_;function fs(){return B_||(B_=1,function(e,t){var n=Kt(),r=HH(),i=t&&!t.nodeType&&t,s=i&&!0&&e&&!e.nodeType&&e,o=s&&s.exports===i,a=o?n.Buffer:void 0,l=a?a.isBuffer:void 0,u=l||r;e.exports=u}(Fs,Fs.exports)),Fs.exports}var mf,H_;function tc(){if(H_)return mf;H_=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(r,i){var s=typeof r;return i=i??e,!!i&&(s=="number"||s!="symbol"&&t.test(r))&&r>-1&&r%1==0&&r<i}return mf=n,mf}var gf,U_;function F0(){if(U_)return gf;U_=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return gf=t,gf}var yf,W_;function UH(){if(W_)return yf;W_=1;var e=si(),t=F0(),n=fn(),r="[object Arguments]",i="[object Array]",s="[object Boolean]",o="[object Date]",a="[object Error]",l="[object Function]",u="[object Map]",c="[object Number]",d="[object Object]",f="[object RegExp]",p="[object Set]",m="[object String]",v="[object WeakMap]",w="[object ArrayBuffer]",g="[object DataView]",x="[object Float32Array]",y="[object Float64Array]",b="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",_="[object Uint8Array]",k="[object Uint8ClampedArray]",I="[object Uint16Array]",F="[object Uint32Array]",S={};S[x]=S[y]=S[b]=S[E]=S[C]=S[_]=S[k]=S[I]=S[F]=!0,S[r]=S[i]=S[w]=S[s]=S[g]=S[o]=S[a]=S[l]=S[u]=S[c]=S[d]=S[f]=S[p]=S[m]=S[v]=!1;function P(L){return n(L)&&t(L.length)&&!!S[e(L)]}return yf=P,yf}var vf,G_;function nc(){if(G_)return vf;G_=1;function e(t){return function(n){return t(n)}}return vf=e,vf}var qs={exports:{}};qs.exports;var Y_;function q0(){return Y_||(Y_=1,function(e,t){var n=QM(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,o=s&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=a}(qs,qs.exports)),qs.exports}var xf,K_;function ua(){if(K_)return xf;K_=1;var e=UH(),t=nc(),n=q0(),r=n&&n.isTypedArray,i=r?t(r):e;return xf=i,xf}var wf,X_;function eA(){if(X_)return wf;X_=1;var e=zH(),t=la(),n=Le(),r=fs(),i=tc(),s=ua(),o=Object.prototype,a=o.hasOwnProperty;function l(u,c){var d=n(u),f=!d&&t(u),p=!d&&!f&&r(u),m=!d&&!f&&!p&&s(u),v=d||f||p||m,w=v?e(u.length,String):[],g=w.length;for(var x in u)(c||a.call(u,x))&&!(v&&(x=="length"||p&&(x=="offset"||x=="parent")||m&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||i(x,g)))&&w.push(x);return w}return wf=l,wf}var bf,Q_;function rc(){if(Q_)return bf;Q_=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,i=typeof r=="function"&&r.prototype||e;return n===i}return bf=t,bf}var _f,Z_;function tA(){if(Z_)return _f;Z_=1;function e(t,n){return function(r){return t(n(r))}}return _f=e,_f}var Sf,J_;function WH(){if(J_)return Sf;J_=1;var e=tA(),t=e(Object.keys,Object);return Sf=t,Sf}var Nf,eS;function V0(){if(eS)return Nf;eS=1;var e=rc(),t=WH(),n=Object.prototype,r=n.hasOwnProperty;function i(s){if(!e(s))return t(s);var o=[];for(var a in Object(s))r.call(s,a)&&a!="constructor"&&o.push(a);return o}return Nf=i,Nf}var Ef,tS;function $n(){if(tS)return Ef;tS=1;var e=oa(),t=F0();function n(r){return r!=null&&t(r.length)&&!e(r)}return Ef=n,Ef}var Cf,nS;function Cr(){if(nS)return Cf;nS=1;var e=eA(),t=V0(),n=$n();function r(i){return n(i)?e(i):t(i)}return Cf=r,Cf}var kf,rS;function GH(){if(rS)return kf;rS=1;var e=aa(),t=Cr();function n(r,i){return r&&e(i,t(i),r)}return kf=n,kf}var Pf,iS;function YH(){if(iS)return Pf;iS=1;function e(t){var n=[];if(t!=null)for(var r in Object(t))n.push(r);return n}return Pf=e,Pf}var jf,sS;function KH(){if(sS)return jf;sS=1;var e=Rt(),t=rc(),n=YH(),r=Object.prototype,i=r.hasOwnProperty;function s(o){if(!e(o))return n(o);var a=t(o),l=[];for(var u in o)u=="constructor"&&(a||!i.call(o,u))||l.push(u);return l}return jf=s,jf}var Tf,oS;function ai(){if(oS)return Tf;oS=1;var e=eA(),t=KH(),n=$n();function r(i){return n(i)?e(i,!0):t(i)}return Tf=r,Tf}var Mf,aS;function XH(){if(aS)return Mf;aS=1;var e=aa(),t=ai();function n(r,i){return r&&e(i,t(i),r)}return Mf=n,Mf}var Vs={exports:{}};Vs.exports;var lS;function nA(){return lS||(lS=1,function(e,t){var n=Kt(),r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===r,o=s?n.Buffer:void 0,a=o?o.allocUnsafe:void 0;function l(u,c){if(c)return u.slice();var d=u.length,f=a?a(d):new u.constructor(d);return u.copy(f),f}e.exports=l}(Vs,Vs.exports)),Vs.exports}var Af,uS;function rA(){if(uS)return Af;uS=1;function e(t,n){var r=-1,i=t.length;for(n||(n=Array(i));++r<i;)n[r]=t[r];return n}return Af=e,Af}var If,cS;function iA(){if(cS)return If;cS=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,s=0,o=[];++r<i;){var a=t[r];n(a,r,t)&&(o[s++]=a)}return o}return If=e,If}var Rf,dS;function sA(){if(dS)return Rf;dS=1;function e(){return[]}return Rf=e,Rf}var Df,fS;function $0(){if(fS)return Df;fS=1;var e=iA(),t=sA(),n=Object.prototype,r=n.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(o){return o==null?[]:(o=Object(o),e(i(o),function(a){return r.call(o,a)}))}:t;return Df=s,Df}var Of,hS;function QH(){if(hS)return Of;hS=1;var e=aa(),t=$0();function n(r,i){return e(r,t(r),i)}return Of=n,Of}var Lf,pS;function z0(){if(pS)return Lf;pS=1;function e(t,n){for(var r=-1,i=n.length,s=t.length;++r<i;)t[s+r]=n[r];return t}return Lf=e,Lf}var Ff,mS;function ic(){if(mS)return Ff;mS=1;var e=tA(),t=e(Object.getPrototypeOf,Object);return Ff=t,Ff}var qf,gS;function oA(){if(gS)return qf;gS=1;var e=z0(),t=ic(),n=$0(),r=sA(),i=Object.getOwnPropertySymbols,s=i?function(o){for(var a=[];o;)e(a,n(o)),o=t(o);return a}:r;return qf=s,qf}var Vf,yS;function ZH(){if(yS)return Vf;yS=1;var e=aa(),t=oA();function n(r,i){return e(r,t(r),i)}return Vf=n,Vf}var $f,vS;function aA(){if(vS)return $f;vS=1;var e=z0(),t=Le();function n(r,i,s){var o=i(r);return t(r)?o:e(o,s(r))}return $f=n,$f}var zf,xS;function lA(){if(xS)return zf;xS=1;var e=aA(),t=$0(),n=Cr();function r(i){return e(i,n,t)}return zf=r,zf}var Bf,wS;function JH(){if(wS)return Bf;wS=1;var e=aA(),t=oA(),n=ai();function r(i){return e(i,n,t)}return Bf=r,Bf}var Hf,bS;function e9(){if(bS)return Hf;bS=1;var e=oi(),t=Kt(),n=e(t,"DataView");return Hf=n,Hf}var Uf,_S;function t9(){if(_S)return Uf;_S=1;var e=oi(),t=Kt(),n=e(t,"Promise");return Uf=n,Uf}var Wf,SS;function uA(){if(SS)return Wf;SS=1;var e=oi(),t=Kt(),n=e(t,"Set");return Wf=n,Wf}var Gf,NS;function n9(){if(NS)return Gf;NS=1;var e=oi(),t=Kt(),n=e(t,"WeakMap");return Gf=n,Gf}var Yf,ES;function hs(){if(ES)return Yf;ES=1;var e=e9(),t=D0(),n=t9(),r=uA(),i=n9(),s=si(),o=ZM(),a="[object Map]",l="[object Object]",u="[object Promise]",c="[object Set]",d="[object WeakMap]",f="[object DataView]",p=o(e),m=o(t),v=o(n),w=o(r),g=o(i),x=s;return(e&&x(new e(new ArrayBuffer(1)))!=f||t&&x(new t)!=a||n&&x(n.resolve())!=u||r&&x(new r)!=c||i&&x(new i)!=d)&&(x=function(y){var b=s(y),E=b==l?y.constructor:void 0,C=E?o(E):"";if(C)switch(C){case p:return f;case m:return a;case v:return u;case w:return c;case g:return d}return b}),Yf=x,Yf}var Kf,CS;function r9(){if(CS)return Kf;CS=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r){var i=r.length,s=new r.constructor(i);return i&&typeof r[0]=="string"&&t.call(r,"index")&&(s.index=r.index,s.input=r.input),s}return Kf=n,Kf}var Xf,kS;function cA(){if(kS)return Xf;kS=1;var e=Kt(),t=e.Uint8Array;return Xf=t,Xf}var Qf,PS;function B0(){if(PS)return Qf;PS=1;var e=cA();function t(n){var r=new n.constructor(n.byteLength);return new e(r).set(new e(n)),r}return Qf=t,Qf}var Zf,jS;function i9(){if(jS)return Zf;jS=1;var e=B0();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.byteLength)}return Zf=t,Zf}var Jf,TS;function s9(){if(TS)return Jf;TS=1;var e=/\w*$/;function t(n){var r=new n.constructor(n.source,e.exec(n));return r.lastIndex=n.lastIndex,r}return Jf=t,Jf}var eh,MS;function o9(){if(MS)return eh;MS=1;var e=ds(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function r(i){return n?Object(n.call(i)):{}}return eh=r,eh}var th,AS;function dA(){if(AS)return th;AS=1;var e=B0();function t(n,r){var i=r?e(n.buffer):n.buffer;return new n.constructor(i,n.byteOffset,n.length)}return th=t,th}var nh,IS;function a9(){if(IS)return nh;IS=1;var e=B0(),t=i9(),n=s9(),r=o9(),i=dA(),s="[object Boolean]",o="[object Date]",a="[object Map]",l="[object Number]",u="[object RegExp]",c="[object Set]",d="[object String]",f="[object Symbol]",p="[object ArrayBuffer]",m="[object DataView]",v="[object Float32Array]",w="[object Float64Array]",g="[object Int8Array]",x="[object Int16Array]",y="[object Int32Array]",b="[object Uint8Array]",E="[object Uint8ClampedArray]",C="[object Uint16Array]",_="[object Uint32Array]";function k(I,F,S){var P=I.constructor;switch(F){case p:return e(I);case s:case o:return new P(+I);case m:return t(I,S);case v:case w:case g:case x:case y:case b:case E:case C:case _:return i(I,S);case a:return new P;case l:case d:return new P(I);case u:return n(I);case c:return new P;case f:return r(I)}}return nh=k,nh}var rh,RS;function fA(){if(RS)return rh;RS=1;var e=Rt(),t=Object.create,n=function(){function r(){}return function(i){if(!e(i))return{};if(t)return t(i);r.prototype=i;var s=new r;return r.prototype=void 0,s}}();return rh=n,rh}var ih,DS;function hA(){if(DS)return ih;DS=1;var e=fA(),t=ic(),n=rc();function r(i){return typeof i.constructor=="function"&&!n(i)?e(t(i)):{}}return ih=r,ih}var sh,OS;function l9(){if(OS)return sh;OS=1;var e=hs(),t=fn(),n="[object Map]";function r(i){return t(i)&&e(i)==n}return sh=r,sh}var oh,LS;function u9(){if(LS)return oh;LS=1;var e=l9(),t=nc(),n=q0(),r=n&&n.isMap,i=r?t(r):e;return oh=i,oh}var ah,FS;function c9(){if(FS)return ah;FS=1;var e=hs(),t=fn(),n="[object Set]";function r(i){return t(i)&&e(i)==n}return ah=r,ah}var lh,qS;function d9(){if(qS)return lh;qS=1;var e=c9(),t=nc(),n=q0(),r=n&&n.isSet,i=r?t(r):e;return lh=i,lh}var uh,VS;function pA(){if(VS)return uh;VS=1;var e=Zu(),t=L0(),n=ec(),r=GH(),i=XH(),s=nA(),o=rA(),a=QH(),l=ZH(),u=lA(),c=JH(),d=hs(),f=r9(),p=a9(),m=hA(),v=Le(),w=fs(),g=u9(),x=Rt(),y=d9(),b=Cr(),E=ai(),C=1,_=2,k=4,I="[object Arguments]",F="[object Array]",S="[object Boolean]",P="[object Date]",L="[object Error]",N="[object Function]",A="[object GeneratorFunction]",R="[object Map]",O="[object Number]",j="[object Object]",M="[object RegExp]",q="[object Set]",$="[object String]",D="[object Symbol]",z="[object WeakMap]",V="[object ArrayBuffer]",U="[object DataView]",W="[object Float32Array]",Y="[object Float64Array]",H="[object Int8Array]",X="[object Int16Array]",se="[object Int32Array]",re="[object Uint8Array]",ee="[object Uint8ClampedArray]",Z="[object Uint16Array]",ce="[object Uint32Array]",J={};J[I]=J[F]=J[V]=J[U]=J[S]=J[P]=J[W]=J[Y]=J[H]=J[X]=J[se]=J[R]=J[O]=J[j]=J[M]=J[q]=J[$]=J[D]=J[re]=J[ee]=J[Z]=J[ce]=!0,J[L]=J[N]=J[z]=!1;function ae(ne,tt,Ye,hn,Qt,ot){var Re,Bn=tt&C,pn=tt&_,Hn=tt&k;if(Ye&&(Re=Qt?Ye(ne,hn,Qt,ot):Ye(ne)),Re!==void 0)return Re;if(!x(ne))return ne;var Un=v(ne);if(Un){if(Re=f(ne),!Bn)return o(ne,Re)}else{var mn=d(ne),fa=mn==N||mn==A;if(w(ne))return s(ne,Bn);if(mn==j||mn==I||fa&&!Qt){if(Re=pn||fa?{}:m(ne),!Bn)return pn?l(ne,i(Re,ne)):a(ne,r(Re,ne))}else{if(!J[mn])return Qt?ne:{};Re=p(ne,mn,Bn)}}ot||(ot=new e);var ci=ot.get(ne);if(ci)return ci;ot.set(ne,Re),y(ne)?ne.forEach(function(Zt){Re.add(ae(Zt,tt,Ye,Zt,ne,ot))}):g(ne)&&ne.forEach(function(Zt,gn){Re.set(gn,ae(Zt,tt,Ye,gn,ne,ot))});var pc=Hn?pn?c:u:pn?E:b,ha=Un?void 0:pc(ne);return t(ha||ne,function(Zt,gn){ha&&(gn=Zt,Zt=ne[gn]),n(Re,gn,ae(Zt,tt,Ye,gn,ne,ot))}),Re}return uh=ae,uh}var ch,$S;function f9(){if($S)return ch;$S=1;var e=pA(),t=4;function n(r){return e(r,t)}return ch=n,ch}var dh,zS;function H0(){if(zS)return dh;zS=1;function e(t){return function(){return t}}return dh=e,dh}var fh,BS;function h9(){if(BS)return fh;BS=1;function e(t){return function(n,r,i){for(var s=-1,o=Object(n),a=i(n),l=a.length;l--;){var u=a[t?l:++s];if(r(o[u],u,o)===!1)break}return n}}return fh=e,fh}var hh,HS;function U0(){if(HS)return hh;HS=1;var e=h9(),t=e();return hh=t,hh}var ph,US;function W0(){if(US)return ph;US=1;var e=U0(),t=Cr();function n(r,i){return r&&e(r,i,t)}return ph=n,ph}var mh,WS;function p9(){if(WS)return mh;WS=1;var e=$n();function t(n,r){return function(i,s){if(i==null)return i;if(!e(i))return n(i,s);for(var o=i.length,a=r?o:-1,l=Object(i);(r?a--:++a<o)&&s(l[a],a,l)!==!1;);return i}}return mh=t,mh}var gh,GS;function sc(){if(GS)return gh;GS=1;var e=W0(),t=p9(),n=t(e);return gh=n,gh}var yh,YS;function li(){if(YS)return yh;YS=1;function e(t){return t}return yh=e,yh}var vh,KS;function mA(){if(KS)return vh;KS=1;var e=li();function t(n){return typeof n=="function"?n:e}return vh=t,vh}var xh,XS;function gA(){if(XS)return xh;XS=1;var e=L0(),t=sc(),n=mA(),r=Le();function i(s,o){var a=r(s)?e:t;return a(s,n(o))}return xh=i,xh}var wh,QS;function yA(){return QS||(QS=1,wh=gA()),wh}var bh,ZS;function m9(){if(ZS)return bh;ZS=1;var e=sc();function t(n,r){var i=[];return e(n,function(s,o,a){r(s,o,a)&&i.push(s)}),i}return bh=t,bh}var _h,JS;function g9(){if(JS)return _h;JS=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return _h=t,_h}var Sh,e2;function y9(){if(e2)return Sh;e2=1;function e(t){return this.__data__.has(t)}return Sh=e,Sh}var Nh,t2;function vA(){if(t2)return Nh;t2=1;var e=O0(),t=g9(),n=y9();function r(i){var s=-1,o=i==null?0:i.length;for(this.__data__=new e;++s<o;)this.add(i[s])}return r.prototype.add=r.prototype.push=t,r.prototype.has=n,Nh=r,Nh}var Eh,n2;function v9(){if(n2)return Eh;n2=1;function e(t,n){for(var r=-1,i=t==null?0:t.length;++r<i;)if(n(t[r],r,t))return!0;return!1}return Eh=e,Eh}var Ch,r2;function xA(){if(r2)return Ch;r2=1;function e(t,n){return t.has(n)}return Ch=e,Ch}var kh,i2;function wA(){if(i2)return kh;i2=1;var e=vA(),t=v9(),n=xA(),r=1,i=2;function s(o,a,l,u,c,d){var f=l&r,p=o.length,m=a.length;if(p!=m&&!(f&&m>p))return!1;var v=d.get(o),w=d.get(a);if(v&&w)return v==a&&w==o;var g=-1,x=!0,y=l&i?new e:void 0;for(d.set(o,a),d.set(a,o);++g<p;){var b=o[g],E=a[g];if(u)var C=f?u(E,b,g,a,o,d):u(b,E,g,o,a,d);if(C!==void 0){if(C)continue;x=!1;break}if(y){if(!t(a,function(_,k){if(!n(y,k)&&(b===_||c(b,_,l,u,d)))return y.push(k)})){x=!1;break}}else if(!(b===E||c(b,E,l,u,d))){x=!1;break}}return d.delete(o),d.delete(a),x}return kh=s,kh}var Ph,s2;function x9(){if(s2)return Ph;s2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i,s){r[++n]=[s,i]}),r}return Ph=e,Ph}var jh,o2;function G0(){if(o2)return jh;o2=1;function e(t){var n=-1,r=Array(t.size);return t.forEach(function(i){r[++n]=i}),r}return jh=e,jh}var Th,a2;function w9(){if(a2)return Th;a2=1;var e=ds(),t=cA(),n=cs(),r=wA(),i=x9(),s=G0(),o=1,a=2,l="[object Boolean]",u="[object Date]",c="[object Error]",d="[object Map]",f="[object Number]",p="[object RegExp]",m="[object Set]",v="[object String]",w="[object Symbol]",g="[object ArrayBuffer]",x="[object DataView]",y=e?e.prototype:void 0,b=y?y.valueOf:void 0;function E(C,_,k,I,F,S,P){switch(k){case x:if(C.byteLength!=_.byteLength||C.byteOffset!=_.byteOffset)return!1;C=C.buffer,_=_.buffer;case g:return!(C.byteLength!=_.byteLength||!S(new t(C),new t(_)));case l:case u:case f:return n(+C,+_);case c:return C.name==_.name&&C.message==_.message;case p:case v:return C==_+"";case d:var L=i;case m:var N=I&o;if(L||(L=s),C.size!=_.size&&!N)return!1;var A=P.get(C);if(A)return A==_;I|=a,P.set(C,_);var R=r(L(C),L(_),I,F,S,P);return P.delete(C),R;case w:if(b)return b.call(C)==b.call(_)}return!1}return Th=E,Th}var Mh,l2;function b9(){if(l2)return Mh;l2=1;var e=lA(),t=1,n=Object.prototype,r=n.hasOwnProperty;function i(s,o,a,l,u,c){var d=a&t,f=e(s),p=f.length,m=e(o),v=m.length;if(p!=v&&!d)return!1;for(var w=p;w--;){var g=f[w];if(!(d?g in o:r.call(o,g)))return!1}var x=c.get(s),y=c.get(o);if(x&&y)return x==o&&y==s;var b=!0;c.set(s,o),c.set(o,s);for(var E=d;++w<p;){g=f[w];var C=s[g],_=o[g];if(l)var k=d?l(_,C,g,o,s,c):l(C,_,g,s,o,c);if(!(k===void 0?C===_||u(C,_,a,l,c):k)){b=!1;break}E||(E=g=="constructor")}if(b&&!E){var I=s.constructor,F=o.constructor;I!=F&&"constructor"in s&&"constructor"in o&&!(typeof I=="function"&&I instanceof I&&typeof F=="function"&&F instanceof F)&&(b=!1)}return c.delete(s),c.delete(o),b}return Mh=i,Mh}var Ah,u2;function _9(){if(u2)return Ah;u2=1;var e=Zu(),t=wA(),n=w9(),r=b9(),i=hs(),s=Le(),o=fs(),a=ua(),l=1,u="[object Arguments]",c="[object Array]",d="[object Object]",f=Object.prototype,p=f.hasOwnProperty;function m(v,w,g,x,y,b){var E=s(v),C=s(w),_=E?c:i(v),k=C?c:i(w);_=_==u?d:_,k=k==u?d:k;var I=_==d,F=k==d,S=_==k;if(S&&o(v)){if(!o(w))return!1;E=!0,I=!1}if(S&&!I)return b||(b=new e),E||a(v)?t(v,w,g,x,y,b):n(v,w,_,g,x,y,b);if(!(g&l)){var P=I&&p.call(v,"__wrapped__"),L=F&&p.call(w,"__wrapped__");if(P||L){var N=P?v.value():v,A=L?w.value():w;return b||(b=new e),y(N,A,g,x,b)}}return S?(b||(b=new e),r(v,w,g,x,y,b)):!1}return Ah=m,Ah}var Ih,c2;function bA(){if(c2)return Ih;c2=1;var e=_9(),t=fn();function n(r,i,s,o,a){return r===i?!0:r==null||i==null||!t(r)&&!t(i)?r!==r&&i!==i:e(r,i,s,o,n,a)}return Ih=n,Ih}var Rh,d2;function S9(){if(d2)return Rh;d2=1;var e=Zu(),t=bA(),n=1,r=2;function i(s,o,a,l){var u=a.length,c=u,d=!l;if(s==null)return!c;for(s=Object(s);u--;){var f=a[u];if(d&&f[2]?f[1]!==s[f[0]]:!(f[0]in s))return!1}for(;++u<c;){f=a[u];var p=f[0],m=s[p],v=f[1];if(d&&f[2]){if(m===void 0&&!(p in s))return!1}else{var w=new e;if(l)var g=l(m,v,p,s,o,w);if(!(g===void 0?t(v,m,n|r,l,w):g))return!1}}return!0}return Rh=i,Rh}var Dh,f2;function _A(){if(f2)return Dh;f2=1;var e=Rt();function t(n){return n===n&&!e(n)}return Dh=t,Dh}var Oh,h2;function N9(){if(h2)return Oh;h2=1;var e=_A(),t=Cr();function n(r){for(var i=t(r),s=i.length;s--;){var o=i[s],a=r[o];i[s]=[o,a,e(a)]}return i}return Oh=n,Oh}var Lh,p2;function SA(){if(p2)return Lh;p2=1;function e(t,n){return function(r){return r==null?!1:r[t]===n&&(n!==void 0||t in Object(r))}}return Lh=e,Lh}var Fh,m2;function E9(){if(m2)return Fh;m2=1;var e=S9(),t=N9(),n=SA();function r(i){var s=t(i);return s.length==1&&s[0][2]?n(s[0][0],s[0][1]):function(o){return o===i||e(o,i,s)}}return Fh=r,Fh}var qh,g2;function ps(){if(g2)return qh;g2=1;var e=si(),t=fn(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return qh=r,qh}var Vh,y2;function Y0(){if(y2)return Vh;y2=1;var e=Le(),t=ps(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(s,o){if(e(s))return!1;var a=typeof s;return a=="number"||a=="symbol"||a=="boolean"||s==null||t(s)?!0:r.test(s)||!n.test(s)||o!=null&&s in Object(o)}return Vh=i,Vh}var $h,v2;function C9(){if(v2)return $h;v2=1;var e=O0(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var s=function(){var o=arguments,a=i?i.apply(this,o):o[0],l=s.cache;if(l.has(a))return l.get(a);var u=r.apply(this,o);return s.cache=l.set(a,u)||l,u};return s.cache=new(n.Cache||e),s}return n.Cache=e,$h=n,$h}var zh,x2;function k9(){if(x2)return zh;x2=1;var e=C9(),t=500;function n(r){var i=e(r,function(o){return s.size===t&&s.clear(),o}),s=i.cache;return i}return zh=n,zh}var Bh,w2;function P9(){if(w2)return Bh;w2=1;var e=k9(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(t,function(o,a,l,u){s.push(l?u.replace(n,"$1"):a||o)}),s});return Bh=r,Bh}var Hh,b2;function oc(){if(b2)return Hh;b2=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,s=Array(i);++r<i;)s[r]=n(t[r],r,t);return s}return Hh=e,Hh}var Uh,_2;function j9(){if(_2)return Uh;_2=1;var e=ds(),t=oc(),n=Le(),r=ps(),i=e?e.prototype:void 0,s=i?i.toString:void 0;function o(a){if(typeof a=="string")return a;if(n(a))return t(a,o)+"";if(r(a))return s?s.call(a):"";var l=a+"";return l=="0"&&1/a==-1/0?"-0":l}return Uh=o,Uh}var Wh,S2;function NA(){if(S2)return Wh;S2=1;var e=j9();function t(n){return n==null?"":e(n)}return Wh=t,Wh}var Gh,N2;function ac(){if(N2)return Gh;N2=1;var e=Le(),t=Y0(),n=P9(),r=NA();function i(s,o){return e(s)?s:t(s,o)?[s]:n(r(s))}return Gh=i,Gh}var Yh,E2;function ca(){if(E2)return Yh;E2=1;var e=ps();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Yh=t,Yh}var Kh,C2;function lc(){if(C2)return Kh;C2=1;var e=ac(),t=ca();function n(r,i){i=e(i,r);for(var s=0,o=i.length;r!=null&&s<o;)r=r[t(i[s++])];return s&&s==o?r:void 0}return Kh=n,Kh}var Xh,k2;function T9(){if(k2)return Xh;k2=1;var e=lc();function t(n,r,i){var s=n==null?void 0:e(n,r);return s===void 0?i:s}return Xh=t,Xh}var Qh,P2;function M9(){if(P2)return Qh;P2=1;function e(t,n){return t!=null&&n in Object(t)}return Qh=e,Qh}var Zh,j2;function EA(){if(j2)return Zh;j2=1;var e=ac(),t=la(),n=Le(),r=tc(),i=F0(),s=ca();function o(a,l,u){l=e(l,a);for(var c=-1,d=l.length,f=!1;++c<d;){var p=s(l[c]);if(!(f=a!=null&&u(a,p)))break;a=a[p]}return f||++c!=d?f:(d=a==null?0:a.length,!!d&&i(d)&&r(p,d)&&(n(a)||t(a)))}return Zh=o,Zh}var Jh,T2;function CA(){if(T2)return Jh;T2=1;var e=M9(),t=EA();function n(r,i){return r!=null&&t(r,i,e)}return Jh=n,Jh}var ep,M2;function A9(){if(M2)return ep;M2=1;var e=bA(),t=T9(),n=CA(),r=Y0(),i=_A(),s=SA(),o=ca(),a=1,l=2;function u(c,d){return r(c)&&i(d)?s(o(c),d):function(f){var p=t(f,c);return p===void 0&&p===d?n(f,c):e(d,p,a|l)}}return ep=u,ep}var tp,A2;function kA(){if(A2)return tp;A2=1;function e(t){return function(n){return n==null?void 0:n[t]}}return tp=e,tp}var np,I2;function I9(){if(I2)return np;I2=1;var e=lc();function t(n){return function(r){return e(r,n)}}return np=t,np}var rp,R2;function R9(){if(R2)return rp;R2=1;var e=kA(),t=I9(),n=Y0(),r=ca();function i(s){return n(s)?e(r(s)):t(s)}return rp=i,rp}var ip,D2;function zn(){if(D2)return ip;D2=1;var e=E9(),t=A9(),n=li(),r=Le(),i=R9();function s(o){return typeof o=="function"?o:o==null?n:typeof o=="object"?r(o)?t(o[0],o[1]):e(o):i(o)}return ip=s,ip}var sp,O2;function PA(){if(O2)return sp;O2=1;var e=iA(),t=m9(),n=zn(),r=Le();function i(s,o){var a=r(s)?e:t;return a(s,n(o,3))}return sp=i,sp}var op,L2;function D9(){if(L2)return op;L2=1;var e=Object.prototype,t=e.hasOwnProperty;function n(r,i){return r!=null&&t.call(r,i)}return op=n,op}var ap,F2;function jA(){if(F2)return ap;F2=1;var e=D9(),t=EA();function n(r,i){return r!=null&&t(r,i,e)}return ap=n,ap}var lp,q2;function O9(){if(q2)return lp;q2=1;var e=V0(),t=hs(),n=la(),r=Le(),i=$n(),s=fs(),o=rc(),a=ua(),l="[object Map]",u="[object Set]",c=Object.prototype,d=c.hasOwnProperty;function f(p){if(p==null)return!0;if(i(p)&&(r(p)||typeof p=="string"||typeof p.splice=="function"||s(p)||a(p)||n(p)))return!p.length;var m=t(p);if(m==l||m==u)return!p.size;if(o(p))return!e(p).length;for(var v in p)if(d.call(p,v))return!1;return!0}return lp=f,lp}var up,V2;function TA(){if(V2)return up;V2=1;function e(t){return t===void 0}return up=e,up}var cp,$2;function MA(){if($2)return cp;$2=1;var e=sc(),t=$n();function n(r,i){var s=-1,o=t(r)?Array(r.length):[];return e(r,function(a,l,u){o[++s]=i(a,l,u)}),o}return cp=n,cp}var dp,z2;function AA(){if(z2)return dp;z2=1;var e=oc(),t=zn(),n=MA(),r=Le();function i(s,o){var a=r(s)?e:n;return a(s,t(o,3))}return dp=i,dp}var fp,B2;function L9(){if(B2)return fp;B2=1;function e(t,n,r,i){var s=-1,o=t==null?0:t.length;for(i&&o&&(r=t[++s]);++s<o;)r=n(r,t[s],s,t);return r}return fp=e,fp}var hp,H2;function F9(){if(H2)return hp;H2=1;function e(t,n,r,i,s){return s(t,function(o,a,l){r=i?(i=!1,o):n(r,o,a,l)}),r}return hp=e,hp}var pp,U2;function IA(){if(U2)return pp;U2=1;var e=L9(),t=sc(),n=zn(),r=F9(),i=Le();function s(o,a,l){var u=i(o)?e:r,c=arguments.length<3;return u(o,n(a,4),l,c,t)}return pp=s,pp}var mp,W2;function q9(){if(W2)return mp;W2=1;var e=si(),t=Le(),n=fn(),r="[object String]";function i(s){return typeof s=="string"||!t(s)&&n(s)&&e(s)==r}return mp=i,mp}var gp,G2;function V9(){if(G2)return gp;G2=1;var e=kA(),t=e("length");return gp=t,gp}var yp,Y2;function $9(){if(Y2)return yp;Y2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",o="\\u200d",a=RegExp("["+o+e+i+s+"]");function l(u){return a.test(u)}return yp=l,yp}var vp,K2;function z9(){if(K2)return vp;K2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",i=t+n+r,s="\\ufe0e\\ufe0f",o="["+e+"]",a="["+i+"]",l="\\ud83c[\\udffb-\\udfff]",u="(?:"+a+"|"+l+")",c="[^"+e+"]",d="(?:\\ud83c[\\udde6-\\uddff]){2}",f="[\\ud800-\\udbff][\\udc00-\\udfff]",p="\\u200d",m=u+"?",v="["+s+"]?",w="(?:"+p+"(?:"+[c,d,f].join("|")+")"+v+m+")*",g=v+m+w,x="(?:"+[c+a+"?",a,d,f,o].join("|")+")",y=RegExp(l+"(?="+l+")|"+x+g,"g");function b(E){for(var C=y.lastIndex=0;y.test(E);)++C;return C}return vp=b,vp}var xp,X2;function B9(){if(X2)return xp;X2=1;var e=V9(),t=$9(),n=z9();function r(i){return t(i)?n(i):e(i)}return xp=r,xp}var wp,Q2;function H9(){if(Q2)return wp;Q2=1;var e=V0(),t=hs(),n=$n(),r=q9(),i=B9(),s="[object Map]",o="[object Set]";function a(l){if(l==null)return 0;if(n(l))return r(l)?i(l):l.length;var u=t(l);return u==s||u==o?l.size:e(l).length}return wp=a,wp}var bp,Z2;function U9(){if(Z2)return bp;Z2=1;var e=L0(),t=fA(),n=W0(),r=zn(),i=ic(),s=Le(),o=fs(),a=oa(),l=Rt(),u=ua();function c(d,f,p){var m=s(d),v=m||o(d)||u(d);if(f=r(f,4),p==null){var w=d&&d.constructor;v?p=m?new w:[]:l(d)?p=a(w)?t(i(d)):{}:p={}}return(v?e:n)(d,function(g,x,y){return f(p,g,x,y)}),p}return bp=c,bp}var _p,J2;function W9(){if(J2)return _p;J2=1;var e=ds(),t=la(),n=Le(),r=e?e.isConcatSpreadable:void 0;function i(s){return n(s)||t(s)||!!(r&&s&&s[r])}return _p=i,_p}var Sp,eN;function K0(){if(eN)return Sp;eN=1;var e=z0(),t=W9();function n(r,i,s,o,a){var l=-1,u=r.length;for(s||(s=t),a||(a=[]);++l<u;){var c=r[l];i>0&&s(c)?i>1?n(c,i-1,s,o,a):e(a,c):o||(a[a.length]=c)}return a}return Sp=n,Sp}var Np,tN;function G9(){if(tN)return Np;tN=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return Np=e,Np}var Ep,nN;function RA(){if(nN)return Ep;nN=1;var e=G9(),t=Math.max;function n(r,i,s){return i=t(i===void 0?r.length-1:i,0),function(){for(var o=arguments,a=-1,l=t(o.length-i,0),u=Array(l);++a<l;)u[a]=o[i+a];a=-1;for(var c=Array(i+1);++a<i;)c[a]=o[a];return c[i]=s(u),e(r,this,c)}}return Ep=n,Ep}var Cp,rN;function Y9(){if(rN)return Cp;rN=1;var e=H0(),t=JM(),n=li(),r=t?function(i,s){return t(i,"toString",{configurable:!0,enumerable:!1,value:e(s),writable:!0})}:n;return Cp=r,Cp}var kp,iN;function K9(){if(iN)return kp;iN=1;var e=800,t=16,n=Date.now;function r(i){var s=0,o=0;return function(){var a=n(),l=t-(a-o);if(o=a,l>0){if(++s>=e)return arguments[0]}else s=0;return i.apply(void 0,arguments)}}return kp=r,kp}var Pp,sN;function DA(){if(sN)return Pp;sN=1;var e=Y9(),t=K9(),n=t(e);return Pp=n,Pp}var jp,oN;function uc(){if(oN)return jp;oN=1;var e=li(),t=RA(),n=DA();function r(i,s){return n(t(i,s,e),i+"")}return jp=r,jp}var Tp,aN;function OA(){if(aN)return Tp;aN=1;function e(t,n,r,i){for(var s=t.length,o=r+(i?1:-1);i?o--:++o<s;)if(n(t[o],o,t))return o;return-1}return Tp=e,Tp}var Mp,lN;function X9(){if(lN)return Mp;lN=1;function e(t){return t!==t}return Mp=e,Mp}var Ap,uN;function Q9(){if(uN)return Ap;uN=1;function e(t,n,r){for(var i=r-1,s=t.length;++i<s;)if(t[i]===n)return i;return-1}return Ap=e,Ap}var Ip,cN;function Z9(){if(cN)return Ip;cN=1;var e=OA(),t=X9(),n=Q9();function r(i,s,o){return s===s?n(i,s,o):e(i,t,o)}return Ip=r,Ip}var Rp,dN;function J9(){if(dN)return Rp;dN=1;var e=Z9();function t(n,r){var i=n==null?0:n.length;return!!i&&e(n,r,0)>-1}return Rp=t,Rp}var Dp,fN;function eU(){if(fN)return Dp;fN=1;function e(t,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;)if(r(n,t[i]))return!0;return!1}return Dp=e,Dp}var Op,hN;function tU(){if(hN)return Op;hN=1;function e(){}return Op=e,Op}var Lp,pN;function nU(){if(pN)return Lp;pN=1;var e=uA(),t=tU(),n=G0(),r=1/0,i=e&&1/n(new e([,-0]))[1]==r?function(s){return new e(s)}:t;return Lp=i,Lp}var Fp,mN;function rU(){if(mN)return Fp;mN=1;var e=vA(),t=J9(),n=eU(),r=xA(),i=nU(),s=G0(),o=200;function a(l,u,c){var d=-1,f=t,p=l.length,m=!0,v=[],w=v;if(c)m=!1,f=n;else if(p>=o){var g=u?null:i(l);if(g)return s(g);m=!1,f=r,w=new e}else w=u?[]:v;e:for(;++d<p;){var x=l[d],y=u?u(x):x;if(x=c||x!==0?x:0,m&&y===y){for(var b=w.length;b--;)if(w[b]===y)continue e;u&&w.push(y),v.push(x)}else f(w,y,c)||(w!==v&&w.push(y),v.push(x))}return v}return Fp=a,Fp}var qp,gN;function LA(){if(gN)return qp;gN=1;var e=$n(),t=fn();function n(r){return t(r)&&e(r)}return qp=n,qp}var Vp,yN;function iU(){if(yN)return Vp;yN=1;var e=K0(),t=uc(),n=rU(),r=LA(),i=t(function(s){return n(e(s,1,r,!0))});return Vp=i,Vp}var $p,vN;function sU(){if(vN)return $p;vN=1;var e=oc();function t(n,r){return e(r,function(i){return n[i]})}return $p=t,$p}var zp,xN;function FA(){if(xN)return zp;xN=1;var e=sU(),t=Cr();function n(r){return r==null?[]:e(r,t(r))}return zp=n,zp}var Bp,wN;function Dt(){if(wN)return Bp;wN=1;var e;if(typeof R0=="function")try{e={clone:f9(),constant:H0(),each:yA(),filter:PA(),has:jA(),isArray:Le(),isEmpty:O9(),isFunction:oa(),isUndefined:TA(),keys:Cr(),map:AA(),reduce:IA(),size:H9(),transform:U9(),union:iU(),values:FA()}}catch{}return e||(e=window._),Bp=e,Bp}var Hp,bN;function X0(){if(bN)return Hp;bN=1;var e=Dt();Hp=i;var t="\0",n="\0",r="";function i(c){this._isDirected=e.has(c,"directed")?c.directed:!0,this._isMultigraph=e.has(c,"multigraph")?c.multigraph:!1,this._isCompound=e.has(c,"compound")?c.compound:!1,this._label=void 0,this._defaultNodeLabelFn=e.constant(void 0),this._defaultEdgeLabelFn=e.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[n]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}i.prototype._nodeCount=0,i.prototype._edgeCount=0,i.prototype.isDirected=function(){return this._isDirected},i.prototype.isMultigraph=function(){return this._isMultigraph},i.prototype.isCompound=function(){return this._isCompound},i.prototype.setGraph=function(c){return this._label=c,this},i.prototype.graph=function(){return this._label},i.prototype.setDefaultNodeLabel=function(c){return e.isFunction(c)||(c=e.constant(c)),this._defaultNodeLabelFn=c,this},i.prototype.nodeCount=function(){return this._nodeCount},i.prototype.nodes=function(){return e.keys(this._nodes)},i.prototype.sources=function(){var c=this;return e.filter(this.nodes(),function(d){return e.isEmpty(c._in[d])})},i.prototype.sinks=function(){var c=this;return e.filter(this.nodes(),function(d){return e.isEmpty(c._out[d])})},i.prototype.setNodes=function(c,d){var f=arguments,p=this;return e.each(c,function(m){f.length>1?p.setNode(m,d):p.setNode(m)}),this},i.prototype.setNode=function(c,d){return e.has(this._nodes,c)?(arguments.length>1&&(this._nodes[c]=d),this):(this._nodes[c]=arguments.length>1?d:this._defaultNodeLabelFn(c),this._isCompound&&(this._parent[c]=n,this._children[c]={},this._children[n][c]=!0),this._in[c]={},this._preds[c]={},this._out[c]={},this._sucs[c]={},++this._nodeCount,this)},i.prototype.node=function(c){return this._nodes[c]},i.prototype.hasNode=function(c){return e.has(this._nodes,c)},i.prototype.removeNode=function(c){var d=this;if(e.has(this._nodes,c)){var f=function(p){d.removeEdge(d._edgeObjs[p])};delete this._nodes[c],this._isCompound&&(this._removeFromParentsChildList(c),delete this._parent[c],e.each(this.children(c),function(p){d.setParent(p)}),delete this._children[c]),e.each(e.keys(this._in[c]),f),delete this._in[c],delete this._preds[c],e.each(e.keys(this._out[c]),f),delete this._out[c],delete this._sucs[c],--this._nodeCount}return this},i.prototype.setParent=function(c,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(e.isUndefined(d))d=n;else{d+="";for(var f=d;!e.isUndefined(f);f=this.parent(f))if(f===c)throw new Error("Setting "+d+" as parent of "+c+" would create a cycle");this.setNode(d)}return this.setNode(c),this._removeFromParentsChildList(c),this._parent[c]=d,this._children[d][c]=!0,this},i.prototype._removeFromParentsChildList=function(c){delete this._children[this._parent[c]][c]},i.prototype.parent=function(c){if(this._isCompound){var d=this._parent[c];if(d!==n)return d}},i.prototype.children=function(c){if(e.isUndefined(c)&&(c=n),this._isCompound){var d=this._children[c];if(d)return e.keys(d)}else{if(c===n)return this.nodes();if(this.hasNode(c))return[]}},i.prototype.predecessors=function(c){var d=this._preds[c];if(d)return e.keys(d)},i.prototype.successors=function(c){var d=this._sucs[c];if(d)return e.keys(d)},i.prototype.neighbors=function(c){var d=this.predecessors(c);if(d)return e.union(d,this.successors(c))},i.prototype.isLeaf=function(c){var d;return this.isDirected()?d=this.successors(c):d=this.neighbors(c),d.length===0},i.prototype.filterNodes=function(c){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var f=this;e.each(this._nodes,function(v,w){c(w)&&d.setNode(w,v)}),e.each(this._edgeObjs,function(v){d.hasNode(v.v)&&d.hasNode(v.w)&&d.setEdge(v,f.edge(v))});var p={};function m(v){var w=f.parent(v);return w===void 0||d.hasNode(w)?(p[v]=w,w):w in p?p[w]:m(w)}return this._isCompound&&e.each(d.nodes(),function(v){d.setParent(v,m(v))}),d},i.prototype.setDefaultEdgeLabel=function(c){return e.isFunction(c)||(c=e.constant(c)),this._defaultEdgeLabelFn=c,this},i.prototype.edgeCount=function(){return this._edgeCount},i.prototype.edges=function(){return e.values(this._edgeObjs)},i.prototype.setPath=function(c,d){var f=this,p=arguments;return e.reduce(c,function(m,v){return p.length>1?f.setEdge(m,v,d):f.setEdge(m,v),v}),this},i.prototype.setEdge=function(){var c,d,f,p,m=!1,v=arguments[0];typeof v=="object"&&v!==null&&"v"in v?(c=v.v,d=v.w,f=v.name,arguments.length===2&&(p=arguments[1],m=!0)):(c=v,d=arguments[1],f=arguments[3],arguments.length>2&&(p=arguments[2],m=!0)),c=""+c,d=""+d,e.isUndefined(f)||(f=""+f);var w=a(this._isDirected,c,d,f);if(e.has(this._edgeLabels,w))return m&&(this._edgeLabels[w]=p),this;if(!e.isUndefined(f)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(c),this.setNode(d),this._edgeLabels[w]=m?p:this._defaultEdgeLabelFn(c,d,f);var g=l(this._isDirected,c,d,f);return c=g.v,d=g.w,Object.freeze(g),this._edgeObjs[w]=g,s(this._preds[d],c),s(this._sucs[c],d),this._in[d][w]=g,this._out[c][w]=g,this._edgeCount++,this},i.prototype.edge=function(c,d,f){var p=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,c,d,f);return this._edgeLabels[p]},i.prototype.hasEdge=function(c,d,f){var p=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,c,d,f);return e.has(this._edgeLabels,p)},i.prototype.removeEdge=function(c,d,f){var p=arguments.length===1?u(this._isDirected,arguments[0]):a(this._isDirected,c,d,f),m=this._edgeObjs[p];return m&&(c=m.v,d=m.w,delete this._edgeLabels[p],delete this._edgeObjs[p],o(this._preds[d],c),o(this._sucs[c],d),delete this._in[d][p],delete this._out[c][p],this._edgeCount--),this},i.prototype.inEdges=function(c,d){var f=this._in[c];if(f){var p=e.values(f);return d?e.filter(p,function(m){return m.v===d}):p}},i.prototype.outEdges=function(c,d){var f=this._out[c];if(f){var p=e.values(f);return d?e.filter(p,function(m){return m.w===d}):p}},i.prototype.nodeEdges=function(c,d){var f=this.inEdges(c,d);if(f)return f.concat(this.outEdges(c,d))};function s(c,d){c[d]?c[d]++:c[d]=1}function o(c,d){--c[d]||delete c[d]}function a(c,d,f,p){var m=""+d,v=""+f;if(!c&&m>v){var w=m;m=v,v=w}return m+r+v+r+(e.isUndefined(p)?t:p)}function l(c,d,f,p){var m=""+d,v=""+f;if(!c&&m>v){var w=m;m=v,v=w}var g={v:m,w:v};return p&&(g.name=p),g}function u(c,d){return a(c,d.v,d.w,d.name)}return Hp}var Up,_N;function oU(){return _N||(_N=1,Up="2.1.8"),Up}var Wp,SN;function aU(){return SN||(SN=1,Wp={Graph:X0(),version:oU()}),Wp}var Gp,NN;function lU(){if(NN)return Gp;NN=1;var e=Dt(),t=X0();Gp={write:n,read:s};function n(o){var a={options:{directed:o.isDirected(),multigraph:o.isMultigraph(),compound:o.isCompound()},nodes:r(o),edges:i(o)};return e.isUndefined(o.graph())||(a.value=e.clone(o.graph())),a}function r(o){return e.map(o.nodes(),function(a){var l=o.node(a),u=o.parent(a),c={v:a};return e.isUndefined(l)||(c.value=l),e.isUndefined(u)||(c.parent=u),c})}function i(o){return e.map(o.edges(),function(a){var l=o.edge(a),u={v:a.v,w:a.w};return e.isUndefined(a.name)||(u.name=a.name),e.isUndefined(l)||(u.value=l),u})}function s(o){var a=new t(o.options).setGraph(o.value);return e.each(o.nodes,function(l){a.setNode(l.v,l.value),l.parent&&a.setParent(l.v,l.parent)}),e.each(o.edges,function(l){a.setEdge({v:l.v,w:l.w,name:l.name},l.value)}),a}return Gp}var Yp,EN;function uU(){if(EN)return Yp;EN=1;var e=Dt();Yp=t;function t(n){var r={},i=[],s;function o(a){e.has(r,a)||(r[a]=!0,s.push(a),e.each(n.successors(a),o),e.each(n.predecessors(a),o))}return e.each(n.nodes(),function(a){s=[],o(a),s.length&&i.push(s)}),i}return Yp}var Kp,CN;function qA(){if(CN)return Kp;CN=1;var e=Dt();Kp=t;function t(){this._arr=[],this._keyIndices={}}return t.prototype.size=function(){return this._arr.length},t.prototype.keys=function(){return this._arr.map(function(n){return n.key})},t.prototype.has=function(n){return e.has(this._keyIndices,n)},t.prototype.priority=function(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority},t.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},t.prototype.add=function(n,r){var i=this._keyIndices;if(n=String(n),!e.has(i,n)){var s=this._arr,o=s.length;return i[n]=o,s.push({key:n,priority:r}),this._decrease(o),!0}return!1},t.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key},t.prototype.decrease=function(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)},t.prototype._heapify=function(n){var r=this._arr,i=2*n,s=i+1,o=n;i<r.length&&(o=r[i].priority<r[o].priority?i:o,s<r.length&&(o=r[s].priority<r[o].priority?s:o),o!==n&&(this._swap(n,o),this._heapify(o)))},t.prototype._decrease=function(n){for(var r=this._arr,i=r[n].priority,s;n!==0&&(s=n>>1,!(r[s].priority<i));)this._swap(n,s),n=s},t.prototype._swap=function(n,r){var i=this._arr,s=this._keyIndices,o=i[n],a=i[r];i[n]=a,i[r]=o,s[a.key]=n,s[o.key]=r},Kp}var Xp,kN;function VA(){if(kN)return Xp;kN=1;var e=Dt(),t=qA();Xp=r;var n=e.constant(1);function r(s,o,a,l){return i(s,String(o),a||n,l||function(u){return s.outEdges(u)})}function i(s,o,a,l){var u={},c=new t,d,f,p=function(m){var v=m.v!==d?m.v:m.w,w=u[v],g=a(m),x=f.distance+g;if(g<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+m+" Weight: "+g);x<w.distance&&(w.distance=x,w.predecessor=d,c.decrease(v,x))};for(s.nodes().forEach(function(m){var v=m===o?0:Number.POSITIVE_INFINITY;u[m]={distance:v},c.add(m,v)});c.size()>0&&(d=c.removeMin(),f=u[d],f.distance!==Number.POSITIVE_INFINITY);)l(d).forEach(p);return u}return Xp}var Qp,PN;function cU(){if(PN)return Qp;PN=1;var e=VA(),t=Dt();Qp=n;function n(r,i,s){return t.transform(r.nodes(),function(o,a){o[a]=e(r,a,i,s)},{})}return Qp}var Zp,jN;function $A(){if(jN)return Zp;jN=1;var e=Dt();Zp=t;function t(n){var r=0,i=[],s={},o=[];function a(l){var u=s[l]={onStack:!0,lowlink:r,index:r++};if(i.push(l),n.successors(l).forEach(function(f){e.has(s,f)?s[f].onStack&&(u.lowlink=Math.min(u.lowlink,s[f].index)):(a(f),u.lowlink=Math.min(u.lowlink,s[f].lowlink))}),u.lowlink===u.index){var c=[],d;do d=i.pop(),s[d].onStack=!1,c.push(d);while(l!==d);o.push(c)}}return n.nodes().forEach(function(l){e.has(s,l)||a(l)}),o}return Zp}var Jp,TN;function dU(){if(TN)return Jp;TN=1;var e=Dt(),t=$A();Jp=n;function n(r){return e.filter(t(r),function(i){return i.length>1||i.length===1&&r.hasEdge(i[0],i[0])})}return Jp}var em,MN;function fU(){if(MN)return em;MN=1;var e=Dt();em=n;var t=e.constant(1);function n(i,s,o){return r(i,s||t,o||function(a){return i.outEdges(a)})}function r(i,s,o){var a={},l=i.nodes();return l.forEach(function(u){a[u]={},a[u][u]={distance:0},l.forEach(function(c){u!==c&&(a[u][c]={distance:Number.POSITIVE_INFINITY})}),o(u).forEach(function(c){var d=c.v===u?c.w:c.v,f=s(c);a[u][d]={distance:f,predecessor:u}})}),l.forEach(function(u){var c=a[u];l.forEach(function(d){var f=a[d];l.forEach(function(p){var m=f[u],v=c[p],w=f[p],g=m.distance+v.distance;g<w.distance&&(w.distance=g,w.predecessor=v.predecessor)})})}),a}return em}var tm,AN;function zA(){if(AN)return tm;AN=1;var e=Dt();tm=t,t.CycleException=n;function t(r){var i={},s={},o=[];function a(l){if(e.has(s,l))throw new n;e.has(i,l)||(s[l]=!0,i[l]=!0,e.each(r.predecessors(l),a),delete s[l],o.push(l))}if(e.each(r.sinks(),a),e.size(i)!==r.nodeCount())throw new n;return o}function n(){}return n.prototype=new Error,tm}var nm,IN;function hU(){if(IN)return nm;IN=1;var e=zA();nm=t;function t(n){try{e(n)}catch(r){if(r instanceof e.CycleException)return!1;throw r}return!0}return nm}var rm,RN;function BA(){if(RN)return rm;RN=1;var e=Dt();rm=t;function t(r,i,s){e.isArray(i)||(i=[i]);var o=(r.isDirected()?r.successors:r.neighbors).bind(r),a=[],l={};return e.each(i,function(u){if(!r.hasNode(u))throw new Error("Graph does not have node: "+u);n(r,u,s==="post",l,o,a)}),a}function n(r,i,s,o,a,l){e.has(o,i)||(o[i]=!0,s||l.push(i),e.each(a(i),function(u){n(r,u,s,o,a,l)}),s&&l.push(i))}return rm}var im,DN;function pU(){if(DN)return im;DN=1;var e=BA();im=t;function t(n,r){return e(n,r,"post")}return im}var sm,ON;function mU(){if(ON)return sm;ON=1;var e=BA();sm=t;function t(n,r){return e(n,r,"pre")}return sm}var om,LN;function gU(){if(LN)return om;LN=1;var e=Dt(),t=X0(),n=qA();om=r;function r(i,s){var o=new t,a={},l=new n,u;function c(f){var p=f.v===u?f.w:f.v,m=l.priority(p);if(m!==void 0){var v=s(f);v<m&&(a[p]=u,l.decrease(p,v))}}if(i.nodeCount()===0)return o;e.each(i.nodes(),function(f){l.add(f,Number.POSITIVE_INFINITY),o.setNode(f)}),l.decrease(i.nodes()[0],0);for(var d=!1;l.size()>0;){if(u=l.removeMin(),e.has(a,u))o.setEdge(u,a[u]);else{if(d)throw new Error("Input graph is not connected: "+i);d=!0}i.nodeEdges(u).forEach(c)}return o}return om}var am,FN;function yU(){return FN||(FN=1,am={components:uU(),dijkstra:VA(),dijkstraAll:cU(),findCycles:dU(),floydWarshall:fU(),isAcyclic:hU(),postorder:pU(),preorder:mU(),prim:gU(),tarjan:$A(),topsort:zA()}),am}var lm,qN;function vU(){if(qN)return lm;qN=1;var e=aU();return lm={Graph:e.Graph,json:lU(),alg:yU(),version:e.version},lm}var au;if(typeof R0=="function")try{au=vU()}catch{}au||(au=window.graphlib);var Xt=au,um,VN;function xU(){if(VN)return um;VN=1;var e=pA(),t=1,n=4;function r(i){return e(i,t|n)}return um=r,um}var cm,$N;function cc(){if($N)return cm;$N=1;var e=cs(),t=$n(),n=tc(),r=Rt();function i(s,o,a){if(!r(a))return!1;var l=typeof o;return(l=="number"?t(a)&&n(o,a.length):l=="string"&&o in a)?e(a[o],s):!1}return cm=i,cm}var dm,zN;function wU(){if(zN)return dm;zN=1;var e=uc(),t=cs(),n=cc(),r=ai(),i=Object.prototype,s=i.hasOwnProperty,o=e(function(a,l){a=Object(a);var u=-1,c=l.length,d=c>2?l[2]:void 0;for(d&&n(l[0],l[1],d)&&(c=1);++u<c;)for(var f=l[u],p=r(f),m=-1,v=p.length;++m<v;){var w=p[m],g=a[w];(g===void 0||t(g,i[w])&&!s.call(a,w))&&(a[w]=f[w])}return a});return dm=o,dm}var fm,BN;function bU(){if(BN)return fm;BN=1;var e=zn(),t=$n(),n=Cr();function r(i){return function(s,o,a){var l=Object(s);if(!t(s)){var u=e(o,3);s=n(s),o=function(d){return u(l[d],d,l)}}var c=i(s,o,a);return c>-1?l[u?s[c]:c]:void 0}}return fm=r,fm}var hm,HN;function _U(){if(HN)return hm;HN=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return hm=t,hm}var pm,UN;function SU(){if(UN)return pm;UN=1;var e=_U(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return pm=n,pm}var mm,WN;function NU(){if(WN)return mm;WN=1;var e=SU(),t=Rt(),n=ps(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function l(u){if(typeof u=="number")return u;if(n(u))return r;if(t(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=t(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=e(u);var d=s.test(u);return d||o.test(u)?a(u.slice(2),d?2:8):i.test(u)?r:+u}return mm=l,mm}var gm,GN;function HA(){if(GN)return gm;GN=1;var e=NU(),t=1/0,n=17976931348623157e292;function r(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var s=i<0?-1:1;return s*n}return i===i?i:0}return gm=r,gm}var ym,YN;function EU(){if(YN)return ym;YN=1;var e=HA();function t(n){var r=e(n),i=r%1;return r===r?i?r-i:r:0}return ym=t,ym}var vm,KN;function CU(){if(KN)return vm;KN=1;var e=OA(),t=zn(),n=EU(),r=Math.max;function i(s,o,a){var l=s==null?0:s.length;if(!l)return-1;var u=a==null?0:n(a);return u<0&&(u=r(l+u,0)),e(s,t(o,3),u)}return vm=i,vm}var xm,XN;function kU(){if(XN)return xm;XN=1;var e=bU(),t=CU(),n=e(t);return xm=n,xm}var wm,QN;function UA(){if(QN)return wm;QN=1;var e=K0();function t(n){var r=n==null?0:n.length;return r?e(n,1):[]}return wm=t,wm}var bm,ZN;function PU(){if(ZN)return bm;ZN=1;var e=U0(),t=mA(),n=ai();function r(i,s){return i==null?i:e(i,t(s),n)}return bm=r,bm}var _m,JN;function jU(){if(JN)return _m;JN=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return _m=e,_m}var Sm,eE;function TU(){if(eE)return Sm;eE=1;var e=Ju(),t=W0(),n=zn();function r(i,s){var o={};return s=n(s,3),t(i,function(a,l,u){e(o,l,s(a,l,u))}),o}return Sm=r,Sm}var Nm,tE;function Q0(){if(tE)return Nm;tE=1;var e=ps();function t(n,r,i){for(var s=-1,o=n.length;++s<o;){var a=n[s],l=r(a);if(l!=null&&(u===void 0?l===l&&!e(l):i(l,u)))var u=l,c=a}return c}return Nm=t,Nm}var Em,nE;function MU(){if(nE)return Em;nE=1;function e(t,n){return t>n}return Em=e,Em}var Cm,rE;function AU(){if(rE)return Cm;rE=1;var e=Q0(),t=MU(),n=li();function r(i){return i&&i.length?e(i,n,t):void 0}return Cm=r,Cm}var km,iE;function WA(){if(iE)return km;iE=1;var e=Ju(),t=cs();function n(r,i,s){(s!==void 0&&!t(r[i],s)||s===void 0&&!(i in r))&&e(r,i,s)}return km=n,km}var Pm,sE;function IU(){if(sE)return Pm;sE=1;var e=si(),t=ic(),n=fn(),r="[object Object]",i=Function.prototype,s=Object.prototype,o=i.toString,a=s.hasOwnProperty,l=o.call(Object);function u(c){if(!n(c)||e(c)!=r)return!1;var d=t(c);if(d===null)return!0;var f=a.call(d,"constructor")&&d.constructor;return typeof f=="function"&&f instanceof f&&o.call(f)==l}return Pm=u,Pm}var jm,oE;function GA(){if(oE)return jm;oE=1;function e(t,n){if(!(n==="constructor"&&typeof t[n]=="function")&&n!="__proto__")return t[n]}return jm=e,jm}var Tm,aE;function RU(){if(aE)return Tm;aE=1;var e=aa(),t=ai();function n(r){return e(r,t(r))}return Tm=n,Tm}var Mm,lE;function DU(){if(lE)return Mm;lE=1;var e=WA(),t=nA(),n=dA(),r=rA(),i=hA(),s=la(),o=Le(),a=LA(),l=fs(),u=oa(),c=Rt(),d=IU(),f=ua(),p=GA(),m=RU();function v(w,g,x,y,b,E,C){var _=p(w,x),k=p(g,x),I=C.get(k);if(I){e(w,x,I);return}var F=E?E(_,k,x+"",w,g,C):void 0,S=F===void 0;if(S){var P=o(k),L=!P&&l(k),N=!P&&!L&&f(k);F=k,P||L||N?o(_)?F=_:a(_)?F=r(_):L?(S=!1,F=t(k,!0)):N?(S=!1,F=n(k,!0)):F=[]:d(k)||s(k)?(F=_,s(_)?F=m(_):(!c(_)||u(_))&&(F=i(k))):S=!1}S&&(C.set(k,F),b(F,k,y,E,C),C.delete(k)),e(w,x,F)}return Mm=v,Mm}var Am,uE;function OU(){if(uE)return Am;uE=1;var e=Zu(),t=WA(),n=U0(),r=DU(),i=Rt(),s=ai(),o=GA();function a(l,u,c,d,f){l!==u&&n(u,function(p,m){if(f||(f=new e),i(p))r(l,u,m,c,a,d,f);else{var v=d?d(o(l,m),p,m+"",l,u,f):void 0;v===void 0&&(v=p),t(l,m,v)}},s)}return Am=a,Am}var Im,cE;function LU(){if(cE)return Im;cE=1;var e=uc(),t=cc();function n(r){return e(function(i,s){var o=-1,a=s.length,l=a>1?s[a-1]:void 0,u=a>2?s[2]:void 0;for(l=r.length>3&&typeof l=="function"?(a--,l):void 0,u&&t(s[0],s[1],u)&&(l=a<3?void 0:l,a=1),i=Object(i);++o<a;){var c=s[o];c&&r(i,c,o,l)}return i})}return Im=n,Im}var Rm,dE;function FU(){if(dE)return Rm;dE=1;var e=OU(),t=LU(),n=t(function(r,i,s){e(r,i,s)});return Rm=n,Rm}var Dm,fE;function YA(){if(fE)return Dm;fE=1;function e(t,n){return t<n}return Dm=e,Dm}var Om,hE;function qU(){if(hE)return Om;hE=1;var e=Q0(),t=YA(),n=li();function r(i){return i&&i.length?e(i,n,t):void 0}return Om=r,Om}var Lm,pE;function VU(){if(pE)return Lm;pE=1;var e=Q0(),t=zn(),n=YA();function r(i,s){return i&&i.length?e(i,t(s,2),n):void 0}return Lm=r,Lm}var Fm,mE;function $U(){if(mE)return Fm;mE=1;var e=Kt(),t=function(){return e.Date.now()};return Fm=t,Fm}var qm,gE;function zU(){if(gE)return qm;gE=1;var e=ec(),t=ac(),n=tc(),r=Rt(),i=ca();function s(o,a,l,u){if(!r(o))return o;a=t(a,o);for(var c=-1,d=a.length,f=d-1,p=o;p!=null&&++c<d;){var m=i(a[c]),v=l;if(m==="__proto__"||m==="constructor"||m==="prototype")return o;if(c!=f){var w=p[m];v=u?u(w,m,p):void 0,v===void 0&&(v=r(w)?w:n(a[c+1])?[]:{})}e(p,m,v),p=p[m]}return o}return qm=s,qm}var Vm,yE;function BU(){if(yE)return Vm;yE=1;var e=lc(),t=zU(),n=ac();function r(i,s,o){for(var a=-1,l=s.length,u={};++a<l;){var c=s[a],d=e(i,c);o(d,c)&&t(u,n(c,i),d)}return u}return Vm=r,Vm}var $m,vE;function HU(){if(vE)return $m;vE=1;var e=BU(),t=CA();function n(r,i){return e(r,i,function(s,o){return t(r,o)})}return $m=n,$m}var zm,xE;function UU(){if(xE)return zm;xE=1;var e=UA(),t=RA(),n=DA();function r(i){return n(t(i,void 0,e),i+"")}return zm=r,zm}var Bm,wE;function WU(){if(wE)return Bm;wE=1;var e=HU(),t=UU(),n=t(function(r,i){return r==null?{}:e(r,i)});return Bm=n,Bm}var Hm,bE;function GU(){if(bE)return Hm;bE=1;var e=Math.ceil,t=Math.max;function n(r,i,s,o){for(var a=-1,l=t(e((i-r)/(s||1)),0),u=Array(l);l--;)u[o?l:++a]=r,r+=s;return u}return Hm=n,Hm}var Um,_E;function YU(){if(_E)return Um;_E=1;var e=GU(),t=cc(),n=HA();function r(i){return function(s,o,a){return a&&typeof a!="number"&&t(s,o,a)&&(o=a=void 0),s=n(s),o===void 0?(o=s,s=0):o=n(o),a=a===void 0?s<o?1:-1:n(a),e(s,o,a,i)}}return Um=r,Um}var Wm,SE;function KU(){if(SE)return Wm;SE=1;var e=YU(),t=e();return Wm=t,Wm}var Gm,NE;function XU(){if(NE)return Gm;NE=1;function e(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}return Gm=e,Gm}var Ym,EE;function QU(){if(EE)return Ym;EE=1;var e=ps();function t(n,r){if(n!==r){var i=n!==void 0,s=n===null,o=n===n,a=e(n),l=r!==void 0,u=r===null,c=r===r,d=e(r);if(!u&&!d&&!a&&n>r||a&&l&&c&&!u&&!d||s&&l&&c||!i&&c||!o)return 1;if(!s&&!a&&!d&&n<r||d&&i&&o&&!s&&!a||u&&i&&o||!l&&o||!c)return-1}return 0}return Ym=t,Ym}var Km,CE;function ZU(){if(CE)return Km;CE=1;var e=QU();function t(n,r,i){for(var s=-1,o=n.criteria,a=r.criteria,l=o.length,u=i.length;++s<l;){var c=e(o[s],a[s]);if(c){if(s>=u)return c;var d=i[s];return c*(d=="desc"?-1:1)}}return n.index-r.index}return Km=t,Km}var Xm,kE;function JU(){if(kE)return Xm;kE=1;var e=oc(),t=lc(),n=zn(),r=MA(),i=XU(),s=nc(),o=ZU(),a=li(),l=Le();function u(c,d,f){d.length?d=e(d,function(v){return l(v)?function(w){return t(w,v.length===1?v[0]:v)}:v}):d=[a];var p=-1;d=e(d,s(n));var m=r(c,function(v,w,g){var x=e(d,function(y){return y(v)});return{criteria:x,index:++p,value:v}});return i(m,function(v,w){return o(v,w,f)})}return Xm=u,Xm}var Qm,PE;function e7(){if(PE)return Qm;PE=1;var e=K0(),t=JU(),n=uc(),r=cc(),i=n(function(s,o){if(s==null)return[];var a=o.length;return a>1&&r(s,o[0],o[1])?o=[]:a>2&&r(o[0],o[1],o[2])&&(o=[o[0]]),t(s,e(o,1),[])});return Qm=i,Qm}var Zm,jE;function t7(){if(jE)return Zm;jE=1;var e=NA(),t=0;function n(r){var i=++t;return e(r)+i}return Zm=n,Zm}var Jm,TE;function n7(){if(TE)return Jm;TE=1;function e(t,n,r){for(var i=-1,s=t.length,o=n.length,a={};++i<s;){var l=i<o?n[i]:void 0;r(a,t[i],l)}return a}return Jm=e,Jm}var eg,ME;function r7(){if(ME)return eg;ME=1;var e=ec(),t=n7();function n(r,i){return t(r||[],i||[],e)}return eg=n,eg}var lu;if(typeof R0=="function")try{lu={cloneDeep:xU(),constant:H0(),defaults:wU(),each:yA(),filter:PA(),find:kU(),flatten:UA(),forEach:gA(),forIn:PU(),has:jA(),isUndefined:TA(),last:jU(),map:AA(),mapValues:TU(),max:AU(),merge:FU(),min:qU(),minBy:VU(),now:$U(),pick:WU(),range:KU(),reduce:IA(),sortBy:e7(),uniqueId:t7(),values:FA(),zipObject:r7()}}catch{}lu||(lu=window._);var Ne=lu,i7=dc;function dc(){var e={};e._next=e._prev=e,this._sentinel=e}dc.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return KA(t),t};dc.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&KA(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t};dc.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,s7)),n=n._prev;return"["+e.join(", ")+"]"};function KA(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function s7(e,t){if(e!=="_next"&&e!=="_prev")return t}var Nn=Ne,o7=Xt.Graph,a7=i7,l7=c7,u7=Nn.constant(1);function c7(e,t){if(e.nodeCount()<=1)return[];var n=f7(e,t||u7),r=d7(n.graph,n.buckets,n.zeroIdx);return Nn.flatten(Nn.map(r,function(i){return e.outEdges(i.v,i.w)}),!0)}function d7(e,t,n){for(var r=[],i=t[t.length-1],s=t[0],o;e.nodeCount();){for(;o=s.dequeue();)tg(e,t,n,o);for(;o=i.dequeue();)tg(e,t,n,o);if(e.nodeCount()){for(var a=t.length-2;a>0;--a)if(o=t[a].dequeue(),o){r=r.concat(tg(e,t,n,o,!0));break}}}return r}function tg(e,t,n,r,i){var s=i?[]:void 0;return Nn.forEach(e.inEdges(r.v),function(o){var a=e.edge(o),l=e.node(o.v);i&&s.push({v:o.v,w:o.w}),l.out-=a,Ry(t,n,l)}),Nn.forEach(e.outEdges(r.v),function(o){var a=e.edge(o),l=o.w,u=e.node(l);u.in-=a,Ry(t,n,u)}),e.removeNode(r.v),s}function f7(e,t){var n=new o7,r=0,i=0;Nn.forEach(e.nodes(),function(a){n.setNode(a,{v:a,in:0,out:0})}),Nn.forEach(e.edges(),function(a){var l=n.edge(a.v,a.w)||0,u=t(a),c=l+u;n.setEdge(a.v,a.w,c),i=Math.max(i,n.node(a.v).out+=u),r=Math.max(r,n.node(a.w).in+=u)});var s=Nn.range(i+r+3).map(function(){return new a7}),o=r+1;return Nn.forEach(n.nodes(),function(a){Ry(s,o,n.node(a))}),{graph:n,buckets:s,zeroIdx:o}}function Ry(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}var qr=Ne,h7=l7,p7={run:m7,undo:y7};function m7(e){var t=e.graph().acyclicer==="greedy"?h7(e,n(e)):g7(e);qr.forEach(t,function(r){var i=e.edge(r);e.removeEdge(r),i.forwardName=r.name,i.reversed=!0,e.setEdge(r.w,r.v,i,qr.uniqueId("rev"))});function n(r){return function(i){return r.edge(i).weight}}}function g7(e){var t=[],n={},r={};function i(s){qr.has(r,s)||(r[s]=!0,n[s]=!0,qr.forEach(e.outEdges(s),function(o){qr.has(n,o.w)?t.push(o):i(o.w)}),delete n[s])}return qr.forEach(e.nodes(),i),t}function y7(e){qr.forEach(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}var he=Ne,XA=Xt.Graph,ht={addDummyNode:QA,simplify:v7,asNonCompoundGraph:x7,successorWeights:w7,predecessorWeights:b7,intersectRect:_7,buildLayerMatrix:S7,normalizeRanks:N7,removeEmptyRanks:E7,addBorderNode:C7,maxRank:ZA,partition:k7,time:P7,notime:j7};function QA(e,t,n,r){var i;do i=he.uniqueId(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function v7(e){var t=new XA().setGraph(e.graph());return he.forEach(e.nodes(),function(n){t.setNode(n,e.node(n))}),he.forEach(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function x7(e){var t=new XA({multigraph:e.isMultigraph()}).setGraph(e.graph());return he.forEach(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),he.forEach(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function w7(e){var t=he.map(e.nodes(),function(n){var r={};return he.forEach(e.outEdges(n),function(i){r[i.w]=(r[i.w]||0)+e.edge(i).weight}),r});return he.zipObject(e.nodes(),t)}function b7(e){var t=he.map(e.nodes(),function(n){var r={};return he.forEach(e.inEdges(n),function(i){r[i.v]=(r[i.v]||0)+e.edge(i).weight}),r});return he.zipObject(e.nodes(),t)}function _7(e,t){var n=e.x,r=e.y,i=t.x-n,s=t.y-r,o=e.width/2,a=e.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(s)*o>Math.abs(i)*a?(s<0&&(a=-a),l=a*i/s,u=a):(i<0&&(o=-o),l=o,u=o*s/i),{x:n+l,y:r+u}}function S7(e){var t=he.map(he.range(ZA(e)+1),function(){return[]});return he.forEach(e.nodes(),function(n){var r=e.node(n),i=r.rank;he.isUndefined(i)||(t[i][r.order]=n)}),t}function N7(e){var t=he.min(he.map(e.nodes(),function(n){return e.node(n).rank}));he.forEach(e.nodes(),function(n){var r=e.node(n);he.has(r,"rank")&&(r.rank-=t)})}function E7(e){var t=he.min(he.map(e.nodes(),function(s){return e.node(s).rank})),n=[];he.forEach(e.nodes(),function(s){var o=e.node(s).rank-t;n[o]||(n[o]=[]),n[o].push(s)});var r=0,i=e.graph().nodeRankFactor;he.forEach(n,function(s,o){he.isUndefined(s)&&o%i!==0?--r:r&&he.forEach(s,function(a){e.node(a).rank+=r})})}function C7(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),QA(e,"border",i,t)}function ZA(e){return he.max(he.map(e.nodes(),function(t){var n=e.node(t).rank;if(!he.isUndefined(n))return n}))}function k7(e,t){var n={lhs:[],rhs:[]};return he.forEach(e,function(r){t(r)?n.lhs.push(r):n.rhs.push(r)}),n}function P7(e,t){var n=he.now();try{return t()}finally{console.log(e+" time: "+(he.now()-n)+"ms")}}function j7(e,t){return t()}var JA=Ne,T7=ht,M7={run:A7,undo:R7};function A7(e){e.graph().dummyChains=[],JA.forEach(e.edges(),function(t){I7(e,t)})}function I7(e,t){var n=t.v,r=e.node(n).rank,i=t.w,s=e.node(i).rank,o=t.name,a=e.edge(t),l=a.labelRank;if(s!==r+1){e.removeEdge(t);var u,c,d;for(d=0,++r;r<s;++d,++r)a.points=[],c={width:0,height:0,edgeLabel:a,edgeObj:t,rank:r},u=T7.addDummyNode(e,"edge",c,"_d"),r===l&&(c.width=a.width,c.height=a.height,c.dummy="edge-label",c.labelpos=a.labelpos),e.setEdge(n,u,{weight:a.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:a.weight},o)}}function R7(e){JA.forEach(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy==="edge-label"&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}var Ga=Ne,fc={longestPath:D7,slack:O7};function D7(e){var t={};function n(r){var i=e.node(r);if(Ga.has(t,r))return i.rank;t[r]=!0;var s=Ga.min(Ga.map(e.outEdges(r),function(o){return n(o.w)-e.edge(o).minlen}));return(s===Number.POSITIVE_INFINITY||s===void 0||s===null)&&(s=0),i.rank=s}Ga.forEach(e.sources(),n)}function O7(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var uu=Ne,L7=Xt.Graph,cu=fc.slack,eI=F7;function F7(e){var t=new L7({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,s;q7(t,e)<r;)i=V7(t,e),s=t.hasNode(i.v)?cu(e,i):-cu(e,i),$7(t,e,s);return t}function q7(e,t){function n(r){uu.forEach(t.nodeEdges(r),function(i){var s=i.v,o=r===s?i.w:s;!e.hasNode(o)&&!cu(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return uu.forEach(e.nodes(),n),e.nodeCount()}function V7(e,t){return uu.minBy(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return cu(t,n)})}function $7(e,t,n){uu.forEach(e.nodes(),function(r){t.node(r).rank+=n})}var Ln=Ne,z7=eI,B7=fc.slack,H7=fc.longestPath,U7=Xt.alg.preorder,W7=Xt.alg.postorder,G7=ht.simplify,Y7=ui;ui.initLowLimValues=J0;ui.initCutValues=Z0;ui.calcCutValue=tI;ui.leaveEdge=rI;ui.enterEdge=iI;ui.exchangeEdges=sI;function ui(e){e=G7(e),H7(e);var t=z7(e);J0(t),Z0(t,e);for(var n,r;n=rI(t);)r=iI(t,e,n),sI(t,e,n,r)}function Z0(e,t){var n=W7(e,e.nodes());n=n.slice(0,n.length-1),Ln.forEach(n,function(r){K7(e,t,r)})}function K7(e,t,n){var r=e.node(n),i=r.parent;e.edge(n,i).cutvalue=tI(e,t,n)}function tI(e,t,n){var r=e.node(n),i=r.parent,s=!0,o=t.edge(n,i),a=0;return o||(s=!1,o=t.edge(i,n)),a=o.weight,Ln.forEach(t.nodeEdges(n),function(l){var u=l.v===n,c=u?l.w:l.v;if(c!==i){var d=u===s,f=t.edge(l).weight;if(a+=d?f:-f,Q7(e,n,c)){var p=e.edge(n,c).cutvalue;a+=d?-p:p}}}),a}function J0(e,t){arguments.length<2&&(t=e.nodes()[0]),nI(e,{},1,t)}function nI(e,t,n,r,i){var s=n,o=e.node(r);return t[r]=!0,Ln.forEach(e.neighbors(r),function(a){Ln.has(t,a)||(n=nI(e,t,n,a,r))}),o.low=s,o.lim=n++,i?o.parent=i:delete o.parent,n}function rI(e){return Ln.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function iI(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var s=e.node(r),o=e.node(i),a=s,l=!1;s.lim>o.lim&&(a=o,l=!0);var u=Ln.filter(t.edges(),function(c){return l===AE(e,e.node(c.v),a)&&l!==AE(e,e.node(c.w),a)});return Ln.minBy(u,function(c){return B7(t,c)})}function sI(e,t,n,r){var i=n.v,s=n.w;e.removeEdge(i,s),e.setEdge(r.v,r.w,{}),J0(e),Z0(e,t),X7(e,t)}function X7(e,t){var n=Ln.find(e.nodes(),function(i){return!t.node(i).parent}),r=U7(e,n);r=r.slice(1),Ln.forEach(r,function(i){var s=e.node(i).parent,o=t.edge(i,s),a=!1;o||(o=t.edge(s,i),a=!0),t.node(i).rank=t.node(s).rank+(a?o.minlen:-o.minlen)})}function Q7(e,t,n){return e.hasEdge(t,n)}function AE(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Z7=fc,oI=Z7.longestPath,J7=eI,eW=Y7,tW=nW;function nW(e){switch(e.graph().ranker){case"network-simplex":IE(e);break;case"tight-tree":iW(e);break;case"longest-path":rW(e);break;default:IE(e)}}var rW=oI;function iW(e){oI(e),J7(e)}function IE(e){eW(e)}var Dy=Ne,sW=oW;function oW(e){var t=lW(e);Dy.forEach(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,s=aW(e,t,i.v,i.w),o=s.path,a=s.lca,l=0,u=o[l],c=!0;n!==i.w;){if(r=e.node(n),c){for(;(u=o[l])!==a&&e.node(u).maxRank<r.rank;)l++;u===a&&(c=!1)}if(!c){for(;l<o.length-1&&e.node(u=o[l+1]).minRank<=r.rank;)l++;u=o[l]}e.setParent(n,u),n=e.successors(n)[0]}})}function aW(e,t,n,r){var i=[],s=[],o=Math.min(t[n].low,t[r].low),a=Math.max(t[n].lim,t[r].lim),l,u;l=n;do l=e.parent(l),i.push(l);while(l&&(t[l].low>o||a>t[l].lim));for(u=l,l=r;(l=e.parent(l))!==u;)s.push(l);return{path:i.concat(s.reverse()),lca:u}}function lW(e){var t={},n=0;function r(i){var s=n;Dy.forEach(e.children(i),r),t[i]={low:s,lim:n++}}return Dy.forEach(e.children(),r),t}var En=Ne,Oy=ht,uW={run:cW,cleanup:hW};function cW(e){var t=Oy.addDummyNode(e,"root",{},"_root"),n=dW(e),r=En.max(En.values(n))-1,i=2*r+1;e.graph().nestingRoot=t,En.forEach(e.edges(),function(o){e.edge(o).minlen*=i});var s=fW(e)+1;En.forEach(e.children(),function(o){aI(e,t,i,s,r,n,o)}),e.graph().nodeRankFactor=i}function aI(e,t,n,r,i,s,o){var a=e.children(o);if(!a.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var l=Oy.addBorderNode(e,"_bt"),u=Oy.addBorderNode(e,"_bb"),c=e.node(o);e.setParent(l,o),c.borderTop=l,e.setParent(u,o),c.borderBottom=u,En.forEach(a,function(d){aI(e,t,n,r,i,s,d);var f=e.node(d),p=f.borderTop?f.borderTop:d,m=f.borderBottom?f.borderBottom:d,v=f.borderTop?r:2*r,w=p!==m?1:i-s[o]+1;e.setEdge(l,p,{weight:v,minlen:w,nestingEdge:!0}),e.setEdge(m,u,{weight:v,minlen:w,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,l,{weight:0,minlen:i+s[o]})}function dW(e){var t={};function n(r,i){var s=e.children(r);s&&s.length&&En.forEach(s,function(o){n(o,i+1)}),t[r]=i}return En.forEach(e.children(),function(r){n(r,1)}),t}function fW(e){return En.reduce(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function hW(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,En.forEach(e.edges(),function(n){var r=e.edge(n);r.nestingEdge&&e.removeEdge(n)})}var ng=Ne,pW=ht,mW=gW;function gW(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&ng.forEach(r,t),ng.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,o=i.maxRank+1;s<o;++s)RE(e,"borderLeft","_bl",n,i,s),RE(e,"borderRight","_br",n,i,s)}}ng.forEach(e.children(),t)}function RE(e,t,n,r,i,s){var o={width:0,height:0,rank:s,borderType:t},a=i[t][s-1],l=pW.addDummyNode(e,"border",o,n);i[t][s]=l,e.setParent(l,r),a&&e.setEdge(a,l,{weight:1})}var rn=Ne,yW={adjust:vW,undo:xW};function vW(e){var t=e.graph().rankdir.toLowerCase();(t==="lr"||t==="rl")&&lI(e)}function xW(e){var t=e.graph().rankdir.toLowerCase();(t==="bt"||t==="rl")&&wW(e),(t==="lr"||t==="rl")&&(bW(e),lI(e))}function lI(e){rn.forEach(e.nodes(),function(t){DE(e.node(t))}),rn.forEach(e.edges(),function(t){DE(e.edge(t))})}function DE(e){var t=e.width;e.width=e.height,e.height=t}function wW(e){rn.forEach(e.nodes(),function(t){rg(e.node(t))}),rn.forEach(e.edges(),function(t){var n=e.edge(t);rn.forEach(n.points,rg),rn.has(n,"y")&&rg(n)})}function rg(e){e.y=-e.y}function bW(e){rn.forEach(e.nodes(),function(t){ig(e.node(t))}),rn.forEach(e.edges(),function(t){var n=e.edge(t);rn.forEach(n.points,ig),rn.has(n,"x")&&ig(n)})}function ig(e){var t=e.x;e.x=e.y,e.y=t}var vn=Ne,_W=SW;function SW(e){var t={},n=vn.filter(e.nodes(),function(a){return!e.children(a).length}),r=vn.max(vn.map(n,function(a){return e.node(a).rank})),i=vn.map(vn.range(r+1),function(){return[]});function s(a){if(!vn.has(t,a)){t[a]=!0;var l=e.node(a);i[l.rank].push(a),vn.forEach(e.successors(a),s)}}var o=vn.sortBy(n,function(a){return e.node(a).rank});return vn.forEach(o,s),i}var Kn=Ne,NW=EW;function EW(e,t){for(var n=0,r=1;r<t.length;++r)n+=CW(e,t[r-1],t[r]);return n}function CW(e,t,n){for(var r=Kn.zipObject(n,Kn.map(n,function(u,c){return c})),i=Kn.flatten(Kn.map(t,function(u){return Kn.sortBy(Kn.map(e.outEdges(u),function(c){return{pos:r[c.w],weight:e.edge(c).weight}}),"pos")}),!0),s=1;s<n.length;)s<<=1;var o=2*s-1;s-=1;var a=Kn.map(new Array(o),function(){return 0}),l=0;return Kn.forEach(i.forEach(function(u){var c=u.pos+s;a[c]+=u.weight;for(var d=0;c>0;)c%2&&(d+=a[c+1]),c=c-1>>1,a[c]+=u.weight;l+=u.weight*d})),l}var OE=Ne,kW=PW;function PW(e,t){return OE.map(t,function(n){var r=e.inEdges(n);if(r.length){var i=OE.reduce(r,function(s,o){var a=e.edge(o),l=e.node(o.v);return{sum:s.sum+a.weight*l.order,weight:s.weight+a.weight}},{sum:0,weight:0});return{v:n,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:n}})}var mt=Ne,jW=TW;function TW(e,t){var n={};mt.forEach(e,function(i,s){var o=n[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:s};mt.isUndefined(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),mt.forEach(t.edges(),function(i){var s=n[i.v],o=n[i.w];!mt.isUndefined(s)&&!mt.isUndefined(o)&&(o.indegree++,s.out.push(n[i.w]))});var r=mt.filter(n,function(i){return!i.indegree});return MW(r)}function MW(e){var t=[];function n(s){return function(o){o.merged||(mt.isUndefined(o.barycenter)||mt.isUndefined(s.barycenter)||o.barycenter>=s.barycenter)&&AW(s,o)}}function r(s){return function(o){o.in.push(s),--o.indegree===0&&e.push(o)}}for(;e.length;){var i=e.pop();t.push(i),mt.forEach(i.in.reverse(),n(i)),mt.forEach(i.out,r(i))}return mt.map(mt.filter(t,function(s){return!s.merged}),function(s){return mt.pick(s,["vs","i","barycenter","weight"])})}function AW(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}var $s=Ne,IW=ht,RW=DW;function DW(e,t){var n=IW.partition(e,function(c){return $s.has(c,"barycenter")}),r=n.lhs,i=$s.sortBy(n.rhs,function(c){return-c.i}),s=[],o=0,a=0,l=0;r.sort(OW(!!t)),l=LE(s,i,l),$s.forEach(r,function(c){l+=c.vs.length,s.push(c.vs),o+=c.barycenter*c.weight,a+=c.weight,l=LE(s,i,l)});var u={vs:$s.flatten(s,!0)};return a&&(u.barycenter=o/a,u.weight=a),u}function LE(e,t,n){for(var r;t.length&&(r=$s.last(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function OW(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}var rr=Ne,LW=kW,FW=jW,qW=RW,VW=uI;function uI(e,t,n,r){var i=e.children(t),s=e.node(t),o=s?s.borderLeft:void 0,a=s?s.borderRight:void 0,l={};o&&(i=rr.filter(i,function(m){return m!==o&&m!==a}));var u=LW(e,i);rr.forEach(u,function(m){if(e.children(m.v).length){var v=uI(e,m.v,n,r);l[m.v]=v,rr.has(v,"barycenter")&&zW(m,v)}});var c=FW(u,n);$W(c,l);var d=qW(c,r);if(o&&(d.vs=rr.flatten([o,d.vs,a],!0),e.predecessors(o).length)){var f=e.node(e.predecessors(o)[0]),p=e.node(e.predecessors(a)[0]);rr.has(d,"barycenter")||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+f.order+p.order)/(d.weight+2),d.weight+=2}return d}function $W(e,t){rr.forEach(e,function(n){n.vs=rr.flatten(n.vs.map(function(r){return t[r]?t[r].vs:r}),!0)})}function zW(e,t){rr.isUndefined(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}var zs=Ne,BW=Xt.Graph,HW=UW;function UW(e,t,n){var r=WW(e),i=new BW({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(s){return e.node(s)});return zs.forEach(e.nodes(),function(s){var o=e.node(s),a=e.parent(s);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(s),i.setParent(s,a||r),zs.forEach(e[n](s),function(l){var u=l.v===s?l.w:l.v,c=i.edge(u,s),d=zs.isUndefined(c)?0:c.weight;i.setEdge(u,s,{weight:e.edge(l).weight+d})}),zs.has(o,"minRank")&&i.setNode(s,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function WW(e){for(var t;e.hasNode(t=zs.uniqueId("_root")););return t}var GW=Ne,YW=KW;function KW(e,t,n){var r={},i;GW.forEach(n,function(s){for(var o=e.parent(s),a,l;o;){if(a=e.parent(o),a?(l=r[a],r[a]=o):(l=i,i=o),l&&l!==o){t.setEdge(l,o);return}o=a}})}var pr=Ne,XW=_W,QW=NW,ZW=VW,JW=HW,eG=YW,tG=Xt.Graph,FE=ht,nG=rG;function rG(e){var t=FE.maxRank(e),n=qE(e,pr.range(1,t+1),"inEdges"),r=qE(e,pr.range(t-1,-1,-1),"outEdges"),i=XW(e);VE(e,i);for(var s=Number.POSITIVE_INFINITY,o,a=0,l=0;l<4;++a,++l){iG(a%2?n:r,a%4>=2),i=FE.buildLayerMatrix(e);var u=QW(e,i);u<s&&(l=0,o=pr.cloneDeep(i),s=u)}VE(e,o)}function qE(e,t,n){return pr.map(t,function(r){return JW(e,r,n)})}function iG(e,t){var n=new tG;pr.forEach(e,function(r){var i=r.graph().root,s=ZW(r,i,n,t);pr.forEach(s.vs,function(o,a){r.node(o).order=a}),eG(r,n,s.vs)})}function VE(e,t){pr.forEach(t,function(n){pr.forEach(n,function(r,i){e.node(r).order=i})})}var ie=Ne,sG=Xt.Graph,oG=ht,aG={positionX:vG};function lG(e,t){var n={};function r(i,s){var o=0,a=0,l=i.length,u=ie.last(s);return ie.forEach(s,function(c,d){var f=cG(e,c),p=f?e.node(f).order:l;(f||c===u)&&(ie.forEach(s.slice(a,d+1),function(m){ie.forEach(e.predecessors(m),function(v){var w=e.node(v),g=w.order;(g<o||p<g)&&!(w.dummy&&e.node(m).dummy)&&cI(n,v,m)})}),a=d+1,o=p)}),s}return ie.reduce(t,r),n}function uG(e,t){var n={};function r(s,o,a,l,u){var c;ie.forEach(ie.range(o,a),function(d){c=s[d],e.node(c).dummy&&ie.forEach(e.predecessors(c),function(f){var p=e.node(f);p.dummy&&(p.order<l||p.order>u)&&cI(n,f,c)})})}function i(s,o){var a=-1,l,u=0;return ie.forEach(o,function(c,d){if(e.node(c).dummy==="border"){var f=e.predecessors(c);f.length&&(l=e.node(f[0]).order,r(o,u,d,a,l),u=d,a=l)}r(o,u,o.length,l,s.length)}),o}return ie.reduce(t,i),n}function cG(e,t){if(e.node(t).dummy)return ie.find(e.predecessors(t),function(n){return e.node(n).dummy})}function cI(e,t,n){if(t>n){var r=t;t=n,n=r}var i=e[t];i||(e[t]=i={}),i[n]=!0}function dG(e,t,n){if(t>n){var r=t;t=n,n=r}return ie.has(e[t],n)}function fG(e,t,n,r){var i={},s={},o={};return ie.forEach(t,function(a){ie.forEach(a,function(l,u){i[l]=l,s[l]=l,o[l]=u})}),ie.forEach(t,function(a){var l=-1;ie.forEach(a,function(u){var c=r(u);if(c.length){c=ie.sortBy(c,function(v){return o[v]});for(var d=(c.length-1)/2,f=Math.floor(d),p=Math.ceil(d);f<=p;++f){var m=c[f];s[u]===u&&l<o[m]&&!dG(n,u,m)&&(s[m]=u,s[u]=i[u]=i[m],l=o[m])}}})}),{root:i,align:s}}function hG(e,t,n,r,i){var s={},o=pG(e,t,n,i),a=i?"borderLeft":"borderRight";function l(d,f){for(var p=o.nodes(),m=p.pop(),v={};m;)v[m]?d(m):(v[m]=!0,p.push(m),p=p.concat(f(m))),m=p.pop()}function u(d){s[d]=o.inEdges(d).reduce(function(f,p){return Math.max(f,s[p.v]+o.edge(p))},0)}function c(d){var f=o.outEdges(d).reduce(function(m,v){return Math.min(m,s[v.w]-o.edge(v))},Number.POSITIVE_INFINITY),p=e.node(d);f!==Number.POSITIVE_INFINITY&&p.borderType!==a&&(s[d]=Math.max(s[d],f))}return l(u,o.predecessors.bind(o)),l(c,o.successors.bind(o)),ie.forEach(r,function(d){s[d]=s[n[d]]}),s}function pG(e,t,n,r){var i=new sG,s=e.graph(),o=xG(s.nodesep,s.edgesep,r);return ie.forEach(t,function(a){var l;ie.forEach(a,function(u){var c=n[u];if(i.setNode(c),l){var d=n[l],f=i.edge(d,c);i.setEdge(d,c,Math.max(o(e,u,l),f||0))}l=u})}),i}function mG(e,t){return ie.minBy(ie.values(t),function(n){var r=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return ie.forIn(n,function(s,o){var a=wG(e,o)/2;r=Math.max(s+a,r),i=Math.min(s-a,i)}),r-i})}function gG(e,t){var n=ie.values(t),r=ie.min(n),i=ie.max(n);ie.forEach(["u","d"],function(s){ie.forEach(["l","r"],function(o){var a=s+o,l=e[a],u;if(l!==t){var c=ie.values(l);u=o==="l"?r-ie.min(c):i-ie.max(c),u&&(e[a]=ie.mapValues(l,function(d){return d+u}))}})})}function yG(e,t){return ie.mapValues(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=ie.sortBy(ie.map(e,r));return(i[1]+i[2])/2})}function vG(e){var t=oG.buildLayerMatrix(e),n=ie.merge(lG(e,t),uG(e,t)),r={},i;ie.forEach(["u","d"],function(o){i=o==="u"?t:ie.values(t).reverse(),ie.forEach(["l","r"],function(a){a==="r"&&(i=ie.map(i,function(d){return ie.values(d).reverse()}));var l=(o==="u"?e.predecessors:e.successors).bind(e),u=fG(e,i,n,l),c=hG(e,i,u.root,u.align,a==="r");a==="r"&&(c=ie.mapValues(c,function(d){return-d})),r[o+a]=c})});var s=mG(e,r);return gG(r,s),yG(r,e.graph().align)}function xG(e,t,n){return function(r,i,s){var o=r.node(i),a=r.node(s),l=0,u;if(l+=o.width/2,ie.has(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=n?u:-u),u=0,l+=(o.dummy?t:e)/2,l+=(a.dummy?t:e)/2,l+=a.width/2,ie.has(a,"labelpos"))switch(a.labelpos.toLowerCase()){case"l":u=a.width/2;break;case"r":u=-a.width/2;break}return u&&(l+=n?u:-u),u=0,l}}function wG(e,t){return e.node(t).width}var Bs=Ne,dI=ht,bG=aG.positionX,_G=SG;function SG(e){e=dI.asNonCompoundGraph(e),NG(e),Bs.forEach(bG(e),function(t,n){e.node(n).x=t})}function NG(e){var t=dI.buildLayerMatrix(e),n=e.graph().ranksep,r=0;Bs.forEach(t,function(i){var s=Bs.max(Bs.map(i,function(o){return e.node(o).height}));Bs.forEach(i,function(o){e.node(o).y=r+s/2}),r+=s+n})}var oe=Ne,$E=p7,zE=M7,EG=tW,CG=ht.normalizeRanks,kG=sW,PG=ht.removeEmptyRanks,BE=uW,jG=mW,HE=yW,TG=nG,MG=_G,br=ht,AG=Xt.Graph,IG=RG;function RG(e,t){var n=t&&t.debugTiming?br.time:br.notime;n("layout",function(){var r=n(" buildLayoutGraph",function(){return UG(e)});n(" runLayout",function(){DG(r,n)}),n(" updateInputGraph",function(){OG(e,r)})})}function DG(e,t){t(" makeSpaceForEdgeLabels",function(){WG(e)}),t(" removeSelfEdges",function(){tY(e)}),t(" acyclic",function(){$E.run(e)}),t(" nestingGraph.run",function(){BE.run(e)}),t(" rank",function(){EG(br.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){GG(e)}),t(" removeEmptyRanks",function(){PG(e)}),t(" nestingGraph.cleanup",function(){BE.cleanup(e)}),t(" normalizeRanks",function(){CG(e)}),t(" assignRankMinMax",function(){YG(e)}),t(" removeEdgeLabelProxies",function(){KG(e)}),t(" normalize.run",function(){zE.run(e)}),t(" parentDummyChains",function(){kG(e)}),t(" addBorderSegments",function(){jG(e)}),t(" order",function(){TG(e)}),t(" insertSelfEdges",function(){nY(e)}),t(" adjustCoordinateSystem",function(){HE.adjust(e)}),t(" position",function(){MG(e)}),t(" positionSelfEdges",function(){rY(e)}),t(" removeBorderNodes",function(){eY(e)}),t(" normalize.undo",function(){zE.undo(e)}),t(" fixupEdgeLabelCoords",function(){ZG(e)}),t(" undoCoordinateSystem",function(){HE.undo(e)}),t(" translateGraph",function(){XG(e)}),t(" assignNodeIntersects",function(){QG(e)}),t(" reversePoints",function(){JG(e)}),t(" acyclic.undo",function(){$E.undo(e)})}function OG(e,t){oe.forEach(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),oe.forEach(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,oe.has(i,"x")&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var LG=["nodesep","edgesep","ranksep","marginx","marginy"],FG={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},qG=["acyclicer","ranker","rankdir","align"],VG=["width","height"],$G={width:0,height:0},zG=["minlen","weight","width","height","labeloffset"],BG={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},HG=["labelpos"];function UG(e){var t=new AG({multigraph:!0,compound:!0}),n=og(e.graph());return t.setGraph(oe.merge({},FG,sg(n,LG),oe.pick(n,qG))),oe.forEach(e.nodes(),function(r){var i=og(e.node(r));t.setNode(r,oe.defaults(sg(i,VG),$G)),t.setParent(r,e.parent(r))}),oe.forEach(e.edges(),function(r){var i=og(e.edge(r));t.setEdge(r,oe.merge({},BG,sg(i,zG),oe.pick(i,HG)))}),t}function WG(e){var t=e.graph();t.ranksep/=2,oe.forEach(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!=="c"&&(t.rankdir==="TB"||t.rankdir==="BT"?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function GG(e){oe.forEach(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),i=e.node(t.w),s={rank:(i.rank-r.rank)/2+r.rank,e:t};br.addDummyNode(e,"edge-proxy",s,"_ep")}})}function YG(e){var t=0;oe.forEach(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=oe.max(t,r.maxRank))}),e.graph().maxRank=t}function KG(e){oe.forEach(e.nodes(),function(t){var n=e.node(t);n.dummy==="edge-proxy"&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function XG(e){var t=Number.POSITIVE_INFINITY,n=0,r=Number.POSITIVE_INFINITY,i=0,s=e.graph(),o=s.marginx||0,a=s.marginy||0;function l(u){var c=u.x,d=u.y,f=u.width,p=u.height;t=Math.min(t,c-f/2),n=Math.max(n,c+f/2),r=Math.min(r,d-p/2),i=Math.max(i,d+p/2)}oe.forEach(e.nodes(),function(u){l(e.node(u))}),oe.forEach(e.edges(),function(u){var c=e.edge(u);oe.has(c,"x")&&l(c)}),t-=o,r-=a,oe.forEach(e.nodes(),function(u){var c=e.node(u);c.x-=t,c.y-=r}),oe.forEach(e.edges(),function(u){var c=e.edge(u);oe.forEach(c.points,function(d){d.x-=t,d.y-=r}),oe.has(c,"x")&&(c.x-=t),oe.has(c,"y")&&(c.y-=r)}),s.width=n-t+o,s.height=i-r+a}function QG(e){oe.forEach(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),s,o;n.points?(s=n.points[0],o=n.points[n.points.length-1]):(n.points=[],s=i,o=r),n.points.unshift(br.intersectRect(r,s)),n.points.push(br.intersectRect(i,o))})}function ZG(e){oe.forEach(e.edges(),function(t){var n=e.edge(t);if(oe.has(n,"x"))switch((n.labelpos==="l"||n.labelpos==="r")&&(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset;break}})}function JG(e){oe.forEach(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function eY(e){oe.forEach(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),s=e.node(oe.last(n.borderLeft)),o=e.node(oe.last(n.borderRight));n.width=Math.abs(o.x-s.x),n.height=Math.abs(i.y-r.y),n.x=s.x+n.width/2,n.y=r.y+n.height/2}}),oe.forEach(e.nodes(),function(t){e.node(t).dummy==="border"&&e.removeNode(t)})}function tY(e){oe.forEach(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function nY(e){var t=br.buildLayerMatrix(e);oe.forEach(t,function(n){var r=0;oe.forEach(n,function(i,s){var o=e.node(i);o.order=s+r,oe.forEach(o.selfEdges,function(a){br.addDummyNode(e,"selfedge",{width:a.label.width,height:a.label.height,rank:o.rank,order:s+ ++r,e:a.e,label:a.label},"_se")}),delete o.selfEdges})})}function rY(e){oe.forEach(e.nodes(),function(t){var n=e.node(t);if(n.dummy==="selfedge"){var r=e.node(n.e.v),i=r.x+r.width/2,s=r.y,o=n.x-i,a=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:s-a},{x:i+5*o/6,y:s-a},{x:i+o,y:s},{x:i+5*o/6,y:s+a},{x:i+2*o/3,y:s+a}],n.label.x=n.x,n.label.y=n.y}})}function sg(e,t){return oe.mapValues(oe.pick(e,t),Number)}function og(e){var t={};return oe.forEach(e,function(n,r){t[r.toLowerCase()]=n}),t}var Ya=Ne,iY=ht,sY=Xt.Graph,oY={debugOrdering:aY};function aY(e){var t=iY.buildLayerMatrix(e),n=new sY({compound:!0,multigraph:!0}).setGraph({});return Ya.forEach(e.nodes(),function(r){n.setNode(r,{label:r}),n.setParent(r,"layer"+e.node(r).rank)}),Ya.forEach(e.edges(),function(r){n.setEdge(r.v,r.w,{},r.name)}),Ya.forEach(t,function(r,i){var s="layer"+i;n.setNode(s,{rank:"same"}),Ya.reduce(r,function(o,a){return n.setEdge(o,a,{style:"invis"}),a})}),n}var lY="0.8.5",uY={graphlib:Xt,layout:IG,debug:oY,util:{time:ht.time,notime:ht.notime},version:lY};const UE=Ly(uY),WE=280,GE=140;function cY(){return{layoutNodes:T.useCallback((t,n)=>{if(t.length===0)return t;const r=new UE.graphlib.Graph;return r.setDefaultEdgeLabel(()=>({})),r.setGraph({rankdir:"TB",nodesep:100,ranksep:200,marginx:60,marginy:60,edgesep:50}),t.forEach(i=>{r.setNode(i.id,{width:WE,height:GE})}),n.forEach(i=>{r.setEdge(i.source,i.target)}),UE.layout(r),t.map(i=>{const s=r.node(i.id);return{...i,position:{x:s.x-WE/2,y:s.y-GE/2}}})},[])}}const dY=150,fY=50,hY={task:dH,decision:fH},pY={insertable:hH};function mY({plan:e,completedCount:t,totalCount:n,onClose:r}){const i=n>0?Math.round(t/n*100):0,s=()=>{switch(e.status){case"completed":return h.jsx(zM,{className:"w-4 h-4 text-accent-green"});case"failed":return h.jsx(I0,{className:"w-4 h-4 text-accent-red"});case"executing":return h.jsx(qo,{className:"w-4 h-4 text-accent-yellow animate-spin"});case"paused":return h.jsx(A0,{className:"w-4 h-4 text-accent-orange"});case"streaming":return h.jsx(qo,{className:"w-4 h-4 text-accent-blue animate-spin"});default:return h.jsx(Fo,{className:"w-4 h-4 text-text-muted"})}},o=()=>{switch(e.status){case"completed":return"bg-accent-green/10 text-accent-green";case"failed":return"bg-accent-red/10 text-accent-red";case"executing":return"bg-accent-yellow/10 text-accent-yellow";case"paused":return"bg-accent-orange/10 text-accent-orange";case"streaming":return"bg-accent-blue/10 text-accent-blue";case"ready":return"bg-accent-blue/10 text-accent-blue";case"approved":return"bg-accent-purple/10 text-accent-purple";default:return"bg-surface-raised text-text-muted"}};return h.jsxs(xe.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"flex items-center gap-3 px-3 py-2 rounded-lg bg-surface/90 backdrop-blur-sm border border-border shadow-lg",children:[s(),h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.title}),h.jsxs("span",{className:"text-xs text-text-muted flex items-center gap-1",children:[h.jsx(oH,{className:"w-3 h-3"}),e.agent]})]}),n>0&&h.jsxs("div",{className:"flex items-center gap-2 pl-3 border-l border-border",children:[h.jsxs("div",{className:"flex flex-col items-end",children:[h.jsxs("span",{className:"text-xs text-text-muted",children:[t,"/",n]}),h.jsxs("span",{className:"text-[10px] text-text-muted",children:[i,"%"]})]}),h.jsx("div",{className:"w-16 h-1.5 bg-surface-raised rounded-full overflow-hidden",children:h.jsx("div",{className:`h-full rounded-full transition-all duration-500 ${e.status==="completed"?"bg-accent-green":e.status==="failed"?"bg-accent-red":"bg-accent-blue"}`,style:{width:`${i}%`}})})]}),h.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${o()}`,children:e.status}),r&&h.jsx("button",{onClick:a=>{a.stopPropagation(),r()},className:"ml-1 p-1 rounded hover:bg-surface-raised transition-colors text-text-muted hover:text-text-primary",title:"Remove plan from canvas",children:h.jsx(wr,{className:"w-3.5 h-3.5"})})]})}function gY(e,t,n,r,i){const{plan:s,nodes:o,edges:a}=e,l=s.status==="executing",u=s.status==="paused",c=s.status==="completed",d=s.status==="ready"||s.status==="approved"||s.status==="streaming",f=new Set,p=new Set;let m=null;o.forEach(k=>{(k.status==="completed"||k.status==="active"||k.status==="failed")&&f.add(k.id),k.status==="completed"&&p.add(k.id),k.status==="active"&&(m=k.id)});let v=null;if((s.status==="approved"||s.status==="executing"||s.status==="paused")&&!m){for(const k of a)if(p.has(k.from)){const I=o.find(F=>F.id===k.to);if(I&&I.status==="pending"){let F=!1;if(I.branchParent&&I.branchId){const S=o.find(P=>P.id===I.branchParent);S!=null&&S.selectedBranchId&&S.selectedBranchId!==I.branchId&&(F=!0)}if(!F){v=I.id;break}}}if(!v&&o.length>0){const k=o[0];k.status==="pending"&&(v=k.id)}}const w={};o.forEach(k=>{k.type==="decision"&&k.selectedBranchId&&(w[k.id]=k.selectedBranchId)});const g={},x={};a.forEach(k=>{g[k.from]=(g[k.from]||0)+1,x[k.to]=(x[k.to]||0)+1});const y=o.map(k=>{let I=!1;if(k.branchParent&&k.branchId){const A=w[k.branchParent];A&&A!==k.branchId&&(I=!0)}const F=l&&!f.has(k.id)&&!I,S=(g[k.id]||0)>1,P=(x[k.id]||0)>1,L=d&&!S,N=d&&!S&&!P;return{id:`${s.id}:${k.id}`,type:k.type,position:{x:0,y:0},data:{...k,planId:s.id,isDisabledBranch:I,isUnexecuted:F,isExecuting:l||u,isCompleted:c,isNextToExecute:k.id===v,canModify:d,canInsertAfter:L,canRemove:N,onInsertNode:n,onRemoveNode:r}}}),b=a.map(k=>{const I=o.find(R=>R.id===k.from),F=o.find(R=>R.id===k.to);let S=!1;if(F!=null&&F.branchParent&&(F!=null&&F.branchId)){const R=w[F.branchParent];R&&R!==F.branchId&&(S=!0)}const P=(F==null?void 0:F.status)==="active",L=I&&f.has(I.id)&&F&&f.has(F.id),N=l&&!L&&!S;let A="#3f3f46";return S?A="#27272a":P?A="#eab308":L?A="#22c55e":N&&(A="#27272a"),{id:`${s.id}:${k.id}`,source:`${s.id}:${k.from}`,target:`${s.id}:${k.to}`,type:"insertable",animated:P,className:P?"edge-active-pulse":"",data:{planId:s.id,isActiveEdge:P,isExecutedEdge:L,isDisabledEdge:S,isUnexecutedEdge:N},style:{stroke:A,strokeWidth:P?3:2,opacity:S?.3:N?.4:1}}}),E=i(y,b);let C=0;return E.forEach(k=>{const I=k.position.x+280;I>C&&(C=I)}),{nodes:E.map(k=>({...k,position:{x:k.position.x+t,y:k.position.y+fY}})),edges:b,width:C}}function yY(){const{plans:e,setSelectedNodeId:t,setPendingInsert:n,clearPlan:r}=Ae(),{removeNode:i}=Jo(),[s,o,a]=TV([]),[l,u,c]=MV([]),{layoutNodes:d}=cY();T.useEffect(()=>{if(e.length===0){o([]),u([]);return}const v=[],w=[];let g=0;e.forEach(x=>{const{nodes:y,edges:b,width:E}=gY(x,g,n,i,d);v.push(...y),w.push(...b),g+=E+dY}),o(v),u(w)},[e,d,o,u,n,i]);const f=T.useCallback((v,w)=>{const g=w.id.split(":")[1],x=w.id.split(":")[0];t(g,x)},[t]),p=T.useCallback(()=>{t(null)},[t]),m=T.useCallback(v=>{r(v)},[r]);return h.jsxs("div",{className:"w-full h-full relative",children:[e.length>0&&h.jsx("div",{className:"absolute top-3 left-3 z-10 flex items-start gap-3 flex-wrap max-w-[calc(100%-24px)]",children:e.map(v=>h.jsx(mY,{plan:v.plan,completedCount:v.completedCount,totalCount:v.totalCount,onClose:e.length>1?()=>m(v.plan.id):void 0},v.plan.id))}),h.jsx(Dn,{children:h.jsxs(kV,{nodes:s,edges:l,onNodesChange:a,onEdgesChange:c,onNodeClick:f,onPaneClick:p,nodeTypes:hY,edgeTypes:pY,connectionMode:Zr.Loose,fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.5},minZoom:.1,maxZoom:2,children:[h.jsx(OV,{variant:kn.Dots,gap:20,size:1,color:"#27272a"}),h.jsx(BV,{showInteractive:!1,className:"!bg-surface !border-border !rounded-lg"}),h.jsx(n$,{nodeColor:v=>{const w=v.data;switch(w==null?void 0:w.status){case"completed":return"#22c55e";case"active":return"#eab308";case"failed":return"#ef4444";default:return"#3f3f46"}},maskColor:"rgba(10, 10, 11, 0.8)",className:"!bg-surface/80 !border-border !rounded-lg"})]})}),e.length===0&&h.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:h.jsxs("div",{className:"text-center",children:[h.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-surface/50 border border-border flex items-center justify-center",children:h.jsx(ou,{className:"w-8 h-8 text-text-muted"})}),h.jsx("h3",{className:"text-lg font-medium text-text-primary mb-2",children:"Waiting for plan..."}),h.jsx("p",{className:"text-sm text-text-muted max-w-xs",children:"Give your AI agent a task and watch the execution plan appear here in real-time."})]})})]})}function vY({tab:e,isActive:t,onActivate:n,onClose:r}){return h.jsxs(xe.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:`
354
+ group flex items-center gap-2 px-3 py-1.5 rounded-t-lg cursor-pointer
355
+ transition-colors relative
356
+ ${t?"bg-surface text-text-primary border-t border-l border-r border-border":"bg-surface-raised/50 text-text-secondary hover:text-text-primary hover:bg-surface-raised"}
357
+ `,onClick:n,children:[h.jsx(M0,{className:"w-3.5 h-3.5 flex-shrink-0"}),h.jsx("span",{className:"text-xs font-medium truncate max-w-[120px]",children:e.projectName}),e.unreadUpdates>0&&!t&&h.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-accent-blue/20 text-accent-blue text-[10px] font-medium",children:e.unreadUpdates>9?"9+":e.unreadUpdates}),h.jsx("button",{onClick:i=>{i.stopPropagation(),r()},className:`
358
+ opacity-0 group-hover:opacity-100
359
+ ml-1 p-0.5 rounded hover:bg-border/50
360
+ transition-opacity
361
+ `,children:h.jsx(wr,{className:"w-3 h-3"})}),t&&h.jsx(xe.div,{layoutId:"activeTabIndicator",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-accent-blue"})]})}function xY(){const{tabs:e,activeTabId:t,setActiveTab:n,removeTab:r,isHistoryPanelOpen:i,toggleHistoryPanel:s}=ri();return e.length<=1?null:h.jsxs("div",{className:"h-8 bg-surface-raised/30 border-b border-border flex items-end px-2 gap-1 overflow-x-auto",children:[h.jsx(Dn,{mode:"popLayout",children:e.map(o=>h.jsx(vY,{tab:o,isActive:o.projectId===t,onActivate:()=>n(o.projectId),onClose:()=>r(o.projectId)},o.projectId))}),h.jsx("div",{className:"flex-1"}),h.jsxs("button",{onClick:s,className:`
362
+ flex items-center gap-1.5 px-2 py-1 rounded text-xs
363
+ transition-colors mb-1
364
+ ${i?"bg-accent-blue/20 text-accent-blue":"text-text-muted hover:text-text-secondary hover:bg-surface-raised"}
365
+ `,title:"View History",children:[h.jsx(GM,{className:"w-3.5 h-3.5"}),h.jsx("span",{className:"hidden sm:inline",children:"History"})]})]})}function wY(){const{plan:e,isConnected:t,completedCount:n,totalCount:r}=Ae(),{tabs:i,toggleHistoryPanel:s,isHistoryPanelOpen:o}=ri(),{pauseExecution:a,resumeExecution:l}=Jo(),u=(e==null?void 0:e.status)==="executing",c=(e==null?void 0:e.status)==="paused",d=(e==null?void 0:e.status)==="approved",f=u||c||d,p=r>0?n/r*100:0,m=i.length>1;return h.jsxs("div",{className:"flex flex-col",children:[h.jsxs("header",{className:"h-14 border-b border-border bg-surface/50 backdrop-blur-sm flex items-center justify-between px-4",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-accent-blue to-accent-purple flex items-center justify-center",children:h.jsx(ou,{className:"w-4 h-4 text-white"})}),h.jsx("span",{className:"font-semibold text-text-primary",children:"Overture"})]}),e&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"w-px h-6 bg-border"}),h.jsx("span",{className:"text-text-secondary text-sm",children:e.title})]})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[e&&(e.status==="executing"||e.status==="paused")&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-xs text-text-muted",children:[n,"/",r]}),h.jsx("div",{className:"w-32 h-1.5 bg-surface-raised rounded-full overflow-hidden",children:h.jsx("div",{className:"h-full bg-gradient-to-r from-accent-blue to-accent-green rounded-full transition-all duration-500",style:{width:`${p}%`}})})]}),f&&h.jsx("button",{onClick:()=>c?l():a(),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium transition-all
366
+ ${c?"bg-accent-green/20 text-accent-green hover:bg-accent-green/30":"bg-surface-raised text-text-secondary hover:bg-surface-overlay"}`,children:c?h.jsxs(h.Fragment,{children:[h.jsx(KM,{className:"w-3.5 h-3.5"}),"Resume"]}):h.jsxs(h.Fragment,{children:[h.jsx(A0,{className:"w-3.5 h-3.5"}),"Pause"]})}),e&&h.jsx("div",{className:`px-2 py-1 rounded-full text-xs font-medium ${e.status==="streaming"?"bg-accent-yellow/10 text-accent-yellow":e.status==="ready"?"bg-accent-blue/10 text-accent-blue":e.status==="approved"?"bg-accent-purple/10 text-accent-purple":e.status==="executing"?"bg-accent-yellow/10 text-accent-yellow":e.status==="paused"?"bg-accent-orange/10 text-accent-orange animate-pulse":e.status==="completed"?"bg-accent-green/10 text-accent-green":"bg-accent-red/10 text-accent-red"}`,children:e.status}),!m&&h.jsx("button",{onClick:s,className:`
367
+ flex items-center gap-1.5 px-2 py-1.5 rounded-lg text-xs
368
+ transition-colors
369
+ ${o?"bg-accent-blue/20 text-accent-blue":"text-text-muted hover:text-text-secondary hover:bg-surface-raised"}
370
+ `,title:"View History",children:h.jsx(GM,{className:"w-4 h-4"})}),h.jsx("div",{className:"flex items-center gap-1.5",children:t?h.jsxs(h.Fragment,{children:[h.jsx(lH,{className:"w-4 h-4 text-accent-green"}),h.jsx("span",{className:"text-xs text-accent-green",children:"Connected"})]}):h.jsxs(h.Fragment,{children:[h.jsx(aH,{className:"w-4 h-4 text-text-muted"}),h.jsx("span",{className:"text-xs text-text-muted",children:"Disconnected"})]})})]})]}),h.jsx(xY,{})]})}function bY(){return h.jsxs("footer",{className:"h-10 border-t border-border bg-surface/30 flex items-center justify-between px-4",children:[h.jsxs("div",{className:"text-xs text-text-muted flex items-center gap-4",children:[h.jsxs("span",{children:["Built by"," ",h.jsx("a",{href:"https://trysixth.com",target:"_blank",rel:"noopener noreferrer",className:"text-accent-blue hover:text-accent-blue/80 transition-colors",children:"Sixth"})," · with ❤️ · ",h.jsx("a",{href:"https://github.com/SixHq/Overture",target:"_blank",rel:"noopener noreferrer",className:"text-accent-green hover:text-accent-green/80 transition-colors",children:"Open Source"})]}),h.jsxs("span",{className:"text-text-muted/70",children:["Try out Overture on"," ",h.jsx("a",{href:"https://marketplace.visualstudio.com/items?itemName=Sixth.sixth-ai",target:"_blank",rel:"noopener noreferrer",className:"text-accent-purple hover:text-accent-purple/80 transition-colors font-medium",children:"Sixth"})," ","with VS Code for a more optimized workflow"]})]}),h.jsxs("div",{className:"text-xs text-text-muted",children:["Press ",h.jsx("kbd",{className:"px-1.5 py-0.5 bg-surface rounded text-text-secondary font-mono",children:"?"})," for shortcuts"]})]})}function _Y({field:e,onChange:t}){const[n,r]=T.useState(!1),[i,s]=T.useState(!1),o=fe("w-full px-2 py-1.5 rounded-md","bg-canvas border border-border","text-xs text-text-primary placeholder-text-muted","focus:outline-none focus:ring-1 focus:ring-accent-blue focus:border-transparent","transition-all duration-200"),a=()=>{var l;switch(e.type){case"secret":return h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:n?"text":"password",value:e.value||"",onChange:c=>t(c.target.value),placeholder:`Enter ${e.title.toLowerCase()}`,className:fe(o,"pr-8 font-mono")}),h.jsx("button",{type:"button",onClick:()=>r(!n),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-primary transition-colors",children:n?h.jsx(B6,{className:"w-3 h-3"}):h.jsx(H6,{className:"w-3 h-3"})})]});case"select":const u=((l=e.options)==null?void 0:l.split(",").map(c=>c.trim()))||[];return h.jsxs("select",{value:e.value||"",onChange:c=>t(c.target.value),className:fe(o,"cursor-pointer"),children:[h.jsxs("option",{value:"",children:["Select ",e.title.toLowerCase()]}),u.map(c=>h.jsx("option",{value:c,children:c},c))]});case"boolean":return h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:"checkbox",checked:e.value==="true",onChange:c=>t(c.target.checked?"true":"false"),className:"sr-only"}),h.jsx("div",{className:fe("w-8 h-5 rounded-full transition-colors",e.value==="true"?"bg-accent-blue":"bg-border"),children:h.jsx("div",{className:fe("absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform",e.value==="true"?"translate-x-3.5":"translate-x-0.5")})})]}),h.jsx("span",{className:"text-xs text-text-secondary",children:e.value==="true"?"Enabled":"Disabled"})]});case"number":return h.jsx("input",{type:"number",value:e.value||"",onChange:c=>t(c.target.value),placeholder:`Enter ${e.title.toLowerCase()}`,className:fe(o,"font-mono")});default:return h.jsx("input",{type:"text",value:e.value||"",onChange:c=>t(c.target.value),placeholder:`Enter ${e.title.toLowerCase()}`,className:o})}};return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsxs("label",{className:"text-xs font-medium text-text-primary flex items-center gap-1",children:[e.title,e.required&&h.jsx("span",{className:"text-accent-red",children:"*"})]}),e.setupInstructions&&h.jsx("button",{type:"button",onClick:()=>s(!i),className:"text-text-muted hover:text-text-primary transition-colors",children:h.jsx(X6,{className:"w-3 h-3"})})]}),e.description&&h.jsx("p",{className:"text-[10px] text-text-muted mb-1",children:e.description}),i&&e.setupInstructions&&h.jsx("div",{className:"mb-1.5 p-1.5 rounded-md bg-accent-blue/10 border border-accent-blue/20 text-[10px] text-accent-blue",children:e.setupInstructions}),a(),e.required&&!e.value&&h.jsx("p",{className:"text-[10px] text-accent-yellow mt-0.5",children:"Required"})]})}function SY({branches:e,selectedBranchId:t,onSelect:n}){return h.jsx("div",{className:"space-y-3",children:e.map((r,i)=>{const s=t===r.id;return h.jsxs(xe.button,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:i*.05},onClick:()=>n(r.id),className:fe("w-full text-left p-4 rounded-xl border-2 transition-all duration-200",{"border-accent-green bg-accent-green/10 shadow-glow-green":s,"border-border hover:border-border-subtle bg-surface-raised":!s}),children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("h4",{className:"font-medium text-sm text-text-primary",children:r.label}),s&&h.jsx(xe.div,{initial:{scale:0},animate:{scale:1},className:"w-5 h-5 rounded-full bg-accent-green flex items-center justify-center",children:h.jsx(BM,{className:"w-3 h-3 text-white"})})]}),r.description&&h.jsx("p",{className:"text-xs text-text-muted mb-3",children:r.description}),(r.pros||r.cons)&&h.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-3 border-t border-border",children:[r.pros&&h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[h.jsx(sH,{className:"w-3 h-3 text-accent-green"}),h.jsx("span",{className:"text-[10px] text-accent-green font-medium uppercase",children:"Pros"})]}),h.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed",children:r.pros})]}),r.cons&&h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[h.jsx(iH,{className:"w-3 h-3 text-accent-red"}),h.jsx("span",{className:"text-[10px] text-accent-red font-medium uppercase",children:"Cons"})]}),h.jsx("p",{className:"text-[11px] text-text-secondary leading-relaxed",children:r.cons})]})]})]},r.id)})})}const NY="/api/mcp-marketplace",YE={"browser-automation":{color:"text-blue-400",bg:"bg-blue-500/10"},"cloud-platforms":{color:"text-cyan-400",bg:"bg-cyan-500/10"},"image-video-processing":{color:"text-purple-400",bg:"bg-purple-500/10"},database:{color:"text-green-400",bg:"bg-green-500/10"},"development-tools":{color:"text-orange-400",bg:"bg-orange-500/10"},communication:{color:"text-pink-400",bg:"bg-pink-500/10"},default:{color:"text-gray-400",bg:"bg-gray-500/10"}};function EY({isOpen:e,onClose:t,nodeId:n,planId:r,currentMcps:i}){const{addNodeMcpServer:s,addMcpServerToAllNodes:o}=Ae(),[a,l]=T.useState([]),[u,c]=T.useState(!0),[d,f]=T.useState(null),[p,m]=T.useState(""),[v,w]=T.useState("recommended"),[g,x]=T.useState("all"),[y,b]=T.useState(null),[E,C]=T.useState("grid"),[_,k]=T.useState(!1),[I,F]=T.useState(""),[S,P]=T.useState(!1);T.useEffect(()=>{if(!e)return;(async()=>{c(!0),f(null);try{const z=await fetch(NY);if(!z.ok)throw new Error("Failed to fetch MCP servers");const V=await z.json();l(V)}catch(z){f(z instanceof Error?z.message:"Failed to load MCP marketplace")}finally{c(!1)}})()},[e]),T.useEffect(()=>{e&&(b(null),k(!1),F(""),P(!1))},[e]);const L=T.useMemo(()=>{const D=new Set(a.map(z=>z.category));return Array.from(D).sort()},[a]),N=T.useMemo(()=>{let D=[...a];if(p){const z=p.toLowerCase();D=D.filter(V=>V.name.toLowerCase().includes(z)||V.description.toLowerCase().includes(z)||V.tags.some(U=>U.toLowerCase().includes(z))||V.author.toLowerCase().includes(z))}switch(g!=="all"&&(D=D.filter(z=>z.category===g)),v){case"recommended":D.sort((z,V)=>(V.isRecommended?1:0)-(z.isRecommended?1:0)||V.githubStars-z.githubStars);break;case"stars":D.sort((z,V)=>V.githubStars-z.githubStars);break;case"downloads":D.sort((z,V)=>V.downloadCount-z.downloadCount);break;case"name":D.sort((z,V)=>z.name.localeCompare(V.name));break;case"recent":D.sort((z,V)=>new Date(V.updatedAt).getTime()-new Date(z.updatedAt).getTime());break}return D},[a,p,g,v]),A=T.useCallback(D=>{b(D),k(!0)},[]),R=T.useCallback(D=>(i==null?void 0:i.some(z=>z.mcpId===D.mcpId))||!1,[i]),O=T.useCallback(()=>{if(y){const D={...y,usageDescription:I.trim()||void 0};S?o(D,r):s(n,D,r)}t()},[y,I,n,r,S,s,o,t]),j=D=>D>=1e6?`${(D/1e6).toFixed(1)}M`:D>=1e3?`${(D/1e3).toFixed(1)}k`:D.toString(),M=D=>D.split("-").map(z=>z.charAt(0).toUpperCase()+z.slice(1)).join(" "),q=D=>YE[D]||YE.default,$=D=>new Date(D).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return Av.createPortal(h.jsx(Dn,{children:e&&h.jsx(xe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] bg-canvas",children:h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs("header",{className:"h-14 border-b border-border bg-surface/80 backdrop-blur-xl flex items-center justify-between px-6 shrink-0",children:[h.jsx("div",{className:"flex items-center gap-4",children:_?h.jsxs("button",{onClick:()=>k(!1),className:"flex items-center gap-2 text-text-secondary hover:text-text-primary transition-colors",children:[h.jsx(q6,{className:"w-5 h-5"}),h.jsx("span",{className:"text-sm font-medium",children:"Back to Marketplace"})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-accent-purple via-accent-blue to-accent-cyan flex items-center justify-center shadow-lg shadow-accent-purple/20",children:h.jsx(ou,{className:"w-5 h-5 text-white"})}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-bold text-text-primary",children:"MCP Marketplace"}),h.jsx("p",{className:"text-xs text-text-muted",children:"Extend your node with powerful integrations"})]})]})}),h.jsx("button",{onClick:t,className:"w-10 h-10 rounded-xl bg-surface-raised hover:bg-surface-overlay flex items-center justify-center transition-colors",children:h.jsx(wr,{className:"w-5 h-5 text-text-muted"})})]}),h.jsx("div",{className:"flex-1 overflow-hidden flex",children:_?y&&h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"max-w-4xl mx-auto p-8",children:[h.jsxs("div",{className:"flex items-start gap-6 mb-8",children:[h.jsx("div",{className:"w-24 h-24 rounded-2xl bg-gradient-to-br from-surface-raised to-surface-overlay flex items-center justify-center overflow-hidden shadow-xl",children:y.logoUrl?h.jsx("img",{src:y.logoUrl,alt:y.name,className:"w-full h-full object-cover"}):h.jsx(so,{className:"w-12 h-12 text-text-muted"})}),h.jsxs("div",{className:"flex-1",children:[h.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[h.jsx("h2",{className:"text-3xl font-bold text-text-primary",children:y.name}),y.isRecommended&&h.jsxs("span",{className:"px-3 py-1 text-sm font-bold bg-gradient-to-r from-accent-yellow to-accent-orange text-white rounded-full flex items-center gap-1.5",children:[h.jsx(dd,{className:"w-4 h-4"}),"Featured"]})]}),h.jsxs("p",{className:"text-text-muted mb-4",children:["by ",y.author]}),h.jsx("p",{className:"text-lg text-text-secondary leading-relaxed",children:y.description})]})]}),h.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[h.jsxs("div",{className:"p-4 rounded-xl bg-surface border border-border",children:[h.jsxs("div",{className:"flex items-center gap-2 text-text-muted mb-1",children:[h.jsx(fd,{className:"w-4 h-4 text-accent-yellow"}),h.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Stars"})]}),h.jsx("p",{className:"text-2xl font-bold text-text-primary",children:j(y.githubStars)})]}),h.jsxs("div",{className:"p-4 rounded-xl bg-surface border border-border",children:[h.jsxs("div",{className:"flex items-center gap-2 text-text-muted mb-1",children:[h.jsx(Fb,{className:"w-4 h-4 text-accent-green"}),h.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Downloads"})]}),h.jsx("p",{className:"text-2xl font-bold text-text-primary",children:j(y.downloadCount)})]}),h.jsxs("div",{className:"p-4 rounded-xl bg-surface border border-border",children:[h.jsxs("div",{className:"flex items-center gap-2 text-text-muted mb-1",children:[h.jsx(rH,{className:"w-4 h-4 text-accent-purple"}),h.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Category"})]}),h.jsx("p",{className:"text-sm font-semibold text-text-primary",children:M(y.category)})]}),h.jsxs("div",{className:"p-4 rounded-xl bg-surface border border-border",children:[h.jsxs("div",{className:"flex items-center gap-2 text-text-muted mb-1",children:[h.jsx(Fo,{className:"w-4 h-4 text-accent-blue"}),h.jsx("span",{className:"text-xs uppercase tracking-wider",children:"Updated"})]}),h.jsx("p",{className:"text-sm font-semibold text-text-primary",children:$(y.updatedAt)})]})]}),y.requiresApiKey&&h.jsxs("div",{className:"p-4 rounded-xl bg-accent-yellow/10 border border-accent-yellow/20 mb-8 flex items-start gap-3",children:[h.jsx(Vb,{className:"w-5 h-5 text-accent-yellow shrink-0 mt-0.5"}),h.jsxs("div",{children:[h.jsx("p",{className:"font-semibold text-accent-yellow",children:"API Key Required"}),h.jsx("p",{className:"text-sm text-text-secondary mt-1",children:"This MCP server requires an API key to function. Make sure to configure it before use."})]})]}),y.tags.length>0&&h.jsxs("div",{className:"mb-8",children:[h.jsx("h3",{className:"text-sm font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Tags"}),h.jsx("div",{className:"flex flex-wrap gap-2",children:y.tags.map(D=>h.jsx("span",{className:"px-3 py-1.5 bg-surface-raised rounded-lg text-sm text-text-secondary",children:D},D))})]}),h.jsxs("div",{className:"mb-8 p-6 rounded-2xl bg-gradient-to-br from-accent-purple/5 to-accent-blue/5 border border-accent-purple/20",children:[h.jsxs("h3",{className:"text-lg font-semibold text-text-primary mb-2 flex items-center gap-2",children:[h.jsx(ou,{className:"w-5 h-5 text-accent-purple"}),"What will you use this MCP for?"]}),h.jsx("p",{className:"text-sm text-text-muted mb-4",children:"Describe how you want to use this MCP server for this specific node. This helps the AI understand your intent."}),h.jsx("textarea",{value:I,onChange:D=>F(D.target.value),placeholder:"e.g., Use this MCP to generate images based on the user's description, focusing on realistic photography style...",rows:4,className:`w-full px-4 py-3 bg-canvas border border-border rounded-xl text-sm text-text-primary
371
+ placeholder:text-text-muted focus:outline-none focus:ring-2 focus:ring-accent-purple/50
372
+ focus:border-accent-purple resize-none`})]}),h.jsxs("a",{href:y.githubUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-surface-raised hover:bg-surface-overlay rounded-xl text-sm text-text-secondary hover:text-text-primary transition-colors mb-8",children:[h.jsx(Y6,{className:"w-4 h-4"}),"View on GitHub",h.jsx(z6,{className:"w-3 h-3"})]}),h.jsx("div",{className:"mb-6 p-4 rounded-xl bg-surface border border-border",children:h.jsxs("label",{className:"flex items-center gap-3 cursor-pointer",children:[h.jsx("input",{type:"checkbox",checked:S,onChange:D=>P(D.target.checked),className:"w-5 h-5 rounded border-border text-accent-purple focus:ring-accent-purple/50 cursor-pointer"}),h.jsxs("div",{children:[h.jsx("span",{className:"text-sm font-medium text-text-primary",children:"Attach to all nodes"}),h.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"This MCP server will be available on every node in the plan"})]})]})}),h.jsxs("div",{className:"flex items-center gap-4 pt-6 border-t border-border",children:[h.jsx("div",{className:"flex-1"}),h.jsx("button",{onClick:()=>k(!1),className:"px-6 py-3 text-text-secondary hover:text-text-primary transition-colors font-medium",children:"Cancel"}),h.jsx("button",{onClick:O,className:`px-8 py-3 bg-gradient-to-r from-accent-purple to-accent-blue text-white rounded-xl font-semibold
373
+ hover:shadow-lg hover:shadow-accent-purple/25 hover:-translate-y-0.5 transition-all`,children:S?"Attach to All Nodes":"Attach MCP Server"})]})]})}):h.jsxs(h.Fragment,{children:[h.jsxs("aside",{className:"w-64 border-r border-border bg-surface/50 p-4 overflow-y-auto shrink-0 hidden lg:block",children:[h.jsx("h3",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider mb-3",children:"Categories"}),h.jsxs("nav",{className:"space-y-1",children:[h.jsxs("button",{onClick:()=>x("all"),className:fe("w-full text-left px-3 py-2 rounded-lg text-sm transition-all",g==="all"?"bg-accent-blue/10 text-accent-blue font-medium":"text-text-secondary hover:bg-surface-raised hover:text-text-primary"),children:["All Categories",h.jsx("span",{className:"float-right text-text-muted",children:a.length})]}),L.map(D=>{const z=q(D),V=a.filter(U=>U.category===D).length;return h.jsxs("button",{onClick:()=>x(D),className:fe("w-full text-left px-3 py-2 rounded-lg text-sm transition-all",g===D?`${z.bg} ${z.color} font-medium`:"text-text-secondary hover:bg-surface-raised hover:text-text-primary"),children:[M(D),h.jsx("span",{className:"float-right text-text-muted",children:V})]},D)})]})]}),h.jsxs("main",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"p-4 border-b border-border bg-surface/30 shrink-0",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs("div",{className:"relative flex-1 min-w-[280px]",children:[h.jsx($b,{className:"absolute left-4 top-1/2 -translate-y-1/2 w-5 h-5 text-text-muted"}),h.jsx("input",{type:"text",value:p,onChange:D=>m(D.target.value),placeholder:"Search MCP servers by name, description, or tags...",className:`w-full pl-12 pr-4 py-3 bg-canvas border border-border rounded-xl
374
+ text-sm text-text-primary placeholder:text-text-muted
375
+ focus:outline-none focus:ring-2 focus:ring-accent-blue/50 focus:border-accent-blue transition-all`})]}),h.jsxs("select",{value:g,onChange:D=>x(D.target.value),className:`lg:hidden px-4 py-3 bg-canvas border border-border rounded-xl text-sm
376
+ text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-blue/50`,children:[h.jsx("option",{value:"all",children:"All Categories"}),L.map(D=>h.jsx("option",{value:D,children:M(D)},D))]}),h.jsxs("select",{value:v,onChange:D=>w(D.target.value),className:`px-4 py-3 bg-canvas border border-border rounded-xl text-sm
377
+ text-text-primary focus:outline-none focus:ring-2 focus:ring-accent-blue/50`,children:[h.jsx("option",{value:"recommended",children:"Recommended"}),h.jsx("option",{value:"stars",children:"Most Stars"}),h.jsx("option",{value:"downloads",children:"Most Downloads"}),h.jsx("option",{value:"name",children:"Name (A-Z)"}),h.jsx("option",{value:"recent",children:"Recently Updated"})]}),h.jsxs("div",{className:"flex items-center bg-canvas border border-border rounded-xl p-1",children:[h.jsx("button",{onClick:()=>C("grid"),className:fe("p-2 rounded-lg transition-colors",E==="grid"?"bg-accent-blue text-white":"text-text-muted hover:text-text-primary"),children:h.jsx(K6,{className:"w-4 h-4"})}),h.jsx("button",{onClick:()=>C("list"),className:fe("p-2 rounded-lg transition-colors",E==="list"?"bg-accent-blue text-white":"text-text-muted hover:text-text-primary"),children:h.jsx(Z6,{className:"w-4 h-4"})})]})]}),h.jsxs("p",{className:"text-xs text-text-muted mt-3",children:[N.length," ",N.length===1?"server":"servers"," found"]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:u?h.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[h.jsx("div",{className:"w-12 h-12 border-3 border-accent-blue border-t-transparent rounded-full animate-spin mb-4"}),h.jsx("p",{className:"text-text-muted",children:"Loading MCP servers..."})]}):d?h.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[h.jsx("div",{className:"w-16 h-16 rounded-2xl bg-accent-red/10 flex items-center justify-center mb-4",children:h.jsx(wr,{className:"w-8 h-8 text-accent-red"})}),h.jsx("p",{className:"text-accent-red font-medium mb-2",children:d}),h.jsx("button",{onClick:()=>window.location.reload(),className:"text-sm text-accent-blue hover:underline",children:"Try again"})]}):N.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[h.jsx("div",{className:"w-16 h-16 rounded-2xl bg-surface-raised flex items-center justify-center mb-4",children:h.jsx($b,{className:"w-8 h-8 text-text-muted"})}),h.jsx("p",{className:"text-text-primary font-medium mb-1",children:"No servers found"}),h.jsx("p",{className:"text-text-muted text-sm",children:"Try adjusting your search or filters"})]}):E==="grid"?h.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:N.map((D,z)=>h.jsxs(xe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:z*.03},onClick:()=>A(D),className:fe("group p-5 rounded-2xl border-2 cursor-pointer transition-all duration-200","hover:shadow-xl hover:shadow-black/10 hover:-translate-y-1",(y==null?void 0:y.mcpId)===D.mcpId?"border-accent-blue bg-accent-blue/5 shadow-lg shadow-accent-blue/10":"border-border bg-surface hover:border-accent-blue/30"),children:[h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsxs("div",{className:"w-14 h-14 rounded-xl bg-gradient-to-br from-surface-raised to-surface-overlay flex items-center justify-center overflow-hidden shrink-0 shadow-inner",children:[D.logoUrl?h.jsx("img",{src:D.logoUrl,alt:D.name,className:"w-full h-full object-cover",onError:V=>{var U;V.target.style.display="none",(U=V.target.nextElementSibling)==null||U.classList.remove("hidden")}}):null,h.jsx(so,{className:fe("w-7 h-7 text-text-muted",D.logoUrl&&"hidden")})]}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsx("h3",{className:"font-semibold text-text-primary truncate",children:D.name}),R(D)&&h.jsxs("span",{className:"shrink-0 px-2 py-0.5 text-[10px] font-bold bg-accent-green/20 text-accent-green rounded-full flex items-center gap-1",children:[h.jsx(ia,{className:"w-3 h-3"}),"Attached"]}),D.isRecommended&&!R(D)&&h.jsxs("span",{className:"shrink-0 px-2 py-0.5 text-[10px] font-bold bg-gradient-to-r from-accent-yellow to-accent-orange text-white rounded-full flex items-center gap-1",children:[h.jsx(dd,{className:"w-3 h-3"}),"Featured"]})]}),h.jsxs("p",{className:"text-xs text-text-muted mb-2",children:["by ",D.author]}),h.jsx("p",{className:"text-sm text-text-secondary line-clamp-2 leading-relaxed",children:D.description})]})]}),h.jsxs("div",{className:"flex items-center gap-4 mt-4 pt-4 border-t border-border/50",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted",children:[h.jsx(fd,{className:"w-4 h-4 text-accent-yellow"}),h.jsx("span",{className:"text-sm font-medium",children:j(D.githubStars)})]}),h.jsxs("div",{className:"flex items-center gap-1.5 text-text-muted",children:[h.jsx(Fb,{className:"w-4 h-4 text-accent-green"}),h.jsx("span",{className:"text-sm font-medium",children:j(D.downloadCount)})]}),D.requiresApiKey&&h.jsxs("div",{className:"flex items-center gap-1.5 text-accent-yellow ml-auto",children:[h.jsx(Vb,{className:"w-4 h-4"}),h.jsx("span",{className:"text-xs font-medium",children:"API Key"})]})]}),h.jsx("div",{className:"flex items-center gap-2 mt-3",children:h.jsx("span",{className:fe("text-xs font-medium px-2.5 py-1 rounded-lg",q(D.category).bg,q(D.category).color),children:M(D.category)})}),h.jsxs("div",{className:"flex items-center justify-between mt-4 pt-3",children:[h.jsx("div",{className:"flex flex-wrap gap-1.5",children:D.tags.slice(0,3).map(V=>h.jsx("span",{className:"text-[10px] px-2 py-0.5 bg-surface-raised rounded-md text-text-muted",children:V},V))}),h.jsx(Ay,{className:"w-5 h-5 text-text-muted group-hover:text-accent-blue group-hover:translate-x-1 transition-all"})]})]},D.mcpId))}):h.jsx("div",{className:"space-y-3",children:N.map((D,z)=>h.jsxs(xe.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:z*.02},onClick:()=>A(D),className:fe("group flex items-center gap-4 p-4 rounded-xl border-2 cursor-pointer transition-all","hover:shadow-lg hover:shadow-black/5",(y==null?void 0:y.mcpId)===D.mcpId?"border-accent-blue bg-accent-blue/5":"border-border bg-surface hover:border-accent-blue/30"),children:[h.jsx("div",{className:"w-12 h-12 rounded-xl bg-surface-raised flex items-center justify-center overflow-hidden shrink-0",children:D.logoUrl?h.jsx("img",{src:D.logoUrl,alt:D.name,className:"w-full h-full object-cover"}):h.jsx(so,{className:"w-6 h-6 text-text-muted"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h3",{className:"font-semibold text-text-primary",children:D.name}),D.isRecommended&&h.jsx(dd,{className:"w-4 h-4 text-accent-yellow"})]}),h.jsx("p",{className:"text-sm text-text-secondary truncate",children:D.description})]}),h.jsxs("div",{className:"flex items-center gap-4 text-sm text-text-muted shrink-0",children:[h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(fd,{className:"w-4 h-4 text-accent-yellow"}),j(D.githubStars)]}),h.jsx("span",{className:fe("px-2 py-1 rounded-lg text-xs font-medium",q(D.category).bg,q(D.category).color),children:M(D.category)}),h.jsx(Ay,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]})]},D.mcpId))})})]})]})})]})})}),document.body)}function CY(e){var n;const t=((n=e.split(".").pop())==null?void 0:n.toLowerCase())||"";return["png","jpg","jpeg","gif","webp","svg","bmp"].includes(t)?"image":["js","ts","tsx","jsx","py","go","rs","java","c","cpp","h","css","html","json","yaml","yml","toml","md"].includes(t)?"code":["pdf","doc","docx","txt","rtf","xls","xlsx"].includes(t)?"document":"other"}function kY({type:e}){switch(e){case"image":return h.jsx(Q6,{className:"w-3.5 h-3.5 text-accent-purple"});case"code":return h.jsx(UM,{className:"w-3.5 h-3.5 text-accent-blue"});case"document":return h.jsx(WM,{className:"w-3.5 h-3.5 text-accent-yellow"});default:return h.jsx(U6,{className:"w-3.5 h-3.5 text-text-muted"})}}function PY(){const{plans:e,selectedNodeId:t,selectedPlanId:n,setSelectedNodeId:r,updateFieldValue:i,setSelectedBranch:s,addAttachment:o,removeAttachment:a,updateMetaInstructions:l,removeNodeMcpServer:u}=Ae(),{activeTabId:c,setProjectFieldValue:d,setProjectSelectedBranch:f}=ri(),[p,m]=T.useState([]),[v,w]=T.useState(""),[g,x]=T.useState(!1),[y,b]=T.useState(null),[E,C]=T.useState(!1);let _=null,k;if(n){const j=e.find(M=>M.plan.id===n);_=(j==null?void 0:j.nodes.find(M=>M.id===t))||null,k=n}else for(const j of e){const M=j.nodes.find(q=>q.id===t);if(M){_=M,k=j.plan.id;break}}if(_&&y!==_.id&&(w(_.metaInstructions||""),m([]),x(!1),b(_.id)),!_)return null;const I=_.dynamicFields.filter(j=>j.required&&!j.value).length,F=(j,M)=>{i(_.id,j,M,k),c&&d(c,_.id,j,M)},S=j=>{s(_.id,j,k),c&&f(c,_.id,j)},P=()=>{m([...p,{id:`pending_${Date.now()}`,path:"",description:""}]),x(!0)},L=(j,M)=>{m(p.map(q=>q.id===j?{...q,path:M}:q)),x(!0)},N=(j,M)=>{m(p.map(q=>q.id===j?{...q,description:M}:q)),x(!0)},A=j=>{m(p.filter(M=>M.id!==j)),x(!0)},R=j=>{w(j),x(!0)},O=()=>{l(_.id,v,k),p.forEach(j=>{if(j.path.trim()&&j.description.trim()){const M={id:`att_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,path:j.path.trim(),name:j.path.trim().split("/").pop()||j.path.trim(),type:CY(j.path),description:j.description.trim()};o(_.id,M,k)}}),m([]),x(!1)};return h.jsxs(xe.div,{initial:{x:400,opacity:0},animate:{x:0,opacity:1},exit:{x:400,opacity:0},transition:{type:"spring",stiffness:300,damping:30},className:"absolute top-0 right-0 h-full w-[380px] bg-surface/95 backdrop-blur-md border-l border-border shadow-2xl overflow-hidden flex flex-col",children:[h.jsxs("div",{className:"px-3 py-2.5 border-b border-border flex items-start justify-between",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[h.jsx("span",{className:fe("w-1.5 h-1.5 rounded-full",{"bg-status-pending":_.status==="pending","bg-status-active animate-pulse":_.status==="active","bg-status-completed":_.status==="completed","bg-status-failed":_.status==="failed"})}),h.jsxs("span",{className:"text-[10px] text-text-muted capitalize",children:[_.type," · ",_.status]})]}),h.jsx("h2",{className:"text-sm font-semibold text-text-primary truncate",children:_.title})]}),h.jsx("button",{onClick:()=>r(null),className:"p-1 rounded hover:bg-surface-raised text-text-muted hover:text-text-primary transition-colors",children:h.jsx(wr,{className:"w-3.5 h-3.5"})})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-2 space-y-3",children:[_.description&&h.jsxs("section",{children:[h.jsx("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider mb-1",children:"Description"}),h.jsx("p",{className:"text-xs text-text-secondary leading-relaxed",children:_.description})]}),h.jsxs("section",{className:"grid grid-cols-2 gap-2",children:[_.complexity&&h.jsxs("div",{className:"p-2 rounded-md bg-surface-raised",children:[h.jsx("span",{className:"text-[9px] text-text-muted uppercase tracking-wider",children:"Complexity"}),h.jsx("p",{className:fe("text-xs font-medium",{"text-accent-green":_.complexity==="low","text-accent-yellow":_.complexity==="medium","text-accent-red":_.complexity==="high"}),children:_.complexity})]}),_.expectedOutput&&h.jsxs("div",{className:"p-2 rounded-md bg-surface-raised col-span-2",children:[h.jsxs("span",{className:"text-[9px] text-text-muted uppercase tracking-wider flex items-center gap-1",children:[h.jsx(UM,{className:"w-2.5 h-2.5"}),"Expected Output"]}),h.jsx("p",{className:"text-xs text-text-secondary mt-0.5",children:_.expectedOutput})]})]}),h.jsxs("section",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsxs("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider flex items-center gap-1",children:[h.jsx(so,{className:"w-2.5 h-2.5"}),"MCP Servers",_.mcpServers&&_.mcpServers.length>0&&h.jsxs("span",{className:"text-accent-purple",children:["(",_.mcpServers.length,")"]})]}),h.jsxs("button",{onClick:()=>C(!0),className:"flex items-center gap-1 px-2 py-0.5 rounded text-[10px] text-accent-purple hover:bg-accent-purple/10 transition-colors",children:[h.jsx(Mt,{className:"w-3 h-3"}),"Add"]})]}),_.mcpServers&&_.mcpServers.length>0?h.jsx("div",{className:"space-y-2",children:_.mcpServers.map(j=>h.jsx("div",{className:"p-2.5 rounded-lg bg-gradient-to-br from-accent-purple/5 to-accent-blue/5 border border-accent-purple/20",children:h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx("div",{className:"w-8 h-8 rounded-md bg-surface-raised flex items-center justify-center overflow-hidden shrink-0",children:j.logoUrl?h.jsx("img",{src:j.logoUrl,alt:j.name,className:"w-full h-full object-cover",onError:M=>{M.target.style.display="none"}}):h.jsx(so,{className:"w-4 h-4 text-text-muted"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("p",{className:"text-xs font-medium text-text-primary truncate",children:j.name}),h.jsx("button",{onClick:()=>u(_.id,j.mcpId,k),className:"p-1 rounded hover:bg-accent-red/20 text-text-muted hover:text-accent-red transition-all",children:h.jsx($i,{className:"w-3 h-3"})})]}),h.jsxs("p",{className:"text-[10px] text-text-muted truncate",children:["by ",j.author]}),h.jsx("p",{className:"text-[10px] text-text-secondary mt-1 line-clamp-2",children:j.description}),j.requiresApiKey&&h.jsx("p",{className:"text-[10px] text-accent-yellow mt-1",children:"Requires API Key"})]})]})},j.mcpId))}):h.jsxs("button",{onClick:()=>C(!0),className:"w-full p-3 rounded-lg border-2 border-dashed border-border hover:border-accent-purple/50 hover:bg-accent-purple/5 transition-all group",children:[h.jsxs("div",{className:"flex items-center justify-center gap-2 text-text-muted group-hover:text-accent-purple",children:[h.jsx(Mt,{className:"w-4 h-4"}),h.jsx("span",{className:"text-xs font-medium",children:"Add MCP Server"})]}),h.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:"Attach MCP servers to enhance this node's capabilities"})]})]}),_.risks&&h.jsxs("section",{children:[h.jsxs("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider mb-1 flex items-center gap-1",children:[h.jsx(My,{className:"w-2.5 h-2.5"}),"Risks"]}),h.jsx("p",{className:"text-xs text-text-secondary bg-accent-yellow/5 border border-accent-yellow/20 rounded-md p-2",children:_.risks})]}),_.type==="decision"&&_.branches&&h.jsxs("section",{children:[h.jsx("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider mb-2",children:"Choose a Path"}),h.jsx(SY,{branches:_.branches,selectedBranchId:_.selectedBranchId,onSelect:S})]}),_.dynamicFields.length>0&&h.jsxs("section",{children:[h.jsxs("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider mb-2",children:["Configuration",I>0&&h.jsxs("span",{className:"ml-1.5 text-accent-yellow",children:["(",I," required)"]})]}),h.jsx("div",{className:"space-y-2.5",children:_.dynamicFields.map(j=>h.jsx(_Y,{field:j,onChange:M=>F(j.id,M)},j.id))})]}),h.jsxs("section",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsxs("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider flex items-center gap-1",children:[h.jsx(eH,{className:"w-2.5 h-2.5"}),"File Attachments"]}),h.jsxs("button",{onClick:P,className:"flex items-center gap-1 px-2 py-0.5 rounded text-[10px] text-accent-blue hover:bg-accent-blue/10 transition-colors",children:[h.jsx(Mt,{className:"w-3 h-3"}),"Add File"]})]}),_.attachments.length>0&&h.jsx("div",{className:"space-y-2 mb-2",children:_.attachments.map(j=>h.jsx("div",{className:"p-2 rounded-md bg-surface-raised border border-border/50 group",children:h.jsxs("div",{className:"flex items-start gap-2",children:[h.jsx(kY,{type:j.type}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs text-text-primary font-medium truncate",children:j.name}),h.jsx("p",{className:"text-[10px] text-text-muted truncate",children:j.path}),h.jsx("p",{className:"text-[10px] text-text-secondary mt-1",children:j.description})]}),h.jsx("button",{onClick:()=>a(_.id,j.id,k),className:"p-1 rounded opacity-0 group-hover:opacity-100 hover:bg-accent-red/20 text-text-muted hover:text-accent-red transition-all",children:h.jsx($i,{className:"w-3 h-3"})})]})},j.id))}),p.map(j=>h.jsxs("div",{className:"p-2 rounded-md bg-canvas border border-border mb-2",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx("div",{className:"flex-1",children:h.jsx("input",{type:"text",value:j.path,onChange:M=>L(j.id,M.target.value),placeholder:"/full/path/to/file.ext",className:"w-full px-2 py-1.5 rounded-md bg-surface-raised border border-border text-xs text-text-primary placeholder-text-muted focus:outline-none focus:ring-1 focus:ring-accent-blue font-mono"})}),h.jsx("button",{onClick:()=>A(j.id),className:"p-1 rounded hover:bg-accent-red/20 text-text-muted hover:text-accent-red transition-colors",children:h.jsx($i,{className:"w-3 h-3"})})]}),h.jsx("input",{type:"text",value:j.description,onChange:M=>N(j.id,M.target.value),placeholder:"Description (required)...",className:"w-full px-2 py-1.5 rounded-md bg-surface-raised border border-border text-xs text-text-primary placeholder-text-muted focus:outline-none focus:ring-1 focus:ring-accent-blue"}),j.path&&!j.description.trim()&&h.jsx("p",{className:"text-[10px] text-accent-red mt-1",children:"Description is required"})]},j.id)),_.attachments.length===0&&p.length===0&&h.jsx("p",{className:"text-[10px] text-text-muted text-center py-2",children:'No files attached. Click "Add File" to attach files for the AI to reference.'})]}),h.jsxs("section",{children:[h.jsxs("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider mb-2 flex items-center gap-1",children:[h.jsx(J6,{className:"w-2.5 h-2.5"}),"Instructions for AI"]}),h.jsx("textarea",{value:v,onChange:j=>R(j.target.value),placeholder:"Add specific instructions for this step...",rows:3,className:"w-full px-2 py-1.5 rounded-md bg-canvas border border-border text-xs text-text-primary placeholder-text-muted focus:outline-none focus:ring-1 focus:ring-accent-blue resize-none"}),h.jsx("p",{className:"text-[10px] text-text-muted mt-1",children:"These instructions will be sent to the AI when executing this node"})]}),_.output&&h.jsxs("section",{children:[h.jsxs("h3",{className:"text-[10px] font-medium text-text-muted uppercase tracking-wider mb-1 flex items-center gap-1",children:[h.jsx(ia,{className:"w-2.5 h-2.5 text-accent-green"}),"Output"]}),h.jsx("pre",{className:"text-[10px] text-text-secondary bg-canvas rounded-md p-2 overflow-x-auto font-mono max-h-32",children:_.output})]})]}),h.jsx("div",{className:"px-3 py-2 border-t border-border bg-surface",children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("span",{className:"text-[10px] text-text-muted",children:[_.attachments.length>0&&`${_.attachments.length} file${_.attachments.length>1?"s":""}`,_.attachments.length>0&&(_.metaInstructions||v)&&" · ",(_.metaInstructions||v)&&"Has instructions",_.mcpServers&&_.mcpServers.length>0&&` · ${_.mcpServers.length} MCP${_.mcpServers.length>1?"s":""}`]}),h.jsxs("button",{onClick:O,disabled:!g,className:fe("flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors",g?"bg-accent-blue text-white hover:bg-accent-blue/90":"bg-surface-raised text-text-muted cursor-not-allowed"),children:[h.jsx(tH,{className:"w-3 h-3"}),"Save"]})]})}),h.jsx(EY,{isOpen:E,onClose:()=>C(!1),nodeId:_.id,planId:k,currentMcps:_.mcpServers})]})}function jY(){const{plans:e,canApprove:t}=Ae(),{activeTabId:n}=ri(),{approvePlan:r}=Jo(),i=[...e].reverse().find(p=>p.plan.status==="ready"),s=(i==null?void 0:i.plan)||(e.length>0?e[e.length-1].plan:null),o=(s==null?void 0:s.status)==="ready",a=(s==null?void 0:s.status)==="approved",l=(s==null?void 0:s.status)==="executing",u=(s==null?void 0:s.status)==="completed",c=(s==null?void 0:s.status)==="failed",d=i?t(i.plan.id):!1,f=()=>{console.log("[Overture] BUTTON CLICKED - canApproveNow:",d,"readyPlan:",!!i),d&&i?(console.log("[Overture] Calling approvePlan with:",n),r(n||void 0)):console.log("[Overture] NOT calling approvePlan - conditions not met")};return!s||s.status==="streaming"||s.status==="executing"||s.status==="paused"?null:h.jsx("div",{className:"absolute bottom-24 left-1/2 -translate-x-1/2 z-10",children:h.jsxs(xe.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center gap-2",children:[h.jsxs(xe.button,{whileHover:{scale:d?1.02:1},whileTap:{scale:d?.98:1},onClick:f,disabled:!d||a||l||u,className:fe("flex items-center gap-2 px-6 py-3 rounded-xl font-medium text-sm","transition-all duration-200 shadow-lg",{"bg-gradient-to-r from-accent-green to-emerald-500 text-white shadow-glow-green hover:shadow-lg":o&&d,"bg-surface border border-border text-text-muted cursor-not-allowed":o&&!d,"bg-accent-blue/20 text-accent-blue cursor-wait":a||l,"bg-accent-green/20 text-accent-green cursor-default":u,"bg-accent-red/20 text-accent-red cursor-default":c}),children:[o&&d&&h.jsxs(h.Fragment,{children:[h.jsx(KM,{className:"w-4 h-4"}),"Approve & Execute"]}),o&&!d&&h.jsxs(h.Fragment,{children:[h.jsx(My,{className:"w-4 h-4"}),"Complete Requirements"]}),(a||l)&&h.jsxs(h.Fragment,{children:[h.jsx(qo,{className:"w-4 h-4 animate-spin"}),"Executing..."]}),u&&h.jsxs(h.Fragment,{children:[h.jsx(ia,{className:"w-4 h-4"}),"Completed"]}),c&&h.jsxs(h.Fragment,{children:[h.jsx(My,{className:"w-4 h-4"}),"Failed"]})]}),o&&d&&h.jsxs("span",{className:"text-xs text-text-muted",children:["Press ",h.jsx("kbd",{className:"px-1 py-0.5 bg-surface rounded font-mono",children:"Enter"})," to approve"]}),o&&!d&&h.jsx("span",{className:"text-xs text-text-muted",children:"See requirements checklist on the left"})]})})}const TY=[{value:"string",label:"Text"},{value:"number",label:"Number"},{value:"boolean",label:"Yes/No"},{value:"select",label:"Dropdown"},{value:"secret",label:"Secret"},{value:"file",label:"File Path"}],MY=[{value:"code",label:"Code"},{value:"image",label:"Image"},{value:"document",label:"Document"},{value:"other",label:"Other"}];function AY(){const{pendingInsert:e,setPendingInsert:t,nodes:n,edges:r}=Ae(),{insertNodes:i}=Jo(),s=()=>({id:`new_${Date.now()}_${Math.random().toString(36).slice(2)}`,title:"",description:"",expanded:!0,fields:[],files:[]}),[o,a]=T.useState([s()]),l=e!==null,u=n.find(P=>P.id===(e==null?void 0:e.afterNodeId)),c=r.find(P=>P.from===(e==null?void 0:e.afterNodeId)),d=c?n.find(P=>P.id===c.to):null,f=T.useCallback(()=>{t(null),a([s()])},[t]),p=T.useCallback(()=>{a(P=>[...P,s()])},[]),m=T.useCallback(P=>{a(L=>L.filter(N=>N.id!==P))},[]),v=T.useCallback((P,L,N)=>{a(A=>A.map(R=>R.id===P?{...R,[L]:N}:R))},[]),w=T.useCallback(P=>{a(L=>L.map(N=>N.id===P?{...N,expanded:!N.expanded}:N))},[]),g=T.useCallback(P=>{a(L=>L.map(N=>N.id===P?{...N,fields:[...N.fields,{id:`field_${Date.now()}_${Math.random().toString(36).slice(2)}`,name:"",type:"string",required:!1,title:"",description:""}]}:N))},[]),x=T.useCallback((P,L)=>{a(N=>N.map(A=>A.id===P?{...A,fields:A.fields.filter(R=>R.id!==L)}:A))},[]),y=T.useCallback((P,L,N)=>{a(A=>A.map(R=>R.id===P?{...R,fields:R.fields.map(O=>O.id===L?{...O,...N}:O)}:R))},[]),b=T.useCallback(P=>{a(L=>L.map(N=>N.id===P?{...N,files:[...N.files,{id:`file_${Date.now()}_${Math.random().toString(36).slice(2)}`,name:"",path:"",type:"code",description:""}]}:N))},[]),E=T.useCallback((P,L)=>{a(N=>N.map(A=>A.id===P?{...A,files:A.files.filter(R=>R.id!==L)}:A))},[]),C=T.useCallback((P,L,N)=>{a(A=>A.map(R=>R.id===P?{...R,files:R.files.map(O=>O.id===L?{...O,...N}:O)}:R))},[]),_=T.useRef({}),k=T.useCallback(async(P,L)=>{if("showOpenFilePicker"in window)try{const[R]=await window.showOpenFilePicker({multiple:!1}),O=await R.getFile(),j=R.name||O.name;C(P,L,{path:j,name:O.name});return}catch(R){if(R.name!=="AbortError")console.log("File picker error, falling back to input");else return}const N=`${P}_${L}`,A=_.current[N];A&&A.click()},[C]),I=T.useCallback((P,L,N)=>{var R;const A=(R=N.target.files)==null?void 0:R[0];if(A){const O=A.webkitRelativePath||A.name;C(P,L,{path:O,name:A.name})}},[C]),F=T.useCallback(()=>{if(!e||o.length===0)return;const P=o.filter(A=>A.title.trim());if(P.length===0)return;const L=P.map((A,R)=>({id:`inserted_${Date.now()}_${R}`,type:"task",status:"pending",title:A.title.trim(),description:A.description.trim()||`Inserted task: ${A.title.trim()}`,dynamicFields:A.fields.filter(O=>O.name.trim()).map(O=>({id:O.id,name:O.name.trim(),type:O.type,required:O.required,title:O.title.trim()||O.name.trim(),description:O.description.trim(),options:O.options})),attachments:A.files.filter(O=>O.path.trim()).map(O=>({id:O.id,name:O.name.trim()||O.path.split("/").pop()||"file",path:O.path.trim(),type:O.type,description:O.description.trim()}))})),N=[];N.push({id:`edge_${e.afterNodeId}_${L[0].id}`,from:e.afterNodeId,to:L[0].id});for(let A=0;A<L.length-1;A++)N.push({id:`edge_${L[A].id}_${L[A+1].id}`,from:L[A].id,to:L[A+1].id});c&&N.push({id:`edge_${L[L.length-1].id}_${c.to}`,from:L[L.length-1].id,to:c.to}),i(e.afterNodeId,L,N),f()},[e,o,c,i,f]),S=o.some(P=>P.title.trim());return h.jsx(Dn,{children:l&&h.jsx(xe.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:f,children:h.jsxs(xe.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},onClick:P=>P.stopPropagation(),className:"bg-surface border border-border rounded-xl shadow-2xl w-full max-w-2xl mx-4 overflow-hidden max-h-[85vh] flex flex-col",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between shrink-0",children:[h.jsx("h2",{className:"text-lg font-semibold text-text-primary",children:"Insert Nodes"}),h.jsx("button",{onClick:f,className:"p-1 rounded-lg hover:bg-surface-raised transition-colors",children:h.jsx(wr,{className:"w-5 h-5 text-text-muted"})})]}),h.jsxs("div",{className:"px-4 py-3 bg-surface-raised/50 border-b border-border shrink-0",children:[h.jsxs("p",{className:"text-sm text-text-secondary",children:["Insert ",o.length===1?"a node":`${o.length} nodes`," between:"]}),h.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[h.jsx("span",{className:"px-2 py-1 bg-accent-blue/10 text-accent-blue rounded-md font-medium",children:(u==null?void 0:u.title)||"Unknown"}),h.jsx("span",{className:"text-text-muted",children:"→"}),h.jsx("span",{className:"px-2 py-1 bg-accent-purple/10 text-accent-purple rounded-md font-medium",children:(d==null?void 0:d.title)||"End"})]})]}),h.jsxs("div",{className:"px-4 py-4 overflow-y-auto flex-1 space-y-4",children:[o.map((P,L)=>h.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-surface-raised cursor-pointer",onClick:()=>w(P.id),children:[h.jsxs("div",{className:"flex items-center gap-2",children:[P.expanded?h.jsx($6,{className:"w-4 h-4 text-text-muted"}):h.jsx(V6,{className:"w-4 h-4 text-text-muted"}),h.jsxs("span",{className:"text-sm font-medium text-text-primary",children:["Node ",L+1,P.title&&`: ${P.title}`]})]}),o.length>1&&h.jsx("button",{onClick:N=>{N.stopPropagation(),m(P.id)},className:"p-1 text-text-muted hover:text-accent-red transition-colors",children:h.jsx($i,{className:"w-4 h-4"})})]}),P.expanded&&h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsx("input",{type:"text",value:P.title,onChange:N=>v(P.id,"title",N.target.value),placeholder:"Task title (required)",className:`w-full px-3 py-2 bg-canvas border border-border rounded-lg
378
+ text-sm text-text-primary placeholder:text-text-muted
379
+ focus:outline-none focus:border-accent-blue transition-colors`,autoFocus:L===0}),h.jsx("textarea",{value:P.description,onChange:N=>v(P.id,"description",N.target.value),placeholder:"Description (optional)",rows:2,className:`w-full px-3 py-2 bg-canvas border border-border rounded-lg
380
+ text-sm text-text-primary placeholder:text-text-muted
381
+ focus:outline-none focus:border-accent-blue transition-colors resize-none`}),h.jsxs("div",{className:"border-t border-border pt-3",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"Custom Fields"}),h.jsxs("button",{onClick:()=>g(P.id),className:"text-xs text-accent-blue hover:text-accent-blue/80 flex items-center gap-1",children:[h.jsx(Mt,{className:"w-3 h-3"}),"Add Field"]})]}),P.fields.length===0?h.jsx("p",{className:"text-xs text-text-muted italic",children:"No custom fields"}):h.jsx("div",{className:"space-y-2",children:P.fields.map(N=>h.jsxs("div",{className:"p-2 bg-canvas rounded-lg border border-border space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:N.name,onChange:A=>y(P.id,N.id,{name:A.target.value}),placeholder:"Field name",className:`flex-1 px-2 py-1 bg-surface border border-border rounded text-xs
382
+ text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-blue`}),h.jsx("select",{value:N.type,onChange:A=>y(P.id,N.id,{type:A.target.value}),className:`px-2 py-1 bg-surface border border-border rounded text-xs
383
+ text-text-primary focus:outline-none focus:border-accent-blue`,children:TY.map(A=>h.jsx("option",{value:A.value,children:A.label},A.value))}),h.jsxs("label",{className:"flex items-center gap-1 text-xs text-text-secondary",children:[h.jsx("input",{type:"checkbox",checked:N.required,onChange:A=>y(P.id,N.id,{required:A.target.checked}),className:"w-3 h-3"}),"Required"]}),h.jsx("button",{onClick:()=>x(P.id,N.id),className:"p-1 text-text-muted hover:text-accent-red",children:h.jsx($i,{className:"w-3 h-3"})})]}),h.jsx("input",{type:"text",value:N.title,onChange:A=>y(P.id,N.id,{title:A.target.value}),placeholder:"Display title (optional)",className:`w-full px-2 py-1 bg-surface border border-border rounded text-xs
384
+ text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-blue`}),N.type==="select"&&h.jsx("input",{type:"text",value:N.options||"",onChange:A=>y(P.id,N.id,{options:A.target.value}),placeholder:"Options (comma-separated)",className:`w-full px-2 py-1 bg-surface border border-border rounded text-xs
385
+ text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-blue`})]},N.id))})]}),h.jsxs("div",{className:"border-t border-border pt-3",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"text-xs font-medium text-text-secondary",children:"File Attachments"}),h.jsxs("button",{onClick:()=>b(P.id),className:"text-xs text-accent-blue hover:text-accent-blue/80 flex items-center gap-1",children:[h.jsx(Mt,{className:"w-3 h-3"}),"Add File"]})]}),P.files.length===0?h.jsx("p",{className:"text-xs text-text-muted italic",children:"No files attached"}):h.jsx("div",{className:"space-y-2",children:P.files.map(N=>h.jsxs("div",{className:"p-2 bg-canvas rounded-lg border border-border space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(WM,{className:"w-4 h-4 text-text-muted shrink-0"}),h.jsx("input",{type:"text",value:N.path,onChange:A=>C(P.id,N.id,{path:A.target.value}),placeholder:"File path (e.g., /src/index.ts)",className:`flex-1 px-2 py-1 bg-surface border border-border rounded text-xs
386
+ text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-blue`}),h.jsxs("button",{onClick:()=>k(P.id,N.id),className:`px-2 py-1 bg-accent-blue/10 text-accent-blue rounded text-xs
387
+ hover:bg-accent-blue/20 transition-colors flex items-center gap-1`,title:"Browse for file",children:[h.jsx(M0,{className:"w-3 h-3"}),"Browse"]}),h.jsx("input",{type:"file",ref:A=>{_.current[`${P.id}_${N.id}`]=A},onChange:A=>I(P.id,N.id,A),className:"hidden"}),h.jsx("select",{value:N.type,onChange:A=>C(P.id,N.id,{type:A.target.value}),className:`px-2 py-1 bg-surface border border-border rounded text-xs
388
+ text-text-primary focus:outline-none focus:border-accent-blue`,children:MY.map(A=>h.jsx("option",{value:A.value,children:A.label},A.value))}),h.jsx("button",{onClick:()=>E(P.id,N.id),className:"p-1 text-text-muted hover:text-accent-red",children:h.jsx($i,{className:"w-3 h-3"})})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx("input",{type:"text",value:N.name,onChange:A=>C(P.id,N.id,{name:A.target.value}),placeholder:"Display name (optional)",className:`flex-1 px-2 py-1 bg-surface border border-border rounded text-xs
389
+ text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-blue`}),h.jsx("input",{type:"text",value:N.description,onChange:A=>C(P.id,N.id,{description:A.target.value}),placeholder:"Description (optional)",className:`flex-1 px-2 py-1 bg-surface border border-border rounded text-xs
390
+ text-text-primary placeholder:text-text-muted focus:outline-none focus:border-accent-blue`})]})]},N.id))})]})]})]},P.id)),h.jsxs("button",{onClick:p,className:`w-full py-2 border border-dashed border-border rounded-lg
391
+ text-sm text-text-muted hover:text-text-secondary hover:border-text-muted
392
+ transition-colors flex items-center justify-center gap-2`,children:[h.jsx(Mt,{className:"w-4 h-4"}),"Add another node"]})]}),h.jsxs("div",{className:"px-4 py-3 border-t border-border flex items-center justify-end gap-2 shrink-0",children:[h.jsx("button",{onClick:f,className:"px-4 py-2 text-sm text-text-secondary hover:text-text-primary transition-colors",children:"Cancel"}),h.jsxs("button",{onClick:F,disabled:!S,className:`px-4 py-2 rounded-lg text-sm font-medium transition-all
393
+ ${S?"bg-accent-blue text-white hover:bg-accent-blue/90":"bg-surface-raised text-text-muted cursor-not-allowed"}`,children:["Insert ",o.filter(P=>P.title.trim()).length||""," Node",o.filter(P=>P.title.trim()).length!==1?"s":""]})]})]})})})}const fI=6048e5,IY=864e5,Ka=43200,KE=1440,XE=Symbol.for("constructDateFrom");function Fn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&XE in e?e[XE](t):e instanceof Date?new e.constructor(t):new Date(t)}function Be(e,t){return Fn(t||e,e)}let RY={};function da(){return RY}function Vo(e,t){var a,l,u,c;const n=da(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.weekStartsOn)??0,i=Be(e,t==null?void 0:t.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function du(e,t){return Vo(e,{...t,weekStartsOn:1})}function hI(e,t){const n=Be(e,t==null?void 0:t.in),r=n.getFullYear(),i=Fn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=du(i),o=Fn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=du(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function fu(e){const t=Be(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function hc(e,...t){const n=Fn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function QE(e,t){const n=Be(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function DY(e,t,n){const[r,i]=hc(n==null?void 0:n.in,e,t),s=QE(r),o=QE(i),a=+s-fu(s),l=+o-fu(o);return Math.round((a-l)/IY)}function OY(e,t){const n=hI(e,t),r=Fn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),du(r)}function gl(e,t){const n=+Be(e)-+Be(t);return n<0?-1:n>0?1:n}function LY(e){return Fn(e,Date.now())}function FY(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function qY(e){return!(!FY(e)&&typeof e!="number"||isNaN(+Be(e)))}function VY(e,t,n){const[r,i]=hc(n==null?void 0:n.in,e,t),s=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return s*12+o}function $Y(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function zY(e,t){return+Be(e)-+Be(t)}function BY(e,t){const n=Be(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function HY(e,t){const n=Be(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function UY(e,t){const n=Be(e,t==null?void 0:t.in);return+BY(n,t)==+HY(n,t)}function WY(e,t,n){const[r,i,s]=hc(n==null?void 0:n.in,e,e,t),o=gl(i,s),a=Math.abs(VY(i,s));if(a<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*a);let l=gl(i,s)===-o;UY(r)&&a===1&&gl(r,s)===1&&(l=!1);const u=o*(a-+l);return u===0?0:u}function GY(e,t,n){const r=zY(e,t)/1e3;return $Y(n==null?void 0:n.roundingMethod)(r)}function YY(e,t){const n=Be(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const KY={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},XY=(e,t,n)=>{let r;const i=KY[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ag(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const QY={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ZY={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},JY={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},eK={date:ag({formats:QY,defaultWidth:"full"}),time:ag({formats:ZY,defaultWidth:"full"}),dateTime:ag({formats:JY,defaultWidth:"full"})},tK={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nK=(e,t,n,r)=>tK[e];function ks(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const rK={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},iK={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},sK={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},oK={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},aK={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},lK={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},uK=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},cK={ordinalNumber:uK,era:ks({values:rK,defaultWidth:"wide"}),quarter:ks({values:iK,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ks({values:sK,defaultWidth:"wide"}),day:ks({values:oK,defaultWidth:"wide"}),dayPeriod:ks({values:aK,defaultWidth:"wide",formattingValues:lK,defaultFormattingWidth:"wide"})};function Ps(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?fK(a,d=>d.test(o)):dK(a,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(o.length);return{value:u,rest:c}}}function dK(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function fK(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function hK(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const pK=/^(\d+)(th|st|nd|rd)?/i,mK=/\d+/i,gK={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},yK={any:[/^b/i,/^(a|c)/i]},vK={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},xK={any:[/1/i,/2/i,/3/i,/4/i]},wK={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},bK={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},_K={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},SK={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},NK={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},EK={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},CK={ordinalNumber:hK({matchPattern:pK,parsePattern:mK,valueCallback:e=>parseInt(e,10)}),era:Ps({matchPatterns:gK,defaultMatchWidth:"wide",parsePatterns:yK,defaultParseWidth:"any"}),quarter:Ps({matchPatterns:vK,defaultMatchWidth:"wide",parsePatterns:xK,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ps({matchPatterns:wK,defaultMatchWidth:"wide",parsePatterns:bK,defaultParseWidth:"any"}),day:Ps({matchPatterns:_K,defaultMatchWidth:"wide",parsePatterns:SK,defaultParseWidth:"any"}),dayPeriod:Ps({matchPatterns:NK,defaultMatchWidth:"any",parsePatterns:EK,defaultParseWidth:"any"})},pI={code:"en-US",formatDistance:XY,formatLong:eK,formatRelative:nK,localize:cK,match:CK,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kK(e,t){const n=Be(e,t==null?void 0:t.in);return DY(n,YY(n))+1}function PK(e,t){const n=Be(e,t==null?void 0:t.in),r=+du(n)-+OY(n);return Math.round(r/fI)+1}function mI(e,t){var c,d,f,p;const n=Be(e,t==null?void 0:t.in),r=n.getFullYear(),i=da(),s=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((p=(f=i.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,o=Fn((t==null?void 0:t.in)||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=Vo(o,t),l=Fn((t==null?void 0:t.in)||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Vo(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function jK(e,t){var a,l,u,c;const n=da(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((c=(u=n.locale)==null?void 0:u.options)==null?void 0:c.firstWeekContainsDate)??1,i=mI(e,t),s=Fn((t==null?void 0:t.in)||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Vo(s,t)}function TK(e,t){const n=Be(e,t==null?void 0:t.in),r=+Vo(n,t)-+jK(n,t);return Math.round(r/fI)+1}function pe(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Xn={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return pe(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):pe(n+1,2)},d(e,t){return pe(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return pe(e.getHours()%12||12,t.length)},H(e,t){return pe(e.getHours(),t.length)},m(e,t){return pe(e.getMinutes(),t.length)},s(e,t){return pe(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return pe(i,t.length)}},hi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ZE={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Xn.y(e,t)},Y:function(e,t,n,r){const i=mI(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return pe(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):pe(s,t.length)},R:function(e,t){const n=hI(e);return pe(n,t.length)},u:function(e,t){const n=e.getFullYear();return pe(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return pe(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return pe(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Xn.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return pe(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=TK(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):pe(i,t.length)},I:function(e,t,n){const r=PK(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):pe(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Xn.d(e,t)},D:function(e,t,n){const r=kK(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):pe(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return pe(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return pe(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return pe(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=hi.noon:r===0?i=hi.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=hi.evening:r>=12?i=hi.afternoon:r>=4?i=hi.morning:i=hi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Xn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Xn.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):pe(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):pe(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Xn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Xn.s(e,t)},S:function(e,t){return Xn.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return eC(r);case"XXXX":case"XX":return Ir(r);case"XXXXX":case"XXX":default:return Ir(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return eC(r);case"xxxx":case"xx":return Ir(r);case"xxxxx":case"xxx":default:return Ir(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+JE(r,":");case"OOOO":default:return"GMT"+Ir(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+JE(r,":");case"zzzz":default:return"GMT"+Ir(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return pe(r,t.length)},T:function(e,t,n){return pe(+e,t.length)}};function JE(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+pe(s,2)}function eC(e,t){return e%60===0?(e>0?"-":"+")+pe(Math.abs(e)/60,2):Ir(e,t)}function Ir(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=pe(Math.trunc(r/60),2),s=pe(r%60,2);return n+i+t+s}const tC=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},gI=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},MK=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return tC(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",tC(r,t)).replace("{{time}}",gI(i,t))},AK={p:gI,P:MK},IK=/^D+$/,RK=/^Y+$/,DK=["D","DD","YY","YYYY"];function OK(e){return IK.test(e)}function LK(e){return RK.test(e)}function FK(e,t,n){const r=qK(e,t,n);if(console.warn(r),DK.includes(e))throw new RangeError(r)}function qK(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const VK=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$K=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,zK=/^'([^]*?)'?$/,BK=/''/g,HK=/[a-zA-Z]/;function UK(e,t,n){var c,d,f,p;const r=da(),i=r.locale??pI,s=r.firstWeekContainsDate??((d=(c=r.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,o=r.weekStartsOn??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,a=Be(e,n==null?void 0:n.in);if(!qY(a))throw new RangeError("Invalid time value");let l=t.match($K).map(m=>{const v=m[0];if(v==="p"||v==="P"){const w=AK[v];return w(m,i.formatLong)}return m}).join("").match(VK).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const v=m[0];if(v==="'")return{isToken:!1,value:WK(m)};if(ZE[v])return{isToken:!0,value:m};if(v.match(HK))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(m=>{if(!m.isToken)return m.value;const v=m.value;(LK(v)||OK(v))&&FK(v,t,String(e));const w=ZE[v[0]];return w(a,v,i.localize,u)}).join("")}function WK(e){const t=e.match(zK);return t?t[1].replace(BK,"'"):e}function GK(e,t,n){const r=da(),i=(n==null?void 0:n.locale)??r.locale??pI,s=2520,o=gl(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:o}),[l,u]=hc(n==null?void 0:n.in,...o>0?[t,e]:[e,t]),c=GY(u,l),d=(fu(u)-fu(l))/1e3,f=Math.round((c-d)/60);let p;if(f<2)return n!=null&&n.includeSeconds?c<5?i.formatDistance("lessThanXSeconds",5,a):c<10?i.formatDistance("lessThanXSeconds",10,a):c<20?i.formatDistance("lessThanXSeconds",20,a):c<40?i.formatDistance("halfAMinute",0,a):c<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):f===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",f,a);if(f<45)return i.formatDistance("xMinutes",f,a);if(f<90)return i.formatDistance("aboutXHours",1,a);if(f<KE){const m=Math.round(f/60);return i.formatDistance("aboutXHours",m,a)}else{if(f<s)return i.formatDistance("xDays",1,a);if(f<Ka){const m=Math.round(f/KE);return i.formatDistance("xDays",m,a)}else if(f<Ka*2)return p=Math.round(f/Ka),i.formatDistance("aboutXMonths",p,a)}if(p=WY(u,l),p<12){const m=Math.round(f/Ka);return i.formatDistance("xMonths",m,a)}else{const m=p%12,v=Math.trunc(p/12);return m<3?i.formatDistance("aboutXYears",v,a):m<9?i.formatDistance("overXYears",v,a):i.formatDistance("almostXYears",v+1,a)}}function YK(e,t){return GK(e,LY(e),t)}function KK({entry:e,onLoad:t}){const n=()=>{switch(e.status){case"completed":return h.jsx(zM,{className:"w-4 h-4 text-accent-green"});case"failed":return h.jsx(I0,{className:"w-4 h-4 text-accent-red"});case"executing":return h.jsx(qo,{className:"w-4 h-4 text-accent-yellow animate-spin"});case"paused":return h.jsx(A0,{className:"w-4 h-4 text-accent-orange"});default:return h.jsx(Fo,{className:"w-4 h-4 text-text-muted"})}},r=()=>{switch(e.status){case"completed":return"border-accent-green/30";case"failed":return"border-accent-red/30";case"executing":return"border-accent-yellow/30";case"paused":return"border-accent-orange/30";default:return"border-border"}},i=e.nodeCount>0?Math.round(e.completedNodeCount/e.nodeCount*100):0;return h.jsx(xe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:`
394
+ p-3 rounded-lg border bg-surface-raised/50
395
+ hover:bg-surface-raised cursor-pointer transition-colors
396
+ ${r()}
397
+ `,onClick:t,children:h.jsxs("div",{className:"flex items-start gap-3",children:[n(),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("h4",{className:"text-sm font-medium text-text-primary truncate",children:e.title}),h.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[h.jsx(M0,{className:"w-3 h-3 text-text-muted flex-shrink-0"}),h.jsx("span",{className:"text-xs text-text-muted truncate",children:e.projectName})]}),h.jsxs("div",{className:"flex items-center justify-between mt-2",children:[h.jsx("span",{className:"text-xs text-text-muted",children:e.agent}),h.jsx("span",{className:"text-xs text-text-muted",children:YK(new Date(e.updatedAt),{addSuffix:!0})})]}),e.nodeCount>0&&h.jsxs("div",{className:"mt-2",children:[h.jsxs("div",{className:"flex items-center justify-between text-[10px] text-text-muted mb-1",children:[h.jsxs("span",{children:[e.completedNodeCount,"/",e.nodeCount," nodes"]}),h.jsxs("span",{children:[i,"%"]})]}),h.jsx("div",{className:"w-full h-1 bg-surface rounded-full overflow-hidden",children:h.jsx("div",{className:`h-full rounded-full transition-all ${e.status==="completed"?"bg-accent-green":e.status==="failed"?"bg-accent-red":"bg-accent-blue"}`,style:{width:`${i}%`}})})]})]})]})})}function XK({onLoadPlan:e}){const{historyEntries:t,isHistoryPanelOpen:n,toggleHistoryPanel:r,activeTabId:i}=ri(),[s,o]=pu.useState(!1),a=s&&i?t.filter(c=>c.projectId===i):t,l=a.reduce((c,d)=>{const f=UK(new Date(d.updatedAt),"MMM d, yyyy");return c[f]||(c[f]=[]),c[f].push(d),c},{}),u=c=>{e&&e(c)};return h.jsx(Dn,{children:n&&h.jsxs(xe.div,{initial:{x:"100%",opacity:0},animate:{x:0,opacity:1},exit:{x:"100%",opacity:0},transition:{type:"spring",damping:25,stiffness:300},className:`
398
+ fixed right-0 top-14 bottom-0 w-80 z-40
399
+ bg-surface border-l border-border
400
+ flex flex-col
401
+ shadow-xl
402
+ `,children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[h.jsxs("h2",{className:"font-medium text-text-primary flex items-center gap-2",children:[h.jsx(Fo,{className:"w-4 h-4"}),"History"]}),h.jsxs("div",{className:"flex items-center gap-2",children:[i&&h.jsx("button",{onClick:()=>o(!s),className:`p-1.5 rounded transition-colors ${s?"bg-accent-blue/20 text-accent-blue":"hover:bg-surface-raised text-text-muted"}`,title:s?"Showing current project only":"Showing all projects",children:h.jsx(W6,{className:"w-4 h-4"})}),h.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-surface-raised transition-colors",children:h.jsx(wr,{className:"w-4 h-4 text-text-muted"})})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:a.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[h.jsx(Fo,{className:"w-12 h-12 text-text-muted/30 mb-3"}),h.jsx("p",{className:"text-sm text-text-muted",children:"No history yet"}),h.jsx("p",{className:"text-xs text-text-muted/70 mt-1",children:"Plans you create will appear here"})]}):h.jsx("div",{className:"space-y-6",children:Object.entries(l).map(([c,d])=>h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:c}),h.jsx("div",{className:"space-y-2",children:h.jsx(Dn,{mode:"popLayout",children:d.map(f=>h.jsx(KK,{entry:f,onLoad:()=>u(f.id)},f.id))})})]},c))})}),h.jsx("div",{className:"px-4 py-2 border-t border-border",children:h.jsx("p",{className:"text-[10px] text-text-muted text-center",children:s&&i?`Showing ${a.length} plan(s) for current project`:`Showing all ${t.length} plan(s)`})})]})})}function lg({title:e,icon:t,count:n,color:r,children:i}){return n===0?null:h.jsxs("div",{className:"mb-4",children:[h.jsxs("div",{className:`flex items-center gap-2 mb-2 text-sm font-medium ${r}`,children:[t,h.jsx("span",{children:e}),h.jsxs("span",{className:"text-xs text-text-muted",children:["(",n,")"]})]}),h.jsx("div",{className:"space-y-2",children:i})]})}function nC({node:e,type:t}){const n=t==="added"?"bg-accent-green/10 border-accent-green/30":"bg-accent-red/10 border-accent-red/30",r=t==="added"?h.jsx(Mt,{className:"w-3 h-3 text-accent-green"}):h.jsx(sa,{className:"w-3 h-3 text-accent-red"});return h.jsxs("div",{className:`p-2 rounded border ${n}`,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[r,h.jsx("span",{className:"text-sm font-medium text-text-primary",children:e.title}),h.jsxs("span",{className:"text-xs text-text-muted",children:["(",e.type,")"]})]}),e.description&&h.jsx("p",{className:"text-xs text-text-muted mt-1 ml-5 line-clamp-2",children:e.description})]})}function QK({before:e,after:t}){var r,i;const n=[];return e.title!==t.title&&n.push("title"),e.description!==t.description&&n.push("description"),e.complexity!==t.complexity&&n.push("complexity"),e.type!==t.type&&n.push("type"),e.dynamicFields.length!==t.dynamicFields.length&&n.push("fields"),((r=e.branches)==null?void 0:r.length)!==((i=t.branches)==null?void 0:i.length)&&n.push("branches"),h.jsxs("div",{className:"p-2 rounded border bg-accent-yellow/10 border-accent-yellow/30",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(YM,{className:"w-3 h-3 text-accent-yellow"}),h.jsx("span",{className:"text-sm font-medium text-text-primary",children:t.title})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-5",children:[h.jsx("span",{className:"text-xs text-text-muted",children:"Changed:"}),n.map(s=>h.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-accent-yellow/20 rounded text-accent-yellow",children:s},s))]}),e.title!==t.title&&h.jsxs("div",{className:"flex items-center gap-2 mt-1 ml-5 text-xs text-text-muted",children:[h.jsx("span",{className:"line-through",children:e.title}),h.jsx($M,{className:"w-3 h-3"}),h.jsx("span",{className:"text-text-primary",children:t.title})]})]})}function rC({edge:e,type:t}){const n=t==="added"?"text-accent-green":"text-accent-red",r=t==="added"?h.jsx(Mt,{className:"w-3 h-3"}):h.jsx(sa,{className:"w-3 h-3"});return h.jsxs("div",{className:`flex items-center gap-2 text-xs ${n}`,children:[r,h.jsx("span",{children:e.from}),h.jsx($M,{className:"w-3 h-3"}),h.jsx("span",{children:e.to})]})}function ZK({onClose:e}){const{currentDiff:t,showDiffView:n,setShowDiffView:r,setCurrentDiff:i}=ri(),s=()=>{r(!1),i(null),e==null||e()};if(!n||!t)return null;const o=t.addedNodes.length+t.removedNodes.length+t.modifiedNodes.length+t.addedEdges.length+t.removedEdges.length;return h.jsx(Dn,{children:n&&h.jsxs(xe.div,{initial:{x:"-100%",opacity:0},animate:{x:0,opacity:1},exit:{x:"-100%",opacity:0},transition:{type:"spring",damping:25,stiffness:300},className:`
403
+ fixed left-0 top-14 bottom-0 w-80 z-40
404
+ bg-surface border-r border-border
405
+ flex flex-col
406
+ shadow-xl
407
+ `,children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[h.jsxs("h2",{className:"font-medium text-text-primary flex items-center gap-2",children:[h.jsx(qb,{className:"w-4 h-4"}),"Plan Changes",h.jsxs("span",{className:"text-xs text-text-muted",children:["(",o,")"]})]}),h.jsx("button",{onClick:s,className:"p-1 rounded hover:bg-surface-raised transition-colors",children:h.jsx(wr,{className:"w-4 h-4 text-text-muted"})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:o===0?h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[h.jsx(qb,{className:"w-12 h-12 text-text-muted/30 mb-3"}),h.jsx("p",{className:"text-sm text-text-muted",children:"No changes detected"})]}):h.jsxs(h.Fragment,{children:[h.jsx(lg,{title:"Added Nodes",icon:h.jsx(Mt,{className:"w-4 h-4"}),count:t.addedNodes.length,color:"text-accent-green",children:t.addedNodes.map(a=>h.jsx(nC,{node:a,type:"added"},a.id))}),h.jsx(lg,{title:"Removed Nodes",icon:h.jsx(sa,{className:"w-4 h-4"}),count:t.removedNodes.length,color:"text-accent-red",children:t.removedNodes.map(a=>h.jsx(nC,{node:a,type:"removed"},a.id))}),h.jsx(lg,{title:"Modified Nodes",icon:h.jsx(YM,{className:"w-4 h-4"}),count:t.modifiedNodes.length,color:"text-accent-yellow",children:t.modifiedNodes.map(({before:a,after:l})=>h.jsx(QK,{before:a,after:l},l.id))}),(t.addedEdges.length>0||t.removedEdges.length>0)&&h.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[h.jsx("h3",{className:"text-xs font-medium text-text-muted uppercase tracking-wider mb-2",children:"Connection Changes"}),t.addedEdges.length>0&&h.jsx("div",{className:"mb-2",children:t.addedEdges.map(a=>h.jsx(rC,{edge:a,type:"added"},a.id))}),t.removedEdges.length>0&&h.jsx("div",{children:t.removedEdges.map(a=>h.jsx(rC,{edge:a,type:"removed"},a.id))})]})]})}),h.jsxs("div",{className:"px-4 py-3 border-t border-border",children:[h.jsx("p",{className:"text-[10px] text-text-muted text-center mb-2",children:"Review changes before approving the updated plan"}),h.jsx("button",{onClick:s,className:"w-full py-2 px-4 bg-accent-blue text-white rounded-lg text-sm font-medium hover:bg-accent-blue/90 transition-colors",children:"Got it"})]})]})})}function JK(){const{plans:e,setSelectedNodeId:t,selectedNodeId:n}=Ae(),r=[...e].reverse().find(f=>f.plan.status==="ready");if(!r)return null;const{plan:i,nodes:s}=r,o=[];for(const f of s){for(const p of f.dynamicFields)p.required&&o.push({id:`${f.id}-field-${p.id}`,nodeId:f.id,nodeTitle:f.title,planId:i.id,type:"field",label:p.title,description:p.description,isComplete:!!p.value});f.type==="decision"&&f.branches&&f.branches.length>0&&o.push({id:`${f.id}-decision`,nodeId:f.id,nodeTitle:f.title,planId:i.id,type:"decision",label:f.title,description:`Choose from ${f.branches.length} options`,isComplete:!!f.selectedBranchId})}if(o.length===0)return null;const a=o.filter(f=>f.isComplete).length,l=o.length,u=a===l,c=a/l*100,d=(f,p)=>{t(f,p)};return h.jsx(xe.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},className:"fixed left-4 top-1/2 -translate-y-1/2 z-20 w-72",children:h.jsxs("div",{className:"bg-surface/95 backdrop-blur-md border border-border rounded-xl shadow-xl overflow-hidden",children:[h.jsxs("div",{className:"px-4 py-3 border-b border-border bg-surface-raised/50",children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("h3",{className:"text-sm font-semibold text-text-primary",children:"Requirements"}),h.jsxs("span",{className:fe("text-xs font-medium px-2 py-0.5 rounded-full",u?"bg-accent-green/20 text-accent-green":"bg-accent-yellow/20 text-accent-yellow"),children:[a,"/",l]})]}),h.jsx("div",{className:"h-1.5 bg-surface rounded-full overflow-hidden",children:h.jsx(xe.div,{className:fe("h-full rounded-full",u?"bg-accent-green":"bg-accent-blue"),initial:{width:0},animate:{width:`${c}%`},transition:{duration:.3}})})]}),h.jsx("div",{className:"max-h-80 overflow-y-auto",children:h.jsx(Dn,{mode:"popLayout",children:o.map((f,p)=>h.jsxs(xe.button,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,x:-20},transition:{delay:p*.03},onClick:()=>d(f.nodeId,f.planId),className:fe("w-full px-4 py-3 flex items-start gap-3 text-left","border-b border-border/50 last:border-b-0","hover:bg-surface-raised/50 transition-colors","focus:outline-none focus:bg-surface-raised/50",n===f.nodeId&&"bg-accent-blue/10"),children:[h.jsx("div",{className:"mt-0.5 flex-shrink-0",children:f.isComplete?h.jsx(ia,{className:"w-4 h-4 text-accent-green"}):h.jsx(HM,{className:"w-4 h-4 text-text-muted"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[f.type==="field"?h.jsx(G6,{className:"w-3 h-3 text-accent-blue flex-shrink-0"}):h.jsx(Iy,{className:"w-3 h-3 text-accent-purple flex-shrink-0"}),h.jsx("span",{className:fe("text-sm font-medium truncate",f.isComplete?"text-text-muted line-through":"text-text-primary"),children:f.label})]}),h.jsx("p",{className:"text-xs text-text-muted mt-0.5 truncate",children:f.nodeTitle})]}),h.jsx(Ay,{className:fe("w-4 h-4 flex-shrink-0 transition-colors",n===f.nodeId?"text-accent-blue":"text-text-muted")})]},f.id))})}),!u&&h.jsx("div",{className:"px-4 py-2 border-t border-border bg-surface-raised/30",children:h.jsx("p",{className:"text-[10px] text-text-muted text-center",children:"Click an item to open its details"})}),u&&h.jsx(xe.div,{initial:{opacity:0},animate:{opacity:1},className:"px-4 py-3 border-t border-border bg-accent-green/10",children:h.jsx("p",{className:"text-xs text-accent-green text-center font-medium",children:"All requirements complete! Ready to approve."})})]})})}function eX(){const{selectedNodeId:e,plans:t,canApprove:n}=Ae(),{approvePlan:r,pauseExecution:i,resumeExecution:s,loadPlan:o}=Jo(),a=[...t].reverse().find(l=>l.plan.status==="ready");return T.useEffect(()=>{const l=u=>{u.key==="Enter"&&a&&n(a.plan.id)&&(u.preventDefault(),r(a.plan.id)),u.key==="Escape"&&Ae.getState().setSelectedNodeId(null);const c=t.find(d=>d.plan.status==="executing"||d.plan.status==="paused");if(u.key===" "&&c){const d=u.target;d.tagName!=="INPUT"&&d.tagName!=="TEXTAREA"&&(u.preventDefault(),c.plan.status==="paused"?s(c.plan.id):i(c.plan.id))}};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[t,a,n,r,i,s]),h.jsxs("div",{className:"h-screen w-screen flex flex-col overflow-hidden bg-canvas",children:[h.jsx(wY,{}),h.jsxs("main",{className:"flex-1 relative",children:[h.jsx(sT,{children:h.jsx(yY,{})}),h.jsx(JK,{}),h.jsx(jY,{}),e&&h.jsx(PY,{}),h.jsx(XK,{onLoadPlan:o}),h.jsx(ZK,{})]}),h.jsx(bY,{}),h.jsx(AY,{})]})}ug.createRoot(document.getElementById("root")).render(h.jsx(pu.StrictMode,{children:h.jsx(eX,{})}));
408
+ //# sourceMappingURL=index-DwGNwSSY.js.map